diff --git a/.gitignore b/.gitignore index e9d2d99ec..f151b9c24 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,8 @@ src/*.s tools/* *.map *.ld +*.bat +*.dump *.sa* +Thumbs.db +.DS_Store diff --git a/Makefile b/Makefile index c18522379..221c54e24 100644 --- a/Makefile +++ b/Makefile @@ -93,7 +93,11 @@ $(C_OBJS): %.o : %.c @echo -e ".text\n\t.align\t2, 0\n" >> $*.s $(AS) $(ASFLAGS) -o $@ $*.s -%.o : dep = $(shell $(SCANINC) $*.s) +ifeq ($(NODEP),) +%.o: dep = $(shell $(SCANINC) $*.s) +else +%.o: dep := +endif $(ASM_OBJS): %.o: %.s $$(dep) $(AS) $(ASFLAGS) -o $@ $< diff --git a/asm/bard_music.s b/asm/bard_music.s new file mode 100644 index 000000000..0b622e1b4 --- /dev/null +++ b/asm/bard_music.s @@ -0,0 +1,130 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_817C7DC +sub_817C7DC: @ 817C7DC + ldr r2, =gUnknown_0860A320 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + lsls r1, 1 + adds r1, r0 + movs r2, 0 + ldrsh r0, [r1, r2] + bx lr + .pool + thumb_func_end sub_817C7DC + + thumb_func_start sub_817C7F4 +sub_817C7F4: @ 817C7F4 + push {r4,r5,lr} + lsls r4, r0, 16 + lsrs r5, r4, 16 + adds r0, r5, 0 + bl sub_811EB10 + lsls r0, 24 + cmp r0, 0 + beq _0817C810 + ldr r0, =gUnknown_0860A3AC + b _0817C84E + .pool +_0817C810: + lsrs r0, r4, 25 + ldr r2, =0x000001ff + ands r2, r5 + cmp r0, 0x13 + bhi _0817C828 + cmp r0, 0x12 + bcs _0817C834 + cmp r0, 0 + beq _0817C82C + b _0817C83C + .pool +_0817C828: + cmp r0, 0x15 + bne _0817C83C +_0817C82C: + ldr r1, =gUnknown_085F5494 + b _0817C844 + .pool +_0817C834: + ldr r1, =gUnknown_085FA1D8 + b _0817C844 + .pool +_0817C83C: + ldr r1, =gUnknown_0860A168 + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] +_0817C844: + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 4 + adds r1, r0 + adds r0, r1, 0 +_0817C84E: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_817C7F4 + + thumb_func_start sub_817C858 +sub_817C858: @ 817C858 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + lsls r1, 16 + lsrs r7, r1, 16 + movs r0, 0 + strh r0, [r5, 0x4] + movs r6, 0 + ldr r0, =gUnknown_0860A3DC + mov r8, r0 + adds r4, r5, 0 + adds r4, 0x18 +_0817C872: + lsls r0, r6, 3 + ldr r1, [r5, 0x30] + adds r2, r1, r0 + ldrb r0, [r2] + cmp r0, 0xFF + beq _0817C8A0 + movs r1, 0x1 + ldrsb r1, [r2, r1] + lsls r0, 2 + add r0, r8 + ldr r0, [r0] + adds r1, r0 + strh r1, [r4] + adds r0, r7, 0 + adds r0, 0x1E + adds r1, r6, 0 + bl sub_817C7DC + strh r0, [r4, 0x2] + ldrh r0, [r4] + ldrh r1, [r5, 0x4] + adds r0, r1 + strh r0, [r5, 0x4] +_0817C8A0: + adds r4, 0x4 + adds r6, 0x1 + cmp r6, 0x5 + ble _0817C872 + movs r0, 0 + strb r0, [r5, 0x1] + strh r0, [r5, 0xA] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C858 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/battle_814AEAC.s b/asm/battle_814AEAC.s index 2474ba2eb..67f8052b5 100644 --- a/asm/battle_814AEAC.s +++ b/asm/battle_814AEAC.s @@ -27,7 +27,7 @@ sub_814AEB0: @ 814AEB0 bx_exec_buffer_A_ch0_tbl4: @ 814AECC push {lr} ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r3, [r0] lsls r0, r3, 2 @@ -176,7 +176,7 @@ sub_814B004: @ 814B004 lsls r0, 24 cmp r0, 0 beq _0814B05C - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -352,7 +352,7 @@ _0814B136: lsls r0, 24 cmp r0, 0 beq _0814B1F0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -380,7 +380,7 @@ _0814B136: ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @@ -416,7 +416,7 @@ _0814B1F0: ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @@ -520,7 +520,7 @@ _0814B318: ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 bl sub_805E990 bl dp01_tbl4_exec_completed @@ -557,10 +557,10 @@ sub_814B340: @ 814B340 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 bl nullsub_24 @@ -854,7 +854,7 @@ sub_814B5A8: @ 814B5A8 ldrh r0, [r0] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5 bl sub_805E990 ldr r1, =gUnknown_020241E4 @@ -922,7 +922,7 @@ sub_814B69C: @ 814B69C ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @@ -979,7 +979,7 @@ dp01_tbl4_exec_completed: @ 814B740 adds r0, r1 ldr r1, =bx_exec_buffer_A_ch0_tbl4 str r1, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -1002,7 +1002,7 @@ dp01_tbl4_exec_completed: @ 814B740 .pool _0814B794: ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r1 @@ -1216,16 +1216,16 @@ _0814B9BC: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1] adds r0, r4, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x2E] movs r6, 0 @@ -1253,12 +1253,12 @@ _0814BA08: adds r1, r6, 0 adds r1, 0xD mov r0, r8 - bl pokemon_getattr + bl GetMonData strh r0, [r4] adds r1, r6, 0 adds r1, 0x11 mov r0, r8 - bl pokemon_getattr + bl GetMonData mov r2, r9 adds r1, r2, r6 strb r0, [r1] @@ -1269,25 +1269,25 @@ _0814BA08: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData mov r1, r10 strb r0, [r1] adds r0, r4, 0 movs r1, 0x20 - bl pokemon_getattr + bl GetMonData ldr r2, [sp, 0x80] strb r0, [r2] adds r0, r4, 0 movs r1, 0x19 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x44] adds r0, r4, 0 movs r1, 0x27 - bl pokemon_getattr + bl GetMonData mov r3, sp movs r5, 0x1F ands r0, r5 @@ -1299,7 +1299,7 @@ _0814BA08: strb r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x28 - bl pokemon_getattr + bl GetMonData mov r3, sp movs r6, 0x1F ands r0, r6 @@ -1311,7 +1311,7 @@ _0814BA08: strh r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x29 - bl pokemon_getattr + bl GetMonData mov r3, sp ands r0, r5 lsls r0, 2 @@ -1323,7 +1323,7 @@ _0814BA08: strb r1, [r3, 0x15] adds r0, r4, 0 movs r1, 0x2A - bl pokemon_getattr + bl GetMonData movs r1, 0x1F ands r1, r0 lsls r1, 15 @@ -1334,7 +1334,7 @@ _0814BA08: str r0, [sp, 0x14] adds r0, r4, 0 movs r1, 0x2B - bl pokemon_getattr + bl GetMonData mov r3, sp ands r0, r6 lsls r0, 4 @@ -1345,7 +1345,7 @@ _0814BA08: strh r1, [r3, 0x16] adds r0, r4, 0 movs r1, 0x2C - bl pokemon_getattr + bl GetMonData mov r3, sp ands r0, r5 lsls r0, 1 @@ -1357,55 +1357,55 @@ _0814BA08: strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x48] adds r0, r4, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x4C] adds r0, r4, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData ldr r1, [sp, 0x7C] strb r0, [r1] adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x28] adds r0, r4, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x2C] adds r0, r4, 0 movs r1, 0x3B - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x2] adds r0, r4, 0 movs r1, 0x3C - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x4] adds r0, r4, 0 movs r1, 0x3D - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x6] adds r0, r4, 0 movs r1, 0x3E - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x8] adds r0, r4, 0 movs r1, 0x3F - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0xA] adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData mov r3, sp movs r1, 0x1 ands r0, r1 @@ -1418,7 +1418,7 @@ _0814BA08: strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x2E - bl pokemon_getattr + bl GetMonData mov r3, sp lsls r0, 7 ldrb r2, [r3, 0x17] @@ -1428,19 +1428,19 @@ _0814BA08: strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x54] adds r0, r4, 0 movs r1, 0x2 ldr r2, [sp, 0x8C] - bl pokemon_getattr + bl GetMonData ldr r0, [sp, 0x84] ldr r1, [sp, 0x8C] - bl CopyString_Limit10 + bl StringCopy10 adds r0, r4, 0 movs r1, 0x7 ldr r2, [sp, 0x88] - bl pokemon_getattr + bl GetMonData mov r2, sp movs r6, 0 _0814BBC0: @@ -1456,7 +1456,7 @@ _0814BBC0: _0814BBE0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB b _0814BF5A @@ -1464,7 +1464,7 @@ _0814BBE0: _0814BBF0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xC b _0814BF5A @@ -1478,20 +1478,20 @@ _0814BC00: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 mov r8, r9 _0814BC16: adds r1, r6, 0 adds r1, 0xD adds r0, r4, 0 - bl pokemon_getattr + bl GetMonData mov r1, r8 strh r0, [r1] adds r1, r6, 0 adds r1, 0x11 adds r0, r4, 0 - bl pokemon_getattr + bl GetMonData mov r2, r10 adds r1, r2, r6 strb r0, [r1] @@ -1502,10 +1502,10 @@ _0814BC16: ble _0814BC16 movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData mov r1, r9 strb r0, [r1, 0xC] mov r2, r9 @@ -1523,7 +1523,7 @@ _0814BC54: _0814BC68: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldrb r1, [r3] lsls r1, 9 @@ -1538,14 +1538,14 @@ _0814BC84: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty mov r8, r2 _0814BC90: adds r1, r6, 0 adds r1, 0x11 mov r2, r8 adds r0, r4, r2 - bl pokemon_getattr + bl GetMonData adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 @@ -1553,10 +1553,10 @@ _0814BC90: ble _0814BC90 movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 @@ -1565,7 +1565,7 @@ _0814BC90: _0814BCC0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldrb r1, [r3] lsls r1, 9 @@ -1578,7 +1578,7 @@ _0814BCC0: _0814BCDC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1 b _0814BCF6 @@ -1586,11 +1586,11 @@ _0814BCDC: _0814BCEC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x19 _0814BCF6: - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 strb r1, [r7] movs r0, 0xFF @@ -1609,7 +1609,7 @@ _0814BCF6: _0814BD1C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1A b _0814C01A @@ -1617,7 +1617,7 @@ _0814BD1C: _0814BD2C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1B b _0814C01A @@ -1625,7 +1625,7 @@ _0814BD2C: _0814BD3C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1C b _0814C01A @@ -1633,7 +1633,7 @@ _0814BD3C: _0814BD4C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1D b _0814C01A @@ -1641,7 +1641,7 @@ _0814BD4C: _0814BD5C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1E b _0814C01A @@ -1649,7 +1649,7 @@ _0814BD5C: _0814BD6C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1F b _0814C01A @@ -1657,7 +1657,7 @@ _0814BD6C: _0814BD7C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x20 b _0814C01A @@ -1665,7 +1665,7 @@ _0814BD7C: _0814BD8C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x22 b _0814C01A @@ -1673,7 +1673,7 @@ _0814BD8C: _0814BD9C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x23 b _0814C01A @@ -1681,7 +1681,7 @@ _0814BD9C: _0814BDAC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x24 b _0814C01A @@ -1689,7 +1689,7 @@ _0814BDAC: _0814BDBC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x25 b _0814C01A @@ -1697,7 +1697,7 @@ _0814BDBC: _0814BDCC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x26 b _0814C01A @@ -1706,31 +1706,31 @@ _0814BDDC: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x27 - bl pokemon_getattr + bl GetMonData strb r0, [r7] adds r0, r4, 0 movs r1, 0x28 - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x1] adds r0, r4, 0 movs r1, 0x29 - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x2] adds r0, r4, 0 movs r1, 0x2A - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x3] adds r0, r4, 0 movs r1, 0x2B - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x4] adds r0, r4, 0 movs r1, 0x2C - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x5] movs r6, 0x6 b _0814C022 @@ -1738,7 +1738,7 @@ _0814BDDC: _0814BE2C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x27 b _0814C01A @@ -1746,7 +1746,7 @@ _0814BE2C: _0814BE3C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x28 b _0814C01A @@ -1754,7 +1754,7 @@ _0814BE3C: _0814BE4C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x29 b _0814C01A @@ -1762,7 +1762,7 @@ _0814BE4C: _0814BE5C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2A b _0814C01A @@ -1770,7 +1770,7 @@ _0814BE5C: _0814BE6C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2B b _0814C01A @@ -1778,7 +1778,7 @@ _0814BE6C: _0814BE7C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2C b _0814C01A @@ -1786,7 +1786,7 @@ _0814BE7C: _0814BE8C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0 b _0814BEB6 @@ -1794,7 +1794,7 @@ _0814BE8C: _0814BE9C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x9 b _0814BF5A @@ -1802,11 +1802,11 @@ _0814BE9C: _0814BEAC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x37 _0814BEB6: - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 strb r1, [r7] movs r0, 0xFF @@ -1827,7 +1827,7 @@ _0814BEB6: _0814BEE0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x38 b _0814C01A @@ -1835,7 +1835,7 @@ _0814BEE0: _0814BEF0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x39 b _0814BF5A @@ -1843,7 +1843,7 @@ _0814BEF0: _0814BF00: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3A b _0814BF5A @@ -1851,7 +1851,7 @@ _0814BF00: _0814BF10: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3B b _0814BF5A @@ -1859,7 +1859,7 @@ _0814BF10: _0814BF20: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3C b _0814BF5A @@ -1867,7 +1867,7 @@ _0814BF20: _0814BF30: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3D b _0814BF5A @@ -1875,7 +1875,7 @@ _0814BF30: _0814BF40: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3E b _0814BF5A @@ -1883,11 +1883,11 @@ _0814BF40: _0814BF50: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3F _0814BF5A: - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 strb r0, [r7] @@ -1899,7 +1899,7 @@ _0814BF5A: _0814BF70: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x16 b _0814C01A @@ -1907,7 +1907,7 @@ _0814BF70: _0814BF80: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x17 b _0814C01A @@ -1915,7 +1915,7 @@ _0814BF80: _0814BF90: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x18 b _0814C01A @@ -1923,7 +1923,7 @@ _0814BF90: _0814BFA0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x21 b _0814C01A @@ -1931,7 +1931,7 @@ _0814BFA0: _0814BFB0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2F b _0814C01A @@ -1939,7 +1939,7 @@ _0814BFB0: _0814BFC0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x30 b _0814C01A @@ -1947,7 +1947,7 @@ _0814BFC0: _0814BFD0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x32 b _0814C01A @@ -1955,7 +1955,7 @@ _0814BFD0: _0814BFE0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x33 b _0814C01A @@ -1963,7 +1963,7 @@ _0814BFE0: _0814BFF0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x34 b _0814C01A @@ -1971,7 +1971,7 @@ _0814BFF0: _0814C000: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x35 b _0814C01A @@ -1979,11 +1979,11 @@ _0814C000: _0814C010: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x36 _0814C01A: - bl pokemon_getattr + bl GetMonData strb r0, [r7] movs r6, 0x1 _0814C022: @@ -2146,7 +2146,7 @@ _0814C1D0: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0xB @@ -2213,7 +2213,7 @@ _0814C236: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x15 @@ -2326,7 +2326,7 @@ _0814C236: _0814C368: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2339,7 +2339,7 @@ _0814C368: _0814C388: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2358,7 +2358,7 @@ _0814C3A8: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r7, r1, r0 adds r6, r3, 0 adds r6, 0x8 @@ -2383,7 +2383,7 @@ _0814C3C2: ble _0814C3C2 movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x15 mov r2, r9 @@ -2393,7 +2393,7 @@ _0814C3C2: _0814C400: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r3, =gUnknown_02023064 ldr r1, =gUnknown_02024064 @@ -2409,7 +2409,7 @@ _0814C428: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 ldr r5, =gUnknown_02024064 ldrb r2, [r5] @@ -2451,7 +2451,7 @@ _0814C428: _0814C48C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r3, =gUnknown_02023064 ldr r1, =gUnknown_02024064 @@ -2470,7 +2470,7 @@ _0814C4A4: _0814C4BC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2483,7 +2483,7 @@ _0814C4BC: _0814C4DC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2496,7 +2496,7 @@ _0814C4DC: _0814C4FC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2509,7 +2509,7 @@ _0814C4FC: _0814C51C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2522,7 +2522,7 @@ _0814C51C: _0814C53C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2535,7 +2535,7 @@ _0814C53C: _0814C55C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2548,7 +2548,7 @@ _0814C55C: _0814C57C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2561,7 +2561,7 @@ _0814C57C: _0814C59C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2574,7 +2574,7 @@ _0814C59C: _0814C5BC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2587,7 +2587,7 @@ _0814C5BC: _0814C5DC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2600,7 +2600,7 @@ _0814C5DC: _0814C5FC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2613,7 +2613,7 @@ _0814C5FC: _0814C61C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2626,7 +2626,7 @@ _0814C61C: _0814C63C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2639,7 +2639,7 @@ _0814C63C: _0814C65C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2653,7 +2653,7 @@ _0814C67C: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 ldr r5, =gUnknown_02024064 ldrb r2, [r5] @@ -2700,7 +2700,7 @@ _0814C67C: _0814C6EC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2713,7 +2713,7 @@ _0814C6EC: _0814C70C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2726,7 +2726,7 @@ _0814C70C: _0814C72C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2739,7 +2739,7 @@ _0814C72C: _0814C74C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2752,7 +2752,7 @@ _0814C74C: _0814C76C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2765,7 +2765,7 @@ _0814C76C: _0814C78C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2779,7 +2779,7 @@ _0814C79C: _0814C7AC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2792,7 +2792,7 @@ _0814C7AC: _0814C7CC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2805,7 +2805,7 @@ _0814C7CC: _0814C7EC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2818,7 +2818,7 @@ _0814C7EC: _0814C80C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2831,7 +2831,7 @@ _0814C80C: _0814C82C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2844,7 +2844,7 @@ _0814C82C: _0814C84C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2857,7 +2857,7 @@ _0814C84C: _0814C86C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2870,7 +2870,7 @@ _0814C86C: _0814C88C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2883,7 +2883,7 @@ _0814C88C: _0814C8AC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2896,7 +2896,7 @@ _0814C8AC: _0814C8CC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2909,7 +2909,7 @@ _0814C8CC: _0814C8EC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2922,7 +2922,7 @@ _0814C8EC: _0814C90C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2935,7 +2935,7 @@ _0814C90C: _0814C92C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2948,7 +2948,7 @@ _0814C92C: _0814C94C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2961,7 +2961,7 @@ _0814C94C: _0814C96C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2974,7 +2974,7 @@ _0814C96C: _0814C98C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2987,7 +2987,7 @@ _0814C98C: _0814C9AC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3000,7 +3000,7 @@ _0814C9AC: _0814C9CC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3013,7 +3013,7 @@ _0814C9CC: _0814C9EC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3026,7 +3026,7 @@ _0814C9EC: _0814CA0C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3039,7 +3039,7 @@ _0814CA0C: _0814CA2C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3052,7 +3052,7 @@ _0814CA2C: _0814CA4C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3069,7 +3069,7 @@ _0814CA62: ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 bl sub_805E990 add sp, 0x34 @@ -3100,7 +3100,7 @@ sub_814CA98: @ 814CA98 adds r0, r4, 0x1 adds r0, r2, r0 ldrb r0, [r0] - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 adds r5, r3, r0 movs r3, 0 @@ -3152,7 +3152,7 @@ sub_814CB0C: @ 814CB0C ldrh r0, [r0] movs r5, 0x64 muls r0, r5 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 bl sub_805DD7C ldrb r0, [r6] @@ -3162,7 +3162,7 @@ sub_814CB0C: @ 814CB0C muls r0, r5 adds r0, r4 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 @@ -3281,7 +3281,7 @@ sub_814CC28: @ 814CC28 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 bl sub_805DD7C ldrb r0, [r5] @@ -3327,16 +3327,16 @@ sub_814CC98: @ 814CC98 ldrh r1, [r2] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData mov r8, r0 lsls r0, 16 lsrs r0, 16 mov r8, r0 ldr r0, =sub_805D714 - bl object_new_hidden_with_callback + bl CreateInvisibleSpriteWithCallback ldr r1, =gUnknown_03005D7C mov r9, r1 add r9, r6 @@ -3598,7 +3598,7 @@ sub_814CF30: @ 814CF30 push {r4-r7,lr} mov r7, r8 push {r7} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -3923,7 +3923,7 @@ _0814D1F0: ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 bl sub_805E990 movs r1, 0x40 @@ -4458,10 +4458,10 @@ sub_814D63C: @ 814D63C ldrh r0, [r0] movs r5, 0x64 muls r0, r5 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData mov r8, r0 mov r1, r9 ldrb r0, [r1] @@ -4471,7 +4471,7 @@ sub_814D63C: @ 814D63C muls r0, r5 adds r0, r4 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r3, r0, 0 mov r1, r9 ldrb r0, [r1] @@ -4490,10 +4490,10 @@ _0814D6CC: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData adds r2, r0, 0 mov r1, r9 ldrb r0, [r1] @@ -4548,7 +4548,7 @@ sub_814D738: @ 814D738 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 movs r2, 0x9 bl healthbar_draw_field_maybe @@ -4916,10 +4916,10 @@ sub_814DA34: @ 814DA34 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 movs r1, 0x19 @@ -5221,7 +5221,7 @@ _0814DCF8: lsls r0, 24 cmp r0, 0 beq _0814DD18 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -5274,7 +5274,7 @@ _0814DD48: ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 bl sub_805DD7C ldrb r0, [r7] @@ -5604,7 +5604,7 @@ sub_814E040: @ 814E040 adds r0, r1 ldrb r0, [r0] strb r0, [r2] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] ldrb r0, [r5] lsls r0, 9 diff --git a/asm/battle_ai.s b/asm/battle_ai.s deleted file mode 100644 index 0c59e12d7..000000000 --- a/asm/battle_ai.s +++ /dev/null @@ -1,6204 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_81308C8 -sub_81308C8: @ 81308C8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =gUnknown_020244A8 - ldr r0, [r1] - ldr r3, [r0, 0x18] - movs r4, 0 - mov r12, r1 - ldr r2, =gUnknown_02022FEC - movs r1, 0 -_081308DC: - adds r0, r3, r4 - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x53 - bls _081308DC - ldr r0, [r2] - ldr r1, =0x0a7f098a - ands r0, r1 - cmp r0, 0x8 - bne _0813092E - movs r4, 0 - ldr r6, =gUnknown_02038BCA - ldr r5, =gTrainers + 0x10 @ items offset -_081308F6: - lsls r2, r4, 1 - ldrh r1, [r6] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r2, r0 - adds r2, r5 - ldrh r3, [r2] - cmp r3, 0 - beq _08130928 - mov r0, r12 - ldr r2, [r0] - ldr r1, [r2, 0x18] - adds r0, r1, 0 - adds r0, 0x50 - ldrb r0, [r0] - lsls r0, 1 - adds r1, 0x48 - adds r1, r0 - strh r3, [r1] - ldr r1, [r2, 0x18] - adds r1, 0x50 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_08130928: - adds r4, 0x1 - cmp r4, 0x3 - ble _081308F6 -_0813092E: - adds r0, r7, 0 - bl sub_8130950 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81308C8 - - thumb_func_start sub_8130950 -sub_8130950: @ 8130950 - push {r4-r7,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r4, 0 - ldr r6, =gUnknown_02024064 - movs r3, 0 -_08130962: - adds r0, r1, r4 - strb r3, [r0] - adds r4, 0x1 - cmp r4, 0x1B - bls _08130962 - movs r4, 0 - ldr r3, =gUnknown_020244A8 - movs r5, 0x1 -_08130972: - adds r1, r2, 0 - ands r1, r5 - cmp r1, 0 - beq _08130990 - ldr r0, [r3] - ldr r0, [r0, 0x14] - adds r0, 0x4 - adds r0, r4 - movs r1, 0x64 - b _08130998 - .pool -_08130990: - ldr r0, [r3] - ldr r0, [r0, 0x14] - adds r0, 0x4 - adds r0, r4 -_08130998: - strb r1, [r0] - lsrs r2, 1 - adds r4, 0x1 - cmp r4, 0x3 - ble _08130972 - ldrb r0, [r6] - movs r1, 0 - movs r2, 0xFF - bl sub_803FECC - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0 - ldr r5, =gUnknown_020244A8 -_081309B4: - ldr r7, =gUnknown_0832A328 - lsls r0, r4, 2 - adds r0, r7 - ldr r0, [r0] - ands r0, r6 - cmp r0, 0 - beq _081309CE - ldr r0, [r5] - ldr r0, [r0, 0x14] - adds r0, 0x4 - adds r0, r4 - movs r1, 0 - strb r1, [r0] -_081309CE: - bl GenerateRandomNumber - ldr r1, [r5] - ldr r2, [r1, 0x14] - adds r2, 0x18 - adds r2, r4 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF - ands r0, r1 - movs r1, 0x64 - subs r1, r0 - strb r1, [r2] - adds r4, 0x1 - cmp r4, 0x3 - ble _081309B4 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r0, [r0, 0x1C] - adds r0, 0x20 - movs r1, 0 - strb r1, [r0] - ldr r0, =gUnknown_0203AB3C - ldr r6, =gUnknown_02024064 - ldrb r2, [r6] - strb r2, [r0] - ldr r0, =gUnknown_02022FEC - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08130A60 - ldr r5, =gUnknown_0202420C - bl GenerateRandomNumber - adds r4, r0, 0 - ldrb r0, [r6] - bl battle_side_get_owner - movs r3, 0x2 - adds r1, r3, 0 - ands r1, r4 - movs r2, 0x1 - eors r0, r2 - adds r1, r0 - strb r1, [r5] - ldr r0, =gUnknown_02024210 - ldrb r1, [r0] - ldrb r2, [r5] - lsls r0, r2, 2 - adds r0, r7 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08130A68 - eors r2, r3 - strb r2, [r5] - b _08130A68 - .pool -_08130A60: - ldr r0, =gUnknown_0202420C - movs r1, 0x1 - eors r1, r2 - strb r1, [r0] -_08130A68: - ldr r0, =gUnknown_02022FEC - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - beq _08130A84 - bl sub_8186438 - b _08130AE6 - .pool -_08130A84: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08130AA0 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0x80 - lsls r0, 23 - str r0, [r1, 0xC] - b _08130B72 - .pool -_08130AA0: - movs r0, 0x80 - lsls r0, 3 - ands r0, r1 - cmp r0, 0 - beq _08130ABC - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0x80 - lsls r0, 22 - str r0, [r1, 0xC] - b _08130B72 - .pool -_08130ABC: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08130AD8 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0x80 - lsls r0, 24 - str r0, [r1, 0xC] - b _08130B72 - .pool -_08130AD8: - movs r0, 0x80 - lsls r0, 12 - ands r0, r1 - cmp r0, 0 - beq _08130AF4 - bl sub_81A6FB4 -_08130AE6: - ldr r1, =gUnknown_020244A8 - ldr r1, [r1] - ldr r1, [r1, 0x14] - str r0, [r1, 0xC] - b _08130B72 - .pool -_08130AF4: - ldr r0, =0x0c3f0900 - ands r0, r1 - cmp r0, 0 - beq _08130B10 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0x7 - str r0, [r1, 0xC] - b _08130B72 - .pool -_08130B10: - movs r0, 0x80 - lsls r0, 8 - ands r1, r0 - cmp r1, 0 - beq _08130B58 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r4, [r0, 0x14] - ldr r3, =gTrainers - ldr r0, =gUnknown_02038BCA - ldrh r0, [r0] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r3, 0x1C - adds r1, r3 - ldr r0, =gUnknown_02038BCC - ldrh r2, [r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r3 - ldr r1, [r1] - ldr r0, [r0] - orrs r1, r0 - str r1, [r4, 0xC] - b _08130B72 - .pool -_08130B58: - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r3, [r0, 0x14] - ldr r2, =gTrainers - ldr r0, =gUnknown_02038BCA - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r2, 0x1C - adds r0, r2 - ldr r0, [r0] - str r0, [r3, 0xC] -_08130B72: - ldr r0, =gUnknown_02022FEC - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08130B8C - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldr r0, [r2, 0xC] - movs r1, 0x80 - orrs r0, r1 - str r0, [r2, 0xC] -_08130B8C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8130950 - - thumb_func_start sub_8130BA4 -sub_8130BA4: @ 8130BA4 - push {r4,lr} - ldr r0, =gUnknown_020241EA - ldrh r4, [r0] - ldr r0, =gUnknown_02022FEC - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08130BC4 - bl sub_8130BDC - b _08130BC8 - .pool -_08130BC4: - bl sub_8130CF4 -_08130BC8: - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, =gUnknown_020241EA - strh r4, [r0] - adds r0, r1, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8130BA4 - - thumb_func_start sub_8130BDC -sub_8130BDC: @ 8130BDC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - bl sub_8131074 - ldr r1, =gUnknown_020244A8 - ldr r0, [r1] - ldr r0, [r0, 0x14] - ldr r0, [r0, 0xC] - cmp r0, 0 - beq _08130C2C - adds r4, r1, 0 - movs r5, 0 -_08130BF8: - ldr r0, [r4] - ldr r2, [r0, 0x14] - ldr r0, [r2, 0xC] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08130C0C - strb r5, [r2] - bl tai_run_script -_08130C0C: - ldr r0, [r4] - ldr r1, [r0, 0x14] - ldr r0, [r1, 0xC] - lsrs r0, 1 - str r0, [r1, 0xC] - ldrb r0, [r1, 0x11] - adds r0, 0x1 - strb r0, [r1, 0x11] - ldr r0, [r4] - ldr r0, [r0, 0x14] - strb r5, [r0, 0x1] - ldr r0, [r4] - ldr r0, [r0, 0x14] - ldr r0, [r0, 0xC] - cmp r0, 0 - bne _08130BF8 -_08130C2C: - ldr r1, =gUnknown_020244A8 - ldr r0, [r1] - ldr r3, [r0, 0x14] - ldrb r2, [r3, 0x10] - movs r0, 0x2 - ands r0, r2 - mov r12, r1 - cmp r0, 0 - beq _08130C48 - movs r0, 0x4 - b _08130CE0 - .pool -_08130C48: - movs r0, 0x4 - ands r0, r2 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _08130C58 - movs r0, 0x5 - b _08130CE0 -_08130C58: - movs r6, 0x1 - mov r1, sp - ldrb r0, [r3, 0x4] - strb r0, [r1] - add r0, sp, 0x4 - strb r2, [r0] - movs r3, 0x1 - mov r8, r0 - ldr r1, =gUnknown_02024084 - ldr r0, =gUnknown_0203AB3C - ldrb r2, [r0] - mov r5, sp - mov r7, r8 - movs r0, 0x58 - muls r0, r2 - adds r1, r0 - adds r4, r1, 0 - adds r4, 0xE -_08130C7C: - ldrh r0, [r4] - cmp r0, 0 - beq _08130CC6 - ldrb r1, [r5] - mov r2, r12 - ldr r0, [r2] - ldr r0, [r0, 0x14] - adds r0, 0x4 - adds r2, r0, r3 - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r1, r0 - bne _08130CAA - mov r0, sp - adds r1, r0, r6 - ldrb r0, [r2] - strb r0, [r1] - adds r1, r6, 0 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r1, r7, r1 - strb r3, [r1] -_08130CAA: - ldrb r1, [r5] - mov r2, r12 - ldr r0, [r2] - ldr r0, [r0, 0x14] - adds r0, 0x4 - adds r2, r0, r3 - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r1, r0 - bge _08130CC6 - movs r6, 0x1 - ldrb r0, [r2] - strb r0, [r5] - strb r3, [r7] -_08130CC6: - adds r4, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - ble _08130C7C - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __modsi3 - add r0, r8 - ldrb r0, [r0] -_08130CE0: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8130BDC - - thumb_func_start sub_8130CF4 -sub_8130CF4: @ 8130CF4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - movs r0, 0 - mov r8, r0 - mov r1, sp - adds r1, 0xC - str r1, [sp, 0x1C] - mov r2, sp - adds r2, 0x8 - str r2, [sp, 0x18] - str r1, [sp, 0x20] - mov r10, sp -_08130D14: - ldr r0, =gUnknown_0203AB3C - ldrb r0, [r0] - cmp r8, r0 - beq _08130D2E - movs r0, 0x58 - mov r7, r8 - muls r7, r0 - adds r0, r7, 0 - ldr r1, =gUnknown_02024084 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08130D48 -_08130D2E: - movs r0, 0xFF - ldr r2, [sp, 0x20] - strb r0, [r2] - ldr r0, =0x0000ffff - mov r7, r10 - strh r0, [r7] - b _08130EAE - .pool -_08130D48: - ldr r0, =gUnknown_02022FEC - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - beq _08130D70 - ldr r0, =gUnknown_0202449C - ldr r0, [r0] - adds r0, 0x92 - ldrb r0, [r0] - lsrs r0, 4 - bl sub_8130950 - b _08130D76 - .pool -_08130D70: - movs r0, 0xF - bl sub_8130950 -_08130D76: - ldr r0, =gUnknown_0202420C - mov r1, r8 - strb r1, [r0] - movs r1, 0x1 - mov r2, r8 - ands r2, r1 - ldr r0, =gUnknown_0203AB3C - ldrb r0, [r0] - ands r1, r0 - cmp r2, r1 - beq _08130D90 - bl sub_8131074 -_08130D90: - ldr r2, =gUnknown_020244A8 - ldr r0, [r2] - ldr r0, [r0, 0x14] - movs r1, 0 - strb r1, [r0, 0x11] - ldr r0, [r2] - ldr r0, [r0, 0x14] - strb r1, [r0, 0x1] - ldr r0, [r2] - ldr r0, [r0, 0x14] - ldr r4, [r0, 0xC] - mov r9, r2 - cmp r4, 0 - beq _08130DD8 - mov r5, r9 - movs r6, 0 -_08130DB0: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _08130DC2 - ldr r0, [r5] - ldr r0, [r0, 0x14] - strb r6, [r0] - bl tai_run_script -_08130DC2: - asrs r4, 1 - ldr r0, [r5] - ldr r1, [r0, 0x14] - ldrb r0, [r1, 0x11] - adds r0, 0x1 - strb r0, [r1, 0x11] - ldr r0, [r5] - ldr r0, [r0, 0x14] - strb r6, [r0, 0x1] - cmp r4, 0 - bne _08130DB0 -_08130DD8: - mov r2, r9 - ldr r0, [r2] - ldr r3, [r0, 0x14] - ldrb r1, [r3, 0x10] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08130DFC - movs r0, 0x4 - ldr r7, [sp, 0x20] - strb r0, [r7] - b _08130EAE - .pool -_08130DFC: - movs r0, 0x4 - ands r0, r1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _08130E10 - movs r0, 0x5 - ldr r1, [sp, 0x20] - strb r0, [r1] - b _08130EAE -_08130E10: - add r1, sp, 0x10 - ldrb r0, [r3, 0x4] - strb r0, [r1] - add r0, sp, 0x14 - strb r2, [r0] - movs r5, 0x1 - movs r3, 0x1 - adds r6, r1, 0 - ldr r0, =gUnknown_0203AB3C - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - ldr r2, =gUnknown_02024090 - adds r0, r2 - adds r4, r0, 0x2 - add r7, sp, 0x14 -_08130E30: - ldrh r0, [r4] - cmp r0, 0 - beq _08130E72 - ldrb r1, [r6] - mov r2, r9 - ldr r0, [r2] - ldr r0, [r0, 0x14] - adds r0, 0x4 - adds r2, r0, r3 - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r1, r0 - bne _08130E56 - adds r0, r6, r5 - ldrb r1, [r2] - strb r1, [r0] - adds r0, r7, r5 - strb r3, [r0] - adds r5, 0x1 -_08130E56: - ldrb r1, [r6] - mov r2, r9 - ldr r0, [r2] - ldr r0, [r0, 0x14] - adds r0, 0x4 - adds r2, r0, r3 - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r1, r0 - bge _08130E72 - ldrb r0, [r2] - strb r0, [r6] - strb r3, [r7] - movs r5, 0x1 -_08130E72: - adds r4, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - ble _08130E30 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl __modsi3 - add r0, sp - adds r0, 0x14 - ldrb r0, [r0] - ldr r7, [sp, 0x20] - strb r0, [r7] - ldrb r2, [r6] - mov r0, r10 - strh r2, [r0] - ldr r0, =gUnknown_0203AB3C - ldrb r1, [r0] - movs r0, 0x2 - eors r0, r1 - cmp r8, r0 - bne _08130EAE - cmp r2, 0x63 - bgt _08130EAE - ldr r0, =0x0000ffff - mov r1, r10 - strh r0, [r1] -_08130EAE: - ldr r2, [sp, 0x20] - adds r2, 0x1 - str r2, [sp, 0x20] - movs r7, 0x2 - add r10, r7 - movs r0, 0x1 - add r8, r0 - mov r1, r8 - cmp r1, 0x3 - bgt _08130EC4 - b _08130D14 -_08130EC4: - mov r0, sp - ldrh r5, [r0] - movs r0, 0 - ldr r2, [sp, 0x18] - strb r0, [r2] - movs r4, 0x1 - mov r8, r4 - ldr r6, =gUnknown_0202420C - ldr r3, [sp, 0x18] - mov r1, sp - adds r1, 0x2 -_08130EDA: - lsls r0, r5, 16 - asrs r2, r0, 16 - movs r7, 0 - ldrsh r0, [r1, r7] - cmp r2, r0 - bne _08130EEE - adds r0, r3, r4 - mov r7, r8 - strb r7, [r0] - adds r4, 0x1 -_08130EEE: - movs r7, 0 - ldrsh r0, [r1, r7] - cmp r2, r0 - bge _08130EFE - ldrh r5, [r1] - mov r0, r8 - strb r0, [r3] - movs r4, 0x1 -_08130EFE: - adds r1, 0x2 - movs r2, 0x1 - add r8, r2 - mov r7, r8 - cmp r7, 0x3 - ble _08130EDA - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __modsi3 - ldr r1, [sp, 0x18] - adds r0, r1, r0 - ldrb r0, [r0] - strb r0, [r6] - ldrb r0, [r6] - ldr r2, [sp, 0x1C] - adds r0, r2, r0 - ldrb r0, [r0] - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8130CF4 - - thumb_func_start tai_run_script -tai_run_script: @ 8130F48 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r7, =gUnknown_020244A8 - ldr r0, [r7] - ldr r0, [r0, 0x14] - ldrb r0, [r0] - adds r6, r7, 0 - cmp r0, 0x2 - bne _08130F60 - b _08131066 -_08130F60: - mov r9, r7 - ldr r0, =gUnknown_0203AB38 - mov r8, r0 -_08130F66: - mov r1, r9 - ldr r0, [r1] - ldr r2, [r0, 0x14] - ldrb r0, [r2] - cmp r0, 0x1 - beq _08130FD4 - cmp r0, 0x1 - bgt _0813105A - cmp r0, 0 - bne _0813105A - ldr r1, =gUnknown_082DBEF8 - ldrb r0, [r2, 0x11] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - mov r1, r8 - str r0, [r1] - ldr r5, =gUnknown_02024084 - ldrb r4, [r2, 0x1] - ldr r0, =gUnknown_0203AB3C - ldrb r1, [r0] - movs r0, 0x58 - adds r3, r1, 0 - muls r3, r0 - adds r0, r4, r3 - adds r1, r5, 0 - adds r1, 0x24 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _08130FB0 - lsls r0, r4, 1 - adds r0, r3 - adds r1, r5, 0 - adds r1, 0xC - adds r0, r1 - ldrh r0, [r0] -_08130FB0: - strh r0, [r2, 0x2] - ldr r0, [r6] - ldr r1, [r0, 0x14] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0813105A - .pool -_08130FD4: - ldrh r1, [r2, 0x2] - cmp r1, 0 - beq _08130FF4 - ldr r1, =gUnknown_085B083C - mov r2, r8 - ldr r0, [r2] - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - b _0813100A - .pool -_08130FF4: - adds r0, r2, 0x4 - ldrb r2, [r2, 0x1] - adds r0, r2 - strb r1, [r0] - mov r1, r9 - ldr r0, [r1] - ldr r2, [r0, 0x14] - ldrb r1, [r2, 0x10] - movs r0, 0x1 - orrs r0, r1 - strb r0, [r2, 0x10] -_0813100A: - ldr r2, =gUnknown_020244A8 - ldr r0, [r2] - ldr r3, [r0, 0x14] - ldrb r1, [r3, 0x10] - movs r0, 0x1 - ands r0, r1 - adds r6, r2, 0 - cmp r0, 0 - beq _0813105A - ldrb r0, [r3, 0x1] - adds r0, 0x1 - strb r0, [r3, 0x1] - ldr r0, [r6] - ldr r2, [r0, 0x14] - ldrb r0, [r2, 0x1] - cmp r0, 0x3 - bhi _08131044 - ldrb r1, [r2, 0x10] - movs r0, 0x8 - ands r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08131044 - strb r0, [r2] - b _0813104E - .pool -_08131044: - ldr r0, [r6] - ldr r1, [r0, 0x14] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0813104E: - ldr r0, [r6] - ldr r2, [r0, 0x14] - ldrb r1, [r2, 0x10] - movs r0, 0xFE - ands r0, r1 - strb r0, [r2, 0x10] -_0813105A: - ldr r0, [r7] - ldr r0, [r0, 0x14] - ldrb r0, [r0] - cmp r0, 0x2 - beq _08131066 - b _08130F66 -_08131066: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end tai_run_script - - thumb_func_start sub_8131074 -sub_8131074: @ 8131074 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r7, 0 - ldr r4, =gUnknown_020244A8 - ldr r0, [r4] - ldr r2, [r0, 0x18] - ldr r3, =gUnknown_0202420C - ldrb r1, [r3] - lsls r0, r1, 4 - adds r2, r0 - ldr r5, =gUnknown_02024248 - lsls r1, 1 - adds r1, r5 - ldrh r0, [r2] - mov r8, r4 - mov r12, r3 - ldrh r1, [r1] - cmp r0, r1 - beq _081310E4 - adds r6, r5, 0 - movs r5, 0 -_081310A0: - mov r1, r8 - ldr r0, [r1] - ldr r4, [r0, 0x18] - mov r0, r12 - ldrb r1, [r0] - lsls r3, r1, 4 - adds r0, r5, r3 - adds r2, r4, r0 - ldrh r0, [r2] - cmp r0, 0 - bne _081310CC - lsls r0, r1, 1 - adds r0, r6 - ldrh r0, [r0] - strh r0, [r2] - b _081310E4 - .pool -_081310CC: - adds r5, 0x2 - adds r7, 0x1 - cmp r7, 0x3 - bgt _081310E4 - adds r0, r5, r3 - adds r0, r4, r0 - lsls r1, 1 - adds r1, r6 - ldrh r0, [r0] - ldrh r1, [r1] - cmp r0, r1 - bne _081310A0 -_081310E4: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8131074 - - thumb_func_start sub_81310F0 -sub_81310F0: @ 81310F0 - push {r4,lr} - lsls r0, 24 - ldr r4, =gUnknown_020244A8 - movs r3, 0 - lsrs r1, r0, 20 - movs r2, 0x3 -_081310FC: - ldr r0, [r4] - ldr r0, [r0, 0x18] - adds r0, r1 - strh r3, [r0] - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _081310FC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81310F0 - - thumb_func_start b_history__record_ability_usage_of_player -b_history__record_ability_usage_of_player: @ 8131118 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_020244A8 - ldr r2, [r2] - ldr r2, [r2, 0x18] - adds r2, 0x40 - adds r2, r0 - strb r1, [r2] - bx lr - .pool - thumb_func_end b_history__record_ability_usage_of_player - - thumb_func_start sub_8131130 -sub_8131130: @ 8131130 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_020244A8 - ldr r1, [r1] - ldr r1, [r1, 0x18] - adds r1, 0x40 - adds r1, r0 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_8131130 - - thumb_func_start b_history__record_item_x12_of_player -b_history__record_item_x12_of_player: @ 8131148 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_020244A8 - ldr r2, [r2] - ldr r2, [r2, 0x18] - adds r2, 0x44 - adds r2, r0 - strb r1, [r2] - bx lr - .pool - thumb_func_end b_history__record_item_x12_of_player - - thumb_func_start sub_8131160 -sub_8131160: @ 8131160 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_020244A8 - ldr r1, [r1] - ldr r1, [r1, 0x18] - adds r1, 0x44 - adds r1, r0 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_8131160 - - thumb_func_start tai00_unk -tai00_unk: @ 8131178 - push {lr} - bl GenerateRandomNumber - lsls r0, 16 - movs r1, 0xFF - lsls r1, 16 - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ands r1, r0 - lsrs r1, 16 - ldrb r0, [r2, 0x1] - cmp r1, r0 - bcs _081311B0 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081311B4 - .pool -_081311B0: - adds r0, r2, 0x6 - str r0, [r3] -_081311B4: - pop {r0} - bx r0 - thumb_func_end tai00_unk - - thumb_func_start tai01_unk -tai01_unk: @ 81311B8 - push {lr} - bl GenerateRandomNumber - lsls r0, 16 - movs r1, 0xFF - lsls r1, 16 - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ands r1, r0 - lsrs r1, 16 - ldrb r0, [r2, 0x1] - cmp r1, r0 - bls _081311F0 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081311F4 - .pool -_081311F0: - adds r0, r2, 0x6 - str r0, [r3] -_081311F4: - pop {r0} - bx r0 - thumb_func_end tai01_unk - - thumb_func_start tai02_unk -tai02_unk: @ 81311F8 - push {lr} - bl GenerateRandomNumber - lsls r0, 16 - movs r1, 0xFF - lsls r1, 16 - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ands r1, r0 - lsrs r1, 16 - ldrb r0, [r2, 0x1] - cmp r1, r0 - bne _08131230 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08131234 - .pool -_08131230: - adds r0, r2, 0x6 - str r0, [r3] -_08131234: - pop {r0} - bx r0 - thumb_func_end tai02_unk - - thumb_func_start tai03_unk -tai03_unk: @ 8131238 - push {lr} - bl GenerateRandomNumber - lsls r0, 16 - movs r1, 0xFF - lsls r1, 16 - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ands r1, r0 - lsrs r1, 16 - ldrb r0, [r2, 0x1] - cmp r1, r0 - beq _08131270 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08131274 - .pool -_08131270: - adds r0, r2, 0x6 - str r0, [r3] -_08131274: - pop {r0} - bx r0 - thumb_func_end tai03_unk - - thumb_func_start tai04_unk -tai04_unk: @ 8131278 - push {r4,lr} - ldr r2, =gUnknown_020244A8 - ldr r0, [r2] - ldr r0, [r0, 0x14] - adds r1, r0, 0x4 - ldrb r0, [r0, 0x1] - adds r1, r0 - ldr r3, =gUnknown_0203AB38 - ldr r0, [r3] - ldrb r0, [r0, 0x1] - ldrb r4, [r1] - adds r0, r4 - strb r0, [r1] - ldr r0, [r2] - ldr r1, [r0, 0x14] - adds r0, r1, 0x4 - ldrb r1, [r1, 0x1] - adds r1, r0, r1 - movs r0, 0 - ldrsb r0, [r1, r0] - cmp r0, 0 - bge _081312A8 - movs r0, 0 - strb r0, [r1] -_081312A8: - ldr r0, [r3] - adds r0, 0x2 - str r0, [r3] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end tai04_unk - - thumb_func_start tai05_unk -tai05_unk: @ 81312BC - push {r4,lr} - ldr r0, =gUnknown_0203AB38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0x1 - bne _081312D8 - ldr r0, =gUnknown_0203AB3C - b _081312DA - .pool -_081312D8: - ldr r0, =gUnknown_0202420C -_081312DA: - ldrb r1, [r0] - ldr r2, =gUnknown_02024084 - movs r0, 0x58 - muls r1, r0 - adds r1, r2 - ldrh r2, [r1, 0x28] - movs r0, 0x64 - muls r0, r2 - ldrh r1, [r1, 0x2C] - bl __divsi3 - ldr r2, [r4] - ldrb r1, [r2, 0x2] - cmp r0, r1 - bcs _08131318 - ldrb r1, [r2, 0x3] - ldrb r0, [r2, 0x4] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _0813131C - .pool -_08131318: - adds r0, r2, 0x7 - str r0, [r4] -_0813131C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai05_unk - - thumb_func_start tai06_unk -tai06_unk: @ 8131324 - push {r4,lr} - ldr r0, =gUnknown_0203AB38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0x1 - bne _08131340 - ldr r0, =gUnknown_0203AB3C - b _08131342 - .pool -_08131340: - ldr r0, =gUnknown_0202420C -_08131342: - ldrb r1, [r0] - ldr r2, =gUnknown_02024084 - movs r0, 0x58 - muls r1, r0 - adds r1, r2 - ldrh r2, [r1, 0x28] - movs r0, 0x64 - muls r0, r2 - ldrh r1, [r1, 0x2C] - bl __divsi3 - ldr r2, [r4] - ldrb r1, [r2, 0x2] - cmp r0, r1 - bls _08131380 - ldrb r1, [r2, 0x3] - ldrb r0, [r2, 0x4] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08131384 - .pool -_08131380: - adds r0, r2, 0x7 - str r0, [r4] -_08131384: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai06_unk - - thumb_func_start tai07_unk -tai07_unk: @ 813138C - push {r4,lr} - ldr r0, =gUnknown_0203AB38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0x1 - bne _081313A8 - ldr r0, =gUnknown_0203AB3C - b _081313AA - .pool -_081313A8: - ldr r0, =gUnknown_0202420C -_081313AA: - ldrb r1, [r0] - ldr r2, =gUnknown_02024084 - movs r0, 0x58 - muls r1, r0 - adds r1, r2 - ldrh r2, [r1, 0x28] - movs r0, 0x64 - muls r0, r2 - ldrh r1, [r1, 0x2C] - bl __divsi3 - ldr r2, [r4] - ldrb r1, [r2, 0x2] - cmp r0, r1 - bne _081313E8 - ldrb r1, [r2, 0x3] - ldrb r0, [r2, 0x4] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _081313EC - .pool -_081313E8: - adds r0, r2, 0x7 - str r0, [r4] -_081313EC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai07_unk - - thumb_func_start tai08_unk -tai08_unk: @ 81313F4 - push {r4,lr} - ldr r0, =gUnknown_0203AB38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0x1 - bne _08131410 - ldr r0, =gUnknown_0203AB3C - b _08131412 - .pool -_08131410: - ldr r0, =gUnknown_0202420C -_08131412: - ldrb r1, [r0] - ldr r2, =gUnknown_02024084 - movs r0, 0x58 - muls r1, r0 - adds r1, r2 - ldrh r2, [r1, 0x28] - movs r0, 0x64 - muls r0, r2 - ldrh r1, [r1, 0x2C] - bl __divsi3 - ldr r2, [r4] - ldrb r1, [r2, 0x2] - cmp r0, r1 - beq _08131450 - ldrb r1, [r2, 0x3] - ldrb r0, [r2, 0x4] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08131454 - .pool -_08131450: - adds r0, r2, 0x7 - str r0, [r4] -_08131454: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai08_unk - - thumb_func_start tai09_unk -tai09_unk: @ 813145C - push {r4,r5,lr} - ldr r0, =gUnknown_0203AB38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r5, r0, 0 - cmp r1, 0x1 - bne _08131478 - ldr r0, =gUnknown_0203AB3C - b _0813147A - .pool -_08131478: - ldr r0, =gUnknown_0202420C -_0813147A: - ldrb r4, [r0] - ldr r3, [r5] - ldrb r2, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r2, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r2, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r2, r0 - ldr r1, =gUnknown_02024084 - movs r0, 0x58 - muls r0, r4 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - ands r0, r2 - cmp r0, 0 - beq _081314C4 - ldrb r1, [r3, 0x6] - ldrb r0, [r3, 0x7] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x8] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x9] - lsls r0, 24 - orrs r1, r0 - str r1, [r5] - b _081314CA - .pool -_081314C4: - adds r0, r3, 0 - adds r0, 0xA - str r0, [r5] -_081314CA: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end tai09_unk - - thumb_func_start tai0A_unk -tai0A_unk: @ 81314D0 - push {r4,r5,lr} - ldr r0, =gUnknown_0203AB38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r5, r0, 0 - cmp r1, 0x1 - bne _081314EC - ldr r0, =gUnknown_0203AB3C - b _081314EE - .pool -_081314EC: - ldr r0, =gUnknown_0202420C -_081314EE: - ldrb r4, [r0] - ldr r3, [r5] - ldrb r2, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r2, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r2, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r2, r0 - ldr r1, =gUnknown_02024084 - movs r0, 0x58 - muls r0, r4 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - ands r0, r2 - cmp r0, 0 - bne _08131538 - ldrb r1, [r3, 0x6] - ldrb r0, [r3, 0x7] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x8] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x9] - lsls r0, 24 - orrs r1, r0 - str r1, [r5] - b _0813153E - .pool -_08131538: - adds r0, r3, 0 - adds r0, 0xA - str r0, [r5] -_0813153E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end tai0A_unk - - thumb_func_start tai0B_unk -tai0B_unk: @ 8131544 - push {r4,r5,lr} - ldr r0, =gUnknown_0203AB38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r5, r0, 0 - cmp r1, 0x1 - bne _08131560 - ldr r0, =gUnknown_0203AB3C - b _08131562 - .pool -_08131560: - ldr r0, =gUnknown_0202420C -_08131562: - ldrb r4, [r0] - ldr r3, [r5] - ldrb r2, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r2, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r2, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r2, r0 - ldr r1, =gUnknown_02024084 - movs r0, 0x58 - muls r0, r4 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - ands r0, r2 - cmp r0, 0 - beq _081315AC - ldrb r1, [r3, 0x6] - ldrb r0, [r3, 0x7] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x8] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x9] - lsls r0, 24 - orrs r1, r0 - str r1, [r5] - b _081315B2 - .pool -_081315AC: - adds r0, r3, 0 - adds r0, 0xA - str r0, [r5] -_081315B2: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end tai0B_unk - - thumb_func_start tai0C_unk -tai0C_unk: @ 81315B8 - push {r4,r5,lr} - ldr r0, =gUnknown_0203AB38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r5, r0, 0 - cmp r1, 0x1 - bne _081315D4 - ldr r0, =gUnknown_0203AB3C - b _081315D6 - .pool -_081315D4: - ldr r0, =gUnknown_0202420C -_081315D6: - ldrb r4, [r0] - ldr r3, [r5] - ldrb r2, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r2, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r2, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r2, r0 - ldr r1, =gUnknown_02024084 - movs r0, 0x58 - muls r0, r4 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - ands r0, r2 - cmp r0, 0 - bne _08131620 - ldrb r1, [r3, 0x6] - ldrb r0, [r3, 0x7] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x8] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x9] - lsls r0, 24 - orrs r1, r0 - str r1, [r5] - b _08131626 - .pool -_08131620: - adds r0, r3, 0 - adds r0, 0xA - str r0, [r5] -_08131626: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end tai0C_unk - - thumb_func_start tai0D_unk -tai0D_unk: @ 813162C - push {r4,r5,lr} - ldr r0, =gUnknown_0203AB38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r5, r0, 0 - cmp r1, 0x1 - bne _08131648 - ldr r0, =gUnknown_0203AB3C - b _0813164A - .pool -_08131648: - ldr r0, =gUnknown_0202420C -_0813164A: - ldrb r4, [r0] - ldr r3, [r5] - ldrb r1, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r1, r0 - ldr r2, =gUnknown_020242AC - lsls r0, r4, 2 - adds r0, r2 - ldr r0, [r0] - ands r0, r1 - cmp r0, 0 - beq _08131690 - ldrb r1, [r3, 0x6] - ldrb r0, [r3, 0x7] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x8] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x9] - lsls r0, 24 - orrs r1, r0 - str r1, [r5] - b _08131696 - .pool -_08131690: - adds r0, r3, 0 - adds r0, 0xA - str r0, [r5] -_08131696: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end tai0D_unk - - thumb_func_start tai0E_unk -tai0E_unk: @ 813169C - push {r4,r5,lr} - ldr r0, =gUnknown_0203AB38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r5, r0, 0 - cmp r1, 0x1 - bne _081316B8 - ldr r0, =gUnknown_0203AB3C - b _081316BA - .pool -_081316B8: - ldr r0, =gUnknown_0202420C -_081316BA: - ldrb r4, [r0] - ldr r3, [r5] - ldrb r1, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r1, r0 - ldr r2, =gUnknown_020242AC - lsls r0, r4, 2 - adds r0, r2 - ldr r0, [r0] - ands r0, r1 - cmp r0, 0 - bne _08131700 - ldrb r1, [r3, 0x6] - ldrb r0, [r3, 0x7] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x8] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x9] - lsls r0, 24 - orrs r1, r0 - str r1, [r5] - b _08131706 - .pool -_08131700: - adds r0, r3, 0 - adds r0, 0xA - str r0, [r5] -_08131706: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end tai0E_unk - - thumb_func_start tai0F_unk -tai0F_unk: @ 813170C - push {r4,lr} - ldr r0, =gUnknown_0203AB38 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - bne _08131724 - ldr r0, =gUnknown_0203AB3C - b _08131726 - .pool -_08131724: - ldr r0, =gUnknown_0202420C -_08131726: - ldrb r0, [r0] - bl battle_get_per_side_status - movs r2, 0x1 - ands r2, r0 - ldr r4, =gUnknown_0203AB38 - ldr r3, [r4] - ldrb r1, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r1, r0 - ldr r0, =gUnknown_0202428E - lsls r2, 1 - adds r2, r0 - ldrh r0, [r2] - ands r0, r1 - cmp r0, 0 - beq _0813177C - ldrb r1, [r3, 0x6] - ldrb r0, [r3, 0x7] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x8] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x9] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08131782 - .pool -_0813177C: - adds r0, r3, 0 - adds r0, 0xA - str r0, [r4] -_08131782: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai0F_unk - - thumb_func_start tai10_unk -tai10_unk: @ 8131788 - push {r4,lr} - ldr r0, =gUnknown_0203AB38 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - bne _081317A0 - ldr r0, =gUnknown_0203AB3C - b _081317A2 - .pool -_081317A0: - ldr r0, =gUnknown_0202420C -_081317A2: - ldrb r0, [r0] - bl battle_get_per_side_status - movs r2, 0x1 - ands r2, r0 - ldr r4, =gUnknown_0203AB38 - ldr r3, [r4] - ldrb r1, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r1, r0 - ldr r0, =gUnknown_0202428E - lsls r2, 1 - adds r2, r0 - ldrh r0, [r2] - ands r0, r1 - cmp r0, 0 - bne _081317F8 - ldrb r1, [r3, 0x6] - ldrb r0, [r3, 0x7] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x8] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x9] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _081317FE - .pool -_081317F8: - adds r0, r3, 0 - adds r0, 0xA - str r0, [r4] -_081317FE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai10_unk - - thumb_func_start tai11_unk -tai11_unk: @ 8131804 - push {lr} - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ldr r0, [r0, 0x8] - ldrb r1, [r2, 0x1] - cmp r0, r1 - bcs _08131838 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0813183C - .pool -_08131838: - adds r0, r2, 0x6 - str r0, [r3] -_0813183C: - pop {r0} - bx r0 - thumb_func_end tai11_unk - - thumb_func_start tai12_unk -tai12_unk: @ 8131840 - push {lr} - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ldr r0, [r0, 0x8] - ldrb r1, [r2, 0x1] - cmp r0, r1 - bls _08131874 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08131878 - .pool -_08131874: - adds r0, r2, 0x6 - str r0, [r3] -_08131878: - pop {r0} - bx r0 - thumb_func_end tai12_unk - - thumb_func_start tai13_unk -tai13_unk: @ 813187C - push {lr} - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ldr r0, [r0, 0x8] - ldrb r1, [r2, 0x1] - cmp r0, r1 - bne _081318B0 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081318B4 - .pool -_081318B0: - adds r0, r2, 0x6 - str r0, [r3] -_081318B4: - pop {r0} - bx r0 - thumb_func_end tai13_unk - - thumb_func_start tai14_unk -tai14_unk: @ 81318B8 - push {lr} - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ldr r0, [r0, 0x8] - ldrb r1, [r2, 0x1] - cmp r0, r1 - beq _081318EC - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081318F0 - .pool -_081318EC: - adds r0, r2, 0x6 - str r0, [r3] -_081318F0: - pop {r0} - bx r0 - thumb_func_end tai14_unk - - thumb_func_start tai15_unk -tai15_unk: @ 81318F4 - push {lr} - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r0, [r0, 0x8] - ldrb r1, [r1] - cmp r0, r1 - bcs _0813193C - ldrb r1, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08131942 - .pool -_0813193C: - adds r0, r2, 0 - adds r0, 0x9 - str r0, [r3] -_08131942: - pop {r0} - bx r0 - thumb_func_end tai15_unk - - thumb_func_start tai16_unk -tai16_unk: @ 8131948 - push {lr} - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r0, [r0, 0x8] - ldrb r1, [r1] - cmp r0, r1 - bls _08131990 - ldrb r1, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08131996 - .pool -_08131990: - adds r0, r2, 0 - adds r0, 0x9 - str r0, [r3] -_08131996: - pop {r0} - bx r0 - thumb_func_end tai16_unk - - thumb_func_start tai17_unk -tai17_unk: @ 813199C - push {lr} - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r0, [r0, 0x8] - ldrb r1, [r1] - cmp r0, r1 - bne _081319E4 - ldrb r1, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081319EA - .pool -_081319E4: - adds r0, r2, 0 - adds r0, 0x9 - str r0, [r3] -_081319EA: - pop {r0} - bx r0 - thumb_func_end tai17_unk - - thumb_func_start tai18_unk -tai18_unk: @ 81319F0 - push {lr} - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r0, [r0, 0x8] - ldrb r1, [r1] - cmp r0, r1 - beq _08131A38 - ldrb r1, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08131A3E - .pool -_08131A38: - adds r0, r2, 0 - adds r0, 0x9 - str r0, [r3] -_08131A3E: - pop {r0} - bx r0 - thumb_func_end tai18_unk - - thumb_func_start tai19_unk -tai19_unk: @ 8131A44 - push {lr} - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldrh r0, [r0, 0x2] - cmp r0, r1 - bne _08131A80 - ldrb r1, [r2, 0x3] - ldrb r0, [r2, 0x4] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08131A84 - .pool -_08131A80: - adds r0, r2, 0x7 - str r0, [r3] -_08131A84: - pop {r0} - bx r0 - thumb_func_end tai19_unk - - thumb_func_start tai1A_unk -tai1A_unk: @ 8131A88 - push {lr} - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldrh r0, [r0, 0x2] - cmp r0, r1 - beq _08131AC4 - ldrb r1, [r2, 0x3] - ldrb r0, [r2, 0x4] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08131AC8 - .pool -_08131AC4: - adds r0, r2, 0x7 - str r0, [r3] -_08131AC8: - pop {r0} - bx r0 - thumb_func_end tai1A_unk - - thumb_func_start tai1B_unk -tai1B_unk: @ 8131ACC - push {r4,lr} - ldr r2, =gUnknown_0203AB38 - ldr r1, [r2] - ldrb r3, [r1, 0x1] - ldrb r0, [r1, 0x2] - lsls r0, 8 - orrs r3, r0 - ldrb r0, [r1, 0x3] - lsls r0, 16 - orrs r3, r0 - ldrb r0, [r1, 0x4] - lsls r0, 24 - orrs r3, r0 - ldrb r0, [r3] - cmp r0, 0xFF - beq _08131B28 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r1, [r0, 0x8] - adds r4, r2, 0 -_08131AF6: - ldrb r0, [r3] - cmp r1, r0 - bne _08131B20 - ldr r2, [r4] - ldrb r1, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08131B2E - .pool -_08131B20: - adds r3, 0x1 - ldrb r0, [r3] - cmp r0, 0xFF - bne _08131AF6 -_08131B28: - ldr r0, [r2] - adds r0, 0x9 - str r0, [r2] -_08131B2E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai1B_unk - - thumb_func_start tai1C_unk -tai1C_unk: @ 8131B34 - push {r4,lr} - ldr r2, =gUnknown_0203AB38 - ldr r1, [r2] - ldrb r3, [r1, 0x1] - ldrb r0, [r1, 0x2] - lsls r0, 8 - orrs r3, r0 - ldrb r0, [r1, 0x3] - lsls r0, 16 - orrs r3, r0 - ldrb r0, [r1, 0x4] - lsls r0, 24 - orrs r3, r0 - ldrb r0, [r3] - adds r4, r2, 0 - cmp r0, 0xFF - beq _08131B80 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r2, [r0, 0x8] - adds r1, r4, 0 -_08131B60: - ldrb r0, [r3] - cmp r2, r0 - bne _08131B78 - ldr r0, [r1] - adds r0, 0x9 - str r0, [r1] - b _08131B98 - .pool -_08131B78: - adds r3, 0x1 - ldrb r0, [r3] - cmp r0, 0xFF - bne _08131B60 -_08131B80: - ldr r2, [r4] - ldrb r1, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] -_08131B98: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai1C_unk - - thumb_func_start tai1D_unk -tai1D_unk: @ 8131BA0 - push {r4,r5,lr} - ldr r2, =gUnknown_0203AB38 - ldr r1, [r2] - ldrb r3, [r1, 0x1] - ldrb r0, [r1, 0x2] - lsls r0, 8 - orrs r3, r0 - ldrb r0, [r1, 0x3] - lsls r0, 16 - orrs r3, r0 - ldrb r0, [r1, 0x4] - lsls r0, 24 - orrs r3, r0 - ldrh r0, [r3] - ldr r5, =0x0000ffff - cmp r0, r5 - beq _08131C00 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r1, [r0, 0x8] - adds r4, r2, 0 -_08131BCC: - ldrh r0, [r3] - cmp r1, r0 - bne _08131BF8 - ldr r2, [r4] - ldrb r1, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08131C06 - .pool -_08131BF8: - adds r3, 0x2 - ldrh r0, [r3] - cmp r0, r5 - bne _08131BCC -_08131C00: - ldr r0, [r2] - adds r0, 0x9 - str r0, [r2] -_08131C06: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end tai1D_unk - - thumb_func_start tai1E_unk -tai1E_unk: @ 8131C0C - push {r4,r5,lr} - ldr r2, =gUnknown_0203AB38 - ldr r1, [r2] - ldrb r3, [r1, 0x1] - ldrb r0, [r1, 0x2] - lsls r0, 8 - orrs r3, r0 - ldrb r0, [r1, 0x3] - lsls r0, 16 - orrs r3, r0 - ldrb r0, [r1, 0x4] - lsls r0, 24 - orrs r3, r0 - ldrh r0, [r3] - ldr r4, =0x0000ffff - adds r5, r2, 0 - cmp r0, r4 - beq _08131C5C - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r2, [r0, 0x8] - adds r1, r5, 0 -_08131C3A: - ldrh r0, [r3] - cmp r2, r0 - bne _08131C54 - ldr r0, [r1] - adds r0, 0x9 - str r0, [r1] - b _08131C74 - .pool -_08131C54: - adds r3, 0x2 - ldrh r0, [r3] - cmp r0, r4 - bne _08131C3A -_08131C5C: - ldr r2, [r5] - ldrb r1, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 24 - orrs r1, r0 - str r1, [r5] -_08131C74: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end tai1E_unk - - thumb_func_start tai1F_unk -tai1F_unk: @ 8131C7C - push {r4,r5,lr} - movs r3, 0 - ldr r4, =gUnknown_0203AB38 - ldr r1, =gUnknown_02024084 - ldr r0, =gUnknown_0203AB3C - ldrb r2, [r0] - ldr r5, =gBattleMoves - movs r0, 0x58 - muls r0, r2 - adds r1, 0xC - adds r2, r0, r1 -_08131C92: - ldrh r0, [r2] - cmp r0, 0 - beq _08131CA6 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1, 0x1] - cmp r0, 0 - bne _08131CAE -_08131CA6: - adds r2, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - ble _08131C92 -_08131CAE: - cmp r3, 0x4 - bne _08131CCC - ldr r0, [r4] - adds r0, 0x5 - str r0, [r4] - b _08131CE4 - .pool -_08131CCC: - ldr r2, [r4] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] -_08131CE4: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end tai1F_unk - - thumb_func_start tai20_unk -tai20_unk: @ 8131CEC - push {r4,r5,lr} - movs r3, 0 - ldr r4, =gUnknown_0203AB38 - ldr r1, =gUnknown_02024084 - ldr r0, =gUnknown_0203AB3C - ldrb r2, [r0] - ldr r5, =gBattleMoves - movs r0, 0x58 - muls r0, r2 - adds r1, 0xC - adds r2, r0, r1 -_08131D02: - ldrh r0, [r2] - cmp r0, 0 - beq _08131D16 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1, 0x1] - cmp r0, 0 - bne _08131D1E -_08131D16: - adds r2, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - ble _08131D02 -_08131D1E: - cmp r3, 0x4 - beq _08131D3C - ldr r0, [r4] - adds r0, 0x5 - str r0, [r4] - b _08131D54 - .pool -_08131D3C: - ldr r2, [r4] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] -_08131D54: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end tai20_unk - - thumb_func_start tai21_unk -tai21_unk: @ 8131D5C - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - ldr r0, =gUnknown_03005D10 - ldrb r0, [r0, 0x13] - str r0, [r1, 0x8] - ldr r1, =gUnknown_0203AB38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end tai21_unk - - thumb_func_start dp15_get_some_type -dp15_get_some_type: @ 8131D80 - push {r4,lr} - ldr r1, =gUnknown_0203AB38 - ldr r0, [r1] - ldrb r0, [r0, 0x1] - adds r4, r1, 0 - cmp r0, 0x4 - bhi _08131E5A - lsls r0, 2 - ldr r1, =_08131DA0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08131DA0: - .4byte _08131DD8 - .4byte _08131DB4 - .4byte _08131E20 - .4byte _08131DFC - .4byte _08131E44 -_08131DB4: - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r3, [r0, 0x14] - ldr r2, =gUnknown_02024084 - ldr r0, =gUnknown_0203AB3C - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x21 - ldrb r0, [r0] - b _08131E58 - .pool -_08131DD8: - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r3, [r0, 0x14] - ldr r2, =gUnknown_02024084 - ldr r0, =gUnknown_0202420C - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x21 - ldrb r0, [r0] - b _08131E58 - .pool -_08131DFC: - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r3, [r0, 0x14] - ldr r2, =gUnknown_02024084 - ldr r0, =gUnknown_0203AB3C - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x22 - ldrb r0, [r0] - b _08131E58 - .pool -_08131E20: - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r3, [r0, 0x14] - ldr r2, =gUnknown_02024084 - ldr r0, =gUnknown_0202420C - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x22 - ldrb r0, [r0] - b _08131E58 - .pool -_08131E44: - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r3, [r0, 0x14] - ldr r2, =gBattleMoves - ldrh r1, [r3, 0x2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x2] -_08131E58: - str r0, [r3, 0x8] -_08131E5A: - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp15_get_some_type - - thumb_func_start sub_8131E70 -sub_8131E70: @ 8131E70 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08131E84 - ldr r0, =gUnknown_0203AB3C - ldrb r0, [r0] - b _08131EAC - .pool -_08131E84: - cmp r0, 0x1 - ble _08131E90 - cmp r0, 0x2 - beq _08131EA4 - cmp r0, 0x3 - beq _08131E9C -_08131E90: - ldr r0, =gUnknown_0202420C - ldrb r0, [r0] - b _08131EAC - .pool -_08131E9C: - ldr r0, =gUnknown_0203AB3C - b _08131EA6 - .pool -_08131EA4: - ldr r0, =gUnknown_0202420C -_08131EA6: - ldrb r1, [r0] - movs r0, 0x2 - eors r0, r1 -_08131EAC: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8131E70 - - thumb_func_start tai5F_unk -tai5F_unk: @ 8131EB4 - push {r4,lr} - ldr r4, =gUnknown_0203AB38 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl sub_8131E70 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_02024084 - movs r1, 0x58 - muls r0, r1 - adds r3, r0, r2 - adds r1, r3, 0 - adds r1, 0x21 - ldr r0, [r4] - ldrb r1, [r1] - ldrb r2, [r0, 0x2] - cmp r1, r2 - beq _08131EE4 - adds r0, r3, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, r2 - bne _08131EFC -_08131EE4: - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0x1 - b _08131F04 - .pool -_08131EFC: - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0 -_08131F04: - str r0, [r1, 0x8] - ldr r1, =gUnknown_0203AB38 - ldr r0, [r1] - adds r0, 0x3 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end tai5F_unk - - thumb_func_start dp15_move_get_power__2_8 -dp15_move_get_power__2_8: @ 8131F1C - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r3, [r0, 0x14] - ldr r2, =gBattleMoves - ldrh r1, [r3, 0x2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - str r0, [r3, 0x8] - ldr r1, =gUnknown_0203AB38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end dp15_move_get_power__2_8 - - thumb_func_start dp15_is_most_powerful_move__8 -dp15_is_most_powerful_move__8: @ 8131F48 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - movs r3, 0 - ldr r0, =gUnknown_085B09C8 - ldrh r1, [r0] - ldr r5, =0x0000ffff - ldr r6, =gBattleMoves - ldr r2, =gUnknown_020244A8 - cmp r1, r5 - beq _08131F86 - ldr r0, [r2] - ldr r0, [r0, 0x14] - ldrh r1, [r0, 0x2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r4, [r0] - ldr r1, =gUnknown_085B09C8 -_08131F76: - ldrh r0, [r1] - cmp r4, r0 - beq _08131F86 - adds r1, 0x2 - adds r3, 0x1 - ldrh r0, [r1] - cmp r0, r5 - bne _08131F76 -_08131F86: - ldr r0, [r2] - ldr r0, [r0, 0x14] - ldrh r1, [r0, 0x2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - bhi _08131F9C - b _08132126 -_08131F9C: - lsls r0, r3, 1 - ldr r1, =gUnknown_085B09C8 - adds r0, r1 - ldrh r3, [r0] - ldr r0, =0x0000ffff - cmp r3, r0 - beq _08131FAC - b _08132126 -_08131FAC: - ldr r0, =gUnknown_02024400 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_0202449C - ldr r0, [r0] - strb r1, [r0, 0x13] - ldr r0, =gUnknown_02024474 - movs r2, 0x1 - strb r2, [r0, 0xE] - ldr r0, =gUnknown_0202427C - strb r1, [r0] - ldr r0, =gUnknown_02024211 - strb r2, [r0] - movs r6, 0 - mov r9, r3 - ldr r2, =gUnknown_085B09C8 - ldrh r2, [r2] - str r2, [sp, 0x10] -_08131FD0: - movs r3, 0 - ldr r5, =gUnknown_02024084 - lsls r4, r6, 1 - ldr r7, =gUnknown_0203AB3C - lsls r0, r6, 2 - mov r8, r0 - adds r1, r6, 0x1 - mov r10, r1 - ldr r2, [sp, 0x10] - cmp r2, r9 - beq _08132014 - ldr r2, =gBattleMoves - ldrb r1, [r7] - movs r0, 0x58 - muls r0, r1 - adds r0, r4, r0 - adds r1, r5, 0 - adds r1, 0xC - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r2, [r0] - ldr r1, =gUnknown_085B09C8 -_08132004: - ldrh r0, [r1] - cmp r2, r0 - beq _08132014 - adds r1, 0x2 - adds r3, 0x1 - ldrh r0, [r1] - cmp r0, r9 - bne _08132004 -_08132014: - ldrb r1, [r7] - movs r0, 0x58 - muls r0, r1 - adds r0, r4, r0 - adds r1, r5, 0 - adds r1, 0xC - adds r1, r0, r1 - ldrh r0, [r1] - cmp r0, 0 - beq _081320C0 - lsls r0, r3, 1 - ldr r2, =gUnknown_085B09C8 - adds r0, r2 - ldrh r0, [r0] - cmp r0, r9 - bne _081320C0 - ldr r0, =gBattleMoves - ldrh r2, [r1] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - cmp r0, 0x1 - bls _081320C0 - ldr r5, =gUnknown_020241EA - strh r2, [r5] - ldrb r0, [r7] - ldr r4, =gUnknown_0202420C - ldrb r1, [r4] - bl sub_8046E7C - ldrh r0, [r5] - ldrb r1, [r7] - ldrb r2, [r4] - bl move_effectiveness_something - mov r4, sp - add r4, r8 - ldr r2, =gUnknown_020241F0 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - adds r0, 0x18 - adds r0, r6 - ldrb r1, [r0] - ldr r0, [r2] - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - str r0, [r4] - cmp r0, 0 - bne _081320C8 - movs r0, 0x1 - str r0, [r4] - b _081320C8 - .pool -_081320C0: - mov r1, sp - add r1, r8 - movs r0, 0 - str r0, [r1] -_081320C8: - mov r6, r10 - cmp r6, 0x3 - bgt _081320D0 - b _08131FD0 -_081320D0: - movs r6, 0 - ldr r2, =gUnknown_020244A8 - ldr r0, [r2] - ldr r0, [r0, 0x14] - ldrb r0, [r0, 0x1] - lsls r0, 2 - add r0, sp - ldr r1, [sp] - ldr r0, [r0] - ldr r5, =gUnknown_0203AB38 - cmp r1, r0 - bgt _08132106 - adds r4, r2, 0 - mov r3, sp -_081320EC: - adds r3, 0x4 - adds r6, 0x1 - cmp r6, 0x3 - bgt _08132106 - ldr r0, [r4] - ldr r0, [r0, 0x14] - ldrb r0, [r0, 0x1] - lsls r0, 2 - add r0, sp - ldr r1, [r3] - ldr r0, [r0] - cmp r1, r0 - ble _081320EC -_08132106: - cmp r6, 0x4 - bne _0813211C - ldr r0, [r2] - ldr r1, [r0, 0x14] - movs r0, 0x2 - str r0, [r1, 0x8] - b _08132130 - .pool -_0813211C: - ldr r0, [r2] - ldr r1, [r0, 0x14] - movs r0, 0x1 - str r0, [r1, 0x8] - b _08132130 -_08132126: - ldr r0, [r2] - ldr r1, [r0, 0x14] - movs r0, 0 - str r0, [r1, 0x8] - ldr r5, =gUnknown_0203AB38 -_08132130: - ldr r0, [r5] - adds r0, 0x1 - str r0, [r5] - 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 dp15_is_most_powerful_move__8 - - thumb_func_start dp15_get_move_to_execute_B -dp15_get_move_to_execute_B: @ 813214C - push {lr} - ldr r0, =gUnknown_0203AB38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r3, r0, 0 - cmp r1, 0x1 - bne _08132178 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldr r1, =gUnknown_02024248 - ldr r0, =gUnknown_0203AB3C - b _08132182 - .pool -_08132178: - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldr r1, =gUnknown_02024248 - ldr r0, =gUnknown_0202420C -_08132182: - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - str r0, [r2, 0x8] - ldr r0, [r3] - adds r0, 0x2 - str r0, [r3] - pop {r0} - bx r0 - .pool - thumb_func_end dp15_get_move_to_execute_B - - thumb_func_start tai26_unk -tai26_unk: @ 81321A4 - push {lr} - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r0, [r0, 0x8] - cmp r1, r0 - bne _081321D8 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081321DC - .pool -_081321D8: - adds r0, r2, 0x6 - str r0, [r3] -_081321DC: - pop {r0} - bx r0 - thumb_func_end tai26_unk - - thumb_func_start tai27_unk -tai27_unk: @ 81321E0 - push {lr} - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r0, [r0, 0x8] - cmp r1, r0 - beq _08132214 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08132218 - .pool -_08132214: - adds r0, r2, 0x6 - str r0, [r3] -_08132218: - pop {r0} - bx r0 - thumb_func_end tai27_unk - - thumb_func_start tai28_unk -tai28_unk: @ 813221C - push {lr} - ldr r0, =gUnknown_0203AB3C - ldrb r0, [r0] - ldr r1, =gUnknown_0202420C - ldrb r1, [r1] - movs r2, 0x1 - bl b_first_side - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r2, 0x1] - cmp r0, r1 - bne _08132260 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08132264 - .pool -_08132260: - adds r0, r2, 0x6 - str r0, [r3] -_08132264: - pop {r0} - bx r0 - thumb_func_end tai28_unk - - thumb_func_start tai29_unk -tai29_unk: @ 8132268 - push {lr} - ldr r0, =gUnknown_0203AB3C - ldrb r0, [r0] - ldr r1, =gUnknown_0202420C - ldrb r1, [r1] - movs r2, 0x1 - bl b_first_side - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r2, 0x1] - cmp r0, r1 - beq _081322AC - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081322B0 - .pool -_081322AC: - adds r0, r2, 0x6 - str r0, [r3] -_081322B0: - pop {r0} - bx r0 - thumb_func_end tai29_unk - - thumb_func_start nullsub_102 -nullsub_102: @ 81322B4 - bx lr - thumb_func_end nullsub_102 - - thumb_func_start nullsub_103 -nullsub_103: @ 81322B8 - bx lr - thumb_func_end nullsub_103 - - thumb_func_start tai2C_unk -tai2C_unk: @ 81322BC - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0 - str r0, [r1, 0x8] - ldr r0, =gUnknown_0203AB38 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - bne _081322E8 - ldr r0, =gUnknown_0203AB3C - b _081322EA - .pool -_081322E8: - ldr r0, =gUnknown_0202420C -_081322EA: - ldrb r5, [r0] - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =gUnknown_02024744 - mov r8, r1 - cmp r0, 0 - bne _08132300 - ldr r0, =gUnknown_020244EC - mov r8, r0 -_08132300: - ldr r0, =gUnknown_02022FEC - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08132344 - ldr r4, =gUnknown_0202406E - lsls r0, r5, 1 - adds r0, r4 - ldrb r7, [r0] - adds r0, r5, 0 - bl battle_get_per_side_status - movs r1, 0x2 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 23 - adds r0, r4 - ldrb r6, [r0] - b _0813234E - .pool -_08132344: - ldr r1, =gUnknown_0202406E - lsls r0, r5, 1 - adds r0, r1 - ldrb r6, [r0] - adds r7, r6, 0 -_0813234E: - movs r5, 0 -_08132350: - cmp r5, r7 - beq _08132394 - cmp r5, r6 - beq _08132394 - movs r0, 0x64 - muls r0, r5 - mov r1, r8 - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _08132394 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _08132394 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _08132394 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - ldr r0, [r1, 0x8] - adds r0, 0x1 - str r0, [r1, 0x8] -_08132394: - adds r5, 0x1 - cmp r5, 0x5 - ble _08132350 - ldr r1, =gUnknown_0203AB38 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end tai2C_unk - - thumb_func_start dp15_get_move_id__8 -dp15_get_move_id__8: @ 81323B8 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - ldrh r0, [r1, 0x2] - str r0, [r1, 0x8] - ldr r1, =gUnknown_0203AB38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end dp15_get_move_id__8 - - thumb_func_start dp15_move_get_move_script_id -dp15_move_get_move_script_id: @ 81323D4 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r3, [r0, 0x14] - ldr r2, =gBattleMoves - ldrh r1, [r3, 0x2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - str r0, [r3, 0x8] - ldr r1, =gUnknown_0203AB38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end dp15_move_get_move_script_id - - thumb_func_start tai2F_unk -tai2F_unk: @ 8132400 - push {r4-r7,lr} - ldr r0, =gUnknown_0203AB38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - mov r12, r0 - cmp r1, 0x1 - bne _0813241C - ldr r0, =gUnknown_0203AB3C - b _0813241E - .pool -_0813241C: - ldr r0, =gUnknown_0202420C -_0813241E: - ldrb r3, [r0] - ldr r0, =gUnknown_02024064 - ldrb r0, [r0] - cmp r0, r3 - beq _081324F0 - ldr r7, =gUnknown_020244A8 - ldr r5, [r7] - ldr r0, [r5, 0x18] - adds r0, 0x40 - adds r2, r0, r3 - ldrb r0, [r2] - adds r6, r7, 0 - cmp r0, 0 - beq _0813244C - ldr r1, [r5, 0x14] - str r0, [r1, 0x8] - b _08132504 - .pool -_0813244C: - ldr r1, =gUnknown_02024084 - movs r0, 0x58 - muls r0, r3 - adds r4, r0, r1 - adds r0, r4, 0 - adds r0, 0x20 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0x17 - beq _08132468 - cmp r0, 0x2A - beq _08132468 - cmp r0, 0x47 - bne _08132480 -_08132468: - ldr r0, [r6] - ldr r1, [r0, 0x14] - movs r0, 0x58 - muls r0, r3 - adds r0, r2 - adds r0, 0x20 - ldrb r0, [r0] - str r0, [r1, 0x8] - b _08132504 - .pool -_08132480: - ldr r6, =gBaseStats - ldrh r0, [r4] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r2, r1, r6 - ldrb r0, [r2, 0x16] - cmp r0, 0 - beq _081324E8 - ldrb r0, [r2, 0x17] - cmp r0, 0 - beq _081324E0 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _081324C4 - ldr r0, [r7] - ldr r2, [r0, 0x14] - ldrh r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x16] - str r0, [r2, 0x8] - ldr r0, =gUnknown_0203AB38 - mov r12, r0 - b _08132504 - .pool -_081324C4: - ldr r0, [r7] - ldr r2, [r0, 0x14] - ldrh r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x17] - str r0, [r2, 0x8] - ldr r1, =gUnknown_0203AB38 - mov r12, r1 - b _08132504 - .pool -_081324E0: - ldr r1, [r5, 0x14] - ldrb r0, [r2, 0x16] - str r0, [r1, 0x8] - b _08132504 -_081324E8: - ldr r1, [r5, 0x14] - ldrb r0, [r2, 0x17] - str r0, [r1, 0x8] - b _08132504 -_081324F0: - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldr r1, =gUnknown_02024084 - movs r0, 0x58 - muls r0, r3 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - str r0, [r2, 0x8] -_08132504: - mov r1, r12 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end tai2F_unk - - thumb_func_start tai60_unk -tai60_unk: @ 813251C - push {r4-r6,lr} - ldr r4, =gUnknown_0203AB38 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl sub_8131E70 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r4] - ldrb r3, [r0, 0x2] - ldrb r0, [r0, 0x1] - cmp r0, 0 - beq _0813253A - cmp r0, 0x2 - bne _081325BC -_0813253A: - ldr r0, =gUnknown_020244A8 - ldr r4, [r0] - ldr r1, [r4, 0x18] - adds r1, 0x40 - adds r2, r1, r5 - ldrb r1, [r2] - adds r6, r0, 0 - cmp r1, 0 - beq _0813255C - adds r3, r1, 0 - ldr r0, [r4, 0x14] - str r3, [r0, 0x8] - b _081325CA - .pool -_0813255C: - ldr r1, =gUnknown_02024084 - movs r0, 0x58 - muls r0, r5 - adds r4, r0, r1 - adds r0, r4, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x17 - beq _08132576 - cmp r0, 0x2A - beq _08132576 - cmp r0, 0x47 - bne _08132588 -_08132576: - movs r0, 0x58 - muls r0, r5 - adds r0, r1 - adds r0, 0x20 - ldrb r3, [r0] - b _081325CA - .pool -_08132588: - ldr r2, =gBaseStats - ldrh r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r1, r0, r2 - ldrb r4, [r1, 0x16] - cmp r4, 0 - beq _081325B8 - ldrb r2, [r1, 0x17] - cmp r2, 0 - beq _081325B4 - adds r0, r3, 0 - cmp r4, r0 - beq _081325CE - cmp r2, r0 - beq _081325CE - adds r3, r4, 0 - b _081325CA - .pool -_081325B4: - ldrb r3, [r1, 0x16] - b _081325CA -_081325B8: - ldrb r3, [r1, 0x17] - b _081325CA -_081325BC: - ldr r1, =gUnknown_02024084 - movs r0, 0x58 - muls r0, r5 - adds r0, r1 - adds r0, 0x20 - ldrb r3, [r0] - ldr r6, =gUnknown_020244A8 -_081325CA: - cmp r3, 0 - bne _081325E8 -_081325CE: - ldr r0, [r6] - ldr r1, [r0, 0x14] - movs r0, 0x2 - str r0, [r1, 0x8] - ldr r2, =gUnknown_0203AB38 - b _08132608 - .pool -_081325E8: - ldr r0, =gUnknown_0203AB38 - ldr r1, [r0] - adds r2, r0, 0 - ldrb r1, [r1, 0x2] - cmp r3, r1 - bne _08132600 - ldr r0, [r6] - ldr r1, [r0, 0x14] - movs r0, 0x1 - b _08132606 - .pool -_08132600: - ldr r0, [r6] - ldr r1, [r0, 0x14] - movs r0, 0 -_08132606: - str r0, [r1, 0x8] -_08132608: - ldr r0, [r2] - adds r0, 0x3 - str r0, [r2] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end tai60_unk - - thumb_func_start tai30_unk -tai30_unk: @ 8132614 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =gUnknown_02024400 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_0202449C - ldr r0, [r0] - strb r1, [r0, 0x13] - ldr r0, =gUnknown_02024474 - movs r3, 0 - movs r2, 0x1 - strb r2, [r0, 0xE] - ldr r0, =gUnknown_0202427C - strb r1, [r0] - ldr r0, =gUnknown_02024211 - strb r2, [r0] - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - str r3, [r0, 0x8] - movs r5, 0 - ldr r4, =gUnknown_020241F0 - ldr r7, =gUnknown_020241EA - ldr r0, =gUnknown_02024090 - mov r8, r0 - ldr r6, =gUnknown_0203AB3C -_0813264A: - movs r0, 0x28 - str r0, [r4] - lsls r1, r5, 1 - ldrb r2, [r6] - movs r0, 0x58 - muls r0, r2 - adds r1, r0 - add r1, r8 - ldrh r0, [r1] - strh r0, [r7] - lsls r0, 16 - cmp r0, 0 - beq _081326B8 - ldrh r0, [r7] - ldrb r1, [r6] - ldr r2, =gUnknown_0202420C - ldrb r2, [r2] - bl move_effectiveness_something - ldr r0, [r4] - cmp r0, 0x78 - bne _0813267A - movs r0, 0x50 - str r0, [r4] -_0813267A: - ldr r0, [r4] - cmp r0, 0xF0 - bne _08132684 - movs r0, 0xA0 - str r0, [r4] -_08132684: - ldr r0, [r4] - cmp r0, 0x1E - bne _0813268E - movs r0, 0x14 - str r0, [r4] -_0813268E: - ldr r0, [r4] - cmp r0, 0xF - bne _08132698 - movs r0, 0xA - str r0, [r4] -_08132698: - ldr r0, =gUnknown_0202427C - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _081326A8 - movs r0, 0 - str r0, [r4] -_081326A8: - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldr r0, [r2, 0x8] - ldr r1, [r4] - cmp r0, r1 - bcs _081326B8 - str r1, [r2, 0x8] -_081326B8: - adds r5, 0x1 - cmp r5, 0x3 - ble _0813264A - ldr r1, =gUnknown_0203AB38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end tai30_unk - - thumb_func_start dp15_simulate_damage_bonus_jump_if_eq -dp15_simulate_damage_bonus_jump_if_eq: @ 8132700 - push {r4,r5,lr} - ldr r0, =gUnknown_02024400 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_0202449C - ldr r0, [r0] - strb r1, [r0, 0x13] - ldr r0, =gUnknown_02024474 - movs r2, 0x1 - strb r2, [r0, 0xE] - ldr r5, =gUnknown_0202427C - strb r1, [r5] - ldr r0, =gUnknown_02024211 - strb r2, [r0] - ldr r4, =gUnknown_020241F0 - movs r0, 0x28 - str r0, [r4] - ldr r1, =gUnknown_020241EA - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldrh r0, [r0, 0x2] - strh r0, [r1] - ldrh r0, [r1] - ldr r1, =gUnknown_0203AB3C - ldrb r1, [r1] - ldr r2, =gUnknown_0202420C - ldrb r2, [r2] - bl move_effectiveness_something - ldr r0, [r4] - cmp r0, 0x78 - bne _08132746 - movs r0, 0x50 - str r0, [r4] -_08132746: - ldr r0, [r4] - cmp r0, 0xF0 - bne _08132750 - movs r0, 0xA0 - str r0, [r4] -_08132750: - ldr r0, [r4] - cmp r0, 0x1E - bne _0813275A - movs r0, 0x14 - str r0, [r4] -_0813275A: - ldr r0, [r4] - cmp r0, 0xF - bne _08132764 - movs r0, 0xA - str r0, [r4] -_08132764: - ldrb r1, [r5] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _08132772 - movs r0, 0 - str r0, [r4] -_08132772: - ldrb r0, [r4] - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - cmp r0, r1 - bne _081327C4 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081327C8 - .pool -_081327C4: - adds r0, r2, 0x6 - str r0, [r3] -_081327C8: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end dp15_simulate_damage_bonus_jump_if_eq - - thumb_func_start nullsub_104 -nullsub_104: @ 81327D0 - bx lr - thumb_func_end nullsub_104 - - thumb_func_start nullsub_105 -nullsub_105: @ 81327D4 - bx lr - thumb_func_end nullsub_105 - - thumb_func_start tai34_unk -tai34_unk: @ 81327D8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =gUnknown_0203AB38 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - bne _08132818 - ldr r0, =gUnknown_0203AB3C - b _0813281A - .pool -_081327F8: - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ldrb r1, [r2, 0x6] - ldrb r0, [r2, 0x7] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x9] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0813289A - .pool -_08132818: - ldr r0, =gUnknown_0202420C -_0813281A: - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =gUnknown_02024744 - mov r9, r1 - cmp r0, 0 - bne _0813282E - ldr r0, =gUnknown_020244EC - mov r9, r0 -_0813282E: - ldr r0, =gUnknown_0203AB38 - ldr r1, [r0] - ldrb r7, [r1, 0x2] - ldrb r0, [r1, 0x3] - lsls r0, 8 - orrs r7, r0 - ldrb r0, [r1, 0x4] - lsls r0, 16 - orrs r7, r0 - ldrb r0, [r1, 0x5] - lsls r0, 24 - orrs r7, r0 - movs r1, 0 - mov r8, r1 - movs r0, 0xCE - lsls r0, 1 - mov r10, r0 -_08132850: - movs r0, 0x64 - mov r4, r8 - muls r4, r0 - add r4, r9 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - cmp r5, 0 - beq _08132888 - cmp r5, r10 - beq _08132888 - cmp r6, 0 - beq _08132888 - cmp r0, r7 - beq _081327F8 -_08132888: - movs r1, 0x1 - add r8, r1 - mov r0, r8 - cmp r0, 0x5 - ble _08132850 - ldr r1, =gUnknown_0203AB38 - ldr r0, [r1] - adds r0, 0xA - str r0, [r1] -_0813289A: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end tai34_unk - - thumb_func_start tai35_unk -tai35_unk: @ 81328B8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =gUnknown_0203AB38 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - bne _081328D8 - ldr r0, =gUnknown_0203AB3C - b _081328DA - .pool -_081328D8: - ldr r0, =gUnknown_0202420C -_081328DA: - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =gUnknown_02024744 - mov r10, r1 - cmp r0, 0 - bne _081328EE - ldr r0, =gUnknown_020244EC - mov r10, r0 -_081328EE: - ldr r2, =gUnknown_0203AB38 - ldr r1, [r2] - ldrb r7, [r1, 0x2] - ldrb r0, [r1, 0x3] - lsls r0, 8 - orrs r7, r0 - ldrb r0, [r1, 0x4] - lsls r0, 16 - orrs r7, r0 - ldrb r0, [r1, 0x5] - lsls r0, 24 - orrs r7, r0 - movs r1, 0 - mov r8, r1 - mov r9, r2 -_0813290C: - movs r0, 0x64 - mov r4, r8 - muls r4, r0 - add r4, r10 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - cmp r5, 0 - beq _08132950 - movs r1, 0xCE - lsls r1, 1 - cmp r5, r1 - beq _08132950 - cmp r6, 0 - beq _08132950 - cmp r0, r7 - bne _08132950 - mov r1, r9 - ldr r0, [r1] - adds r0, 0xA - str r0, [r1] -_08132950: - movs r0, 0x1 - add r8, r0 - mov r1, r8 - cmp r1, 0x5 - ble _0813290C - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ldrb r1, [r2, 0x6] - ldrb r0, [r2, 0x7] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x9] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end tai35_unk - - thumb_func_start dp15_get_weather__8 -dp15_get_weather__8: @ 8132994 - push {lr} - ldr r2, =gUnknown_020243CC - ldrh r1, [r2] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - beq _081329AC - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0x1 - str r0, [r1, 0x8] -_081329AC: - ldrh r1, [r2] - movs r0, 0x18 - ands r0, r1 - cmp r0, 0 - beq _081329C0 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0x2 - str r0, [r1, 0x8] -_081329C0: - ldrh r1, [r2] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _081329D4 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0 - str r0, [r1, 0x8] -_081329D4: - ldrh r1, [r2] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081329E8 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0x3 - str r0, [r1, 0x8] -_081329E8: - ldr r1, =gUnknown_0203AB38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end dp15_get_weather__8 - - thumb_func_start tai37_unk -tai37_unk: @ 8132A00 - push {lr} - ldr r2, =gBattleMoves - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldrh r1, [r0, 0x2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ldrb r0, [r0] - ldrb r1, [r2, 0x1] - cmp r0, r1 - bne _08132A44 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08132A48 - .pool -_08132A44: - adds r0, r2, 0x6 - str r0, [r3] -_08132A48: - pop {r0} - bx r0 - thumb_func_end tai37_unk - - thumb_func_start tai38_unk -tai38_unk: @ 8132A4C - push {lr} - ldr r2, =gBattleMoves - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldrh r1, [r0, 0x2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ldrb r0, [r0] - ldrb r1, [r2, 0x1] - cmp r0, r1 - beq _08132A90 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08132A94 - .pool -_08132A90: - adds r0, r2, 0x6 - str r0, [r3] -_08132A94: - pop {r0} - bx r0 - thumb_func_end tai38_unk - - thumb_func_start tai39_unk -tai39_unk: @ 8132A98 - push {r4,lr} - ldr r0, =gUnknown_0203AB38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0x1 - bne _08132AB4 - ldr r0, =gUnknown_0203AB3C - b _08132AB6 - .pool -_08132AB4: - ldr r0, =gUnknown_0202420C -_08132AB6: - ldrb r3, [r0] - ldr r1, =gUnknown_02024084 - ldr r2, [r4] - movs r0, 0x58 - muls r0, r3 - ldrb r3, [r2, 0x2] - adds r0, r3 - adds r1, 0x18 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrb r1, [r2, 0x3] - cmp r0, r1 - bge _08132AF4 - ldrb r1, [r2, 0x4] - ldrb r0, [r2, 0x5] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08132AFA - .pool -_08132AF4: - adds r0, r2, 0 - adds r0, 0x8 - str r0, [r4] -_08132AFA: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai39_unk - - thumb_func_start tai3A_unk -tai3A_unk: @ 8132B00 - push {r4,lr} - ldr r0, =gUnknown_0203AB38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0x1 - bne _08132B1C - ldr r0, =gUnknown_0203AB3C - b _08132B1E - .pool -_08132B1C: - ldr r0, =gUnknown_0202420C -_08132B1E: - ldrb r3, [r0] - ldr r1, =gUnknown_02024084 - ldr r2, [r4] - movs r0, 0x58 - muls r0, r3 - ldrb r3, [r2, 0x2] - adds r0, r3 - adds r1, 0x18 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrb r1, [r2, 0x3] - cmp r0, r1 - ble _08132B5C - ldrb r1, [r2, 0x4] - ldrb r0, [r2, 0x5] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08132B62 - .pool -_08132B5C: - adds r0, r2, 0 - adds r0, 0x8 - str r0, [r4] -_08132B62: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai3A_unk - - thumb_func_start tai3B_unk -tai3B_unk: @ 8132B68 - push {r4,lr} - ldr r0, =gUnknown_0203AB38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0x1 - bne _08132B84 - ldr r0, =gUnknown_0203AB3C - b _08132B86 - .pool -_08132B84: - ldr r0, =gUnknown_0202420C -_08132B86: - ldrb r3, [r0] - ldr r1, =gUnknown_02024084 - ldr r2, [r4] - movs r0, 0x58 - muls r0, r3 - ldrb r3, [r2, 0x2] - adds r0, r3 - adds r1, 0x18 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrb r1, [r2, 0x3] - cmp r0, r1 - bne _08132BC4 - ldrb r1, [r2, 0x4] - ldrb r0, [r2, 0x5] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08132BCA - .pool -_08132BC4: - adds r0, r2, 0 - adds r0, 0x8 - str r0, [r4] -_08132BCA: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai3B_unk - - thumb_func_start tai3C_unk -tai3C_unk: @ 8132BD0 - push {r4,lr} - ldr r0, =gUnknown_0203AB38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0x1 - bne _08132BEC - ldr r0, =gUnknown_0203AB3C - b _08132BEE - .pool -_08132BEC: - ldr r0, =gUnknown_0202420C -_08132BEE: - ldrb r3, [r0] - ldr r1, =gUnknown_02024084 - ldr r2, [r4] - movs r0, 0x58 - muls r0, r3 - ldrb r3, [r2, 0x2] - adds r0, r3 - adds r1, 0x18 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrb r1, [r2, 0x3] - cmp r0, r1 - beq _08132C2C - ldrb r1, [r2, 0x4] - ldrb r0, [r2, 0x5] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08132C32 - .pool -_08132C2C: - adds r0, r2, 0 - adds r0, 0x8 - str r0, [r4] -_08132C32: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai3C_unk - - thumb_func_start tai3D_unk -tai3D_unk: @ 8132C38 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r2, =gBattleMoves - ldr r0, =gUnknown_020244A8 - mov r8, r0 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldrh r1, [r0, 0x2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - bls _08132D1C - ldr r0, =gUnknown_02024400 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_0202449C - ldr r0, [r0] - strb r1, [r0, 0x13] - ldr r0, =gUnknown_02024474 - movs r7, 0x1 - strb r7, [r0, 0xE] - ldr r0, =gUnknown_0202427C - strb r1, [r0] - ldr r0, =gUnknown_02024211 - strb r7, [r0] - ldr r5, =gUnknown_020241EA - mov r1, r8 - ldr r0, [r1] - ldr r0, [r0, 0x14] - ldrh r0, [r0, 0x2] - strh r0, [r5] - ldr r4, =gUnknown_0203AB3C - ldrb r0, [r4] - ldr r6, =gUnknown_0202420C - ldrb r1, [r6] - bl sub_8046E7C - ldrh r0, [r5] - ldrb r1, [r4] - ldrb r2, [r6] - bl move_effectiveness_something - ldr r4, =gUnknown_020241F0 - mov r1, r8 - ldr r0, [r1] - ldr r1, [r0, 0x14] - adds r0, r1, 0 - adds r0, 0x18 - ldrb r1, [r1, 0x1] - adds r0, r1 - ldrb r1, [r0] - ldr r0, [r4] - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - str r0, [r4] - cmp r0, 0 - bne _08132CB8 - str r7, [r4] -_08132CB8: - ldr r2, =gUnknown_02024084 - ldrb r1, [r6] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r1, [r0, 0x28] - ldr r0, [r4] - cmp r1, r0 - bgt _08132D1C - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08132D24 - .pool -_08132D1C: - ldr r1, =gUnknown_0203AB38 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_08132D24: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end tai3D_unk - - thumb_func_start dp15_determine_move_damage_jump_if_not_fatal -dp15_determine_move_damage_jump_if_not_fatal: @ 8132D34 - push {r4-r7,lr} - ldr r2, =gBattleMoves - ldr r7, =gUnknown_020244A8 - ldr r0, [r7] - ldr r0, [r0, 0x14] - ldrh r1, [r0, 0x2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - bls _08132E04 - ldr r0, =gUnknown_02024400 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_0202449C - ldr r0, [r0] - strb r1, [r0, 0x13] - ldr r0, =gUnknown_02024474 - movs r2, 0x1 - strb r2, [r0, 0xE] - ldr r0, =gUnknown_0202427C - strb r1, [r0] - ldr r0, =gUnknown_02024211 - strb r2, [r0] - ldr r6, =gUnknown_020241EA - ldr r0, [r7] - ldr r0, [r0, 0x14] - ldrh r0, [r0, 0x2] - strh r0, [r6] - ldr r4, =gUnknown_0203AB3C - ldrb r0, [r4] - ldr r5, =gUnknown_0202420C - ldrb r1, [r5] - bl sub_8046E7C - ldrh r0, [r6] - ldrb r1, [r4] - ldrb r2, [r5] - bl move_effectiveness_something - ldr r4, =gUnknown_020241F0 - ldr r0, [r7] - ldr r1, [r0, 0x14] - adds r0, r1, 0 - adds r0, 0x18 - ldrb r1, [r1, 0x1] - adds r0, r1 - ldrb r1, [r0] - ldr r0, [r4] - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - str r0, [r4] - ldr r3, =gUnknown_02024084 - ldrb r2, [r5] - movs r1, 0x58 - muls r1, r2 - adds r1, r3 - ldrh r1, [r1, 0x28] - cmp r1, r0 - ble _08132E04 - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08132E0C - .pool -_08132E04: - ldr r1, =gUnknown_0203AB38 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_08132E0C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp15_determine_move_damage_jump_if_not_fatal - - thumb_func_start tai3F_unk -tai3F_unk: @ 8132E18 - push {r4-r7,lr} - ldr r0, =gUnknown_0203AB38 - ldr r5, [r0] - adds r7, r5, 0x2 - ldrb r1, [r5, 0x1] - adds r6, r0, 0 - cmp r1, 0x1 - beq _08132E42 - cmp r1, 0x1 - bgt _08132E38 - cmp r1, 0 - beq _08132EDC - b _08132F40 - .pool -_08132E38: - cmp r1, 0x2 - beq _08132EDC - cmp r1, 0x3 - beq _08132E84 - b _08132F40 -_08132E42: - movs r4, 0 - ldr r3, =gUnknown_02024084 - ldr r2, =gUnknown_0203AB3C - ldrb r1, [r2] - movs r0, 0x58 - muls r0, r1 - adds r3, 0xC - adds r0, r3 - ldrh r0, [r0] - ldrh r5, [r5, 0x2] - cmp r0, r5 - beq _08132E74 - movs r5, 0x58 -_08132E5C: - adds r4, 0x1 - cmp r4, 0x3 - bgt _08132E74 - lsls r1, r4, 1 - ldrb r0, [r2] - muls r0, r5 - adds r1, r0 - adds r1, r3 - ldrh r0, [r1] - ldrh r1, [r7] - cmp r0, r1 - bne _08132E5C -_08132E74: - cmp r4, 0x4 - beq _08132F18 - b _08132F28 - .pool -_08132E84: - ldr r3, =gUnknown_02024084 - ldr r2, =gUnknown_0203AB3C - ldrb r1, [r2] - movs r0, 0x2 - eors r0, r1 - movs r1, 0x58 - muls r1, r0 - adds r0, r1, r3 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08132EA8 - adds r0, r5, 0 - b _08132F1A - .pool -_08132EA8: - movs r4, 0 - adds r3, 0xC - adds r0, r1, r3 - ldrh r0, [r0] - ldrh r5, [r5, 0x2] - cmp r0, r5 - beq _08132E74 - mov r12, r3 - adds r5, r2, 0 - movs r3, 0x2 -_08132EBC: - adds r4, 0x1 - cmp r4, 0x3 - bgt _08132E74 - lsls r1, r4, 1 - ldrb r0, [r5] - adds r2, r3, 0 - eors r2, r0 - movs r0, 0x58 - muls r0, r2 - adds r1, r0 - add r1, r12 - ldrh r0, [r1] - ldrh r1, [r7] - cmp r0, r1 - bne _08132EBC - b _08132E74 -_08132EDC: - movs r4, 0 - ldr r3, =gUnknown_020244A8 - ldr r0, [r3] - ldr r1, [r0, 0x18] - ldr r2, =gUnknown_0202420C - ldrb r0, [r2] - lsls r0, 4 - adds r1, r0 - ldrh r0, [r1] - ldrh r1, [r7] - cmp r0, r1 - beq _08132F14 - adds r7, r3, 0 - adds r5, r2, 0 - adds r3, r1, 0 -_08132EFA: - adds r4, 0x1 - cmp r4, 0x3 - bgt _08132F14 - ldr r0, [r7] - ldr r2, [r0, 0x18] - lsls r1, r4, 1 - ldrb r0, [r5] - lsls r0, 4 - adds r1, r0 - adds r2, r1 - ldrh r0, [r2] - cmp r0, r3 - bne _08132EFA -_08132F14: - cmp r4, 0x4 - bne _08132F28 -_08132F18: - ldr r0, [r6] -_08132F1A: - adds r0, 0x8 - str r0, [r6] - b _08132F40 - .pool -_08132F28: - ldr r2, [r6] - ldrb r1, [r2, 0x4] - ldrb r0, [r2, 0x5] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 24 - orrs r1, r0 - str r1, [r6] -_08132F40: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end tai3F_unk - - thumb_func_start tai40_unk -tai40_unk: @ 8132F48 - push {r4-r7,lr} - ldr r1, =gUnknown_0203AB38 - ldr r0, [r1] - adds r6, r0, 0x2 - ldrb r0, [r0, 0x1] - adds r5, r1, 0 - cmp r0, 0x1 - beq _08132F70 - cmp r0, 0x1 - bgt _08132F68 - cmp r0, 0 - beq _08132FB4 - b _08133018 - .pool -_08132F68: - cmp r0, 0x2 - beq _08132FB4 - cmp r0, 0x3 - bne _08133018 -_08132F70: - movs r3, 0 - ldr r2, =gUnknown_02024084 - ldr r4, =gUnknown_0203AB3C - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 - adds r2, 0xC - adds r0, r2 - ldrh r0, [r0] - ldrh r1, [r6] - cmp r0, r1 - beq _08132FA6 - adds r7, r4, 0 - movs r6, 0x58 - adds r4, r2, 0 - adds r2, r1, 0 -_08132F90: - adds r3, 0x1 - cmp r3, 0x3 - bgt _08132FA6 - lsls r1, r3, 1 - ldrb r0, [r7] - muls r0, r6 - adds r1, r0 - adds r1, r4 - ldrh r0, [r1] - cmp r0, r2 - bne _08132F90 -_08132FA6: - cmp r3, 0x4 - bne _08132FF0 - b _08133000 - .pool -_08132FB4: - movs r3, 0 - ldr r4, =gUnknown_020244A8 - ldr r0, [r4] - ldr r1, [r0, 0x18] - ldr r2, =gUnknown_0202420C - ldrb r0, [r2] - lsls r0, 4 - adds r1, r0 - ldrh r0, [r1] - ldrh r1, [r6] - cmp r0, r1 - beq _08132FEC - adds r7, r4, 0 - adds r6, r2, 0 - adds r4, r1, 0 -_08132FD2: - adds r3, 0x1 - cmp r3, 0x3 - bgt _08132FEC - ldr r0, [r7] - ldr r2, [r0, 0x18] - lsls r1, r3, 1 - ldrb r0, [r6] - lsls r0, 4 - adds r1, r0 - adds r2, r1 - ldrh r0, [r2] - cmp r0, r4 - bne _08132FD2 -_08132FEC: - cmp r3, 0x4 - beq _08133000 -_08132FF0: - ldr r0, [r5] - adds r0, 0x8 - str r0, [r5] - b _08133018 - .pool -_08133000: - ldr r2, [r5] - ldrb r1, [r2, 0x4] - ldrb r0, [r2, 0x5] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 24 - orrs r1, r0 - str r1, [r5] -_08133018: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end tai40_unk - - thumb_func_start tai41_unk -tai41_unk: @ 8133020 - push {r4-r7,lr} - ldr r1, =gUnknown_0203AB38 - ldr r0, [r1] - ldrb r0, [r0, 0x1] - adds r5, r1, 0 - cmp r0, 0x1 - beq _08133044 - cmp r0, 0x1 - bgt _0813303C - cmp r0, 0 - beq _08133090 - b _08133110 - .pool -_0813303C: - cmp r0, 0x2 - beq _08133090 - cmp r0, 0x3 - bne _08133110 -_08133044: - movs r3, 0 - ldr r1, =gUnknown_02024084 - ldr r0, =gUnknown_0203AB3C - ldrb r2, [r0] - ldr r6, =gBattleMoves - movs r0, 0x58 - muls r0, r2 - adds r1, 0xC - adds r2, r0, r1 - ldr r4, =gUnknown_0203AB38 -_08133058: - ldrh r0, [r2] - cmp r0, 0 - beq _08133072 - adds r1, r0, 0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldr r1, [r4] - ldrb r0, [r0] - ldrb r1, [r1, 0x2] - cmp r0, r1 - beq _0813307A -_08133072: - adds r2, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - ble _08133058 -_0813307A: - cmp r3, 0x4 - beq _081330DC - b _081330F8 - .pool -_08133090: - movs r3, 0 - ldr r1, =gUnknown_02024084 - ldr r0, =gUnknown_0203AB3C - ldrb r2, [r0] - ldr r0, =gBattleMoves - mov r12, r0 - ldr r7, =gUnknown_020244A8 - ldr r6, =gUnknown_0202420C - movs r0, 0x58 - muls r0, r2 - adds r1, 0xC - adds r4, r0, r1 -_081330A8: - lsls r2, r3, 1 - ldrh r0, [r4] - cmp r0, 0 - beq _081330D0 - ldr r0, [r7] - ldr r1, [r0, 0x18] - ldrb r0, [r6] - lsls r0, 4 - adds r0, r2, r0 - adds r1, r0 - ldrh r1, [r1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - add r0, r12 - ldr r1, [r5] - ldrb r0, [r0] - ldrb r1, [r1, 0x2] - cmp r0, r1 - beq _081330D8 -_081330D0: - adds r4, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - ble _081330A8 -_081330D8: - cmp r3, 0x4 - bne _081330F8 -_081330DC: - ldr r0, [r5] - adds r0, 0x7 - str r0, [r5] - b _08133110 - .pool -_081330F8: - ldr r2, [r5] - ldrb r1, [r2, 0x3] - ldrb r0, [r2, 0x4] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 24 - orrs r1, r0 - str r1, [r5] -_08133110: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end tai41_unk - - thumb_func_start tai42_unk -tai42_unk: @ 8133118 - push {r4-r6,lr} - ldr r1, =gUnknown_0203AB38 - ldr r0, [r1] - ldrb r0, [r0, 0x1] - adds r4, r1, 0 - cmp r0, 0x1 - beq _0813313C - cmp r0, 0x1 - bgt _08133134 - cmp r0, 0 - beq _08133188 - b _081331F4 - .pool -_08133134: - cmp r0, 0x2 - beq _08133188 - cmp r0, 0x3 - bne _081331F4 -_0813313C: - movs r3, 0 - ldr r1, =gUnknown_02024084 - ldr r0, =gUnknown_0203AB3C - ldrb r2, [r0] - ldr r6, =gBattleMoves - movs r0, 0x58 - muls r0, r2 - adds r1, 0xC - adds r2, r0, r1 - ldr r5, =gUnknown_0203AB38 -_08133150: - ldrh r0, [r2] - cmp r0, 0 - beq _0813316A - adds r1, r0, 0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldr r1, [r5] - ldrb r0, [r0] - ldrb r1, [r1, 0x2] - cmp r0, r1 - beq _08133172 -_0813316A: - adds r2, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - ble _08133150 -_08133172: - cmp r3, 0x4 - bne _081331C2 - b _081331DC - .pool -_08133188: - movs r3, 0 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r1, [r0, 0x18] - ldr r0, =gUnknown_0202420C - ldrb r0, [r0] - ldr r6, =gBattleMoves - lsls r0, 4 - adds r2, r0, r1 - ldr r5, =gUnknown_0203AB38 -_0813319C: - ldrh r0, [r2] - cmp r0, 0 - beq _081331B6 - adds r1, r0, 0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldr r1, [r5] - ldrb r0, [r0] - ldrb r1, [r1, 0x2] - cmp r0, r1 - beq _081331BE -_081331B6: - adds r2, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - ble _0813319C -_081331BE: - cmp r3, 0x4 - beq _081331DC -_081331C2: - ldr r0, [r4] - adds r0, 0x7 - str r0, [r4] - b _081331F4 - .pool -_081331DC: - ldr r2, [r4] - ldrb r1, [r2, 0x3] - ldrb r0, [r2, 0x4] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] -_081331F4: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end tai42_unk - - thumb_func_start tai43_unk -tai43_unk: @ 81331FC - push {r4,r5,lr} - ldr r0, =gUnknown_0203AB38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r5, r0, 0 - cmp r1, 0x1 - bne _08133218 - ldr r0, =gUnknown_0203AB3C - b _0813321A - .pool -_08133218: - ldr r0, =gUnknown_0202420C -_0813321A: - ldrb r3, [r0] - adds r4, r5, 0 - ldr r2, [r4] - ldrb r0, [r2, 0x2] - cmp r0, 0 - bne _08133240 - ldr r0, =gUnknown_020242BC - lsls r1, r3, 3 - subs r1, r3 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x4] - cmp r0, 0 - beq _08133244 - b _0813325A - .pool -_08133240: - cmp r0, 0x1 - beq _0813324A -_08133244: - adds r0, r2, 0x7 - str r0, [r4] - b _0813327C -_0813324A: - ldr r0, =gUnknown_020242BC - lsls r1, r3, 3 - subs r1, r3 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x6] - cmp r0, 0 - beq _08133278 -_0813325A: - ldrb r1, [r2, 0x3] - ldrb r0, [r2, 0x4] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _0813327C - .pool -_08133278: - adds r0, r2, 0x7 - str r0, [r5] -_0813327C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end tai43_unk - - thumb_func_start tai44_unk -tai44_unk: @ 8133284 - push {r4,lr} - ldr r4, =gUnknown_0203AB38 - ldr r3, [r4] - ldrb r0, [r3, 0x1] - cmp r0, 0 - beq _0813329C - cmp r0, 0x1 - beq _081332C8 - b _08133308 - .pool -_0813329C: - ldr r2, =gUnknown_020242BC - ldr r0, =gUnknown_02024064 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =gUnknown_020244A8 - ldr r1, [r1] - ldr r1, [r1, 0x14] - ldrh r0, [r0, 0x4] - ldrh r1, [r1, 0x2] - cmp r0, r1 - beq _081332E4 - b _08133308 - .pool -_081332C8: - ldr r2, =gUnknown_020242BC - ldr r0, =gUnknown_02024064 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =gUnknown_020244A8 - ldr r1, [r1] - ldr r1, [r1, 0x14] - ldrh r0, [r0, 0x6] - ldrh r1, [r1, 0x2] - cmp r0, r1 - bne _08133308 -_081332E4: - ldrb r1, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _0813330C - .pool -_08133308: - adds r0, r3, 0x6 - str r0, [r4] -_0813330C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai44_unk - - thumb_func_start tai45_unk -tai45_unk: @ 8133314 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldrb r1, [r2, 0x10] - movs r0, 0xB - orrs r0, r1 - strb r0, [r2, 0x10] - bx lr - .pool - thumb_func_end tai45_unk - - thumb_func_start tai46_unk -tai46_unk: @ 8133328 - push {r4,lr} - ldr r0, =gUnknown_0202449C - ldr r0, [r0] - adds r0, 0x7B - ldrb r0, [r0] - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - cmp r0, r4 - bcs _08133374 - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0813337C - .pool -_08133374: - ldr r1, =gUnknown_0203AB38 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_0813337C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end tai46_unk - - thumb_func_start dp15_end_with_move_5 -dp15_end_with_move_5: @ 8133388 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldrb r1, [r2, 0x10] - movs r0, 0xD - orrs r0, r1 - strb r0, [r2, 0x10] - bx lr - .pool - thumb_func_end dp15_end_with_move_5 - - thumb_func_start dp15_get_held_item_x12__8 -dp15_get_held_item_x12__8: @ 813339C - push {r4,lr} - ldr r0, =gUnknown_0203AB38 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - bne _081333B4 - ldr r0, =gUnknown_0203AB3C - b _081333B6 - .pool -_081333B4: - ldr r0, =gUnknown_0202420C -_081333B6: - ldrb r2, [r0] - ldr r0, =gUnknown_02024064 - ldrb r0, [r0] - cmp r0, r2 - beq _081333E0 - ldr r4, =gUnknown_020244A8 - ldr r0, [r4] - ldr r0, [r0, 0x18] - adds r0, 0x44 - adds r0, r2 - ldrb r0, [r0] - bl itemid_get_x12 - ldr r1, [r4] - b _081333F2 - .pool -_081333E0: - ldr r1, =gUnknown_02024084 - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x2E] - bl itemid_get_x12 - ldr r1, =gUnknown_020244A8 - ldr r1, [r1] -_081333F2: - ldr r1, [r1, 0x14] - lsls r0, 24 - lsrs r0, 24 - str r0, [r1, 0x8] - ldr r1, =gUnknown_0203AB38 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp15_get_held_item_x12__8 - - thumb_func_start tai62_unk -tai62_unk: @ 8133414 - push {r4,lr} - ldr r0, =gUnknown_0203AB38 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl sub_8131E70 - lsls r0, 24 - lsrs r3, r0, 24 - movs r0, 0x1 - ldr r1, =gUnknown_0203AB3C - ldrb r2, [r1] - adds r1, r3, 0 - ands r1, r0 - ands r0, r2 - cmp r1, r0 - bne _0813344C - ldr r1, =gUnknown_02024084 - movs r0, 0x58 - muls r0, r3 - adds r0, r1 - ldrh r3, [r0, 0x2E] - b _08133458 - .pool -_0813344C: - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r0, [r0, 0x18] - adds r0, 0x44 - adds r0, r3 - ldrb r3, [r0] -_08133458: - ldr r4, =gUnknown_0203AB38 - ldr r2, [r4] - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - orrs r0, r1 - cmp r0, r3 - bne _08133488 - ldrb r1, [r2, 0x4] - ldrb r0, [r2, 0x5] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _0813348E - .pool -_08133488: - adds r0, r2, 0 - adds r0, 0x8 - str r0, [r4] -_0813348E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai62_unk - - thumb_func_start tai49_unk -tai49_unk: @ 8133494 - push {lr} - ldr r0, =gUnknown_0203AB38 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - bne _081334AC - ldr r0, =gUnknown_0203AB3C - b _081334AE - .pool -_081334AC: - ldr r0, =gUnknown_0202420C -_081334AE: - ldrb r1, [r0] - ldr r2, =gUnknown_02024084 - movs r0, 0x58 - muls r1, r0 - adds r0, r1, r2 - ldrh r0, [r0] - adds r2, 0x48 - adds r1, r2 - ldr r1, [r1] - bl pokemon_species_get_gender_info - ldr r1, =gUnknown_020244A8 - ldr r1, [r1] - ldr r1, [r1, 0x14] - lsls r0, 24 - lsrs r0, 24 - str r0, [r1, 0x8] - ldr r1, =gUnknown_0203AB38 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end tai49_unk - - thumb_func_start dp15_enter_battle_countdown_get_state -dp15_enter_battle_countdown_get_state: @ 81334EC - push {r4,lr} - ldr r0, =gUnknown_0203AB38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0x1 - bne _08133508 - ldr r0, =gUnknown_0203AB3C - b _0813350A - .pool -_08133508: - ldr r0, =gUnknown_0202420C -_0813350A: - ldrb r3, [r0] - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldr r1, =gUnknown_020242BC - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x16] - str r0, [r2, 0x8] - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp15_enter_battle_countdown_get_state - - thumb_func_start dp15_stockpile_get_num_uses -dp15_stockpile_get_num_uses: @ 8133538 - push {r4,lr} - ldr r0, =gUnknown_0203AB38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0x1 - bne _08133554 - ldr r0, =gUnknown_0203AB3C - b _08133556 - .pool -_08133554: - ldr r0, =gUnknown_0202420C -_08133556: - ldrb r3, [r0] - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldr r1, =gUnknown_020242BC - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x9] - str r0, [r2, 0x8] - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp15_stockpile_get_num_uses - - thumb_func_start dp15_is_double_battle -dp15_is_double_battle: @ 8133584 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldr r0, =gUnknown_02022FEC - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - str r0, [r2, 0x8] - ldr r1, =gUnknown_0203AB38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end dp15_is_double_battle - - thumb_func_start dp15_get_dp08_item__8 -dp15_get_dp08_item__8: @ 81335AC - push {r4,lr} - ldr r0, =gUnknown_0203AB38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0x1 - bne _081335C8 - ldr r0, =gUnknown_0203AB3C - b _081335CA - .pool -_081335C8: - ldr r0, =gUnknown_0202420C -_081335CA: - ldrb r3, [r0] - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldr r0, =gUnknown_0202449C - ldr r1, [r0] - lsls r0, r3, 1 - adds r0, r1 - adds r0, 0xB8 - ldrb r0, [r0] - str r0, [r2, 0x8] - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp15_get_dp08_item__8 - - thumb_func_start dp15_move_get_type__8 -dp15_move_get_type__8: @ 81335F8 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r3, [r0, 0x14] - ldr r2, =gBattleMoves - ldr r1, [r3, 0x8] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x2] - str r0, [r3, 0x8] - ldr r1, =gUnknown_0203AB38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end dp15_move_get_type__8 - - thumb_func_start dp15_move_get_power__8_8 -dp15_move_get_power__8_8: @ 8133624 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r3, [r0, 0x14] - ldr r2, =gBattleMoves - ldr r1, [r3, 0x8] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - str r0, [r3, 0x8] - ldr r1, =gUnknown_0203AB38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end dp15_move_get_power__8_8 - - thumb_func_start dp15_move_get_move_script_id__8 -dp15_move_get_move_script_id__8: @ 8133650 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r3, [r0, 0x14] - ldr r2, =gBattleMoves - ldr r1, [r3, 0x8] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - str r0, [r3, 0x8] - ldr r1, =gUnknown_0203AB38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end dp15_move_get_move_script_id__8 - - thumb_func_start dp15_get_protect_endure_activity -dp15_get_protect_endure_activity: @ 813367C - push {r4,lr} - ldr r0, =gUnknown_0203AB38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0x1 - bne _08133698 - ldr r0, =gUnknown_0203AB3C - b _0813369A - .pool -_08133698: - ldr r0, =gUnknown_0202420C -_0813369A: - ldrb r3, [r0] - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldr r1, =gUnknown_020242BC - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x8] - str r0, [r2, 0x8] - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp15_get_protect_endure_activity - - thumb_func_start nullsub_106 -nullsub_106: @ 81336C8 - bx lr - thumb_func_end nullsub_106 - - thumb_func_start nullsub_107 -nullsub_107: @ 81336CC - bx lr - thumb_func_end nullsub_107 - - thumb_func_start nullsub_108 -nullsub_108: @ 81336D0 - bx lr - thumb_func_end nullsub_108 - - thumb_func_start nullsub_109 -nullsub_109: @ 81336D4 - bx lr - thumb_func_end nullsub_109 - - thumb_func_start nullsub_110 -nullsub_110: @ 81336D8 - bx lr - thumb_func_end nullsub_110 - - thumb_func_start nullsub_111 -nullsub_111: @ 81336DC - bx lr - thumb_func_end nullsub_111 - - thumb_func_start tai58_unk -tai58_unk: @ 81336E0 - push {r4,lr} - ldr r4, =gUnknown_0203AB38 - ldr r0, [r4] - adds r0, 0x5 - bl b_mc_stack_push - ldr r2, [r4] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end tai58_unk - - thumb_func_start dp15_jump -dp15_jump: @ 8133710 - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - bx lr - .pool - thumb_func_end dp15_jump - - thumb_func_start dp15_return -dp15_return: @ 8133730 - push {lr} - bl b_mc_stack_pop_cursor - lsls r0, 24 - cmp r0, 0 - bne _0813374A - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldrb r1, [r2, 0x10] - movs r0, 0x1 - orrs r0, r1 - strb r0, [r2, 0x10] -_0813374A: - pop {r0} - bx r0 - .pool - thumb_func_end dp15_return - - thumb_func_start dp15_compare_attacker_defender_levels -dp15_compare_attacker_defender_levels: @ 8133754 - push {r4,r5,lr} - ldr r5, =gUnknown_0203AB38 - ldr r4, [r5] - ldrb r0, [r4, 0x1] - cmp r0, 0x1 - beq _081337A8 - cmp r0, 0x1 - bgt _08133770 - cmp r0, 0 - beq _08133776 - b _08133824 - .pool -_08133770: - cmp r0, 0x2 - beq _081337D8 - b _08133824 -_08133776: - ldr r3, =gUnknown_02024084 - ldr r0, =gUnknown_0203AB3C - ldrb r0, [r0] - movs r2, 0x58 - adds r1, r0, 0 - muls r1, r2 - adds r1, r3 - adds r1, 0x2A - ldr r0, =gUnknown_0202420C - ldrb r0, [r0] - muls r0, r2 - adds r0, r3 - adds r0, 0x2A - ldrb r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - bhi _081337FA - b _08133820 - .pool -_081337A8: - ldr r3, =gUnknown_02024084 - ldr r0, =gUnknown_0203AB3C - ldrb r0, [r0] - movs r2, 0x58 - adds r1, r0, 0 - muls r1, r2 - adds r1, r3 - adds r1, 0x2A - ldr r0, =gUnknown_0202420C - ldrb r0, [r0] - muls r0, r2 - adds r0, r3 - adds r0, 0x2A - ldrb r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - bcc _081337FA - b _08133820 - .pool -_081337D8: - ldr r3, =gUnknown_02024084 - ldr r0, =gUnknown_0203AB3C - ldrb r0, [r0] - movs r2, 0x58 - adds r1, r0, 0 - muls r1, r2 - adds r1, r3 - adds r1, 0x2A - ldr r0, =gUnknown_0202420C - ldrb r0, [r0] - muls r0, r2 - adds r0, r3 - adds r0, 0x2A - ldrb r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - bne _08133820 -_081337FA: - ldrb r1, [r4, 0x2] - ldrb r0, [r4, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r4, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r4, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r5] - b _08133824 - .pool -_08133820: - adds r0, r4, 0x6 - str r0, [r5] -_08133824: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end dp15_compare_attacker_defender_levels - - thumb_func_start tai5C_unk -tai5C_unk: @ 813382C - push {lr} - ldr r2, =gUnknown_020242BC - ldr r0, =gUnknown_0202420C - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x13] - lsls r0, 28 - cmp r0, 0 - beq _0813386C - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08133874 - .pool -_0813386C: - ldr r1, =gUnknown_0203AB38 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_08133874: - pop {r0} - bx r0 - .pool - thumb_func_end tai5C_unk - - thumb_func_start tai5D_unk -tai5D_unk: @ 813387C - push {lr} - ldr r2, =gUnknown_020242BC - ldr r0, =gUnknown_0202420C - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x13] - lsls r0, 28 - cmp r0, 0 - bne _081338BC - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081338C4 - .pool -_081338BC: - ldr r1, =gUnknown_0203AB38 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_081338C4: - pop {r0} - bx r0 - .pool - thumb_func_end tai5D_unk - - thumb_func_start tai5E_unk -tai5E_unk: @ 81338CC - push {lr} - ldr r0, =gUnknown_0203AB3C - ldrb r3, [r0] - movs r0, 0x1 - ldr r1, =gUnknown_0202420C - ldrb r2, [r1] - adds r1, r0, 0 - ands r1, r3 - ands r0, r2 - cmp r1, r0 - bne _0813390C - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08133914 - .pool -_0813390C: - ldr r1, =gUnknown_0203AB38 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_08133914: - pop {r0} - bx r0 - .pool - thumb_func_end tai5E_unk - - thumb_func_start tai61_unk -tai61_unk: @ 813391C - push {r4,lr} - ldr r4, =gUnknown_0203AB38 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl sub_8131E70 - lsls r0, 24 - ldr r1, =gUnknown_020244A8 - ldr r1, [r1] - ldr r1, [r1, 0x4] - lsrs r0, 22 - adds r1, r0 - ldr r0, [r1] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08133960 - ldr r2, [r4] - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08133966 - .pool -_08133960: - ldr r0, [r4] - adds r0, 0x6 - str r0, [r4] -_08133966: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai61_unk - - thumb_func_start b_mc_stack_push -b_mc_stack_push: @ 813396C - push {r4,lr} - ldr r1, =gUnknown_020244A8 - ldr r1, [r1] - ldr r3, [r1, 0x1C] - adds r4, r3, 0 - adds r4, 0x20 - ldrb r1, [r4] - adds r2, r1, 0x1 - strb r2, [r4] - lsls r1, 24 - lsrs r1, 22 - adds r3, r1 - str r0, [r3] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end b_mc_stack_push - - thumb_func_start b_mc_stack_push_cursor -b_mc_stack_push_cursor: @ 8133990 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r2, [r0, 0x1C] - adds r3, r2, 0 - adds r3, 0x20 - ldrb r0, [r3] - adds r1, r0, 0x1 - strb r1, [r3] - lsls r0, 24 - lsrs r0, 22 - adds r2, r0 - ldr r0, =gUnknown_0203AB38 - ldr r0, [r0] - str r0, [r2] - bx lr - .pool - thumb_func_end b_mc_stack_push_cursor - - thumb_func_start b_mc_stack_pop_cursor -b_mc_stack_pop_cursor: @ 81339B8 - push {lr} - ldr r3, =gUnknown_020244A8 - ldr r0, [r3] - ldr r0, [r0, 0x1C] - adds r1, r0, 0 - adds r1, 0x20 - ldrb r0, [r1] - cmp r0, 0 - bne _081339D4 - movs r0, 0 - b _081339EE - .pool -_081339D4: - subs r0, 0x1 - strb r0, [r1] - ldr r2, =gUnknown_0203AB38 - ldr r0, [r3] - ldr r1, [r0, 0x1C] - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - lsls r0, 2 - adds r1, r0 - ldr r0, [r1] - str r0, [r2] - movs r0, 0x1 -_081339EE: - pop {r1} - bx r1 - .pool - thumb_func_end b_mc_stack_pop_cursor - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/battle_anim.s b/asm/battle_anim.s new file mode 100644 index 000000000..18e09542a --- /dev/null +++ b/asm/battle_anim.s @@ -0,0 +1,4205 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80A3934 +sub_80A3934: @ 80A3934 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =gUnknown_020383FC + movs r1, 0 + strb r1, [r0] + ldr r0, =gUnknown_020383FD + strb r1, [r0] + ldr r0, =gUnknown_020383FE + strb r1, [r0] + ldr r0, =gUnknown_020383FF + strb r1, [r0] + ldr r0, =gUnknown_02038400 + movs r1, 0 + str r1, [r0] + ldr r0, =gUnknown_02038404 + str r1, [r0] + ldr r0, =gUnknown_02038408 + movs r2, 0 + strh r1, [r0] + ldr r0, =gUnknown_0203841A + strb r2, [r0] + ldr r4, =gUnknown_02038430 + ldr r5, =gUnknown_02038432 + ldr r6, =gUnknown_02038433 + ldr r7, =gUnknown_02038434 + ldr r0, =gUnknown_02038436 + mov r12, r0 + ldr r1, =gUnknown_02038437 + mov r8, r1 + ldr r0, =gUnknown_02038440 + mov r9, r0 + ldr r1, =0x0000ffff + adds r3, r1, 0 + ldr r1, =gUnknown_0203840A + movs r2, 0x7 +_080A397E: + ldrh r0, [r1] + orrs r0, r3 + strh r0, [r1] + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _080A397E + ldr r1, =gUnknown_0203841E + movs r2, 0 + adds r0, r1, 0 + adds r0, 0xE +_080A3994: + strh r2, [r0] + subs r0, 0x2 + cmp r0, r1 + bge _080A3994 + movs r1, 0 + movs r0, 0xFF + strb r0, [r4] + movs r0, 0x1 + negs r0, r0 + strb r0, [r4, 0x1] + strb r1, [r5] + strb r1, [r6] + movs r0, 0 + strh r1, [r7] + mov r1, r12 + strb r0, [r1] + mov r1, r8 + strb r0, [r1] + mov r1, r9 + strb r0, [r1] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3934 + + thumb_func_start move_anim_start_t1 +move_anim_start_t1: @ 80A3A10 + push {lr} + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r2, =gUnknown_02038436 + ldr r0, =gUnknown_0202420B + ldrb r0, [r0] + strb r0, [r2] + ldr r2, =gUnknown_02038437 + ldr r0, =gEnemyMonIndex + ldrb r0, [r0] + strb r0, [r2] + ldr r0, =gUnknown_082C8D6C + movs r2, 0x1 + bl move_something + pop {r0} + bx r0 + .pool + thumb_func_end move_anim_start_t1 + + thumb_func_start move_something +move_something: @ 80A3A48 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + str r0, [sp] + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A3AE8 + bl sub_80A8278 + movs r0, 0 + bl sub_8072A88 + movs r4, 0 + mov r0, r8 + lsls r0, 2 + mov r10, r0 + ldr r6, =gUnknown_0202406E + movs r7, 0x64 + ldr r5, =gUnknown_02038438 +_080A3A84: + lsls r0, r4, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A3AA8 + ldrh r0, [r6] + muls r0, r7 + ldr r1, =gEnemyParty + b _080A3AAE + .pool +_080A3AA8: + ldrh r0, [r6] + muls r0, r7 + ldr r1, =gPlayerParty +_080A3AAE: + adds r0, r1 + movs r1, 0xB + bl GetMonData + strh r0, [r5] + adds r6, 0x2 + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _080A3A84 + ldr r3, =gUnknown_02038434 + ldr r5, =gUnknown_02038430 + ldr r1, =gUnknown_020383FD + mov r12, r1 + ldr r7, =gUnknown_020383F8 + ldr r6, =move_anim_execute + b _080A3B10 + .pool +_080A3AE8: + ldr r3, =gUnknown_02038434 + ldr r5, =gUnknown_02038430 + mov r0, r8 + lsls r0, 2 + mov r10, r0 + ldr r1, =gUnknown_020383FD + mov r12, r1 + ldr r7, =gUnknown_020383F8 + ldr r6, =move_anim_execute + ldr r2, =gUnknown_02039F34 + ldr r1, =gUnknown_02038438 + movs r4, 0x3 +_080A3B00: + ldr r0, [r2] + ldr r0, [r0, 0x18] + ldrh r0, [r0] + strh r0, [r1] + adds r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _080A3B00 +_080A3B10: + mov r0, r9 + cmp r0, 0 + bne _080A3B38 + strh r0, [r3] + b _080A3B3C + .pool +_080A3B38: + mov r1, r8 + strh r1, [r3] +_080A3B3C: + ldr r1, =gUnknown_0203841E + movs r2, 0 + adds r0, r1, 0 + adds r0, 0xE +_080A3B44: + strh r2, [r0] + subs r0, 0x2 + cmp r0, r1 + bge _080A3B44 + movs r0, 0xFF + strb r0, [r5] + movs r0, 0x1 + negs r0, r0 + strb r0, [r5, 0x1] + ldr r0, [sp] + add r0, r10 + ldr r0, [r0] + ldr r1, =gUnknown_020383F0 + str r0, [r1] + movs r0, 0x1 + mov r1, r12 + strb r0, [r1] + movs r0, 0 + ldr r1, =gUnknown_020383FC + strb r0, [r1] + str r6, [r7] + ldr r0, =0x0000ffff + adds r2, r0, 0 + ldr r1, =gUnknown_0203840A + movs r4, 0x7 +_080A3B76: + ldrh r0, [r1] + orrs r0, r2 + strh r0, [r1] + adds r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _080A3B76 + mov r1, r9 + cmp r1, 0 + beq _080A3BC2 + movs r4, 0 + ldr r2, =gUnknown_082C8D64 + b _080A3BAA + .pool +_080A3BA8: + adds r4, 0x1 +_080A3BAA: + lsls r0, r4, 1 + adds r0, r2 + ldrh r0, [r0] + ldr r1, =0x0000ffff + cmp r0, r1 + beq _080A3BC2 + cmp r8, r0 + bne _080A3BA8 + ldr r0, =gMPlay_BGM + movs r2, 0x80 + bl m4aMPlayVolumeControl +_080A3BC2: + ldr r0, =gUnknown_02022E24 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E26 + strh r1, [r0] + ldr r0, =gUnknown_02022E28 + strh r1, [r0] + ldr r0, =gUnknown_02022E2A + strh r1, [r0] + 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 move_something + + thumb_func_start move_anim_8072740 +move_anim_8072740: @ 80A3BFC + push {r4,lr} + adds r4, r0, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + ldr r1, =gUnknown_020383FE + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end move_anim_8072740 + + thumb_func_start move_anim_task_del +move_anim_task_del: @ 80A3C1C + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + ldr r1, =gUnknown_020383FE + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end move_anim_task_del + + thumb_func_start move_anim_related_task_del +move_anim_related_task_del: @ 80A3C38 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + ldr r1, =gUnknown_020383FF + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end move_anim_related_task_del + + thumb_func_start sub_80A3C54 +sub_80A3C54: @ 80A3C54 + push {r4,lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r4, =0x0000ffff + ldr r1, =gUnknown_0203840A +_080A3C60: + ldrh r0, [r1] + cmp r0, r4 + bne _080A3C74 + strh r3, [r1] + b _080A3C7C + .pool +_080A3C74: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x7 + ble _080A3C60 +_080A3C7C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A3C54 + + thumb_func_start sub_80A3C84 +sub_80A3C84: @ 80A3C84 + push {r4,lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r0, =0x0000ffff + adds r4, r0, 0 + ldr r1, =gUnknown_0203840A +_080A3C92: + ldrh r0, [r1] + cmp r0, r3 + bne _080A3CA8 + orrs r0, r4 + strh r0, [r1] + b _080A3CB0 + .pool +_080A3CA8: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x7 + ble _080A3C92 +_080A3CB0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A3C84 + + thumb_func_start move_anim_waiter +move_anim_waiter: @ 80A3CB8 + push {lr} + ldr r2, =gUnknown_020383FC + ldrb r1, [r2] + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r0, 0 + bgt _080A3CDC + ldr r0, =gUnknown_020383F8 + ldr r1, =move_anim_execute + str r1, [r0] + movs r0, 0 + b _080A3CDE + .pool +_080A3CDC: + subs r0, r1, 0x1 +_080A3CDE: + strb r0, [r2] + pop {r0} + bx r0 + thumb_func_end move_anim_waiter + + thumb_func_start move_anim_execute +move_anim_execute: @ 80A3CE4 + push {r4,lr} + ldr r4, =gUnknown_08525E98 +_080A3CE8: + ldr r0, =gUnknown_020383F0 + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =gUnknown_020383FC + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bne _080A3D0C + ldr r0, =gUnknown_020383FD + ldrb r0, [r0] + cmp r0, 0 + bne _080A3CE8 +_080A3D0C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end move_anim_execute + + thumb_func_start ma00_load_graphics +ma00_load_graphics: @ 80A3D24 + push {r4-r6,lr} + ldr r6, =gUnknown_020383F0 + ldr r0, [r6] + adds r1, r0, 0x1 + str r1, [r6] + ldrb r4, [r0, 0x1] + ldrb r0, [r1, 0x1] + lsls r0, 8 + orrs r4, r0 + lsls r5, r4, 3 + ldr r0, =gUnknown_085112C4 + adds r0, r5, r0 + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_08511BCC + adds r5, r0 + adds r0, r5, 0 + bl LoadCompressedObjectPaletteUsingHeap + ldr r0, [r6] + adds r0, 0x2 + str r0, [r6] + ldr r0, =0xffffd8f0 + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + bl sub_80A3C54 + ldr r1, =gUnknown_020383FC + movs r0, 0x1 + strb r0, [r1] + ldr r1, =gUnknown_020383F8 + ldr r0, =move_anim_waiter + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end ma00_load_graphics + + thumb_func_start ma01_080728D0 +@ void ma01_080728D0() +ma01_080728D0: @ 80A3D8C + push {r4-r6,lr} + ldr r6, =gUnknown_020383F0 + ldr r0, [r6] + adds r1, r0, 0x1 + str r1, [r6] + ldrb r4, [r0, 0x1] + ldrb r0, [r1, 0x1] + lsls r0, 8 + orrs r4, r0 + ldr r1, =gUnknown_08524B44 + ldr r0, =0xffffd8f0 + adds r4, r0 + lsls r0, r4, 3 + adds r0, r1 + ldrh r5, [r0, 0x6] + adds r0, r5, 0 + bl FreeObjectTilesByTag + adds r0, r5, 0 + bl FreeObjectPaletteByTag + ldr r0, [r6] + adds r0, 0x2 + str r0, [r6] + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + bl sub_80A3C84 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end ma01_080728D0 + + thumb_func_start ma02_instanciate_template +ma02_instanciate_template: @ 80A3DD8 + push {r4-r7,lr} + ldr r5, =gUnknown_020383F0 + ldr r1, [r5] + adds r3, r1, 0x1 + str r3, [r5] + ldrb r2, [r1, 0x1] + ldrb r0, [r3, 0x1] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r3, 0x2] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r3, 0x3] + lsls r0, 24 + adds r7, r2, r0 + adds r0, r1, 0x5 + str r0, [r5] + ldrb r4, [r1, 0x5] + adds r0, r1, 0x6 + str r0, [r5] + ldrb r0, [r1, 0x6] + adds r1, 0x7 + str r1, [r5] + cmp r0, 0 + beq _080A3E28 + adds r6, r5, 0 + ldr r5, =gUnknown_0203841E + adds r3, r0, 0 +_080A3E10: + ldr r2, [r6] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + strh r1, [r5] + adds r2, 0x2 + str r2, [r6] + adds r5, 0x2 + subs r3, 0x1 + cmp r3, 0 + bne _080A3E10 +_080A3E28: + movs r0, 0x80 + ands r0, r4 + cmp r0, 0 + beq _080A3E58 + movs r0, 0x80 + eors r4, r0 + cmp r4, 0x3F + bls _080A3E48 + adds r0, r4, 0 + subs r0, 0x40 + b _080A3E4A + .pool +_080A3E48: + negs r0, r4 +_080A3E4A: + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_02038437 + b _080A3E6A + .pool +_080A3E58: + cmp r4, 0x3F + bls _080A3E62 + adds r0, r4, 0 + subs r0, 0x40 + b _080A3E64 +_080A3E62: + negs r0, r4 +_080A3E64: + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_02038436 +_080A3E6A: + ldrb r0, [r0] + bl sub_80A82E4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r4, 24 + asrs r1, 24 + adds r0, r1 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r0, r6, 16 + asrs r0, 16 + cmp r0, 0x2 + bgt _080A3E88 + movs r6, 0x3 +_080A3E88: + ldr r5, =gUnknown_02038437 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r3, r6, 24 + lsrs r3, 24 + adds r0, r7, 0 + adds r1, r4, 0 + bl AddObjectAndAnimateForOneFrame + ldr r1, =gUnknown_020383FE + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ma02_instanciate_template + + thumb_func_start sub_80A3ECC +sub_80A3ECC: @ 80A3ECC + push {r4-r7,lr} + ldr r4, =gUnknown_020383F0 + ldr r1, [r4] + adds r3, r1, 0x1 + str r3, [r4] + ldrb r2, [r1, 0x1] + ldrb r0, [r3, 0x1] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r3, 0x2] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r3, 0x3] + lsls r0, 24 + adds r6, r2, r0 + adds r0, r1, 0x5 + str r0, [r4] + ldrb r7, [r1, 0x5] + adds r0, r1, 0x6 + str r0, [r4] + ldrb r0, [r1, 0x6] + adds r1, 0x7 + str r1, [r4] + cmp r0, 0 + beq _080A3F1C + adds r5, r4, 0 + ldr r4, =gUnknown_0203841E + adds r3, r0, 0 +_080A3F04: + ldr r2, [r5] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + strh r1, [r4] + adds r2, 0x2 + str r2, [r5] + adds r4, 0x2 + subs r3, 0x1 + cmp r3, 0 + bne _080A3F04 +_080A3F1C: + adds r0, r6, 0 + adds r1, r7, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r6 + ldr r1, =gUnknown_020383FE + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3ECC + + thumb_func_start ma04_wait_countdown +ma04_wait_countdown: @ 80A3F48 + push {r4,lr} + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + adds r2, r0, 0x1 + str r2, [r1] + ldr r3, =gUnknown_020383FC + ldrb r0, [r0, 0x1] + strb r0, [r3] + lsls r0, 24 + cmp r0, 0 + bne _080A3F66 + movs r4, 0x1 + negs r4, r4 + adds r0, r4, 0 + strb r0, [r3] +_080A3F66: + adds r0, r2, 0x1 + str r0, [r1] + ldr r1, =gUnknown_020383F8 + ldr r0, =move_anim_waiter + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ma04_wait_countdown + + thumb_func_start sub_80A3F88 +sub_80A3F88: @ 80A3F88 + push {lr} + ldr r0, =gUnknown_020383FE + ldrb r2, [r0] + cmp r2, 0 + bne _080A3FAC + ldr r0, =gUnknown_020383F0 + ldr r1, [r0] + adds r1, 0x1 + str r1, [r0] + ldr r0, =gUnknown_020383FC + strb r2, [r0] + b _080A3FB2 + .pool +_080A3FAC: + ldr r1, =gUnknown_020383FC + movs r0, 0x1 + strb r0, [r1] +_080A3FB2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3F88 + + thumb_func_start nullsub_6 +nullsub_6: @ 80A3FBC + bx lr + thumb_func_end nullsub_6 + + thumb_func_start nullsub_7 +nullsub_7: @ 80A3FC0 + bx lr + thumb_func_end nullsub_7 + + thumb_func_start sub_80A3FC4 +sub_80A3FC4: @ 80A3FC4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r0, 0 + mov r8, r0 + ldr r0, =gUnknown_020383FE + ldrb r0, [r0] + cmp r0, 0 + bne _080A3FEC + ldr r0, =gUnknown_020383FF + ldrb r0, [r0] + cmp r0, 0 + bne _080A3FEC + ldr r1, =gUnknown_02038430 + ldrb r0, [r1] + cmp r0, 0xFF + bne _080A3FEC + ldrb r0, [r1, 0x1] + cmp r0, 0xFF + beq _080A4004 +_080A3FEC: + ldr r1, =gUnknown_0203842E + movs r0, 0 + strh r0, [r1] + b _080A401E + .pool +_080A4004: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _080A403C + ldr r1, =gUnknown_0203842E + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5A + bhi _080A4030 +_080A401E: + ldr r1, =gUnknown_020383FC + movs r0, 0x1 + strb r0, [r1] + b _080A40A2 + .pool +_080A4030: + ldr r0, =gMPlay_SE1 + bl m4aMPlayStop + ldr r0, =gMPlay_SE2 + bl m4aMPlayStop +_080A403C: + ldr r1, =gUnknown_0203842E + movs r0, 0 + strh r0, [r1] + movs r5, 0 + ldr r7, =0x0000ffff + ldr r6, =gUnknown_08524B44 + ldr r4, =gUnknown_0203840A +_080A404A: + ldrh r0, [r4] + cmp r0, r7 + beq _080A406E + lsls r0, 3 + adds r0, r6 + ldrh r0, [r0, 0x6] + bl FreeObjectTilesByTag + ldrh r0, [r4] + lsls r0, 3 + adds r0, r6 + ldrh r0, [r0, 0x6] + bl FreeObjectPaletteByTag + ldrh r1, [r4] + adds r0, r7, 0 + orrs r0, r1 + strh r0, [r4] +_080A406E: + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x7 + ble _080A404A + mov r1, r8 + cmp r1, 0 + bne _080A40A2 + ldr r0, =gMPlay_BGM + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl m4aMPlayVolumeControl + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A409C + bl sub_80A8278 + movs r0, 0x1 + bl sub_8072A88 +_080A409C: + ldr r0, =gUnknown_020383FD + mov r1, r8 + strb r1, [r0] +_080A40A2: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3FC4 + + thumb_func_start ma09_play_sound +ma09_play_sound: @ 80A40CC + push {r4,lr} + ldr r4, =gUnknown_020383F0 + ldr r0, [r4] + adds r1, r0, 0x1 + str r1, [r4] + ldrb r0, [r0, 0x1] + ldrb r1, [r1, 0x1] + lsls r1, 8 + orrs r0, r1 + bl audio_play + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ma09_play_sound + + thumb_func_start sub_80A40F4 +sub_80A40F4: @ 80A40F4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + mov r8, r1 + adds r6, r0, r1 + ldr r1, =gUnknown_020241E4 + movs r2, 0 + ldrsh r0, [r6, r2] + adds r0, r1 + ldrb r5, [r0] + ldr r1, =gUnknown_02020630 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r4, r0, r1 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + movs r3, 0x4 + ldrsh r0, [r6, r3] + cmp r0, 0 + bne _080A4148 + adds r0, r7, 0 + bl move_anim_task_del + b _080A41BE + .pool +_080A4148: + ldr r0, =task_pA_ma0A_obj_to_bg_pal + movs r1, 0xA + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + mov r1, r8 + subs r1, 0x8 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0, r1 + strh r5, [r1, 0x8] + ldrh r0, [r4, 0x24] + ldrh r3, [r4, 0x20] + adds r0, r3 + strh r0, [r1, 0xA] + ldrh r0, [r4, 0x26] + ldrh r4, [r4, 0x22] + adds r0, r4 + strh r0, [r1, 0xC] + movs r3, 0x2 + ldrsh r0, [r6, r3] + cmp r0, 0 + bne _080A4190 + ldr r0, =gUnknown_02022E18 + ldrh r0, [r0] + strh r0, [r1, 0xE] + ldr r0, =gUnknown_02022E1A + b _080A4198 + .pool +_080A4190: + ldr r0, =gUnknown_02022E1C + ldrh r0, [r0] + strh r0, [r1, 0xE] + ldr r0, =gUnknown_02022E1E +_080A4198: + ldrh r0, [r0] + strh r0, [r1, 0x10] + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r6, 0x2] + strh r1, [r0, 0x12] + ldrh r1, [r6] + strh r1, [r0, 0x14] + ldr r1, =gUnknown_02038430 + movs r3, 0x6 + ldrsh r0, [r6, r3] + adds r0, r1 + strb r2, [r0] + adds r0, r7, 0 + bl move_anim_task_del +_080A41BE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A40F4 + + thumb_func_start sub_80A41D8 +sub_80A41D8: @ 80A41D8 + push {r4,r5,lr} + ldr r1, =gUnknown_020383F0 + ldr r2, [r1] + adds r0, r2, 0x1 + str r0, [r1] + ldrb r0, [r2, 0x1] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080A41F8 + ldr r0, =gUnknown_02038437 + b _080A41FA + .pool +_080A41F8: + ldr r0, =gUnknown_02038436 +_080A41FA: + ldrb r4, [r0] + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A4266 + adds r0, r4, 0 + bl battle_get_per_side_status + lsls r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bls _080A4226 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A4230 +_080A4226: + movs r5, 0 + b _080A4232 + .pool +_080A4230: + movs r5, 0x1 +_080A4232: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl sub_80A438C + ldr r0, =sub_80A40F4 + movs r1, 0xA + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =gUnknown_020383FE + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + strh r4, [r0, 0x8] + strh r5, [r0, 0xA] + movs r1, 0x1 + strh r1, [r0, 0xC] + strh r2, [r0, 0xE] +_080A4266: + movs r0, 0x2 + eors r4, r0 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A42D8 + adds r0, r4, 0 + bl battle_get_per_side_status + lsls r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bls _080A4294 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A42A4 +_080A4294: + movs r5, 0 + b _080A42A6 + .pool +_080A42A4: + movs r5, 0x1 +_080A42A6: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl sub_80A438C + ldr r0, =sub_80A40F4 + movs r1, 0xA + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =gUnknown_020383FE + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0x8] + strh r5, [r0, 0xA] + movs r1, 0x1 + strh r1, [r0, 0xC] + strh r1, [r0, 0xE] +_080A42D8: + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r1, =gUnknown_020383FC + movs r0, 0x1 + strb r0, [r1] + ldr r1, =gUnknown_020383F8 + ldr r0, =move_anim_waiter + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A41D8 + + thumb_func_start b_side_obj__get_some_boolean +b_side_obj__get_some_boolean: @ 80A4310 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A4330 + ldr r0, =gUnknown_02038436 + ldrb r0, [r0] + cmp r4, r0 + beq _080A4374 + b _080A4384 + .pool +_080A4330: + adds r0, r4, 0 + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _080A4384 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A4374 + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r5, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080A4374 + ldr r2, =gUnknown_02020630 + ldr r0, =gUnknown_020241E4 + adds r0, r5, r0 + 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 _080A4384 +_080A4374: + movs r0, 0x1 + b _080A4386 + .pool +_080A4384: + movs r0, 0 +_080A4386: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end b_side_obj__get_some_boolean + + thumb_func_start sub_80A438C +sub_80A438C: @ 80A438C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x28 + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + lsls r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + cmp r1, 0 + beq _080A43AA + b _080A455E +_080A43AA: + bl sub_80A4DF0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080A43DC + ldr r1, =0x06008000 + movs r2, 0x80 + lsls r2, 6 + movs r0, 0 + movs r3, 0x1 + bl RequestDma3Fill + ldr r1, =0x0600f000 + movs r2, 0x80 + lsls r2, 5 + movs r0, 0xFF + movs r3, 0 + bl RequestDma3Fill + b _080A43F8 + .pool +_080A43DC: + ldr r1, =0x06004000 + movs r2, 0x80 + lsls r2, 6 + movs r0, 0 + movs r3, 0x1 + bl RequestDma3Fill + ldr r1, =0x0600e000 + movs r2, 0x80 + lsls r2, 5 + movs r0, 0xFF + movs r3, 0 + bl RequestDma3Fill +_080A43F8: + add r0, sp, 0x10 + bl sub_80A6B30 + add r0, sp, 0x20 + movs r1, 0 + strh r1, [r0] + ldr r1, [sp, 0x10] + ldr r2, =0x01000800 + bl CpuSet + mov r0, sp + adds r0, 0x22 + movs r1, 0xFF + strh r1, [r0] + ldr r1, [sp, 0x14] + ldr r2, =0x01000400 + bl CpuSet + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x2 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl lcd_bg_operations + ldr r0, =gUnknown_020241E4 + adds r0, r6, r0 + ldrb r4, [r0] + ldr r5, =gUnknown_02022E18 + ldr r0, =gUnknown_02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x24] + ldrh r1, [r1, 0x20] + adds r0, r1 + negs r0, r0 + adds r0, 0x20 + strh r0, [r5] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A447A + ldr r0, =gUnknown_02039F34 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrh r0, [r0] + bl sub_80DB2A8 + lsls r0, 24 + cmp r0, 0 + beq _080A447A + ldrh r0, [r5] + subs r0, 0x1 + strh r0, [r5] +_080A447A: + ldr r5, =gUnknown_02022E1A + ldr r2, =gUnknown_02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x26] + ldrh r1, [r1, 0x22] + adds r0, r1 + negs r0, r0 + adds r0, 0x20 + strh r0, [r5] + mov r0, r9 + cmp r0, 0 + beq _080A44B0 + ldr r0, =gUnknown_020241E4 + adds r0, r6, r0 + 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] +_080A44B0: + ldr r0, =gUnknown_02022E18 + ldrh r1, [r0] + movs r0, 0x14 + bl SetGpuReg + ldrh r1, [r5] + movs r0, 0x16 + bl SetGpuReg + lsls r4, r6, 5 + ldr r0, =gUnknown_02037914 + adds r4, r0 + add r0, sp, 0x10 + ldrb r1, [r0, 0x8] + lsls r1, 4 + adds r0, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply + add r0, sp, 0x10 + ldrb r1, [r0, 0x8] + lsls r1, 5 + movs r0, 0xA0 + lsls r0, 19 + adds r1, r0 + ldr r2, =0x04000008 + adds r0, r4, 0 + bl CpuSet + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A4524 + movs r3, 0 + b _080A452E + .pool +_080A4524: + adds r0, r6, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r3, r0, 24 +_080A452E: + add r0, sp, 0x10 + ldrb r0, [r0, 0x8] + str r0, [sp] + ldr r0, [sp, 0x10] + str r0, [sp, 0x4] + ldr r0, [sp, 0x14] + str r0, [sp, 0x8] + add r0, sp, 0x10 + ldrh r0, [r0, 0xA] + str r0, [sp, 0xC] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl sub_8118FBC + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A4558 + b _080A4666 +_080A4558: + bl sub_80A46A0 + b _080A4666 +_080A455E: + ldr r1, =0x06006000 + movs r2, 0x80 + lsls r2, 6 + movs r0, 0 + movs r3, 0x1 + bl RequestDma3Fill + ldr r1, =0x0600f000 + movs r7, 0x80 + lsls r7, 5 + movs r0, 0 + adds r2, r7, 0 + movs r3, 0x1 + bl RequestDma3Fill + add r0, sp, 0x10 + movs r1, 0x2 + bl sub_80A6B90 + add r0, sp, 0x24 + movs r4, 0 + strh r4, [r0] + ldr r1, [sp, 0x10] + adds r1, r7 + ldr r2, =0x01000800 + bl CpuSet + mov r0, sp + adds r0, 0x26 + strh r4, [r0] + ldr r1, [sp, 0x14] + movs r2, 0x80 + lsls r2, 4 + mov r8, r2 + add r1, r8 + ldr r2, =0x01000400 + bl CpuSet + movs r0, 0x2 + movs r1, 0x4 + movs r2, 0x2 + bl lcd_bg_operations + movs r0, 0x2 + movs r1, 0 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + bl lcd_bg_operations + ldr r0, =gUnknown_020241E4 + adds r2, r5, r0 + ldrb r4, [r2] + ldr r5, =gUnknown_02022E1C + ldr r3, =gUnknown_02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r1, 0x24] + ldrh r4, [r1, 0x20] + adds r0, r4 + negs r0, r0 + adds r0, 0x20 + strh r0, [r5] + ldr r4, =gUnknown_02022E1E + ldrh r0, [r1, 0x26] + ldrh r1, [r1, 0x22] + adds r0, r1 + negs r0, r0 + adds r0, 0x20 + strh r0, [r4] + mov r0, r9 + cmp r0, 0 + beq _080A460E + 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] +_080A460E: + ldrh r1, [r5] + movs r0, 0x18 + bl SetGpuReg + ldrh r1, [r4] + movs r0, 0x1A + bl SetGpuReg + lsls r4, r6, 5 + ldr r0, =gUnknown_02037914 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x90 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =0x05000120 + ldr r2, =0x04000008 + adds r0, r4, 0 + bl CpuSet + adds r0, r6, 0 + bl battle_get_per_side_status + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + add r0, sp, 0x10 + ldrb r0, [r0, 0x8] + str r0, [sp] + ldr r0, [sp, 0x10] + adds r0, r7 + str r0, [sp, 0x4] + ldr r0, [sp, 0x14] + add r0, r8 + str r0, [sp, 0x8] + add r0, sp, 0x10 + ldrh r0, [r0, 0xA] + str r0, [sp, 0xC] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl sub_8118FBC +_080A4666: + add sp, 0x28 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A438C + + thumb_func_start sub_80A46A0 +sub_80A46A0: @ 80A46A0 + push {r4-r7,lr} + sub sp, 0x10 + ldr r0, =gUnknown_02039F34 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrh r0, [r0] + bl sub_80DB2A8 + lsls r0, 24 + cmp r0, 0 + beq _080A4712 + mov r0, sp + bl sub_80A6B30 + ldr r6, [sp, 0x4] + movs r5, 0 + movs r0, 0x7 + mov r12, r0 + movs r7, 0 +_080A46C6: + movs r4, 0 + adds r3, r7, r6 + mov r1, r12 + lsls r0, r1, 1 + adds r2, r0, r6 +_080A46D0: + ldrh r1, [r3] + ldrh r0, [r2] + strh r0, [r3] + strh r1, [r2] + adds r3, 0x2 + subs r2, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _080A46D0 + movs r0, 0x20 + add r12, r0 + adds r7, 0x40 + adds r5, 0x1 + cmp r5, 0x7 + ble _080A46C6 + movs r5, 0 + movs r1, 0x80 + lsls r1, 3 + adds r3, r1, 0 +_080A46F6: + adds r2, r5, 0x1 + lsls r0, r5, 6 + adds r1, r0, r6 + movs r4, 0x7 +_080A46FE: + ldrh r0, [r1] + eors r0, r3 + strh r0, [r1] + adds r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _080A46FE + adds r5, r2, 0 + cmp r5, 0x7 + ble _080A46F6 +_080A4712: + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A46A0 + + thumb_func_start sub_80A4720 +sub_80A4720: @ 80A4720 + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r1 + adds r6, r2, 0 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r3, 24 + movs r0, 0x40 + mov r12, r0 + cmp r3, 0 + bne _080A473C + movs r1, 0x20 + mov r12, r1 +_080A473C: + lsls r0, r5, 28 + lsrs r5, r0, 16 + movs r0, 0 + cmp r0, r12 + bge _080A476C + ldr r7, =0x00000fff +_080A4748: + adds r4, r0, 0x1 + lsls r0, 6 + mov r1, r8 + adds r3, r0, r1 + movs r2, 0x1F +_080A4752: + ldrh r1, [r3] + adds r0, r7, 0 + ands r0, r1 + orrs r0, r5 + adds r0, r6 + strh r0, [r3] + adds r3, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _080A4752 + adds r0, r4, 0 + cmp r0, r12 + blt _080A4748 +_080A476C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A4720 + + thumb_func_start sub_80A477C +sub_80A477C: @ 80A477C + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r0, sp + bl sub_80A6B30 + cmp r4, 0 + beq _080A479C + bl sub_80A4DF0 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _080A47B8 +_080A479C: + movs r0, 0x1 + bl sub_80A6C68 + ldr r0, =gUnknown_02022E18 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E1A + strh r1, [r0] + b _080A47C6 + .pool +_080A47B8: + movs r0, 0x2 + bl sub_80A6C68 + ldr r0, =gUnknown_02022E1C + strh r4, [r0] + ldr r0, =gUnknown_02022E1E + strh r4, [r0] +_080A47C6: + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A477C + + thumb_func_start task_pA_ma0A_obj_to_bg_pal +@ void task_pA_ma0A_obj_to_bg_pal(int task_id) +task_pA_ma0A_obj_to_bg_pal: @ 80A47D8 + push {r4-r6,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r5, r1, r2 + ldrb r4, [r5, 0x8] + ldrb r6, [r5, 0x14] + mov r0, sp + bl sub_80A6B30 + ldr r0, =gUnknown_02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + ldrh r2, [r1, 0x24] + ldrh r0, [r1, 0x20] + adds r2, r0 + ldrh r0, [r5, 0xA] + subs r0, r2 + lsls r0, 16 + lsrs r3, r0, 16 + ldrh r2, [r1, 0x26] + ldrh r1, [r1, 0x22] + adds r2, r1 + ldrh r0, [r5, 0xC] + subs r0, r2 + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0x12 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _080A4870 + ldr r1, =gUnknown_02022E18 + lsls r0, r3, 16 + asrs r0, 16 + ldrh r3, [r5, 0xE] + adds r0, r3 + strh r0, [r1] + ldr r1, =gUnknown_02022E1A + lsls r0, r2, 16 + asrs r0, 16 + ldrh r5, [r5, 0x10] + adds r0, r5 + strh r0, [r1] + lsls r0, r6, 5 + ldr r2, =gUnknown_02037D14 + adds r0, r2 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 5 + ldr r3, =0xfffffe00 + adds r2, r3 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet + b _080A4896 + .pool +_080A4870: + ldr r1, =gUnknown_02022E1C + lsls r0, r3, 16 + asrs r0, 16 + ldrh r3, [r5, 0xE] + adds r0, r3 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + lsls r0, r2, 16 + asrs r0, 16 + ldrh r5, [r5, 0x10] + adds r0, r5 + strh r0, [r1] + lsls r0, r6, 5 + ldr r1, =gUnknown_02037D14 + adds r0, r1 + subs r1, 0xE0 + ldr r2, =0x04000008 + bl CpuSet +_080A4896: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end task_pA_ma0A_obj_to_bg_pal + + thumb_func_start ma0B_0807324C +ma0B_0807324C: @ 80A48B0 + push {r4,r5,lr} + ldr r0, =gUnknown_020383F0 + ldr r2, [r0] + adds r1, r2, 0x1 + str r1, [r0] + ldrb r4, [r2, 0x1] + cmp r4, 0 + bne _080A48C8 + movs r4, 0x2 + b _080A48D2 + .pool +_080A48C8: + cmp r4, 0x1 + bne _080A48CE + movs r4, 0x3 +_080A48CE: + cmp r4, 0 + beq _080A48D6 +_080A48D2: + cmp r4, 0x2 + bne _080A48E0 +_080A48D6: + ldr r0, =gUnknown_02038436 + b _080A48E2 + .pool +_080A48E0: + ldr r0, =gUnknown_02038437 +_080A48E2: + ldrb r5, [r0] + ldr r3, =gUnknown_02038430 + ldrb r0, [r3] + cmp r0, 0xFF + beq _080A4908 + ldr r2, =gUnknown_02020630 + ldr r0, =gUnknown_020241E4 + adds r0, r5, r0 + ldrb r1, [r0] + 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] +_080A4908: + cmp r4, 0x1 + bls _080A4948 + ldrb r0, [r3, 0x1] + cmp r0, 0xFF + beq _080A4948 + ldr r3, =gUnknown_02020630 + ldr r2, =gUnknown_020241E4 + movs r1, 0x2 + adds r0, r5, 0 + eors r0, r1 + adds r0, r2 + ldrb r1, [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] + b _080A494A + .pool +_080A4948: + movs r4, 0 +_080A494A: + ldr r0, =sub_80A4980 + 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, 0x8] + strh r5, [r1, 0xC] + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ma0B_0807324C + + thumb_func_start sub_80A4980 +sub_80A4980: @ 80A4980 + 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 r1, r0, r1 + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + beq _080A4A0A + ldrb r0, [r1, 0xC] + bl battle_get_per_side_status + lsls r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bls _080A49BC + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A49C4 +_080A49BC: + movs r4, 0 + b _080A49C6 + .pool +_080A49C4: + movs r4, 0x1 +_080A49C6: + ldr r6, =gUnknown_02038430 + ldrb r0, [r6] + cmp r0, 0xFF + beq _080A49DE + adds r0, r4, 0 + bl sub_80A477C + ldrb r0, [r6] + bl DestroyTask + movs r0, 0xFF + strb r0, [r6] +_080A49DE: + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + ble _080A4A04 + movs r0, 0x1 + eors r4, r0 + adds r0, r4, 0 + bl sub_80A477C + ldrb r0, [r6, 0x1] + bl DestroyTask + movs r0, 0xFF + strb r0, [r6, 0x1] +_080A4A04: + adds r0, r5, 0 + bl DestroyTask +_080A4A0A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A4980 + + thumb_func_start sub_80A4A18 +sub_80A4A18: @ 80A4A18 + push {r4,r5,lr} + ldr r0, =gUnknown_020383F0 + ldr r2, [r0] + adds r1, r2, 0x1 + str r1, [r0] + ldrb r5, [r2, 0x1] + cmp r5, 0 + bne _080A4A30 + movs r5, 0x2 + b _080A4A3A + .pool +_080A4A30: + cmp r5, 0x1 + bne _080A4A36 + movs r5, 0x3 +_080A4A36: + cmp r5, 0 + beq _080A4A3E +_080A4A3A: + cmp r5, 0x2 + bne _080A4A48 +_080A4A3E: + ldr r0, =gUnknown_02038436 + b _080A4A4A + .pool +_080A4A48: + ldr r0, =gUnknown_02038437 +_080A4A4A: + ldrb r4, [r0] + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A4A8A + adds r0, r4, 0 + bl battle_get_per_side_status + lsls r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bls _080A4A76 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A4A80 +_080A4A76: + movs r1, 0 + b _080A4A82 + .pool +_080A4A80: + movs r1, 0x1 +_080A4A82: + adds r0, r4, 0 + movs r2, 0 + bl sub_80A438C +_080A4A8A: + movs r0, 0x2 + eors r4, r0 + cmp r5, 0x1 + bls _080A4ACA + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A4ACA + adds r0, r4, 0 + bl battle_get_per_side_status + lsls r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bls _080A4ABC + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A4AC0 +_080A4ABC: + movs r1, 0 + b _080A4AC2 +_080A4AC0: + movs r1, 0x1 +_080A4AC2: + adds r0, r4, 0 + movs r2, 0 + bl sub_80A438C +_080A4ACA: + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A4A18 + + thumb_func_start ma23_8073484 +ma23_8073484: @ 80A4ADC + push {r4-r6,lr} + ldr r0, =gUnknown_020383F0 + ldr r2, [r0] + adds r1, r2, 0x1 + str r1, [r0] + ldrb r5, [r2, 0x1] + cmp r5, 0 + bne _080A4AF4 + movs r5, 0x2 + b _080A4AFE + .pool +_080A4AF4: + cmp r5, 0x1 + bne _080A4AFA + movs r5, 0x3 +_080A4AFA: + cmp r5, 0 + beq _080A4B02 +_080A4AFE: + cmp r5, 0x2 + bne _080A4B0C +_080A4B02: + ldr r0, =gUnknown_02038436 + b _080A4B0E + .pool +_080A4B0C: + ldr r0, =gUnknown_02038437 +_080A4B0E: + ldrb r6, [r0] + adds r0, r6, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A4B38 + ldr r2, =gUnknown_02020630 + ldr r0, =gUnknown_020241E4 + adds r0, r6, r0 + ldrb r1, [r0] + 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] +_080A4B38: + cmp r5, 0x1 + bls _080A4B78 + movs r0, 0x2 + adds r4, r6, 0 + eors r4, r0 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A4B78 + ldr r2, =gUnknown_02020630 + ldr r0, =gUnknown_020241E4 + adds r0, r4, r0 + ldrb r1, [r0] + 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] + b _080A4B7A + .pool +_080A4B78: + movs r5, 0 +_080A4B7A: + ldr r0, =sub_80A4BB0 + 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 r5, [r1, 0x8] + strh r6, [r1, 0xC] + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end ma23_8073484 + + thumb_func_start sub_80A4BB0 +sub_80A4BB0: @ 80A4BB0 + 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 r1, r0, r1 + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + beq _080A4C3E + ldrb r4, [r1, 0xC] + adds r0, r4, 0 + bl battle_get_per_side_status + lsls r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bls _080A4BEE + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A4BF8 +_080A4BEE: + movs r5, 0 + b _080A4BFA + .pool +_080A4BF8: + movs r5, 0x1 +_080A4BFA: + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A4C0C + adds r0, r5, 0 + bl sub_80A477C +_080A4C0C: + ldr r0, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + ble _080A4C38 + movs r0, 0x2 + eors r4, r0 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A4C38 + movs r0, 0x1 + eors r5, r0 + adds r0, r5, 0 + bl sub_80A477C +_080A4C38: + adds r0, r6, 0 + bl DestroyTask +_080A4C3E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A4BB0 + + thumb_func_start ma0C_set_BLDCNT_to_x3F40_and_BLDALPHA_to_argument +ma0C_set_BLDCNT_to_x3F40_and_BLDALPHA_to_argument: @ 80A4C48 + push {r4,r5,lr} + ldr r2, =gUnknown_020383F0 + ldr r0, [r2] + adds r1, r0, 0x1 + str r1, [r2] + ldrb r5, [r0, 0x1] + adds r0, r1, 0x1 + str r0, [r2] + ldrb r4, [r1, 0x1] + lsls r4, 8 + adds r0, 0x1 + str r0, [r2] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + orrs r5, r4 + movs r0, 0x52 + adds r1, r5, 0 + bl SetGpuReg + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ma0C_set_BLDCNT_to_x3F40_and_BLDALPHA_to_argument + + thumb_func_start ma1E_set_BLDCNT +ma1E_set_BLDCNT: @ 80A4C80 + push {lr} + ldr r3, =gUnknown_020383F0 + ldr r0, [r3] + adds r2, r0, 0x1 + str r2, [r3] + ldrb r1, [r0, 0x1] + adds r0, r2, 0x1 + str r0, [r3] + ldrb r2, [r2, 0x1] + lsls r2, 8 + adds r0, 0x1 + str r0, [r3] + orrs r1, r2 + movs r0, 0x50 + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end ma1E_set_BLDCNT + + thumb_func_start ma0D_reset_BLDCNT_and_BLDALPHA +ma0D_reset_BLDCNT_and_BLDALPHA: @ 80A4CA8 + push {lr} + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end ma0D_reset_BLDCNT_and_BLDALPHA + + thumb_func_start ma0E_call +ma0E_call: @ 80A4CCC + push {r4,lr} + ldr r4, =gUnknown_020383F0 + ldr r1, [r4] + adds r3, r1, 0x1 + str r3, [r4] + ldr r2, =gUnknown_020383F4 + adds r0, r1, 0x5 + str r0, [r2] + ldrb r1, [r1, 0x1] + ldrb r0, [r3, 0x1] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r3, 0x2] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r3, 0x3] + lsls r0, 24 + adds r1, r0 + str r1, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ma0E_call + + thumb_func_start sub_80A4D00 +sub_80A4D00: @ 80A4D00 + ldr r0, =gUnknown_020383F0 + ldr r1, =gUnknown_020383F4 + ldr r1, [r1] + str r1, [r0] + bx lr + .pool + thumb_func_end sub_80A4D00 + + thumb_func_start ma10_080736AC +ma10_080736AC: @ 80A4D14 + push {r4,r5,lr} + ldr r5, =gUnknown_020383F0 + ldr r1, [r5] + adds r0, r1, 0x1 + str r0, [r5] + ldrb r2, [r1, 0x1] + adds r3, r0, 0x1 + str r3, [r5] + ldrb r4, [r0, 0x1] + ldrb r0, [r3, 0x1] + lsls r0, 8 + orrs r4, r0 + adds r1, 0x4 + str r1, [r5] + ldr r0, =gUnknown_0203841E + lsls r2, 1 + adds r2, r0 + strh r4, [r2] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ma10_080736AC + + thumb_func_start ma11_if_else +ma11_if_else: @ 80A4D48 + push {lr} + ldr r3, =gUnknown_020383F0 + ldr r2, [r3] + adds r0, r2, 0x1 + str r0, [r3] + ldr r0, =gUnknown_02038432 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080A4D62 + adds r0, r2, 0x5 + str r0, [r3] +_080A4D62: + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + adds r1, r0 + str r1, [r3] + pop {r0} + bx r0 + .pool + thumb_func_end ma11_if_else + + thumb_func_start ma12_cond_if +ma12_cond_if: @ 80A4D88 + push {r4,r5,lr} + ldr r5, =gUnknown_020383F0 + ldr r4, [r5] + adds r2, r4, 0x1 + str r2, [r5] + ldrb r1, [r4, 0x1] + adds r3, r2, 0x1 + str r3, [r5] + ldr r0, =gUnknown_02038432 + ldrb r0, [r0] + cmp r1, r0 + bne _080A4DC0 + ldrb r1, [r2, 0x1] + ldrb r0, [r3, 0x1] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r3, 0x2] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r3, 0x3] + lsls r0, 24 + adds r1, r0 + str r1, [r5] + b _080A4DC4 + .pool +_080A4DC0: + adds r0, r4, 0x6 + str r0, [r5] +_080A4DC4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end ma12_cond_if + + thumb_func_start ma13_goto +ma13_goto: @ 80A4DCC + ldr r3, =gUnknown_020383F0 + ldr r0, [r3] + adds r2, r0, 0x1 + str r2, [r3] + ldrb r1, [r0, 0x1] + ldrb r0, [r2, 0x1] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + adds r1, r0 + str r1, [r3] + bx lr + .pool + thumb_func_end ma13_goto + + thumb_func_start sub_80A4DF0 +sub_80A4DF0: @ 80A4DF0 + push {lr} + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080A4E10 + movs r0, 0 + b _080A4E12 + .pool +_080A4E10: + movs r0, 0x1 +_080A4E12: + pop {r1} + bx r1 + thumb_func_end sub_80A4DF0 + + thumb_func_start ma14_load_background +ma14_load_background: @ 80A4E18 + push {r4,lr} + ldr r1, =gUnknown_020383F0 + ldr r2, [r1] + adds r0, r2, 0x1 + str r0, [r1] + ldrb r4, [r2, 0x1] + adds r0, 0x1 + str r0, [r1] + ldr r0, =task_p5_load_battle_screen_elements + 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, 0x8] + ldr r1, =gUnknown_02038433 + movs r0, 0x1 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ma14_load_background + + thumb_func_start sub_80A4E5C +sub_80A4E5C: @ 80A4E5C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r2, =gUnknown_020383F0 + ldr r1, [r2] + adds r0, r1, 0x1 + str r0, [r2] + ldrb r3, [r1, 0x1] + mov r8, r3 + ldrb r7, [r0, 0x1] + ldrb r6, [r0, 0x2] + adds r1, 0x4 + str r1, [r2] + ldr r0, =task_p5_load_battle_screen_elements + movs r1, 0x5 + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A4EA8 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0x8] + b _080A4EDA + .pool +_080A4EA8: + ldr r0, =gUnknown_02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080A4ECC + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r7, [r0, 0x8] + b _080A4EDA + .pool +_080A4ECC: + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + mov r1, r8 + strh r1, [r0, 0x8] +_080A4EDA: + ldr r1, =gUnknown_02038433 + movs r0, 0x1 + strb r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A4E5C + + thumb_func_start task_p5_load_battle_screen_elements +task_p5_load_battle_screen_elements: @ 80A4EF4 + 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 r4, r0, r1 + ldrh r6, [r4, 0x1C] + movs r0, 0x1C + ldrsh r3, [r4, r0] + adds r7, r1, 0 + cmp r3, 0 + bne _080A4F2C + str r3, [sp] + movs r0, 0xE8 + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A27B0 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + b _080A4FBC + .pool +_080A4F2C: + ldr r2, =gUnknown_02037FD4 + ldrb r1, [r2, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080A4FBC + cmp r3, 0x1 + bne _080A4F50 + adds r0, r6, 0x1 + strh r0, [r4, 0x1C] + ldr r1, =gUnknown_02038433 + movs r0, 0x2 + strb r0, [r1] + b _080A4F94 + .pool +_080A4F50: + cmp r3, 0x2 + bne _080A4F94 + ldrh r0, [r4, 0x8] + lsls r2, r0, 16 + asrs r1, r2, 16 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080A4F68 + bl dp01t_11_3_message_for_player_only + b _080A4F6E +_080A4F68: + lsrs r0, r2, 16 + bl sub_80A4FC8 +_080A4F6E: + movs r0, 0x1 + str r0, [sp] + movs r0, 0xE8 + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A27B0 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x1C] + adds r1, 0x1 + strh r1, [r0, 0x1C] + b _080A4FBC + .pool +_080A4F94: + ldrb r1, [r2, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080A4FBC + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r7 + movs r1, 0x1C + ldrsh r0, [r0, r1] + cmp r0, 0x3 + bne _080A4FBC + adds r0, r5, 0 + bl DestroyTask + ldr r0, =gUnknown_02038433 + strb r4, [r0] +_080A4FBC: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end task_p5_load_battle_screen_elements + + thumb_func_start sub_80A4FC8 +sub_80A4FC8: @ 80A4FC8 + push {r4-r7,lr} + lsls r0, 16 + lsrs r7, r0, 16 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A5050 + ldr r6, =gUnknown_08525D54 + lsls r4, r7, 1 + adds r4, r7 + lsls r4, 2 + adds r0, r6, 0 + adds r0, 0x8 + adds r0, r4, r0 + ldr r0, [r0] + ldr r5, =0x0201c000 + adds r1, r5, 0 + bl LZDecompressWram + bl sub_80A6D94 + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + adds r1, r5, 0 + movs r3, 0 + bl sub_80A4720 + ldr r1, =0x0600d000 + ldr r0, =0x040000d4 + str r5, [r0] + str r1, [r0, 0x4] + ldr r1, =0x84000200 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + adds r0, r4, r6 + ldr r0, [r0] + ldr r1, =0x06002000 + bl LZDecompressVram + adds r6, 0x4 + adds r4, r6 + ldr r4, [r4] + bl sub_80A6D94 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 20 + adds r0, r4, 0 + movs r2, 0x20 + bl decompress_palette + b _080A507E + .pool +_080A5050: + ldr r5, =gUnknown_08525D54 + lsls r4, r7, 1 + adds r4, r7 + lsls r4, 2 + adds r0, r5, 0 + adds r0, 0x8 + adds r0, r4, r0 + ldr r0, [r0] + ldr r1, =0x0600d000 + bl LZDecompressVram + adds r0, r4, r5 + ldr r0, [r0] + ldr r1, =0x06008000 + bl LZDecompressVram + adds r5, 0x4 + adds r4, r5 + ldr r0, [r4] + movs r1, 0x20 + movs r2, 0x20 + bl decompress_palette +_080A507E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A4FC8 + + thumb_func_start dp01t_11_3_message_for_player_only +dp01t_11_3_message_for_player_only: @ 80A5090 + push {lr} + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A50A2 + bl sub_80D7724 + b _080A50A6 +_080A50A2: + bl load_battle_oval_graphics +_080A50A6: + pop {r0} + bx r0 + thumb_func_end dp01t_11_3_message_for_player_only + + thumb_func_start ma15_load_battle_screen_elements +ma15_load_battle_screen_elements: @ 80A50AC + push {lr} + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r0, =task_p5_load_battle_screen_elements + 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 + ldr r0, =0x0000ffff + strh r0, [r1, 0x8] + ldr r1, =gUnknown_02038433 + movs r0, 0x1 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end ma15_load_battle_screen_elements + + thumb_func_start ma16_wait_for_battle_screen_elements_s2 +ma16_wait_for_battle_screen_elements_s2: @ 80A50F0 + push {lr} + ldr r0, =gUnknown_02038433 + ldrb r0, [r0] + cmp r0, 0x2 + bne _080A5114 + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r1, =gUnknown_020383FC + movs r0, 0 + b _080A5118 + .pool +_080A5114: + ldr r1, =gUnknown_020383FC + movs r0, 0x1 +_080A5118: + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end ma16_wait_for_battle_screen_elements_s2 + + thumb_func_start sub_80A5124 +sub_80A5124: @ 80A5124 + push {lr} + ldr r0, =gUnknown_02038433 + ldrb r2, [r0] + cmp r2, 0 + bne _080A5148 + ldr r0, =gUnknown_020383F0 + ldr r1, [r0] + adds r1, 0x1 + str r1, [r0] + ldr r0, =gUnknown_020383FC + strb r2, [r0] + b _080A514E + .pool +_080A5148: + ldr r1, =gUnknown_020383FC + movs r0, 0x1 + strb r0, [r1] +_080A514E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A5124 + + thumb_func_start ma18_load_background_probably +ma18_load_background_probably: @ 80A5158 + push {r4,lr} + ldr r4, =gUnknown_020383F0 + ldr r1, [r4] + adds r0, r1, 0x1 + str r0, [r4] + ldrb r0, [r1, 0x1] + bl sub_80A4FC8 + ldr r0, [r4] + adds r0, 0x1 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ma18_load_background_probably + + thumb_func_start sub_80A5178 +sub_80A5178: @ 80A5178 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A51C0 + ldr r0, =gUnknown_020244D0 + ldr r1, [r0] + ldr r0, =gUnknown_02038436 + ldrb r2, [r0] + ldr r1, [r1, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080A51C0 + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + movs r4, 0xC0 + cmp r0, 0 + beq _080A5252 + movs r4, 0x3F + b _080A5252 + .pool +_080A51C0: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A51E8 + ldr r0, =gUnknown_02038436 + ldr r1, =gUnknown_02038437 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bne _080A524C + cmp r0, 0x2 + bne _080A524C + cmp r4, 0x3F + beq _080A525E + b _080A524C + .pool +_080A51E8: + ldr r0, =gUnknown_02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080A5226 + ldr r0, =gUnknown_02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080A5252 + lsls r0, r4, 24 + asrs r1, r0, 24 + cmp r1, 0x3F + bne _080A5218 + movs r4, 0xC0 + b _080A5252 + .pool +_080A5218: + movs r0, 0x40 + negs r0, r0 + cmp r1, r0 + beq _080A5252 + negs r0, r1 + lsls r0, 24 + b _080A5250 +_080A5226: + ldr r0, =gUnknown_02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080A524C + lsls r0, r4, 24 + asrs r0, 24 + movs r1, 0x40 + negs r1, r1 + cmp r0, r1 + bne _080A5252 + movs r4, 0x3F + b _080A5252 + .pool +_080A524C: + lsls r0, r4, 24 + negs r0, r0 +_080A5250: + lsrs r4, r0, 24 +_080A5252: + lsls r0, r4, 24 + asrs r0, 24 + cmp r0, 0x3F + ble _080A525E + movs r4, 0x3F + b _080A526C +_080A525E: + lsls r0, r4, 24 + asrs r0, 24 + movs r1, 0x40 + negs r1, r1 + cmp r0, r1 + bge _080A526C + movs r4, 0xC0 +_080A526C: + lsls r0, r4, 24 + asrs r0, 24 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80A5178 + + thumb_func_start sub_80A5278 +sub_80A5278: @ 80A5278 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A52C0 + ldr r0, =gUnknown_020244D0 + ldr r1, [r0] + ldr r0, =gUnknown_02038436 + ldrb r2, [r0] + ldr r1, [r1, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080A52C0 + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + movs r4, 0xC0 + cmp r0, 0 + beq _080A52DE + movs r4, 0x3F + b _080A52DE + .pool +_080A52C0: + ldr r0, =gUnknown_02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080A52D8 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A52DE +_080A52D8: + lsls r0, r4, 24 + negs r0, r0 + lsrs r4, r0, 24 +_080A52DE: + lsls r0, r4, 24 + asrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A5278 + + thumb_func_start sub_80A52EC +sub_80A52EC: @ 80A52EC + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + asrs r2, r0, 16 + cmp r2, 0x3F + ble _080A52FC + movs r1, 0x3F + b _080A5306 +_080A52FC: + movs r0, 0x40 + negs r0, r0 + cmp r2, r0 + bge _080A5306 + ldr r1, =0x0000ffc0 +_080A5306: + lsls r0, r1, 16 + asrs r0, 16 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A52EC + + thumb_func_start sub_80A5314 +sub_80A5314: @ 80A5314 + push {lr} + lsls r2, 16 + lsrs r2, 16 + adds r3, r2, 0 + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + cmp r0, r1 + bge _080A5332 + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0 + bge _080A5342 + b _080A5340 +_080A5332: + cmp r0, r1 + ble _080A5348 + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, 0 + bge _080A5340 + negs r0, r0 +_080A5340: + negs r0, r0 +_080A5342: + lsls r0, 16 + lsrs r0, 16 + b _080A534A +_080A5348: + movs r0, 0 +_080A534A: + lsls r0, 16 + asrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_80A5314 + + thumb_func_start ma19_08073BC8 +ma19_08073BC8: @ 80A5354 + push {r4,r5,lr} + ldr r5, =gUnknown_020383F0 + ldr r0, [r5] + adds r1, r0, 0x1 + str r1, [r5] + ldrb r4, [r0, 0x1] + ldrb r0, [r1, 0x1] + lsls r0, 8 + orrs r4, r0 + movs r0, 0x2 + ldrsb r0, [r1, r0] + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + adds r0, r4, 0 + bl audio_play_and_stuff + ldr r0, [r5] + adds r0, 0x3 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ma19_08073BC8 + + thumb_func_start ma1A_8073C00 +ma1A_8073C00: @ 80A538C + push {r4,lr} + ldr r4, =gUnknown_020383F0 + ldr r1, [r4] + adds r0, r1, 0x1 + str r0, [r4] + movs r0, 0x1 + ldrsb r0, [r1, r0] + bl sub_80A5178 + lsls r0, 24 + asrs r0, 24 + bl sub_80A3870 + ldr r0, [r4] + adds r0, 0x1 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ma1A_8073C00 + + thumb_func_start ma1B_8073C2C +ma1B_8073C2C: @ 80A53B8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =gUnknown_020383F0 + mov r10, r0 + ldr r0, [r0] + adds r1, r0, 0x1 + mov r2, r10 + str r1, [r2] + ldrb r0, [r0, 0x1] + mov r9, r0 + ldrb r0, [r1, 0x1] + lsls r0, 8 + mov r2, r9 + orrs r2, r0 + mov r9, r2 + ldrb r4, [r1, 0x3] + ldrb r6, [r1, 0x4] + ldrb r7, [r1, 0x5] + movs r0, 0x2 + ldrsb r0, [r1, r0] + bl sub_80A5178 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, 24 + asrs r4, 24 + adds r0, r4, 0 + bl sub_80A5178 + mov r8, r0 + lsls r5, 24 + asrs r5, 24 + mov r0, r8 + lsls r0, 24 + asrs r0, 24 + mov r8, r0 + lsls r6, 24 + asrs r6, 24 + adds r0, r5, 0 + mov r1, r8 + adds r2, r6, 0 + bl sub_80A5314 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =c3_08073CEC + 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, 0x8] + mov r2, r8 + strh r2, [r1, 0xA] + lsls r4, 24 + asrs r4, 24 + strh r4, [r1, 0xC] + strh r7, [r1, 0xE] + strh r5, [r1, 0x10] + mov r0, r9 + adds r1, r5, 0 + bl audio_play_and_stuff + ldr r1, =gUnknown_020383FF + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r1, r10 + ldr r0, [r1] + adds r0, 0x6 + str r0, [r1] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ma1B_8073C2C + + thumb_func_start c3_08073CEC +c3_08073CEC: @ 80A5478 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r7, 0 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r2, r0, r1 + ldrh r0, [r2, 0x18] + adds r1, r0, 0x1 + strh r1, [r2, 0x18] + lsls r0, 16 + asrs r0, 16 + movs r3, 0xE + ldrsh r1, [r2, r3] + cmp r0, r1 + blt _080A54FC + strh r7, [r2, 0x18] + ldrh r6, [r2, 0x8] + ldrh r3, [r2, 0xA] + movs r4, 0x10 + ldrsh r0, [r2, r4] + movs r4, 0xC + ldrsh r1, [r2, r4] + adds r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + strh r4, [r2, 0x10] + cmp r1, 0 + bne _080A54C0 + lsls r2, r3, 16 + b _080A54E4 + .pool +_080A54C0: + lsls r1, r6, 16 + lsls r0, r3, 16 + asrs r3, r0, 16 + adds r2, r0, 0 + cmp r1, r2 + bge _080A54D6 + lsls r0, r4, 16 + asrs r0, 16 + cmp r0, r3 + blt _080A54E0 + b _080A54E4 +_080A54D6: + lsls r0, r4, 16 + asrs r0, 16 + cmp r0, r3 + bgt _080A54E0 + movs r7, 0x1 +_080A54E0: + cmp r7, 0 + beq _080A54F4 +_080A54E4: + lsrs r4, r2, 16 + adds r0, r5, 0 + bl DestroyTask + ldr r1, =gUnknown_020383FF + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] +_080A54F4: + lsls r0, r4, 24 + asrs r0, 24 + bl sub_80A3870 +_080A54FC: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end c3_08073CEC + + thumb_func_start sub_80A5508 +sub_80A5508: @ 80A5508 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + ldr r0, =gUnknown_020383F0 + mov r9, r0 + ldr r0, [r0] + adds r1, r0, 0x1 + mov r2, r9 + str r1, [r2] + ldrb r0, [r0, 0x1] + mov r8, r0 + ldrb r0, [r1, 0x1] + lsls r0, 8 + mov r2, r8 + orrs r2, r0 + mov r8, r2 + ldrb r4, [r1, 0x2] + ldrb r5, [r1, 0x3] + ldrb r6, [r1, 0x4] + ldrb r1, [r1, 0x5] + mov r10, r1 + ldr r0, =c3_08073CEC + 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 + lsls r4, 24 + asrs r4, 24 + strh r4, [r1, 0x8] + lsls r5, 24 + asrs r5, 24 + strh r5, [r1, 0xA] + lsls r6, 24 + asrs r6, 24 + strh r6, [r1, 0xC] + mov r0, r10 + strh r0, [r1, 0xE] + strh r4, [r1, 0x10] + mov r0, r8 + adds r1, r4, 0 + bl audio_play_and_stuff + ldr r1, =gUnknown_020383FF + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r1, r9 + ldr r0, [r1] + adds r0, 0x6 + str r0, [r1] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A5508 + + thumb_func_start sub_80A559C +sub_80A559C: @ 80A559C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =gUnknown_020383F0 + mov r10, r0 + ldr r0, [r0] + adds r1, r0, 0x1 + mov r2, r10 + str r1, [r2] + ldrb r0, [r0, 0x1] + mov r9, r0 + ldrb r0, [r1, 0x1] + lsls r0, 8 + mov r2, r9 + orrs r2, r0 + mov r9, r2 + ldrb r4, [r1, 0x3] + ldrb r0, [r1, 0x4] + mov r8, r0 + ldrb r7, [r1, 0x5] + movs r0, 0x2 + ldrsb r0, [r1, r0] + bl sub_80A5278 + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 24 + asrs r4, 24 + adds r0, r4, 0 + bl sub_80A5278 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + mov r0, r8 + bl sub_80A5278 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =c3_08073CEC + 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 + lsls r6, 24 + asrs r6, 24 + strh r6, [r1, 0x8] + lsls r5, 24 + asrs r5, 24 + strh r5, [r1, 0xA] + lsls r4, 24 + asrs r4, 24 + strh r4, [r1, 0xC] + strh r7, [r1, 0xE] + strh r6, [r1, 0x10] + mov r0, r9 + adds r1, r6, 0 + bl audio_play_and_stuff + ldr r1, =gUnknown_020383FF + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r2, r10 + ldr r0, [r2] + adds r0, 0x6 + str r0, [r2] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A559C + + thumb_func_start ma1C_8073ED0 +ma1C_8073ED0: @ 80A565C + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + ldr r6, =gUnknown_020383F0 + ldr r0, [r6] + adds r1, r0, 0x1 + str r1, [r6] + ldrb r5, [r0, 0x1] + ldrb r0, [r1, 0x1] + lsls r0, 8 + orrs r5, r0 + ldrb r0, [r1, 0x3] + mov r8, r0 + ldrb r2, [r1, 0x4] + mov r9, r2 + movs r0, 0x2 + ldrsb r0, [r1, r0] + bl sub_80A5178 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =sub_80A56E4 + 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, 0x8] + lsls r4, 24 + asrs r4, 24 + strh r4, [r1, 0xA] + mov r2, r8 + strh r2, [r1, 0xC] + mov r2, r9 + strh r2, [r1, 0xE] + mov r2, r8 + strh r2, [r1, 0x18] + ldr r1, [r1] + bl _call_via_r1 + ldr r1, =gUnknown_020383FF + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x5 + str r0, [r6] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end ma1C_8073ED0 + + thumb_func_start sub_80A56E4 +sub_80A56E4: @ 80A56E4 + 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 r2, r0, r1 + ldrh r0, [r2, 0x18] + adds r1, r0, 0x1 + strh r1, [r2, 0x18] + lsls r0, 16 + asrs r0, 16 + movs r3, 0xC + ldrsh r1, [r2, r3] + cmp r0, r1 + blt _080A5732 + movs r0, 0 + strh r0, [r2, 0x18] + ldrh r0, [r2, 0x8] + ldrb r1, [r2, 0xA] + ldrh r4, [r2, 0xE] + subs r4, 0x1 + strh r4, [r2, 0xE] + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + asrs r1, 24 + bl audio_play_and_stuff + cmp r4, 0 + bne _080A5732 + adds r0, r5, 0 + bl DestroyTask + ldr r1, =gUnknown_020383FF + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] +_080A5732: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A56E4 + + thumb_func_start ma1D_08073FB4 +ma1D_08073FB4: @ 80A5740 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r6, =gUnknown_020383F0 + ldr r0, [r6] + adds r1, r0, 0x1 + str r1, [r6] + ldrb r5, [r0, 0x1] + ldrb r0, [r1, 0x1] + lsls r0, 8 + orrs r5, r0 + ldrb r0, [r1, 0x3] + mov r8, r0 + movs r0, 0x2 + ldrsb r0, [r1, r0] + bl sub_80A5178 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =sub_80A57B4 + 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, 0x8] + lsls r4, 24 + asrs r4, 24 + strh r4, [r1, 0xA] + mov r0, r8 + strh r0, [r1, 0xC] + ldr r1, =gUnknown_020383FF + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x4 + str r0, [r6] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end ma1D_08073FB4 + + thumb_func_start sub_80A57B4 +sub_80A57B4: @ 80A57B4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r1 + ldrh r0, [r2, 0xC] + subs r1, r0, 0x1 + strh r1, [r2, 0xC] + lsls r0, 16 + cmp r0, 0 + bgt _080A57E8 + ldrh r0, [r2, 0x8] + movs r1, 0xA + ldrsb r1, [r2, r1] + bl audio_play_and_stuff + adds r0, r4, 0 + bl DestroyTask + ldr r1, =gUnknown_020383FF + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] +_080A57E8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A57B4 + + thumb_func_start sub_80A57F8 +sub_80A57F8: @ 80A57F8 + push {r4-r6,lr} + ldr r4, =gUnknown_020383F0 + ldr r1, [r4] + adds r3, r1, 0x1 + str r3, [r4] + ldrb r2, [r1, 0x1] + ldrb r0, [r3, 0x1] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r3, 0x2] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r3, 0x3] + lsls r0, 24 + adds r6, r2, r0 + adds r0, r1, 0x5 + str r0, [r4] + ldrb r0, [r1, 0x5] + adds r1, 0x6 + str r1, [r4] + cmp r0, 0 + beq _080A5842 + adds r5, r4, 0 + ldr r4, =gUnknown_0203841E + adds r3, r0, 0 +_080A582A: + ldr r2, [r5] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + strh r1, [r4] + adds r2, 0x2 + str r2, [r5] + adds r4, 0x2 + subs r3, 0x1 + cmp r3, 0 + bne _080A582A +_080A5842: + adds r0, r6, 0 + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r6 + ldr r1, =gUnknown_020383FF + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A57F8 + + thumb_func_start ma20_wait_for_something +ma20_wait_for_something: @ 80A586C + push {r4,r5,lr} + ldr r0, =gUnknown_020383FF + ldrb r5, [r0] + cmp r5, 0 + bne _080A58B4 + bl mplay_has_finished_maybe + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _080A58CC + ldr r4, =gUnknown_0203842E + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5A + bls _080A58BA + ldr r0, =gMPlay_SE1 + bl m4aMPlayStop + ldr r0, =gMPlay_SE2 + bl m4aMPlayStop + strh r5, [r4] + b _080A58DE + .pool +_080A58B4: + ldr r1, =gUnknown_0203842E + movs r0, 0 + strh r0, [r1] +_080A58BA: + ldr r1, =gUnknown_020383FC + movs r0, 0x1 + strb r0, [r1] + b _080A58DE + .pool +_080A58CC: + ldr r0, =gUnknown_0203842E + movs r2, 0 + strh r1, [r0] + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r0, =gUnknown_020383FC + strb r2, [r0] +_080A58DE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ma20_wait_for_something + + thumb_func_start ma21_08074164 +ma21_08074164: @ 80A58F0 + push {r4-r6,lr} + ldr r5, =gUnknown_020383F0 + ldr r4, [r5] + adds r3, r4, 0x1 + str r3, [r5] + ldrb r2, [r4, 0x1] + ldrb r1, [r3, 0x1] + ldrb r0, [r3, 0x2] + lsls r0, 8 + orrs r1, r0 + ldr r0, =gUnknown_0203841E + lsls r2, 1 + adds r2, r0 + lsls r1, 16 + asrs r1, 16 + movs r6, 0 + ldrsh r0, [r2, r6] + cmp r1, r0 + bne _080A5938 + ldrb r1, [r3, 0x3] + ldrb r0, [r3, 0x4] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r3, 0x6] + lsls r0, 24 + adds r1, r0 + str r1, [r5] + b _080A593E + .pool +_080A5938: + adds r0, r4, 0 + adds r0, 0x8 + str r0, [r5] +_080A593E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end ma21_08074164 + + thumb_func_start sub_80A5944 +sub_80A5944: @ 80A5944 + push {r4,lr} + ldr r4, =gUnknown_020383F0 + ldr r0, [r4] + adds r0, 0x1 + str r0, [r4] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A5978 + ldr r2, [r4] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + adds r1, r0 + str r1, [r4] + b _080A597E + .pool +_080A5978: + ldr r0, [r4] + adds r0, 0x4 + str r0, [r4] +_080A597E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A5944 + + thumb_func_start sub_80A5984 +sub_80A5984: @ 80A5984 + push {r4,lr} + ldr r0, =gUnknown_020383F0 + ldr r1, [r0] + ldrb r2, [r1, 0x1] + adds r1, 0x2 + str r1, [r0] + cmp r2, 0 + beq _080A59A0 + ldr r0, =gUnknown_02038437 + b _080A59A2 + .pool +_080A59A0: + ldr r0, =gUnknown_02038436 +_080A59A2: + ldrb r0, [r0] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A59D2 + cmp r4, 0 + beq _080A59BE + cmp r4, 0x3 + bne _080A59D2 +_080A59BE: + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x2 + movs r1, 0x4 + movs r2, 0x2 + bl lcd_bg_operations +_080A59D2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A5984 + + thumb_func_start sub_80A59DC +sub_80A59DC: @ 80A59DC + push {lr} + ldr r0, =gUnknown_020383F0 + ldr r1, [r0] + adds r1, 0x1 + str r1, [r0] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A5A04 + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x2 + movs r1, 0x4 + movs r2, 0x2 + bl lcd_bg_operations +_080A5A04: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A59DC + + thumb_func_start sub_80A5A0C +sub_80A5A0C: @ 80A5A0C + push {r4-r7,lr} + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + ldrb r6, [r0, 0x1] + adds r0, 0x2 + str r0, [r1] + ldr r7, =gUnknown_02038436 + ldrb r0, [r7] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r5, =gUnknown_02038437 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _080A5A78 + cmp r6, 0 + beq _080A5A48 + ldrb r0, [r5] + b _080A5A4A + .pool +_080A5A48: + ldrb r0, [r7] +_080A5A4A: + bl battle_get_per_side_status + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A5A78 + cmp r4, 0 + beq _080A5A64 + cmp r4, 0x3 + bne _080A5A78 +_080A5A64: + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x2 + movs r1, 0x4 + movs r2, 0x2 + bl lcd_bg_operations +_080A5A78: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A5A0C + + thumb_func_start ma2B_make_side_invisible +ma2B_make_side_invisible: @ 80A5A80 + push {r4,lr} + ldr r4, =gUnknown_020383F0 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _080A5AA8 + ldr r1, =gUnknown_02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080A5AA8: + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ma2B_make_side_invisible + + thumb_func_start ma2C_make_side_visible +ma2C_make_side_visible: @ 80A5ABC + push {r4,lr} + ldr r4, =gUnknown_020383F0 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _080A5AE6 + ldr r1, =gUnknown_02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] +_080A5AE6: + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ma2C_make_side_visible + + thumb_func_start sub_80A5AFC +sub_80A5AFC: @ 80A5AFC + push {r4-r7,lr} + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + ldrb r7, [r0, 0x1] + adds r0, 0x2 + str r0, [r1] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A5BA6 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _080A5BA6 + ldr r6, =gUnknown_02038436 + ldrb r0, [r6] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r5, =gUnknown_02038437 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _080A5BA6 + cmp r7, 0 + bne _080A5B54 + ldrb r0, [r6] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0 + b _080A5B60 + .pool +_080A5B54: + ldrb r0, [r5] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x1 +_080A5B60: + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _080A5BA6 + ldr r1, =gUnknown_02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r2, r0, r1 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + cmp r4, 0x2 + bne _080A5B90 + ldrb r0, [r2, 0x5] + movs r1, 0xC + orrs r0, r1 + strb r0, [r2, 0x5] +_080A5B90: + cmp r4, 0x1 + bne _080A5BA0 + movs r0, 0 + bl sub_80A477C + b _080A5BA6 + .pool +_080A5BA0: + movs r0, 0x1 + bl sub_80A477C +_080A5BA6: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A5AFC + + thumb_func_start sub_80A5BAC +sub_80A5BAC: @ 80A5BAC + push {r4-r7,lr} + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + ldrb r7, [r0, 0x1] + adds r0, 0x2 + str r0, [r1] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A5C38 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _080A5C38 + ldr r6, =gUnknown_02038436 + ldrb r0, [r6] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r5, =gUnknown_02038437 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _080A5C38 + cmp r7, 0 + bne _080A5C04 + ldrb r0, [r6] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0 + b _080A5C10 + .pool +_080A5C04: + ldrb r0, [r5] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x1 +_080A5C10: + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _080A5C38 + cmp r4, 0x2 + bne _080A5C38 + ldr r1, =gUnknown_02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0, 0x5] +_080A5C38: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A5BAC + + thumb_func_start ma2F_stop_music +ma2F_stop_music: @ 80A5C44 + push {lr} + ldr r0, =gMPlay_SE1 + bl m4aMPlayStop + ldr r0, =gMPlay_SE2 + bl m4aMPlayStop + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end ma2F_stop_music + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/battle_anim_80FE840.s b/asm/battle_anim_80FE840.s index 53a1a830e..cbbcc9f35 100644 --- a/asm/battle_anim_80FE840.s +++ b/asm/battle_anim_80FE840.s @@ -69,7 +69,7 @@ sub_80FE898: @ 80FE898 ldrsh r0, [r4, r1] movs r2, 0x34 ldrsh r1, [r4, r2] - bl sine + bl Sin strh r0, [r4, 0x24] ldrh r0, [r4, 0x36] ldrh r1, [r4, 0x38] @@ -230,14 +230,14 @@ _080FEA1E: movs r1, 0x38 ldrsh r0, [r4, r1] movs r1, 0x5 - bl sine + bl Sin ldrh r1, [r4, 0x24] adds r0, r1 strh r0, [r4, 0x24] movs r1, 0x38 ldrsh r0, [r4, r1] movs r1, 0xE - bl cosine + bl Cos ldrh r1, [r4, 0x26] adds r0, r1 strh r0, [r4, 0x26] @@ -366,7 +366,7 @@ _080FEB3C: sub_80FEB44: @ 80FEB44 push {r4,r5,lr} adds r5, r0, 0 - bl GenerateRandomNumber2 + bl Random2 adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -401,7 +401,7 @@ _080FEB90: adds r0, 0x14 _080FEB94: strh r0, [r5, 0x20] - bl GenerateRandomNumber2 + bl Random2 lsls r0, 16 lsrs r0, 16 movs r1, 0x1F @@ -427,7 +427,7 @@ _080FEB94: strh r0, [r5, 0x36] adds r0, r5, 0 bl sub_80A7160 - bl GenerateRandomNumber2 + bl Random2 movs r1, 0xFF ands r1, r0 strh r1, [r5, 0x38] @@ -460,7 +460,7 @@ _080FEC12: movs r1, 0x38 ldrsh r0, [r4, r1] movs r1, 0xC - bl cosine + bl Cos ldrh r1, [r4, 0x26] adds r0, r1 strh r0, [r4, 0x26] @@ -635,13 +635,13 @@ sub_80FED74: @ 80FED74 movs r1, 0x30 ldrsh r0, [r4, r1] movs r1, 0x20 - bl sine + bl Sin strh r0, [r4, 0x24] movs r1, 0x30 ldrsh r0, [r4, r1] movs r1, 0x3 negs r1, r1 - bl cosine + bl Cos ldrh r1, [r4, 0x32] adds r1, 0x18 strh r1, [r4, 0x32] @@ -805,7 +805,7 @@ sub_80FEECC: @ 80FEECC movs r1, 0x38 ldrsh r0, [r4, r1] movs r1, 0x20 - bl sine + bl Sin ldrh r1, [r4, 0x24] adds r0, r1 strh r0, [r4, 0x24] @@ -813,7 +813,7 @@ sub_80FEECC: @ 80FEECC ldrsh r0, [r4, r1] movs r1, 0x5 negs r1, r1 - bl cosine + bl Cos ldrh r1, [r4, 0x26] adds r0, r1 strh r0, [r4, 0x26] @@ -902,7 +902,7 @@ sub_80FEF98: @ 80FEF98 movs r1, 0x38 ldrsh r0, [r4, r1] movs r1, 0x8 - bl sine + bl Sin ldrh r1, [r4, 0x24] adds r0, r1 strh r0, [r4, 0x24] @@ -1035,7 +1035,7 @@ sub_80FF090: @ 80FF090 movs r1, 0x2E ldrsh r0, [r4, r1] movs r1, 0x19 - bl sine + bl Sin negs r0, r0 b _080FF0BE .pool @@ -1043,7 +1043,7 @@ _080FF0B4: movs r1, 0x2E ldrsh r0, [r4, r1] movs r1, 0x19 - bl sine + bl Sin _080FF0BE: strh r0, [r4, 0x24] ldrh r0, [r4, 0x2E] @@ -1339,12 +1339,12 @@ _080FF2F8: ldrsh r0, [r4, r1] movs r2, 0x34 ldrsh r1, [r4, r2] - bl cosine + bl Cos strh r0, [r4, 0x24] movs r5, 0x38 ldrsh r0, [r4, r5] movs r1, 0x5 - bl sine + bl Sin strh r0, [r4, 0x26] movs r1, 0x38 ldrsh r0, [r4, r1] @@ -2135,7 +2135,7 @@ _080FF974: ands r0, r1 movs r2, 0x32 ldrsh r1, [r6, r2] - bl sine + bl Sin strh r0, [r6, 0x26] movs r0, 0x2E ldrsh r1, [r6, r0] @@ -2325,7 +2325,7 @@ _080FFADE: subs r1, r2 lsls r1, 16 asrs r1, 16 - bl sine + bl Sin strh r0, [r4, 0x26] adds r0, r4, 0 bl sub_80FF9E0 @@ -2432,7 +2432,7 @@ _080FFBBA: subs r1, r2 lsls r1, 16 asrs r1, 16 - bl sine + bl Sin strh r0, [r4, 0x26] adds r0, r4, 0 bl sub_80FF9E0 @@ -2634,7 +2634,7 @@ _080FFD56: subs r1, r2 lsls r1, 16 asrs r1, 16 - bl sine + bl Sin strh r0, [r4, 0x26] lsls r0, 16 cmp r0, 0 @@ -2719,12 +2719,12 @@ _080FFE06: movs r1, 0x30 ldrsh r0, [r4, r1] movs r1, 0x3C - bl cosine + bl Cos strh r0, [r4, 0x24] movs r1, 0x30 ldrsh r0, [r4, r1] movs r1, 0x14 - bl sine + bl Sin strh r0, [r4, 0x26] ldr r0, =sub_80FFE58 str r0, [r4, 0x1C] @@ -2893,12 +2893,12 @@ _080FFF5E: movs r6, 0x30 ldrsh r0, [r4, r6] movs r1, 0x3C - bl cosine + bl Cos strh r0, [r4, 0x24] movs r1, 0x30 ldrsh r0, [r4, r1] movs r1, 0x14 - bl sine + bl Sin strh r0, [r4, 0x26] _080FFF76: pop {r4-r6} @@ -4801,12 +4801,12 @@ sub_8100E80: @ 8100E80 movs r1, 0x2E ldrsh r0, [r4, r1] movs r1, 0x64 - bl cosine + bl Cos strh r0, [r4, 0x24] movs r2, 0x2E ldrsh r0, [r4, r2] movs r1, 0x14 - bl sine + bl Sin strh r0, [r4, 0x26] movs r1, 0x2E ldrsh r0, [r4, r1] @@ -5585,7 +5585,7 @@ sub_81014A0: @ 81014A0 lsls r0, 18 asrs r0, 16 movs r1, 0x3 - bl sine + bl Sin strh r0, [r4, 0x24] ldrh r0, [r4, 0x30] adds r0, 0x1 @@ -8468,7 +8468,7 @@ _08102B80: ldrsh r0, [r5, r1] movs r2, 0x36 ldrsh r1, [r5, r2] - bl sine + bl Sin strh r0, [r5, 0x24] _08102BC2: pop {r4,r5} @@ -8781,7 +8781,7 @@ _08102E00: lsls r0, 16 asrs r0, 16 movs r1, 0xF - bl sine + bl Sin strh r0, [r4, 0x26] ldrh r2, [r4, 0x22] ldrh r0, [r4, 0x20] @@ -8951,12 +8951,12 @@ sub_8102F40: @ 8102F40 movs r1, 0x32 ldrsh r0, [r4, r1] movs r1, 0x12 - bl cosine + bl Cos strh r0, [r4, 0x24] movs r2, 0x32 ldrsh r0, [r4, r2] movs r1, 0x12 - bl sine + bl Sin strh r0, [r4, 0x26] movs r1, 0x32 ldrsh r0, [r4, r1] @@ -9104,7 +9104,7 @@ sub_81030B0: @ 81030B0 movs r1, 0x38 ldrsh r0, [r4, r1] movs r1, 0x8 - bl sine + bl Sin lsls r0, 16 lsrs r1, r0, 16 ldrh r2, [r4, 0x24] @@ -9123,7 +9123,7 @@ _081030DC: movs r1, 0x38 ldrsh r0, [r4, r1] movs r1, 0x4 - bl sine + bl Sin ldrh r3, [r4, 0x26] adds r0, r3 strh r0, [r4, 0x26] @@ -10736,7 +10736,7 @@ _08103DB6: lsrs r0, 24 strh r0, [r4, 0x1C] mov r9, r0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -11159,7 +11159,7 @@ _08104178: ldrsh r0, [r4, r1] movs r2, 0x32 ldrsh r1, [r4, r2] - bl sine + bl Sin strh r0, [r4, 0x26] ldrh r0, [r4, 0x30] adds r0, 0x5 @@ -11262,7 +11262,7 @@ _08104250: subs r1, 0x1 cmp r1, 0 bge _08104250 - bl GenerateRandomNumber2 + bl Random2 lsls r0, 16 lsrs r0, 16 movs r1, 0x7 @@ -11271,7 +11271,7 @@ _08104250: adds r1, r2, 0 subs r1, r0 strh r1, [r4, 0x3A] - bl GenerateRandomNumber2 + bl Random2 lsls r0, 16 lsrs r0, 16 movs r1, 0xA0 @@ -11314,7 +11314,7 @@ _081042BE: ldrsh r0, [r4, r1] movs r2, 0x3A ldrsh r1, [r4, r2] - bl sine + bl Sin strh r0, [r4, 0x26] ldrh r0, [r4, 0x30] adds r0, 0x8 @@ -14747,7 +14747,7 @@ _08105E7A: movs r1, 0x30 ldrsh r0, [r4, r1] movs r1, 0x8 - bl sine + bl Sin strh r0, [r4, 0x24] ldrh r2, [r4, 0x32] lsls r0, r2, 16 @@ -15108,7 +15108,7 @@ sub_810618C: @ 810618C movs r1, 0x38 ldrsh r0, [r4, r1] movs r1, 0xE - bl sine + bl Sin ldrh r1, [r4, 0x26] adds r0, r1 strh r0, [r4, 0x26] @@ -15157,7 +15157,7 @@ _081061E8: ldrsh r0, [r4, r1] movs r2, 0x32 ldrsh r1, [r4, r2] - bl sine + bl Sin strh r0, [r4, 0x26] ldrh r0, [r4, 0x34] adds r0, 0x3 @@ -15233,7 +15233,7 @@ sub_810627C: @ 810627C movs r1, 0x34 ldrsh r0, [r4, r1] movs r1, 0x4 - bl sine + bl Sin strh r0, [r4, 0x24] ldrh r0, [r4, 0x34] adds r0, 0x3 @@ -15837,14 +15837,14 @@ _081067B6: ldrh r1, [r4, 0x32] lsls r1, 16 asrs r1, 24 - bl sine + bl Sin strh r0, [r4, 0x24] movs r2, 0x30 ldrsh r0, [r4, r2] ldrh r1, [r4, 0x34] lsls r1, 16 asrs r1, 24 - bl cosine + bl Cos strh r0, [r4, 0x26] ldrh r0, [r4, 0x30] adds r0, 0x9 @@ -15941,12 +15941,12 @@ sub_8106878: @ 8106878 movs r1, 0 ldrsh r0, [r4, r1] movs r1, 0xA - bl sine + bl Sin strh r0, [r5, 0x2E] movs r1, 0 ldrsh r0, [r4, r1] movs r1, 0x7 - bl cosine + bl Cos strh r0, [r5, 0x30] ldr r0, =sub_81068CC str r0, [r5, 0x1C] @@ -16046,12 +16046,12 @@ sub_8106944: @ 8106944 movs r1, 0 ldrsh r0, [r4, r1] movs r1, 0xA - bl sine + bl Sin strh r0, [r5, 0x2E] movs r1, 0 ldrsh r0, [r4, r1] movs r1, 0x7 - bl cosine + bl Cos strh r0, [r5, 0x30] ldrh r0, [r4, 0x2] strh r0, [r5, 0x32] @@ -16124,7 +16124,7 @@ _081069EE: ands r5, r0 adds r0, r5, 0 movs r1, 0x50 - bl sine + bl Sin lsls r0, 16 asrs r0, 24 strh r0, [r4, 0x24] @@ -16134,7 +16134,7 @@ _081069EE: bgt _08106A32 adds r0, r5, 0 movs r1, 0x50 - bl cosine + bl Cos movs r2, 0x2E ldrsh r1, [r4, r2] lsrs r2, r1, 31 @@ -16182,7 +16182,7 @@ sub_8106A64: @ 8106A64 movs r1, 0x34 ldrsh r0, [r4, r1] movs r1, 0x5 - bl sine + bl Sin strh r0, [r4, 0x24] movs r1, 0x38 ldrsh r0, [r4, r1] @@ -16260,7 +16260,7 @@ _08106AF4: ldrsh r0, [r4, r1] movs r2, 0x32 ldrsh r1, [r4, r2] - bl sine + bl Sin adds r2, r0, 0 strh r2, [r4, 0x26] ldrh r0, [r4, 0x34] @@ -16281,7 +16281,7 @@ _08106AF4: strh r0, [r4, 0x22] strh r5, [r4, 0x24] strh r5, [r4, 0x26] - bl GenerateRandomNumber2 + bl Random2 lsls r0, 16 lsrs r0, 16 movs r1, 0xB4 @@ -16358,7 +16358,7 @@ _08106BC4: movs r1, 0x1E subs r1, r0 adds r0, r2, 0 - bl cosine + bl Cos strh r0, [r4, 0x24] movs r0, 0x30 ldrsh r2, [r4, r0] @@ -16372,7 +16372,7 @@ _08106BE0: movs r1, 0xA subs r1, r0 adds r0, r2, 0 - bl sine + bl Sin strh r0, [r4, 0x26] movs r2, 0x30 ldrsh r0, [r4, r2] @@ -16861,16 +16861,16 @@ _08106F8E: ands r4, r2 adds r0, r4, 0 movs r1, 0x64 - bl cosine + bl Cos strh r0, [r6, 0x24] adds r0, r4, 0 movs r1, 0xA - bl sine + bl Sin adds r4, r0, 0 movs r1, 0x3A ldrsh r0, [r6, r1] movs r1, 0x4 - bl cosine + bl Cos ldrh r2, [r6, 0x30] adds r4, r2 adds r0, r4 @@ -16986,7 +16986,7 @@ _081070A6: sub_81070AC: @ 81070AC push {r4,r5,lr} adds r5, r0, 0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -17116,7 +17116,7 @@ _081071B0: bl __modsi3 cmp r0, 0x1 bne _081071F8 - bl GenerateRandomNumber2 + bl Random2 lsls r0, 16 lsrs r0, 16 movs r1, 0xF0 @@ -17124,7 +17124,7 @@ _081071B0: adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - bl GenerateRandomNumber2 + bl Random2 lsls r0, 16 lsrs r0, 16 movs r1, 0x50 @@ -17271,7 +17271,7 @@ _081072D8: adds r0, r6, 0 bl obj_translate_based_on_private_1_2_3_4 ldr r0, =DummyObjectCallback - bl object_new_hidden_with_callback + bl CreateInvisibleSpriteWithCallback adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -17279,14 +17279,14 @@ _081072D8: ldrb r0, [r5, 0x8] movs r2, 0x4 ldrsh r1, [r5, r2] - bl sine + bl Sin ldrh r1, [r6, 0x20] subs r1, r0 strh r1, [r6, 0x20] ldrb r0, [r5, 0x8] movs r2, 0x6 ldrsh r1, [r5, r2] - bl cosine + bl Cos ldrh r1, [r6, 0x22] subs r1, r0 strh r1, [r6, 0x22] @@ -17345,14 +17345,14 @@ sub_8107380: @ 8107380 movs r0, 0x2E ldrsh r1, [r7, r0] adds r0, r6, 0 - bl sine + bl Sin ldrh r1, [r5, 0x24] adds r0, r1 strh r0, [r5, 0x24] movs r0, 0x30 ldrsh r1, [r7, r0] adds r0, r6, 0 - bl cosine + bl Cos ldrh r1, [r5, 0x26] adds r0, r1 strh r0, [r5, 0x26] @@ -17690,7 +17690,7 @@ _08107688: asrs r0, 24 movs r2, 0x3C ldrsh r1, [r4, r2] - bl sine + bl Sin ldrh r1, [r4, 0x26] adds r0, r1 strh r0, [r4, 0x26] @@ -18007,7 +18007,7 @@ sub_810790C: @ 810790C movs r1, 0x2E ldrsh r0, [r4, r1] movs r1, 0x4 - bl sine + bl Sin strh r0, [r4, 0x24] ldrh r0, [r4, 0x30] adds r0, 0x30 @@ -18881,14 +18881,14 @@ sub_8108034: @ 8108034 adds r0, r4, 0 movs r1, 0x1 bl sub_80A6980 - bl GenerateRandomNumber2 + bl Random2 movs r5, 0xFF ands r5, r0 movs r0, 0x80 lsls r0, 1 adds r6, r0, 0 orrs r5, r6 - bl GenerateRandomNumber2 + bl Random2 ldr r1, =0x000001ff ands r1, r0 adds r0, r1, 0 @@ -19291,7 +19291,7 @@ sub_8108384: @ 8108384 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty b _081083C8 .pool _081083B4: @@ -19305,17 +19305,17 @@ _081083B8: ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty _081083C8: adds r5, r1, r0 adds r0, r5, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 adds r0, r5, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r3, r0, 16 lsrs r4, 18 @@ -19419,11 +19419,11 @@ _08108472: asrs r4, r6, 16 adds r0, r4, 0 movs r1, 0x40 - bl cosine + bl Cos strh r0, [r5, 0x36] adds r0, r4, 0 movs r1, 0x40 - bl sine + bl Sin strh r0, [r5, 0x38] mov r1, sp ldrh r1, [r1] @@ -20248,7 +20248,7 @@ sub_8108B2C: @ 8108B2C strh r0, [r6, 0x22] movs r0, 0x6 strh r0, [r6, 0x2E] - bl GenerateRandomNumber2 + bl Random2 movs r4, 0x1F adds r1, r4, 0 ands r1, r0 @@ -20257,13 +20257,13 @@ sub_8108B2C: @ 8108B2C ldrh r0, [r6, 0x20] adds r1, r0 strh r1, [r6, 0x32] - bl GenerateRandomNumber2 + bl Random2 ands r4, r0 adds r4, r5 ldrh r1, [r6, 0x22] adds r4, r1 strh r4, [r6, 0x36] - bl GenerateRandomNumber2 + bl Random2 movs r1, 0x7 ands r1, r0 mvns r1, r1 @@ -20362,7 +20362,7 @@ sub_8108C08: @ 8108C08 ldrsh r0, [r4, r1] movs r2, 0x32 ldrsh r1, [r4, r2] - bl sine + bl Sin strh r0, [r4, 0x24] ldrh r0, [r4, 0x34] subs r0, 0x1 @@ -20534,7 +20534,7 @@ sub_8108D54: @ 8108D54 lsls r1, 16 lsrs r1, 16 mov r10, r1 - bl GenerateRandomNumber2 + bl Random2 lsls r0, 16 lsrs r0, 16 movs r1, 0xA @@ -20544,7 +20544,7 @@ sub_8108D54: @ 8108D54 lsls r0, 16 lsrs r0, 16 mov r9, r0 - bl GenerateRandomNumber2 + bl Random2 negs r4, r4 lsls r0, 16 lsrs r0, 16 @@ -20962,7 +20962,7 @@ _081090F6: adds r1, r2 lsls r1, 16 asrs r1, 16 - bl sine + bl Sin strh r0, [r4, 0x24] movs r1, 0x2E ldrsh r0, [r4, r1] @@ -20973,7 +20973,7 @@ _081090F6: adds r1, r2 lsls r1, 16 asrs r1, 16 - bl cosine + bl Cos strh r0, [r4, 0x26] ldrh r0, [r4, 0x32] ldrh r2, [r4, 0x2E] @@ -21189,14 +21189,14 @@ _081092E4: movs r1, 0x3C ldrsh r0, [r6, r1] movs r1, 0x1C - bl sine + bl Sin ldrh r1, [r6, 0x24] adds r0, r1 strh r0, [r6, 0x24] movs r1, 0x3C ldrsh r0, [r6, r1] movs r1, 0x1C - bl cosine + bl Cos ldrh r1, [r6, 0x26] adds r0, r1 strh r0, [r6, 0x26] @@ -21238,12 +21238,12 @@ sub_8109338: @ 8109338 movs r1, 0x3C ldrsh r0, [r4, r1] movs r1, 0x1C - bl sine + bl Sin strh r0, [r4, 0x24] movs r1, 0x3C ldrsh r0, [r4, r1] movs r1, 0x1C - bl cosine + bl Cos strh r0, [r4, 0x26] ldrh r0, [r4, 0x3C] adds r0, 0x14 @@ -21344,14 +21344,14 @@ sub_810940C: @ 810940C ldrh r1, [r4, 0x32] lsls r1, 16 asrs r1, 24 - bl sine + bl Sin strh r0, [r4, 0x24] movs r1, 0x30 ldrsh r0, [r4, r1] ldrh r1, [r4, 0x32] lsls r1, 16 asrs r1, 24 - bl cosine + bl Cos strh r0, [r4, 0x26] ldrh r0, [r4, 0x30] adds r0, 0xA @@ -22301,7 +22301,7 @@ _08109B9A: ldrsh r0, [r5, r2] movs r2, 0x36 ldrsh r1, [r5, r2] - bl sine + bl Sin strh r0, [r5, 0x24] ldrh r0, [r5, 0x32] adds r0, 0x4 @@ -22327,7 +22327,7 @@ _08109BCE: ldrsh r0, [r5, r1] movs r2, 0x36 ldrsh r1, [r5, r2] - bl sine + bl Sin adds r2, r0, 0 movs r3, 0 strh r2, [r5, 0x24] @@ -22393,7 +22393,7 @@ sub_8109C4C: @ 8109C4C movs r1, 0x38 ldrsh r0, [r4, r1] movs r1, 0x10 - bl sine + bl Sin ldrh r1, [r4, 0x24] adds r0, r1 strh r0, [r4, 0x24] @@ -22461,14 +22461,14 @@ _08109CC8: ldrsh r0, [r4, r2] lsls r1, 16 asrs r1, 24 - bl sine + bl Sin strh r0, [r4, 0x24] movs r1, 0x30 ldrsh r0, [r4, r1] ldrh r1, [r4, 0x36] lsls r1, 16 asrs r1, 24 - bl cosine + bl Cos strh r0, [r4, 0x26] ldrh r0, [r4, 0x30] adds r0, 0x7 @@ -23476,7 +23476,7 @@ sub_810A4F4: @ 810A4F4 ldrsh r0, [r4, r1] movs r2, 0x38 ldrsh r1, [r4, r2] - bl sine + bl Sin ldrh r1, [r4, 0x24] adds r0, r1 strh r0, [r4, 0x24] @@ -23484,7 +23484,7 @@ sub_810A4F4: @ 810A4F4 ldrsh r0, [r4, r2] movs r2, 0x38 ldrsh r1, [r4, r2] - bl cosine + bl Cos ldrh r1, [r4, 0x26] adds r0, r1 strh r0, [r4, 0x26] @@ -23714,13 +23714,13 @@ sub_810A6EC: @ 810A6EC ldrsh r0, [r4, r1] movs r2, 0x38 ldrsh r1, [r4, r2] - bl sine + bl Sin strh r0, [r4, 0x24] movs r1, 0x3C ldrsh r0, [r4, r1] movs r2, 0x38 ldrsh r1, [r4, r2] - bl cosine + bl Cos strh r0, [r4, 0x26] ldrh r0, [r4, 0x3A] ldrh r1, [r4, 0x3C] @@ -25910,7 +25910,7 @@ sub_810B848: @ 810B848 ldrsh r0, [r4, r1] movs r2, 0x34 ldrsh r1, [r4, r2] - bl sine + bl Sin ldrh r1, [r4, 0x24] adds r0, r1 strh r0, [r4, 0x24] @@ -25918,7 +25918,7 @@ sub_810B848: @ 810B848 ldrsh r0, [r4, r2] movs r2, 0x34 ldrsh r1, [r4, r2] - bl sine + bl Sin ldrh r1, [r4, 0x26] adds r0, r1 strh r0, [r4, 0x26] @@ -26290,12 +26290,12 @@ _0810BB90: ldrsh r0, [r4, r2] lsls r1, 16 asrs r1, 16 - bl sine + bl Sin strh r0, [r4, 0x34] movs r1, 0x2E ldrsh r0, [r4, r1] movs r1, 0xF - bl cosine + bl Cos strh r0, [r4, 0x36] strh r5, [r4, 0x38] ldr r1, =sub_810BBC8 @@ -26329,14 +26329,14 @@ _0810BBDE: ldrsh r0, [r4, r2] lsls r1, 16 asrs r1, 16 - bl sine + bl Sin ldrh r1, [r4, 0x34] subs r0, r1 strh r0, [r4, 0x24] movs r1, 0x2E ldrsh r0, [r4, r1] movs r1, 0xF - bl cosine + bl Cos ldrh r1, [r4, 0x36] subs r0, r1 strh r0, [r4, 0x26] @@ -26582,7 +26582,7 @@ _0810BDEC: ldrsh r0, [r4, r2] movs r2, 0x38 ldrsh r1, [r4, r2] - bl sine + bl Sin ldrh r1, [r4, 0x26] adds r0, r1 strh r0, [r4, 0x26] @@ -26853,7 +26853,7 @@ sub_810C008: @ 810C008 ldrsh r0, [r4, r1] movs r2, 0x3A ldrsh r1, [r4, r2] - bl sine + bl Sin ldrh r1, [r4, 0x24] adds r0, r1 strh r0, [r4, 0x24] @@ -26861,7 +26861,7 @@ sub_810C008: @ 810C008 ldrsh r0, [r4, r2] movs r1, 0x6 negs r1, r1 - bl cosine + bl Cos ldrh r1, [r4, 0x26] adds r0, r1 strh r0, [r4, 0x26] @@ -28451,14 +28451,14 @@ sub_810CD4C: @ 810CD4C adds r0, r4, 0 movs r1, 0x1 bl sub_80A6980 - bl GenerateRandomNumber2 + bl Random2 movs r5, 0xFF ands r5, r0 movs r0, 0x80 lsls r0, 1 adds r6, r0, 0 orrs r5, r6 - bl GenerateRandomNumber2 + bl Random2 ldr r1, =0x000001ff ands r1, r0 adds r0, r1, 0 @@ -28693,7 +28693,7 @@ _0810CF56: ldrsh r0, [r4, r3] cmp r0, 0 bge _0810CF74 - bl GenerateRandomNumber2 + bl Random2 lsls r0, 16 lsrs r0, 16 movs r1, 0x5 @@ -28735,7 +28735,7 @@ _0810CF74: _0810CFBE: lsls r4, r0, 14 lsrs r4, 16 - bl GenerateRandomNumber2 + bl Random2 lsls r0, 16 lsrs r0, 16 lsls r1, r6, 16 @@ -28743,7 +28743,7 @@ _0810CFBE: bl __modsi3 lsls r0, 16 lsrs r6, r0, 16 - bl GenerateRandomNumber2 + bl Random2 lsls r0, 16 lsrs r0, 16 lsls r4, 16 @@ -28752,7 +28752,7 @@ _0810CFBE: bl __modsi3 lsls r0, 16 lsrs r4, r0, 16 - bl GenerateRandomNumber2 + bl Random2 movs r7, 0x1 adds r1, r7, 0 ands r1, r0 @@ -28762,7 +28762,7 @@ _0810CFBE: negs r0, r0 lsrs r6, r0, 16 _0810D000: - bl GenerateRandomNumber2 + bl Random2 adds r1, r7, 0 ands r1, r0 cmp r1, 0 @@ -29048,7 +29048,7 @@ sub_810D240: @ 810D240 asrs r0, 24 movs r2, 0x38 ldrsh r1, [r4, r2] - bl sine + bl Sin ldrh r1, [r4, 0x26] adds r0, r1 strh r0, [r4, 0x26] @@ -29218,7 +29218,7 @@ _0810D3A8: ldrsh r0, [r4, r1] movs r2, 0x32 ldrsh r1, [r4, r2] - bl sine + bl Sin strh r0, [r4, 0x26] ldrh r0, [r4, 0x34] adds r0, 0x3 @@ -30057,7 +30057,7 @@ sub_810DA7C: @ 810DA7C movs r1, 0x30 ldrsh r0, [r4, r1] movs r1, 0x2 - bl sine + bl Sin strh r0, [r4, 0x24] ldrh r0, [r4, 0x2E] adds r0, 0x1 @@ -30497,7 +30497,7 @@ sub_810DE2C: @ 810DE2C movs r1, 0x2E ldrsh r0, [r4, r1] movs r1, 0x4 - bl sine + bl Sin strh r0, [r4, 0x24] ldrh r0, [r4, 0x30] adds r0, 0x30 @@ -30549,12 +30549,12 @@ sub_810DE98: @ 810DE98 movs r1, 0x30 ldrsh r0, [r4, r1] movs r1, 0x20 - bl sine + bl Sin strh r0, [r4, 0x24] movs r1, 0x30 ldrsh r0, [r4, r1] movs r1, 0x8 - bl cosine + bl Cos strh r0, [r4, 0x26] ldrh r0, [r4, 0x30] adds r0, 0x5 @@ -32223,13 +32223,13 @@ sub_810EB88: @ 810EB88 movs r5, 0xD negs r5, r5 adds r1, r5, 0 - bl sine + bl Sin ldr r4, =gUnknown_0203841E strh r0, [r4] movs r1, 0x8 ldrsh r0, [r7, r1] adds r1, r5, 0 - bl cosine + bl Cos strh r0, [r4, 0x2] movs r0, 0x1 strh r0, [r4, 0x4] @@ -32644,10 +32644,10 @@ _0810EEEC: sub_810EEF8: @ 810EEF8 push {r4,r5,lr} adds r5, r0, 0 - bl GenerateRandomNumber2 + bl Random2 ldr r4, =0x000001ff ands r4, r0 - bl GenerateRandomNumber2 + bl Random2 movs r1, 0x7F ands r1, r0 movs r0, 0x1 @@ -35438,7 +35438,7 @@ _08110592: ldrsh r0, [r4, r1] movs r2, 0x38 ldrsh r1, [r4, r2] - bl sine + bl Sin ldrh r1, [r4, 0x24] adds r0, r1 strh r0, [r4, 0x24] @@ -36165,7 +36165,7 @@ sub_8110B80: @ 8110B80 ldrsh r0, [r4, r2] movs r2, 0x34 ldrsh r1, [r4, r2] - bl sine + bl Sin strh r0, [r4, 0x24] ldrh r0, [r4, 0x32] ldrh r1, [r4, 0x38] @@ -37277,7 +37277,7 @@ sub_811149C: @ 811149C ldrsh r0, [r4, r2] movs r2, 0x38 ldrsh r1, [r4, r2] - bl sine + bl Sin ldrh r1, [r4, 0x26] subs r1, r0 strh r1, [r4, 0x26] @@ -37409,7 +37409,7 @@ _081115BC: movs r2, 0xA ldrsh r1, [r4, r2] movs r0, 0x4 - bl cosine + bl Cos ldrh r4, [r4, 0xC] adds r0, r4 strh r0, [r6] @@ -37495,14 +37495,14 @@ _08111694: movs r1, 0x38 ldrsh r0, [r4, r1] movs r1, 0xA - bl sine + bl Sin ldrh r1, [r4, 0x24] adds r0, r1 strh r0, [r4, 0x24] movs r1, 0x38 ldrsh r0, [r4, r1] movs r1, 0xF - bl cosine + bl Cos ldrh r1, [r4, 0x26] adds r0, r1 strh r0, [r4, 0x26] @@ -37545,14 +37545,14 @@ sub_81116E8: @ 81116E8 movs r1, 0x38 ldrsh r0, [r4, r1] movs r1, 0xA - bl sine + bl Sin ldrh r1, [r4, 0x24] adds r0, r1 strh r0, [r4, 0x24] movs r1, 0x38 ldrsh r0, [r4, r1] movs r1, 0xF - bl cosine + bl Cos ldrh r1, [r4, 0x26] adds r0, r1 strh r0, [r4, 0x26] @@ -37699,12 +37699,12 @@ sub_8111814: @ 8111814 movs r1, 0x2E ldrsh r0, [r4, r1] movs r1, 0x20 - bl sine + bl Sin strh r0, [r4, 0x24] movs r1, 0x2E ldrsh r0, [r4, r1] movs r1, 0x8 - bl cosine + bl Cos strh r0, [r4, 0x26] ldrh r0, [r4, 0x2E] subs r0, 0x41 @@ -40050,7 +40050,7 @@ sub_8112B78: @ 8112B78 movs r1, 0x2E ldrsh r0, [r5, r1] movs r1, 0xC - bl sine + bl Sin strh r0, [r5, 0x24] ldr r0, =gUnknown_02038436 ldrb r0, [r0] @@ -40464,7 +40464,7 @@ _08112EB2: ldrsh r0, [r4, r2] movs r2, 0x34 ldrsh r1, [r4, r2] - bl sine + bl Sin strh r0, [r4, 0x24] ldrh r0, [r4, 0x32] subs r0, 0x41 @@ -40516,7 +40516,7 @@ _08112F08: movs r2, 0x3A ldrsh r0, [r4, r2] movs r1, 0x7 - bl sine + bl Sin strh r0, [r4, 0x26] ldr r2, =gTasks movs r0, 0x2E @@ -40595,7 +40595,7 @@ sub_8112FB8: @ 8112FB8 ldrsh r0, [r5, r2] movs r2, 0x30 ldrsh r1, [r5, r2] - bl sine + bl Sin ldr r4, =gUnknown_02020630 movs r1, 0x38 ldrsh r2, [r5, r1] @@ -40608,7 +40608,7 @@ sub_8112FB8: @ 8112FB8 ldrsh r0, [r5, r2] movs r2, 0x30 ldrsh r1, [r5, r2] - bl cosine + bl Cos movs r1, 0x38 ldrsh r2, [r5, r1] lsls r1, r2, 4 @@ -40930,13 +40930,13 @@ _081132B2: ldrsh r0, [r6, r1] movs r2, 0x3C ldrsh r1, [r6, r2] - bl cosine + bl Cos strh r0, [r6, 0x24] movs r1, 0x3A ldrsh r0, [r6, r1] movs r2, 0x3C ldrsh r1, [r6, r2] - bl sine + bl Sin strh r0, [r6, 0x26] ldr r0, =sub_81132E0 str r0, [r6, 0x1C] @@ -40968,13 +40968,13 @@ _081132F2: ldrsh r0, [r4, r1] movs r2, 0x3C ldrsh r1, [r4, r2] - bl cosine + bl Cos strh r0, [r4, 0x24] movs r1, 0x3A ldrsh r0, [r4, r1] movs r2, 0x3C ldrsh r1, [r4, r2] - bl sine + bl Sin strh r0, [r4, 0x26] ldrh r0, [r4, 0x36] adds r0, 0x1 @@ -41037,13 +41037,13 @@ _08113386: ldrsh r0, [r4, r1] movs r2, 0x3C ldrsh r1, [r4, r2] - bl cosine + bl Cos strh r0, [r4, 0x24] movs r1, 0x3A ldrsh r0, [r4, r1] movs r2, 0x3C ldrsh r1, [r4, r2] - bl sine + bl Sin strh r0, [r4, 0x26] ldrh r0, [r4, 0x36] adds r0, 0x1 @@ -41363,14 +41363,14 @@ sub_81135EC: @ 81135EC ldrsh r0, [r5, r1] movs r2, 0x4 ldrsh r1, [r5, r2] - bl cosine + bl Cos strh r0, [r4, 0x30] movs r3, 0x2 ldrsh r0, [r5, r3] lsls r6, 16 asrs r6, 16 adds r1, r6, 0 - bl sine + bl Sin strh r0, [r4, 0x32] ldrh r1, [r4, 0x30] ldrh r2, [r5] @@ -41766,7 +41766,7 @@ _08113992: ldrsh r0, [r4, r1] movs r2, 0x3A ldrsh r1, [r4, r2] - bl sine + bl Sin ldrh r6, [r4, 0x26] adds r0, r6 strh r0, [r4, 0x26] @@ -43263,7 +43263,7 @@ _08114614: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty b _08114650 .pool _08114640: @@ -43274,11 +43274,11 @@ _08114640: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty _08114650: adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r5, r0, 16 _0811465C: @@ -43814,11 +43814,11 @@ sub_8114AF0: @ 8114AF0 bl sub_80A60AC lsls r0, 24 lsrs r7, r0, 24 - bl GenerateRandomNumber2 + bl Random2 movs r4, 0x1F adds r5, r4, 0 ands r5, r0 - bl GenerateRandomNumber2 + bl Random2 ands r4, r0 adds r1, r5, 0 cmp r1, 0x10 @@ -45363,12 +45363,12 @@ sub_8115798: @ 8115798 movs r1, 0x2E ldrsh r0, [r4, r1] movs r1, 0x1E - bl cosine + bl Cos strh r0, [r4, 0x24] movs r2, 0x2E ldrsh r0, [r4, r2] movs r1, 0xA - bl sine + bl Sin strh r0, [r4, 0x26] ldrh r0, [r4, 0x2E] cmp r0, 0x7F @@ -46977,7 +46977,7 @@ sub_8116458: @ 8116458 negs r0, r0 cmp r1, r0 bne _08116474 - bl GenerateRandomNumber2 + bl Random2 movs r1, 0x3 ands r1, r0 strh r1, [r5, 0x2] @@ -46999,7 +46999,7 @@ _08116494: movs r1, 0 bl sub_80A6980 _0811649C: - bl GenerateRandomNumber2 + bl Random2 lsls r0, 16 lsrs r0, 16 movs r1, 0x30 @@ -47009,7 +47009,7 @@ _0811649C: ldrh r1, [r4, 0x24] adds r0, r1 strh r0, [r4, 0x24] - bl GenerateRandomNumber2 + bl Random2 lsls r0, 16 lsrs r0, 16 movs r1, 0x18 @@ -47933,7 +47933,7 @@ _08116C64: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty b _08116CA0 .pool _08116C90: @@ -47944,11 +47944,11 @@ _08116C90: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty _08116CA0: adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r5, r0, 16 _08116CAC: @@ -48370,7 +48370,7 @@ _08117078: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty b _081170BA .pool _081170A8: @@ -48382,11 +48382,11 @@ _081170A8: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty _081170BA: adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData ldr r1, [r4] _081170C4: strh r0, [r1, 0x14] @@ -49429,7 +49429,7 @@ _08117964: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty b _08117996 .pool _08117988: @@ -49439,11 +49439,11 @@ _08117988: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty _08117996: adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 _081179A2: @@ -50053,7 +50053,7 @@ sub_8117E94: @ 8117E94 lsls r0, 24 lsrs r0, 24 ldr r2, =gUnknown_02038436 - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex ldrb r1, [r1] strb r1, [r2] ldr r2, =gUnknown_02038437 @@ -50105,7 +50105,7 @@ sub_8117F10: @ 8117F10 lsls r0, 24 lsrs r0, 24 ldr r2, =gUnknown_02038437 - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex ldrb r1, [r1] strb r1, [r2] bl move_anim_task_del @@ -50436,7 +50436,7 @@ battle_intro_launch: @ 81181D4 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r0, [r2] movs r1, 0x80 lsls r1, 15 @@ -50474,7 +50474,7 @@ _08118230: ands r2, r0 cmp r2, 0 beq _08118250 - ldr r0, =gUnknown_82E9530 + ldr r0, =gGameVersion ldrb r0, [r0] cmp r0, 0x2 beq _08118250 @@ -50587,7 +50587,7 @@ _08118330: .4byte _081183E4 .4byte _08118524 _08118344: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -50872,7 +50872,7 @@ _08118580: bne _081185E4 ldr r7, =gUnknown_02022E1A ldrh r0, [r4, 0x14] - bl cosine2 + bl Cos2 lsls r0, 16 asrs r0, 16 cmp r0, 0 @@ -50937,7 +50937,7 @@ _0811861C: adds r2, r0, r1 movs r3, 0x10 strh r3, [r2, 0x10] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -51236,7 +51236,7 @@ _08118898: lsls r0, 3 adds r2, r0, r1 strh r4, [r2, 0x10] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 diff --git a/asm/battle_anim_8170478.s b/asm/battle_anim_8170478.s new file mode 100644 index 000000000..4b170be29 --- /dev/null +++ b/asm/battle_anim_8170478.s @@ -0,0 +1,5832 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8170478 +sub_8170478: @ 8170478 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + ldr r0, =gUnknown_02038436 + ldrb r4, [r0] + ldr r0, =gUnknown_02022E24 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E26 + strh r1, [r0] + ldr r1, =0x00003f3f + movs r0, 0x48 + bl SetGpuReg + ldr r1, =0x00003f3d + movs r0, 0x4A + bl SetGpuReg + movs r1, 0x80 + lsls r1, 8 + movs r0, 0 + bl SetGpuRegBits + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl lcd_bg_operations + ldr r0, =gUnknown_03005D70 + adds r4, r0 + ldrb r0, [r4] + ldr r1, =gUnknown_02020630 + mov r9, r1 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + add r4, r9 + ldrb r7, [r4, 0x6] + ldrh r6, [r4, 0x38] + lsls r6, 24 + lsrs r6, 24 + ldr r0, =DummyObjectCallback + bl CreateInvisibleSpriteWithCallback + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + ldr r0, =DummyObjectCallback + bl CreateInvisibleSpriteWithCallback + mov r10, r0 + mov r2, r10 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + ldrb r1, [r4, 0x5] + movs r3, 0xD + negs r3, r3 + adds r0, r3, 0 + ands r0, r1 + movs r1, 0x4 + mov r8, r1 + mov r2, r8 + orrs r0, r2 + strb r0, [r4, 0x5] + lsls r5, r7, 4 + adds r5, r7 + lsls r5, 2 + add r5, r9 + ldrb r1, [r5, 0x5] + adds r0, r3, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + add r1, r9 + ldrb r2, [r1, 0x5] + adds r0, r3, 0 + ands r0, r2 + mov r2, r8 + orrs r0, r2 + strb r0, [r1, 0x5] + ldr r0, [sp, 0x14] + lsls r6, r0, 4 + adds r6, r0 + lsls r6, 2 + mov r1, r9 + adds r7, r6, r1 + adds r0, r7, 0 + adds r1, r4, 0 + movs r2, 0x44 + str r3, [sp, 0x18] + bl memcpy + mov r2, r10 + lsls r4, r2, 4 + add r4, r10 + lsls r4, 2 + adds r0, r4, 0 + add r0, r9 + mov r8, r0 + adds r1, r5, 0 + movs r2, 0x44 + bl memcpy + ldrb r1, [r7, 0x1] + ldr r3, [sp, 0x18] + adds r0, r3, 0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r7, 0x1] + mov r2, r8 + ldrb r0, [r2, 0x1] + ands r3, r0 + orrs r3, r1 + strb r3, [r2, 0x1] + movs r0, 0x1C + add r9, r0 + add r6, r9 + ldr r1, =DummyObjectCallback + str r1, [r6] + add r4, r9 + str r1, [r4] + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, =gUnknown_08C2EA9C + bl sub_80A6D48 + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, =gUnknown_08C2EA50 + mov r2, sp + ldrh r2, [r2, 0xA] + bl sub_80A6CC0 + ldr r0, =gUnknown_08C2DDA4 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl decompress_palette + ldr r1, =gUnknown_02022E18 + ldrh r0, [r7, 0x20] + negs r0, r0 + adds r0, 0x20 + strh r0, [r1] + ldr r1, =gUnknown_02022E1A + ldrh r0, [r7, 0x22] + negs r0, r0 + subs r0, 0x20 + strh r0, [r1] + ldr r1, =gTasks + ldr r2, [sp, 0x10] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r1, 0xA0 + lsls r1, 2 + strh r1, [r0, 0xA] + mov r1, sp + ldrh r1, [r1, 0x14] + strh r1, [r0, 0x8] + mov r2, r10 + strh r2, [r0, 0xC] + ldr r1, =sub_8170660 + str r1, [r0] + 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_8170478 + + thumb_func_start sub_8170660 +sub_8170660: @ 8170660 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gUnknown_02038436 + ldrb r0, [r0] + mov r8, r0 + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r5, r0, r1 + ldrh r1, [r5, 0xA] + ldrh r0, [r5, 0x22] + adds r1, r0 + movs r3, 0 + strh r1, [r5, 0x22] + ldr r2, =gUnknown_02022E1A + lsls r0, r1, 16 + lsrs r0, 24 + ldrh r4, [r2] + adds r0, r4 + strh r0, [r2] + movs r0, 0xFF + ands r1, r0 + strh r1, [r5, 0x22] + movs r1, 0x26 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _081706F0 + cmp r0, 0x1 + bgt _081706B4 + cmp r0, 0 + beq _081706BA + b _08170814 + .pool +_081706B4: + cmp r0, 0x2 + beq _08170708 + b _08170814 +_081706BA: + ldrh r0, [r5, 0x1E] + adds r1, r0, 0x1 + strh r1, [r5, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bgt _081706CA + b _08170814 +_081706CA: + strh r3, [r5, 0x1E] + ldrh r1, [r5, 0x20] + adds r1, 0x1 + strh r1, [r5, 0x20] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r2, 0x20 + ldrsh r0, [r5, r2] + cmp r0, 0x8 + beq _081706EE + b _08170814 +_081706EE: + b _08170700 +_081706F0: + ldrh r0, [r5, 0x1C] + adds r0, 0x1 + strh r0, [r5, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1E + beq _08170700 + b _08170814 +_08170700: + ldrh r0, [r5, 0x26] + adds r0, 0x1 + strh r0, [r5, 0x26] + b _08170814 +_08170708: + ldrh r0, [r5, 0x1E] + adds r1, r0, 0x1 + strh r1, [r5, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08170814 + strh r3, [r5, 0x1E] + ldrh r1, [r5, 0x20] + subs r1, 0x1 + strh r1, [r5, 0x20] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x20 + ldrsh r4, [r5, r0] + cmp r4, 0 + bne _08170814 + movs r0, 0 + bl sub_80A477C + ldr r0, =gUnknown_02022E24 + strh r4, [r0] + ldr r0, =gUnknown_02022E26 + strh r4, [r0] + ldr r4, =0x00003f3f + movs r0, 0x48 + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x4A + adds r1, r4, 0 + bl SetGpuReg + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0817076C + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl lcd_bg_operations +_0817076C: + movs r0, 0 + bl GetGpuReg + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 8 + adds r0, r2, 0 + eors r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r4, 0x8 + ldrsh r1, [r5, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r6, =gUnknown_02020630 + adds r0, r6 + bl RemoveObjectAndFreeTiles + movs r0, 0xC + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl RemoveObjectAndFreeTiles + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl lcd_bg_operations + ldr r0, =gUnknown_03005D70 + add r0, r8 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r2, [r1, 0x6] + mov r8, r2 + ldrh r4, [r1, 0x38] + lsls r4, 24 + lsrs r4, 24 + ldrb r3, [r1, 0x5] + movs r2, 0xD + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + movs r5, 0x4 + orrs r0, r5 + strb r0, [r1, 0x5] + mov r0, r8 + lsls r1, r0, 4 + add r1, r8 + lsls r1, 2 + adds r1, r6 + ldrb r3, [r1, 0x5] + adds r0, r2, 0 + ands r0, r3 + orrs r0, r5 + strb r0, [r1, 0x5] + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0, 0x5] + ands r2, r1 + orrs r2, r5 + strb r2, [r0, 0x5] + adds r0, r7, 0 + bl move_anim_task_del +_08170814: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8170660 + + thumb_func_start sub_8170834 +sub_8170834: @ 8170834 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r9, r0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_03005D70 + adds r2, r0 + ldrb r0, [r2] + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + ldr r0, =gUnknown_02020630 + adds r5, r0 + ldrb r1, [r5, 0x6] + mov r10, r1 + ldrh r4, [r5, 0x38] + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x0000d709 + bl AllocObjectPalette + mov r2, r9 + strb r0, [r2] + ldr r0, =0x0000d70a + bl AllocObjectPalette + strb r0, [r7] + ldrb r0, [r5, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r1, 0x80 + lsls r1, 1 + adds r3, r1, 0 + orrs r0, r3 + lsls r6, r4, 4 + adds r6, r4 + lsls r6, 2 + ldr r2, =gUnknown_02020630 + adds r6, r2 + ldrb r4, [r6, 0x5] + lsrs r4, 4 + lsls r4, 4 + orrs r4, r3 + lsls r0, 1 + ldr r1, =gUnknown_02037714 + mov r8, r1 + add r0, r8 + mov r2, r9 + ldrb r1, [r2] + lsls r1, 4 + adds r1, r3, r1 + movs r2, 0x20 + str r3, [sp] + bl gpu_pal_apply + lsls r4, 1 + add r4, r8 + ldrb r0, [r7] + lsls r0, 4 + ldr r3, [sp] + adds r3, r0 + adds r0, r4, 0 + adds r1, r3, 0 + movs r2, 0x20 + bl gpu_pal_apply + mov r0, r9 + ldrb r1, [r0] + lsls r1, 4 + ldrb r2, [r5, 0x5] + movs r3, 0xF + adds r0, r3, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + mov r2, r10 + lsls r1, r2, 4 + add r1, r10 + lsls r1, 2 + ldr r0, =gUnknown_02020630 + adds r1, r0 + mov r0, r9 + ldrb r2, [r0] + lsls r2, 4 + ldrb r4, [r1, 0x5] + adds r0, r3, 0 + ands r0, r4 + orrs r0, r2 + strb r0, [r1, 0x5] + ldrb r0, [r7] + lsls r0, 4 + ldrb r1, [r6, 0x5] + ands r3, r1 + orrs r3, r0 + strb r3, [r6, 0x5] + 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_8170834 + + thumb_func_start sub_8170920 +sub_8170920: @ 8170920 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r1, sp + adds r1, 0x1 + ldr r0, =gUnknown_02038436 + ldrb r2, [r0] + mov r0, sp + bl sub_8170834 + adds r0, r4, 0 + bl move_anim_task_del + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8170920 + + thumb_func_start sub_817094C +sub_817094C: @ 817094C + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_03005D70 + adds r0, r1 + ldrb r0, [r0] + ldr r1, =gUnknown_02020630 + mov r8, r1 + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + add r5, r8 + ldrb r0, [r5, 0x6] + mov r9, r0 + ldrh r6, [r5, 0x38] + lsls r6, 24 + lsrs r6, 24 + ldr r0, =0x0000d709 + bl FreeObjectPaletteByTag + ldr r0, =0x0000d70a + bl FreeObjectPaletteByTag + ldr r0, =0x0000d6ff + bl IndexOfObjectPaletteTag + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x0000d704 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsls r4, 4 + ldrb r2, [r5, 0x5] + movs r3, 0xF + adds r1, r3, 0 + ands r1, r2 + orrs r1, r4 + strb r1, [r5, 0x5] + mov r1, r9 + lsls r2, r1, 4 + add r2, r9 + lsls r2, 2 + add r2, r8 + ldrb r5, [r2, 0x5] + adds r1, r3, 0 + ands r1, r5 + orrs r1, r4 + strb r1, [r2, 0x5] + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + add r1, r8 + lsrs r0, 20 + ldrb r2, [r1, 0x5] + ands r3, r2 + orrs r3, r0 + strb r3, [r1, 0x5] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817094C + + thumb_func_start sub_81709EC +sub_81709EC: @ 81709EC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_02038436 + ldrb r0, [r0] + bl sub_817094C + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81709EC + + thumb_func_start sub_8170A0C +sub_8170A0C: @ 8170A0C + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, =gUnknown_0203841E + ldrh r0, [r2] + strh r0, [r1, 0x1C] + ldrh r0, [r2, 0x2] + strh r0, [r1, 0x1E] + ldr r0, =sub_8170A38 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_8170A0C + + thumb_func_start sub_8170A38 +sub_8170A38: @ 8170A38 + 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 r0, [r4, 0x8] + adds r0, 0x1 + movs r6, 0 + adds r1, r0, 0x1 + strh r1, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x1E + ldrsh r1, [r4, r2] + cmp r0, r1 + blt _08170AF8 + strh r6, [r4, 0x8] + ldr r0, =0x0000d709 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r2, r0, 24 + movs r3, 0x1C + ldrsh r0, [r4, r3] + movs r1, 0x2 + cmp r0, 0 + bne _08170A76 + movs r1, 0x6 +_08170A76: + movs r3, 0xA + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _08170A8C + cmp r0, 0x1 + beq _08170AC8 + b _08170AF8 + .pool +_08170A8C: + ldrh r0, [r4, 0xC] + adds r0, 0x2 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _08170A9E + movs r0, 0x10 + strh r0, [r4, 0xC] +_08170A9E: + lsls r0, r2, 4 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2 + orrs r0, r1 + ldrb r2, [r4, 0xC] + ldr r3, =0x00007f74 + movs r1, 0x1 + bl BlendPalette + movs r3, 0xC + ldrsh r0, [r4, r3] + cmp r0, 0x10 + bne _08170AF8 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + b _08170AF8 + .pool +_08170AC8: + ldrh r0, [r4, 0xC] + subs r0, 0x2 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + bge _08170AD6 + strh r6, [r4, 0xC] +_08170AD6: + lsls r0, r2, 4 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2 + orrs r0, r1 + ldrb r2, [r4, 0xC] + ldr r3, =0x00007f74 + movs r1, 0x1 + bl BlendPalette + movs r3, 0xC + ldrsh r0, [r4, r3] + cmp r0, 0 + bne _08170AF8 + adds r0, r5, 0 + bl move_anim_task_del +_08170AF8: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8170A38 + + thumb_func_start sub_8170B04 +sub_8170B04: @ 8170B04 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gUnknown_020241E4 + ldr r0, =gUnknown_02038436 + ldrb r0, [r0] + adds r0, r1 + ldrb r5, [r0] + 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, 0x1 + beq _08170B52 + cmp r0, 0x1 + bgt _08170B3C + cmp r0, 0 + beq _08170B42 + b _08170BA4 + .pool +_08170B3C: + cmp r0, 0x2 + beq _08170B84 + b _08170BA4 +_08170B42: + adds r0, r5, 0 + movs r1, 0 + bl sub_80A7270 + movs r0, 0x80 + lsls r0, 1 + strh r0, [r4, 0x1C] + b _08170B76 +_08170B52: + ldrh r0, [r4, 0x1C] + adds r0, 0x30 + strh r0, [r4, 0x1C] + movs r0, 0x1C + ldrsh r2, [r4, r0] + adds r0, r5, 0 + adds r1, r2, 0 + movs r3, 0 + bl obj_id_set_rotscale + adds r0, r5, 0 + bl sub_80A7E6C + movs r0, 0x1C + ldrsh r1, [r4, r0] + ldr r0, =0x000002cf + cmp r1, r0 + ble _08170BA4 +_08170B76: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08170BA4 + .pool +_08170B84: + adds r0, r5, 0 + bl sub_80A7344 + ldr r1, =gUnknown_02020630 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + adds r0, r6, 0 + bl move_anim_task_del +_08170BA4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8170B04 + + thumb_func_start sub_8170BB0 +sub_8170BB0: @ 8170BB0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gUnknown_020241E4 + ldr r4, =gUnknown_02038436 + ldrb r0, [r4] + adds r1, r0, r1 + ldrb r1, [r1] + mov r9, r1 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08170BF8 + ldr r1, =gUnknown_0202406E + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + b _08170C08 + .pool +_08170BF8: + ldr r1, =gUnknown_0202406E + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gEnemyParty +_08170C08: + adds r0, r1 + movs r1, 0x26 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + bl ball_number_to_ball_processing_index + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r2, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r6, r0, r2 + movs r0, 0x8 + ldrsh r7, [r6, r0] + cmp r7, 0 + beq _08170C44 + cmp r7, 0x1 + beq _08170CC4 + b _08170CEE + .pool +_08170C44: + ldr r5, =gUnknown_02038436 + ldrb r0, [r5] + movs r1, 0 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r5] + movs r1, 0x1 + bl sub_80A5C6C + adds r1, r0, 0 + lsls r1, 24 + ldr r2, =gUnknown_02020630 + mov r3, r9 + lsls r0, r3, 4 + add r0, r9 + lsls r0, 2 + adds r0, r2 + ldrb r2, [r0, 0x5] + lsls r2, 28 + lsrs r2, 30 + adds r0, 0x43 + ldrb r3, [r0] + movs r0, 0x80 + lsls r0, 22 + adds r1, r0 + lsrs r1, 24 + mov r0, r8 + str r0, [sp] + adds r0, r4, 0 + bl sub_8171D98 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x1C] + str r7, [sp] + str r7, [sp, 0x4] + str r7, [sp, 0x8] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80A75AC + adds r2, r0, 0 + ldrb r1, [r5] + movs r0, 0 + mov r3, r8 + bl sub_81729E8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x1E] + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + b _08170CEE + .pool +_08170CC4: + movs r1, 0x1C + ldrsh r0, [r6, r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x4] + cmp r0, 0 + bne _08170CEE + movs r3, 0x1E + ldrsh r0, [r6, r3] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x4] + cmp r0, 0 + bne _08170CEE + adds r0, r5, 0 + bl move_anim_task_del +_08170CEE: + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8170BB0 + + thumb_func_start sub_8170CFC +sub_8170CFC: @ 8170CFC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_02024208 + ldrh r0, [r0] + bl ball_number_to_ball_processing_index + lsls r0, 24 + lsrs r0, 24 + bl sub_8076A78 + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8170CFC + + thumb_func_start sub_8170D24 +sub_8170D24: @ 8170D24 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_02024208 + ldrh r0, [r0] + bl ball_number_to_ball_processing_index + lsls r0, 24 + lsrs r0, 24 + bl sub_8076AE8 + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8170D24 + + thumb_func_start sub_8170D4C +sub_8170D4C: @ 8170D4C + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x8] + cmp r0, 0x5 + bne _08170D70 + ldr r1, =gUnknown_0203841E + ldr r0, =0x0000ffff + b _08170D74 + .pool +_08170D70: + ldr r1, =gUnknown_0203841E + movs r0, 0 +_08170D74: + strh r0, [r1, 0xE] + adds r0, r2, 0 + bl move_anim_task_del + pop {r0} + bx r0 + .pool + thumb_func_end sub_8170D4C + + thumb_func_start ball_number_to_ball_processing_index +ball_number_to_ball_processing_index: @ 8170D84 + push {lr} + lsls r0, 16 + lsrs r0, 16 + subs r0, 0x1 + cmp r0, 0xB + bhi _08170DFC + lsls r0, 2 + ldr r1, =_08170DA0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08170DA0: + .4byte _08170DD0 + .4byte _08170DD4 + .4byte _08170DD8 + .4byte _08170DFC + .4byte _08170DDC + .4byte _08170DE0 + .4byte _08170DE4 + .4byte _08170DE8 + .4byte _08170DEC + .4byte _08170DF0 + .4byte _08170DF4 + .4byte _08170DF8 +_08170DD0: + movs r0, 0x4 + b _08170DFE +_08170DD4: + movs r0, 0x3 + b _08170DFE +_08170DD8: + movs r0, 0x1 + b _08170DFE +_08170DDC: + movs r0, 0x2 + b _08170DFE +_08170DE0: + movs r0, 0x5 + b _08170DFE +_08170DE4: + movs r0, 0x6 + b _08170DFE +_08170DE8: + movs r0, 0x7 + b _08170DFE +_08170DEC: + movs r0, 0x8 + b _08170DFE +_08170DF0: + movs r0, 0x9 + b _08170DFE +_08170DF4: + movs r0, 0xA + b _08170DFE +_08170DF8: + movs r0, 0xB + b _08170DFE +_08170DFC: + movs r0, 0 +_08170DFE: + pop {r1} + bx r1 + thumb_func_end ball_number_to_ball_processing_index + + thumb_func_start sub_8170E04 +sub_8170E04: @ 8170E04 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + mov r10, r0 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r0, =gUnknown_02024208 + ldrh r0, [r0] + bl ball_number_to_ball_processing_index + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + ldr r1, =gUnknown_0832C588 + adds r0, r1 + movs r1, 0x20 + movs r2, 0x50 + movs r3, 0x1D + bl AddObjectToFront + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =gUnknown_02020630 + mov r9, r1 + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + adds r6, r4, r1 + movs r0, 0x22 + strh r0, [r6, 0x2E] + ldr r2, =gUnknown_02038437 + mov r8, r2 + ldrb r0, [r2] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x30] + mov r1, r8 + ldrb r0, [r1] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x10 + strh r0, [r6, 0x32] + mov r0, r9 + adds r0, 0x1C + adds r4, r0 + ldr r0, =sub_8171104 + str r0, [r4] + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r3, [r0, 0x8] + ldr r1, =gUnknown_020241E4 + mov r2, r8 + ldrb r0, [r2] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + adds r0, 0x3E + ldrb r1, [r0] + lsls r1, 29 + lsrs r1, 31 + lsls r1, 1 + ldrb r2, [r3, 0x9] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x9] + ldr r1, =gTasks + mov r2, r10 + lsls r0, r2, 2 + add r0, r10 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0x8] + ldr r1, =sub_8170EF0 + str r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8170E04 + + thumb_func_start sub_8170EF0 +sub_8170EF0: @ 8170EF0 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, =gTasks + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x8] + ldr r2, =gUnknown_02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x2E] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _08170F1A + adds r0, r3, 0 + bl move_anim_task_del +_08170F1A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8170EF0 + + thumb_func_start sub_8170F2C +sub_8170F2C: @ 8170F2C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 2 + ands r0, r1 + cmp r0, 0 + beq _08170F50 + movs r6, 0x20 + movs r5, 0xB + b _08170F54 + .pool +_08170F50: + movs r6, 0x17 + movs r5, 0x5 +_08170F54: + ldr r0, =gUnknown_02024208 + ldrh r0, [r0] + bl ball_number_to_ball_processing_index + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + bl sub_80A82E4 + adds r3, r0, 0 + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + ldr r1, =gUnknown_0832C588 + adds r0, r1 + adds r1, r6, 0 + adds r1, 0x20 + movs r2, 0x50 + orrs r5, r2 + adds r2, r5, 0 + bl AddObjectToFront + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_02020630 + mov r9, r0 + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + adds r6, r4, r0 + movs r0, 0x22 + strh r0, [r6, 0x2E] + ldr r1, =gUnknown_02038437 + mov r8, r1 + ldrb r0, [r1] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x30] + mov r1, r8 + ldrb r0, [r1] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x10 + strh r0, [r6, 0x32] + movs r0, 0x1C + add r9, r0 + add r4, r9 + ldr r0, =DummyObjectCallback + str r0, [r4] + movs r0, 0 + bl battle_get_side_with_given_state + ldr r1, =gUnknown_020241E4 + lsls r0, 24 + lsrs r0, 24 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + ldr r1, =sub_8039E84 + str r1, [r0] + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0x8] + ldr r1, =sub_8171030 + str r1, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8170F2C + + thumb_func_start sub_8171030 +sub_8171030: @ 8171030 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r6, =gUnknown_02020630 + movs r0, 0 + bl battle_get_side_with_given_state + ldr r1, =gUnknown_020241E4 + lsls r0, 24 + lsrs r0, 24 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0x1 + bne _0817108A + movs r0, 0x3D + movs r1, 0 + bl audio_play_and_stuff + ldr r0, =gTasks + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r6, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_8171104 + str r1, [r0] + ldr r0, =sub_81710A8 + movs r1, 0xA + bl CreateTask + ldr r0, =sub_8170EF0 + str r0, [r4] +_0817108A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8171030 + + thumb_func_start sub_81710A8 +sub_81710A8: @ 81710A8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r6, =gUnknown_02020630 + movs r0, 0 + bl battle_get_side_with_given_state + ldr r4, =gUnknown_020241E4 + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 27 + cmp r0, 0 + bge _081710F4 + movs r0, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0 + bl StartObjectImageAnim + adds r0, r5, 0 + bl DestroyTask +_081710F4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81710A8 + + thumb_func_start sub_8171104 +sub_8171104: @ 8171104 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x30] + ldrh r2, [r4, 0x32] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + strh r1, [r4, 0x32] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + strh r2, [r4, 0x36] + ldr r0, =0x0000ffd8 + strh r0, [r4, 0x38] + adds r0, r4, 0 + bl sub_80A68D4 + ldr r0, =sub_8171134 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8171104 + + thumb_func_start sub_8171134 +sub_8171134: @ 8171134 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _081711D2 + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x8] + cmp r0, 0x5 + bne _08171160 + ldr r0, =sub_8171CAC + str r0, [r4, 0x1C] + b _081711D2 + .pool +_08171160: + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectImageAnim + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + movs r1, 0 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + strh r1, [r4, 0x24] + strh r1, [r4, 0x26] + adds r1, r4, 0 + adds r1, 0x2E + movs r2, 0 + adds r0, r4, 0 + adds r0, 0x3C +_08171188: + strh r2, [r0] + subs r0, 0x2 + cmp r0, r1 + bge _08171188 + movs r0, 0 + strh r0, [r4, 0x38] + ldr r0, =sub_81711E8 + str r0, [r4, 0x1C] + ldr r0, =gUnknown_02024208 + ldrh r0, [r0] + bl ball_number_to_ball_processing_index + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xB + bgt _081711D2 + cmp r5, 0 + blt _081711D2 + ldrh r0, [r4, 0x20] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x22] + subs r1, 0x5 + lsls r1, 24 + lsrs r1, 24 + str r5, [sp] + movs r2, 0x1 + movs r3, 0x1C + bl sub_8171D98 + ldr r0, =gUnknown_02038437 + ldrb r1, [r0] + movs r0, 0 + movs r2, 0xE + adds r3, r5, 0 + bl sub_81729E8 +_081711D2: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8171134 + + thumb_func_start sub_81711E8 +sub_81711E8: @ 81711E8 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _08171224 + ldr r0, =TaskDummy + movs r1, 0x32 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x38] + ldr r0, =sub_8171240 + str r0, [r4, 0x1C] + ldr r2, =gUnknown_02020630 + ldr r1, =gUnknown_020241E4 + ldr r0, =gUnknown_02038437 + ldrb r0, [r0] + 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, 0x30] +_08171224: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81711E8 + + thumb_func_start sub_8171240 +sub_8171240: @ 8171240 + push {r4-r7,lr} + adds r7, r0, 0 + ldr r1, =gUnknown_020241E4 + ldr r0, =gUnknown_02038437 + ldrb r0, [r0] + adds r0, r1 + ldrb r4, [r0] + ldrh r0, [r7, 0x38] + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + bne _08171272 + movs r0, 0x3C + bl audio_play +_08171272: + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _081712E8 + cmp r0, 0x1 + bgt _08171290 + cmp r0, 0 + beq _08171296 + b _08171354 + .pool +_08171290: + cmp r0, 0x2 + beq _0817132C + b _08171354 +_08171296: + adds r0, r4, 0 + movs r1, 0 + bl sub_80A7270 + movs r0, 0x80 + lsls r0, 1 + strh r0, [r5, 0x1C] + ldr r1, =gUnknown_030062DC + movs r0, 0x1C + str r0, [r1] + ldr r2, =gUnknown_030062E4 + ldr r1, =gUnknown_02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0, 0x26] + ldrh r0, [r0, 0x22] + adds r1, r0 + ldrh r0, [r7, 0x26] + ldrh r7, [r7, 0x22] + adds r0, r7 + subs r1, r0 + strh r1, [r2] + ldr r4, =gUnknown_030062E0 + ldrh r0, [r2] + lsls r0, 8 + movs r1, 0x1C + bl __udivsi3 + strh r0, [r4] + strh r0, [r5, 0xC] + b _08171346 + .pool +_081712E8: + ldrh r0, [r5, 0x1C] + adds r0, 0x20 + strh r0, [r5, 0x1C] + movs r0, 0x1C + ldrsh r2, [r5, r0] + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrh r0, [r5, 0xC] + ldrh r1, [r5, 0xE] + adds r0, r1 + strh r0, [r5, 0xE] + ldr r0, =gUnknown_02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + movs r2, 0xE + ldrsh r0, [r5, r2] + negs r0, r0 + asrs r0, 8 + strh r0, [r1, 0x26] + movs r0, 0x1C + ldrsh r1, [r5, r0] + ldr r0, =0x0000047f + cmp r1, r0 + ble _0817137C + b _08171346 + .pool +_0817132C: + adds r0, r4, 0 + bl sub_80A7344 + ldr r1, =gUnknown_02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_08171346: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _0817137C + .pool +_08171354: + ldr r0, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + movs r2, 0xA + ldrsh r0, [r1, r2] + cmp r0, 0xA + ble _0817137C + adds r0, r6, 0 + bl DestroyTask + adds r0, r7, 0 + movs r1, 0x2 + bl StartObjectImageAnim + movs r0, 0 + strh r0, [r7, 0x38] + ldr r0, =sub_817138C + str r0, [r7, 0x1C] +_0817137C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8171240 + + thumb_func_start sub_817138C +sub_817138C: @ 817138C + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081713C6 + movs r1, 0 + strh r1, [r4, 0x34] + movs r0, 0x28 + strh r0, [r4, 0x36] + strh r1, [r4, 0x38] + movs r0, 0 + movs r1, 0x28 + 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_81713D0 + str r0, [r4, 0x1C] +_081713C6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817138C + + thumb_func_start sub_81713D0 +sub_81713D0: @ 81713D0 + 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 _081713E6 + cmp r1, 0x1 + beq _0817145A + b _08171486 +_081713E6: + 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 _08171486 + 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 _08171422 + movs r5, 0x1 +_08171422: + cmp r0, 0x2 + beq _08171442 + cmp r0, 0x2 + bgt _08171434 + cmp r0, 0x1 + beq _0817143A + b _08171452 + .pool +_08171434: + cmp r0, 0x3 + beq _0817144A + b _08171452 +_0817143A: + movs r0, 0x38 + bl audio_play + b _08171486 +_08171442: + movs r0, 0x39 + bl audio_play + b _08171486 +_0817144A: + movs r0, 0x3A + bl audio_play + b _08171486 +_08171452: + movs r0, 0x3B + bl audio_play + b _08171486 +_0817145A: + 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 _08171486 + strh r5, [r4, 0x38] + ldr r0, =0xffffff00 + ands r0, r2 + strh r0, [r4, 0x34] +_08171486: + cmp r5, 0 + beq _081714CA + movs r5, 0 + strh r5, [r4, 0x34] + movs r0, 0x40 + movs r1, 0x28 + bl Cos + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + strh r5, [r4, 0x26] + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _081714C0 + strh r5, [r4, 0x38] + ldr r0, =sub_81717B4 + str r0, [r4, 0x1C] + b _081714CA + .pool +_081714C0: + ldr r0, =sub_81714D4 + str r0, [r4, 0x1C] + movs r0, 0x1 + strh r0, [r4, 0x36] + strh r5, [r4, 0x38] +_081714CA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81713D0 + + thumb_func_start sub_81714D4 +sub_81714D4: @ 81714D4 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x34] + adds r0, 0x1 + movs r5, 0 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _08171510 + strh r5, [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 StartObjectRotScalAnim + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + strh r5, [r0, 0xC] + ldr r0, =sub_8171520 + str r0, [r4, 0x1C] + movs r0, 0x17 + bl audio_play +_08171510: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81714D4 + + thumb_func_start sub_8171520 +sub_8171520: @ 8171520 + push {r4-r6,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x34] + movs r1, 0xFF + ands r1, r0 + cmp r1, 0x6 + bls _08171530 + b _08171768 +_08171530: + lsls r0, r1, 2 + ldr r1, =_08171540 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08171540: + .4byte _0817155C + .4byte _081715AE + .4byte _081715F4 + .4byte _08171654 + .4byte _081716A4 + .4byte _08171708 + .4byte _08171768 +_0817155C: + ldr r1, =gUnknown_020244D0 + ldr r5, [r1] + ldr r2, [r5, 0x8] + ldrh r3, [r2, 0xC] + movs r6, 0xC + ldrsh r0, [r2, r6] + adds r6, r1, 0 + cmp r0, 0xFF + ble _08171584 + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + ldr r1, [r5, 0x8] + ldrb r0, [r1, 0xC] + strh r0, [r1, 0xC] + b _0817158A + .pool +_08171584: + adds r0, r3, 0 + adds r0, 0xB0 + strh r0, [r2, 0xC] +_0817158A: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + movs r3, 0 + 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, 0x7 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xE + bhi _081715AC + b _081717AE +_081715AC: + b _08171644 +_081715AE: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _08171660 + 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 r6, 0x36 + ldrsh r0, [r4, r6] + cmp r0, 0 + bge _081715EA + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80082B8 + b _081717AE +_081715EA: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80082B8 + b _081717AE +_081715F4: + ldr r1, =gUnknown_020244D0 + ldr r5, [r1] + ldr r2, [r5, 0x8] + ldrh r3, [r2, 0xC] + movs r6, 0xC + ldrsh r0, [r2, r6] + adds r6, r1, 0 + cmp r0, 0xFF + ble _0817161C + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + ldr r1, [r5, 0x8] + ldrb r0, [r1, 0xC] + strh r0, [r1, 0xC] + b _08171622 + .pool +_0817161C: + adds r0, r3, 0 + adds r0, 0xB0 + strh r0, [r2, 0xC] +_08171622: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + movs r3, 0 + 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, 0xC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x18 + bhi _08171644 + b _081717AE +_08171644: + ldr r0, [r6] + ldr r0, [r0, 0x8] + strh r3, [r0, 0xC] + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + strh r3, [r4, 0x38] + b _081717AE +_08171654: + ldrh r0, [r4, 0x38] + adds r1, r0, 0x1 + strh r1, [r4, 0x38] + lsls r0, 16 + cmp r0, 0 + bge _0817166E +_08171660: + adds r0, r4, 0 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] + b _081717AE +_0817166E: + 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 r6, 0x36 + ldrsh r0, [r4, r6] + cmp r0, 0 + bge _0817169C + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80082B8 + b _081716A4 +_0817169C: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80082B8 +_081716A4: + ldr r1, =gUnknown_020244D0 + ldr r5, [r1] + ldr r2, [r5, 0x8] + ldrh r3, [r2, 0xC] + movs r6, 0xC + ldrsh r0, [r2, r6] + adds r6, r1, 0 + cmp r0, 0xFF + ble _081716CC + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + ldr r1, [r5, 0x8] + ldrb r0, [r1, 0xC] + strh r0, [r1, 0xC] + b _081716D2 + .pool +_081716CC: + adds r0, r3, 0 + adds r0, 0xB0 + strh r0, [r2, 0xC] +_081716D2: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + movs r3, 0 + 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, 0x4 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8 + bls _081717AE + ldr r0, [r6] + ldr r0, [r0, 0x8] + strh r3, [r0, 0xC] + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + strh r3, [r4, 0x38] + ldrh r0, [r4, 0x36] + negs r0, r0 + strh r0, [r4, 0x36] + b _081717AE +_08171708: + movs r6, 0x80 + lsls r6, 1 + adds r0, r6, 0 + ldrh r1, [r4, 0x34] + adds r0, r1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r1, r0, 24 + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x8] + cmp r1, r0 + bne _08171740 + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_81717B4 + str r0, [r4, 0x1C] + b _081717AE + .pool +_08171740: + cmp r0, 0x4 + bne _08171754 + cmp r1, 0x3 + bne _08171754 + ldr r0, =sub_81717D8 + str r0, [r4, 0x1C] + b _0817175A + .pool +_08171754: + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] +_0817175A: + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + b _081717AE +_08171768: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _081717AE + 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 StartObjectRotScalAnim + movs r6, 0x36 + ldrsh r0, [r4, r6] + cmp r0, 0 + bge _081717A0 + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectRotScalAnim + b _081717A8 + .pool +_081717A0: + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim +_081717A8: + movs r0, 0x17 + bl audio_play +_081717AE: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8171520 + + thumb_func_start sub_81717B4 +sub_81717B4: @ 81717B4 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x38] + adds r0, 0x1 + strh r0, [r1, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _081717CE + movs r0, 0 + strh r0, [r1, 0x38] + ldr r0, =sub_8171AE4 + str r0, [r1, 0x1C] +_081717CE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81717B4 + + thumb_func_start sub_81717D8 +sub_81717D8: @ 81717D8 + adds r3, r0, 0 + adds r3, 0x2C + ldrb r1, [r3] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r3] + ldr r1, =sub_81717F8 + 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_81717D8 + + thumb_func_start sub_81717F8 +sub_81717F8: @ 81717F8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r6, r0, 0 + ldr r7, =gUnknown_02038437 + ldrh r0, [r6, 0x36] + adds r0, 0x1 + movs r1, 0 + mov r8, r1 + strh r0, [r6, 0x36] + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0x28 + bne _0817183C + movs r0, 0xFE + bl audio_play + ldrb r1, [r6, 0x5] + lsrs r1, 4 + movs r0, 0x80 + lsls r0, 9 + lsls r0, r1 + movs r1, 0x6 + movs r2, 0 + bl sub_80A2A20 + adds r0, r6, 0 + bl sub_81719EC + b _081718BC + .pool +_0817183C: + cmp r1, 0x3C + bne _0817185A + ldrb r1, [r6, 0x5] + lsrs r1, 4 + movs r0, 0x80 + lsls r0, 9 + lsls r0, r1 + mov r1, r8 + str r1, [sp] + movs r1, 0x2 + movs r2, 0x6 + movs r3, 0 + bl pal_fade_maybe + b _081718BC +_0817185A: + cmp r1, 0x5F + bne _08171880 + ldr r0, =gUnknown_020244B9 + movs r1, 0 + strb r1, [r0] + movs r0, 0x1 + bl sub_8072A88 + bl m4aMPlayAllStop + ldr r0, =0x00000213 + bl audio_play + b _081718BC + .pool +_08171880: + ldr r0, =0x0000013b + cmp r1, r0 + bne _081718BC + ldr r5, =gUnknown_02020630 + ldr r4, =gUnknown_020241E4 + ldrb r0, [r7] + 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 rotscale_free_entry + ldrb r0, [r7] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles + mov r0, r8 + strh r0, [r6, 0x2E] + ldr r0, =sub_81718D8 + str r0, [r6, 0x1C] +_081718BC: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81717F8 + + thumb_func_start sub_81718D8 +sub_81718D8: @ 81718D8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08171944 + cmp r0, 0x1 + bgt _081718F0 + cmp r0, 0 + beq _081718F6 + b _0817198A +_081718F0: + cmp r0, 0x2 + beq _08171976 + b _0817198A +_081718F6: + strh r0, [r4, 0x30] + strh r0, [r4, 0x32] + ldrb r1, [r4, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4, 0x1] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0x10 + bl SetGpuReg + ldr r0, [r4, 0x14] + ldrh r0, [r0, 0x2] + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x10 + movs r1, 0x1 + lsls r1, r0 + ldr r0, =0x00007fff + str r0, [sp] + adds r0, r1, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _08171982 + .pool +_08171944: + ldrh r0, [r4, 0x30] + adds r1, r0, 0x1 + strh r1, [r4, 0x30] + lsls r0, 16 + cmp r0, 0 + ble _081719B0 + movs r0, 0 + strh r0, [r4, 0x30] + ldrh r2, [r4, 0x32] + adds r2, 0x1 + strh r2, [r4, 0x32] + lsls r1, r2, 8 + movs r0, 0x10 + subs r0, r2 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _081719B0 + b _08171982 +_08171976: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_08171982: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _081719B0 +_0817198A: + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _081719B0 + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + strh r5, [r4, 0x2E] + ldr r0, =sub_81719C0 + str r0, [r4, 0x1C] +_081719B0: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81718D8 + + thumb_func_start sub_81719C0 +sub_81719C0: @ 81719C0 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _081719D8 + ldr r0, =0x0000ffff + strh r0, [r4, 0x2E] + b _081719E4 + .pool +_081719D8: + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_081719E4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81719C0 + + thumb_func_start sub_81719EC +sub_81719EC: @ 81719EC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r6, r0, 0 + adds r1, r6, 0 + adds r1, 0x43 + ldrb r0, [r1] + cmp r0, 0 + beq _08171A0C + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + b _08171A14 +_08171A0C: + movs r0, 0 + mov r8, r0 + movs r0, 0x1 + strb r0, [r1] +_08171A14: + movs r0, 0x4 + bl sub_8171D60 + movs r7, 0 + ldr r2, =gUnknown_02020630 + mov r9, r2 + movs r0, 0x1C + add r0, r9 + mov r10, r0 +_08171A26: + movs r2, 0x20 + ldrsh r1, [r6, r2] + movs r0, 0x22 + ldrsh r2, [r6, r0] + ldr r0, =gUnknown_085E5250 + mov r3, r8 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08171A82 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + mov r2, r9 + adds r5, r4, r2 + movs r0, 0x18 + strh r0, [r5, 0x2E] + ldr r0, =gUnknown_085E5088 + lsls r1, r7, 2 + adds r1, r0 + movs r0, 0 + ldrsb r0, [r1, r0] + ldrh r2, [r6, 0x20] + adds r0, r2 + strh r0, [r5, 0x32] + movs r0, 0x1 + ldrsb r0, [r1, r0] + ldrh r2, [r6, 0x22] + adds r0, r2 + strh r0, [r5, 0x36] + movs r0, 0x2 + ldrsb r0, [r1, r0] + strh r0, [r5, 0x38] + adds r0, r5, 0 + bl sub_80A68D4 + add r4, r10 + ldr r0, =sub_8171AAC + str r0, [r4] + ldr r0, =gUnknown_085E51B4 + ldrb r1, [r0, 0x4] + adds r0, r5, 0 + bl StartObjectImageAnim +_08171A82: + adds r7, 0x1 + cmp r7, 0x2 + bls _08171A26 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81719EC + + thumb_func_start sub_8171AAC +sub_8171AAC: @ 8171AAC + push {r4,lr} + adds r4, r0, 0 + adds r3, r4, 0 + adds r3, 0x3E + ldrb r2, [r3] + lsrs r1, r2, 2 + movs r0, 0x1 + eors r1, r0 + ands r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + adds r0, r4, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _08171ADC + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_08171ADC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8171AAC + + thumb_func_start sub_8171AE4 +sub_8171AE4: @ 8171AE4 + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r1, 0x1 + bl StartObjectImageAnim + adds r0, r4, 0 + movs r1, 0 + bl StartObjectRotScalAnim + ldr r0, =sub_8171BAC + str r0, [r4, 0x1C] + ldr r0, =gUnknown_02024208 + ldrh r0, [r0] + bl ball_number_to_ball_processing_index + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xB + bgt _08171B36 + cmp r5, 0 + blt _08171B36 + ldrh r0, [r4, 0x20] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x22] + subs r1, 0x5 + lsls r1, 24 + lsrs r1, 24 + str r5, [sp] + movs r2, 0x1 + movs r3, 0x1C + bl sub_8171D98 + ldr r0, =gUnknown_02038437 + ldrb r1, [r0] + movs r0, 0x1 + movs r2, 0xE + adds r3, r5, 0 + bl sub_81729E8 +_08171B36: + ldr r6, =gUnknown_02020630 + ldr r5, =gUnknown_020241E4 + ldr r4, =gUnknown_02038437 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x1 + bl StartObjectRotScalAnim + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl AnimateObject + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x80 + lsls r1, 5 + strh r1, [r0, 0x30] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8171AE4 + + thumb_func_start sub_8171BAC +sub_8171BAC: @ 8171BAC + push {r4-r7,lr} + adds r7, r0, 0 + movs r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08171BCA + adds r2, r7, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_08171BCA: + ldr r4, =gUnknown_02020630 + ldr r3, =gUnknown_020241E4 + ldr r2, =gUnknown_02038437 + ldrb r0, [r2] + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r4 + adds r0, r1, 0 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _08171C04 + adds r0, r1, 0 + movs r1, 0 + bl StartObjectRotScalAnim + movs r5, 0x1 + b _08171C24 + .pool +_08171C04: + ldr r6, =0xfffffee0 + adds r0, r6, 0 + ldrh r6, [r1, 0x30] + adds r0, r6 + strh r0, [r1, 0x30] + ldrb r0, [r2] + adds r0, r3 + ldrb r0, [r0] + 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] +_08171C24: + adds r0, r7, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08171C8A + cmp r5, 0 + beq _08171C8A + ldr r4, =gUnknown_02020630 + ldr r3, =gUnknown_020241E4 + ldr r2, =gUnknown_02038437 + ldrb r0, [r2] + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r6, 0 + movs r5, 0 + strh r5, [r0, 0x26] + ldrb r0, [r2] + adds r0, r3 + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r1, [r0, 0x9] + lsls r1, 30 + adds r2, 0x3E + lsrs r1, 31 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + strh r5, [r7, 0x2E] + ldr r0, =sub_81719C0 + str r0, [r7, 0x1C] + ldr r0, =gUnknown_020244B9 + strb r6, [r0] + movs r0, 0x1 + bl sub_8072A88 +_08171C8A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8171BAC + + thumb_func_start sub_8171CAC +sub_8171CAC: @ 8171CAC + push {r4,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x24] + ldrh r1, [r2, 0x20] + adds r0, r1 + movs r1, 0 + strh r0, [r2, 0x20] + ldrh r0, [r2, 0x26] + ldrh r3, [r2, 0x22] + adds r0, r3 + strh r0, [r2, 0x22] + strh r1, [r2, 0x26] + strh r1, [r2, 0x24] + ldr r4, =sub_8171CE8 + movs r3, 0 + movs r1, 0x5 + adds r0, r2, 0 + adds r0, 0x38 +_08171CD0: + strh r3, [r0] + subs r0, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _08171CD0 + str r4, [r2, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8171CAC + + thumb_func_start sub_8171CE8 +sub_8171CE8: @ 8171CE8 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x80 + lsls r0, 4 + adds r2, r0, 0 + ldrh r1, [r4, 0x2E] + adds r2, r1 + movs r0, 0xD0 + lsls r0, 3 + adds r3, r0, 0 + ldrh r1, [r4, 0x30] + adds r3, r1 + lsls r1, r3, 16 + asrs r1, 24 + ldrh r0, [r4, 0x24] + subs r0, r1 + strh r0, [r4, 0x24] + lsls r0, r2, 16 + asrs r0, 24 + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + movs r0, 0xFF + ands r2, r0 + strh r2, [r4, 0x2E] + ands r3, r0 + strh r3, [r4, 0x30] + movs r2, 0x22 + ldrsh r0, [r4, r2] + movs r2, 0x26 + ldrsh r1, [r4, r2] + adds r0, r1 + cmp r0, 0xA0 + bgt _08171D3E + movs r1, 0x20 + ldrsh r0, [r4, r1] + movs r2, 0x24 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0x8 + negs r1, r1 + cmp r0, r1 + bge _08171D52 +_08171D3E: + movs r0, 0 + strh r0, [r4, 0x2E] + ldr r0, =sub_81719C0 + str r0, [r4, 0x1C] + ldr r1, =gUnknown_020244B9 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + bl sub_8072A88 +_08171D52: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8171CE8 + + thumb_func_start sub_8171D60 +sub_8171D60: @ 8171D60 + push {r4,r5,lr} + lsls r0, 24 + ldr r1, =gUnknown_085E5094 + lsrs r5, r0, 21 + adds r4, r5, r1 + ldrh r0, [r4, 0x6] + bl GetObjectTileRangeStartByTag + lsls r0, 16 + ldr r1, =0xffff0000 + cmp r0, r1 + bne _08171D86 + adds r0, r4, 0 + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_085E50F4 + adds r0, r5, r0 + bl LoadCompressedObjectPaletteUsingHeap +_08171D86: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8171D60 + + thumb_func_start sub_8171D98 +sub_8171D98: @ 8171D98 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + adds r6, r0, 0 + mov r8, r1 + mov r9, r2 + mov r10, r3 + ldr r5, [sp, 0x1C] + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r1, r9 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r5, 0 + bl sub_8171D60 + ldr r1, =gUnknown_085E51C0 + lsls r0, r5, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x5 + bl CreateTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0xA] + mov r1, r8 + strh r1, [r0, 0xC] + mov r1, r9 + strh r1, [r0, 0xE] + mov r1, r10 + strh r1, [r0, 0x10] + strh r5, [r0, 0x26] + movs r0, 0xF + bl audio_play + adds r0, r4, 0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8171D98 + + thumb_func_start sub_8171E20 +sub_8171E20: @ 8171E20 + push {lr} + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08171E3E + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r1, [r0, 0x8] + ldrb r0, [r1, 0xA] + adds r0, 0x1 + strb r0, [r1, 0xA] +_08171E3E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8171E20 + + thumb_func_start sub_8171E50 +sub_8171E50: @ 8171E50 + 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 r6, r0, r1 + ldrh r0, [r6, 0x26] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r2, 0x8 + ldrsh r0, [r6, r2] + adds r2, r1, 0 + cmp r0, 0xF + bgt _08171F48 + ldrb r1, [r6, 0xA] + ldrb r2, [r6, 0xC] + ldrb r4, [r6, 0xE] + mov r9, r4 + ldrb r3, [r6, 0x10] + ldr r4, [sp] + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + ldr r4, =gUnknown_085E51F0 + adds r0, r4 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + cmp r0, 0x40 + beq _08171EEC + bl sub_8171E20 + mov r0, r10 + lsls r4, r0, 4 + add r4, r10 + lsls r4, 2 + ldr r5, =gUnknown_02020630 + adds r7, r4, r5 + ldr r0, =gUnknown_085E51B4 + ldr r1, [sp] + adds r0, r1, r0 + ldrb r1, [r0] + adds r0, r7, 0 + bl StartObjectImageAnim + adds r5, 0x1C + adds r4, r5 + ldr r0, =sub_8171F68 + str r0, [r4] + movs r0, 0x3 + mov r2, r9 + ands r2, r0 + lsls r2, 2 + ldrb r1, [r7, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + orrs r0, r2 + strb r0, [r7, 0x5] + ldrb r0, [r6, 0x8] + cmp r0, 0x7 + bls _08171EE8 + subs r0, 0x8 + lsls r0, 24 + lsrs r0, 24 +_08171EE8: + lsls r0, 5 + strh r0, [r7, 0x2E] +_08171EEC: + ldr r0, =gTasks + mov r4, r8 + lsls r1, r4, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r2, 0x8 + ldrsh r1, [r1, r2] + adds r2, r0, 0 + cmp r1, 0xF + bne _08171F48 + ldr r0, =gMain + ldr r4, =0x00000439 + adds r0, r4 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08171F22 + ldr r0, =gUnknown_02020630 + mov r2, r10 + lsls r1, r2, 4 + add r1, r10 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_08171F22: + mov r0, r8 + bl DestroyTask + b _08171F58 + .pool +_08171F48: + mov r4, r8 + lsls r0, r4, 2 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] +_08171F58: + 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_8171E50 + + thumb_func_start sub_8171F68 +sub_8171F68: @ 8171F68 + push {lr} + adds r1, r0, 0 + ldrh r2, [r1, 0x30] + movs r3, 0x30 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _08171F80 + ldr r0, =sub_8171F88 + str r0, [r1, 0x1C] + b _08171F84 + .pool +_08171F80: + subs r0, r2, 0x1 + strh r0, [r1, 0x30] +_08171F84: + pop {r0} + bx r0 + thumb_func_end sub_8171F68 + + thumb_func_start sub_8171F88 +sub_8171F88: @ 8171F88 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r2, 0x30 + ldrsh r1, [r4, r2] + bl Sin + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r2, 0x30 + ldrsh r1, [r4, r2] + bl Cos + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x2 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x32 + bne _08171FBC + adds r0, r4, 0 + bl sub_8172944 +_08171FBC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8171F88 + + thumb_func_start sub_8171FC4 +sub_8171FC4: @ 8171FC4 + 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 r9, r0 + ldr r0, =gTasks + mov r2, r9 + lsls r1, r2, 2 + add r1, r9 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrb r3, [r1, 0xA] + str r3, [sp] + ldrb r0, [r1, 0xC] + str r0, [sp, 0x4] + ldrb r2, [r1, 0xE] + str r2, [sp, 0x8] + ldrb r1, [r1, 0x10] + str r1, [sp, 0xC] + movs r7, 0 + ldr r3, =gUnknown_02020630 + mov r10, r3 + mov r1, r8 + lsls r0, r1, 1 + add r0, r8 + lsls r0, 3 + str r0, [sp, 0x10] +_0817200A: + ldr r0, =gUnknown_085E51F0 + ldr r2, [sp, 0x10] + adds r0, r2, r0 + ldr r1, [sp] + ldr r2, [sp, 0x4] + ldr r3, [sp, 0xC] + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _0817206A + bl sub_8171E20 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + mov r3, r10 + adds r5, r4, r3 + ldr r0, =gUnknown_085E51B4 + add r0, r8 + ldrb r1, [r0] + adds r0, r5, 0 + bl StartObjectImageAnim + ldr r0, =gUnknown_0202064C + adds r4, r0 + ldr r0, =sub_8172508 + str r0, [r4] + movs r0, 0x3 + ldr r2, [sp, 0x8] + ands r2, r0 + lsls r2, 2 + ldrb r0, [r5, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + lsls r0, r7, 5 + strh r0, [r5, 0x2E] + movs r0, 0xA + strh r0, [r5, 0x36] + movs r0, 0x2 + strh r0, [r5, 0x38] + movs r0, 0x1 + strh r0, [r5, 0x3A] +_0817206A: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x7 + bls _0817200A + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08172092 + ldr r0, =gUnknown_02020630 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_08172092: + mov r0, r9 + bl DestroyTask + 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_8171FC4 + + thumb_func_start sub_81720C8 +sub_81720C8: @ 81720C8 + 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 r9, r0 + ldr r0, =gTasks + mov r2, r9 + lsls r1, r2, 2 + add r1, r9 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrb r3, [r1, 0xA] + str r3, [sp] + ldrb r0, [r1, 0xC] + str r0, [sp, 0x4] + ldrb r2, [r1, 0xE] + str r2, [sp, 0x8] + ldrb r1, [r1, 0x10] + str r1, [sp, 0xC] + movs r7, 0 + ldr r3, =gUnknown_02020630 + mov r10, r3 + mov r1, r8 + lsls r0, r1, 1 + add r0, r8 + lsls r0, 3 + str r0, [sp, 0x10] +_0817210E: + ldr r0, =gUnknown_085E51F0 + ldr r2, [sp, 0x10] + adds r0, r2, r0 + ldr r1, [sp] + ldr r2, [sp, 0x4] + ldr r3, [sp, 0xC] + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _0817216E + bl sub_8171E20 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + mov r3, r10 + adds r5, r4, r3 + ldr r0, =gUnknown_085E51B4 + add r0, r8 + ldrb r1, [r0] + adds r0, r5, 0 + bl StartObjectImageAnim + ldr r0, =gUnknown_0202064C + adds r4, r0 + ldr r0, =sub_8172508 + str r0, [r4] + movs r0, 0x3 + ldr r2, [sp, 0x8] + ands r2, r0 + lsls r2, 2 + ldrb r0, [r5, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + lsls r0, r7, 5 + strh r0, [r5, 0x2E] + movs r0, 0xA + strh r0, [r5, 0x36] + movs r0, 0x1 + strh r0, [r5, 0x38] + movs r0, 0x2 + strh r0, [r5, 0x3A] +_0817216E: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x7 + bls _0817210E + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08172196 + ldr r0, =gUnknown_02020630 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_08172196: + mov r0, r9 + bl DestroyTask + 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_81720C8 + + thumb_func_start sub_81721CC +sub_81721CC: @ 81721CC + 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 r9, r0 + ldr r1, =gTasks + lsls r0, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x26] + lsls r1, 24 + lsrs r1, 24 + ldrb r2, [r0, 0xA] + str r2, [sp] + ldrb r3, [r0, 0xC] + str r3, [sp, 0x4] + ldrb r2, [r0, 0xE] + str r2, [sp, 0x8] + ldrb r0, [r0, 0x10] + str r0, [sp, 0xC] + movs r7, 0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + str r0, [sp, 0x10] + ldr r3, =gUnknown_02020630 + mov r8, r3 + ldr r0, =gUnknown_085E51B4 + adds r1, r0 + mov r10, r1 +_08172212: + ldr r0, =gUnknown_085E51F0 + ldr r1, [sp, 0x10] + adds r0, r1, r0 + ldr r1, [sp] + ldr r2, [sp, 0x4] + ldr r3, [sp, 0xC] + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _0817226E + bl sub_8171E20 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + mov r2, r8 + adds r5, r4, r2 + mov r3, r10 + ldrb r1, [r3] + adds r0, r5, 0 + bl StartObjectImageAnim + ldr r0, =gUnknown_0202064C + adds r4, r0 + ldr r0, =sub_8172508 + str r0, [r4] + movs r0, 0x3 + ldr r2, [sp, 0x8] + ands r2, r0 + lsls r2, 2 + ldrb r0, [r5, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + lsls r0, r7, 5 + strh r0, [r5, 0x2E] + movs r0, 0x4 + strh r0, [r5, 0x36] + movs r0, 0x1 + strh r0, [r5, 0x38] + strh r0, [r5, 0x3A] +_0817226E: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x7 + bls _08172212 + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08172296 + ldr r0, =gUnknown_02020630 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_08172296: + mov r0, r9 + bl DestroyTask + 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_81721CC + + thumb_func_start sub_81722CC +sub_81722CC: @ 81722CC + 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 r9, r0 + ldr r0, =gTasks + mov r2, r9 + lsls r1, r2, 2 + add r1, r9 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrb r3, [r1, 0xA] + str r3, [sp] + ldrb r0, [r1, 0xC] + str r0, [sp, 0x4] + ldrb r2, [r1, 0xE] + str r2, [sp, 0x8] + ldrb r1, [r1, 0x10] + str r1, [sp, 0xC] + movs r7, 0 + ldr r3, =gUnknown_02020630 + mov r10, r3 + mov r1, r8 + lsls r0, r1, 1 + add r0, r8 + lsls r0, 3 + str r0, [sp, 0x10] +_08172312: + ldr r0, =gUnknown_085E51F0 + ldr r2, [sp, 0x10] + adds r0, r2, r0 + ldr r1, [sp] + ldr r2, [sp, 0x4] + ldr r3, [sp, 0xC] + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _08172376 + bl sub_8171E20 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + mov r3, r10 + adds r5, r4, r3 + ldr r0, =gUnknown_085E51B4 + add r0, r8 + ldrb r1, [r0] + adds r0, r5, 0 + bl StartObjectImageAnim + ldr r0, =gUnknown_0202064C + adds r4, r0 + ldr r0, =sub_8172508 + str r0, [r4] + movs r0, 0x3 + ldr r2, [sp, 0x8] + ands r2, r0 + lsls r2, 2 + ldrb r0, [r5, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 3 + adds r0, r7 + strh r0, [r5, 0x2E] + movs r0, 0x5 + strh r0, [r5, 0x36] + movs r0, 0x1 + strh r0, [r5, 0x38] + strh r0, [r5, 0x3A] +_08172376: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x9 + bls _08172312 + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0817239E + ldr r0, =gUnknown_02020630 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_0817239E: + mov r0, r9 + bl DestroyTask + 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_81722CC + + thumb_func_start sub_81723D4 +sub_81723D4: @ 81723D4 + 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 + mov r8, r0 + ldr r1, =gTasks + lsls r2, r0, 2 + adds r0, r2, r0 + lsls r0, 3 + adds r3, r0, r1 + ldrh r1, [r3, 0x16] + movs r4, 0x16 + ldrsh r0, [r3, r4] + cmp r0, 0 + beq _08172404 + subs r0, r1, 0x1 + strh r0, [r3, 0x16] + b _081724D6 + .pool +_08172404: + ldrh r0, [r3, 0x26] + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r3, 0xA] + str r1, [sp] + ldrb r4, [r3, 0xC] + str r4, [sp, 0x4] + ldrb r1, [r3, 0xE] + str r1, [sp, 0x8] + ldrb r3, [r3, 0x10] + str r3, [sp, 0xC] + movs r7, 0 + str r2, [sp, 0x14] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + str r1, [sp, 0x10] + ldr r3, =gUnknown_02020630 + mov r9, r3 + ldr r1, =gUnknown_085E51B4 + adds r0, r1 + mov r10, r0 +_08172430: + ldr r0, =gUnknown_085E51F0 + ldr r4, [sp, 0x10] + adds r0, r4, r0 + ldr r1, [sp] + ldr r2, [sp, 0x4] + ldr r3, [sp, 0xC] + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _0817248C + bl sub_8171E20 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + mov r0, r9 + adds r5, r4, r0 + mov r3, r10 + ldrb r1, [r3] + adds r0, r5, 0 + bl StartObjectImageAnim + ldr r0, =gUnknown_0202064C + adds r4, r0 + ldr r0, =sub_8172508 + str r0, [r4] + movs r0, 0x3 + ldr r2, [sp, 0x8] + ands r2, r0 + lsls r2, 2 + ldrb r0, [r5, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + lsls r0, r7, 5 + strh r0, [r5, 0x2E] + movs r0, 0x8 + strh r0, [r5, 0x36] + movs r0, 0x2 + strh r0, [r5, 0x38] + strh r0, [r5, 0x3A] +_0817248C: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x7 + bls _08172430 + ldr r0, =gTasks + ldr r1, [sp, 0x14] + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x8 + strh r0, [r1, 0x16] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0x2 + bne _081724D6 + ldr r0, =gMain + ldr r4, =0x00000439 + adds r0, r4 + ldrb r1, [r0] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _081724D0 + ldr r0, =gUnknown_02020630 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_081724D0: + mov r0, r8 + bl DestroyTask +_081724D6: + 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_81723D4 + + thumb_func_start sub_8172508 +sub_8172508: @ 8172508 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r2, 0x30 + ldrsh r1, [r4, r2] + bl Sin + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r2, 0x32 + ldrsh r1, [r4, r2] + bl Cos + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x2E] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x38] + ldrh r2, [r4, 0x30] + adds r0, r2 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x3A] + ldrh r1, [r4, 0x32] + adds r0, r1 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x33 + bne _08172558 + adds r0, r4, 0 + bl sub_8172944 +_08172558: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8172508 + + thumb_func_start sub_8172560 +sub_8172560: @ 8172560 + 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 r9, r0 + ldr r1, =gTasks + lsls r0, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x26] + lsls r1, 24 + lsrs r1, 24 + ldrb r2, [r0, 0xA] + str r2, [sp] + ldrb r3, [r0, 0xC] + str r3, [sp, 0x4] + ldrb r2, [r0, 0xE] + str r2, [sp, 0x8] + ldrb r0, [r0, 0x10] + str r0, [sp, 0xC] + movs r7, 0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + str r0, [sp, 0x10] + ldr r3, =gUnknown_02020630 + mov r8, r3 + ldr r0, =gUnknown_085E51B4 + adds r1, r0 + mov r10, r1 +_081725A6: + ldr r0, =gUnknown_085E51F0 + ldr r1, [sp, 0x10] + adds r0, r1, r0 + ldr r1, [sp] + ldr r2, [sp, 0x4] + ldr r3, [sp, 0xC] + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _081725FE + bl sub_8171E20 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + mov r2, r8 + adds r5, r4, r2 + mov r3, r10 + ldrb r1, [r3] + adds r0, r5, 0 + bl StartObjectImageAnim + ldr r0, =gUnknown_0202064C + adds r4, r0 + ldr r0, =sub_817265C + str r0, [r4] + movs r0, 0x3 + ldr r2, [sp, 0x8] + ands r2, r0 + lsls r2, 2 + ldrb r0, [r5, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 2 + adds r0, r7 + strh r0, [r5, 0x2E] +_081725FE: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0xB + bls _081725A6 + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08172626 + ldr r0, =gUnknown_02020630 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_08172626: + mov r0, r9 + bl DestroyTask + 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_8172560 + + thumb_func_start sub_817265C +sub_817265C: @ 817265C + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + movs r2, 0x30 + ldrsh r1, [r5, r2] + bl Sin + strh r0, [r5, 0x24] + movs r0, 0x2E + ldrsh r4, [r5, r0] + movs r2, 0x32 + ldrsh r1, [r5, r2] + adds r0, r4, 0 + bl Sin + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl Cos + strh r0, [r5, 0x26] + ldrh r0, [r5, 0x2E] + adds r0, 0x6 + movs r1, 0xFF + ands r0, r1 + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x30] + adds r0, 0x1 + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x34] + adds r0, 0x1 + strh r0, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x33 + bne _081726B4 + adds r0, r5, 0 + bl sub_8172944 +_081726B4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_817265C + + thumb_func_start sub_81726BC +sub_81726BC: @ 81726BC + 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] + ldr r0, =gTasks + ldr r2, [sp] + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldrb r3, [r1, 0xA] + str r3, [sp, 0x4] + ldrb r0, [r1, 0xC] + str r0, [sp, 0x8] + ldrb r2, [r1, 0xE] + str r2, [sp, 0xC] + ldrb r1, [r1, 0x10] + str r1, [sp, 0x10] + movs r3, 0 + mov r8, r3 + mov r1, r9 + lsls r0, r1, 1 + add r0, r9 + lsls r0, 3 + str r0, [sp, 0x14] +_08172700: + movs r7, 0 + movs r2, 0x1 + add r2, r8 + mov r10, r2 +_08172708: + ldr r0, =gUnknown_085E51F0 + ldr r3, [sp, 0x14] + adds r0, r3, r0 + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + ldr r3, [sp, 0x10] + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _08172790 + bl sub_8171E20 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + ldr r0, =gUnknown_02020630 + adds r5, r4, r0 + ldr r0, =gUnknown_085E51B4 + add r0, r9 + ldrb r1, [r0] + adds r0, r5, 0 + bl StartObjectImageAnim + ldr r1, =gUnknown_0202064C + adds r4, r1 + ldr r0, =sub_8172508 + str r0, [r4] + movs r0, 0x3 + ldr r1, [sp, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r0, [r5, 0x5] + movs r3, 0xD + negs r3, r3 + adds r2, r3, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + lsls r0, r7, 5 + strh r0, [r5, 0x2E] + movs r0, 0x8 + strh r0, [r5, 0x36] + mov r0, r8 + cmp r0, 0 + bne _08172788 + movs r0, 0x2 + strh r0, [r5, 0x38] + movs r0, 0x1 + b _0817278E + .pool +_08172788: + movs r0, 0x1 + strh r0, [r5, 0x38] + movs r0, 0x2 +_0817278E: + strh r0, [r5, 0x3A] +_08172790: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x7 + bls _08172708 + mov r1, r10 + lsls r0, r1, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x1 + bls _08172700 + ldr r0, =gMain + ldr r2, =0x00000439 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _081727C4 + ldr r0, =gUnknown_02020630 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_081727C4: + ldr r0, [sp] + bl DestroyTask + 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_81726BC + + thumb_func_start sub_81727E8 +sub_81727E8: @ 81727E8 + 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 r9, r0 + ldr r1, =gTasks + lsls r0, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x26] + lsls r1, 24 + lsrs r1, 24 + ldrb r2, [r0, 0xA] + str r2, [sp] + ldrb r3, [r0, 0xC] + str r3, [sp, 0x4] + ldrb r2, [r0, 0xE] + str r2, [sp, 0x8] + ldrb r0, [r0, 0x10] + str r0, [sp, 0xC] + movs r7, 0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + str r0, [sp, 0x10] + ldr r3, =gUnknown_02020630 + mov r8, r3 + ldr r0, =gUnknown_085E51B4 + adds r1, r0 + mov r10, r1 +_0817282E: + ldr r0, =gUnknown_085E51F0 + ldr r1, [sp, 0x10] + adds r0, r1, r0 + ldr r1, [sp] + ldr r2, [sp, 0x4] + ldr r3, [sp, 0xC] + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _08172880 + bl sub_8171E20 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + mov r2, r8 + adds r5, r4, r2 + mov r3, r10 + ldrb r1, [r3] + adds r0, r5, 0 + bl StartObjectImageAnim + ldr r0, =gUnknown_0202064C + adds r4, r0 + ldr r0, =sub_81728E0 + str r0, [r4] + movs r0, 0x3 + ldr r2, [sp, 0x8] + ands r2, r0 + lsls r2, 2 + ldrb r0, [r5, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + lsls r0, r7, 5 + strh r0, [r5, 0x2E] +_08172880: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x7 + bls _0817282E + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _081728A8 + ldr r0, =gUnknown_02020630 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_081728A8: + mov r0, r9 + bl DestroyTask + 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_81727E8 + + thumb_func_start sub_81728E0 +sub_81728E0: @ 81728E0 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + movs r2, 0x30 + ldrsh r1, [r5, r2] + bl Sin + strh r0, [r5, 0x24] + movs r0, 0x2E + ldrsh r4, [r5, r0] + ldrh r1, [r5, 0x2E] + movs r0, 0x3F + ands r0, r1 + movs r2, 0x32 + ldrsh r1, [r5, r2] + bl Sin + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl Cos + strh r0, [r5, 0x26] + ldrh r0, [r5, 0x2E] + adds r0, 0xA + movs r1, 0xFF + ands r0, r1 + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x30] + adds r0, 0x1 + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x34] + adds r0, 0x1 + strh r0, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x33 + bne _0817293C + adds r0, r5, 0 + bl sub_8172944 +_0817293C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81728E0 + + thumb_func_start sub_8172944 +sub_8172944: @ 8172944 + push {r4-r7,lr} + adds r7, r0, 0 + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08172970 + movs r1, 0x3C + ldrsh r0, [r7, r1] + cmp r0, 0x1 + bne _081729CA + adds r0, r7, 0 + bl RemoveObjectAndFreeResources + b _081729E2 + .pool +_08172970: + ldr r2, =gUnknown_020244D0 + ldr r0, [r2] + ldr r1, [r0, 0x8] + ldrb r0, [r1, 0xA] + subs r0, 0x1 + strb r0, [r1, 0xA] + ldr r0, [r2] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0xA] + cmp r0, 0 + bne _081729DC + movs r4, 0 + ldr r5, =gUnknown_085E51C0 + b _08172998 + .pool +_08172994: + adds r5, 0x4 + adds r4, 0x1 +_08172998: + cmp r4, 0xB + bgt _081729AA + ldr r0, [r5] + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08172994 +_081729AA: + cmp r4, 0xC + bne _081729CA + movs r6, 0 + ldr r5, =gUnknown_085E5094 + ldr r4, =gUnknown_085E50F4 +_081729B4: + ldrh r0, [r5, 0x6] + bl FreeObjectTilesByTag + ldrh r0, [r4, 0x4] + bl FreeObjectPaletteByTag + adds r5, 0x8 + adds r4, 0x8 + adds r6, 0x1 + cmp r6, 0xB + ble _081729B4 +_081729CA: + adds r0, r7, 0 + bl RemoveObjectAndFreeTiles + b _081729E2 + .pool +_081729DC: + adds r0, r7, 0 + bl RemoveObjectAndFreeTiles +_081729E2: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8172944 + + thumb_func_start sub_81729E8 +sub_81729E8: @ 81729E8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r4, r0, 0 + mov r9, r2 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r3, 24 + lsrs r7, r3, 24 + ldr r0, =sub_8172AB0 + movs r1, 0x5 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, =gTasks + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + strh r7, [r5, 0x26] + strh r6, [r5, 0xE] + mov r0, r9 + strh r0, [r5, 0x1C] + mov r1, r9 + lsrs r0, r1, 16 + strh r0, [r5, 0x1E] + cmp r4, 0 + bne _08172A58 + lsls r0, r6, 20 + movs r2, 0x80 + lsls r2, 17 + adds r0, r2 + lsrs r0, 16 + ldr r2, =gUnknown_085E5310 + lsls r1, r7, 1 + adds r1, r2 + ldrh r3, [r1] + movs r1, 0x10 + movs r2, 0 + bl BlendPalette + movs r0, 0x1 + strh r0, [r5, 0xA] + b _08172A7E + .pool +_08172A58: + lsls r0, r6, 20 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r0, 16 + ldr r2, =gUnknown_085E5310 + lsls r1, r7, 1 + adds r1, r2 + ldrh r3, [r1] + movs r1, 0x10 + movs r2, 0x10 + bl BlendPalette + movs r0, 0x10 + strh r0, [r5, 0x8] + ldr r0, =0x0000ffff + strh r0, [r5, 0xA] + ldr r0, =sub_8172B40 + str r0, [r5] +_08172A7E: + ldr r0, =0x00007fff + str r0, [sp] + mov r0, r9 + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + mov r0, r8 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81729E8 + + thumb_func_start sub_8172AB0 +sub_8172AB0: @ 8172AB0 + push {r4,r5,lr} + sub sp, 0x4 + 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, 0x26] + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0x10 + bgt _08172B08 + movs r2, 0xE + ldrsh r0, [r4, r2] + lsls r0, 20 + movs r2, 0x80 + lsls r2, 17 + adds r0, r2 + lsrs r0, 16 + ldrb r2, [r4, 0x8] + ldr r3, =gUnknown_085E5310 + lsls r1, 1 + adds r1, r3 + ldrh r3, [r1] + movs r1, 0x10 + bl BlendPalette + ldrh r0, [r4, 0xA] + ldrh r1, [r4, 0x8] + adds r0, r1 + strh r0, [r4, 0x8] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + b _08172B30 + .pool +_08172B08: + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08172B30 + ldrh r0, [r4, 0x1C] + ldrh r1, [r4, 0x1E] + lsls r1, 16 + orrs r0, r1 + ldr r1, =0x00007fff + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + adds r0, r5, 0 + bl DestroyTask +_08172B30: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8172AB0 + + thumb_func_start sub_8172B40 +sub_8172B40: @ 8172B40 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08172B78 + ldr r0, =gTasks + lsls r4, r2, 2 + adds r4, r2 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r4, 0x1C] + ldrh r1, [r4, 0x1E] + lsls r1, 16 + orrs r0, r1 + ldr r1, =0x00007fff + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =sub_8172B90 + str r0, [r4] +_08172B78: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8172B40 + + thumb_func_start sub_8172B90 +sub_8172B90: @ 8172B90 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r1, r0, 24 + movs r3, 0xC + ldrsh r0, [r4, r3] + cmp r0, 0x10 + bgt _08172BE4 + movs r2, 0xE + ldrsh r0, [r4, r2] + lsls r0, 20 + movs r3, 0x80 + lsls r3, 17 + adds r0, r3 + lsrs r0, 16 + ldrb r2, [r4, 0x8] + ldr r3, =gUnknown_085E5310 + lsls r1, 1 + adds r1, r3 + ldrh r3, [r1] + movs r1, 0x10 + bl BlendPalette + ldrh r0, [r4, 0xA] + ldrh r1, [r4, 0x8] + adds r0, r1 + strh r0, [r4, 0x8] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + b _08172BEA + .pool +_08172BE4: + adds r0, r2, 0 + bl DestroyTask +_08172BEA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8172B90 + + thumb_func_start sub_8172BF0 +sub_8172BF0: @ 8172BF0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0 + mov r8, r0 + ldr r0, =gUnknown_020241E4 + ldr r3, =gUnknown_02038436 + ldrb r2, [r3] + adds r0, r2, r0 + ldrb r6, [r0] + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0x1C + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _08172CC8 + cmp r0, 0x1 + bgt _08172C30 + cmp r0, 0 + beq _08172C36 + b _08172D8A + .pool +_08172C30: + cmp r0, 0x2 + beq _08172CDA + b _08172D8A +_08172C36: + ldr r0, =gUnknown_0203841E + ldrh r0, [r0] + strh r0, [r5, 0x1E] + movs r2, 0xA0 + lsls r2, 3 + adds r0, r2, 0 + ldrh r4, [r5, 0x8] + adds r0, r4 + strh r0, [r5, 0x8] + ldrb r0, [r3] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08172C78 + ldr r2, =gUnknown_02020630 + lsls r3, r6, 4 + adds r1, r3, r6 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r5, 0x8] + lsls r0, 16 + asrs r0, 24 + ldrh r4, [r1, 0x24] + adds r0, r4 + strh r0, [r1, 0x24] + adds r4, r3, 0 + b _08172C90 + .pool +_08172C78: + ldr r3, =gUnknown_02020630 + lsls r4, r6, 4 + adds r2, r4, r6 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r5, 0x8] + lsls r1, 16 + asrs r1, 24 + ldrh r0, [r2, 0x24] + subs r0, r1 + strh r0, [r2, 0x24] + adds r2, r3, 0 +_08172C90: + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r3, r0, r1 + ldrb r0, [r3, 0x8] + strh r0, [r3, 0x8] + adds r0, r4, r6 + lsls r0, 2 + adds r0, r2 + movs r2, 0x20 + ldrsh r1, [r0, r2] + movs r4, 0x24 + ldrsh r0, [r0, r4] + adds r1, r0 + adds r1, 0x20 + movs r0, 0x98 + lsls r0, 1 + cmp r1, r0 + bls _08172D8A + ldrh r0, [r3, 0x1C] + adds r0, 0x1 + strh r0, [r3, 0x1C] + b _08172D8A + .pool +_08172CC8: + ldrb r1, [r5, 0x1E] + adds r0, r2, 0 + adds r2, r6, 0 + bl refresh_graphics_maybe + ldrh r0, [r5, 0x1C] + adds r0, 0x1 + strh r0, [r5, 0x1C] + b _08172D8A +_08172CDA: + movs r1, 0xA0 + lsls r1, 3 + adds r0, r1, 0 + ldrh r2, [r5, 0x8] + adds r0, r2 + strh r0, [r5, 0x8] + ldrb r0, [r3] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08172D10 + ldr r0, =gUnknown_02020630 + lsls r3, r6, 4 + adds r2, r3, r6 + lsls r2, 2 + adds r2, r0 + ldrh r1, [r5, 0x8] + lsls r1, 16 + asrs r1, 24 + ldrh r0, [r2, 0x24] + subs r0, r1 + strh r0, [r2, 0x24] + adds r4, r3, 0 + b _08172D28 + .pool +_08172D10: + ldr r0, =gUnknown_02020630 + lsls r2, r6, 4 + adds r1, r2, r6 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r5, 0x8] + lsls r0, 16 + asrs r0, 24 + ldrh r3, [r1, 0x24] + adds r0, r3 + strh r0, [r1, 0x24] + adds r4, r2, 0 +_08172D28: + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x8] + strh r1, [r0, 0x8] + ldr r0, =gUnknown_02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _08172D68 + ldr r0, =gUnknown_02020630 + adds r1, r4, r6 + lsls r1, 2 + adds r1, r0 + movs r4, 0x24 + ldrsh r0, [r1, r4] + cmp r0, 0 + bgt _08172D7E + movs r0, 0 + strh r0, [r1, 0x24] + b _08172D84 + .pool +_08172D68: + ldr r0, =gUnknown_02020630 + adds r1, r4, r6 + lsls r1, 2 + adds r1, r0 + movs r3, 0x24 + ldrsh r0, [r1, r3] + cmp r0, 0 + blt _08172D7E + strh r2, [r1, 0x24] + movs r4, 0x1 + mov r8, r4 +_08172D7E: + mov r0, r8 + cmp r0, 0 + beq _08172D8A +_08172D84: + adds r0, r7, 0 + bl move_anim_task_del +_08172D8A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8172BF0 + + thumb_func_start sub_8172D98 +sub_8172D98: @ 8172D98 + 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, 0x26 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08172E14 + cmp r0, 0x1 + bgt _08172DC0 + cmp r0, 0 + beq _08172DC6 + b _08172E84 + .pool +_08172DC0: + cmp r0, 0x2 + beq _08172E4E + b _08172E84 +_08172DC6: + ldr r0, =gUnknown_02038436 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08172DE8 + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + b _08172DF0 + .pool +_08172DE8: + ldr r1, =0x00003f44 + movs r0, 0x50 + bl SetGpuReg +_08172DF0: + movs r0, 0x52 + movs r1, 0x10 + bl SetGpuReg + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _08172E84 + .pool +_08172E14: + ldrh r0, [r4, 0xA] + adds r1, r0, 0x1 + strh r1, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08172E84 + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r2, [r4, 0x8] + adds r2, 0x1 + strh r2, [r4, 0x8] + lsls r1, r2, 8 + movs r0, 0x10 + subs r0, r2 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _08172E84 + ldrh r0, [r4, 0x26] + adds r0, 0x1 + strh r0, [r4, 0x26] + b _08172E84 +_08172E4E: + ldr r1, =gUnknown_020241E4 + ldr r4, =gUnknown_02038436 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + ldr r2, =gUnknown_02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x4] + lsls r1, 22 + lsrs r1, 17 + ldr r0, =0x06010000 + adds r1, r0 + movs r2, 0x80 + lsls r2, 4 + movs r0, 0 + movs r3, 0x1 + bl RequestDma3Fill + ldrb r0, [r4] + bl sub_805E974 + adds r0, r5, 0 + bl move_anim_task_del +_08172E84: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8172D98 + + thumb_func_start sub_8172E9C +sub_8172E9C: @ 8172E9C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, =gUnknown_0203841E + ldr r1, =gUnknown_020244D0 + ldr r2, [r1] + ldr r1, =gUnknown_02038436 + ldrb r1, [r1] + ldr r2, [r2] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + lsls r1, 29 + lsrs r1, 31 + strh r1, [r3, 0xE] + bl move_anim_task_del + pop {r0} + bx r0 + .pool + thumb_func_end sub_8172E9C + + thumb_func_start sub_8172ED0 +sub_8172ED0: @ 8172ED0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_02038437 + ldr r1, =gUnknown_0202420E + ldrb r1, [r1] + strb r1, [r2] + bl move_anim_task_del + pop {r0} + bx r0 + .pool + thumb_func_end sub_8172ED0 + + thumb_func_start sub_8172EF0 +sub_8172EF0: @ 8172EF0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r1, 0 + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0 + mov r8, r0 + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] + adds r0, r4, 0 + movs r1, 0x1 + bl GetMonData + adds r5, r0, 0 + adds r0, r4, 0 + movs r1, 0 + bl GetMonData + adds r4, r0, 0 + adds r0, r6, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _08172FC8 + lsrs r0, r5, 16 + ldr r7, =0x0000ffff + ands r5, r7 + eors r0, r5 + lsrs r1, r4, 16 + eors r0, r1 + ands r4, r7 + eors r0, r4 + cmp r0, 0x7 + bhi _08172F4E + movs r0, 0x1 + mov r8, r0 +_08172F4E: + mov r0, r8 + cmp r0, 0 + beq _08172FC8 + ldr r0, =0x000027f9 + bl GetObjectTileRangeStartByTag + lsls r0, 16 + lsrs r0, 16 + cmp r0, r7 + bne _08172F6E + ldr r0, =gUnknown_0852528C + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_08525B94 + bl LoadCompressedObjectPaletteUsingHeap +_08172F6E: + ldr r5, =sub_8172FEC + adds r0, r5, 0 + movs r1, 0xA + bl CreateTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0xA + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r3, =gTasks + lsls r2, r4, 2 + adds r2, r4 + lsls r2, 3 + adds r2, r3 + movs r4, 0 + strh r6, [r2, 0x8] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r3 + strh r6, [r1, 0x8] + strh r4, [r2, 0xA] + movs r0, 0x1 + strh r0, [r1, 0xA] + b _08172FDE + .pool +_08172FC8: + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x1] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0, 0x1] +_08172FDE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8172EF0 + + thumb_func_start sub_8172FEC +sub_8172FEC: @ 8172FEC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r4, r0, r1 + ldrh r1, [r4, 0x22] + movs r2, 0x22 + ldrsh r0, [r4, r2] + cmp r0, 0x3B + bgt _08173018 + adds r0, r1, 0x1 + strh r0, [r4, 0x22] + b _08173190 + .pool +_08173018: + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0xA] + cmp r0, 0 + beq _08173026 + b _08173190 +_08173026: + ldrh r0, [r4, 0x1C] + adds r1, r0, 0x1 + strh r1, [r4, 0x1C] + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + cmp r1, 0 + beq _0817303A + b _08173190 +_0817303A: + ldrb r0, [r4, 0x8] + mov r8, r0 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, r8 + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08173074 + ldr r0, =gUnknown_085CE388 + adds r1, r5, 0 + movs r3, 0x5 + bl AddObjectToFront + lsls r0, 24 + lsrs r5, r0, 24 + b _081730D6 + .pool +_08173074: + cmp r0, 0 + blt _081730A8 + cmp r0, 0x3 + bgt _081730A8 + ldr r0, =gUnknown_085CE3A0 + adds r1, r5, 0 + movs r3, 0x5 + bl AddObjectToFront + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gUnknown_02020630 + lsls r2, r5, 4 + adds r2, r5 + lsls r2, 2 + adds r2, r0 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x4 + b _081730C8 + .pool +_081730A8: + ldr r0, =gUnknown_085CE3A0 + adds r1, r5, 0 + movs r3, 0x5 + bl AddObjectToFront + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gUnknown_02020630 + lsls r2, r5, 4 + adds r2, r5 + lsls r2, 2 + adds r2, r0 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x5 +_081730C8: + ldr r4, =0x000003ff + adds r0, r4, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] +_081730D6: + ldr r2, =gTasks + lsls r1, r7, 2 + adds r0, r1, r7 + lsls r0, 3 + adds r6, r0, r2 + movs r2, 0xA + ldrsh r0, [r6, r2] + mov r9, r1 + cmp r0, 0 + bne _08173118 + ldr r1, =gUnknown_02020630 + lsls r2, r5, 4 + adds r0, r2, r5 + lsls r0, 2 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_81731FC + str r1, [r0] + adds r4, r2, 0 + b _08173160 + .pool +_08173118: + ldr r3, =gUnknown_02020630 + lsls r4, r5, 4 + adds r1, r4, r5 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x1C + adds r0, r1, r0 + ldr r2, =sub_8173250 + str r2, [r0] + adds r1, r3 + ldr r0, =0x0000ffe0 + strh r0, [r1, 0x24] + movs r0, 0x20 + strh r0, [r1, 0x26] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + movs r1, 0x1E + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _08173160 + mov r0, r8 + bl battle_side_get_owner + lsls r0, 24 + movs r1, 0x3F + cmp r0, 0 + bne _08173156 + movs r1, 0xC0 +_08173156: + lsls r1, 24 + asrs r1, 24 + movs r0, 0x66 + bl audio_play_and_stuff +_08173160: + ldr r1, =gUnknown_02020630 + adds r0, r4, r5 + lsls r0, 2 + adds r0, r1 + strh r7, [r0, 0x2E] + ldr r1, =gTasks + mov r2, r9 + adds r0, r2, r7 + lsls r0, 3 + adds r1, r0, r1 + ldrh r0, [r1, 0x1E] + adds r0, 0x1 + strh r0, [r1, 0x1E] + cmp r5, 0x40 + beq _08173184 + ldrh r0, [r1, 0x20] + adds r0, 0x1 + strh r0, [r1, 0x20] +_08173184: + movs r4, 0x1E + ldrsh r0, [r1, r4] + cmp r0, 0x5 + bne _08173190 + ldr r0, =sub_81731B0 + str r0, [r1] +_08173190: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8172FEC + + thumb_func_start sub_81731B0 +sub_81731B0: @ 81731B0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r3, r0, 0 + ldr r1, =gTasks + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r1, r0, r1 + movs r2, 0x20 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _081731F0 + movs r2, 0xA + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _081731EA + ldrb r1, [r1, 0x8] + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0, 0x1] +_081731EA: + adds r0, r3, 0 + bl DestroyTask +_081731F0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81731B0 + + thumb_func_start sub_81731FC +sub_81731FC: @ 81731FC + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x18 + bl Sin + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x18 + bl Cos + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0xC + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _08173246 + ldr r2, =gTasks + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0x20] + subs r1, 0x1 + strh r1, [r0, 0x20] + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_08173246: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81731FC + + thumb_func_start sub_8173250 +sub_8173250: @ 8173250 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0x3 + bgt _08173264 + adds r0, r1, 0x1 + strh r0, [r4, 0x30] + b _081732A6 +_08173264: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldrh r1, [r4, 0x24] + adds r1, 0x5 + strh r1, [r4, 0x24] + ldrh r0, [r4, 0x26] + subs r0, 0x5 + strh r0, [r4, 0x26] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x20 + ble _081732A6 + ldr r2, =gTasks + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0x20] + subs r1, 0x1 + strh r1, [r0, 0x20] + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_081732A6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8173250 + + thumb_func_start sub_81732B0 +sub_81732B0: @ 81732B0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_085253AC + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_08525CB4 + bl LoadCompressedObjectPaletteUsingHeap + ldr r0, =0x0000281d + bl IndexOfObjectPaletteTag + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81732B0 + + thumb_func_start sub_81732E4 +sub_81732E4: @ 81732E4 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =0x0000281d + adds r0, r5, 0 + bl FreeObjectTilesByTag + adds r0, r5, 0 + bl FreeObjectPaletteByTag + adds r0, r4, 0 + bl move_anim_task_del + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81732E4 + + thumb_func_start sub_817330C +sub_817330C: @ 817330C + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0 + bl sub_80A69CC + movs r0, 0x1E + strh r0, [r4, 0x2E] + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + ldr r5, =gUnknown_0203841E + lsrs r0, 24 + ldrh r1, [r5, 0x4] + adds r0, r1 + strh r0, [r4, 0x32] + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r5, [r5, 0x6] + adds r0, r5 + strh r0, [r4, 0x36] + ldr r0, =0x0000ffe0 + strh r0, [r4, 0x38] + adds r0, r4, 0 + bl sub_80A68D4 + ldr r2, =gUnknown_02020630 + ldr r1, =gUnknown_020241E4 + ldr r0, =gUnknown_02038436 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_8039E84 + str r1, [r0] + ldr r0, =sub_817339C + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817330C + + thumb_func_start sub_817339C +sub_817339C: @ 817339C + push {lr} + adds r3, r0, 0 + ldr r2, =gUnknown_02020630 + ldr r1, =gUnknown_020241E4 + ldr r0, =gUnknown_02038436 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0x1 + bne _081733C0 + ldr r0, =sub_81733D4 + str r0, [r3, 0x1C] +_081733C0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_817339C + + thumb_func_start sub_81733D4 +sub_81733D4: @ 81733D4 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _081733F6 + movs r0, 0 + strh r0, [r4, 0x2E] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_8173400 + str r0, [r4, 0x1C] +_081733F6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81733D4 + + thumb_func_start sub_8173400 +sub_8173400: @ 8173400 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =gUnknown_02020630 + ldr r3, =gUnknown_020241E4 + ldr r2, =gUnknown_02038436 + ldrb r0, [r2] + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 27 + cmp r0, 0 + bge _08173448 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + ble _08173448 + ldrb r0, [r2] + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0 + bl StartObjectImageAnim + adds r0, r4, 0 + bl move_anim_8072740 +_08173448: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8173400 + + thumb_func_start sub_817345C +sub_817345C: @ 817345C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_0203841E + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08173478 + cmp r0, 0x1 + beq _0817348C + b _081734A0 + .pool +_08173478: + movs r0, 0 + bl battle_get_side_with_given_state + ldr r1, =gUnknown_02038436 + strb r0, [r1] + movs r0, 0x1 + b _08173498 + .pool +_0817348C: + movs r0, 0x1 + bl battle_get_side_with_given_state + ldr r1, =gUnknown_02038436 + strb r0, [r1] + movs r0, 0 +_08173498: + bl battle_get_side_with_given_state + ldr r1, =gUnknown_02038437 + strb r0, [r1] +_081734A0: + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817345C + + thumb_func_start sub_81734B4 +sub_81734B4: @ 81734B4 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrh r1, [r0] + cmp r1, 0x53 + bne _081734D4 + ldr r1, =gUnknown_0203841E + movs r0, 0x1 + b _0817350C + .pool +_081734D4: + cmp r1, 0xFA + bne _081734E4 + ldr r1, =gUnknown_0203841E + movs r0, 0x2 + b _0817350C + .pool +_081734E4: + cmp r1, 0x80 + bne _081734F4 + ldr r1, =gUnknown_0203841E + movs r0, 0x3 + b _0817350C + .pool +_081734F4: + movs r0, 0xA4 + lsls r0, 1 + cmp r1, r0 + bne _08173508 + ldr r1, =gUnknown_0203841E + movs r0, 0x4 + b _0817350C + .pool +_08173508: + ldr r1, =gUnknown_0203841E + movs r0, 0 +_0817350C: + strh r0, [r1] + adds r0, r2, 0 + bl move_anim_task_del + pop {r0} + bx r0 + .pool + thumb_func_end sub_81734B4 + + thumb_func_start sub_817351C +sub_817351C: @ 817351C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, =gUnknown_02038436 + ldr r1, =gUnknown_020244D0 + ldr r2, [r1] + ldr r1, [r2, 0x8] + ldrh r1, [r1] + strb r1, [r3] + ldr r3, =gUnknown_02038437 + ldr r1, [r2, 0x8] + ldrh r1, [r1] + lsrs r1, 8 + strb r1, [r3] + bl move_anim_task_del + pop {r0} + bx r0 + .pool + thumb_func_end sub_817351C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/battle_message.s b/asm/battle_message.s index 78fea08e5..cf7ff1d90 100644 --- a/asm/battle_message.s +++ b/asm/battle_message.s @@ -114,7 +114,7 @@ _0814E1B4: .4byte _0814E4F8 .4byte _0814E55C _0814E1CC: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r2, [r0] movs r0, 0x8 ands r0, r2 @@ -219,7 +219,7 @@ _0814E2AC: lsls r0, 24 cmp r0, 0 bne _0814E310 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x1 ands r0, r1 @@ -258,7 +258,7 @@ _0814E308: b _0814E6D8 .pool _0814E310: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x1 ands r0, r1 @@ -333,7 +333,7 @@ _0814E394: _0814E3BC: cmp r2, 0x1 beq _0814E3CC - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -357,7 +357,7 @@ _0814E3EC: ldrh r1, [r0] movs r0, 0x80 lsls r0, 4 - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags cmp r1, r0 beq _0814E406 ldr r0, [r2] @@ -395,7 +395,7 @@ _0814E430: ldrb r2, [r0] cmp r2, 0 beq _0814E456 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -421,7 +421,7 @@ _0814E47C: b _0814E6D8 .pool _0814E488: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x02000002 ands r0, r1 @@ -491,7 +491,7 @@ _0814E4F8: adds r1, r2 ldr r2, =gUnknown_085CCBBC adds r1, r2 - bl CopyString + bl StringCopy b _0814E544 .pool _0814E534: @@ -501,7 +501,7 @@ _0814E534: muls r1, r2 ldr r2, =gMoveNames adds r1, r2 - bl CopyString + bl StringCopy _0814E544: ldr r0, =gUnknown_02022F68 bl sub_814F950 @@ -543,7 +543,7 @@ _0814E58A: b _0814E6D8 .pool _0814E5A4: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -570,7 +570,7 @@ _0814E5C4: eors r0, r1 strb r0, [r4] _0814E5E0: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x40 ands r0, r1 @@ -774,7 +774,7 @@ get_battle_strings: @ 814E764 mov r8, r1 movs r6, 0 movs r4, 0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 18 @@ -872,7 +872,7 @@ _0814E8A0: ldrb r0, [r5] cmp r0, 0xFD bne _0814E8B8 - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 adds r0, r5, 0 b _0814E8F0 .pool @@ -891,7 +891,7 @@ _0814E8CE: ldrb r0, [r1] cmp r0, 0xFD bne _0814E904 - ldr r4, =gUnknown_02021DC4 + ldr r4, =gStringVar2 b _0814E8EE .pool _0814E8E4: @@ -899,7 +899,7 @@ _0814E8E4: ldrb r0, [r1] cmp r0, 0xFD bne _0814E904 - ldr r4, =gUnknown_02021EC4 + ldr r4, =gStringVar3 _0814E8EE: adds r0, r1, 0 _0814E8F0: @@ -911,15 +911,15 @@ _0814E904: adds r4, r1, 0 bl _0814F5C0 _0814E90A: - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 bl _0814F5C0 .pool _0814E914: - ldr r4, =gUnknown_02021DC4 + ldr r4, =gStringVar2 bl _0814F5C0 .pool _0814E920: - ldr r4, =gUnknown_02021EC4 + ldr r4, =gStringVar3 bl _0814F5C0 .pool _0814E92C: @@ -932,13 +932,13 @@ _0814E92C: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData mov r0, sp - bl GetStringEnd_Limit7 + bl StringGetEnd10 bl _0814F5BE .pool _0814E960: @@ -951,13 +951,13 @@ _0814E960: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData mov r0, sp - bl GetStringEnd_Limit7 + bl StringGetEnd10 bl _0814F5BE .pool _0814E994: @@ -970,13 +970,13 @@ _0814E994: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData mov r0, sp - bl GetStringEnd_Limit7 + bl StringGetEnd10 bl _0814F5BE .pool _0814E9C8: @@ -989,13 +989,13 @@ _0814E9C8: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData mov r0, sp - bl GetStringEnd_Limit7 + bl StringGetEnd10 bl _0814F5BE .pool _0814E9FC: @@ -1011,13 +1011,13 @@ _0814E9FC: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData mov r0, sp - bl GetStringEnd_Limit7 + bl StringGetEnd10 bl _0814F5BE .pool _0814EA38: @@ -1035,13 +1035,13 @@ _0814EA38: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData mov r0, sp - bl GetStringEnd_Limit7 + bl StringGetEnd10 bl _0814F5BE .pool _0814EA78: @@ -1059,13 +1059,13 @@ _0814EA78: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData mov r0, sp - bl GetStringEnd_Limit7 + bl StringGetEnd10 bl _0814F5BE .pool _0814EAB8: @@ -1083,13 +1083,13 @@ _0814EAB8: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData mov r0, sp - bl GetStringEnd_Limit7 + bl StringGetEnd10 bl _0814F5BE .pool _0814EAF8: @@ -1100,7 +1100,7 @@ _0814EAF8: adds r2, r4, 0 cmp r0, 0 beq _0814EB74 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x8 ands r1, r0 @@ -1134,11 +1134,11 @@ _0814EB36: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData b _0814EB9E .pool _0814EB74: @@ -1155,14 +1155,14 @@ _0814EB74: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData _0814EB9E: mov r0, sp - bl GetStringEnd_Limit7 + bl StringGetEnd10 bl _0814F5BE .pool _0814EBB0: @@ -1186,11 +1186,11 @@ _0814EBB0: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData b _0814EC24 .pool _0814EBF8: @@ -1208,14 +1208,14 @@ _0814EBF8: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData _0814EC24: mov r0, sp - bl GetStringEnd_Limit7 + bl StringGetEnd10 bl _0814F5BE .pool _0814EC38: @@ -1225,7 +1225,7 @@ _0814EC38: lsls r0, 24 cmp r0, 0 beq _0814ECA8 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x8 ands r1, r0 @@ -1237,7 +1237,7 @@ _0814EC56: ldrb r1, [r4] adds r0, r1, 0 ldr r3, =gUnknown_0202406E - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty mov r12, r2 adds r2, r5, 0 cmp r0, 0xFF @@ -1262,7 +1262,7 @@ _0814EC78: add r0, r12 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData b _0814ECC2 .pool _0814ECA8: @@ -1273,24 +1273,24 @@ _0814ECA8: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData _0814ECC2: mov r0, sp - bl GetStringEnd_Limit7 + bl StringGetEnd10 bl _0814F5BE .pool _0814ECD4: - ldr r5, =gUnknown_0202420C + ldr r5, =gEnemyMonIndex ldrb r0, [r5] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq _0814ED44 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x8 ands r1, r0 @@ -1302,7 +1302,7 @@ _0814ECF2: ldrb r1, [r4] adds r0, r1, 0 ldr r3, =gUnknown_0202406E - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty mov r12, r2 adds r2, r5, 0 cmp r0, 0xFF @@ -1327,7 +1327,7 @@ _0814ED14: add r0, r12 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData b _0814ED5E .pool _0814ED44: @@ -1338,14 +1338,14 @@ _0814ED44: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData _0814ED5E: mov r0, sp - bl GetStringEnd_Limit7 + bl StringGetEnd10 bl _0814F5BE .pool _0814ED70: @@ -1355,7 +1355,7 @@ _0814ED70: lsls r0, 24 cmp r0, 0 beq _0814EDE0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x8 ands r1, r0 @@ -1367,7 +1367,7 @@ _0814ED8E: ldrb r1, [r4] adds r0, r1, 0 ldr r3, =gUnknown_0202406E - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty mov r12, r2 adds r2, r5, 0 cmp r0, 0xFF @@ -1392,7 +1392,7 @@ _0814EDB0: add r0, r12 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData b _0814EDFA .pool _0814EDE0: @@ -1403,14 +1403,14 @@ _0814EDE0: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData _0814EDFA: mov r0, sp - bl GetStringEnd_Limit7 + bl StringGetEnd10 bl _0814F5BE .pool _0814EE0C: @@ -1420,7 +1420,7 @@ _0814EE0C: lsls r0, 24 cmp r0, 0 beq _0814EE7C - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x8 ands r1, r0 @@ -1432,7 +1432,7 @@ _0814EE2A: ldrb r1, [r4] adds r0, r1, 0 ldr r3, =gUnknown_0202406E - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty mov r12, r2 adds r2, r5, 0 cmp r0, 0xFF @@ -1457,7 +1457,7 @@ _0814EE4C: add r0, r12 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData b _0814EE96 .pool _0814EE7C: @@ -1468,14 +1468,14 @@ _0814EE7C: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData _0814EE96: mov r0, sp - bl GetStringEnd_Limit7 + bl StringGetEnd10 b _0814F5BE .pool _0814EEA8: @@ -1485,7 +1485,7 @@ _0814EEA8: lsls r0, 24 cmp r0, 0 beq _0814EF18 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x8 ands r1, r0 @@ -1497,7 +1497,7 @@ _0814EEC6: ldrb r1, [r4] adds r0, r1, 0 ldr r3, =gUnknown_0202406E - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty mov r12, r2 adds r2, r5, 0 cmp r0, 0xFF @@ -1522,7 +1522,7 @@ _0814EEE8: add r0, r12 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData b _0814EF32 .pool _0814EF18: @@ -1533,14 +1533,14 @@ _0814EF18: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData _0814EF32: mov r0, sp - bl GetStringEnd_Limit7 + bl StringGetEnd10 b _0814F5BE .pool _0814EF44: @@ -1583,7 +1583,7 @@ _0814EF8A: b _0814F5C0 .pool _0814EF98: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x02000002 ands r0, r1 @@ -1625,10 +1625,10 @@ _0814EFEC: ldr r0, =gUnknown_02024404 adds r1, r0 mov r0, sp - bl CopyString + bl StringCopy ldr r1, =gUnknown_085CC0AD mov r0, sp - bl AppendString + bl StringAppend b _0814F5BE .pool _0814F014: @@ -1651,10 +1651,10 @@ _0814F014: ldr r0, =gUnknown_02024404 adds r1, r0 mov r0, sp - bl CopyString + bl StringCopy ldr r1, =gUnknown_085CC0AD mov r0, sp - bl AppendString + bl StringAppend b _0814F5BE .pool _0814F05C: @@ -1684,7 +1684,7 @@ _0814F088: .pool _0814F098: ldr r1, =gUnknown_0203ABA4 - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex b _0814F0BC .pool _0814F0A8: @@ -1709,7 +1709,7 @@ _0814F0C0: b _0814F5C0 .pool _0814F0D8: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 20 @@ -1775,7 +1775,7 @@ _0814F14E: b _0814F5A2 .pool _0814F164: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 20 @@ -1804,7 +1804,7 @@ _0814F178: ldr r0, [r0] ldrb r1, [r0, 0xD] mov r0, sp - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString b _0814F5BE .pool _0814F1AC: @@ -1922,7 +1922,7 @@ _0814F284: b _0814F5C0 .pool _0814F298: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -1933,12 +1933,12 @@ _0814F298: b _0814F5C0 .pool _0814F2B4: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r4, [r0] b _0814F5C0 .pool _0814F2C0: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x003f0100 ands r0, r1 @@ -1965,7 +1965,7 @@ _0814F2F8: adds r4, r0, 0 b _0814F5C0 _0814F300: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x003f0100 ands r0, r1 @@ -1992,7 +1992,7 @@ _0814F330: lsls r0, 24 cmp r0, 0 beq _0814F39C - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x8 ands r1, r0 @@ -2003,7 +2003,7 @@ _0814F330: _0814F34E: ldrb r1, [r4] adds r0, r1, 0 - ldr r5, =gUnknown_02024744 + ldr r5, =gEnemyParty mov r12, r5 ldr r2, =gUnknown_0202449C cmp r0, 0xFF @@ -2027,7 +2027,7 @@ _0814F36E: add r0, r12 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData b _0814F3B4 .pool _0814F39C: @@ -2037,14 +2037,14 @@ _0814F39C: ldrb r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData _0814F3B4: mov r0, sp - bl GetStringEnd_Limit7 + bl StringGetEnd10 b _0814F5BE .pool _0814F3C4: @@ -2064,7 +2064,7 @@ _0814F3E4: b _0814F3EE .pool _0814F3EC: - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex _0814F3EE: ldrb r0, [r0] bl battle_side_get_owner @@ -2082,7 +2082,7 @@ _0814F410: b _0814F41A .pool _0814F418: - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex _0814F41A: ldrb r0, [r0] bl battle_side_get_owner @@ -2100,7 +2100,7 @@ _0814F43C: b _0814F446 .pool _0814F444: - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex _0814F446: ldrb r0, [r0] bl battle_side_get_owner @@ -2114,7 +2114,7 @@ _0814F456: b _0814F5C0 .pool _0814F468: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x003f0100 ands r0, r1 @@ -2147,7 +2147,7 @@ _0814F49C: b _0814F5A2 .pool _0814F4B8: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x003f0100 ands r0, r1 @@ -2179,7 +2179,7 @@ _0814F4F0: b _0814F5C0 .pool _0814F508: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x003f0100 ands r0, r1 @@ -2206,7 +2206,7 @@ _0814F540: adds r4, r0, 0 b _0814F5C0 _0814F548: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x003f0100 ands r0, r1 @@ -2218,7 +2218,7 @@ _0814F556: movs r0, 0x1 _0814F55A: bl sub_81A36D0 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 b _0814F5C0 .pool _0814F574: @@ -2233,7 +2233,7 @@ _0814F580: movs r0, 0x3 _0814F584: bl sub_81D572C - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 b _0814F5C0 .pool _0814F594: @@ -2437,7 +2437,7 @@ _0814F706: adds r0, r6, 0 mov r1, r8 movs r2, 0 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r0, r5, 0x3 ldrb r4, [r4, 0x1] adds r5, r0, r4 @@ -2471,15 +2471,15 @@ _0814F744: ldrb r1, [r4, 0x2] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData b _0814F7A4 .pool _0814F768: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x8 ands r0, r1 @@ -2487,29 +2487,29 @@ _0814F768: beq _0814F788 ldr r1, =gUnknown_085CBD8B adds r0, r6, 0 - bl AppendString + bl StringAppend b _0814F790 .pool _0814F788: ldr r1, =gUnknown_085CBD85 adds r0, r6, 0 - bl AppendString + bl StringAppend _0814F790: adds r0, r5, r7 ldrb r1, [r0, 0x2] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData _0814F7A4: mov r0, sp - bl GetStringEnd_Limit7 + bl StringGetEnd10 adds r0, r6, 0 mov r1, sp - bl AppendString + bl StringAppend b _0814F8DE .pool _0814F7BC: @@ -2540,25 +2540,25 @@ _0814F7E2: ldrb r1, [r4, 0x2] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2 adds r2, r6, 0 - bl pokemon_getattr + bl GetMonData b _0814F81A .pool _0814F808: ldrb r1, [r4, 0x2] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x2 adds r2, r6, 0 - bl pokemon_getattr + bl GetMonData _0814F81A: adds r0, r6, 0 - bl GetStringEnd_Limit7 + bl StringGetEnd10 b _0814F8DE .pool _0814F828: @@ -2580,7 +2580,7 @@ _0814F846: adds r1, r0 _0814F848: adds r0, r6, 0 - bl AppendString + bl StringAppend adds r5, 0x2 b _0814F8E0 .pool @@ -2590,7 +2590,7 @@ _0814F858: ldrb r0, [r0, 0x2] lsls r0, 8 orrs r2, r0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 @@ -2617,7 +2617,7 @@ _0814F858: ldr r0, =gUnknown_02024404 adds r1, r0 adds r0, r6, 0 - bl CopyString + bl StringCopy ldr r1, =gUnknown_085CC0AD b _0814F8BE .pool @@ -2625,7 +2625,7 @@ _0814F8BC: ldr r1, =gUnknown_085CC0A0 _0814F8BE: adds r0, r6, 0 - bl AppendString + bl StringAppend b _0814F8DE .pool _0814F8CC: @@ -2681,7 +2681,7 @@ _0814F918: bgt _0814F938 ldr r1, =gUnknown_085CCBB5 adds r0, r4, 0 - bl CopyString + bl StringCopy b _0814F944 .pool _0814F938: @@ -2689,7 +2689,7 @@ _0814F938: bgt _0814F944 ldr r1, =gUnknown_085CCBB9 adds r0, r4, 0 - bl CopyString + bl StringCopy _0814F944: pop {r4,r5} pop {r0} @@ -2759,13 +2759,13 @@ _0814F9C8: ldr r1, =gUnknown_085CBDBD _0814F9CA: adds r0, r3, 0 - bl CopyString + bl StringCopy b _0814F9E0 .pool _0814F9D8: ldr r1, =gUnknown_085CBDBF adds r0, r3, 0 - bl CopyString + bl StringCopy _0814F9E0: pop {r4,r5} pop {r0} @@ -2898,7 +2898,7 @@ _0814FAE0: _0814FAE8: strb r1, [r0] adds r3, r0, 0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r2, =0x01000002 ands r1, r2 diff --git a/asm/battle_records.s b/asm/battle_records.s index 5e71f4f48..5c4ea6688 100644 --- a/asm/battle_records.s +++ b/asm/battle_records.s @@ -80,7 +80,7 @@ _0813C014: adds r0, r4, 0 adds r1, r7, 0 movs r2, 0x7 - bl CompareString_LimitN + bl StringCompareN cmp r0, 0 bne _0813C02C ldrh r0, [r4, 0x8] @@ -307,7 +307,7 @@ sub_813C170: @ 813C170 adds r0, r4, 0 mov r1, r8 movs r2, 0x7 - bl CopyString_LimitN + bl StringCopyN strh r7, [r4, 0x8] adds r2, r6, 0 adds r2, 0x54 @@ -339,7 +339,7 @@ _0813C1D4: thumb_func_start sub_813C1F8 sub_813C1F8: @ 813C1F8 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003150 adds r0, r1 @@ -433,7 +433,7 @@ sub_813C2A0: @ 813C2A0 beq _0813C2DA adds r0, r4, 0 bl sub_813C264 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003150 adds r0, r1 @@ -463,34 +463,34 @@ _0813C2DA: sub_813C2F4: @ 813C2F4 push {r4,lr} sub sp, 0xC - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 movs r0, 0x17 bl sub_80847F8 adds r1, r0, 0 adds r0, r4, 0 movs r2, 0 movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021DC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar2 movs r0, 0x18 bl sub_80847F8 adds r1, r0, 0 adds r0, r4, 0 movs r2, 0 movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021EC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar3 movs r0, 0x19 bl sub_80847F8 adds r1, r0, 0 adds r0, r4, 0 movs r2, 0 movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EF6A1 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 adds r1, r4, 0 movs r2, 0xD0 @@ -576,17 +576,17 @@ sub_813C384: @ 813C384 b _0813C4A8 .pool _0813C40C: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r1, 0x8 - bl RepeatStringTerminator - ldr r0, =gUnknown_02021CC4 + bl StringFillWithTerminator + ldr r0, =gStringVar1 adds r1, r6, 0 movs r2, 0x7 - bl CopyString_LimitN + bl StringCopyN lsls r1, r5, 24 lsrs r1, 24 - ldr r0, =gUnknown_02021CC4 - bl StopMusicWhileStringIsPrinted + ldr r0, =gStringVar1 + bl ConvertInternationalString ldr r0, =gUnknown_0203AB74 mov r8, r0 ldrb r0, [r0] @@ -599,49 +599,49 @@ _0813C40C: str r5, [sp, 0x4] str r5, [sp, 0x8] movs r1, 0x1 - ldr r2, =gUnknown_02021CC4 + ldr r2, =gStringVar1 movs r3, 0x8 bl Print ldrh r1, [r6, 0xA] - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r2, 0x1 movs r3, 0x4 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN mov r1, r8 ldrb r0, [r1] str r4, [sp] str r5, [sp, 0x4] str r5, [sp, 0x8] movs r1, 0x1 - ldr r2, =gUnknown_02021CC4 + ldr r2, =gStringVar1 movs r3, 0x50 bl Print ldrh r1, [r6, 0xC] - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r2, 0x1 movs r3, 0x4 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN mov r1, r8 ldrb r0, [r1] str r4, [sp] str r5, [sp, 0x4] str r5, [sp, 0x8] movs r1, 0x1 - ldr r2, =gUnknown_02021CC4 + ldr r2, =gStringVar1 movs r3, 0x80 bl Print ldrh r1, [r6, 0xE] - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r2, 0x1 movs r3, 0x4 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN mov r1, r8 ldrb r0, [r1] str r4, [sp] str r5, [sp, 0x4] str r5, [sp, 0x8] movs r1, 0x1 - ldr r2, =gUnknown_02021CC4 + ldr r2, =gStringVar1 movs r3, 0xB0 bl Print _0813C4A8: @@ -671,10 +671,10 @@ sub_813C4BC: @ 813C4BC ldrb r0, [r6] movs r1, 0x11 bl FillWindowPixelBuffer - ldr r5, =gUnknown_02021FC4 + ldr r5, =gStringVar4 ldr r1, =gUnknown_085EF68D adds r0, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 adds r1, r5, 0 movs r2, 0xD0 @@ -690,7 +690,7 @@ sub_813C4BC: @ 813C4BC str r4, [sp, 0x8] adds r2, r5, 0 bl Print - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr mov r8, r0 ldr r0, [r0] ldr r1, =0x00003150 @@ -699,7 +699,7 @@ sub_813C4BC: @ 813C4BC bl sub_813C2F4 ldr r1, =gUnknown_085EF6BD adds r0, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldrb r0, [r6] movs r1, 0x29 str r1, [sp] diff --git a/asm/battle_setup.s b/asm/battle_setup.s index e14954e63..ae559ca27 100644 --- a/asm/battle_setup.s +++ b/asm/battle_setup.s @@ -111,10 +111,10 @@ sub_80B06BC: @ 80B06BC bl script_env_2_enable bl player_bitmagic bl sub_808BCF4 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =sub_80B0AF8 str r0, [r1, 0x8] - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags movs r0, 0 str r0, [r4] bl InBattlePyramid @@ -153,10 +153,10 @@ sub_80B072C: @ 80B072C bl script_env_2_enable bl player_bitmagic bl sub_808BCF4 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =sub_80B0AF8 str r0, [r1, 0x8] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0x80 lsls r0, 3 str r0, [r1] @@ -182,10 +182,10 @@ sub_80B077C: @ 80B077C bl script_env_2_enable bl player_bitmagic bl sub_808BCF4 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =sub_80FC190 str r0, [r1, 0x8] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0x80 str r0, [r1] bl sub_80B0EC8 @@ -204,10 +204,10 @@ sub_80B07B4: @ 80B07B4 bl script_env_2_enable bl player_bitmagic bl sub_808BCF4 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =sub_80B0AF8 str r0, [r1, 0x8] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0x80 lsls r0, 13 str r0, [r1] @@ -278,16 +278,16 @@ _080B0856: thumb_func_start sub_80B086C sub_80B086C: @ 80B086C push {lr} - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty movs r1, 0xC4 lsls r1, 1 movs r2, 0x5 bl sub_8067FF8 bl script_env_2_enable - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music str r0, [r1, 0x8] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0x80 lsls r0, 2 str r0, [r1] @@ -303,10 +303,10 @@ sub_80B086C: @ 80B086C sub_80B08A8: @ 80B08A8 push {lr} bl script_env_2_enable - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =sub_80B0B6C str r0, [r1, 0x8] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0 str r0, [r1] bl sub_80B0EC8 @@ -329,10 +329,10 @@ sub_80B08A8: @ 80B08A8 sub_80B08EC: @ 80B08EC push {lr} bl script_env_2_enable - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =sub_80B0B6C str r0, [r1, 0x8] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0x80 lsls r0, 6 str r0, [r1] @@ -356,17 +356,17 @@ sub_80B08EC: @ 80B08EC sub_80B0934: @ 80B0934 push {r4,lr} bl script_env_2_enable - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =sub_80B0B6C str r0, [r1, 0x8] - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags movs r0, 0x80 lsls r0, 6 str r0, [r4] - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 movs r0, 0xCA lsls r0, 1 @@ -396,7 +396,7 @@ _080B0988: cmp r1, r0 beq _080B09E4 _080B099A: - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r0, [r2] movs r1, 0x80 lsls r1, 21 @@ -458,14 +458,14 @@ _080B09FE: sub_80B0A18: @ 80B0A18 push {lr} bl script_env_2_enable - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =sub_80B0B6C str r0, [r1, 0x8] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0xC0 lsls r0, 6 str r0, [r1] - ldr r0, =gUnknown_82E9530 + ldr r0, =gGameVersion ldrb r0, [r0] cmp r0, 0x2 bne _080B0A50 @@ -495,16 +495,16 @@ _080B0A5A: sub_80B0A74: @ 80B0A74 push {lr} bl script_env_2_enable - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =sub_80B0B6C str r0, [r1, 0x8] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0xC0 lsls r0, 7 str r0, [r1] - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r1, r0, 16 adds r2, r1, 0 @@ -775,7 +775,7 @@ _080B0CF2: movs r0, 0x4 b _080B0D1A _080B0CF6: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0, 0x4] movs r0, 0xE0 @@ -862,11 +862,11 @@ _080B0D92: movs r0, 0x64 adds r1, r6, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 movs r0, 0xCE lsls r0, 1 @@ -876,12 +876,12 @@ _080B0D92: beq _080B0DD6 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _080B0DD6 adds r0, r4, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData adds r0, r7, r0 lsls r0, 24 lsrs r7, r0, 24 @@ -1034,9 +1034,9 @@ sub_80B0EC8: @ 80B0EC8 lsls r0, 24 lsrs r5, r0, 24 adds r6, r5, 0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty movs r1, 0x38 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -1195,9 +1195,9 @@ _080B1000: sub_80B100C: @ 80B100C push {r4,r5,lr} adds r5, r0, 0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty movs r1, 0x38 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -1222,7 +1222,7 @@ _080B1040: b _080B1120 _080B1048: ldr r4, =gUnknown_0854FEA4 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -1230,7 +1230,7 @@ _080B1048: .pool _080B105C: ldr r4, =gUnknown_0854FEA7 - bl GenerateRandomNumber + bl Random ands r5, r0 lsls r0, r5, 16 b _080B111A @@ -1243,7 +1243,7 @@ _080B106C: cmp r0, 0x3 beq _080B10EC ldr r4, =gUnknown_0854FE98 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 b _080B1112 @@ -1263,7 +1263,7 @@ _080B109E: b _080B1120 _080B10A6: ldr r4, =gUnknown_0854FEA4 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -1271,7 +1271,7 @@ _080B10A6: .pool _080B10B8: ldr r4, =gUnknown_0854FEA7 - bl GenerateRandomNumber + bl Random ands r5, r0 lsls r0, r5, 16 b _080B111A @@ -1284,13 +1284,13 @@ _080B10C8: cmp r0, 0x3 beq _080B10EC ldr r4, =gUnknown_0854FE98 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 b _080B1112 .pool _080B10EC: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r2, =0x00000cb2 adds r0, r1, r2 @@ -1330,7 +1330,7 @@ sub_80B1138: @ 80B1138 push {lr} ldr r0, =set_256color_bg_bg0 bl SetMainCallback2 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =sub_80B1158 str r0, [r1, 0x8] pop {r0} @@ -1380,10 +1380,10 @@ sub_80B11A8: @ 80B11A8 lsrs r0, 24 cmp r0, 0x1 bne _080B11F0 - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0x10 str r0, [r1] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =sub_80B1204 str r0, [r1, 0x8] bl FreeAllWindowBuffers @@ -1673,7 +1673,7 @@ battle_80801F0: @ 80B13F8 strh r1, [r0] lsls r0, r1, 24 lsrs r0, 24 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] @@ -2104,12 +2104,12 @@ sub_80B17E0: @ 80B17E0 ldrb r0, [r0] cmp r0, 0x2 bne _080B17FC - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r0, =0x00008009 b _080B1800 .pool _080B17FC: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0x8 _080B1800: str r0, [r1] @@ -2120,7 +2120,7 @@ _080B1800: ldr r0, =0x0000400e movs r1, 0 bl VarSet - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r0, [r2] movs r1, 0x80 lsls r1, 14 @@ -2166,7 +2166,7 @@ _080B1884: lsls r0, 24 cmp r0, 0 beq _080B18B8 - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r0, [r2] movs r1, 0x80 lsls r1, 19 @@ -2195,7 +2195,7 @@ _080B18B8: ldr r1, =gUnknown_03006080 movs r0, 0 strh r0, [r1] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =sub_80B1918 str r0, [r1, 0x8] bl InBattlePyramid @@ -2308,10 +2308,10 @@ _080B19E2: thumb_func_start sub_80B19EC sub_80B19EC: @ 80B19EC push {lr} - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0x8 str r0, [r1] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =sub_80B1994 str r0, [r1, 0x8] bl task_add_01_battle_start_with_music_and_stats @@ -2633,11 +2633,11 @@ _080B1CBC: ldr r0, =gUnknown_02038BDC ldr r0, [r0] _080B1CC0: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 bl ReturnEmptyStringIfNull adds r1, r0, 0 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 pop {r4} pop {r1} @@ -2648,13 +2648,13 @@ _080B1CC0: thumb_func_start sub_80B1CE0 sub_80B1CE0: @ 80B1CE0 push {r4,lr} - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r0, =gUnknown_02038BE0 ldr r0, [r0] bl ReturnEmptyStringIfNull adds r1, r0, 0 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 pop {r4} pop {r1} @@ -2801,7 +2801,7 @@ _080B1DCE: cmp r0, 0 bne _080B1DCA _080B1DE2: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000009ca adds r0, r1 @@ -2841,7 +2841,7 @@ _080B1E1A: bl sub_80B1D94 cmp r0, 0 bne _080B1E74 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000009ca adds r0, r1 @@ -2858,7 +2858,7 @@ _080B1E1A: lsls r0, 24 cmp r0, 0 beq _080B1E74 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -2920,7 +2920,7 @@ sub_80B1EC0: @ 80B1EC0 movs r1, 0 adds r3, r0, 0 adds r3, 0xA - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr _080B1ED2: ldrh r0, [r3] cmp r0, r4 @@ -2994,7 +2994,7 @@ sub_80B1F38: @ 80B1F38 beq _080B1F6C cmp r1, 0x63 bgt _080B1F6C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x000009ca adds r0, r2 @@ -3025,7 +3025,7 @@ sub_80B1F74: @ 80B1F74 beq _080B1FA8 cmp r1, 0x63 bgt _080B1FA8 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x000009ca adds r0, r2 @@ -3153,7 +3153,7 @@ sub_80B205C: @ 80B205C negs r0, r0 cmp r1, r0 beq _080B207E - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x000009ca adds r0, r2 @@ -3284,7 +3284,7 @@ sub_80B215C: @ 80B215C bl sub_80B2128 cmp r0, 0 beq _080B2184 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x000009c8 adds r1, r0, r2 @@ -3309,7 +3309,7 @@ sub_80B2188: @ 80B2188 bl sub_80B2128 cmp r0, 0 beq _080B21AC - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000009c8 adds r0, r1 @@ -3342,7 +3342,7 @@ sub_80B21B4: @ 80B21B4 bl sub_80B1DFC cmp r0, 0x1 bne _080B21E0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000009c8 adds r0, r1 diff --git a/asm/battle_transition.s b/asm/battle_transition.s index df940ef66..2d9aa39fe 100644 --- a/asm/battle_transition.s +++ b/asm/battle_transition.s @@ -10,7 +10,7 @@ sub_8145EF4: @ 8145EF4 push {lr} lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldr r1, =sub_8085E50 str r1, [r2, 0x4] bl sub_8145F6C @@ -665,7 +665,7 @@ sub_8146420: @ 8146420 _08146448: lsrs r0, r4, 8 asrs r1, r7, 16 - bl sine + bl Sin ldr r1, =gUnknown_02038C28 lsls r2, r5, 1 adds r2, r1 @@ -2094,7 +2094,7 @@ sub_8147018: @ 8147018 adds r0, r4, 0 movs r2, 0xA bl memcpy - bl GenerateRandomNumber + bl Random movs r5, 0x1 ands r5, r0 movs r1, 0 @@ -3042,7 +3042,7 @@ _081477E4: _081477E8: lsrs r0, r4, 8 asrs r1, r7, 16 - bl sine + bl Sin ldr r1, =gUnknown_02038C28 lsls r2, r5, 1 adds r2, r1 @@ -3250,7 +3250,7 @@ sub_814797C: @ 814797C _081479A4: adds r0, r5, 0 movs r1, 0x28 - bl sine + bl Sin ldrh r1, [r4, 0xA] adds r0, r1 lsls r0, 16 @@ -3575,7 +3575,7 @@ sub_8147C24: @ 8147C24 movs r2, 0x20 bl LoadPalette ldr r1, =gUnknown_085C8FF0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] lsls r0, 2 @@ -3652,7 +3652,7 @@ sub_8147CE4: @ 8147CE4 _08147CFE: adds r0, r5, 0 movs r1, 0x10 - bl sine + bl Sin ldrh r1, [r4, 0xC] adds r0, r1 lsls r0, 16 @@ -3683,7 +3683,7 @@ _08147D1E: _08147D38: adds r0, r5, 0 movs r1, 0x10 - bl sine + bl Sin ldrh r1, [r4, 0xE] subs r1, r0 lsls r1, 16 @@ -4293,7 +4293,7 @@ sub_8148218: @ 8148218 lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x22] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] bl sub_806F000 @@ -5733,7 +5733,7 @@ _08148E08: lsls r1, 16 asrs r1, 16 adds r0, r2, 0 - bl sine + bl Sin ldrh r2, [r4, 0xA] adds r0, r2 strh r0, [r4, 0xA] @@ -7938,7 +7938,7 @@ _08149FD0: ands r0, r4 mov r2, r8 asrs r1, r2, 16 - bl sine + bl Sin lsls r1, r6, 1 add r1, r10 add r0, r9 @@ -8000,13 +8000,13 @@ _0814A04C: asrs r0, r5, 16 mov r10, r0 ldr r1, [sp, 0x4] - bl sine + bl Sin adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 mov r0, r10 ldr r1, [sp, 0x4] - bl cosine + bl Cos ldr r2, [sp] lsls r1, r2, 16 asrs r1, 16 @@ -8071,7 +8071,7 @@ _0814A0B8: lsls r0, 16 asrs r0, 16 ldr r1, [sp, 0x4] - bl cosine + bl Cos lsls r0, 16 asrs r0, 16 ldr r2, [sp, 0x8] @@ -8717,7 +8717,7 @@ _0814A5E0: _0814A5E4: lsrs r0, r6, 8 asrs r1, r7, 16 - bl sine + bl Sin ldr r1, =gUnknown_02038C28 lsls r2, r5, 1 adds r2, r1 @@ -9526,7 +9526,7 @@ sub_814AC38: @ 814AC38 bl CreateTask lsls r0, 24 lsrs r5, r0, 24 - bl GenerateRandomNumber + bl Random lsls r0, 16 movs r1, 0xC0 lsls r1, 10 diff --git a/asm/berry.s b/asm/berry.s index 0d4daef45..a6ee3d077 100644 --- a/asm/berry.s +++ b/asm/berry.s @@ -12,7 +12,7 @@ sub_80E15B8: @ 80E15B8 mov r1, sp movs r0, 0 strh r0, [r1] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =0x000031f8 adds r1, r0 @@ -29,7 +29,7 @@ sub_80E15B8: @ 80E15B8 sub_80E15E4: @ 80E15E4 push {r4,lr} adds r4, r0, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000031f8 adds r3, r0, r1 @@ -69,7 +69,7 @@ _080E1618: thumb_func_start sub_80E162C sub_80E162C: @ 80E162C push {r4,lr} - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r1, [r4] ldr r2, =0x0000320c adds r0, r1, r2 @@ -112,7 +112,7 @@ GetBerryInfo: @ 80E167C bl sub_80E162C cmp r0, 0 beq _080E16A0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000031f8 b _080E16B4 @@ -141,7 +141,7 @@ _080E16B4: @ struct BerryTreeInfo *GetBerryTreeInfo(u8 berryTreeId) GetBerryTreeInfo: @ 80E16C0 lsls r0, 24 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr lsrs r0, 21 ldr r2, =0x0000169c adds r0, r2 @@ -261,7 +261,7 @@ _080E178E: RemoveAllBerryTrees: @ 80E1794 push {r4-r6,lr} movs r2, 0 - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr ldr r5, =0x0000169c ldr r0, =gUnknown_0858ABD0 ldr r3, [r0] @@ -378,7 +378,7 @@ BerryTreeTimeUpdate: @ 80E1870 adds r6, r0, 0 movs r2, 0 _080E1876: - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr lsls r0, r2, 3 ldr r3, =0x0000169c adds r0, r3 @@ -518,7 +518,7 @@ _080E197A: @ void RemoveBerryTree(u8 berryTreeId) RemoveBerryTree: @ 80E1984 lsls r0, 24 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] lsrs r0, 21 adds r2, r0 @@ -537,7 +537,7 @@ RemoveBerryTree: @ 80E1984 @ u8 GetBerryTypeByBerryTreeId(u8 berryTreeId) GetBerryTypeByBerryTreeId: @ 80E19AC lsls r0, 24 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r1, [r1] lsrs r0, 21 adds r1, r0 @@ -552,7 +552,7 @@ GetBerryTypeByBerryTreeId: @ 80E19AC @ u8 GetStageByBerryTreeId(u8 berryTreeId) GetStageByBerryTreeId: @ 80E19C8 lsls r0, 24 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r1, [r1] lsrs r0, 21 adds r1, r0 @@ -738,7 +738,7 @@ _080E1AFA: muls r5, r0 adds r4, r1, 0 muls r4, r2 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 subs r4, r5 @@ -793,7 +793,7 @@ CalcBerryYield: @ 80E1B38 @ u8 GetBerryCountByBerryTreeId(u8 berryTreeId) GetBerryCountByBerryTreeId: @ 80E1B64 lsls r0, 24 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r1, [r1] lsrs r0, 21 adds r1, r0 @@ -838,7 +838,7 @@ FieldObjectInteractionGetBerryTreeData: @ 80E1B94 bl ResetBerryTreeSparkleFlag ldr r0, =gUnknown_020375F2 ldrb r0, [r0] - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] @@ -871,7 +871,7 @@ _080E1BEE: lsls r0, 24 lsrs r0, 24 strh r0, [r4] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 ldrh r2, [r4] adds r0, r6, 0 bl GetBerryCountStringByBerryType @@ -893,7 +893,7 @@ FieldObjectInteractionGetBerryName: @ 80E1C2C bl GetBerryTypeByBerryTreeId lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl GetBerryNameByBerryType pop {r0} bx r0 @@ -920,7 +920,7 @@ FieldObjectInteractionGetBerryCountString: @ 80E1C54 adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 adds r0, r5, 0 bl GetBerryCountStringByBerryType pop {r4,r5} @@ -1013,7 +1013,7 @@ FieldObjectInteractionRemoveBerryTree: @ 80E1D28 bl RemoveBerryTree ldr r0, =gUnknown_020375F2 ldrb r0, [r0] - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] diff --git a/asm/berry_blender.s b/asm/berry_blender.s index ae0f4209a..c1610a472 100644 --- a/asm/berry_blender.s +++ b/asm/berry_blender.s @@ -516,7 +516,7 @@ _0807FBBE: ldrb r0, [r0] cmp r0, 0 beq _0807FC14 - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _0807FC14 @@ -771,7 +771,7 @@ sub_807FE14: @ 807FE14 strh r5, [r6] adds r0, r6, 0x2 adds r1, r4, 0 - bl CopyString + bl StringCopy ldrb r0, [r4, 0x15] strb r0, [r6, 0x9] ldrb r0, [r4, 0x16] @@ -821,10 +821,10 @@ _0807FE7C: movs r1, 0x2 strb r1, [r0] ldr r4, =gUnknown_020229F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r0, r4, 0 - bl CopyString + bl StringCopy movs r0, 0xD0 lsls r0, 2 bl FlagGet @@ -835,7 +835,7 @@ _0807FE7C: adds r0, 0x1C ldr r1, =gUnknown_083397D0 ldr r1, [r1, 0xC] - bl CopyString + bl StringCopy b _0807FED4 .pool _0807FEC8: @@ -843,7 +843,7 @@ _0807FEC8: adds r0, 0x1C ldr r1, =gUnknown_083397D0 ldr r1, [r1] - bl CopyString + bl StringCopy _0807FED4: ldr r1, =gUnknown_020229E8 movs r0, 0x2 @@ -860,19 +860,19 @@ _0807FEE8: movs r1, 0x3 strb r1, [r0] ldr r6, =gUnknown_020229F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r0, r6, 0 - bl CopyString + bl StringCopy adds r0, r6, 0 adds r0, 0x1C ldr r4, =gUnknown_083397D0 ldr r1, [r4, 0x10] - bl CopyString + bl StringCopy adds r0, r6, 0 adds r0, 0x38 ldr r1, [r4, 0x8] - bl CopyString + bl StringCopy adds r0, r6, 0 subs r0, 0x8 strh r5, [r0, 0x1A] @@ -890,23 +890,23 @@ _0807FF3C: movs r1, 0x4 strb r1, [r0] ldr r5, =gUnknown_020229F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r0, r5, 0 - bl CopyString + bl StringCopy adds r0, r5, 0 adds r0, 0x1C ldr r4, =gUnknown_083397D0 ldr r1, [r4, 0x14] - bl CopyString + bl StringCopy adds r0, r5, 0 adds r0, 0x38 ldr r1, [r4, 0x4] - bl CopyString + bl StringCopy adds r0, r5, 0 adds r0, 0x54 ldr r1, [r4, 0x8] - bl CopyString + bl StringCopy adds r0, r5, 0 subs r0, 0x8 movs r1, 0x2 @@ -1122,7 +1122,7 @@ _08080126: bne _0808016A b _080804F8 _0808016A: - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _08080174 @@ -1938,7 +1938,7 @@ _080807E4: ldr r0, =gUnknown_020229F0 adds r1, r0 add r0, sp, 0x8 - bl CopyString + bl StringCopy movs r0, 0x1 add r1, sp, 0x8 movs r2, 0x38 @@ -2687,7 +2687,7 @@ _08080ED8: ldrb r0, [r0] cmp r0, 0 bne _08080F9A - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 ldr r1, =0x0000028f @@ -2830,7 +2830,7 @@ sub_8080FD0: @ 8080FD0 ldrb r0, [r0] cmp r0, 0 bne _080810CC - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 ldr r1, =0x0000028f @@ -2956,7 +2956,7 @@ sub_80810F8: @ 80810F8 ldrb r0, [r0] cmp r0, 0 bne _080811F8 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 ldr r1, =0x0000028f @@ -3334,7 +3334,7 @@ sub_80814B0: @ 80814B0 ldrb r0, [r0] cmp r0, 0 beq _080814E4 - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _080814E4 @@ -3652,12 +3652,12 @@ _0808175A: ldrb r0, [r1] cmp r0, 0 bne _0808182C - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0x2 bne _080817A8 - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r0, 0x1 ands r0, r1 @@ -3672,7 +3672,7 @@ _0808175A: b _080817BA .pool _080817A8: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -3758,7 +3758,7 @@ _0808185A: ldrb r0, [r0] cmp r0, 0 beq _0808187E - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x80 lsls r0, 2 @@ -3883,7 +3883,7 @@ help_system_is_not_first_time: @ 8081964 bne _080819A2 adds r0, r4, 0x2 adds r1, r5, 0x2 - bl CompareString + bl StringCompare cmp r0, 0 bne _080819B0 ldr r0, [r4, 0x8] @@ -4432,7 +4432,7 @@ _08081D4C: ldrb r0, [r5] cmp r0, 0xC bne _08081DA6 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xA @@ -4706,7 +4706,7 @@ sub_8081F94: @ 8081F94 ldrb r0, [r0] cmp r0, 0 beq _08081FB8 - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _08081FB8 @@ -4852,7 +4852,7 @@ _080820EC: ldrb r0, [r0] cmp r0, 0 beq _0808218C - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _0808218C @@ -4968,7 +4968,7 @@ _080821D4: ldrb r0, [r0] cmp r0, 0 beq _08082254 - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _08082254 @@ -5367,7 +5367,7 @@ _08082558: ldr r0, [r1] adds r0, 0x1 str r0, [r1] - ldr r1, =gUnknown_03002700 + ldr r1, =gSoftResetDisabled movs r0, 0x1 strb r0, [r1] b _0808263C @@ -5456,7 +5456,7 @@ _0808261A: str r0, [r1] cmp r0, 0x5 ble _0808263C - ldr r1, =gUnknown_03002700 + ldr r1, =gSoftResetDisabled movs r0, 0 strb r0, [r1] movs r0, 0x1 @@ -5544,7 +5544,7 @@ _080826EC: adds r0, 0x63 movs r1, 0x3 strb r1, [r0] - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r0, [r6] adds r0, 0x6E ldrh r0, [r0] @@ -5554,7 +5554,7 @@ _080826EC: ldr r0, =gUnknown_020229F0 adds r1, r0 adds r0, r4, 0 - bl CopyString + bl StringCopy ldr r1, =gUnknown_083398DD b _08082740 .pool @@ -5564,7 +5564,7 @@ _0808271C: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r0, [r6] adds r0, 0x6E ldrh r0, [r0] @@ -5574,18 +5574,18 @@ _0808271C: ldr r0, =gUnknown_020229F0 adds r1, r0 adds r0, r4, 0 - bl CopyString + bl StringCopy ldr r1, =gUnknown_083398B0 _08082740: adds r0, r4, 0 - bl AppendString + bl StringAppend b _080828DC .pool _08082754: ldr r4, [r6] ldr r0, =0x000011b8 adds r4, r0 - ldr r5, =gUnknown_02021FC4 + ldr r5, =gStringVar4 bl sav2_get_text_speed adds r2, r0, 0 lsls r2, 24 @@ -5855,9 +5855,9 @@ _080829AA: ldr r1, =0x000011b8 adds r0, r1 strh r2, [r0] - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_08339896 - bl CopyString + bl StringCopy b _08082A92 .pool _080829D4: @@ -5871,16 +5871,16 @@ _080829D4: ldr r1, =0x000011b8 adds r0, r1 strh r2, [r0] - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_08339858 - bl CopyString + bl StringCopy b _08082A92 .pool _08082A00: ldr r4, [r6] ldr r2, =0x000011b8 adds r4, r2 - ldr r5, =gUnknown_02021FC4 + ldr r5, =gStringVar4 bl sav2_get_text_speed adds r2, r0, 0 lsls r2, 24 @@ -6250,7 +6250,7 @@ sub_8082D28: @ 8082D28 lsls r0, 24 lsrs r1, r0, 24 _08082D3C: - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _08082DCC @@ -6415,7 +6415,7 @@ sub_8082E84: @ 8082E84 mov r6, r9 mov r5, r8 push {r5-r7} - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r1, r0, 16 movs r0, 0x1 @@ -6432,7 +6432,7 @@ sub_8082E84: @ 8082E84 mov r8, r3 movs r7, 0x10 _08082EB0: - bl GenerateRandomNumber + bl Random ldr r1, =gUnknown_020322A4 ldr r4, [r1] adds r4, 0x4A @@ -6475,7 +6475,7 @@ _08082EF4: adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - bl GenerateRandomNumber + bl Random lsls r5, r4, 4 adds r5, r4 lsls r5, 2 @@ -6487,7 +6487,7 @@ _08082EF4: ands r0, r1 subs r0, r7, r0 strh r0, [r4, 0x2E] - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 mov r2, r8 @@ -6968,7 +6968,7 @@ sub_80832BC: @ 80832BC ldrsh r0, [r6, r1] cmp r0, 0 bne _080832E0 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r5, 0 @@ -7042,7 +7042,7 @@ _08083344: ldrsh r1, [r4, r2] cmp r1, 0 bne _08083362 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r5, 0 @@ -7155,7 +7155,7 @@ sub_80833F8: @ 80833F8 @ void UpdateBerryBlenderRecord() UpdateBerryBlenderRecord: @ 8083418 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r0, =gUnknown_020322A4 ldr r1, [r0] @@ -7326,15 +7326,15 @@ _08083564: mov r1, r8 movs r2, 0 movs r3, 0x1 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, [r7] adds r0, 0x9F ldr r1, =gUnknown_08339941 - bl AppendString + bl StringAppend ldr r0, [r7] adds r0, 0x9F ldr r1, =gUnknown_085E8D5E - bl AppendString + bl StringAppend ldr r0, [r7] adds r0, 0x9F lsls r4, r5, 3 @@ -7342,7 +7342,7 @@ _08083564: lsls r4, 2 ldr r3, =gUnknown_020229F0 adds r1, r4, r3 - bl AppendString + bl StringAppend ldr r1, [r7] adds r1, 0x9F mov r0, r9 @@ -7365,17 +7365,17 @@ _08083564: lsls r1, 1 adds r5, r1 adds r1, r5, 0 - bl CopyString + bl StringCopy ldr r0, [r7] adds r0, 0x9F ldr r2, =gUnknown_020229E8 adds r4, r2 ldrb r1, [r4, 0x1A] - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString ldr r0, [r7] adds r0, 0x9F ldr r1, =gUnknown_08339914 - bl AppendString + bl StringAppend ldr r1, [r7] adds r1, 0x9F movs r3, 0xFF @@ -7422,11 +7422,11 @@ _0808361A: adds r0, r4, 0 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, [r6] adds r0, 0x9F ldr r1, =gUnknown_08339941 - bl AppendString + bl StringAppend ldr r0, [r6] adds r0, 0x4E ldrh r0, [r0] @@ -7438,15 +7438,15 @@ _0808361A: ldr r0, [sp, 0x48] movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, [r6] adds r0, 0x9F ldr r1, [sp, 0x48] - bl AppendString + bl StringAppend ldr r0, [r6] adds r0, 0x9F ldr r1, =gUnknown_0833993C - bl AppendString + bl StringAppend ldr r1, [r6] adds r1, 0x9F movs r0, 0x1 @@ -7496,19 +7496,19 @@ _0808361A: adds r0, r5, 0 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, [r6] adds r0, 0x9F ldr r1, =gUnknown_08339921 - bl AppendString + bl StringAppend adds r1, r4, 0 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, [r6] adds r0, 0x9F ldr r1, =gUnknown_08339928 - bl AppendString + bl StringAppend ldr r1, [r6] adds r1, 0x9F movs r0, 0x1 @@ -7540,7 +7540,7 @@ _0808361A: b _08083898 .pool _08083790: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -7681,13 +7681,13 @@ sub_80838AC: @ 80838AC adds r0, r1 ldr r1, [r0] adds r0, r6, 0 - bl CopyString + bl StringCopy ldr r1, =gUnknown_0833979D adds r0, r6, 0 - bl AppendString + bl StringAppend ldr r1, =gUnknown_08339943 adds r0, r6, 0 - bl AppendString + bl StringAppend adds r0, r5, 0 bl sub_8136EA4 adds r4, r0, 0 @@ -7700,32 +7700,32 @@ sub_80838AC: @ 80838AC lsrs r5, 24 ldr r1, =gUnknown_0833994F adds r0, r6, 0 - bl AppendString + bl StringAppend mov r0, sp adds r1, r4, 0 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r0, r6, 0 mov r1, sp - bl AppendString + bl StringAppend ldr r1, =gUnknown_0833995D adds r0, r6, 0 - bl AppendString + bl StringAppend mov r0, sp adds r1, r5, 0 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r0, r6, 0 mov r1, sp - bl AppendString + bl StringAppend ldr r1, =gUnknown_08339970 adds r0, r6, 0 - bl AppendString + bl StringAppend ldr r1, =gUnknown_0833979B adds r0, r6, 0 - bl AppendString + bl StringAppend add sp, 0xC pop {r4-r6} pop {r0} @@ -8158,15 +8158,15 @@ _08083C84: mov r1, r8 movs r2, 0 movs r3, 0x1 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, [r7] adds r0, 0x9F ldr r1, =gUnknown_08339941 - bl AppendString + bl StringAppend ldr r0, [r7] adds r0, 0x9F ldr r1, =gUnknown_085E8D5E - bl AppendString + bl StringAppend ldr r0, [r7] adds r0, 0x9F lsls r1, r5, 3 @@ -8174,7 +8174,7 @@ _08083C84: lsls r1, 2 ldr r2, =gUnknown_020229F0 adds r1, r2 - bl AppendString + bl StringAppend ldr r1, [r7] adds r1, 0x9F ldr r0, [sp, 0x8] @@ -8201,7 +8201,7 @@ _08083C84: ldrh r1, [r1] movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r1, [r7] adds r1, 0x9F mov r3, r10 @@ -8222,7 +8222,7 @@ _08083C84: ldrh r1, [r1] movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r1, [r7] adds r1, 0x9F mov r3, r10 @@ -8243,7 +8243,7 @@ _08083C84: ldrh r1, [r1] movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r1, [r7] adds r1, 0x9F mov r3, r10 @@ -8296,7 +8296,7 @@ _08083DC8: strb r0, [r2] b _08083E12 _08083DE2: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -8379,7 +8379,7 @@ ShowBerryBlenderRecordWindow: @ 8083E24 movs r7, 0xA4 lsls r7, 22 _08083E8A: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] lsls r1, r6, 1 ldr r2, =0x000009bc @@ -8393,10 +8393,10 @@ _08083E8A: add r0, sp, 0xC movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r5, r0, 0 ldr r1, =gUnknown_08339941 - bl AppendString + bl StringAppend adds r5, r0, 0 adds r0, r4, 0 movs r1, 0x64 @@ -8405,10 +8405,10 @@ _08083E8A: adds r0, r5, 0 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r5, r0, 0 ldr r1, =gUnknown_0833993C - bl AppendString + bl StringAppend movs r0, 0x1 add r1, sp, 0xC movs r2, 0x8C @@ -8545,7 +8545,7 @@ sub_8083F94: @ 8083F94 ldr r5, =gUnknown_020229F0 adds r1, r5 adds r0, r7, 0 - bl CopyString + bl StringCopy adds r0, r6, 0 bl sub_81370B4 strb r0, [r7, 0xB] @@ -8599,7 +8599,7 @@ _08084058: ldr r5, =gUnknown_020229F0 adds r1, r5 adds r0, r7, 0 - bl CopyString + bl StringCopy adds r0, r6, 0 bl sub_81370B4 strb r0, [r7, 0xB] diff --git a/asm/berry_tag_screen.s b/asm/berry_tag_screen.s index d747c6e03..afb9a59fb 100644 --- a/asm/berry_tag_screen.s +++ b/asm/berry_tag_screen.s @@ -80,7 +80,7 @@ _08177CAA: sub_8177CB0: @ 8177CB0 push {lr} sub sp, 0x4 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -202,7 +202,7 @@ _08177DC2: _08177DDA: strb r0, [r2, 0x8] _08177DDC: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -343,7 +343,7 @@ _08177F1C: b _08177FD6 .pool _08177F3C: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 @@ -562,20 +562,20 @@ sub_8178110: @ 8178110 ldrb r0, [r0] bl GetBerryInfo adds r6, r0, 0 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, [r5] adds r1, r4 ldrh r1, [r1] movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, =gUnknown_02021DC4 + bl ConvertIntToDecimalStringN + ldr r0, =gStringVar2 adds r1, r6, 0 - bl CopyString - ldr r4, =gUnknown_02021FC4 + bl StringCopy + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E9263 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0 str r0, [sp] str r0, [sp, 0x4] @@ -641,20 +641,20 @@ _081781C8: movs r1, 0x64 bl __udivsi3 adds r5, r0, 0 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0 movs r2, 0 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, =gUnknown_02021DC4 + bl ConvertIntToDecimalStringN + ldr r0, =gStringVar2 adds r1, r4, 0 movs r2, 0 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E9233 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders str r7, [sp] str r6, [sp, 0x4] str r6, [sp, 0x8] @@ -1164,7 +1164,7 @@ sub_8178654: @ 8178654 ands r0, r1 cmp r0, 0 bne _081786A6 - ldr r3, =gUnknown_030022C0 + ldr r3, =gMain ldrh r0, [r3, 0x30] movs r1, 0xF0 ands r1, r0 diff --git a/asm/big_shroomish_barboach.s b/asm/big_shroomish_barboach.s index fb0878fb8..f3bc3cf8a 100644 --- a/asm/big_shroomish_barboach.s +++ b/asm/big_shroomish_barboach.s @@ -15,45 +15,45 @@ sub_80F97C8: @ 80F97C8 sub sp, 0x8 adds r5, r0, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 str r0, [sp, 0x4] lsrs r0, 16 str r0, [sp] adds r0, r5, 0 movs r1, 0x27 - bl pokemon_getattr + bl GetMonData adds r7, r0, 0 movs r6, 0xF ands r7, r6 adds r0, r5, 0 movs r1, 0x28 - bl pokemon_getattr + bl GetMonData mov r8, r0 mov r1, r8 ands r1, r6 mov r8, r1 adds r0, r5, 0 movs r1, 0x29 - bl pokemon_getattr + bl GetMonData mov r9, r0 mov r3, r9 ands r3, r6 mov r9, r3 adds r0, r5, 0 movs r1, 0x2A - bl pokemon_getattr + bl GetMonData mov r10, r0 ands r0, r6 mov r10, r0 adds r0, r5, 0 movs r1, 0x2B - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 ands r4, r6 adds r0, r5, 0 movs r1, 0x2C - bl pokemon_getattr + bl GetMonData adds r2, r0, 0 ands r2, r6 mov r1, r8 @@ -194,10 +194,10 @@ _080F992C: adds r0, r5, 0 movs r2, 0 movs r3, 0x8 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r5, r0, 0 ldr r1, _080F9980 - bl AppendString + bl StringAppend adds r5, r0, 0 adds r0, r4, 0 movs r1, 0xA @@ -206,7 +206,7 @@ _080F992C: adds r0, r5, 0 movs r2, 0 movs r3, 0x1 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN pop {r4,r5} pop {r0} bx r0 @@ -236,16 +236,16 @@ _080F99A0: ldrh r1, [r1] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r1, r0 adds r0, r5, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0x1 beq _080F99C2 adds r0, r5, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, r6 beq _080F99CC _080F99C2: @@ -266,7 +266,7 @@ _080F99CC: adds r0, r6, 0 bl sub_80F989C adds r4, r0, 0 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r5, 0 bl sub_80F9910 cmp r5, r4 @@ -297,29 +297,29 @@ sub_80F9A14: @ 80F9A14 adds r0, r4, 0 bl sub_80F989C adds r1, r0, 0 - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 bl sub_80F9910 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r1, 0xB muls r1, r4 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy ldrh r1, [r5] movs r0, 0x80 lsls r0, 8 cmp r1, r0 bne _080F9A64 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085ECF6B - bl CopyString + bl StringCopy b _080F9A6E .pool _080F9A64: - ldr r0, =gUnknown_02021DC4 - ldr r1, =gUnknown_03005D90 + ldr r0, =gStringVar2 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy _080F9A6E: pop {r4,r5} pop {r0} @@ -438,7 +438,7 @@ sub_80F9B30: @ 80F9B30 bhi _080F9BAC cmp r5, 0x40 bhi _080F9BAC - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000031a8 adds r0, r1 @@ -449,16 +449,16 @@ _080F9B6A: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _080F9B9C adds r0, r4, 0 movs r1, 0x6 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _080F9B9C mov r1, sp diff --git a/asm/braille_puzzles.s b/asm/braille_puzzles.s new file mode 100644 index 000000000..c83572471 --- /dev/null +++ b/asm/braille_puzzles.s @@ -0,0 +1,627 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_81795E8 +sub_81795E8: @ 81795E8 + push {lr} + ldr r0, =0x000008af + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _08179634 + ldr r0, =gSaveBlock1Ptr + ldr r2, [r0] + ldrh r1, [r2, 0x4] + ldr r0, =0x00004718 + cmp r1, r0 + bne _08179634 + ldr r1, [r2] + ldr r0, =0x0003000a + cmp r1, r0 + beq _08179616 + ldr r0, =0x00030009 + cmp r1, r0 + beq _08179616 + ldr r0, =0x0003000b + cmp r1, r0 + bne _08179634 +_08179616: + movs r0, 0x1 + b _08179636 + .pool +_08179634: + movs r0, 0 +_08179636: + pop {r1} + bx r1 + thumb_func_end sub_81795E8 + + thumb_func_start sub_817963C +sub_817963C: @ 817963C + push {lr} + ldr r2, =0x0000022a + movs r0, 0x10 + movs r1, 0x8 + bl MapGridSetMetatileIdAt + ldr r2, =0x0000022b + movs r0, 0x11 + movs r1, 0x8 + bl MapGridSetMetatileIdAt + movs r2, 0x8B + lsls r2, 2 + movs r0, 0x12 + movs r1, 0x8 + bl MapGridSetMetatileIdAt + ldr r2, =0x00000e32 + movs r0, 0x10 + movs r1, 0x9 + bl MapGridSetMetatileIdAt + ldr r2, =0x00000233 + movs r0, 0x11 + movs r1, 0x9 + bl MapGridSetMetatileIdAt + ldr r2, =0x00000e34 + movs r0, 0x12 + movs r1, 0x9 + bl MapGridSetMetatileIdAt + bl DrawWholeMapView + movs r0, 0x14 + bl audio_play + ldr r0, =0x000008af + bl FlagSet + bl script_env_2_disable + pop {r0} + bx r0 + .pool + thumb_func_end sub_817963C + + thumb_func_start sub_81796AC +sub_81796AC: @ 81796AC + push {r4,lr} + ldr r4, =gPlayerParty + adds r0, r4, 0 + movs r1, 0x41 + movs r2, 0 + bl GetMonData + movs r1, 0x9D + lsls r1, 1 + cmp r0, r1 + bne _081796F4 + bl calc_player_party_count + ldr r0, =gUnknown_020244E9 + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + adds r1, r4, 0 + subs r1, 0x64 + adds r0, r1 + movs r1, 0x41 + movs r2, 0 + bl GetMonData + ldr r1, =0x0000017d + cmp r0, r1 + bne _081796F4 + movs r0, 0x1 + b _081796F6 + .pool +_081796F4: + movs r0, 0 +_081796F6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81796AC + + thumb_func_start nullsub_84 +nullsub_84: @ 81796FC + bx lr + thumb_func_end nullsub_84 + + thumb_func_start sub_8179700 +sub_8179700: @ 8179700 + push {lr} + ldr r0, =sub_8179778 + 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 r0, [r1, 0xA] + strh r0, [r1, 0xC] + movs r0, 0x2 + strh r0, [r1, 0x10] + movs r0, 0x5 + strh r0, [r1, 0x12] + movs r0, 0x32 + strh r0, [r1, 0x14] + movs r0, 0 + bl SetCameraPanningCallback + pop {r0} + bx r0 + .pool + thumb_func_end sub_8179700 + + thumb_func_start sub_817973C +sub_817973C: @ 817973C + push {lr} + ldr r0, =sub_8179778 + 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 r0, [r1, 0xA] + strh r0, [r1, 0xC] + movs r0, 0x3 + strh r0, [r1, 0x10] + movs r0, 0x5 + strh r0, [r1, 0x12] + movs r0, 0x2 + strh r0, [r1, 0x14] + movs r0, 0 + bl SetCameraPanningCallback + pop {r0} + bx r0 + .pool + thumb_func_end sub_817973C + + thumb_func_start sub_8179778 +sub_8179778: @ 8179778 + 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 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + movs r1, 0xA + ldrsh r0, [r4, r1] + movs r2, 0x12 + ldrsh r1, [r4, r2] + bl __modsi3 + cmp r0, 0 + bne _081797D0 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x10] + negs r0, r0 + strh r0, [r4, 0x10] + movs r0, 0x10 + ldrsh r1, [r4, r0] + movs r0, 0 + bl SetCameraPanning + movs r2, 0xC + ldrsh r1, [r4, r2] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _081797D0 + adds r0, r5, 0 + bl DestroyTask + bl script_env_2_enable_and_set_ctx_running + bl InstallCameraPanAheadCallback +_081797D0: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8179778 + + thumb_func_start sub_81797DC +sub_81797DC: @ 81797DC + push {lr} + movs r0, 0x8B + lsls r0, 4 + bl FlagGet + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _0817982C + ldr r0, =gSaveBlock1Ptr + ldr r3, [r0] + ldrh r1, [r3, 0x4] + movs r0, 0xC3 + lsls r0, 3 + cmp r1, r0 + bne _0817982C + ldr r1, [r3] + ldr r0, =0x00170006 + cmp r1, r0 + beq _08179810 + ldr r0, =0x00170005 + cmp r1, r0 + beq _08179810 + ldr r0, =0x00170007 + cmp r1, r0 + bne _0817982C +_08179810: + ldr r0, =gUnknown_0203BD14 + strb r2, [r0] + movs r0, 0x1 + b _0817982E + .pool +_0817982C: + movs r0, 0 +_0817982E: + pop {r1} + bx r1 + thumb_func_end sub_81797DC + + thumb_func_start sub_8179834 +sub_8179834: @ 8179834 + push {lr} + bl brm_get_pokemon_selection + ldr r1, =gUnknown_02038C08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + movs r0, 0x3C + bl FieldEffectStart + pop {r0} + bx r0 + .pool + thumb_func_end sub_8179834 + + thumb_func_start sub_8179850 +sub_8179850: @ 8179850 + push {lr} + movs r0, 0x3C + bl FieldEffectActiveListRemove + bl sub_8179860 + pop {r0} + bx r0 + thumb_func_end sub_8179850 + + thumb_func_start sub_8179860 +sub_8179860: @ 8179860 + push {lr} + ldr r2, =0x0000022a + movs r0, 0xE + movs r1, 0x1A + bl MapGridSetMetatileIdAt + ldr r2, =0x0000022b + movs r0, 0xF + movs r1, 0x1A + bl MapGridSetMetatileIdAt + movs r2, 0x8B + lsls r2, 2 + movs r0, 0x10 + movs r1, 0x1A + bl MapGridSetMetatileIdAt + ldr r2, =0x00000e32 + movs r0, 0xE + movs r1, 0x1B + bl MapGridSetMetatileIdAt + ldr r2, =0x00000233 + movs r0, 0xF + movs r1, 0x1B + bl MapGridSetMetatileIdAt + ldr r2, =0x00000e34 + movs r0, 0x10 + movs r1, 0x1B + bl MapGridSetMetatileIdAt + bl DrawWholeMapView + movs r0, 0x14 + bl audio_play + movs r0, 0x8B + lsls r0, 4 + bl FlagSet + bl script_env_2_disable + pop {r0} + bx r0 + .pool + thumb_func_end sub_8179860 + + thumb_func_start sub_81798D0 +sub_81798D0: @ 81798D0 + push {lr} + ldr r0, =0x000008b2 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _08179910 + ldr r0, =gSaveBlock1Ptr + ldr r2, [r0] + ldrh r1, [r2, 0x4] + ldr r0, =0x00004418 + cmp r1, r0 + bne _08179910 + ldr r1, [r2] + ldr r0, =0x00190008 + cmp r1, r0 + bne _08179910 + ldr r1, =gUnknown_0203BD14 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0x1 + b _08179912 + .pool +_08179910: + movs r0, 0 +_08179912: + pop {r1} + bx r1 + thumb_func_end sub_81798D0 + + thumb_func_start sub_8179918 +sub_8179918: @ 8179918 + push {lr} + bl brm_get_pokemon_selection + ldr r1, =gUnknown_02038C08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + movs r0, 0x3C + bl FieldEffectStart + pop {r0} + bx r0 + .pool + thumb_func_end sub_8179918 + + thumb_func_start sub_8179934 +sub_8179934: @ 8179934 + push {lr} + movs r0, 0x3C + bl FieldEffectActiveListRemove + bl sub_8179944 + pop {r0} + bx r0 + thumb_func_end sub_8179934 + + thumb_func_start sub_8179944 +sub_8179944: @ 8179944 + push {lr} + ldr r2, =0x0000022a + movs r0, 0xE + movs r1, 0x1A + bl MapGridSetMetatileIdAt + ldr r2, =0x0000022b + movs r0, 0xF + movs r1, 0x1A + bl MapGridSetMetatileIdAt + movs r2, 0x8B + lsls r2, 2 + movs r0, 0x10 + movs r1, 0x1A + bl MapGridSetMetatileIdAt + ldr r2, =0x00000e32 + movs r0, 0xE + movs r1, 0x1B + bl MapGridSetMetatileIdAt + ldr r2, =0x00000233 + movs r0, 0xF + movs r1, 0x1B + bl MapGridSetMetatileIdAt + ldr r2, =0x00000e34 + movs r0, 0x10 + movs r1, 0x1B + bl MapGridSetMetatileIdAt + bl DrawWholeMapView + movs r0, 0x14 + bl audio_play + ldr r0, =0x000008b2 + bl FlagSet + bl script_env_2_disable + pop {r0} + bx r0 + .pool + thumb_func_end sub_8179944 + + thumb_func_start nullsub_64 +nullsub_64: @ 81799B4 + bx lr + thumb_func_end nullsub_64 + + thumb_func_start sub_81799B8 +sub_81799B8: @ 81799B8 + push {lr} + bl oei_task_add + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gUnknown_0203BD14 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081799E4 + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + ldr r2, =sub_8179934 + b _081799F0 + .pool +_081799E4: + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + ldr r2, =sub_8179850 +_081799F0: + lsrs r1, r2, 16 + strh r1, [r0, 0x18] + strh r2, [r0, 0x1A] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81799B8 + + thumb_func_start sub_8179A04 +sub_8179A04: @ 8179A04 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r4, =gSaveBlock1Ptr + ldr r0, [r4] + ldrh r1, [r0, 0x4] + ldr r0, =0x00004318 + cmp r1, r0 + beq _08179A1A + b _08179B5A +_08179A1A: + ldr r0, =0x000008b1 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08179A28 + b _08179B5A +_08179A28: + movs r0, 0x2 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _08179A36 + b _08179B5A +_08179A36: + movs r0, 0x3 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08179A58 + b _08179B5A + .pool +_08179A54: + movs r0, 0x1 + b _08179B5C +_08179A58: + movs r5, 0 + mov r8, r4 + ldr r4, =gUnknown_085EFE74 + adds r0, r4, 0x1 + mov r12, r0 + ldr r6, =0x0000403b + ldr r1, =0x0000403c + mov r9, r1 +_08179A68: + lsls r0, r5, 1 + adds r1, r0, r4 + add r0, r12 + ldrb r3, [r0] + mov r7, r8 + ldr r2, [r7] + movs r7, 0 + ldrsh r0, [r2, r7] + ldrb r1, [r1] + cmp r0, r1 + bne _08179B44 + movs r1, 0x2 + ldrsh r0, [r2, r1] + cmp r0, r3 + bne _08179B44 + cmp r5, 0xF + bhi _08179AB0 + adds r0, r6, 0 + bl VarGet + lsls r0, 16 + movs r1, 0x80 + lsls r1, 9 + lsls r1, r5 + orrs r1, r0 + lsrs r1, 16 + adds r0, r6, 0 + bl VarSet + b _08179AF0 + .pool +_08179AB0: + cmp r5, 0x1F + bhi _08179AD2 + mov r0, r9 + bl VarGet + lsls r0, 16 + adds r2, r5, 0 + subs r2, 0x10 + movs r1, 0x80 + lsls r1, 9 + lsls r1, r2 + orrs r1, r0 + lsrs r1, 16 + mov r0, r9 + bl VarSet + b _08179AF0 +_08179AD2: + ldr r4, =0x0000403d + adds r0, r4, 0 + bl VarGet + lsls r0, 16 + adds r2, r5, 0 + subs r2, 0x20 + movs r1, 0x80 + lsls r1, 9 + lsls r1, r2 + orrs r1, r0 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet +_08179AF0: + ldr r0, =0x0000403b + bl VarGet + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x0000ffff + cmp r4, r0 + bne _08179B5A + ldr r0, =0x0000403c + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, r4 + bne _08179B5A + ldr r0, =0x0000403d + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xF + bne _08179B5A + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, [r0] + ldr r0, =0x00150008 + cmp r1, r0 + beq _08179A54 + b _08179B5A + .pool +_08179B44: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x23 + bls _08179A68 + movs r0, 0x3 + bl FlagSet + movs r0, 0x2 + bl FlagReset +_08179B5A: + movs r0, 0 +_08179B5C: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8179A04 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/cable_car.s b/asm/cable_car.s index 96f97f0ac..3d82586fe 100644 --- a/asm/cable_car.s +++ b/asm/cable_car.s @@ -57,7 +57,7 @@ sub_814FCC8: @ 814FCC8 sub sp, 0x18 movs r4, 0 str r4, [sp, 0x14] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 @@ -156,7 +156,7 @@ _0814FD4E: ldr r0, =0x00004110 bl AllocZeroed str r0, [r4] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -186,7 +186,7 @@ _0814FDFC: lsrs r4, r0, 24 cmp r4, 0x13 bls _0814FDFC - bl sound_sources_off + bl InitMapMusic bl map_music_set_to_zero movs r0, 0 bl ResetBgsAndClearDma3BusyFlags @@ -219,7 +219,7 @@ _0814FDFC: movs r0, 0 strh r0, [r1] strh r0, [r2] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r3, 0x87 lsls r3, 3 adds r1, r3 @@ -282,7 +282,7 @@ _0814FE96: movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -301,7 +301,7 @@ _0814FF5C: movs r1, 0 movs r2, 0x80 bl LoadPalette - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r3, 0x87 lsls r3, 3 adds r1, r3 @@ -312,7 +312,7 @@ _0814FF5C: _0814FF7C: bl sub_8150D28 bl RunTasks - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -426,7 +426,7 @@ _0814FFF8: movs r2, 0 movs r3, 0x2 bl CopyToBgTilemapBufferRect_ChangePalette - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -539,7 +539,7 @@ _08150090: movs r2, 0x18 movs r3, 0x17 bl CopyToBgTilemapBufferRect_ChangePalette - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -561,7 +561,7 @@ _08150190: bl sub_80A3194 movs r0, 0x1 bl sub_8150B6C - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r3, 0x87 lsls r3, 3 adds r1, r3 @@ -621,7 +621,7 @@ mainloop: @ 815023C bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl UpdatePaletteFade - bl sound_something + bl MapMusicMain pop {r0} bx r0 thumb_func_end mainloop @@ -1912,7 +1912,7 @@ sub_8150D28: @ 8150D28 add r0, sp, 0xC movs r2, 0x2 bl memcpy - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 mov r9, r0 @@ -1945,7 +1945,7 @@ sub_8150D28: @ 8150D28 cmp r0, 0x1 beq _08150E68 _08150D86: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] add r0, sp @@ -2051,7 +2051,7 @@ _08150E68: movs r2, 0x18 movs r3, 0x1A bl CopyToBgTilemapBufferRect_ChangePalette - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] add r0, sp diff --git a/asm/cable_club.s b/asm/cable_club.s index 1e21e4029..d716e488b 100644 --- a/asm/cable_club.s +++ b/asm/cable_club.s @@ -45,19 +45,19 @@ sub_80B23B0: @ 80B23B0 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r2, 0 movs r3, 0x1 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN lsls r4, 24 lsrs r4, 24 adds r0, r4, 0 movs r1, 0 bl SetStandardWindowBorderStyle - ldr r5, =gUnknown_02021FC4 + ldr r5, =gStringVar4 ldr r1, =gUnknown_085EE667 adds r0, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 adds r1, r5, 0 movs r2, 0x58 @@ -177,7 +177,7 @@ _080B24C8: movs r0, 0x9 b _080B24F2 _080B24CC: - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 bl sub_800ABAC adds r1, r0, 0 lsls r1, 24 @@ -185,7 +185,7 @@ _080B24CC: adds r0, r4, 0 movs r2, 0 movs r3, 0x1 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x4 b _080B24F2 .pool @@ -233,7 +233,7 @@ sub_80B252C: @ 80B252C push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -276,7 +276,7 @@ sub_80B2578: @ 80B2578 movs r0, 0x1 bl sub_800B330 _080B258E: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -525,7 +525,7 @@ sub_80B275C: @ 80B275C adds r0, r4, 0 adds r1, r6, 0 bl sub_80B243C - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -539,11 +539,11 @@ sub_80B275C: @ 80B275C bl sub_800AA04 ldrh r0, [r7, 0xA] bl sub_80B241C - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0 movs r2, 0 movs r3, 0x1 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, =gUnknown_082780F2 bl box_related_two__3 mov r0, r9 @@ -590,7 +590,7 @@ sub_80B2804: @ 80B2804 lsls r0, 24 cmp r4, r0 bne _080B2852 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2C] movs r0, 0x2 ands r0, r1 @@ -755,7 +755,7 @@ _080B2994: adds r0, r5 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r4, 0 adds r1, 0x54 strh r0, [r1] @@ -765,7 +765,7 @@ _080B2994: adds r0, r5 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, 0x56 strh r0, [r4] ldr r0, =sub_80B2C30 @@ -845,7 +845,7 @@ _080B2A6C: adds r0, r5 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r4, 0 adds r1, 0x54 strh r0, [r1] @@ -855,7 +855,7 @@ _080B2A6C: adds r0, r5 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, 0x56 strh r0, [r4] ldr r1, =gTasks @@ -888,10 +888,10 @@ sub_80B2AF4: @ 80B2AF4 str r1, [sp, 0x4] movs r2, 0 movs r7, 0 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 movs r0, 0xFF strb r0, [r1] - ldr r1, =gUnknown_02021DC4 + ldr r1, =gStringVar2 movs r0, 0x1 negs r0, r0 strb r0, [r1] @@ -918,8 +918,8 @@ _080B2B2E: mov r1, r10 muls r1, r0 add r1, r9 - ldr r0, =gUnknown_02021CC4 - bl CopyString + ldr r0, =gStringVar1 + bl StringCopy movs r2, 0x1 _080B2B48: cmp r7, 0x1 @@ -928,8 +928,8 @@ _080B2B48: mov r1, r10 muls r1, r0 add r1, r9 - ldr r0, =gUnknown_02021DC4 - bl CopyString + ldr r0, =gStringVar2 + bl StringCopy movs r2, 0x1 _080B2B5C: adds r7, 0x1 @@ -1234,7 +1234,7 @@ _080B2DEC: .pool _080B2E00: movs r3, 0x2 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 @@ -1270,7 +1270,7 @@ sub_80B2E4C: @ 80B2E4C ldr r2, =0x00001133 adds r0, r2, 0 strh r0, [r1] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0 str r0, [r1] movs r0, 0x2 @@ -1291,7 +1291,7 @@ sub_80B2E74: @ 80B2E74 ldr r2, =0x00003311 adds r0, r2, 0 strh r0, [r1] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0 str r0, [r1] movs r0, 0x2 @@ -1458,7 +1458,7 @@ sub_80B2FD8: @ 80B2FD8 ldr r2, =0x00004411 adds r0, r2, 0 strh r0, [r1] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0 str r0, [r1] movs r0, 0x2 @@ -1476,7 +1476,7 @@ sub_80B3000: @ 80B3000 ldr r2, =0x00006601 adds r0, r2, 0 strh r0, [r1] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0 str r0, [r1] movs r0, 0x4 @@ -1494,7 +1494,7 @@ sub_80B3028: @ 80B3028 ldr r2, =0x00006602 adds r0, r2, 0 strh r0, [r1] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0 str r0, [r1] movs r0, 0x2 @@ -1555,7 +1555,7 @@ _080B30C8: b _080B3124 .pool _080B30D8: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 @@ -1751,23 +1751,23 @@ _080B3270: beq _080B32A0 b _080B32A6 _080B327A: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0xA b _080B32A4 .pool _080B3284: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0xB b _080B32A4 .pool _080B3290: bl sub_80F94E8 - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0x4B b _080B32A4 .pool _080B32A0: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r0, =0x0000014b _080B32A4: str r0, [r1] @@ -1874,7 +1874,7 @@ _080B3378: strh r0, [r1] ldr r0, =sub_8036760 bl SetMainCallback2 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =sub_80B360C str r0, [r1, 0x8] adds r0, r5, 0 @@ -2047,7 +2047,7 @@ _080B3504: strh r0, [r1] ldr r0, =sub_8036760 bl SetMainCallback2 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =sub_80B360C str r0, [r1, 0x8] adds r0, r4, 0 @@ -2062,7 +2062,7 @@ _080B3532: thumb_func_start sub_80B3554 sub_80B3554: @ 80B3554 push {r4,lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -2109,7 +2109,7 @@ _080B35AC: cmp r4, 0 beq _080B35C8 _080B35B0: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -2119,7 +2119,7 @@ _080B35B0: .pool _080B35C8: bl sub_800AC34 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -2150,7 +2150,7 @@ _080B35FE: thumb_func_start sub_80B360C sub_80B360C: @ 80B360C push {r4,r5,lr} - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r0, [r2] movs r1, 0x21 negs r1, r1 @@ -2172,7 +2172,7 @@ sub_80B360C: @ 80B360C movs r5, 0x1 eors r0, r5 bl sub_813C2A0 - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _080B36B2 @@ -2218,12 +2218,12 @@ _080B36B2: bl InUnionRoom cmp r0, 0x1 bne _080B36CC - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =sub_80B3554 b _080B36D0 .pool _080B36CC: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =c2_8056854 _080B36D0: str r0, [r1, 0x8] @@ -2512,7 +2512,7 @@ _080B391C: thumb_func_start sub_80B3924 sub_80B3924: @ 80B3924 push {lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _080B3940 @@ -2552,7 +2552,7 @@ sub_80B3968: @ 80B3968 ldr r2, =0x00002211 adds r0, r2, 0 strh r0, [r1] - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _080B3994 @@ -2601,26 +2601,26 @@ sub_80B39D4: @ 80B39D4 lsrs r4, 24 ldr r0, =gUnknown_020375E4 strh r4, [r0] - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 lsls r1, r4, 3 subs r1, r4 lsls r1, 2 ldr r2, =gUnknown_020229F0 adds r1, r2 - bl CopyString + bl StringCopy adds r0, r4, 0 bl sub_80C4904 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 beq _080B3A28 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r2, =gUnknown_0855059C subs r1, 0x1 lsls r1, 2 adds r1, r2 ldr r1, [r1] - bl CopyString + bl StringCopy movs r0, 0x1 b _080B3A2A .pool @@ -2661,7 +2661,7 @@ _080B3A62: ldrb r0, [r0] cmp r0, 0 beq _080B3AA6 - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _080B3AA0 @@ -2752,7 +2752,7 @@ _080B3B20: beq _080B3B9E b _080B3BB8 _080B3B2A: - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _080B3B40 @@ -2825,7 +2825,7 @@ _080B3BB8: thumb_func_start sub_80B3BC4 sub_80B3BC4: @ 80B3BC4 push {lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _080B3BD6 diff --git a/asm/calculate_base_damage.s b/asm/calculate_base_damage.s index f6c2497a7..379a8c46a 100644 --- a/asm/calculate_base_damage.s +++ b/asm/calculate_base_damage.s @@ -261,7 +261,7 @@ _08069790: mov r0, r9 cmp r0, 0x22 bne _080697C6 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x003f0100 ands r0, r1 @@ -288,7 +288,7 @@ _080697C6: ldr r0, [sp, 0x20] cmp r0, 0x22 bne _080697FC - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x003f0100 ands r0, r1 @@ -621,7 +621,7 @@ _08069A58: bls _08069A60 b _08069BC2 _08069A60: - ldr r0, =gUnknown_02024211 + ldr r0, =gCritMultiplier ldrb r1, [r0] adds r4, r0, 0 cmp r1, 0x2 @@ -728,7 +728,7 @@ _08069B48: ldrb r1, [r4] cmp r1, 0x1 bne _08069B8A - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ands r0, r1 cmp r0, 0 @@ -750,7 +750,7 @@ _08069B84: adds r0, r5, r0 asrs r5, r0, 1 _08069B8A: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -789,7 +789,7 @@ _08069BCA: bhi _08069BD2 b _08069DD4 _08069BD2: - ldr r0, =gUnknown_02024211 + ldr r0, =gCritMultiplier ldrb r1, [r0] adds r4, r0, 0 cmp r1, 0x2 @@ -880,7 +880,7 @@ _08069C76: ldrb r1, [r4] cmp r1, 0x1 bne _08069CCA - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ands r0, r1 cmp r0, 0 @@ -902,7 +902,7 @@ _08069CC4: adds r0, r5, r0 asrs r5, r0, 1 _08069CCA: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -947,7 +947,7 @@ _08069CFC: lsls r0, 24 cmp r0, 0 bne _08069DAC - ldr r2, =gUnknown_020243CC + ldr r2, =gBattleWeather ldrh r1, [r2] movs r0, 0x1 ands r0, r1 diff --git a/asm/clear_save_data_screen.s b/asm/clear_save_data_screen.s index dce70330f..118c6f4f7 100644 --- a/asm/clear_save_data_screen.s +++ b/asm/clear_save_data_screen.s @@ -158,7 +158,7 @@ sub_817ADF4: @ 817ADF4 sub_817AE00: @ 817AE00 push {r4,lr} sub sp, 0xC - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -301,7 +301,7 @@ _0817AEEC: bl EnableInterrupts ldr r0, =sub_817ADF4 bl SetVBlankCallback - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -335,7 +335,7 @@ _0817AFCA: sub_817AFD4: @ 817AFD4 push {r4,lr} sub sp, 0x4 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r4, r0, r1 @@ -364,7 +364,7 @@ _0817B008: cmp r0, 0 bne _0817B020 bl FreeAllWindowBuffers - bl Reset + bl DoSoftReset _0817B020: add sp, 0x4 pop {r4} diff --git a/asm/clock.s b/asm/clock.s new file mode 100644 index 000000000..fff679dfc --- /dev/null +++ b/asm/clock.s @@ -0,0 +1,175 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_809E778 +sub_809E778: @ 809E778 + push {lr} + ldr r0, =0x00000895 + bl FlagSet + bl GameFreakRTC_CalcLocalDateTime + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + adds r2, 0xA0 + ldr r3, =gUnknown_03005CF8 + ldr r0, [r3] + ldr r1, [r3, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + ldr r0, =0x00004040 + ldrh r1, [r3] + bl VarSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E778 + + thumb_func_start sub_809E7B0 +sub_809E7B0: @ 809E7B0 + push {r4,lr} + ldr r0, =0x00000895 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0809E7DA + bl sub_813B9C0 + lsls r0, 24 + cmp r0, 0 + bne _0809E7DA + bl GameFreakRTC_CalcLocalDateTime + ldr r4, =gUnknown_03005CF8 + adds r0, r4, 0 + bl sub_809E7E8 + adds r0, r4, 0 + bl sub_809E858 +_0809E7DA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E7B0 + + thumb_func_start sub_809E7E8 +sub_809E7E8: @ 809E7E8 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r0, =0x00004040 + bl GetVarPointer + adds r6, r0, 0 + ldrh r0, [r6] + movs r2, 0 + ldrsh r1, [r5, r2] + cmp r0, r1 + beq _0809E84E + cmp r0, r1 + bgt _0809E84E + ldrh r4, [r5] + subs r4, r0 + lsls r4, 16 + lsrs r4, 16 + bl sub_809D3A0 + adds r0, r4, 0 + bl sub_8122580 + adds r0, r4, 0 + bl sub_80ED888 + adds r0, r4, 0 + bl sub_80AEFBC + adds r0, r4, 0 + bl sub_806DE44 + adds r0, r4, 0 + bl sub_8137904 + adds r0, r4, 0 + bl sub_8137A20 + adds r0, r4, 0 + bl sub_8139EF4 + adds r0, r4, 0 + bl sub_813A7F4 + adds r0, r4, 0 + bl sub_813945C + adds r0, r4, 0 + bl sub_8177584 + ldrh r0, [r5] + strh r0, [r6] +_0809E84E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E7E8 + + thumb_func_start sub_809E858 +sub_809E858: @ 809E858 + push {r4-r6,lr} + sub sp, 0x8 + adds r5, r0, 0 + mov r4, sp + ldr r6, =gSaveBlock2Ptr + ldr r1, [r6] + adds r1, 0xA0 + mov r0, sp + adds r2, r5, 0 + bl GameFreakRTC_GetDelta + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + lsls r0, r1, 1 + adds r0, r1 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 5 + movs r2, 0x2 + ldrsb r2, [r4, r2] + lsls r0, r2, 4 + subs r0, r2 + lsls r0, 2 + adds r1, r0 + movs r0, 0x3 + ldrsb r0, [r4, r0] + adds r0, r1, r0 + cmp r0, 0 + beq _0809E8A8 + cmp r0, 0 + blt _0809E8A8 + bl BerryTreeTimeUpdate + ldr r2, [r6] + adds r2, 0xA0 + ldr r0, [r5] + ldr r1, [r5, 0x4] + str r0, [r2] + str r1, [r2, 0x4] +_0809E8A8: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E858 + + thumb_func_start sub_809E8B4 +sub_809E8B4: @ 809E8B4 + push {lr} + bl sub_809E778 + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E8B4 + + thumb_func_start Special_StartWallClock +Special_StartWallClock: @ 809E8C8 + push {lr} + ldr r0, =Cb2_StartWallClock + bl SetMainCallback2 + ldr r1, =gMain + ldr r0, =sub_809E8B4 + str r0, [r1, 0x8] + pop {r0} + bx r0 + .pool + thumb_func_end Special_StartWallClock + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/coins.s b/asm/coins.s index df0304722..88e515b47 100644 --- a/asm/coins.s +++ b/asm/coins.s @@ -11,14 +11,14 @@ PrintCoinsString: @ 8145B54 push {r4,lr} sub sp, 0xC adds r1, r0, 0 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r2, 0x1 movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E8DAB adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 adds r1, r4, 0 movs r2, 0x40 @@ -110,11 +110,11 @@ HideCoinsWindow: @ 8145C14 thumb_func_start GetCoins @ u16 GetCoins() GetCoins: @ 8145C30 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =0x00000494 adds r1, r0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xAC ldr r0, [r0] @@ -131,9 +131,9 @@ GetCoins: @ 8145C30 SetCoins: @ 8145C58 lsls r0, 16 lsrs r0, 16 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] adds r1, 0xAC ldr r1, [r1] diff --git a/asm/contest.s b/asm/contest.s index 25cf1062d..b4286013e 100644 --- a/asm/contest.s +++ b/asm/contest.s @@ -523,7 +523,7 @@ sub_80D7A5C: @ 80D7A5C thumb_func_start sub_80D7B24 sub_80D7B24: @ 80D7B24 push {r4-r6,lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r6, r0, r1 @@ -850,7 +850,7 @@ sub_80D7DE8: @ 80D7DE8 adds r0, r5 ldr r1, =sub_80D80C8 str r1, [r0] - ldr r1, =gUnknown_03005D80 + ldr r1, =gRngValue ldr r0, =gUnknown_030060B8 ldr r0, [r0] str r0, [r1] @@ -1056,11 +1056,11 @@ _080D8004: strb r3, [r1, 0x2] movs r2, 0x2 strb r2, [r1, 0x3] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags str r4, [r0] ldr r4, =gUnknown_0202420B strb r2, [r4] - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex strb r3, [r0] bl sub_80DB0C4 ldr r2, =gUnknown_020241E4 @@ -1400,7 +1400,7 @@ sub_80D833C: @ 80D833C ldr r1, =0x84000100 str r1, [r0, 0x8] ldr r0, [r0, 0x8] - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_02039F34 ldr r1, [r1] ldr r1, [r1] @@ -1408,7 +1408,7 @@ sub_80D833C: @ 80D833C adds r1, 0x1 movs r2, 0 movs r3, 0x1 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, =gUnknown_02039F25 ldrb r0, [r0] bl sub_80DBCA8 @@ -1417,19 +1417,19 @@ sub_80D833C: @ 80D833C bne _080D83CC ldr r0, =gUnknown_02022E2C ldr r1, =gUnknown_0827D507 - bl CopyString + bl StringCopy b _080D83D4 .pool _080D83CC: ldr r0, =gUnknown_02022E2C ldr r1, =gUnknown_0827D531 - bl CopyString + bl StringCopy _080D83D4: bl sub_80DB89C - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_02022E2C adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0x1 bl sub_80DEC30 @@ -1463,7 +1463,7 @@ sub_80D8424: @ 80D8424 lsls r0, 24 lsrs r4, r0, 24 adds r5, r4, 0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -1605,7 +1605,7 @@ _080D853C: add r0, sp, 0x4 ldr r1, =gUnknown_085ED1A7 _080D8566: - bl CopyString + bl StringCopy adds r5, r0, 0 _080D856C: movs r0, 0xD @@ -1614,7 +1614,7 @@ _080D856C: ldr r0, =gMoveNames adds r1, r0 adds r0, r5, 0 - bl CopyString + bl StringCopy adds r4, r6, 0x5 lsls r0, r4, 24 lsrs r0, 24 @@ -1677,7 +1677,7 @@ sub_80D8610: @ 80D8610 lsls r0, 24 lsrs r7, r0, 24 movs r6, 0 - ldr r3, =gUnknown_030022C0 + ldr r3, =gMain ldr r1, =gUnknown_02039E00 ldr r0, =gUnknown_02039F25 ldrb r0, [r0] @@ -1737,7 +1737,7 @@ _080D868E: bl audio_play movs r0, 0 bl sub_80DC490 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_02039F34 ldr r1, [r1] ldr r1, [r1] @@ -1745,7 +1745,7 @@ _080D868E: adds r1, 0x1 movs r2, 0 movs r3, 0x1 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, =gUnknown_02039F25 ldrb r0, [r0] bl sub_80DBCA8 @@ -1754,19 +1754,19 @@ _080D868E: bne _080D86DC ldr r0, =gUnknown_02022E2C ldr r1, =gUnknown_0827D507 - bl CopyString + bl StringCopy b _080D86E4 .pool _080D86DC: ldr r0, =gUnknown_02022E2C ldr r1, =gUnknown_0827D531 - bl CopyString + bl StringCopy _080D86E4: bl sub_80DB89C - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_02022E2C adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0 bl sub_80DEC30 @@ -2191,7 +2191,7 @@ sub_80D8A88: @ 80D8A88 strb r0, [r1, 0x10] ldr r0, [r2] ldr r1, [r0] - ldr r0, =gUnknown_03005D80 + ldr r0, =gRngValue ldr r0, [r0] str r0, [r1, 0x18] ldr r0, =gUnknown_02039F2A @@ -2622,11 +2622,11 @@ _080D8EC8: bl _080DA100 _080D8EF2: bl sub_80DB89C - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 lsls r1, r6, 6 ldr r2, =gUnknown_02039E02 adds r1, r2 - bl CopyString + bl StringCopy mov r2, r9 ldr r0, [r2] ldr r0, [r0, 0x4] @@ -2636,28 +2636,28 @@ _080D8EF2: lsls r0, 1 cmp r1, r0 bhi _080D8F38 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r2, r1, 0 movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 - bl CopyString + bl StringCopy b _080D8F48 .pool _080D8F38: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r2, =gUnknown_08587F1C ldrb r1, [r3, 0xA] lsls r1, 2 adds r1, r2 ldr r1, [r1] - bl CopyString + bl StringCopy _080D8F48: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_0827D55A adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0x1 bl sub_80DEC30 @@ -3560,15 +3560,15 @@ _080D96AE: beq _080D96F6 _080D96D4: bl sub_80DB89C - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 lsls r1, r6, 6 ldr r2, =gUnknown_02039E02 adds r1, r2 - bl CopyString - ldr r4, =gUnknown_02021FC4 + bl StringCopy + ldr r4, =gStringVar4 ldr r1, =gUnknown_0827E793 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0x1 bl sub_80DEC30 @@ -3669,15 +3669,15 @@ _080D97BC: .pool _080D97DC: bl sub_80DB89C - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 lsls r1, r6, 6 ldr r2, =gUnknown_02039E02 adds r1, r2 - bl CopyString - ldr r4, =gUnknown_02021FC4 + bl StringCopy + ldr r4, =gStringVar4 ldr r1, =gUnknown_0827E2FE adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0x1 bl sub_80DEC30 @@ -3807,15 +3807,15 @@ _080D9904: cmp r0, 0 beq _080D996C bl sub_80DB89C - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 lsls r1, r6, 6 ldr r2, =gUnknown_02039E02 adds r1, r2 - bl CopyString - ldr r4, =gUnknown_02021FC4 + bl StringCopy + ldr r4, =gStringVar4 ldr r1, =gUnknown_0827E6E3 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0x1 bl sub_80DEC30 @@ -3965,17 +3965,17 @@ _080D9A56: beq _080D9A94 movs r4, 0x1 str r4, [sp] - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldrh r2, [r5, 0x6] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 - bl CopyString + bl StringCopy b _080D9AAE .pool _080D9A94: - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldr r3, =gUnknown_08587F08 ldr r2, =gContestMoves ldrh r1, [r5, 0x6] @@ -3986,7 +3986,7 @@ _080D9A94: lsrs r1, 27 adds r1, r3 ldr r1, [r1] - bl CopyString + bl StringCopy _080D9AAE: ldr r5, [sp] lsls r0, r5, 24 @@ -4008,11 +4008,11 @@ _080D9AAE: str r3, [sp] _080D9AD2: bl sub_80DB89C - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 lsls r1, r6, 6 ldr r2, =gUnknown_02039E02 adds r1, r2 - bl CopyString + bl StringCopy ldr r4, =gUnknown_02039F34 ldr r0, [r4] ldr r1, [r0] @@ -4042,9 +4042,9 @@ _080D9B06: _080D9B30: cmp r3, 0 bge _080D9B48 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_0827E73C - bl ExpandStringRefs + bl StringExpandPlaceholders b _080D9B74 .pool _080D9B48: @@ -4057,17 +4057,17 @@ _080D9B48: asrs r0, 24 cmp r0, 0x4 bgt _080D9B6C - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_0827E717 - bl ExpandStringRefs + bl StringExpandPlaceholders b _080D9B74 .pool _080D9B6C: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_0827E76A - bl ExpandStringRefs + bl StringExpandPlaceholders _080D9B74: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 movs r1, 0x1 bl sub_80DEC30 ldr r1, =gTasks @@ -4373,7 +4373,7 @@ _080D9DC2: .pool _080D9DD4: bl sub_80DB89C - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldr r5, =gUnknown_02039F34 ldr r1, [r5] ldr r1, [r1, 0x10] @@ -4383,12 +4383,12 @@ _080D9DD4: lsls r1, 6 ldr r4, =gUnknown_02039E02 adds r1, r4 - bl CopyString - ldr r0, =gUnknown_02021CC4 + bl StringCopy + ldr r0, =gStringVar1 lsls r1, r6, 6 adds r1, r4 - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 ldr r1, [r5] ldr r2, [r1, 0x4] lsls r1, r6, 3 @@ -4400,11 +4400,11 @@ _080D9DD4: muls r1, r2 ldr r2, =gMoveNames adds r1, r2 - bl CopyString - ldr r4, =gUnknown_02021FC4 + bl StringCopy + ldr r4, =gStringVar4 ldr r1, =gUnknown_0827E7EA adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0x1 bl sub_80DEC30 @@ -4425,10 +4425,10 @@ _080D9E60: b _080DA100 _080D9E6A: bl sub_80DB89C - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_0827E817 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0x1 bl sub_80DEC30 @@ -4474,12 +4474,12 @@ _080D9EBC: _080D9EDC: adds r0, r6, 0 bl sub_80DC9B4 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 lsls r1, r6, 6 ldr r2, =gUnknown_02039E02 adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 mov r2, r9 ldr r1, [r2] ldr r1, [r1, 0x4] @@ -4489,11 +4489,11 @@ _080D9EDC: muls r1, r2 ldr r2, =gMoveNames adds r1, r2 - bl CopyString - ldr r4, =gUnknown_02021FC4 + bl StringCopy + ldr r4, =gStringVar4 ldr r1, =gUnknown_0827E58A adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0x1 bl sub_80DEC30 @@ -4624,15 +4624,15 @@ _080DA024: b _080DA100 _080DA038: bl sub_80DB89C - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 lsls r1, r6, 6 ldr r2, =gUnknown_02039E02 adds r1, r2 - bl CopyString - ldr r4, =gUnknown_02021FC4 + bl StringCopy + ldr r4, =gStringVar4 ldr r1, =gUnknown_0827D56F adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0x1 bl sub_80DEC30 @@ -5093,19 +5093,19 @@ sub_80DA3CC: @ 80DA3CC adds r0, r2 ldrb r4, [r0, 0x1A] bl sub_80DB89C - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrb r1, [r5] lsls r1, 6 ldr r2, =gUnknown_02039E02 adds r1, r2 - bl CopyString - ldr r5, =gUnknown_02021FC4 + bl StringCopy + ldr r5, =gStringVar4 ldr r0, =gUnknown_08587D90 lsls r4, 2 adds r4, r0 ldr r1, [r4] adds r0, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r5, 0 movs r1, 0x1 bl sub_80DEC30 @@ -5369,13 +5369,13 @@ _080DA65C: bl sub_80DF750 _080DA668: ldr r1, =gUnknown_030060B8 - ldr r0, =gUnknown_03005D80 + ldr r0, =gRngValue ldr r0, [r0] str r0, [r1] - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_0827D597 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0x1 bl sub_80DEC30 @@ -5651,10 +5651,10 @@ sub_80DA8C8: @ 80DA8C8 lsls r0, 24 lsrs r0, 24 mov r8, r0 - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r1, [r6] mov r0, sp - bl CopyString + bl StringCopy ldr r0, =gUnknown_02039F2A ldrb r1, [r0] movs r0, 0x1 @@ -5706,11 +5706,11 @@ _080DA930: movs r0, 0x64 mov r1, r8 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r1, r0 adds r0, r5, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData ldrb r1, [r6] lsls r1, 6 adds r1, r7 @@ -5718,9 +5718,9 @@ _080DA930: adds r0, r5, 0 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData mov r0, sp - bl GetStringEnd_Limit7 + bl StringGetEnd10 ldr r0, =gUnknown_02039F2A ldrb r1, [r0] movs r0, 0x1 @@ -5729,7 +5729,7 @@ _080DA930: beq _080DA994 adds r0, r5, 0 movs r1, 0x3 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 mov r0, sp bl sub_80DF9E0 @@ -5745,10 +5745,10 @@ _080DA994: lsls r0, 6 adds r0, r4 mov r1, sp - bl CopyString + bl StringCopy adds r0, r5, 0 movs r1, 0x16 - bl pokemon_getattr + bl GetMonData ldrb r1, [r6] lsls r1, 6 adds r1, r7 @@ -5756,7 +5756,7 @@ _080DA994: strb r0, [r1] adds r0, r5, 0 movs r1, 0x17 - bl pokemon_getattr + bl GetMonData ldrb r1, [r6] lsls r1, 6 adds r1, r7 @@ -5764,7 +5764,7 @@ _080DA994: strb r0, [r1] adds r0, r5, 0 movs r1, 0x18 - bl pokemon_getattr + bl GetMonData ldrb r1, [r6] lsls r1, 6 adds r1, r7 @@ -5772,7 +5772,7 @@ _080DA994: strb r0, [r1] adds r0, r5, 0 movs r1, 0x21 - bl pokemon_getattr + bl GetMonData ldrb r1, [r6] lsls r1, 6 adds r1, r7 @@ -5780,7 +5780,7 @@ _080DA994: strb r0, [r1] adds r0, r5, 0 movs r1, 0x2F - bl pokemon_getattr + bl GetMonData ldrb r1, [r6] lsls r1, 6 adds r1, r7 @@ -5788,7 +5788,7 @@ _080DA994: strb r0, [r1] adds r0, r5, 0 movs r1, 0x30 - bl pokemon_getattr + bl GetMonData ldrb r1, [r6] lsls r1, 6 adds r1, r7 @@ -5796,35 +5796,35 @@ _080DA994: strb r0, [r1] adds r0, r5, 0 movs r1, 0xD - bl pokemon_getattr + bl GetMonData ldrb r1, [r6] lsls r1, 6 adds r1, r7 strh r0, [r1, 0x1E] adds r0, r5, 0 movs r1, 0xE - bl pokemon_getattr + bl GetMonData ldrb r1, [r6] lsls r1, 6 adds r1, r7 strh r0, [r1, 0x20] adds r0, r5, 0 movs r1, 0xF - bl pokemon_getattr + bl GetMonData ldrb r1, [r6] lsls r1, 6 adds r1, r7 strh r0, [r1, 0x22] adds r0, r5, 0 movs r1, 0x10 - bl pokemon_getattr + bl GetMonData ldrb r1, [r6] lsls r1, 6 adds r1, r7 strh r0, [r1, 0x24] adds r0, r5, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData ldrb r1, [r6] lsls r1, 6 adds r2, r7, 0 @@ -5833,7 +5833,7 @@ _080DA994: str r0, [r1] adds r0, r5, 0 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData ldrb r1, [r6] lsls r1, 6 adds r2, r7, 0 @@ -5842,7 +5842,7 @@ _080DA994: str r0, [r1] adds r0, r5, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r2, r0, 16 ldrb r0, [r6] @@ -6072,7 +6072,7 @@ _080DAC3A: movs r5, 0 ldr r7, =gUnknown_085880A4 _080DAC50: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r6, 0 @@ -6299,7 +6299,7 @@ sub_80DAE0C: @ 80DAE0C push {r4,lr} adds r4, r0, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _080DAE1E movs r0, 0x3 @@ -6307,7 +6307,7 @@ sub_80DAE0C: @ 80DAE0C _080DAE1E: adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _080DAE2E movs r0, 0x4 @@ -6350,7 +6350,7 @@ _080DAE74: adds r0, r4, 0 movs r1, 0x36 _080DAE78: - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r1, r0, 24 b _080DAE86 @@ -6408,13 +6408,13 @@ sub_80DAED4: @ 80DAED4 lsrs r4, 24 ldr r0, =gUnknown_02022E2C ldr r1, =gUnknown_085ED1AB - bl CopyString + bl StringCopy adds r1, r0, 0 subs r0, r1, 0x1 strb r4, [r0] adds r0, r1, 0 adds r1, r5, 0 - bl CopyString + bl StringCopy adds r1, r0, 0 pop {r4,r5} pop {r1} @@ -6449,12 +6449,12 @@ sub_80DAF1C: @ 80DAF1C lsrs r4, 24 ldr r1, =gUnknown_085E8D3E add r0, sp, 0x4 - bl CopyString + bl StringCopy lsls r1, r5, 6 ldr r0, =gUnknown_02039E0D adds r1, r0 add r0, sp, 0x4 - bl AppendString + bl StringAppend add r0, sp, 0x4 adds r1, r4, 0 bl sub_80DAED4 @@ -8264,7 +8264,7 @@ sub_80DBD4C: @ 80DBD4C str r6, [sp, 0x6C] mov r4, sp _080DBD7A: - bl GenerateRandomNumber + bl Random strh r0, [r4] movs r2, 0 cmp r2, r9 @@ -8448,7 +8448,7 @@ sub_80DBED4: @ 80DBED4 ands r0, r1 cmp r0, 0 beq _080DBF0E - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r1, =gUnknown_02039F20 ldr r0, =gUnknown_02039F25 @@ -9930,7 +9930,7 @@ sub_80DC9EC: @ 80DC9EC movs r0, 0 movs r1, 0x3 adds r2, r4, 0 - bl rfu_MBOOT_CHILD_inheritanceLinkStatus + bl CopySpriteTiles ldrb r0, [r6] lsls r3, r0, 2 adds r3, r0 @@ -9943,7 +9943,7 @@ sub_80DC9EC: @ 80DC9EC movs r0, 0 movs r1, 0x3 adds r2, r4, 0 - bl rfu_MBOOT_CHILD_inheritanceLinkStatus + bl CopySpriteTiles movs r4, 0 str r4, [sp, 0x4] ldr r0, [r7] @@ -10297,7 +10297,7 @@ _080DCD92: lsrs r4, r0, 16 adds r0, r2, 0 ldr r1, =gUnknown_085E8D40 - bl CopyString + bl StringCopy adds r2, r0, 0 _080DCDBC: lsls r1, r4, 16 @@ -10305,7 +10305,7 @@ _080DCDBC: adds r0, r2, 0 movs r2, 0 movs r3, 0x4 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, =gUnknown_02039F26 adds r0, r5, r0 ldrb r0, [r0] @@ -10340,7 +10340,7 @@ _080DCDEA: lsrs r4, r0, 16 adds r0, r2, 0 ldr r1, =gUnknown_085E8D40 - bl CopyString + bl StringCopy adds r2, r0, 0 _080DCE14: lsls r1, r4, 16 @@ -10348,7 +10348,7 @@ _080DCE14: adds r0, r2, 0 movs r2, 0 movs r3, 0x4 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, =gUnknown_02039F26 adds r0, r5, r0 ldrb r0, [r0] @@ -10393,7 +10393,7 @@ sub_80DCE58: @ 80DCE58 adds r6, r4, 0 movs r7, 0 _080DCE7E: - bl GenerateRandomNumber + bl Random adds r1, r0, 0 mov r0, sp adds r0, r7 @@ -11048,7 +11048,7 @@ _080DD388: movs r0, 0 _080DD38A: strb r0, [r3, 0x2] - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -11171,12 +11171,12 @@ sub_80DD45C: @ 80DD45C lsrs r4, 24 lsls r1, 24 lsrs r6, r1, 24 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 lsls r1, r4, 6 ldr r2, =gUnknown_02039E02 adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 ldr r5, =gUnknown_02039F34 ldr r1, [r5] ldr r2, [r1, 0x4] @@ -11189,7 +11189,7 @@ sub_80DD45C: @ 80DD45C muls r1, r2 ldr r2, =gMoveNames adds r1, r2 - bl CopyString + bl StringCopy ldr r3, =gContestMoves ldr r1, [r5] ldr r0, [r1, 0x8] @@ -11206,50 +11206,50 @@ sub_80DD45C: @ 80DD45C lsls r1, r0, 29 cmp r1, 0 bne _080DD4DC - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldr r1, =gUnknown_0827E837 - bl CopyString + bl StringCopy b _080DD52C .pool _080DD4DC: lsrs r0, r1, 29 cmp r0, 0x1 bne _080DD4F4 - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldr r1, =gUnknown_0827E83F - bl CopyString + bl StringCopy b _080DD52C .pool _080DD4F4: lsrs r0, r1, 29 cmp r0, 0x2 bne _080DD50C - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldr r1, =gUnknown_0827E847 - bl CopyString + bl StringCopy b _080DD52C .pool _080DD50C: lsrs r0, r1, 29 cmp r0, 0x3 bne _080DD524 - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldr r1, =gUnknown_0827E850 - bl CopyString + bl StringCopy b _080DD52C .pool _080DD524: - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldr r1, =gUnknown_0827E85A - bl CopyString + bl StringCopy _080DD52C: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_08587E10 lsls r0, r6, 2 adds r0, r1 ldr r1, [r0] adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders bl sub_80DB89C adds r0, r4, 0 movs r1, 0x1 @@ -13795,10 +13795,10 @@ sub_80DE9DC: @ 80DE9DC sub_80DEA20: @ 80DEA20 push {lr} ldr r0, =DummyObjectCallback - bl object_new_hidden_with_callback + bl CreateInvisibleSpriteWithCallback ldr r1, =gUnknown_020241E4 strb r0, [r1, 0x3] - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] @@ -13905,12 +13905,12 @@ _080DEAD0: .4byte _080DEB60 .4byte _080DEB60 _080DEB54: - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex movs r0, 0x2 b _080DEB64 .pool _080DEB60: - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex movs r0, 0x3 _080DEB64: strb r0, [r1] @@ -14191,7 +14191,7 @@ sub_80DED60: @ 80DED60 sub_80DED74: @ 80DED74 push {r4-r6,lr} movs r0, 0 - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r5, =0x00000624 movs r4, 0 _080DED7E: @@ -14227,7 +14227,7 @@ sub_80DEDA8: @ 80DEDA8 lsls r0, 24 lsrs r0, 24 str r0, [sp] - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -14308,7 +14308,7 @@ _080DEE54: lsls r0, 24 lsrs r0, 24 mov r9, r0 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr mov r10, r2 ldr r0, [r2] mov r3, r9 @@ -14342,7 +14342,7 @@ _080DEE54: adds r0, 0xB adds r1, r4, 0x2 adds r1, r5, r1 - bl CopyString + bl StringCopy mov r2, r10 ldr r0, [r2] adds r0, r6 @@ -14350,7 +14350,7 @@ _080DEE54: adds r4, 0xD adds r5, r4 adds r1, r5, 0 - bl CopyString + bl StringCopy ldr r0, =gUnknown_02039F2A ldrb r1, [r0] movs r0, 0x1 @@ -14378,7 +14378,7 @@ _080DEF02: ldr r0, [sp] cmp r0, 0xFF beq _080DEF34 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] mov r2, r9 lsls r1, r2, 5 @@ -14391,7 +14391,7 @@ _080DEF02: b _080DEF8E .pool _080DEF34: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] mov r2, r9 lsls r1, r2, 5 @@ -14423,13 +14423,13 @@ _080DEF50: adds r0, 0xB adds r1, r4, 0x2 adds r1, r5, r1 - bl CopyString + bl StringCopy adds r0, r6, 0 adds r0, 0x16 adds r4, 0xD adds r5, r4 adds r1, r5, 0 - bl CopyString + bl StringCopy mov r2, r8 strb r2, [r6, 0xA] _080DEF8E: @@ -14460,7 +14460,7 @@ sub_80DEFA8: @ 80DEFA8 cmp r1, 0 beq _080DEFE6 movs r2, 0x5 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr mov r12, r0 ldr r4, =0x00002e90 ldr r3, =0x00002e70 @@ -14526,7 +14526,7 @@ _080DF03A: sub_80DF040: @ 80DF040 push {r4-r7,lr} movs r2, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr mov r12, r0 ldr r4, =0x00002e90 ldr r3, =gUnknown_08587FA4 @@ -15122,7 +15122,7 @@ _080DF4B6: cmp r0, r7 bne _080DF478 _080DF4C0: - bl GenerateRandomNumber + bl Random ldr r1, =gUnknown_02039F34 ldr r1, [r1] ldr r4, [r1, 0x1C] @@ -15246,7 +15246,7 @@ _080DF5A0: subs r3, 0x1 cmp r3, 0 bge _080DF592 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r4, 0 @@ -15351,7 +15351,7 @@ _080DF67C: cmp r3, 0x3 ble _080DF644 _080DF682: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r5, 0 @@ -15508,7 +15508,7 @@ _080DF784: _080DF7AE: add r0, sp, 0x4 ldr r1, =gUnknown_085ED1B2 - bl CopyString + bl StringCopy adds r5, r0, 0 ldr r0, =gUnknown_02039F26 adds r0, r7, r0 @@ -15534,7 +15534,7 @@ _080DF7DE: adds r0, r5, 0 movs r2, 0 movs r3, 0x1 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r5, r0, 0 lsrs r4, 1 lsls r0, r6, 24 @@ -15605,7 +15605,7 @@ _080DF874: _080DF884: add r0, sp, 0x4 ldr r1, =gUnknown_085ED1B5 - bl CopyString + bl StringCopy ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r1, [r0, 0x1C] @@ -15622,7 +15622,7 @@ _080DF8A0: adds r0, r5, 0 movs r2, 0 movs r3, 0x1 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r5, r0, 0 lsrs r4, 1 lsls r0, r6, 24 @@ -15708,7 +15708,7 @@ sub_80DF940: @ 80DF940 b _080DF9CC _080DF956: adds r0, r4, 0 - bl GetStringLength + bl StringLength lsls r0, 16 lsrs r0, 16 cmp r0, 0x5 @@ -15789,7 +15789,7 @@ sub_80DF9E0: @ 80DF9E0 push {r4,r5,lr} adds r5, r0, 0 adds r4, r1, 0 - bl StripExtendedControlCodes + bl StripExtCtrlCodes cmp r4, 0x1 bne _080DF9F8 movs r0, 0xFF @@ -15822,7 +15822,7 @@ sub_80DFA08: @ 80DFA08 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString b _080DFA3E _080DFA28: ldrb r0, [r4, 0xA] @@ -15830,7 +15830,7 @@ _080DFA28: bne _080DFA38 adds r0, r4, 0 movs r1, 0x1 - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString b _080DFA3E _080DFA38: strb r0, [r4, 0x5] diff --git a/asm/contest_ai.s b/asm/contest_ai.s index fc3d48507..f28492886 100644 --- a/asm/contest_ai.s +++ b/asm/contest_ai.s @@ -95,7 +95,7 @@ _0815634A: _0815636A: movs r6, 0x3 _0815636C: - bl GenerateRandomNumber + bl Random adds r5, r0, 0 ands r5, r6 ldr r4, =gUnknown_02039F34 @@ -143,7 +143,7 @@ sub_81563B0: @ 81563B0 cmp r0, 0x2 beq _081564A0 adds r7, r5, 0 - ldr r6, =gUnknown_0203AB38 + ldr r6, =gAIScriptPtr ldr r0, =gUnknown_02039E1E mov r8, r0 _081563CC: @@ -295,7 +295,7 @@ sub_81564DC: @ 81564DC adds r1, r0, 0x5 ldrb r0, [r0, 0x4] adds r1, r0 - ldr r2, =gUnknown_0203AB38 + ldr r2, =gAIScriptPtr ldr r0, [r2] ldrb r0, [r0, 0x1] lsls r0, 24 @@ -337,7 +337,7 @@ sub_8156530: @ 8156530 ldr r0, [r0] ldrb r0, [r0, 0x1] strh r0, [r1, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -354,7 +354,7 @@ sub_8156550: @ 8156550 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -389,7 +389,7 @@ sub_8156594: @ 8156594 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -424,7 +424,7 @@ sub_81565D8: @ 81565D8 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -459,7 +459,7 @@ sub_815661C: @ 815661C ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -495,7 +495,7 @@ sub_8156660: @ 8156660 lsls r0, 24 asrs r0, 24 strh r0, [r1, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -512,7 +512,7 @@ sub_8156684: @ 8156684 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -547,7 +547,7 @@ sub_81566C8: @ 81566C8 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -582,7 +582,7 @@ sub_815670C: @ 815670C ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -617,7 +617,7 @@ sub_8156750: @ 8156750 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -655,7 +655,7 @@ sub_8156794: @ 8156794 adds r0, r1 ldrb r0, [r0] strh r0, [r2, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -672,7 +672,7 @@ sub_81567BC: @ 81567BC ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -707,7 +707,7 @@ sub_8156800: @ 8156800 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -742,7 +742,7 @@ sub_8156844: @ 8156844 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -777,7 +777,7 @@ sub_8156888: @ 8156888 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -825,7 +825,7 @@ sub_81568CC: @ 81568CC lsls r0, 24 asrs r0, 24 strh r0, [r4, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -844,7 +844,7 @@ sub_815690C: @ 815690C ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -879,7 +879,7 @@ sub_8156950: @ 8156950 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -914,7 +914,7 @@ sub_8156994: @ 8156994 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -949,7 +949,7 @@ sub_81569D8: @ 81569D8 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -990,7 +990,7 @@ sub_8156A1C: @ 8156A1C adds r0, r2 ldrh r0, [r0, 0x4] strh r0, [r3, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -1005,7 +1005,7 @@ sub_8156A48: @ 8156A48 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3] ldrb r0, [r3, 0x1] @@ -1046,7 +1046,7 @@ sub_8156A98: @ 8156A98 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3] ldrb r0, [r3, 0x1] @@ -1087,7 +1087,7 @@ sub_8156AE8: @ 8156AE8 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3] ldrb r0, [r3, 0x1] @@ -1128,7 +1128,7 @@ sub_8156B38: @ 8156B38 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3] ldrb r0, [r3, 0x1] @@ -1175,7 +1175,7 @@ sub_8156B88: @ 8156B88 adds r0, r1 ldrh r0, [r0] strh r0, [r2, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -1190,7 +1190,7 @@ sub_8156BB4: @ 8156BB4 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3] ldrb r0, [r3, 0x1] @@ -1231,7 +1231,7 @@ sub_8156C04: @ 8156C04 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3] ldrb r0, [r3, 0x1] @@ -1272,7 +1272,7 @@ sub_8156C54: @ 8156C54 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3] ldrb r0, [r3, 0x1] @@ -1313,7 +1313,7 @@ sub_8156CA4: @ 8156CA4 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3] ldrb r0, [r3, 0x1] @@ -1355,7 +1355,7 @@ sub_8156CF4: @ 8156CF4 ldr r0, =gUnknown_02039F2C ldrh r0, [r0] strh r0, [r1, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -1372,7 +1372,7 @@ sub_8156D18: @ 8156D18 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -1407,7 +1407,7 @@ sub_8156D5C: @ 8156D5C ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -1455,7 +1455,7 @@ sub_8156DA0: @ 8156DA0 lsls r0, 24 asrs r0, 24 strh r0, [r1, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -1472,7 +1472,7 @@ sub_8156DE4: @ 8156DE4 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r0, [r0, 0xC] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] movs r4, 0x18 ldrsh r1, [r0, r4] @@ -1509,7 +1509,7 @@ sub_8156E2C: @ 8156E2C ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r0, [r0, 0xC] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] movs r4, 0x18 ldrsh r1, [r0, r4] @@ -1546,7 +1546,7 @@ sub_8156E74: @ 8156E74 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r0, [r0, 0xC] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] movs r4, 0x18 ldrsh r1, [r0, r4] @@ -1583,7 +1583,7 @@ sub_8156EBC: @ 8156EBC ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r0, [r0, 0xC] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] movs r4, 0x18 ldrsh r1, [r0, r4] @@ -1634,7 +1634,7 @@ sub_8156F04: @ 8156F04 adds r0, r1 ldrb r0, [r0] strh r0, [r3, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -1651,7 +1651,7 @@ sub_8156F44: @ 8156F44 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -1686,7 +1686,7 @@ sub_8156F88: @ 8156F88 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -1737,7 +1737,7 @@ sub_8156FCC: @ 8156FCC adds r0, r2 ldrb r0, [r0] strh r0, [r3, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -1754,7 +1754,7 @@ sub_8157018: @ 8157018 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -1789,7 +1789,7 @@ sub_815705C: @ 815705C ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -1840,7 +1840,7 @@ sub_81570A0: @ 81570A0 adds r0, r3 ldrb r7, [r0, 0x1] movs r6, 0 - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr mov r12, r0 adds r1, r2 _081570D4: @@ -1894,7 +1894,7 @@ sub_815712C: @ 815712C ldrsh r0, [r0, r1] cmp r0, 0 beq _08157164 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -1910,7 +1910,7 @@ sub_815712C: @ 815712C b _0815716C .pool _08157164: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -1945,7 +1945,7 @@ sub_8157174: @ 8157174 adds r0, r3 ldrb r7, [r0, 0x2] movs r6, 0 - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr mov r12, r0 adds r1, r2 _081571A8: @@ -1999,7 +1999,7 @@ sub_8157200: @ 8157200 ldrsh r0, [r0, r1] cmp r0, 0 beq _08157238 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] @@ -2015,7 +2015,7 @@ sub_8157200: @ 8157200 b _08157240 .pool _08157238: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x5 str r0, [r1] @@ -2055,7 +2055,7 @@ sub_8157248: @ 8157248 lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -2074,7 +2074,7 @@ sub_81572A4: @ 81572A4 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -2109,7 +2109,7 @@ sub_81572E8: @ 81572E8 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -2144,7 +2144,7 @@ sub_815732C: @ 815732C ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -2179,7 +2179,7 @@ sub_8157370: @ 8157370 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -2235,7 +2235,7 @@ sub_81573B4: @ 81573B4 lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -2254,7 +2254,7 @@ sub_8157410: @ 8157410 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -2289,7 +2289,7 @@ sub_8157454: @ 8157454 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -2324,7 +2324,7 @@ sub_8157498: @ 8157498 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -2359,7 +2359,7 @@ sub_81574DC: @ 81574DC ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -2421,7 +2421,7 @@ _08157560: ldr r0, [r5] ldr r0, [r0, 0xC] strh r1, [r0, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -2440,7 +2440,7 @@ sub_8157578: @ 8157578 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -2475,7 +2475,7 @@ sub_81575BC: @ 81575BC ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -2510,7 +2510,7 @@ sub_8157600: @ 8157600 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -2545,7 +2545,7 @@ sub_8157644: @ 8157644 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -2623,7 +2623,7 @@ _081576DE: ldr r0, [r0] ldr r0, [r0, 0xC] strh r3, [r0, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -2644,7 +2644,7 @@ sub_8157700: @ 8157700 ldrsh r0, [r0, r1] cmp r0, 0 beq _08157738 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -2660,7 +2660,7 @@ sub_8157700: @ 8157700 b _08157740 .pool _08157738: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -2681,7 +2681,7 @@ sub_8157748: @ 8157748 ldrsh r0, [r0, r1] cmp r0, 0 bne _08157780 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -2697,7 +2697,7 @@ sub_8157748: @ 8157748 b _08157788 .pool _08157780: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -2758,7 +2758,7 @@ _081577E4: ldr r0, [r0] ldr r0, [r0, 0xC] strh r3, [r0, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -2779,7 +2779,7 @@ sub_8157808: @ 8157808 ldrsh r0, [r0, r1] cmp r0, 0 beq _08157840 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -2795,7 +2795,7 @@ sub_8157808: @ 8157808 b _08157848 .pool _08157840: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -2816,7 +2816,7 @@ sub_8157850: @ 8157850 ldrsh r0, [r0, r1] cmp r0, 0 bne _08157888 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -2832,7 +2832,7 @@ sub_8157850: @ 8157850 b _08157890 .pool _08157888: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -2879,7 +2879,7 @@ _081578D6: ldr r0, [r6] ldr r0, [r0, 0xC] strh r5, [r0, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -2900,7 +2900,7 @@ sub_81578F8: @ 81578F8 ldrsh r0, [r0, r1] cmp r0, 0 beq _08157930 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -2916,7 +2916,7 @@ sub_81578F8: @ 81578F8 b _08157938 .pool _08157930: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -2937,7 +2937,7 @@ sub_8157940: @ 8157940 ldrsh r0, [r0, r1] cmp r0, 0 bne _08157978 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -2953,7 +2953,7 @@ sub_8157940: @ 8157940 b _08157980 .pool _08157978: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -2966,7 +2966,7 @@ _08157980: thumb_func_start sub_8157988 sub_8157988: @ 8157988 push {r4,r5,lr} - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r0, [r4] ldrb r0, [r0, 0x1] bl sub_81564AC @@ -3005,7 +3005,7 @@ sub_81579CC: @ 81579CC ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -3040,7 +3040,7 @@ sub_8157A10: @ 8157A10 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -3075,7 +3075,7 @@ sub_8157A54: @ 8157A54 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -3110,7 +3110,7 @@ sub_8157A98: @ 8157A98 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -3140,7 +3140,7 @@ _08157AD8: sub_8157ADC: @ 8157ADC push {r4-r6,lr} movs r6, 0 - ldr r5, =gUnknown_0203AB38 + ldr r5, =gAIScriptPtr ldr r0, [r5] ldrb r0, [r0, 0x1] bl sub_81564AC @@ -3189,7 +3189,7 @@ sub_8157B38: @ 8157B38 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -3224,7 +3224,7 @@ sub_8157B7C: @ 8157B7C ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -3259,7 +3259,7 @@ sub_8157BC0: @ 8157BC0 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -3294,7 +3294,7 @@ sub_8157C04: @ 8157C04 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -3323,7 +3323,7 @@ _08157C44: thumb_func_start sub_8157C48 sub_8157C48: @ 8157C48 push {lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r0, [r0] ldrb r0, [r0, 0x1] bl sub_81564AC @@ -3346,7 +3346,7 @@ _08157C74: movs r0, 0x1 _08157C7C: strh r0, [r1, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x2 str r0, [r1] @@ -3366,7 +3366,7 @@ sub_8157C94: @ 8157C94 ldrsh r0, [r0, r1] cmp r0, 0 beq _08157CCC - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -3382,7 +3382,7 @@ sub_8157C94: @ 8157C94 b _08157CD4 .pool _08157CCC: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -3403,7 +3403,7 @@ sub_8157CDC: @ 8157CDC ldrsh r0, [r0, r1] cmp r0, 0 bne _08157D14 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -3419,7 +3419,7 @@ sub_8157CDC: @ 8157CDC b _08157D1C .pool _08157D14: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -3432,7 +3432,7 @@ _08157D1C: thumb_func_start sub_8157D24 sub_8157D24: @ 8157D24 push {r4,lr} - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r0, [r4] ldrb r0, [r0, 0x1] bl sub_81564AC @@ -3470,7 +3470,7 @@ sub_8157D60: @ 8157D60 ldrsh r0, [r0, r1] cmp r0, 0 beq _08157D98 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -3486,7 +3486,7 @@ sub_8157D60: @ 8157D60 b _08157DA0 .pool _08157D98: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -3507,7 +3507,7 @@ sub_8157DA8: @ 8157DA8 ldrsh r0, [r0, r1] cmp r0, 0 bne _08157DE0 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -3523,7 +3523,7 @@ sub_8157DA8: @ 8157DA8 b _08157DE8 .pool _08157DE0: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -3536,7 +3536,7 @@ _08157DE8: thumb_func_start sub_8157DF0 sub_8157DF0: @ 8157DF0 push {r4,r5,lr} - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r0, [r4] ldrb r0, [r0, 0x1] bl sub_81564AC @@ -3581,7 +3581,7 @@ sub_8157E3C: @ 8157E3C ldrsh r0, [r0, r1] cmp r0, 0 bge _08157E74 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -3597,7 +3597,7 @@ sub_8157E3C: @ 8157E3C b _08157E7C .pool _08157E74: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -3618,7 +3618,7 @@ sub_8157E84: @ 8157E84 ldrsh r0, [r0, r1] cmp r0, 0 ble _08157EBC - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -3634,7 +3634,7 @@ sub_8157E84: @ 8157E84 b _08157EC4 .pool _08157EBC: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -3655,7 +3655,7 @@ sub_8157ECC: @ 8157ECC ldrsh r0, [r0, r1] cmp r0, 0 bne _08157F04 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -3671,7 +3671,7 @@ sub_8157ECC: @ 8157ECC b _08157F0C .pool _08157F04: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -3692,7 +3692,7 @@ sub_8157F14: @ 8157F14 ldrsh r0, [r0, r1] cmp r0, 0 beq _08157F4C - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -3708,7 +3708,7 @@ sub_8157F14: @ 8157F14 b _08157F54 .pool _08157F4C: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -3721,7 +3721,7 @@ _08157F54: thumb_func_start sub_8157F5C sub_8157F5C: @ 8157F5C push {r4,lr} - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r0, [r4] ldrb r0, [r0, 0x1] bl sub_81564AC @@ -3761,7 +3761,7 @@ sub_8157FA0: @ 8157FA0 ldrsh r0, [r0, r1] cmp r0, 0 bge _08157FD8 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -3777,7 +3777,7 @@ sub_8157FA0: @ 8157FA0 b _08157FE0 .pool _08157FD8: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -3798,7 +3798,7 @@ sub_8157FE8: @ 8157FE8 ldrsh r0, [r0, r1] cmp r0, 0 ble _08158020 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -3814,7 +3814,7 @@ sub_8157FE8: @ 8157FE8 b _08158028 .pool _08158020: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -3835,7 +3835,7 @@ sub_8158030: @ 8158030 ldrsh r0, [r0, r1] cmp r0, 0 bne _08158068 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -3851,7 +3851,7 @@ sub_8158030: @ 8158030 b _08158070 .pool _08158068: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -3872,7 +3872,7 @@ sub_8158078: @ 8158078 ldrsh r0, [r0, r1] cmp r0, 0 beq _081580B0 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -3888,7 +3888,7 @@ sub_8158078: @ 8158078 b _081580B8 .pool _081580B0: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -3901,7 +3901,7 @@ _081580B8: thumb_func_start sub_81580C0 sub_81580C0: @ 81580C0 push {r4,r5,lr} - ldr r5, =gUnknown_0203AB38 + ldr r5, =gAIScriptPtr ldr r0, [r5] ldrb r0, [r0, 0x1] bl sub_81564AC @@ -3940,7 +3940,7 @@ sub_8158108: @ 8158108 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -3975,7 +3975,7 @@ sub_815814C: @ 815814C ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -4010,7 +4010,7 @@ sub_8158190: @ 8158190 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -4045,7 +4045,7 @@ sub_81581D4: @ 81581D4 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -4074,7 +4074,7 @@ _08158214: thumb_func_start sub_8158218 sub_8158218: @ 8158218 push {r4,r5,lr} - ldr r5, =gUnknown_0203AB38 + ldr r5, =gAIScriptPtr ldr r0, [r5] ldrb r0, [r0, 0x1] bl sub_81564AC @@ -4110,7 +4110,7 @@ sub_8158254: @ 8158254 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -4145,7 +4145,7 @@ sub_8158298: @ 8158298 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -4180,7 +4180,7 @@ sub_81582DC: @ 81582DC ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -4215,7 +4215,7 @@ sub_8158320: @ 8158320 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -4244,7 +4244,7 @@ _08158360: thumb_func_start sub_8158364 sub_8158364: @ 8158364 push {r4,r5,lr} - ldr r5, =gUnknown_0203AB38 + ldr r5, =gAIScriptPtr ldr r0, [r5] ldrb r0, [r0, 0x1] bl sub_81564AC @@ -4287,7 +4287,7 @@ sub_81583B8: @ 81583B8 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -4322,7 +4322,7 @@ sub_81583FC: @ 81583FC ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -4354,7 +4354,7 @@ sub_8158440: @ 8158440 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r3, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r2, [r4] ldrb r0, [r2, 0x1] lsls r0, 1 @@ -4377,7 +4377,7 @@ sub_815846C: @ 815846C ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r3, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r2, [r4] ldrb r0, [r2, 0x1] lsls r0, 1 @@ -4402,7 +4402,7 @@ sub_815849C: @ 815849C ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r0, [r3, 0x1] lsls r0, 1 @@ -4430,7 +4430,7 @@ sub_81584D4: @ 81584D4 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3, 0x1] lsls r1, 1 @@ -4457,7 +4457,7 @@ sub_8158508: @ 8158508 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3, 0x1] lsls r1, 1 @@ -4484,7 +4484,7 @@ sub_815853C: @ 815853C ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r1, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r0, [r3, 0x1] lsls r0, 1 @@ -4527,7 +4527,7 @@ sub_815858C: @ 815858C ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r1, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r0, [r3, 0x1] lsls r0, 1 @@ -4570,7 +4570,7 @@ sub_81585DC: @ 81585DC ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r1, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r0, [r3, 0x1] lsls r0, 1 @@ -4613,7 +4613,7 @@ sub_815862C: @ 815862C ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r1, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r0, [r3, 0x1] lsls r0, 1 @@ -4656,7 +4656,7 @@ sub_815867C: @ 815867C ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3, 0x1] lsls r1, 1 @@ -4699,7 +4699,7 @@ sub_81586D0: @ 81586D0 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3, 0x1] lsls r1, 1 @@ -4742,7 +4742,7 @@ sub_8158724: @ 8158724 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3, 0x1] lsls r1, 1 @@ -4785,7 +4785,7 @@ sub_8158778: @ 8158778 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3, 0x1] lsls r1, 1 @@ -4825,13 +4825,13 @@ _081587C4: thumb_func_start sub_81587CC sub_81587CC: @ 81587CC push {r4,r5,lr} - bl GenerateRandomNumber + bl Random movs r2, 0xFF ands r2, r0 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r1, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r0, [r3, 0x1] lsls r0, 1 @@ -4866,13 +4866,13 @@ _08158814: thumb_func_start sub_815881C sub_815881C: @ 815881C push {r4,r5,lr} - bl GenerateRandomNumber + bl Random movs r2, 0xFF ands r2, r0 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r1, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r0, [r3, 0x1] lsls r0, 1 @@ -4906,7 +4906,7 @@ _08158864: thumb_func_start sub_815886C sub_815886C: @ 815886C - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] @@ -4926,7 +4926,7 @@ sub_815886C: @ 815886C thumb_func_start dp15_call dp15_call: @ 815888C push {r4,lr} - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r0, [r4] adds r0, 0x5 bl sub_81588E0 @@ -5007,7 +5007,7 @@ sub_8158908: @ 8158908 _08158924: subs r0, 0x1 strb r0, [r1] - ldr r2, =gUnknown_0203AB38 + ldr r2, =gAIScriptPtr ldr r0, [r3] ldr r1, [r0, 0xC] adds r0, r1, 0 @@ -5061,7 +5061,7 @@ _08158986: ldr r0, [r0] ldr r0, [r0, 0xC] strh r5, [r0, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -5082,7 +5082,7 @@ sub_81589A4: @ 81589A4 ldrsh r0, [r0, r1] cmp r0, 0 beq _081589DC - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -5098,7 +5098,7 @@ sub_81589A4: @ 81589A4 b _081589E4 .pool _081589DC: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -5119,7 +5119,7 @@ sub_81589EC: @ 81589EC ldrsh r0, [r0, r1] cmp r0, 0 bne _08158A24 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -5135,7 +5135,7 @@ sub_81589EC: @ 81589EC b _08158A2C .pool _08158A24: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -5149,7 +5149,7 @@ _08158A2C: sub_8158A34: @ 8158A34 push {r4-r6,lr} movs r6, 0 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r0, [r3] ldrb r5, [r0, 0x1] ldrb r0, [r0, 0x2] @@ -5212,7 +5212,7 @@ sub_8158AA0: @ 8158AA0 ldrsh r0, [r0, r1] cmp r0, 0 beq _08158AD8 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -5228,7 +5228,7 @@ sub_8158AA0: @ 8158AA0 b _08158AE0 .pool _08158AD8: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -5249,7 +5249,7 @@ sub_8158AE8: @ 8158AE8 ldrsh r0, [r0, r1] cmp r0, 0 bne _08158B20 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -5265,7 +5265,7 @@ sub_8158AE8: @ 8158AE8 b _08158B28 .pool _08158B20: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] diff --git a/asm/contest_effect.s b/asm/contest_effect.s index 36cafdb38..09c06b079 100644 --- a/asm/contest_effect.s +++ b/asm/contest_effect.s @@ -394,7 +394,7 @@ _080E56C6: thumb_func_start ContestEffectFunc_080E56E0 ContestEffectFunc_080E56E0: @ 80E56E0 push {lr} - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xA @@ -450,7 +450,7 @@ _080E5736: ldr r1, [r0, 0x8] movs r0, 0xFF strb r0, [r1, 0x9] - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xA @@ -1071,7 +1071,7 @@ _080E5BD2: beq _080E5CA0 mov r4, sp _080E5C16: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -1636,7 +1636,7 @@ _080E6060: thumb_func_start ContestEffectFunc_080E6068 ContestEffectFunc_080E6068: @ 80E6068 push {r4,lr} - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xA @@ -2467,7 +2467,7 @@ _080E6680: movs r6, 0 adds r7, r5, 0 _080E66AA: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 lsls r2, r6, 24 diff --git a/asm/contest_link_80F57C4.s b/asm/contest_link_80F57C4.s index 7a8141c6e..08eb2359c 100644 --- a/asm/contest_link_80F57C4.s +++ b/asm/contest_link_80F57C4.s @@ -285,12 +285,12 @@ sub_80F5A74: @ 80F5A74 bne _080F5A96 ldr r1, =gUnknown_085ED21E adds r0, r6, 0 - bl CopyString + bl StringCopy adds r6, r0, 0 _080F5A96: adds r1, r7, 0x2 adds r0, r6, 0 - bl CopyString + bl StringCopy ldr r4, =gUnknown_02022E2C adds r0, r5, 0 adds r1, r4, 0 @@ -298,11 +298,11 @@ _080F5A96: bl sub_80F7ED0 ldr r1, =gUnknown_085E8D3E adds r0, r6, 0 - bl CopyString + bl StringCopy adds r1, r7, 0 adds r1, 0xD adds r0, r6, 0 - bl AppendString + bl StringAppend adds r0, r5, 0 adds r1, r4, 0 movs r2, 0x32 @@ -1238,7 +1238,7 @@ _080F6334: movs r4, 0 ldr r1, =gUnknown_02039F20 ldrb r0, [r1] - ldr r7, =gUnknown_02021CC4 + ldr r7, =gStringVar1 ldr r2, =gUnknown_02039E0D mov r8, r2 cmp r0, 0 @@ -1256,18 +1256,18 @@ _080F636E: mov r0, r8 adds r1, r4, r0 adds r0, r7, 0 - bl CopyString + bl StringCopy adds r0, r7, 0 bl sub_81DB5AC - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 mov r1, r8 subs r1, 0xB adds r4, r1 adds r1, r4, 0 - bl CopyString + bl StringCopy ldr r1, =gUnknown_085ED1FA mov r0, sp - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r0, =gUnknown_0203A034 ldr r0, [r0] ldr r0, [r0] @@ -1616,7 +1616,7 @@ sub_80F66B4: @ 80F66B4 push {r4-r7,lr} lsls r0, 24 lsrs r7, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r2, 0x1 adds r0, r2, 0 @@ -3565,7 +3565,7 @@ sub_80F7670: @ 80F7670 cmp r0, 0x27 bhi _080F7732 ldr r4, =gUnknown_0858D860 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xF0 @@ -3581,7 +3581,7 @@ sub_80F7670: @ 80F7670 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - bl GenerateRandomNumber + bl Random ldr r1, =gUnknown_02020630 lsls r5, r4, 4 adds r5, r4 @@ -3590,21 +3590,21 @@ sub_80F7670: @ 80F7670 lsls r0, 23 lsrs r0, 23 strh r0, [r5, 0x2E] - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x18 bl __umodsi3 adds r0, 0x10 strh r0, [r5, 0x30] - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xFF ands r0, r1 adds r0, 0x30 strh r0, [r5, 0x32] - bl GenerateRandomNumber + bl Random ldrh r6, [r5, 0x4] lsls r4, r6, 22 lsrs r4, 22 @@ -3656,7 +3656,7 @@ sub_80F7768: @ 80F7768 asrs r0, 24 movs r2, 0x30 ldrsh r1, [r4, r2] - bl sine + bl Sin strh r0, [r4, 0x24] ldrh r1, [r4, 0x32] ldrh r0, [r4, 0x36] @@ -4632,7 +4632,7 @@ sub_80F7F30: @ 80F7F30 ldrb r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 bl sub_80DAE0C lsls r0, 24 @@ -4664,7 +4664,7 @@ sub_80F7F7C: @ 80F7F7C ldrb r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r2, r1, r0 ldr r0, =gUnknown_02039F2C ldrh r0, [r0] @@ -4703,7 +4703,7 @@ _080F7FDC: adds r0, r2, 0 movs r1, 0x36 _080F7FE0: - bl pokemon_getattr + bl GetMonData ldr r1, =gUnknown_02039F2E ldrh r1, [r1] cmp r0, r1 @@ -4754,10 +4754,10 @@ _080F8048: ldrb r0, [r6] movs r5, 0x64 muls r0, r5 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 movs r1, 0x32 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r1, r0, 24 mov r0, sp @@ -4805,10 +4805,10 @@ _080F80B8: ldrb r0, [r7] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5 movs r1, 0x33 - bl pokemon_getattr + bl GetMonData strb r0, [r4] mov r0, sp ldrb r2, [r0] @@ -4854,10 +4854,10 @@ _080F8124: ldrb r0, [r7] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5 movs r1, 0x34 - bl pokemon_getattr + bl GetMonData strb r0, [r4] mov r0, sp ldrb r2, [r0] @@ -4901,10 +4901,10 @@ _080F8190: ldrb r0, [r7] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5 movs r1, 0x35 - bl pokemon_getattr + bl GetMonData strb r0, [r4] mov r0, sp ldrb r2, [r0] @@ -4944,10 +4944,10 @@ _080F81F8: ldrb r0, [r7] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5 movs r1, 0x36 - bl pokemon_getattr + bl GetMonData strb r0, [r4] mov r0, sp ldrb r2, [r0] @@ -4990,14 +4990,14 @@ _080F8250: thumb_func_start sub_80F8264 sub_80F8264: @ 80F8264 push {r4,lr} - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 ldr r0, =gUnknown_020375E4 ldrh r1, [r0] lsls r1, 6 ldr r0, =gUnknown_02039E0D adds r1, r0 adds r0, r4, 0 - bl CopyString + bl StringCopy adds r0, r4, 0 bl sub_81DB5AC pop {r4} @@ -5009,13 +5009,13 @@ sub_80F8264: @ 80F8264 thumb_func_start sub_80F8290 sub_80F8290: @ 80F8290 push {lr} - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldr r1, =gUnknown_020375E4 ldrh r1, [r1] lsls r1, 6 ldr r2, =gUnknown_02039E02 adds r1, r2 - bl CopyString + bl StringCopy pop {r0} bx r0 .pool @@ -5103,7 +5103,7 @@ sub_80F834C: @ 80F834C movs r1, 0 ldr r2, =gUnknown_02039F20 ldrb r0, [r2] - ldr r4, =gUnknown_02021EC4 + ldr r4, =gStringVar3 ldr r3, =gUnknown_02039E0D cmp r0, 0 beq _080F836E @@ -5121,7 +5121,7 @@ _080F836E: lsls r1, 6 adds r1, r3 adds r0, r4, 0 - bl CopyString + bl StringCopy adds r0, r4, 0 bl sub_81DB5AC pop {r4} @@ -5136,7 +5136,7 @@ sub_80F8390: @ 80F8390 movs r1, 0 ldr r2, =gUnknown_02039F20 ldrb r0, [r2] - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 ldr r3, =gUnknown_02039E02 cmp r0, 0 beq _080F83B2 @@ -5154,7 +5154,7 @@ _080F83B2: lsls r1, 6 adds r1, r3 adds r0, r4, 0 - bl CopyString + bl StringCopy pop {r4} pop {r0} bx r0 @@ -5582,14 +5582,14 @@ _080F8748: movs r4, 0x3 _080F874C: adds r0, r5, 0 - bl GetStringEnd_Limit7 + bl StringGetEnd10 adds r5, 0x40 subs r4, 0x1 cmp r4, 0 bge _080F874C adds r0, r6, 0 bl DestroyTask - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x4 ldrsb r1, [r0, r1] diff --git a/asm/contest_link_80FC4F4.s b/asm/contest_link_80FC4F4.s index ea9ebe2c8..d3984fb0d 100644 --- a/asm/contest_link_80FC4F4.s +++ b/asm/contest_link_80FC4F4.s @@ -147,7 +147,7 @@ sub_80FC5DC: @ 80FC5DC ldr r1, =gUnknown_02039F2A movs r0, 0x1 strb r0, [r1] - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0x1 bne _080FC60C @@ -416,7 +416,7 @@ _080FC830: lsls r0, 24 cmp r0, 0 beq _080FC880 - ldr r0, =gUnknown_03005D80 + ldr r0, =gRngValue movs r1, 0x4 bl sub_80FC4F4 cmp r0, 0x1 @@ -429,7 +429,7 @@ _080FC858: lsls r0, 24 cmp r0, 0 beq _080FC880 - ldr r0, =gUnknown_03005D80 + ldr r0, =gRngValue ldr r4, =gUnknown_020223C4 adds r1, r4, 0 movs r2, 0x4 diff --git a/asm/contest_painting.s b/asm/contest_painting.s index d0c98eb01..d0fe69d18 100644 --- a/asm/contest_painting.s +++ b/asm/contest_painting.s @@ -10,7 +10,7 @@ sub_812FDA8: @ 812FDA8 push {r4-r7,lr} ldr r3, =gUnknown_02039F5D ldr r4, =gUnknown_02039F5C - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] subs r0, 0x1 lsls r1, r0, 5 @@ -54,7 +54,7 @@ sub_812FDF8: @ 812FDF8 thumb_func_start sub_812FE0C sub_812FE0C: @ 812FE0C push {r4,r5,lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r0, [r0, 0x8] bl SetMainCallback2 ldr r4, =gUnknown_030061C4 @@ -83,7 +83,7 @@ sub_812FE0C: @ 812FE0C sub_812FE58: @ 812FE58 push {r4-r7,lr} sub sp, 0x4 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 @@ -117,7 +117,7 @@ _0812FE94: movs r0, 0x1 bl sub_8130238 bl sub_81301EC - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -161,7 +161,7 @@ _0812FEE2: _0812FF14: ldrh r0, [r4, 0x20] bl SeedRng - bl InitKeypadData + bl InitKeys bl sub_8130098 movs r0, 0x87 lsls r0, 3 @@ -174,7 +174,7 @@ _0812FF2A: ldrb r1, [r1] bl sub_8130884 _0812FF36: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -265,7 +265,7 @@ _0812FFFA: b _08130080 .pool _0813001C: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r2, [r0, 0x2E] ands r1, r2 cmp r1, 0 @@ -379,13 +379,13 @@ sub_813010C: @ 813010C ldrb r5, [r1, 0xA] cmp r0, 0x7 bhi _08130190 - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 adds r0, r4, 0 adds r1, r5, 0 bl sub_818E868 ldr r1, =gUnknown_085E8D5E adds r0, r4, 0 - bl AppendString + bl StringAppend ldr r1, =gUnknown_085B07D4 ldr r0, [r6] ldrb r0, [r0, 0x1E] @@ -393,35 +393,35 @@ sub_813010C: @ 813010C adds r0, r1 ldr r1, [r0] adds r0, r4, 0 - bl AppendString - ldr r4, =gUnknown_02021DC4 + bl StringAppend + ldr r4, =gStringVar2 ldr r1, [r6] adds r1, 0x16 adds r0, r4, 0 - bl CopyString + bl StringCopy adds r0, r4, 0 bl sub_81DB5AC - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldr r1, [r6] adds r1, 0xB - bl CopyString - ldr r0, =gUnknown_02021FC4 + bl StringCopy + ldr r0, =gStringVar4 ldr r1, =gUnknown_0827EA0C - bl ExpandStringRefs + bl StringExpandPlaceholders b _081301A6 .pool _08130190: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, 0xB - bl CopyString - ldr r0, =gUnknown_02021FC4 + bl StringCopy + ldr r0, =gStringVar4 ldr r2, =gUnknown_085B07F4 lsls r1, r5, 2 adds r1, r2 ldr r1, [r1] - bl ExpandStringRefs + bl StringExpandPlaceholders _081301A6: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 movs r0, 0x1 adds r1, r4, 0 movs r2, 0xD0 @@ -961,7 +961,7 @@ sub_8130688: @ 8130688 push {lr} lsls r0, 24 lsrs r0, 24 - ldr r3, =gUnknown_030022C0 + ldr r3, =gMain ldr r1, =gUnknown_085B0830 ldr r2, [r1, 0x4] ldr r1, [r1] diff --git a/asm/coord_event_weather.s b/asm/coord_event_weather.s new file mode 100644 index 000000000..7c1188ad6 --- /dev/null +++ b/asm/coord_event_weather.s @@ -0,0 +1,156 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_809D7BC +sub_809D7BC: @ 809D7BC + push {lr} + movs r0, 0x1 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D7BC + + thumb_func_start sub_809D7C8 +sub_809D7C8: @ 809D7C8 + push {lr} + movs r0, 0x2 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D7C8 + + thumb_func_start sub_809D7D4 +sub_809D7D4: @ 809D7D4 + push {lr} + movs r0, 0x3 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D7D4 + + thumb_func_start sub_809D7E0 +sub_809D7E0: @ 809D7E0 + push {lr} + movs r0, 0x4 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D7E0 + + thumb_func_start sub_809D7EC +sub_809D7EC: @ 809D7EC + push {lr} + movs r0, 0x5 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D7EC + + thumb_func_start sub_809D7F8 +sub_809D7F8: @ 809D7F8 + push {lr} + movs r0, 0x6 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D7F8 + + thumb_func_start sub_809D804 +sub_809D804: @ 809D804 + push {lr} + movs r0, 0x9 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D804 + + thumb_func_start sub_809D810 +sub_809D810: @ 809D810 + push {lr} + movs r0, 0x7 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D810 + + thumb_func_start sub_809D81C +sub_809D81C: @ 809D81C + push {lr} + movs r0, 0x8 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D81C + + thumb_func_start sub_809D828 +sub_809D828: @ 809D828 + push {lr} + movs r0, 0xB + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D828 + + thumb_func_start sub_809D834 +sub_809D834: @ 809D834 + push {lr} + movs r0, 0xC + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D834 + + thumb_func_start sub_809D840 +sub_809D840: @ 809D840 + push {lr} + movs r0, 0x14 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D840 + + thumb_func_start sub_809D84C +sub_809D84C: @ 809D84C + push {lr} + movs r0, 0x15 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D84C + + thumb_func_start trigger_activate_weather +trigger_activate_weather: @ 809D858 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r2, 0 + ldr r3, =gUnknown_085102E0 +_0809D862: + lsls r1, r2, 3 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r4 + bne _0809D87C + adds r0, r3, 0x4 + adds r0, r1, r0 + ldr r0, [r0] + bl _call_via_r0 + b _0809D886 + .pool +_0809D87C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xC + bls _0809D862 +_0809D886: + pop {r4} + pop {r0} + bx r0 + thumb_func_end trigger_activate_weather + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/credits.s b/asm/credits.s new file mode 100644 index 000000000..0365a34d7 --- /dev/null +++ b/asm/credits.s @@ -0,0 +1,3903 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_81754C8 +sub_81754C8: @ 81754C8 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_81754C8 + + thumb_func_start sub_81754DC +sub_81754DC: @ 81754DC + push {lr} + bl RunTasks + bl CallObjectCallbacks + ldr r0, =gMain + ldrh r1, [r0, 0x2C] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08175522 + ldr r0, =gUnknown_0203BCE4 + ldrb r0, [r0] + cmp r0, 0 + beq _08175522 + ldr r2, =gTasks + ldr r0, =gUnknown_0203BCE2 + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, [r0] + ldr r0, =sub_8175774 + cmp r1, r0 + bne _08175522 + bl sub_81754C8 + bl RunTasks + bl CallObjectCallbacks + ldr r1, =gUnknown_0203BCE5 + movs r0, 0x1 + strb r0, [r1] +_08175522: + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r0} + bx r0 + .pool + thumb_func_end sub_81754DC + + thumb_func_start sub_8175548 +sub_8175548: @ 8175548 + push {lr} + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085E6F68 + movs r0, 0 + movs r2, 0x1 + bl InitBgsFromTemplates + movs r0, 0x80 + lsls r0, 4 + bl AllocZeroed + adds r1, r0, 0 + movs r0, 0 + bl SetBgTilemapBuffer + ldr r0, =gUnknown_085E56F0 + movs r1, 0x80 + movs r2, 0x40 + bl gpu_pal_apply + ldr r0, =gUnknown_085E6F6C + bl InitWindows + bl DeactivateAllTextPrinters + movs r0, 0 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0 + bl ShowBg + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175548 + + thumb_func_start sub_81755A4 +sub_81755A4: @ 81755A4 + push {lr} + bl FreeAllWindowBuffers + movs r0, 0 + bl GetBgTilemapBuffer + cmp r0, 0 + beq _081755B8 + bl Free +_081755B8: + pop {r0} + bx r0 + thumb_func_end sub_81755A4 + + thumb_func_start sub_81755BC +sub_81755BC: @ 81755BC + push {r4,r5,lr} + sub sp, 0x18 + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r2, 24 + add r1, sp, 0x14 + movs r0, 0 + strb r0, [r1] + cmp r2, 0x1 + bne _081755DC + movs r0, 0x3 + strb r0, [r1, 0x1] + movs r0, 0x4 + b _081755E4 +_081755DC: + add r1, sp, 0x14 + movs r0, 0x1 + strb r0, [r1, 0x1] + movs r0, 0x2 +_081755E4: + strb r0, [r1, 0x2] + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xF0 + movs r3, 0x1 + bl GetStringCenterAlignXOffsetWithLetterSpacing + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + add r0, sp, 0x14 + str r0, [sp, 0x8] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0xC] + str r4, [sp, 0x10] + movs r0, 0 + movs r1, 0x1 + adds r3, r5, 0 + bl AddTextPrinterParametrized2 + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81755BC + + thumb_func_start sub_8175620 +sub_8175620: @ 8175620 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + bl sub_8175CE4 + movs r0, 0 + bl SetVBlankCallback + ldr r0, =0x02000000 + movs r1, 0xE0 + lsls r1, 9 + bl InitHeap + bl sub_80A1A74 + bl ResetTasks + bl sub_8175548 + ldr r0, =sub_8175744 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x10] + strh r1, [r0, 0x16] + strh r1, [r0, 0x1E] + movs r1, 0x1 + strh r1, [r0, 0x22] +_0817566A: + movs r0, 0 + adds r1, r7, 0 + bl sub_8176AB0 + lsls r0, 24 + cmp r0, 0 + beq _0817566A + ldr r5, =gTasks + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r5 + movs r0, 0xA + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r1, 0 + mov r8, r1 + movs r6, 0 + movs r1, 0x28 + strh r1, [r0, 0x8] + ldr r1, =0x0000fffc + movs r0, 0x12 + bl SetGpuReg + ldr r0, =sub_8175DA0 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r5 + strh r7, [r1, 0xA] + strh r0, [r4, 0x26] + movs r0, 0x1 + negs r0, r0 + str r6, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r0, 0x1 + bl EnableInterrupts + ldr r0, =sub_81754C8 + bl SetVBlankCallback + ldr r0, =0x000001c7 + bl m4aSongNumStart + ldr r0, =sub_81754DC + bl SetMainCallback2 + ldr r0, =gUnknown_0203BCE5 + mov r1, r8 + strb r1, [r0] + ldr r4, =gUnknown_0203BCE8 + movs r0, 0xEB + lsls r0, 2 + bl AllocZeroed + str r0, [r4] + bl sub_8177388 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x8E + strh r6, [r0] + adds r0, 0x2 + strh r6, [r0] + adds r0, 0x2 + strh r6, [r0] + ldr r0, =gUnknown_0203BCE2 + strh r7, [r0] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175620 + + thumb_func_start sub_8175744 +sub_8175744: @ 8175744 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08175764 + ldr r0, =gTasks + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_8175774 + str r0, [r1] +_08175764: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175744 + + thumb_func_start sub_8175774 +sub_8175774: @ 8175774 + push {r4,lr} + sub sp, 0x4 + 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, 0x10 + ldrsh r1, [r4, r0] + cmp r1, 0 + beq _081757B0 + movs r3, 0xA + ldrsh r1, [r4, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x1E + strh r1, [r0, 0x8] + movs r0, 0x80 + lsls r0, 1 + strh r0, [r4, 0x20] + ldr r0, =sub_8175A9C + b _081757FA + .pool +_081757B0: + ldr r0, =gUnknown_0203BCE0 + strh r1, [r0] + ldrh r2, [r4, 0x1E] + movs r3, 0x1E + ldrsh r0, [r4, r3] + cmp r0, 0x1 + bne _081757E0 + strh r2, [r4, 0x22] + strh r1, [r4, 0x1E] + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =sub_8175808 + b _081757FA + .pool +_081757E0: + cmp r0, 0x2 + bne _081757FC + strh r2, [r4, 0x22] + strh r1, [r4, 0x1E] + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =sub_81758A4 +_081757FA: + str r0, [r4] +_081757FC: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175774 + + thumb_func_start sub_8175808 +sub_8175808: @ 8175808 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08175836 + movs r0, 0 + movs r1, 0 + bl SetGpuReg + adds r0, r4, 0 + bl sub_8176CA0 + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =c2_080C9BFC + str r0, [r1] +_08175836: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175808 + + thumb_func_start c2_080C9BFC +c2_080C9BFC: @ 8175848 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + bl SetVBlankCallback + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r5, r0, r1 + ldrb r0, [r5, 0x16] + adds r1, r4, 0 + bl sub_8176AB0 + lsls r0, 24 + cmp r0, 0 + beq _08175890 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r0, 0x1 + bl EnableInterrupts + ldr r0, =sub_81754C8 + bl SetVBlankCallback + ldr r0, =sub_8175744 + str r0, [r5] +_08175890: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end c2_080C9BFC + + thumb_func_start sub_81758A4 +sub_81758A4: @ 81758A4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081758D2 + movs r0, 0 + movs r1, 0 + bl SetGpuReg + adds r0, r4, 0 + bl sub_8176CA0 + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81758E4 + str r0, [r1] +_081758D2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81758A4 + + thumb_func_start sub_81758E4 +sub_81758E4: @ 81758E4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =gMain + movs r1, 0x87 + lsls r1, 3 + adds r1, r0 + mov r8, r1 + ldrb r7, [r1] + cmp r7, 0 + beq _08175906 + cmp r7, 0x1 + beq _081759F0 +_08175906: + bl ResetAllObjectData + bl dp13_810BB8C + bl ResetObjectPaletteAllocator + ldr r1, =gUnknown_0300301C + movs r0, 0x8 + strb r0, [r1] + ldr r0, =gUnknown_085B0E04 + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, =gUnknown_085B0C0C + ldr r1, =0x06003800 + bl LZ77UnCompVram + ldr r0, =gUnknown_085B0A02 + movs r1, 0x1 + movs r2, 0x3E + bl gpu_pal_apply + movs r1, 0 + ldr r4, =0x0201c000 + movs r3, 0x11 + ldr r2, =0x000007ff +_0817593C: + adds r0, r1, r4 + strb r3, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r2 + bls _0817593C + movs r1, 0 + ldr r2, =0x0201d800 + ldr r6, =gUnknown_085E701C + ldr r0, =0xfffff000 + adds r5, r2, r0 + movs r4, 0x22 + ldr r3, =0x000007ff +_08175958: + adds r0, r1, r5 + strb r4, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r3 + bls _08175958 + movs r1, 0 + ldr r5, =0x0201d000 + movs r4, 0x33 + ldr r3, =0x000007ff +_0817596E: + adds r0, r1, r5 + strb r4, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r3 + bls _0817596E + movs r0, 0 + strh r0, [r2] + ldr r1, =0x000053ff + adds r0, r1, 0 + strh r0, [r2, 0x2] + ldr r1, =0x0000529f + adds r0, r1, 0 + strh r0, [r2, 0x4] + ldr r1, =0x00007e94 + adds r0, r1, 0 + strh r0, [r2, 0x6] + adds r0, r6, 0 + bl LoadObjectPic + ldr r0, =gUnknown_085E702C + bl LoadTaggedObjectPalette + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08175A7A + .pool +_081759F0: + ldr r0, =sub_81760FC + movs r1, 0 + bl CreateTask + ldr r2, =gTasks + lsls r4, r6, 2 + adds r4, r6 + lsls r4, 3 + adds r4, r2 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + mov r9, r1 + movs r5, 0 + strh r0, [r4, 0xE] + movs r0, 0xE + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + strh r7, [r0, 0x8] + movs r0, 0xE + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + strh r6, [r0, 0xA] + movs r0, 0xE + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r4, 0x16] + strh r1, [r0, 0xC] + movs r0, 0x1 + negs r0, r0 + str r5, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r0, 0x1C + movs r1, 0 + bl SetGpuReg + movs r0, 0x1E + movs r1, 0x20 + bl SetGpuReg + ldr r1, =0x00000703 + movs r0, 0xE + bl SetGpuReg + movs r1, 0xCA + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + mov r0, r9 + mov r1, r8 + strb r0, [r1] + ldr r0, =gUnknown_0203BD28 + strh r5, [r0] + ldr r0, =sub_8175744 + str r0, [r4] +_08175A7A: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81758E4 + + thumb_func_start sub_8175A9C +sub_8175A9C: @ 8175A9C + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x20] + movs r2, 0x20 + ldrsh r1, [r4, r2] + cmp r1, 0 + beq _08175AC4 + subs r0, 0x1 + strh r0, [r4, 0x20] + b _08175AD8 + .pool +_08175AC4: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0xC + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =sub_8175AE4 + str r0, [r4] +_08175AD8: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175A9C + + thumb_func_start sub_8175AE4 +sub_8175AE4: @ 8175AE4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08175B0A + adds r0, r4, 0 + bl sub_8176CA0 + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_8175B1C + str r0, [r1] +_08175B0A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175AE4 + + thumb_func_start sub_8175B1C +sub_8175B1C: @ 8175B1C + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8175CE4 + bl sub_80A1A74 + movs r1, 0xE0 + lsls r1, 6 + movs r0, 0 + movs r2, 0 + bl sub_8176D1C + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r1, 0x8 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r1, 0xE0 + lsls r1, 3 + movs r0, 0x8 + bl SetGpuReg + movs r0, 0x1 + bl EnableInterrupts + movs r1, 0xA0 + lsls r1, 1 + movs r0, 0 + bl SetGpuReg + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0xEB + strh r1, [r0, 0x8] + ldr r1, =sub_8175B90 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175B1C + + thumb_func_start sub_8175B90 +sub_8175B90: @ 8175B90 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x8] + movs r2, 0x8 + ldrsh r1, [r4, r2] + cmp r1, 0 + beq _08175BB8 + subs r0, 0x1 + strh r0, [r4, 0x8] + b _08175BCC + .pool +_08175BB8: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0x6 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =sub_8175BD8 + str r0, [r4] +_08175BCC: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175B90 + + thumb_func_start sub_8175BD8 +sub_8175BD8: @ 8175BD8 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _08175C1E + movs r0, 0xE0 + lsls r0, 6 + movs r1, 0 + bl sub_8176E40 + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl pal_fade_maybe + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0xE1 + lsls r1, 5 + strh r1, [r0, 0x8] + ldr r1, =sub_8175C34 + str r1, [r0] +_08175C1E: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175BD8 + + thumb_func_start sub_8175C34 +sub_8175C34: @ 8175C34 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08175CB8 + 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, 0 + beq _08175C62 + ldr r0, =gMain + ldrh r0, [r0, 0x2E] + cmp r0, 0 + beq _08175C94 +_08175C62: + movs r0, 0x4 + bl play_sound_effect + movs r0, 0x1 + negs r0, r0 + ldr r1, =0x0000ffff + str r1, [sp] + movs r1, 0x8 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =sub_8175CC8 + str r0, [r4] + b _08175CB8 + .pool +_08175C94: + ldr r0, =0x00001be8 + cmp r1, r0 + bne _08175CA0 + movs r0, 0x8 + bl play_sound_effect +_08175CA0: + movs r0, 0x8 + ldrsh r1, [r4, r0] + ldr r0, =0x00001ab8 + cmp r1, r0 + bne _08175CB2 + movs r0, 0xE4 + lsls r0, 1 + bl m4aSongNumStart +_08175CB2: + ldrh r0, [r4, 0x8] + subs r0, 0x1 + strh r0, [r4, 0x8] +_08175CB8: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175C34 + + thumb_func_start sub_8175CC8 +sub_8175CC8: @ 8175CC8 + push {lr} + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08175CDC + movs r0, 0xFF + bl SoftReset +_08175CDC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175CC8 + + thumb_func_start sub_8175CE4 +sub_8175CE4: @ 8175CE4 + push {lr} + sub sp, 0x8 + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1C + movs r1, 0 + bl SetGpuReg + movs r0, 0x1E + movs r1, 0 + bl SetGpuReg + movs r0, 0x18 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + movs r1, 0 + bl SetGpuReg + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + movs r0, 0x16 + movs r1, 0 + bl SetGpuReg + movs r0, 0x10 + movs r1, 0 + bl SetGpuReg + movs r0, 0x12 + 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 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, =0x040000d4 + mov r0, sp + str r0, [r1] + movs r0, 0xC0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, =0x8100c000 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r2, 0 + str r2, [sp, 0x4] + add r0, sp, 0x4 + str r0, [r1] + movs r0, 0xE0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, =0x85000100 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + mov r0, sp + strh r2, [r0] + str r0, [r1] + ldr r0, =0x05000002 + str r0, [r1, 0x4] + ldr r0, =0x810001ff + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175CE4 + + thumb_func_start sub_8175DA0 +sub_8175DA0: @ 8175DA0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + 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 r5, r1, 0 + cmp r0, 0xA + bhi _08175E00 + lsls r0, 2 + ldr r1, =_08175DD4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08175DD4: + .4byte _08175E00 + .4byte _08175E40 + .4byte _08175E60 + .4byte _08175F38 + .4byte _08175F5C + .4byte _08175FC8 + .4byte _08175E00 + .4byte _08175E00 + .4byte _08175E00 + .4byte _08175E00 + .4byte _08175FFC +_08175E00: + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _08175E12 + b _0817602A +_08175E12: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r5 + movs r1, 0x1 + strh r1, [r0, 0x8] + movs r1, 0x48 + strh r1, [r0, 0xE] + movs r3, 0xA + ldrsh r1, [r0, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r2, [r0, 0x24] + ldr r0, =gUnknown_0203BCE0 + strh r2, [r0] + b _0817602A + .pool +_08175E40: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r5 + ldrh r2, [r1, 0xE] + movs r3, 0xE + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _08175E58 + subs r0, r2, 0x1 + strh r0, [r1, 0xE] + b _0817602A +_08175E58: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0817602A +_08175E60: + lsls r2, r4, 2 + adds r0, r2, r4 + lsls r0, 3 + adds r3, r0, r5 + movs r0, 0xA + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r5, r0, r5 + ldr r1, [r5] + ldr r0, =sub_8175774 + mov r9, r2 + cmp r1, r0 + bne _08175F32 + movs r1, 0xC + ldrsh r0, [r3, r1] + cmp r0, 0x38 + bgt _08175F2C + movs r5, 0 + ldr r2, =gUnknown_085E6AF4 + mov r8, r2 + adds r7, r3, 0 + movs r6, 0xA0 + lsls r6, 19 +_08175E92: + movs r3, 0xC + ldrsh r1, [r7, r3] + lsls r0, r1, 2 + adds r0, r1 + adds r0, r5 + lsls r0, 2 + add r0, r8 + ldr r2, [r0] + ldr r0, [r2, 0x4] + lsrs r1, r6, 24 + ldrb r2, [r2, 0x1] + bl sub_81755BC + movs r0, 0x80 + lsls r0, 21 + adds r6, r0 + adds r5, 0x1 + cmp r5, 0x4 + ble _08175E92 + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + ldr r3, =gTasks + mov r2, r9 + adds r1, r2, r4 + lsls r1, 3 + adds r1, r3 + ldrh r0, [r1, 0xC] + adds r0, 0x1 + strh r0, [r1, 0xC] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0xA + ldrsh r2, [r1, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r3 + movs r2, 0x1 + strh r2, [r0, 0x24] + movs r2, 0xA + ldrsh r1, [r1, r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r3 + movs r3, 0x22 + ldrsh r0, [r0, r3] + cmp r0, 0x1 + bne _08175F14 + movs r0, 0xC0 + lsls r0, 2 + ldr r1, =0x0000328d + b _08175F1A + .pool +_08175F14: + movs r0, 0xC0 + lsls r0, 2 + ldr r1, =0x00001967 +_08175F1A: + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + b _0817602A + .pool +_08175F2C: + movs r0, 0xA + strh r0, [r3, 0x8] + b _0817602A +_08175F32: + movs r0, 0 + strh r0, [r5, 0x24] + b _0817602A +_08175F38: + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0817602A + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r5 + movs r1, 0x73 + strh r1, [r0, 0xE] + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _0817602A + .pool +_08175F5C: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r5 + ldrh r1, [r4, 0xE] + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08175F74 + subs r0, r1, 0x1 + strh r0, [r4, 0xE] + b _0817602A +_08175F74: + ldrb r0, [r4, 0xC] + ldrb r1, [r4, 0xA] + bl sub_817603C + lsls r0, 24 + cmp r0, 0 + beq _08175F8A + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0817602A +_08175F8A: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r3, 0xA + ldrsh r1, [r4, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r1, 0x22 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + bne _08175FB0 + movs r0, 0xC0 + lsls r0, 2 + ldr r1, =0x0000328d + b _08175FB6 + .pool +_08175FB0: + movs r0, 0xC0 + lsls r0, 2 + ldr r1, =0x00001967 +_08175FB6: + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _0817602A + .pool +_08175FC8: + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0817602A + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x2 + strh r0, [r1, 0x8] + b _0817602A + .pool +_08175FFC: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r5 + movs r2, 0xA + ldrsh r1, [r0, r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r5, 0 + movs r1, 0x1 + strh r1, [r0, 0x10] + adds r0, r4, 0 + bl DestroyTask + bl sub_81755A4 + ldr r4, =gUnknown_0203BCE8 + ldr r0, [r4] + bl Free + str r5, [r4] +_0817602A: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175DA0 + + thumb_func_start sub_817603C +sub_817603C: @ 817603C + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + adds r6, r3, 0 + lsls r1, 24 + lsrs r2, r1, 24 + adds r5, r2, 0 + ldr r4, =gTasks + cmp r3, 0x6 + bne _0817605C + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0, 0x1E] +_0817605C: + cmp r3, 0xC + bne _0817606E + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r4 + movs r1, 0x1 + strh r1, [r0, 0x16] + strh r1, [r0, 0x1E] +_0817606E: + cmp r3, 0x12 + bne _0817607E + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0, 0x1E] +_0817607E: + cmp r3, 0x18 + bne _08176092 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0, 0x16] + movs r1, 0x1 + strh r1, [r0, 0x1E] +_08176092: + cmp r3, 0x1E + bne _081760A2 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0, 0x1E] +_081760A2: + cmp r3, 0x24 + bne _081760B6 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r4 + movs r1, 0x3 + strh r1, [r0, 0x16] + movs r1, 0x1 + strh r1, [r0, 0x1E] +_081760B6: + cmp r3, 0x2A + bne _081760C6 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0, 0x1E] +_081760C6: + cmp r6, 0x30 + bne _081760DA + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r4 + movs r1, 0x4 + strh r1, [r0, 0x16] + movs r1, 0x1 + strh r1, [r0, 0x1E] +_081760DA: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r4 + movs r1, 0x1E + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _081760F4 + movs r0, 0 + b _081760F6 + .pool +_081760F4: + movs r0, 0x1 +_081760F6: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_817603C + + thumb_func_start sub_81760FC +sub_81760FC: @ 81760FC + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r2, r0, r4 + movs r1, 0x8 + ldrsh r0, [r2, r1] + cmp r0, 0x1 + beq _0817612C + cmp r0, 0x1 + bgt _0817611A + b _08176244 +_0817611A: + cmp r0, 0x2 + beq _08176158 + cmp r0, 0x3 + bne _08176124 + b _08176230 +_08176124: + b _08176244 + .pool +_0817612C: + ldr r0, =gUnknown_0203BCE8 + ldr r0, [r0] + adds r0, 0x90 + ldrh r0, [r0] + cmp r0, 0 + bne _0817614E + movs r3, 0xA + ldrsh r0, [r2, r3] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + movs r3, 0x24 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _0817614E + b _08176244 +_0817614E: + ldrh r0, [r2, 0x8] + adds r0, 0x1 + b _08176242 + .pool +_08176158: + ldr r6, =gUnknown_0203BCE8 + ldr r3, [r6] + adds r0, r3, 0 + adds r0, 0x8E + ldrh r0, [r0] + cmp r0, 0x47 + beq _08176244 + movs r0, 0xA + ldrsh r1, [r2, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + ldr r1, [r0] + ldr r0, =sub_8175774 + cmp r1, r0 + bne _08176244 + adds r0, r3, 0 + adds r0, 0x92 + ldrh r0, [r0] + lsls r0, 1 + adds r0, r3, r0 + ldrh r0, [r0] + ldr r4, =gUnknown_085E6F7C + adds r1, r3, 0 + adds r1, 0x90 + ldrh r3, [r1] + lsls r2, r3, 1 + adds r1, r2, r4 + ldrb r1, [r1] + adds r4, 0x1 + adds r2, r4 + ldrb r2, [r2] + bl sub_8177224 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, [r6] + adds r1, r0, 0 + adds r1, 0x92 + ldrh r3, [r1] + adds r0, 0x94 + ldrh r0, [r0] + subs r0, 0x1 + cmp r3, r0 + bge _081761D8 + adds r0, r3, 0x1 + strh r0, [r1] + ldr r1, =gUnknown_02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0x32 + b _081761EA + .pool +_081761D8: + movs r0, 0 + strh r0, [r1] + ldr r1, =gUnknown_02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0x80 + lsls r1, 2 +_081761EA: + strh r1, [r0, 0x34] + ldr r0, =gUnknown_0203BCE8 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x8E + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + adds r1, 0x90 + ldrh r0, [r1] + cmp r0, 0x2 + bne _08176210 + movs r0, 0 + b _08176212 + .pool +_08176210: + adds r0, 0x1 +_08176212: + strh r0, [r1] + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r0, 0x32 + strh r0, [r1, 0xE] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _08176244 + .pool +_08176230: + ldrh r1, [r2, 0xE] + movs r3, 0xE + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _08176240 + subs r0, r1, 0x1 + strh r0, [r2, 0xE] + b _08176244 +_08176240: + movs r0, 0x1 +_08176242: + strh r0, [r2, 0x8] +_08176244: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81760FC + + thumb_func_start sub_817624C +sub_817624C: @ 817624C + 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 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r6, r1, 0 + cmp r0, 0x32 + bls _08176268 + b _08176514 +_08176268: + lsls r0, 2 + ldr r1, =_0817627C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0817627C: + .4byte _08176348 + .4byte _0817636C + .4byte _081763C0 + .4byte _081763D8 + .4byte _08176414 + .4byte _08176438 + .4byte _08176484 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176490 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _081764B0 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _081764D4 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176508 +_08176348: + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r6 + ldrh r0, [r4, 0x12] + lsls r0, 16 + asrs r0, 17 + movs r1, 0x7F + ands r0, r1 + movs r1, 0xC + bl Sin + ldr r1, =gUnknown_0203BD26 + strh r0, [r1] + b _08176390 + .pool +_0817636C: + ldr r7, =gUnknown_0203BD26 + movs r3, 0 + ldrsh r4, [r7, r3] + cmp r4, 0 + beq _0817639C + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r6 + ldrh r0, [r4, 0x12] + lsls r0, 16 + asrs r0, 17 + movs r1, 0x7F + ands r0, r1 + movs r1, 0xC + bl Sin + strh r0, [r7] +_08176390: + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + b _08176514 + .pool +_0817639C: + ldr r3, =gUnknown_02020630 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r6 + movs r0, 0xC + ldrsh r2, [r1, r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + movs r2, 0x2 + strh r2, [r0, 0x2E] + strh r4, [r1, 0x12] + b _08176430 + .pool +_081763C0: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r1, r0, r6 + ldrh r2, [r1, 0x12] + movs r3, 0x12 + ldrsh r0, [r1, r3] + cmp r0, 0x3F + bgt _08176430 + adds r0, r2, 0x1 + strh r0, [r1, 0x12] + b _0817644E +_081763D8: + ldr r3, =gUnknown_02020630 + lsls r2, r5, 2 + adds r2, r5 + lsls r2, 3 + adds r2, r6 + movs r0, 0xC + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x3 + strh r1, [r0, 0x2E] + movs r0, 0xE + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x1 + strh r1, [r0, 0x2E] + movs r0, 0x78 + strh r0, [r2, 0x10] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + b _08176514 + .pool +_08176414: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r1, r0, r6 + ldrh r2, [r1, 0x10] + movs r3, 0x10 + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _0817642C + subs r0, r2, 0x1 + strh r0, [r1, 0x10] + b _08176514 +_0817642C: + movs r0, 0x40 + strh r0, [r1, 0x12] +_08176430: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _08176514 +_08176438: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r6 + ldrh r1, [r4, 0x12] + movs r2, 0x12 + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _08176464 + subs r0, r1, 0x1 + strh r0, [r4, 0x12] +_0817644E: + movs r1, 0x7F + ands r0, r1 + movs r1, 0x14 + bl Sin + ldr r1, =gUnknown_0203BD26 + strh r0, [r1] + b _08176514 + .pool +_08176464: + ldr r2, =gUnknown_02020630 + movs r3, 0xC + ldrsh r1, [r4, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + strh r1, [r0, 0x2E] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08176514 + .pool +_08176484: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r6 + movs r1, 0x32 + b _08176512 +_08176490: + ldr r3, =gUnknown_02020630 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r6 + movs r0, 0xE + ldrsh r2, [r1, r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + movs r2, 0x2 + b _081764C8 + .pool +_081764B0: + ldr r3, =gUnknown_02020630 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r6 + movs r0, 0xC + ldrsh r2, [r1, r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + movs r2, 0x4 +_081764C8: + strh r2, [r0, 0x2E] + movs r0, 0x32 + strh r0, [r1, 0x8] + b _08176514 + .pool +_081764D4: + ldr r3, =gUnknown_02020630 + lsls r2, r5, 2 + adds r2, r5 + lsls r2, 3 + adds r2, r6 + movs r0, 0xC + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x5 + strh r1, [r0, 0x2E] + movs r0, 0xE + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x3 + strh r1, [r0, 0x2E] + movs r0, 0x32 + strh r0, [r2, 0x8] + b _08176514 + .pool +_08176508: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r6 + movs r1, 0 +_08176512: + strh r1, [r0, 0x8] +_08176514: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_817624C + + thumb_func_start sub_817651C +sub_817651C: @ 817651C + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r3, 0x8 + ldrsh r0, [r0, r3] + adds r4, r1, 0 + cmp r0, 0x4 + bhi _0817655C + lsls r0, 2 + ldr r1, =_08176548 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08176548: + .4byte _0817655C + .4byte _081765A0 + .4byte _081765AC + .4byte _081765F4 + .4byte _08176640 +_0817655C: + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r2, r0, r4 + movs r1, 0xA + ldrsh r0, [r2, r1] + ldr r5, =0x00007fff + cmp r0, r5 + beq _081765A0 + movs r3, 0xC + ldrsh r1, [r2, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r3, r0, r4 + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r1, 0xC + ldrsh r0, [r0, r1] + cmp r0, 0x2 + bne _081765A0 + movs r1, 0xA + ldrsh r0, [r3, r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + movs r0, 0x14 + strh r0, [r1, 0x8] + strh r5, [r2, 0xA] +_081765A0: + movs r0, 0 + bl sub_817B540 + b _08176646 + .pool +_081765AC: + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r2, r0, r4 + movs r3, 0xA + ldrsh r0, [r2, r3] + ldr r5, =0x00007fff + cmp r0, r5 + beq _08176638 + movs r0, 0xC + ldrsh r1, [r2, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r3, 0xA + ldrsh r1, [r0, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r3, r0, r4 + ldrh r1, [r3, 0x12] + movs r0, 0x80 + negs r0, r0 + ands r0, r1 + movs r1, 0xA0 + lsls r1, 2 + cmp r0, r1 + bne _08176638 + movs r0, 0x1 + strh r0, [r3, 0x8] + strh r5, [r2, 0xA] + b _08176638 + .pool +_081765F4: + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r2, r0, r4 + ldrh r3, [r2, 0xA] + movs r0, 0xA + ldrsh r1, [r2, r0] + ldr r5, =0x00007fff + cmp r1, r5 + beq _08176638 + movs r0, 0x92 + lsls r0, 2 + cmp r1, r0 + bne _08176634 + movs r3, 0xC + ldrsh r1, [r2, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r3, 0xA + ldrsh r1, [r0, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r1, 0xA + strh r1, [r0, 0x8] + strh r5, [r2, 0xA] + b _08176638 + .pool +_08176634: + adds r0, r3, 0x1 + strh r0, [r2, 0xA] +_08176638: + movs r0, 0x1 + bl sub_817B540 + b _08176646 +_08176640: + movs r0, 0x2 + bl sub_817B540 +_08176646: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_817651C + + thumb_func_start sub_817664C +sub_817664C: @ 817664C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r7, r1, 24 + cmp r0, 0x4 + bls _08176662 + b _081769E0 +_08176662: + lsls r0, 2 + ldr r1, =_08176670 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08176670: + .4byte _08176684 + .4byte _0817672C + .4byte _081767D8 + .4byte _08176884 + .4byte _08176934 +_08176684: + ldr r5, =gUnknown_02020630 + ldr r0, =gTasks + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r0 + movs r1, 0x12 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r3, 0 + movs r2, 0x88 + lsls r2, 1 + strh r2, [r0, 0x20] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x20] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r2, 0x2E + strh r2, [r0, 0x22] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x22] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + movs r2, 0x20 + b _081769D4 + .pool +_0817672C: + ldr r5, =gUnknown_02020630 + ldr r0, =gTasks + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r0 + movs r1, 0x12 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r3, 0 + movs r1, 0x78 + strh r1, [r0, 0x20] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x88 + lsls r1, 1 + strh r1, [r0, 0x20] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r2, 0x2E + strh r2, [r0, 0x22] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x22] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + movs r2, 0x20 + b _081769D4 + .pool +_081767D8: + ldr r5, =gUnknown_02020630 + ldr r0, =gTasks + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r0 + movs r1, 0x12 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r3, 0 + movs r1, 0x78 + strh r1, [r0, 0x20] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x88 + lsls r1, 1 + strh r1, [r0, 0x20] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r2, 0x2E + strh r2, [r0, 0x22] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x22] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r1, 0x80 + lsls r1, 6 + movs r2, 0x80 + lsls r2, 2 + movs r0, 0x1 + b _081769D4 + .pool +_08176884: + ldr r5, =gUnknown_02020630 + ldr r0, =gTasks + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r0 + movs r1, 0x12 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r3, 0 + movs r1, 0x78 + strh r1, [r0, 0x20] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x0000ffe0 + strh r1, [r0, 0x20] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r2, 0x2E + strh r2, [r0, 0x22] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x22] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r1, 0x80 + lsls r1, 6 + movs r2, 0x80 + lsls r2, 2 + movs r0, 0x1 + b _081769D4 + .pool +_08176934: + ldr r5, =gUnknown_02020630 + ldr r0, =gTasks + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r0 + movs r1, 0x12 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r3, 0 + movs r1, 0x58 + strh r1, [r0, 0x20] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x98 + strh r1, [r0, 0x20] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r2, 0x2E + strh r2, [r0, 0x22] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x22] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r1, 0x80 + lsls r1, 6 + movs r2, 0x80 + lsls r2, 2 + movs r0, 0x2 +_081769D4: + movs r3, 0x8 + bl sub_817B3DC + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x8] +_081769E0: + ldr r0, =sub_817651C + movs r1, 0 + bl CreateTask + ldr r6, =gTasks + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 3 + adds r5, r1, r6 + lsls r0, 24 + lsrs r0, 24 + movs r4, 0 + strh r0, [r5, 0xC] + movs r0, 0xC + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + mov r1, r8 + strh r1, [r0, 0x8] + movs r0, 0xC + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + strh r4, [r0, 0xA] + movs r0, 0xC + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + strh r7, [r0, 0xC] + ldr r0, =sub_817624C + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0xA] + movs r0, 0xA + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + strh r4, [r0, 0x8] + movs r0, 0xA + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + strh r7, [r0, 0xA] + movs r0, 0xA + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + ldrh r1, [r5, 0x12] + strh r1, [r0, 0xC] + movs r0, 0xA + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + ldrh r1, [r5, 0x14] + strh r1, [r0, 0xE] + movs r0, 0xA + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + strh r4, [r0, 0x10] + mov r1, r8 + cmp r1, 0x2 + bne _08176A94 + movs r1, 0xA + ldrsh r0, [r5, r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r6 + movs r0, 0x45 + strh r0, [r1, 0x12] +_08176A94: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817664C + + thumb_func_start sub_8176AB0 +sub_8176AB0: @ 8176AB0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, =gMain + movs r1, 0x87 + lsls r1, 3 + adds r6, r0, r1 + ldrb r0, [r6] + cmp r0, 0x1 + beq _08176B30 + cmp r0, 0x1 + ble _08176AD6 + cmp r0, 0x2 + beq _08176B54 + cmp r0, 0x3 + bne _08176AD6 + b _08176C80 +_08176AD6: + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1C + movs r1, 0x8 + bl SetGpuReg + movs r0, 0x1E + movs r1, 0 + bl SetGpuReg + movs r0, 0x18 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + 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 r0, 0x52 + movs r1, 0 + bl SetGpuReg + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + movs r0, 0x1 + strb r0, [r6] + b _08176C96 + .pool +_08176B30: + ldr r1, =gUnknown_0203BD24 + movs r0, 0x22 + strh r0, [r1] + ldr r1, =gUnknown_0203BD26 + movs r0, 0 + strh r0, [r1] + adds r0, r4, 0 + bl sub_817B1C8 + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + b _08176C96 + .pool +_08176B54: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _08176BD8 + ldr r0, =gUnknown_085F5334 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085F53BC + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085F5354 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085F5384 + bl LoadTaggedObjectPalettes + movs r0, 0x78 + movs r1, 0x2E + bl sub_817B834 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gTasks + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + strh r2, [r4, 0x12] + ldr r6, =gUnknown_02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r5, r6, 0 + adds r5, 0x1C + adds r2, r0, r5 + ldr r1, =sub_8176EE8 + str r1, [r2] + adds r6, 0x8 + adds r0, r6 + ldr r1, =gUnknown_085E6FD0 + str r1, [r0] + movs r0, 0x88 + lsls r0, 1 + movs r1, 0x2E + bl sub_817B88C + b _08176C2C + .pool +_08176BD8: + ldr r0, =gUnknown_085F5344 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085F53AC + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085F5354 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085F5384 + bl LoadTaggedObjectPalettes + movs r0, 0x78 + movs r1, 0x2E + bl sub_817B88C + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gTasks + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + strh r2, [r4, 0x12] + ldr r6, =gUnknown_02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r5, r6, 0 + adds r5, 0x1C + adds r2, r0, r5 + ldr r1, =sub_8176EE8 + str r1, [r2] + adds r6, 0x8 + adds r0, r6 + ldr r1, =gUnknown_085E6FD0 + str r1, [r0] + movs r0, 0x88 + lsls r0, 1 + movs r1, 0x2E + bl sub_817B834 +_08176C2C: + lsls r0, 24 + lsrs r2, r0, 24 + strh r2, [r4, 0x14] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r5, r0, r5 + ldr r1, =sub_8176F90 + str r1, [r5] + adds r0, r6 + ldr r1, =gUnknown_085E7010 + str r1, [r0] + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08176C96 + .pool +_08176C80: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_817664C + adds r0, r4, 0 + bl sub_817B3A8 + movs r0, 0 + strb r0, [r6] + movs r0, 0x1 + b _08176C98 +_08176C96: + movs r0, 0 +_08176C98: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8176AB0 + + thumb_func_start sub_8176CA0 +sub_8176CA0: @ 8176CA0 + 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 + ldrh r1, [r4, 0x8] + movs r2, 0x8 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08176CC6 + lsls r0, r1, 24 + lsrs r0, 24 + bl DestroyTask + movs r0, 0 + strh r0, [r4, 0x8] +_08176CC6: + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08176CDC + lsls r0, r1, 24 + lsrs r0, 24 + bl DestroyTask + movs r0, 0 + strh r0, [r4, 0xA] +_08176CDC: + ldrh r1, [r4, 0xC] + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08176CF2 + lsls r0, r1, 24 + lsrs r0, 24 + bl DestroyTask + movs r0, 0 + strh r0, [r4, 0xC] +_08176CF2: + ldrh r1, [r4, 0xE] + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08176D08 + lsls r0, r1, 24 + lsrs r0, 24 + bl DestroyTask + movs r0, 0 + strh r0, [r4, 0xE] +_08176D08: + ldr r1, =gUnknown_0203BD28 + movs r0, 0x1 + strh r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8176CA0 + + thumb_func_start sub_8176D1C +sub_8176D1C: @ 8176D1C + push {r4-r7,lr} + adds r3, r0, 0 + adds r4, r2, 0 + lsls r3, 16 + lsrs r3, 16 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r4, 16 + lsrs r5, r4, 16 + ldr r0, =gUnknown_085E5770 + movs r6, 0xC0 + lsls r6, 19 + adds r3, r6 + adds r1, r3, 0 + bl LZ77UnCompVram + ldr r0, =gIntroCopyright_Pal + adds r1, r5, 0 + movs r2, 0x20 + bl gpu_pal_apply + lsrs r4, 20 + lsls r4, 28 + lsrs r4, 16 + movs r1, 0 + adds r4, 0x1 + ldr r2, =0x000003ff +_08176D52: + lsls r0, r1, 1 + adds r0, r7 + adds r0, r6 + strh r4, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r2 + bls _08176D52 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8176D1C + + thumb_func_start sub_8176D78 +sub_8176D78: @ 8176D78 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + adds r3, r2, 0 + movs r0, 0x3F + ands r0, r2 + adds r1, r0, 0 + adds r1, 0x50 + cmp r2, 0xFF + bne _08176D90 + movs r0, 0x1 + b _08176DB6 +_08176D90: + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _08176DA0 + movs r2, 0x80 + lsls r2, 4 + adds r0, r2, 0 + orrs r1, r0 +_08176DA0: + movs r0, 0x40 + ands r3, r0 + cmp r3, 0 + beq _08176DB4 + movs r2, 0x80 + lsls r2, 3 + adds r0, r2, 0 + orrs r1, r0 + lsls r0, r1, 16 + lsrs r1, r0, 16 +_08176DB4: + adds r0, r1, 0 +_08176DB6: + pop {r1} + bx r1 + thumb_func_end sub_8176D78 + + thumb_func_start sub_8176DBC +sub_8176DBC: @ 8176DBC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + str r0, [sp] + ldr r0, [sp, 0x2C] + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x4] + lsls r3, 16 + lsrs r3, 16 + str r3, [sp, 0x8] + lsls r0, 16 + lsrs r0, 20 + lsls r0, 28 + lsrs r0, 16 + mov r9, r0 + movs r5, 0 +_08176DEA: + movs r4, 0 + lsls r7, r5, 1 + ldr r1, [sp, 0x4] + adds r0, r1, r5 + adds r2, r5, 0x1 + mov r8, r2 + lsls r0, 6 + ldr r1, [sp, 0x8] + adds r6, r0, r1 +_08176DFC: + adds r0, r7, r5 + adds r0, r4 + ldr r2, [sp] + adds r0, r2, r0 + ldrb r0, [r0] + bl sub_8176D78 + mov r2, r10 + adds r1, r2, r4 + lsls r1, 1 + adds r1, r6 + movs r2, 0xC0 + lsls r2, 19 + adds r1, r2 + add r0, r9 + strh r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _08176DFC + mov r1, r8 + lsls r0, r1, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bls _08176DEA + 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_8176DBC + + thumb_func_start sub_8176E40 +sub_8176E40: @ 8176E40 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r6, r1, 16 + lsrs r1, 20 + lsls r1, 28 + lsrs r1, 16 + movs r2, 0 + ldr r7, =gUnknown_085E5BAC + movs r4, 0xC0 + lsls r4, 19 + adds r1, 0x1 + ldr r3, =0x000003ff +_08176E5E: + lsls r0, r2, 1 + adds r0, r5 + adds r0, r4 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, r3 + bls _08176E5E + str r6, [sp] + adds r0, r7, 0 + movs r1, 0x3 + movs r2, 0x7 + adds r3, r5, 0 + bl sub_8176DBC + ldr r0, =gUnknown_085E5BBB + str r6, [sp] + movs r1, 0x7 + movs r2, 0x7 + adds r3, r5, 0 + bl sub_8176DBC + ldr r4, =gUnknown_085E5BCA + str r6, [sp] + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0x7 + adds r3, r5, 0 + bl sub_8176DBC + str r6, [sp] + adds r0, r4, 0 + movs r1, 0x10 + movs r2, 0x7 + adds r3, r5, 0 + bl sub_8176DBC + ldr r0, =gUnknown_085E5BD9 + str r6, [sp] + movs r1, 0x14 + movs r2, 0x7 + adds r3, r5, 0 + bl sub_8176DBC + ldr r0, =gUnknown_085E5BE8 + str r6, [sp] + movs r1, 0x18 + movs r2, 0x7 + adds r3, r5, 0 + bl sub_8176DBC + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8176E40 + + thumb_func_start sub_8176EE8 +sub_8176EE8: @ 8176EE8 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gUnknown_0203BD28 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08176F04 + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + b _08176F88 + .pool +_08176F04: + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0x5 + bhi _08176F88 + lsls r0, 2 + ldr r1, =_08176F1C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08176F1C: + .4byte _08176F34 + .4byte _08176F3E + .4byte _08176F44 + .4byte _08176F4E + .4byte _08176F58 + .4byte _08176F6E +_08176F34: + adds r0, r4, 0 + movs r1, 0 + bl StartObjectImageAnimIfDifferent + b _08176F88 +_08176F3E: + adds r0, r4, 0 + movs r1, 0x1 + b _08176F72 +_08176F44: + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectImageAnimIfDifferent + b _08176F88 +_08176F4E: + adds r0, r4, 0 + movs r1, 0x3 + bl StartObjectImageAnimIfDifferent + b _08176F88 +_08176F58: + adds r0, r4, 0 + movs r1, 0 + bl StartObjectImageAnimIfDifferent + ldrh r1, [r4, 0x20] + movs r2, 0x20 + ldrsh r0, [r4, r2] + cmp r0, 0x78 + ble _08176F88 + subs r0, r1, 0x1 + b _08176F86 +_08176F6E: + adds r0, r4, 0 + movs r1, 0 +_08176F72: + bl StartObjectImageAnimIfDifferent + ldrh r2, [r4, 0x20] + movs r0, 0x20 + ldrsh r1, [r4, r0] + movs r0, 0x20 + negs r0, r0 + cmp r1, r0 + ble _08176F88 + subs r0, r2, 0x1 +_08176F86: + strh r0, [r4, 0x20] +_08176F88: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8176EE8 + + thumb_func_start sub_8176F90 +sub_8176F90: @ 8176F90 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gUnknown_0203BD28 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08176FAC + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + b _08177048 + .pool +_08176FAC: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08176FD4 + cmp r0, 0x1 + bgt _08176FBE + cmp r0, 0 + beq _08176FC8 + b _08177048 +_08176FBE: + cmp r0, 0x2 + beq _08177010 + cmp r0, 0x3 + beq _0817702E + b _08177048 +_08176FC8: + strh r0, [r4, 0x26] + adds r0, r4, 0 + movs r1, 0 + bl StartObjectImageAnimIfDifferent + b _08177048 +_08176FD4: + movs r1, 0x20 + ldrsh r0, [r4, r1] + cmp r0, 0xC8 + ble _08176FE6 + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectImageAnimIfDifferent + b _08176FEE +_08176FE6: + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectImageAnimIfDifferent +_08176FEE: + ldrh r2, [r4, 0x20] + movs r0, 0x20 + ldrsh r1, [r4, r0] + movs r0, 0x20 + negs r0, r0 + cmp r1, r0 + ble _08177000 + subs r0, r2, 0x2 + strh r0, [r4, 0x20] +_08177000: + ldr r0, =gUnknown_0203BD26 + ldrh r0, [r0] + negs r0, r0 + strh r0, [r4, 0x26] + b _08177048 + .pool +_08177010: + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + movs r1, 0 + bl StartObjectImageAnimIfDifferent + ldrh r1, [r4, 0x3C] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08177048 + ldrh r0, [r4, 0x20] + adds r0, 0x1 + b _08177046 +_0817702E: + adds r0, r4, 0 + movs r1, 0 + bl StartObjectImageAnimIfDifferent + ldrh r2, [r4, 0x20] + movs r0, 0x20 + ldrsh r1, [r4, r0] + movs r0, 0x20 + negs r0, r0 + cmp r1, r0 + ble _08177048 + subs r0, r2, 0x1 +_08177046: + strh r0, [r4, 0x20] +_08177048: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8176F90 + + thumb_func_start sub_8177050 +sub_8177050: @ 8177050 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, =gUnknown_0203BD28 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _0817706C + ldrh r0, [r5, 0x3A] + bl sub_818D820 + b _0817721C + .pool +_0817706C: + ldrh r0, [r5, 0x3C] + adds r0, 0x1 + strh r0, [r5, 0x3C] + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0xA + bhi _081770B4 + lsls r0, 2 + ldr r1, =_08177088 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08177088: + .4byte _081770B4 + .4byte _0817710E + .4byte _08177190 + .4byte _081771C6 + .4byte _081770B4 + .4byte _081770B4 + .4byte _081770B4 + .4byte _081770B4 + .4byte _081770B4 + .4byte _081771FE + .4byte _08177206 +_081770B4: + ldrb r1, [r5, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r5, 0x1] + movs r0, 0x30 + ldrsh r1, [r5, r0] + movs r0, 0x1F + ands r1, r0 + lsls r1, 1 + ldrb r2, [r5, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x3] + movs r0, 0x10 + strh r0, [r5, 0x32] + ldrh r4, [r5, 0x30] + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x80 + lsls r0, 9 + movs r1, 0x10 + bl __divsi3 + adds r1, r0, 0 + str r1, [sp] + adds r0, r4, 0 + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + adds r2, r5, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + movs r0, 0x1 + strh r0, [r5, 0x2E] + b _0817721C +_0817710E: + ldrh r1, [r5, 0x32] + movs r2, 0x32 + ldrsh r0, [r5, r2] + cmp r0, 0xFF + bgt _08177144 + adds r0, r1, 0 + adds r0, 0x8 + strh r0, [r5, 0x32] + ldrh r4, [r5, 0x30] + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x32 + ldrsh r1, [r5, r0] + movs r0, 0x80 + lsls r0, 9 + bl __divsi3 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + adds r0, r4, 0 + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + b _0817714A +_08177144: + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] +_0817714A: + movs r2, 0x30 + ldrsh r1, [r5, r2] + cmp r1, 0x2 + beq _0817721C + cmp r1, 0x2 + bgt _0817715C + cmp r1, 0x1 + beq _08177162 + b _0817721C +_0817715C: + cmp r1, 0x3 + beq _0817717A + b _0817721C +_08177162: + ldrh r1, [r5, 0x3C] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08177172 + ldrh r0, [r5, 0x22] + adds r0, 0x1 + strh r0, [r5, 0x22] +_08177172: + ldrh r0, [r5, 0x20] + subs r0, 0x2 + strh r0, [r5, 0x20] + b _0817721C +_0817717A: + ldrh r0, [r5, 0x3C] + ands r1, r0 + cmp r1, 0 + bne _08177188 + ldrh r0, [r5, 0x22] + adds r0, 0x1 + strh r0, [r5, 0x22] +_08177188: + ldrh r0, [r5, 0x20] + adds r0, 0x2 + strh r0, [r5, 0x20] + b _0817721C +_08177190: + ldrh r1, [r5, 0x34] + movs r2, 0x34 + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _081771A0 + subs r0, r1, 0x1 + strh r0, [r5, 0x34] + b _0817721C +_081771A0: + movs r1, 0xF4 + lsls r1, 4 + movs r0, 0x50 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0x10 + bl SetGpuReg + ldrb r1, [r5, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r5, 0x1] + movs r0, 0x10 + strh r0, [r5, 0x34] + b _081771FE +_081771C6: + ldrh r1, [r5, 0x34] + movs r2, 0x34 + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _081771EC + subs r1, 0x1 + strh r1, [r5, 0x34] + movs r0, 0x34 + ldrsh r2, [r5, r0] + movs r0, 0x10 + subs r0, r2 + lsls r0, 8 + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + b _0817721C +_081771EC: + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x9 + strh r0, [r5, 0x2E] + b _0817721C +_081771FE: + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + b _0817721C +_08177206: + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + ldrh r0, [r5, 0x3A] + bl sub_818D820 +_0817721C: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8177050 + + thumb_func_start sub_8177224 +sub_8177224: @ 8177224 + push {r4-r7,lr} + adds r5, r3, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + adds r3, r5, 0 + bl sub_80C0E9C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r6, =gUnknown_02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r2, r1, r6 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + movs r3, 0x4 + orrs r0, r3 + strb r0, [r2, 0x5] + adds r0, r5, 0x1 + strh r0, [r2, 0x30] + movs r0, 0x3E + adds r0, r2 + mov r12, r0 + ldrb r0, [r0] + orrs r0, r3 + mov r3, r12 + strb r0, [r3] + adds r0, r6, 0 + adds r0, 0x1C + adds r1, r0 + ldr r0, =sub_8177050 + str r0, [r1] + strh r4, [r2, 0x3A] + ldr r0, =gUnknown_085E7068 + movs r7, 0x20 + ldrsh r1, [r2, r7] + movs r3, 0x22 + ldrsh r2, [r2, r3] + movs r3, 0x1 + bl AddObjectToFront + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r4, [r0, 0x2E] + lsls r5, 24 + lsrs r5, 24 + adds r1, r5, 0 + bl StartObjectImageAnimIfDifferent + adds r0, r4, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8177224 + + thumb_func_start sub_81772B8 +sub_81772B8: @ 81772B8 + push {r4,lr} + adds r3, r0, 0 + ldr r4, =gUnknown_02020630 + movs r1, 0x2E + ldrsh r0, [r3, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0xA + beq _081772DC + ldr r0, =gUnknown_0203BD28 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + beq _081772EC +_081772DC: + adds r0, r3, 0 + bl RemoveObjectAndFreeTiles + b _08177380 + .pool +_081772EC: + adds r0, r1, 0 + adds r0, 0x3E + ldrb r0, [r0] + movs r1, 0x3E + adds r1, r3 + mov r12, r1 + movs r1, 0x4 + ands r1, r0 + mov r0, r12 + ldrb r2, [r0] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + movs r2, 0x2E + ldrsh r1, [r3, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x1] + movs r0, 0xC + ands r0, r1 + ldrb r2, [r3, 0x1] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x1] + movs r0, 0x2E + ldrsh r2, [r3, r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x1] + lsls r0, 30 + lsrs r0, 30 + movs r2, 0x4 + negs r2, r2 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x1] + movs r2, 0x2E + ldrsh r1, [r3, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x3] + movs r1, 0x3E + ands r1, r0 + ldrb r2, [r3, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x3] + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x20] + strh r0, [r3, 0x20] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x22] + strh r0, [r3, 0x22] +_08177380: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81772B8 + + thumb_func_start sub_8177388 +sub_8177388: @ 8177388 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x00004023 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + bl sub_8133EDC + lsls r0, 16 + lsrs r0, 16 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + movs r4, 0x1 + movs r6, 0 + ldr r5, =0x00000181 +_081773B4: + adds r0, r4, 0 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _081773D4 + ldr r0, =gUnknown_0203BCE8 + ldr r0, [r0] + lsls r1, r6, 1 + adds r0, 0x96 + adds r0, r1 + strh r4, [r0] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_081773D4: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r5 + bls _081773B4 + adds r4, r6, 0 + ldr r0, =0x00000181 + ldr r1, =gUnknown_0203BCE8 + mov r8, r1 + lsls r7, r4, 16 + cmp r4, r0 + bhi _08177406 + mov r5, r8 + movs r3, 0 + adds r2, r0, 0 +_081773F2: + ldr r0, [r5] + lsls r1, r4, 1 + adds r0, 0x96 + adds r0, r1 + strh r3, [r0] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r2 + bls _081773F2 +_08177406: + mov r2, r8 + ldr r1, [r2] + ldr r2, =0x0000039a + adds r0, r1, r2 + strh r6, [r0] + lsrs r0, r7, 16 + cmp r0, 0x46 + bhi _08177430 + adds r0, r1, 0 + adds r0, 0x94 + strh r6, [r0] + b _08177436 + .pool +_08177430: + adds r1, 0x94 + movs r0, 0x47 + strh r0, [r1] +_08177436: + movs r6, 0 + ldr r0, =gUnknown_0203BCE8 + mov r9, r0 + ldr r1, =0x0000039a + mov r8, r1 + movs r7, 0 + b _08177450 + .pool +_0817744C: + cmp r6, 0x46 + bhi _081774AC +_08177450: + bl Random + mov r2, r9 + ldr r4, [r2] + mov r1, r8 + adds r5, r4, r1 + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r5] + bl __umodsi3 + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, r6, 1 + adds r1, r4, r1 + lsls r0, r3, 1 + adds r4, 0x96 + adds r2, r4, r0 + ldrh r0, [r2] + strh r0, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + strh r7, [r2] + ldrh r0, [r5] + subs r0, 0x1 + strh r0, [r5] + lsls r0, 16 + lsrs r0, 16 + cmp r3, r0 + beq _081774A0 + ldrh r0, [r5] + lsls r0, 1 + adds r0, r4, r0 + ldrh r0, [r0] + strh r0, [r2] + ldrh r0, [r5] + lsls r0, 1 + adds r0, r4, r0 + strh r7, [r0] +_081774A0: + mov r2, r9 + ldr r0, [r2] + add r0, r8 + ldrh r0, [r0] + cmp r0, 0 + bne _0817744C +_081774AC: + ldr r1, =gUnknown_0203BCE8 + ldr r2, [r1] + adds r3, r2, 0 + adds r3, 0x94 + ldrh r0, [r3] + mov r8, r1 + cmp r0, 0x46 + bhi _081774F8 + adds r6, r0, 0 + movs r3, 0 + cmp r6, 0x46 + bhi _081774EE + mov r4, r8 +_081774C6: + ldr r2, [r4] + lsls r1, r6, 1 + adds r1, r2, r1 + lsls r0, r3, 1 + adds r0, r2, r0 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + adds r2, 0x94 + ldrh r2, [r2] + cmp r3, r2 + bne _081774E4 + movs r3, 0 +_081774E4: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x46 + bls _081774C6 +_081774EE: + mov r1, r8 + ldr r0, [r1] + b _08177538 + .pool +_081774F8: + movs r4, 0 + ldrh r0, [r2] + cmp r0, r10 + beq _08177516 + adds r1, r2, 0 +_08177502: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + lsls r0, r4, 1 + adds r0, r1, r0 + ldrh r0, [r0] + cmp r0, r10 + beq _08177516 + cmp r4, 0x46 + bls _08177502 +_08177516: + mov r0, r8 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x94 + ldrh r0, [r0] + subs r0, 0x1 + cmp r4, r0 + bge _08177536 + lsls r0, r4, 1 + adds r0, r2, r0 + adds r2, 0x8C + ldrh r1, [r2] + strh r1, [r0] + mov r1, r10 + strh r1, [r2] + b _0817753E +_08177536: + adds r0, r2, 0 +_08177538: + adds r0, 0x8C + mov r2, r10 + strh r2, [r0] +_0817753E: + mov r1, r8 + ldr r0, [r1] + adds r0, 0x94 + movs r1, 0x47 + strh r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8177388 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/crt0.s b/asm/crt0.s index 65aa8ed4b..14675fe4c 100644 --- a/asm/crt0.s +++ b/asm/crt0.s @@ -41,9 +41,9 @@ Init: @ 8000204 msr cpsr_cf, r0 ldr sp, sp_sys ldr r1, =INTR_VECTOR - adr r0, InterruptMain + adr r0, IntrMain str r0, [r1] - ldr r1, =Main + 1 + ldr r1, =AgbMain + 1 mov lr, pc bx r1 b Init @@ -56,8 +56,8 @@ sp_irq: .word IWRAM_END - 0x60 .arm .align 2, 0 - .global InterruptMain -InterruptMain: @ 8000248 + .global IntrMain +IntrMain: @ 8000248 mov r3, REG_BASE add r3, r3, 0x200 ldr r2, [r3, OFFSET_REG_IE - 0x200] @@ -69,51 +69,50 @@ InterruptMain: @ 8000248 and r1, r2, r2, lsr 16 mov r12, 0 ands r0, r1, INTR_FLAG_VCOUNT - bne InterruptMain_FoundIntr + bne IntrMain_FoundIntr add r12, r12, 0x4 mov r0, 0x1 strh r0, [r3, OFFSET_REG_IME - 0x200] ands r0, r1, INTR_FLAG_SERIAL - bne InterruptMain_FoundIntr + bne IntrMain_FoundIntr add r12, r12, 0x4 ands r0, r1, INTR_FLAG_TIMER3 - bne InterruptMain_FoundIntr + bne IntrMain_FoundIntr add r12, r12, 0x4 ands r0, r1, INTR_FLAG_HBLANK - bne InterruptMain_FoundIntr + bne IntrMain_FoundIntr add r12, r12, 0x4 ands r0, r1, INTR_FLAG_VBLANK - bne InterruptMain_FoundIntr + bne IntrMain_FoundIntr add r12, r12, 0x4 ands r0, r1, INTR_FLAG_TIMER0 - bne InterruptMain_FoundIntr + bne IntrMain_FoundIntr add r12, r12, 0x4 ands r0, r1, INTR_FLAG_TIMER1 - bne InterruptMain_FoundIntr + bne IntrMain_FoundIntr add r12, r12, 0x4 ands r0, r1, INTR_FLAG_TIMER2 - bne InterruptMain_FoundIntr + bne IntrMain_FoundIntr add r12, r12, 0x4 ands r0, r1, INTR_FLAG_DMA0 - bne InterruptMain_FoundIntr + bne IntrMain_FoundIntr add r12, r12, 0x4 ands r0, r1, INTR_FLAG_DMA1 - bne InterruptMain_FoundIntr + bne IntrMain_FoundIntr add r12, r12, 0x4 ands r0, r1, INTR_FLAG_DMA2 - bne InterruptMain_FoundIntr + bne IntrMain_FoundIntr add r12, r12, 0x4 ands r0, r1, INTR_FLAG_DMA3 - bne InterruptMain_FoundIntr + bne IntrMain_FoundIntr add r12, r12, 0x4 ands r0, r1, INTR_FLAG_KEYPAD - bne InterruptMain_FoundIntr + bne IntrMain_FoundIntr add r12, r12, 0x4 ands r0, r1, INTR_FLAG_GAMEPAK strbne r0, [r3, OFFSET_REG_SOUNDCNT_X - 0x200] -InterruptMain_Loop: - bne InterruptMain_Loop -InterruptMain_FoundIntr: + bne . @ spin +IntrMain_FoundIntr: strh r0, [r3, OFFSET_REG_IF - 0x200] bic r2, r2, r0 ldr r0, =gUnknown_03007868 @@ -129,13 +128,13 @@ InterruptMain_FoundIntr: bic r3, r3, PSR_I_BIT | PSR_F_BIT | PSR_MODE_MASK orr r3, r3, PSR_SYS_MODE msr cpsr_cf, r3 - ldr r1, =gUnknown_03002710 + ldr r1, =gIntrTable add r1, r1, r12 ldr r0, [r1] stmdb sp!, {lr} - adr lr, InterruptMain_RetAddr + adr lr, IntrMain_RetAddr bx r0 -InterruptMain_RetAddr: +IntrMain_RetAddr: ldmia sp!, {lr} mrs r3, cpsr bic r3, r3, PSR_I_BIT | PSR_F_BIT | PSR_MODE_MASK diff --git a/asm/daycare.s b/asm/daycare.s index 04ad6f448..05a8370f2 100644 --- a/asm/daycare.s +++ b/asm/daycare.s @@ -12,10 +12,10 @@ pokemon_get_nick: @ 806FA2C adds r4, r1, 0 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData adds r0, r4, 0 mov r1, sp - bl CopyString_Limit10 + bl StringCopy10 add sp, 0x14 pop {r4} pop {r1} @@ -32,7 +32,7 @@ pokemon_get_nick_: @ 806FA4C bl pokemon_getattr_encrypted adds r0, r4, 0 mov r1, sp - bl CopyString_Limit10 + bl StringCopy10 add sp, 0x14 pop {r4} pop {r1} @@ -170,16 +170,16 @@ sub_806FB38: @ 806FB38 beq _0806FBBC adds r0, r5, 0 adds r0, 0x74 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy adds r4, r5, 0 adds r4, 0x7C adds r0, r6, 0 adds r1, r4, 0 bl pokemon_get_nick adds r0, r4, 0 - bl StripExtendedControlCodes + bl StripExtCtrlCodes adds r4, 0xB ldrb r1, [r4] movs r0, 0x10 @@ -190,7 +190,7 @@ sub_806FB38: @ 806FB38 strb r0, [r4] adds r0, r6, 0 movs r1, 0x3 - bl pokemon_getattr + bl GetMonData lsls r0, 4 ldrb r2, [r4] movs r1, 0xF @@ -199,10 +199,10 @@ sub_806FB38: @ 806FB38 strb r1, [r4] adds r0, r6, 0 movs r1, 0x40 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r1, [r1] lsls r2, r0, 3 adds r2, r0 @@ -270,9 +270,9 @@ daycare_send_selected_pokemon: @ 806FC18 lsrs r0, 24 movs r1, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r1, [r1] ldr r2, =0x00003030 adds r1, r2 @@ -375,7 +375,7 @@ sub_806FCF8: @ 806FCF8 push {r4-r7,lr} sub sp, 0x68 adds r5, r0, 0 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl pokemon_get_nick_ adds r0, r5, 0 movs r1, 0xB @@ -387,12 +387,12 @@ sub_806FCF8: @ 806FCF8 bl sub_8069004 mov r0, sp movs r1, 0x38 - bl pokemon_getattr + bl GetMonData cmp r0, 0x64 beq _0806FD46 mov r0, sp movs r1, 0x19 - bl pokemon_getattr + bl GetMonData adds r1, r5, 0 adds r1, 0x88 ldr r1, [r1] @@ -405,7 +405,7 @@ sub_806FCF8: @ 806FCF8 mov r0, sp bl sub_806FCA4 _0806FD46: - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty movs r1, 0xFA lsls r1, 1 adds r6, r0, r1 @@ -466,7 +466,7 @@ sub_806FD9C: @ 806FD9C thumb_func_start sub_806FDC4 sub_806FDC4: @ 806FDC4 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003030 adds r0, r1 @@ -540,12 +540,12 @@ sub_806FE54: @ 806FE54 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r4, 0 movs r2, 0 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r1, =gUnknown_02021CC4 + bl ConvertIntToDecimalStringN + ldr r1, =gStringVar1 adds r0, r5, 0 bl pokemon_get_nick_ adds r0, r4, 0 @@ -563,17 +563,17 @@ sub_806FE88: @ 806FE88 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 adds r0, r5, 0 bl pokemon_get_nick_ movs r0, 0x64 muls r4, r0 adds r4, 0x64 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r4, 0 movs r2, 0 movs r3, 0x5 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r0, r4, 0 pop {r4,r5} pop {r1} @@ -599,7 +599,7 @@ sub_806FEC0: @ 806FEC0 thumb_func_start sub_806FED8 sub_806FED8: @ 806FED8 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003030 adds r0, r1 @@ -617,7 +617,7 @@ sub_806FED8: @ 806FED8 sub_806FF04: @ 806FF04 lsls r0, 16 lsrs r0, 16 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] ldr r1, =0x000030b8 adds r3, r2, r1 @@ -636,7 +636,7 @@ sub_806FF04: @ 806FF04 thumb_func_start sub_806FF30 sub_806FF30: @ 806FF30 push {r4-r6,lr} - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr ldr r5, =gUnknown_020375E0 ldrh r0, [r5] movs r4, 0x8C @@ -860,7 +860,7 @@ _080700C8: ble _080700AE cmp r5, 0x2 bne _080700E2 - bl GenerateRandomNumber + bl Random lsls r0, 16 ldr r1, =0x7ffe0000 movs r7, 0x1 @@ -875,7 +875,7 @@ _080700E2: bl pokemon_getattr_encrypted cmp r0, 0xC3 bne _080700FE - bl GenerateRandomNumber + bl Random lsls r0, 16 ldr r1, =0x7ffe0000 cmp r0, r1 @@ -899,7 +899,7 @@ sub_8070114: @ 8070114 push {r4-r7,lr} adds r5, r0, 0 movs r6, 0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r0, [r0, 0x24] bl SeedRng2 adds r0, r5, 0 @@ -907,9 +907,9 @@ sub_8070114: @ 8070114 adds r1, r0, 0 cmp r1, 0 bge _08070160 - bl GenerateRandomNumber2 + bl Random2 adds r4, r0, 0 - bl GenerateRandomNumber + bl Random movs r1, 0x8C lsls r1, 1 adds r5, r1 @@ -936,9 +936,9 @@ _08070160: lsls r0, 24 lsrs r7, r0, 24 _08070176: - bl GenerateRandomNumber2 + bl Random2 adds r4, r0, 0 - bl GenerateRandomNumber + bl Random lsls r4, 16 lsls r0, 16 lsrs r0, 16 @@ -974,7 +974,7 @@ _080701AC: sub_80701B8: @ 80701B8 push {r4,lr} adds r4, r0, 0 - bl GenerateRandomNumber + bl Random movs r1, 0x8C lsls r1, 1 adds r4, r1 @@ -995,7 +995,7 @@ sub_80701B8: @ 80701B8 thumb_func_start sub_80701E0 sub_80701E0: @ 80701E0 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003030 adds r0, r1 @@ -1008,7 +1008,7 @@ sub_80701E0: @ 80701E0 thumb_func_start sub_80701FC sub_80701FC: @ 80701FC push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003030 adds r0, r1 @@ -1084,7 +1084,7 @@ _08070276: movs r5, 0 adds r6, r1, 0 _08070288: - bl GenerateRandomNumber + bl Random mov r1, sp adds r4, r1, r5 lsls r0, 16 @@ -1106,7 +1106,7 @@ _08070288: movs r5, 0 movs r4, 0x1 _080702B8: - bl GenerateRandomNumber + bl Random adds r1, r7, r5 lsls r0, 16 lsrs r0, 16 @@ -1245,7 +1245,7 @@ pokemon_get_eggmoves: @ 80703C8 movs r6, 0 movs r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r3, r0, 16 movs r2, 0 @@ -1376,7 +1376,7 @@ _080704C4: bls _080704C4 adds r0, r7, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 ldr r1, =gUnknown_020249C4 @@ -1662,7 +1662,7 @@ sub_8070710: @ 8070710 thumb_func_start sub_8070728 sub_8070728: @ 8070728 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003030 adds r0, r1 @@ -1920,7 +1920,7 @@ _08070918: mov r0, sp movs r1, 0x2D bl pokemon_setattr - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty movs r1, 0xFA lsls r1, 1 adds r0, r1 @@ -2099,7 +2099,7 @@ sub_8070A0C: @ 8070A0C thumb_func_start sp0B8_daycare sp0B8_daycare: @ 8070AA8 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003030 adds r0, r1 @@ -2154,7 +2154,7 @@ _08070AEE: adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -2183,21 +2183,21 @@ _08070B34: ldrb r0, [r0] cmp r5, r0 bcs _08070BC0 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty _08070B5C: adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08070BB4 adds r0, r4, 0 movs r1, 0x4 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _08070BB4 adds r0, r4, 0 movs r1, 0x20 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 str r1, [sp] cmp r0, 0 @@ -2242,7 +2242,7 @@ _08070BC2: thumb_func_start sub_8070BD0 sub_8070BD0: @ 8070BD0 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003030 adds r0, r1 @@ -2278,16 +2278,16 @@ sub_8070C04: @ 8070C04 bl pokemon_getattr_encrypted cmp r0, 0 beq _08070C2E - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 adds r0, r4, 0 bl pokemon_get_nick_ adds r0, r4, 0 movs r1, 0x7 mov r2, sp bl pokemon_getattr_encrypted - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 mov r1, sp - bl CopyString + bl StringCopy _08070C2E: adds r4, 0x8C adds r0, r4, 0 @@ -2295,7 +2295,7 @@ _08070C2E: bl pokemon_getattr_encrypted cmp r0, 0 beq _08070C44 - ldr r1, =gUnknown_02021DC4 + ldr r1, =gStringVar2 adds r0, r4, 0 bl pokemon_get_nick_ _08070C44: @@ -2314,9 +2314,9 @@ sub_8070C58: @ 8070C58 lsrs r0, 24 movs r5, 0x64 muls r0, r5 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl pokemon_get_nick_ bl brm_get_pokemon_selection lsls r0, 24 @@ -2336,7 +2336,7 @@ sub_8070C58: @ 8070C58 thumb_func_start sp0B5_daycare sp0B5_daycare: @ 8070C94 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003030 adds r0, r1 @@ -2349,7 +2349,7 @@ sp0B5_daycare: @ 8070C94 thumb_func_start sp0B6_daycare sp0B6_daycare: @ 8070CB0 push {r4,lr} - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] ldr r1, =0x00003030 adds r0, r1 @@ -2385,7 +2385,7 @@ _08070CF2: thumb_func_start sub_8070CF8 sub_8070CF8: @ 8070CF8 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003030 adds r0, r1 @@ -2587,7 +2587,7 @@ _08070E5C: thumb_func_start daycare_relationship_score_from_savegame daycare_relationship_score_from_savegame: @ 8070E6C push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003030 adds r0, r1 @@ -2623,12 +2623,12 @@ _08070EAC: bne _08070EB2 movs r1, 0 _08070EB2: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r2, =gUnknown_0832B6F8 lsls r1, 2 adds r1, r2 ldr r1, [r1] - bl CopyString + bl StringCopy pop {r0} bx r0 .pool @@ -2739,7 +2739,7 @@ _08070F84: ldr r1, =gUnknown_0832DACB _08070F86: adds r0, r4, 0 - bl AppendString + bl StringAppend pop {r4} pop {r1} bx r1 @@ -2799,20 +2799,20 @@ _08070FCC: bls _08070FCC adds r0, r7, 0 mov r1, sp - bl CopyString + bl StringCopy ldr r4, =gUnknown_085EF881 adds r0, r7, 0 adds r1, r4, 0 - bl AppendString + bl StringAppend adds r0, r7, 0 mov r1, r9 - bl AppendString + bl StringAppend adds r0, r7, 0 adds r1, r4, 0 - bl AppendString + bl StringAppend ldr r1, =gUnknown_085EF883 adds r0, r7, 0 - bl AppendString + bl StringAppend add sp, 0x28 pop {r3,r4} mov r8, r3 @@ -2835,7 +2835,7 @@ sub_8071038: @ 8071038 _08071046: adds r0, r4, 0 ldr r1, =gUnknown_085EF888 - bl AppendString + bl StringAppend movs r0, 0x8C adds r2, r5, 0 muls r2, r0 @@ -2851,13 +2851,13 @@ _08071046: mov r0, sp movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r0, r4, 0 mov r1, sp - bl AppendString + bl StringAppend adds r0, r4, 0 ldr r1, =gUnknown_085EF881 - bl AppendString + bl StringAppend adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 @@ -2973,7 +2973,7 @@ sub_8071148: @ 8071148 lsrs r5, 24 ldr r1, =gUnknown_085EF888 mov r0, sp - bl CopyString + bl StringCopy movs r0, 0x8C adds r1, r6, 0 muls r1, r0 @@ -2989,10 +2989,10 @@ sub_8071148: @ 8071148 adds r0, r4, 0 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN mov r0, sp adds r1, r4, 0 - bl AppendString + bl StringAppend movs r0, 0x1 mov r1, sp movs r2, 0x70 @@ -3023,7 +3023,7 @@ sub_80711B8: @ 80711B8 lsrs r5, r2, 24 cmp r6, 0x1 bhi _080711F0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr mov r8, r0 ldr r0, [r0] ldr r4, =0x00003030 @@ -3062,7 +3062,7 @@ c3_080469FC: @ 8071204 ldrb r0, [r4, 0x8] bl ListMenuHandleInput adds r1, r0, 0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r2, [r0, 0x2E] movs r0, 0x1 ands r0, r2 @@ -3182,7 +3182,7 @@ sub_80712C0: @ 80712C0 sub_8071330: @ 8071330 push {lr} bl sub_81B9328 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =c2_exit_to_overworld_2_switch str r0, [r1, 0x8] pop {r0} diff --git a/asm/decoration.s b/asm/decoration.s index f07946c25..c22bd977f 100644 --- a/asm/decoration.s +++ b/asm/decoration.s @@ -23,7 +23,7 @@ _0812697E: ldrb r0, [r2, 0x9] cmp r0, 0 bne _08126996 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r3, =0x00001aae adds r1, r0, r3 @@ -35,7 +35,7 @@ _08126996: ldrb r0, [r2, 0x9] cmp r0, 0x1 bne _081269AC - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r3, =0x0000271c adds r1, r0, r3 @@ -177,7 +177,7 @@ sub_8126AD8: @ 8126AD8 lsrs r4, 24 bl sub_8126ABC ldr r2, =gUnknown_0203A17C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r3, =0x00001aae adds r1, r0, r3 @@ -210,7 +210,7 @@ sub_8126B2C: @ 8126B2C lsrs r4, 24 bl sub_8126ABC ldr r2, =gUnknown_0203A17C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r3, =0x0000271c adds r1, r0, r3 @@ -335,10 +335,10 @@ sub_8126C48: @ 8126C48 lsls r0, 24 cmp r0, 0 bne _08126C7C - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EA83D adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r2, =sub_8126DA4 adds r0, r5, 0 adds r1, r4, 0 @@ -375,10 +375,10 @@ sub_8126CA4: @ 8126CA4 lsls r0, 24 cmp r0, 0 bne _08126CD8 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EAAEC adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r2, =sub_8126DA4 adds r0, r5, 0 adds r1, r4, 0 @@ -419,10 +419,10 @@ sub_8126D10: @ 8126D10 lsls r0, 24 cmp r0, 0 bne _08126D44 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EA83D adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r2, =sub_8126DA4 adds r0, r5, 0 adds r1, r4, 0 @@ -717,11 +717,11 @@ _08126FA2: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 adds r0, r4, 0 bl sub_8127058 adds r0, r4, 0 - bl GetStringLength + bl StringLength lsls r0, 16 lsrs r0, 16 adds r6, r0, r4 @@ -731,7 +731,7 @@ _08126FA2: adds r0, r1 ldr r1, [r0] adds r0, r6, 0 - bl CopyString + bl StringCopy str r5, [sp] mov r0, r9 str r0, [sp, 0x4] @@ -751,7 +751,7 @@ _08126FA2: adds r0, r6, 0 movs r2, 0x1 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r6, r0, 0 movs r0, 0xBA strb r0, [r6] @@ -764,7 +764,7 @@ _08126FA2: adds r0, r6, 0 movs r2, 0x1 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x1 adds r1, r4, 0 ldr r2, [sp, 0x14] @@ -799,7 +799,7 @@ sub_8127058: @ 8127058 lsls r4, r1, 24 lsrs r4, 24 ldr r1, =gUnknown_085EA7C8 - bl CopyString + bl StringCopy cmp r4, 0x1 bne _08127078 movs r0, 0x4 @@ -908,10 +908,10 @@ sub_81270E8: @ 81270E8 _08127154: movs r0, 0x1 bl sub_8126A58 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EA83D adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r2, =sub_8127180 adds r0, r5, 0 adds r1, r4, 0 @@ -1030,7 +1030,7 @@ sub_8127250: @ 8127250 lsrs r1, 22 adds r1, r2 ldr r1, [r1] - bl CopyString + bl StringCopy pop {r0} bx r0 .pool @@ -1153,13 +1153,13 @@ sub_8127330: @ 8127330 ldrsh r0, [r1, r2] cmp r0, 0 bne _08127378 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r1, 0x1 bl sub_8127058 b _08127380 .pool _08127378: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r1, 0 bl sub_8127058 _08127380: @@ -1217,7 +1217,7 @@ _081273D6: ldr r0, [r5] adds r0, r4 ldr r1, =gUnknown_085E8CF0 - bl CopyString + bl StringCopy ldr r0, [r5] lsls r2, r6, 3 adds r1, r0, r2 @@ -1261,14 +1261,14 @@ sub_8127454: @ 8127454 adds r5, r0, 0 lsls r4, r1, 16 lsrs r4, 16 - ldr r1, =gUnknown_02021CC4 - bl CopyString + ldr r1, =gStringVar1 + bl StringCopy lsls r4, 5 ldr r0, =gUnknown_085A5C09 adds r4, r0 adds r0, r5, 0 adds r1, r4, 0 - bl AppendString + bl StringAppend pop {r4,r5} pop {r0} bx r0 @@ -1722,7 +1722,7 @@ sub_8127814: @ 8127814 movs r2, 0xC bl memset movs r6, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr mov r10, r0 ldr r1, =0x00001aae mov r9, r1 @@ -1810,7 +1810,7 @@ _081278E2: ldr r3, =gUnknown_0203BC40 mov r8, r3 _081278F4: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x0000271c adds r0, r1 @@ -1826,7 +1826,7 @@ _08127918: ldr r0, =gUnknown_0203A14C ldr r1, [r0] adds r1, r2 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r3, =0x0000271c adds r0, r3 @@ -1991,7 +1991,7 @@ sub_8127A5C: @ 8127A5C push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -2049,7 +2049,7 @@ sub_8127ACC: @ 8127ACC adds r2, r0 lsls r2, 3 adds r4, r2, r3 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldrh r0, [r1] strh r0, [r4, 0xE] @@ -2074,7 +2074,7 @@ sub_8127B04: @ 8127B04 lsls r5, 24 lsrs r5, 24 bl DrawWholeMapView - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] movs r0, 0x4 ldrsb r0, [r1, r0] @@ -2477,7 +2477,7 @@ sub_8127E18: @ 8127E18 mov r8, r0 ldr r1, =gUnknown_020375E4 mov r10, r1 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr mov r9, r2 _08127E34: adds r5, r6, 0 @@ -2636,10 +2636,10 @@ sub_8127F68: @ 8127F68 beq _08127FAC cmp r0, 0x7 beq _08127FAC - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EA9AE adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r2, =sub_8127A5C adds r0, r5, 0 adds r1, r4, 0 @@ -2672,36 +2672,36 @@ _08127FAC: b _0812804C .pool _08127FE8: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r4, =gUnknown_0203A17C ldrb r1, [r4, 0x8] movs r2, 0x1 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldrb r0, [r4, 0x9] cmp r0, 0 bne _08128018 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085EA8EA - bl ExpandStringRefs + bl StringExpandPlaceholders b _08128020 .pool _08128018: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085EA931 - bl ExpandStringRefs + bl StringExpandPlaceholders _08128020: - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 ldr r2, =sub_8127A5C adds r0, r5, 0 bl DisplayItemMessageOnField b _0812804C .pool _08128038: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EA8D2 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r2, =sub_8127A5C adds r0, r5, 0 adds r1, r4, 0 @@ -2898,7 +2898,7 @@ _081281E2: lsls r0, 24 lsrs r2, r0, 24 _081281EA: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 @@ -3168,10 +3168,10 @@ sub_8128414: @ 8128414 adds r0, r3 strh r2, [r0, 0x3C] bl sub_8128DE0 - ldr r5, =gUnknown_02021FC4 + ldr r5, =gStringVar4 ldr r1, =gUnknown_085EA8BF adds r0, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r2, =sub_8128B80 adds r0, r4, 0 adds r1, r5, 0 @@ -3834,10 +3834,10 @@ sub_8128950: @ 8128950 lsrs r0, 24 cmp r0, 0x1 bne _081289A4 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EA897 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r2, =sub_81289D0 adds r0, r5, 0 adds r1, r4, 0 @@ -3847,10 +3847,10 @@ sub_8128950: @ 8128950 _081289A4: movs r0, 0x20 bl audio_play - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EA8A6 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r2, =sub_8129020 adds r0, r5, 0 adds r1, r4, 0 @@ -4339,7 +4339,7 @@ _08128DAE: thumb_func_start sub_8128DB4 sub_8128DB4: @ 8128DB4 push {lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r0, [r0, 0x2C] movs r1, 0xF0 ands r1, r0 @@ -4440,7 +4440,7 @@ _08128E76: b _08128FBA .pool _08128E88: - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2C] movs r7, 0xF0 adds r0, r7, 0 @@ -4582,7 +4582,7 @@ _08128F94: ldrsh r0, [r4, r1] cmp r0, 0 bne _08128FBA - ldr r3, =gUnknown_030022C0 + ldr r3, =gMain ldrh r1, [r3, 0x2E] movs r2, 0x1 adds r0, r2, 0 @@ -4644,7 +4644,7 @@ sub_8129020: @ 8129020 push {lr} lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -5809,10 +5809,10 @@ _08129968: lsrs r0, 24 cmp r0, 0x1 bne _08129994 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EAAC5 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r2, =sub_8129D64 adds r0, r5, 0 adds r1, r4, 0 @@ -5885,7 +5885,7 @@ SetUpPuttingAwayDecorationPlayerAvatar: @ 81299DC lsls r0, 24 lsrs r0, 24 str r0, [r4, 0x4] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 @@ -6136,10 +6136,10 @@ sub_8129BF8: @ 8129BF8 adds r0, r3 ldr r1, =DummyObjectCallback str r1, [r0] - ldr r5, =gUnknown_02021FC4 + ldr r5, =gStringVar4 ldr r1, =gUnknown_085EAA62 adds r0, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r2, =sub_812A1F0 adds r0, r4, 0 adds r1, r5, 0 @@ -6161,10 +6161,10 @@ sub_8129C74: @ 8129C74 ldrb r0, [r0] cmp r0, 0 beq _08129CA8 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EAAA3 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r2, =sub_812A1A0 b _08129D14 .pool @@ -6215,10 +6215,10 @@ _08129CDE: adds r0, r3 ldr r1, =DummyObjectCallback str r1, [r0] - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EAA62 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r2, =sub_812A1F0 _08129D14: adds r0, r5, 0 @@ -6227,10 +6227,10 @@ _08129D14: b _08129D50 .pool _08129D3C: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EAA81 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r2, =sub_8129D64 adds r0, r5, 0 adds r1, r4, 0 @@ -6247,7 +6247,7 @@ sub_8129D64: @ 8129D64 push {lr} lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -6501,7 +6501,7 @@ sub_8129F20: @ 8129F20 movs r6, 0xF ands r6, r0 movs r4, 0 - ldr r7, =gUnknown_03005D8C + ldr r7, =gSaveBlock1Ptr mov r9, r3 _08129F4A: ldr r1, [r7] @@ -7038,7 +7038,7 @@ _0812A398: thumb_func_start sub_812A39C sub_812A39C: @ 812A39C push {lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 @@ -7075,7 +7075,7 @@ sub_812A3D4: @ 812A3D4 lsrs r0, 24 cmp r0, 0x1 bne _0812A430 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_0203A172 ldrb r2, [r1] ldr r1, =gUnknown_0203A14C @@ -7085,11 +7085,11 @@ sub_812A3D4: @ 812A3D4 lsls r1, 5 ldr r2, =gUnknown_085A5C09 adds r1, r2 - bl CopyString - ldr r4, =gUnknown_02021FC4 + bl StringCopy + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EAA14 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r2, =sub_812A458 adds r0, r5, 0 adds r1, r4, 0 @@ -7097,10 +7097,10 @@ sub_812A3D4: @ 812A3D4 b _0812A444 .pool _0812A430: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EA9E0 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r2, =sub_8127A5C adds r0, r5, 0 adds r1, r4, 0 @@ -7150,10 +7150,10 @@ sub_812A478: @ 812A478 bl sub_8161A38 adds r0, r4, 0 bl sub_8127814 - ldr r5, =gUnknown_02021FC4 + ldr r5, =gStringVar4 ldr r1, =gUnknown_085EAA3D adds r0, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r2, =sub_8127A5C adds r0, r4, 0 adds r1, r5, 0 diff --git a/asm/dewford_trend.s b/asm/dewford_trend.s index 2dfc967ba..aef73f46d 100644 --- a/asm/dewford_trend.s +++ b/asm/dewford_trend.s @@ -9,7 +9,7 @@ sub_81224D4: @ 81224D4 push {r4-r7,lr} movs r6, 0 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr _081224DA: movs r0, 0xA bl sub_811EE38 @@ -19,7 +19,7 @@ _081224DA: ldr r2, =0x00002e6c adds r1, r2 strh r0, [r1] - bl GenerateRandomNumber + bl Random movs r1, 0x1 ands r1, r0 cmp r1, 0 @@ -41,7 +41,7 @@ _08122514: adds r1, r2 _08122522: strh r0, [r1] - bl GenerateRandomNumber + bl Random ldr r3, [r5] adds r3, r4 movs r2, 0x1 @@ -66,7 +66,7 @@ _08122522: lsrs r6, r0, 16 cmp r6, 0x4 bls _081224DA - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002e68 adds r0, r1 @@ -109,7 +109,7 @@ _081225AA: lsls r0, r3, 3 ldr r4, =0x00002e68 adds r0, r4 - ldr r3, =gUnknown_03005D8C + ldr r3, =gSaveBlock1Ptr ldr r1, [r3] adds r5, r1, r0 ldrb r6, [r5, 0x1] @@ -236,7 +236,7 @@ _0812269E: bhi _081226AE b _081225AA _081226AE: - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] ldr r1, =0x00002e68 adds r0, r1 @@ -286,7 +286,7 @@ _081226F8: lsls r0, 24 cmp r0, 0 bne _08122744 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] mov r0, r8 ldrh r2, [r0] @@ -317,7 +317,7 @@ _08122744: bl sub_8122B28 movs r5, 0 _08122762: - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr lsls r4, r5, 3 ldr r1, =0x00002e68 adds r0, r4, r1 @@ -576,7 +576,7 @@ _08122946: movs r2, 0x2 bl sub_8122804 adds r4, r7, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002e68 adds r1, r0 @@ -613,13 +613,13 @@ _08122980: thumb_func_start sub_8122998 sub_8122998: @ 8122998 push {lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r1, 3 ldr r0, [r2] adds r1, r0 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r2, =0x00002e6c adds r1, r2 movs r2, 0x2 @@ -634,7 +634,7 @@ sub_8122998: @ 8122998 sub_81229C8: @ 81229C8 push {r4,lr} movs r4, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r3, [r0] ldr r1, =0x00002e68 adds r0, r3, r1 @@ -678,7 +678,7 @@ _08122A0C: thumb_func_start sub_8122A30 sub_8122A30: @ 8122A30 ldr r2, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r3, =0x00002e6c adds r1, r0, r3 @@ -801,7 +801,7 @@ _08122B16: movs r0, 0x1 b _08122B22 _08122B1A: - bl GenerateRandomNumber + bl Random movs r1, 0x1 ands r0, r1 _08122B22: @@ -814,7 +814,7 @@ _08122B22: sub_8122B28: @ 8122B28 push {r4,r5,lr} adds r5, r0, 0 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x62 @@ -823,7 +823,7 @@ sub_8122B28: @ 8122B28 lsrs r4, r0, 16 cmp r4, 0x32 bls _08122B6A - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x62 @@ -832,7 +832,7 @@ sub_8122B28: @ 8122B28 lsrs r4, r0, 16 cmp r4, 0x50 bls _08122B6A - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x62 @@ -850,7 +850,7 @@ _08122B6A: ands r0, r2 orrs r0, r1 strh r0, [r5] - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r4, 0x1 @@ -864,7 +864,7 @@ _08122B6A: ands r1, r2 orrs r1, r0 strb r1, [r5] - bl GenerateRandomNumber + bl Random strh r0, [r5, 0x2] pop {r4,r5} pop {r0} @@ -877,7 +877,7 @@ sub_8122BB0: @ 8122BB0 push {r4-r6,lr} adds r5, r0, 0 movs r4, 0 - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr _08122BB8: lsls r1, r4, 3 ldr r0, [r6] diff --git a/asm/diploma.s b/asm/diploma.s index a7b84ff07..bc3daf86b 100644 --- a/asm/diploma.s +++ b/asm/diploma.s @@ -196,7 +196,7 @@ sub_8177A50: @ 8177A50 sub sp, 0x4 lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -261,23 +261,23 @@ pokedex_diploma_something: @ 8177AD4 lsls r1, 1 movs r0, 0x14 bl SetGpuReg - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EE855 - bl CopyString + bl StringCopy b _08177B0C .pool _08177AFC: movs r0, 0x14 movs r1, 0 bl SetGpuReg - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EE84F - bl CopyString + bl StringCopy _08177B0C: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EE85E adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0 movs r2, 0x1 diff --git a/asm/dma3_manager.s b/asm/dma3_manager.s deleted file mode 100644 index 74832b527..000000000 --- a/asm/dma3_manager.s +++ /dev/null @@ -1,555 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start ClearDma3Requests -@ void ClearDma3Requests() -ClearDma3Requests: @ 8000BB8 - push {lr} - ldr r2, =gDma3ManagerLocked - movs r0, 0x1 - strb r0, [r2] - ldr r1, =gDma3RequestCursor - movs r0, 0 - strb r0, [r1] - movs r3, 0 - ldr r0, =gDma3Requests - movs r1, 0x7F -_8000BCC: - strh r3, [r0, 0x8] - str r3, [r0] - str r3, [r0, 0x4] - adds r0, 0x10 - subs r1, 0x1 - cmp r1, 0 - bge _8000BCC - movs r0, 0 - strb r0, [r2] - pop {r0} - bx r0 - .pool - thumb_func_end ClearDma3Requests - - thumb_func_start ProcessDma3Requests -@ void ProcessDma3Requests() -ProcessDma3Requests: @ 8000BF0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - ldr r0, =gDma3ManagerLocked - ldrb r0, [r0] - cmp r0, 0 - beq _08000C06 - b _08000E46 -_08000C06: - movs r0, 0 - str r0, [sp, 0x8] - ldr r1, =gDma3Requests - ldr r2, =gDma3RequestCursor - ldrb r0, [r2] - lsls r0, 4 - adds r0, r1 - ldrh r0, [r0, 0x8] - mov r12, r2 - cmp r0, 0 - bne _08000C1E - b _08000E46 -_08000C1E: - mov r8, r1 - adds r1, 0x4 - mov r10, r1 - movs r6, 0x80 - lsls r6, 5 - ldr r7, =REG_DMA3 - movs r2, 0 - mov r9, r2 -_08000C2E: - mov r3, r12 - ldrb r0, [r3] - lsls r5, r0, 4 - mov r0, r8 - adds r1, r5, r0 - ldrh r0, [r1, 0x8] - ldr r2, [sp, 0x8] - adds r0, r2, r0 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x8] - movs r0, 0xA0 - lsls r0, 8 - ldr r3, [sp, 0x8] - cmp r3, r0 - bls _08000C50 - b _08000E46 -_08000C50: - ldr r0, =REG_VCOUNT - ldrb r0, [r0] - cmp r0, 0xE0 - bls _08000C5A - b _08000E46 -_08000C5A: - ldrh r0, [r1, 0xA] - cmp r0, 0x2 - beq _08000CD0 - cmp r0, 0x2 - bgt _08000C80 - cmp r0, 0x1 - beq _08000C8C - b _08000DF0 - .pool -_08000C80: - cmp r0, 0x3 - beq _08000D3C - cmp r0, 0x4 - bne _08000C8A - b _08000D88 -_08000C8A: - b _08000DF0 -_08000C8C: - ldr r3, [r1] - mov r2, r10 - adds r0, r5, r2 - ldr r2, [r0] - ldrh r1, [r1, 0x8] - cmp r1, r6 - bhi _08000CA6 - str r3, [r7] - str r2, [r7, 0x4] - lsrs r0, r1, 2 - movs r1, 0x84 - lsls r1, 24 - b _08000DAA -_08000CA6: - ldr r4, =REG_DMA3 - str r3, [r4] - str r2, [r4, 0x4] - ldr r0, =0x84000400 - str r0, [r4, 0x8] - ldr r0, [r4, 0x8] - adds r3, r6 - adds r2, r6 - subs r1, r6 - cmp r1, r6 - bhi _08000CA6 - str r3, [r4] - str r2, [r4, 0x4] - lsrs r0, r1, 2 - movs r1, 0x84 - lsls r1, 24 - b _08000D76 - .pool -_08000CD0: - mov r3, r10 - adds r0, r5, r3 - ldr r4, [r0] - ldrh r1, [r1, 0x8] - cmp r1, r6 - bhi _08000CF4 - mov r0, r8 - adds r0, 0xC - adds r0, r5, r0 - ldr r0, [r0] - str r0, [sp] - mov r5, sp - str r5, [r7] - str r4, [r7, 0x4] - lsrs r0, r1, 2 - movs r1, 0x85 - lsls r1, 24 - b _08000DAA -_08000CF4: - mov r2, r12 - ldrb r0, [r2] - lsls r0, 4 - mov r5, r8 - adds r5, 0xC - adds r0, r5 - ldr r0, [r0] - str r0, [sp] - ldr r3, =REG_DMA3 - mov r0, sp - str r0, [r3] - str r4, [r3, 0x4] - ldr r0, =0x85000400 - str r0, [r3, 0x8] - ldr r0, [r3, 0x8] - adds r4, r6 - subs r1, r6 - cmp r1, r6 - bhi _08000CF4 - ldrb r0, [r2] - lsls r0, 4 - adds r0, r5 - ldr r0, [r0] - str r0, [sp] - mov r2, sp - str r2, [r3] - str r4, [r3, 0x4] - lsrs r0, r1, 2 - movs r1, 0x85 - lsls r1, 24 - b _08000DEA - .pool -_08000D3C: - ldr r3, [r1] - mov r2, r10 - adds r0, r5, r2 - ldr r2, [r0] - ldrh r1, [r1, 0x8] - cmp r1, r6 - bhi _08000D56 - str r3, [r7] - str r2, [r7, 0x4] - lsrs r0, r1, 1 - movs r1, 0x80 - lsls r1, 24 - b _08000DAA -_08000D56: - ldr r4, =REG_DMA3 - str r3, [r4] - str r2, [r4, 0x4] - ldr r0, =0x80000800 - str r0, [r4, 0x8] - ldr r0, [r4, 0x8] - adds r3, r6 - adds r2, r6 - subs r1, r6 - cmp r1, r6 - bhi _08000D56 - str r3, [r4] - str r2, [r4, 0x4] - lsrs r0, r1, 1 - movs r1, 0x80 - lsls r1, 24 -_08000D76: - orrs r0, r1 - str r0, [r4, 0x8] - ldr r0, [r4, 0x8] - b _08000DF0 - .pool -_08000D88: - mov r3, r10 - adds r0, r5, r3 - ldr r2, [r0] - ldrh r4, [r1, 0x8] - add r1, sp, 0x4 - cmp r4, r6 - bhi _08000DB2 - mov r0, r8 - adds r0, 0xC - adds r0, r5, r0 - ldr r0, [r0] - strh r0, [r1] - str r1, [r7] - str r2, [r7, 0x4] - lsrs r0, r4, 1 - movs r1, 0x81 - lsls r1, 24 -_08000DAA: - orrs r0, r1 - str r0, [r7, 0x8] - ldr r0, [r7, 0x8] - b _08000DF0 -_08000DB2: - mov r5, r12 - ldrb r0, [r5] - lsls r0, 4 - ldr r3, =gUnknown_0300001C - adds r0, r3 - ldr r0, [r0] - strh r0, [r1] - ldr r3, =REG_DMA3 - str r1, [r3] - str r2, [r3, 0x4] - ldr r0, =0x81000800 - str r0, [r3, 0x8] - ldr r0, [r3, 0x8] - adds r2, r6 - subs r4, r6 - cmp r4, r6 - bhi _08000DB2 - ldrb r0, [r5] - lsls r0, 4 - ldr r5, =gUnknown_0300001C - adds r0, r5 - ldr r0, [r0] - strh r0, [r1] - str r1, [r3] - str r2, [r3, 0x4] - lsrs r0, r4, 1 - movs r1, 0x81 - lsls r1, 24 -_08000DEA: - orrs r0, r1 - str r0, [r3, 0x8] - ldr r0, [r3, 0x8] -_08000DF0: - ldr r1, =gDma3Requests - mov r3, r12 - ldrb r0, [r3] - lsls r0, 4 - adds r0, r1 - mov r2, r9 - str r2, [r0] - ldrb r0, [r3] - lsls r0, 4 - add r0, r10 - str r2, [r0] - ldrb r0, [r3] - lsls r0, 4 - adds r0, r1 - movs r4, 0 - strh r2, [r0, 0x8] - ldrb r0, [r3] - lsls r0, 4 - adds r0, r1 - mov r5, r9 - strh r5, [r0, 0xA] - ldrb r0, [r3] - lsls r0, 4 - adds r1, 0xC - adds r0, r1 - mov r1, r9 - str r1, [r0] - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - lsls r0, 24 - cmp r0, 0 - bge _08000E34 - strb r4, [r3] -_08000E34: - mov r2, r12 - ldrb r0, [r2] - lsls r0, 4 - ldr r3, =gDma3Requests - adds r0, r3 - ldrh r0, [r0, 0x8] - cmp r0, 0 - beq _08000E46 - b _08000C2E -_08000E46: - 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 ProcessDma3Requests - - thumb_func_start RequestDma3Copy -@ int RequestDma3Copy(void *src, void *dest, u16 size, u8 mode) -RequestDma3Copy: @ 8000E68 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r12, r0 - mov r8, r1 - lsls r2, 16 - lsrs r7, r2, 16 - lsls r3, 24 - lsrs r4, r3, 24 - movs r5, 0 - ldr r1, =gDma3ManagerLocked - movs r0, 0x1 - strb r0, [r1] - ldr r0, =gDma3RequestCursor - ldrb r2, [r0] - mov r10, r1 - ldr r6, =gDma3Requests - mov r9, r6 - lsls r0, r2, 4 - adds r1, r0, r6 -_08000E94: - lsls r3, r2, 4 - ldrh r0, [r1, 0x8] - cmp r0, 0 - bne _08000ED4 - mov r0, r12 - str r0, [r1] - mov r0, r9 - adds r0, 0x4 - adds r0, r3, r0 - mov r3, r8 - str r3, [r0] - strh r7, [r1, 0x8] - cmp r4, 0x1 - bne _08000EC0 - strh r4, [r1, 0xA] - b _08000EC4 - .pool -_08000EC0: - movs r0, 0x3 - strh r0, [r1, 0xA] -_08000EC4: - movs r0, 0 - ldr r1, =gDma3ManagerLocked - strb r0, [r1] - lsls r0, r2, 16 - asrs r0, 16 - b _08000EF0 - .pool -_08000ED4: - adds r1, 0x10 - adds r2, 0x1 - cmp r2, 0x7F - ble _08000EE0 - adds r1, r6, 0 - movs r2, 0 -_08000EE0: - adds r5, 0x1 - cmp r5, 0x7F - ble _08000E94 - movs r0, 0 - mov r3, r10 - strb r0, [r3] - movs r0, 0x1 - negs r0, r0 -_08000EF0: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end RequestDma3Copy - - thumb_func_start RequestDma3Fill -@ int RequestDma3Fill(s32 value, void *dest, u16 size, u8 mode) -RequestDma3Fill: @ 8000F00 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r9, r0 - mov r8, r1 - lsls r2, 16 - lsrs r7, r2, 16 - lsls r3, 24 - lsrs r5, r3, 24 - movs r6, 0 - ldr r0, =gDma3RequestCursor - ldrb r2, [r0] - ldr r1, =gDma3ManagerLocked - movs r0, 0x1 - strb r0, [r1] - mov r10, r1 - ldr r0, =gDma3Requests - mov r12, r0 - mov r4, r12 - lsls r0, r2, 4 - adds r0, 0x8 - adds r1, r0, r4 -_8000F30: - lsls r3, r2, 4 - ldrh r0, [r1] - cmp r0, 0 - bne _08000F78 - adds r0, r4, 0x4 - adds r0, r3, r0 - mov r6, r8 - str r6, [r0] - strh r7, [r1] - strh r5, [r1, 0x2] - adds r0, r4, 0 - adds r0, 0xC - adds r0, r3, r0 - mov r3, r9 - str r3, [r0] - cmp r5, 0x1 - bne _08000F64 - movs r0, 0x2 - b _08000F66 - .pool -_08000F64: - movs r0, 0x4 -_08000F66: - strh r0, [r1, 0x2] - movs r0, 0 - ldr r6, =gDma3ManagerLocked - strb r0, [r6] - lsls r0, r2, 16 - asrs r0, 16 - b _08000F96 - .pool -_08000F78: - adds r1, 0x10 - adds r2, 0x1 - cmp r2, 0x7F - ble _08000F86 - mov r1, r12 - adds r1, 0x8 - movs r2, 0 -_08000F86: - adds r6, 0x1 - cmp r6, 0x7F - ble _8000F30 - movs r0, 0 - mov r1, r10 - strb r0, [r1] - movs r0, 0x1 - negs r0, r0 -_08000F96: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end RequestDma3Fill - - thumb_func_start CheckForSpaceForDma3Request -@ int CheckForSpaceForDma3Request(s16 index) -CheckForSpaceForDma3Request: @ 8000FA4 - push {lr} - movs r2, 0 - lsls r0, 16 - asrs r1, r0, 16 - movs r3, 0x1 - negs r3, r3 - cmp r1, r3 - bne _08000FCC - ldr r1, =gDma3Requests -_08000FB6: - ldrh r0, [r1, 0x8] - cmp r0, 0 - bne _08000FD8 - adds r1, 0x10 - adds r2, 0x1 - cmp r2, 0x7F - ble _08000FB6 -_08000FC4: - movs r0, 0 - b _08000FDC - .pool -_08000FCC: - ldr r0, =gDma3Requests - lsls r1, 4 - adds r1, r0 - ldrh r0, [r1, 0x8] - cmp r0, 0 - beq _08000FC4 -_08000FD8: - movs r0, 0x1 - negs r0, r0 -_08000FDC: - pop {r1} - bx r1 - .pool - thumb_func_end CheckForSpaceForDma3Request - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/easy_chat.s b/asm/easy_chat.s index 7bbe31ff0..d967dd140 100644 --- a/asm/easy_chat.s +++ b/asm/easy_chat.s @@ -396,35 +396,35 @@ _0811A510: .4byte _0811A7AC .4byte _0811A7BC _0811A564: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002bb0 adds r4, r0, r1 b _0811A7C2 .pool _0811A578: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00002bbc adds r4, r0, r2 b _0811A7C2 .pool _0811A58C: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r3, =0x00002bc8 adds r4, r0, r3 b _0811A7C2 .pool _0811A5A0: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002bd4 adds r4, r0, r1 b _0811A7C2 .pool _0811A5B4: - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E2 ldrh r1, [r0] lsls r0, r1, 3 @@ -437,7 +437,7 @@ _0811A5B4: b _0811A7C2 .pool _0811A5D8: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00002e36 adds r1, r0, r2 @@ -455,7 +455,7 @@ _0811A5E6: b _0811A7C2 .pool _0811A604: - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E2 ldrh r1, [r0] lsls r0, r1, 3 @@ -470,7 +470,7 @@ _0811A604: b _0811A7C2 .pool _0811A630: - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E2 ldrh r1, [r0] lsls r0, r1, 3 @@ -489,7 +489,7 @@ _0811A630: b _0811A7C2 .pool _0811A664: - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E2 ldrh r1, [r0] lsls r0, r1, 3 @@ -503,8 +503,8 @@ _0811A664: b _0811A7C2 .pool _0811A688: - ldr r4, =gUnknown_02021EC4 - ldr r1, =gUnknown_03005D8C + ldr r4, =gStringVar3 + ldr r1, =gSaveBlock1Ptr ldr r0, [r1] ldr r2, =0x00002e6c adds r0, r2 @@ -518,7 +518,7 @@ _0811A688: b _0811A7C2 .pool _0811A6B4: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002baa adds r4, r0, r1 @@ -529,7 +529,7 @@ _0811A6B4: b _0811A7C2 .pool _0811A6D4: - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E2 ldrh r1, [r0] lsls r0, r1, 3 @@ -548,7 +548,7 @@ _0811A6D4: b _0811A7C2 .pool _0811A708: - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E2 ldrh r1, [r0] lsls r0, r1, 3 @@ -562,14 +562,14 @@ _0811A708: b _0811A7C2 .pool _0811A72C: - ldr r4, =gUnknown_02021EC4 + ldr r4, =gStringVar3 adds r0, r4, 0 movs r1, 0x2 bl sub_811F88C b _0811A7C2 .pool _0811A73C: - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E2 ldrh r1, [r0] lsls r0, r1, 3 @@ -588,28 +588,28 @@ _0811A73C: b _0811A7C2 .pool _0811A770: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r3, =0x00003b6e adds r4, r0, r3 b _0811A7C2 .pool _0811A784: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003b5a adds r4, r0, r1 b _0811A7C2 .pool _0811A798: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00003b6c adds r4, r0, r2 b _0811A7C2 .pool _0811A7AC: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r3, 0x82 lsls r3, 1 @@ -638,7 +638,7 @@ _0811A7D4: sub_811A7E4: @ 811A7E4 push {lr} bl UpdatePaletteFade - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -661,7 +661,7 @@ _0811A80E: ands r0, r1 cmp r0, 0 bne _0811A84E - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003b58 adds r0, r1 @@ -672,7 +672,7 @@ _0811A80E: b _0811A84E .pool _0811A840: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -756,7 +756,7 @@ sub_811A8A4: @ 811A8A4 thumb_func_start sub_811A8CC sub_811A8CC: @ 811A8CC push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =0x00003b6e adds r1, r0 @@ -772,7 +772,7 @@ sub_811A8CC: @ 811A8CC thumb_func_start sub_811A8F0 sub_811A8F0: @ 811A8F0 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =0x00003b5a adds r1, r0 @@ -788,7 +788,7 @@ sub_811A8F0: @ 811A8F0 thumb_func_start sub_811A914 sub_811A914: @ 811A914 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =0x00003b6c adds r1, r0 @@ -804,7 +804,7 @@ sub_811A914: @ 811A914 thumb_func_start sub_811A938 sub_811A938: @ 811A938 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =0x00003b5a adds r1, r0 @@ -1084,7 +1084,7 @@ _0811AB64: thumb_func_start sub_811AB68 sub_811AB68: @ 811AB68 push {r4-r7,lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -1274,7 +1274,7 @@ _0811ACCC: thumb_func_start sub_811ACDC sub_811ACDC: @ 811ACDC push {r4-r6,lr} - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r0, 0x1 ands r0, r1 @@ -1456,7 +1456,7 @@ _0811AE32: thumb_func_start sub_811AE44 sub_811AE44: @ 811AE44 push {lr} - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldrh r2, [r1, 0x2E] movs r0, 0x2 ands r0, r2 @@ -1557,7 +1557,7 @@ _0811AEFA: thumb_func_start sub_811AF00 sub_811AF00: @ 811AF00 push {lr} - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r0, 0x2 ands r0, r1 @@ -1769,7 +1769,7 @@ _0811B086: thumb_func_start sub_811B08C sub_811B08C: @ 811B08C push {lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -1797,7 +1797,7 @@ _0811B0B8: thumb_func_start sub_811B0BC sub_811B0BC: @ 811B0BC push {lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -3632,7 +3632,7 @@ _0811BD7C: movs r0, 0 b _0811BD9C _0811BD80: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r2, 0 ldr r3, =0x0000ffff @@ -3666,7 +3666,7 @@ sub_811BDB0: @ 811BDB0 b _0811BDDE .pool _0811BDC8: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003b58 adds r0, r1 @@ -3689,13 +3689,13 @@ sub_811BDF0: @ 811BDF0 push {r4-r6,lr} sub sp, 0x20 adds r6, r0, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r4, [r0] bl sub_81AFBF0 ldr r0, =0x00003b70 adds r5, r4, r0 adds r0, r5, 0 - bl GetStringLength + bl StringLength lsls r0, 16 cmp r0, 0 beq _0811BE34 @@ -3732,7 +3732,7 @@ sub_811BE54: @ 811BE54 ldr r0, [r0] adds r4, r0, 0 adds r4, 0x3C - ldr r2, =gUnknown_02021DC4 + ldr r2, =gStringVar2 movs r5, 0 b _0811BE86 .pool @@ -6261,7 +6261,7 @@ _0811D32C: strb r0, [r1, 0xB] adds r0, r2, 0 add r1, sp, 0xC - bl AppendString + bl StringAppend adds r2, r0, 0 movs r5, 0 lsls r0, r7, 4 @@ -6316,7 +6316,7 @@ _0811D3A8: _0811D3AE: adds r0, r2, 0 add r1, sp, 0xC - bl AppendString + bl StringAppend adds r2, r0, 0 cmp r6, 0x2 beq _0811D3C4 @@ -9006,7 +9006,7 @@ _0811E852: movs r1, 0x2 bl StartObjectImageAnim _0811E892: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] movs r1, 0x69 @@ -9456,7 +9456,7 @@ _0811EBD8: adds r1, r0, 0 _0811EBEA: adds r0, r5, 0 - bl CopyString + bl StringCopy b _0811EC02 .pool _0811EBFC: @@ -9695,7 +9695,7 @@ _0811ED94: _0811EDB0: ldr r0, =gUnknown_085EEA42 _0811EDB2: - bl GetStringLength + bl StringLength lsls r0, 16 lsrs r0, 16 _0811EDBA: @@ -9777,7 +9777,7 @@ sub_811EE38: @ 811EE38 push {r4,lr} lsls r0, 16 lsrs r4, r0, 16 - bl GenerateRandomNumber + bl Random ldr r2, =gEasyChatGroups lsls r1, r4, 3 adds r1, r2 @@ -9868,7 +9868,7 @@ _0811EEE4: beq _0811EF3C b _0811EF58 _0811EEEE: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002bb0 adds r5, r0, r1 @@ -9876,7 +9876,7 @@ _0811EEEE: b _0811EF46 .pool _0811EF04: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002bbc adds r5, r0, r1 @@ -9893,13 +9893,13 @@ _0811EF04: b _0811EF48 .pool _0811EF2C: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002bc8 b _0811EF42 .pool _0811EF3C: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002bd4 _0811EF42: @@ -9909,7 +9909,7 @@ _0811EF44: _0811EF46: movs r3, 0x2 _0811EF48: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 adds r0, r4, 0 adds r1, r5, 0 bl ConvertEasyChatWordsToString @@ -9925,7 +9925,7 @@ _0811EF58: thumb_func_start sub_811EF6C sub_811EF6C: @ 811EF6C push {lr} - bl GenerateRandomNumber + bl Random movs r1, 0x1 ands r1, r0 movs r0, 0xC @@ -9937,7 +9937,7 @@ _0811EF7E: adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 bl CopyEasyChatWord pop {r0} bx r0 @@ -9952,7 +9952,7 @@ sub_811EF98: @ 811EF98 lsls r1, 19 ands r1, r0 lsrs r1, 24 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r3, =0x00002e20 adds r0, r3 @@ -9975,7 +9975,7 @@ sub_811EFC0: @ 811EFC0 lsrs r3, r0, 27 movs r2, 0x7 ands r2, r1 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =0x00002e20 adds r1, r0 @@ -10039,7 +10039,7 @@ _0811F02C: b _0811F084 .pool _0811F048: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x21 @@ -10096,7 +10096,7 @@ _0811F0A0: b _0811F0EC .pool _0811F0B4: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r5, 0 @@ -10158,7 +10158,7 @@ _0811F11A: b _0811F174 .pool _0811F128: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r4, 0 @@ -10206,7 +10206,7 @@ _0811F174: sub_811F184: @ 811F184 push {r4-r7,lr} movs r2, 0 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r4, =0x00002bb0 ldr r3, =gUnknown_0859E62C _0811F18E: @@ -10223,7 +10223,7 @@ _0811F18E: cmp r2, 0x3 bls _0811F18E movs r2, 0 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r4, =0x00002bbc ldr r3, =gUnknown_0859E634 _0811F1AE: @@ -10240,7 +10240,7 @@ _0811F1AE: cmp r2, 0x5 bls _0811F1AE movs r2, 0 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r4, =0x00002bc8 ldr r3, =gUnknown_0859E640 _0811F1CE: @@ -10257,7 +10257,7 @@ _0811F1CE: cmp r2, 0x5 bls _0811F1CE movs r2, 0 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r4, =0x00002bd4 ldr r3, =gUnknown_0859E64C _0811F1EE: @@ -10274,7 +10274,7 @@ _0811F1EE: cmp r2, 0x5 bls _0811F1EE movs r2, 0 - ldr r7, =gUnknown_03005D8C + ldr r7, =gSaveBlock1Ptr ldr r6, =0x00002be0 ldr r0, =0x0000ffff adds r5, r0, 0 @@ -10303,7 +10303,7 @@ _0811F218: cmp r2, 0xF bls _0811F210 movs r2, 0 - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r3, =0x00002e20 movs r1, 0 _0811F244: @@ -10512,7 +10512,7 @@ sub_811F3E0: @ 811F3E0 adds r1, r0 ldr r1, [r1] adds r0, r4, 0 - bl CopyString + bl StringCopy adds r1, r0, 0 subs r4, r1, r4 lsls r4, 16 diff --git a/asm/egg_hatch.s b/asm/egg_hatch.s index 5a13ee9b7..16c1be474 100644 --- a/asm/egg_hatch.s +++ b/asm/egg_hatch.s @@ -16,7 +16,7 @@ sub_8071348: @ 8071348 adds r5, r0, 0 adds r6, r1, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x3C] @@ -41,7 +41,7 @@ _08071386: adds r1, r4, 0 adds r1, 0xD adds r0, r5, 0 - bl pokemon_getattr + bl GetMonData lsls r1, r4, 1 add r1, sp adds r1, 0x10 @@ -53,14 +53,14 @@ _08071386: bls _08071386 adds r0, r5, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData mov r9, r0 movs r4, 0 _080713AE: adds r1, r4, 0 adds r1, 0x27 adds r0, r5, 0 - bl pokemon_getattr + bl GetMonData lsls r1, r4, 2 adds r1, r7, r1 str r0, [r1] @@ -71,26 +71,26 @@ _080713AE: bls _080713AE adds r0, r5, 0 movs r1, 0x3 - bl pokemon_getattr + bl GetMonData mov r1, r8 strb r0, [r1] adds r0, r5, 0 movs r1, 0x25 - bl pokemon_getattr + bl GetMonData mov r1, r10 strb r0, [r1] adds r0, r5, 0 movs r1, 0x8 - bl pokemon_getattr + bl GetMonData ldr r1, [sp, 0x40] strb r0, [r1] adds r0, r5, 0 movs r1, 0x22 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x38] adds r0, r5, 0 movs r1, 0x50 - bl pokemon_getattr + bl GetMonData ldr r1, [sp, 0x48] strb r0, [r1] movs r0, 0x1 @@ -189,9 +189,9 @@ sub_80714B8: @ 80714B8 movs r1, 0x64 adds r5, r0, 0 muls r5, r1 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r0 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r5, 0 bl sub_8071348 adds r0, r5, 0 @@ -200,7 +200,7 @@ sub_80714B8: @ 80714B8 bl pokemon_setattr adds r0, r5, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 @@ -222,7 +222,7 @@ sub_80714B8: @ 80714B8 adds r0, r4, 0 movs r1, 0x3 bl pokedex_flag_operation - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 adds r0, r5, 0 bl pokemon_get_nick mov r2, sp @@ -288,29 +288,29 @@ sub_807158C: @ 807158C adds r6, 0x7C mov r0, sp adds r1, r6, 0 - bl CompareStringWithoutExtendedControlCodes + bl StringCompareWithoutExtCtrlCodes adds r5, r4, 0 adds r5, 0x74 cmp r0, 0 bne _080715CE - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r1, r5, 0 - bl CompareStringWithoutExtendedControlCodes + bl StringCompareWithoutExtCtrlCodes cmp r0, 0 beq _08071608 _080715CE: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 mov r1, sp - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 adds r4, 0x87 ldrb r2, [r4] lsls r2, 28 lsrs r2, 28 adds r1, r5, 0 bl sub_81DB5E8 - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldrb r2, [r4] lsrs r2, 4 adds r1, r6, 0 @@ -330,7 +330,7 @@ _0807160A: thumb_func_start sub_8071614 sub_8071614: @ 8071614 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003030 adds r0, r1 @@ -366,7 +366,7 @@ sub_807163C: @ 807163C bne _0807166A movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r1, r0 movs r4, 0x1 _0807166A: @@ -375,7 +375,7 @@ _0807166A: movs r0, 0x64 adds r1, r2, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r1, r0 movs r4, 0x3 _0807167A: @@ -388,13 +388,13 @@ _0807167A: _08071688: adds r0, r5, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData adds r3, r0, 0 lsls r0, r4, 3 ldr r1, =gMonFrontPicTable @@ -510,7 +510,7 @@ _08071788: c1_hatching_egg: @ 80717A0 push {r4,lr} sub sp, 0x4 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -696,7 +696,7 @@ _08071970: movs r0, 0x1 bl CopyBgTilemapBufferToVram _080719A6: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -732,9 +732,9 @@ sub_80719FC: @ 80719FC ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 - ldr r2, =gUnknown_02021EC4 + ldr r2, =gStringVar3 movs r1, 0x2 bl pokemon_setattr bl sub_805F094 @@ -922,10 +922,10 @@ _08071BBC: ldrb r1, [r2, 0x4] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r7, r0, 16 ldr r0, [r5] @@ -966,14 +966,14 @@ _08071C24: ldrb r1, [r0, 0x4] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl pokemon_get_nick - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085ED5A5 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r0, [r5] ldrb r0, [r0, 0x8] movs r1, 0xFF @@ -1018,14 +1018,14 @@ _08071CA4: ldrb r1, [r0, 0x4] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl pokemon_get_nick - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085ED5BE adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r0, [r5] ldrb r0, [r0, 0x8] movs r1, 0x1 @@ -1085,9 +1085,9 @@ _08071D3C: ldrb r0, [r0, 0x4] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5 - ldr r1, =gUnknown_02021EC4 + ldr r1, =gStringVar3 mov r9, r1 bl pokemon_get_nick mov r1, r8 @@ -1096,7 +1096,7 @@ _08071D3C: muls r0, r6 adds r0, r5 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r7, r0, 16 mov r1, r8 @@ -1115,7 +1115,7 @@ _08071D3C: adds r0, r5 movs r1, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp] ldr r0, =sub_80719FC str r0, [sp, 0x4] @@ -1205,7 +1205,7 @@ _08071E54: movs r1, 0x30 ldrsh r0, [r4, r1] movs r1, 0x1 - bl sine + bl Sin strh r0, [r4, 0x24] movs r1, 0x2E ldrsh r0, [r4, r1] @@ -1257,7 +1257,7 @@ _08071EBC: movs r1, 0x30 ldrsh r0, [r4, r1] movs r1, 0x2 - bl sine + bl Sin strh r0, [r4, 0x24] movs r1, 0x2E ldrsh r0, [r4, r1] @@ -1301,10 +1301,10 @@ sub_8071EF0: @ 8071EF0 ldrb r1, [r0, 0x4] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData ldr r3, =gUnknown_02020630 ldr r2, [r4] ldrb r1, [r2, 0x1] @@ -1330,7 +1330,7 @@ _08071F5C: movs r1, 0x30 ldrsh r0, [r4, r1] movs r1, 0x2 - bl sine + bl Sin strh r0, [r4, 0x24] movs r1, 0x2E ldrsh r0, [r4, r1] @@ -1584,7 +1584,7 @@ sub_8072140: @ 8072140 ldrh r4, [r0] adds r3, 0x1 strb r3, [r6, 0x7] - bl GenerateRandomNumber + bl Random lsls r0, 16 movs r1, 0xC0 lsls r1, 10 @@ -1745,11 +1745,11 @@ _0807229C: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x6 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _080722CC adds r0, r4, 0 diff --git a/asm/event_data.s b/asm/event_data.s new file mode 100644 index 000000000..0ae8b4eb7 --- /dev/null +++ b/asm/event_data.s @@ -0,0 +1,565 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_809D300 +sub_809D300: @ 809D300 + push {r4,lr} + ldr r4, =gSaveBlock1Ptr + ldr r0, [r4] + ldr r1, =0x00001270 + adds r0, r1 + movs r2, 0x96 + lsls r2, 1 + movs r1, 0 + bl memset + ldr r0, [r4] + ldr r1, =0x0000139c + adds r0, r1 + movs r2, 0x80 + lsls r2, 2 + movs r1, 0 + bl memset + ldr r0, =gUnknown_020375FC + movs r1, 0 + movs r2, 0x10 + bl memset + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D300 + + thumb_func_start sub_809D344 +sub_809D344: @ 809D344 + push {lr} + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00001270 + adds r2, r0, r1 + movs r1, 0 + str r1, [r2] + ldr r1, =0x0000139c + adds r0, r1 + movs r1, 0 + movs r2, 0x20 + bl memset + ldr r0, =0x000008ad + bl FlagReset + ldr r0, =0x000008ae + bl FlagReset + ldr r0, =0x00000889 + bl FlagReset + ldr r0, =0x000008c1 + bl FlagReset + movs r0, 0x88 + lsls r0, 4 + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D344 + + thumb_func_start sub_809D3A0 +sub_809D3A0: @ 809D3A0 + push {lr} + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00001394 + adds r0, r1 + movs r1, 0 + movs r2, 0x8 + bl memset + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D3A0 + + thumb_func_start sub_809D3C0 +sub_809D3C0: @ 809D3C0 + push {lr} + ldr r0, =0x00004046 + bl GetVarPointer + ldr r1, =gSaveBlock2Ptr + ldr r2, [r1] + movs r1, 0 + strb r1, [r2, 0x1A] + strh r1, [r0] + ldr r0, =0x00000896 + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D3C0 + + thumb_func_start sub_809D3E8 +sub_809D3E8: @ 809D3E8 + push {r4,r5,lr} + ldr r0, =0x00004046 + bl GetVarPointer + ldr r4, =gSaveBlock2Ptr + ldr r2, [r4] + movs r5, 0 + movs r1, 0xDA + strb r1, [r2, 0x1A] + ldr r2, =0x00000302 + adds r1, r2, 0 + strh r1, [r0] + ldr r0, =0x00000896 + bl FlagSet + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x19] + ldr r0, [r4] + strb r5, [r0, 0x18] + bl sub_80BB358 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D3E8 + + thumb_func_start sub_809D42C +sub_809D42C: @ 809D42C + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldrb r0, [r0, 0x1A] + cmp r0, 0xDA + bne _0809D468 + ldr r0, =0x00004046 + bl VarGet + lsls r0, 16 + ldr r1, =0x03020000 + cmp r0, r1 + bne _0809D468 + ldr r0, =0x00000896 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0809D468 + movs r0, 0x1 + b _0809D46A + .pool +_0809D468: + movs r0, 0 +_0809D46A: + pop {r1} + bx r1 + thumb_func_end sub_809D42C + + thumb_func_start sub_809D470 +sub_809D470: @ 809D470 + push {lr} + ldr r0, =0x000008ac + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D470 + + thumb_func_start sub_809D480 +sub_809D480: @ 809D480 + push {lr} + ldr r0, =0x000008ac + bl FlagSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D480 + + thumb_func_start sub_809D490 +sub_809D490: @ 809D490 + push {lr} + ldr r0, =0x000008ac + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809D490 + + thumb_func_start sub_809D4A4 +sub_809D4A4: @ 809D4A4 + push {lr} + ldr r0, =0x000008db + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D4A4 + + thumb_func_start sub_809D4B4 +sub_809D4B4: @ 809D4B4 + push {lr} + ldr r0, =0x000008db + bl FlagSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D4B4 + + thumb_func_start sub_809D4C4 +sub_809D4C4: @ 809D4C4 + push {lr} + ldr r0, =0x000008db + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809D4C4 + + thumb_func_start sub_809D4D8 +sub_809D4D8: @ 809D4D8 + push {lr} + movs r0, 0xF2 + lsls r0, 1 + bl FlagReset + ldr r0, =0x000001e5 + bl FlagReset + movs r0, 0xF3 + lsls r0, 1 + bl FlagReset + ldr r0, =0x000001e7 + bl FlagReset + movs r0, 0xF4 + lsls r0, 1 + bl FlagReset + ldr r0, =0x000001e9 + bl FlagReset + movs r0, 0xF5 + lsls r0, 1 + bl FlagReset + ldr r0, =0x000001eb + bl FlagReset + movs r0, 0xF6 + lsls r0, 1 + bl FlagReset + ldr r0, =0x000001ed + bl FlagReset + movs r0, 0xF7 + lsls r0, 1 + bl FlagReset + ldr r0, =0x000001ef + bl FlagReset + movs r0, 0xF8 + lsls r0, 1 + bl FlagReset + ldr r0, =0x000001f1 + bl FlagReset + movs r0, 0xF9 + lsls r0, 1 + bl FlagReset + ldr r0, =0x000001f3 + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D4D8 + + thumb_func_start sub_809D570 +sub_809D570: @ 809D570 + push {lr} + ldr r0, =0x000040dd + movs r1, 0 + bl VarSet + ldr r0, =0x000040de + movs r1, 0 + bl VarSet + ldr r0, =0x000040df + movs r1, 0 + bl VarSet + ldr r0, =0x000040e0 + movs r1, 0 + bl VarSet + ldr r0, =0x000040e1 + movs r1, 0 + bl VarSet + ldr r0, =0x000040e2 + movs r1, 0 + bl VarSet + ldr r0, =0x000040e3 + movs r1, 0 + bl VarSet + ldr r0, =0x000040e4 + movs r1, 0 + bl VarSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D570 + + thumb_func_start sub_809D5D8 +sub_809D5D8: @ 809D5D8 + push {lr} + ldr r0, =0x0000402c + movs r1, 0 + bl VarSet + ldr r0, =0x000008c2 + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D5D8 + + thumb_func_start sub_809D5F4 +sub_809D5F4: @ 809D5F4 + push {lr} + ldr r0, =0x0000402c + movs r1, 0x92 + lsls r1, 4 + bl VarSet + ldr r0, =0x000008c2 + bl FlagSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D5F4 + + thumb_func_start sub_809D614 +sub_809D614: @ 809D614 + push {lr} + ldr r0, =0x000008c2 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0809D640 + ldr r0, =0x0000402c + bl VarGet + lsls r0, 16 + movs r1, 0x92 + lsls r1, 20 + cmp r0, r1 + bne _0809D640 + movs r0, 0x1 + b _0809D642 + .pool +_0809D640: + movs r0, 0 +_0809D642: + pop {r1} + bx r1 + thumb_func_end sub_809D614 + + thumb_func_start GetVarPointer +@ u16 *GetVarPointer(u16 varId) +GetVarPointer: @ 809D648 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + adds r2, r1, 0 + ldr r0, =0x00003fff + cmp r1, r0 + bhi _0809D660 + movs r0, 0 + b _0809D688 + .pool +_0809D660: + lsls r0, r1, 16 + cmp r0, 0 + bge _0809D67C + ldr r0, =gUnknown_081DBA0C + ldr r2, =0xffff8000 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + b _0809D688 + .pool +_0809D67C: + ldr r0, =gSaveBlock1Ptr + lsls r1, r2, 1 + ldr r2, =0xffff939c + adds r1, r2 + ldr r0, [r0] + adds r0, r1 +_0809D688: + pop {r1} + bx r1 + .pool + thumb_func_end GetVarPointer + + thumb_func_start VarGet +@ u16 VarGet(u16 varId) +VarGet: @ 809D694 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl GetVarPointer + cmp r0, 0 + beq _0809D6A8 + ldrh r0, [r0] + b _0809D6AA +_0809D6A8: + adds r0, r4, 0 +_0809D6AA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end VarGet + + thumb_func_start VarSet +@ bool8 VarSet(u16 varId, u16 value) +VarSet: @ 809D6B0 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + bl GetVarPointer + cmp r0, 0 + beq _0809D6C8 + strh r4, [r0] + movs r0, 0x1 + b _0809D6CA +_0809D6C8: + movs r0, 0 +_0809D6CA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end VarSet + + thumb_func_start VarGetFieldObjectGraphicsId +@ u8 VarGetFieldObjectGraphicsId(u8 index) +VarGetFieldObjectGraphicsId: @ 809D6D0 + push {lr} + lsls r0, 24 + lsrs r0, 8 + ldr r1, =0x40100000 + adds r0, r1 + lsrs r0, 16 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end VarGetFieldObjectGraphicsId + + thumb_func_start GetFlagPointer +@ u8 *GetFlagPointer(u16 flagId) +GetFlagPointer: @ 809D6EC + push {lr} + lsls r1, r0, 16 + lsrs r2, r1, 16 + adds r3, r2, 0 + cmp r2, 0 + bne _0809D6FC + movs r0, 0 + b _0809D72E +_0809D6FC: + ldr r0, =0x00003fff + cmp r2, r0 + bhi _0809D71C + ldr r0, =gSaveBlock1Ptr + lsrs r1, 19 + ldr r2, =0x00001270 + adds r1, r2 + ldr r0, [r0] + b _0809D72C + .pool +_0809D71C: + ldr r1, =0xffffc000 + adds r0, r3, r1 + cmp r0, 0 + bge _0809D728 + ldr r2, =0xffffc007 + adds r0, r3, r2 +_0809D728: + asrs r0, 3 + ldr r1, =gUnknown_020375FC +_0809D72C: + adds r0, r1 +_0809D72E: + pop {r1} + bx r1 + .pool + thumb_func_end GetFlagPointer + + thumb_func_start FlagSet +@ bool8 FlagSet(u16 flagId) +FlagSet: @ 809D740 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl GetFlagPointer + adds r2, r0, 0 + cmp r2, 0 + beq _0809D760 + movs r0, 0x7 + ands r0, r4 + movs r1, 0x1 + lsls r1, r0 + ldrb r0, [r2] + orrs r1, r0 + strb r1, [r2] +_0809D760: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end FlagSet + + thumb_func_start FlagReset +@ bool8 FlagReset(u16 flagId) +FlagReset: @ 809D768 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl GetFlagPointer + adds r2, r0, 0 + cmp r2, 0 + beq _0809D788 + movs r0, 0x7 + ands r0, r4 + movs r1, 0x1 + lsls r1, r0 + ldrb r0, [r2] + bics r0, r1 + strb r0, [r2] +_0809D788: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end FlagReset + + thumb_func_start FlagGet +@ bool8 FlagGet(u16 flagId) +FlagGet: @ 809D790 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl GetFlagPointer + cmp r0, 0 + beq _0809D7B4 + ldrb r0, [r0] + movs r1, 0x7 + ands r1, r4 + asrs r0, r1 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0809D7B4 + movs r0, 0x1 + b _0809D7B6 +_0809D7B4: + movs r0, 0 +_0809D7B6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end FlagGet + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/evolution_graphics.s b/asm/evolution_graphics.s new file mode 100644 index 000000000..600363266 --- /dev/null +++ b/asm/evolution_graphics.s @@ -0,0 +1,1751 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start nullsub_67 +nullsub_67: @ 817BA40 + bx lr + thumb_func_end nullsub_67 + + thumb_func_start sub_817BA44 +sub_817BA44: @ 817BA44 + push {r4,r5,lr} + sub sp, 0x4 + movs r4, 0 + ldr r5, =gUnknown_085F5458 +_0817BA4C: + adds r0, r4, 0 + adds r0, 0x14 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r4, 1 + adds r1, r5 + ldrh r1, [r1] + str r1, [sp] + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0xB + bls _0817BA4C + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817BA44 + + thumb_func_start sub_817BA7C +sub_817BA7C: @ 817BA7C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x22 + ldrsh r0, [r4, r1] + cmp r0, 0x8 + ble _0817BB2A + movs r2, 0x3C + ldrsh r0, [r4, r2] + adds r1, r0, 0 + muls r1, r0 + adds r0, r1, 0 + movs r1, 0x50 + bl __divsi3 + movs r1, 0x58 + subs r1, r0 + strh r1, [r4, 0x22] + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl Sin + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0817BAB6 + adds r0, 0x3 +_0817BAB6: + asrs r0, 2 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl Cos + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x3A] + adds r0, 0x4 + strh r0, [r4, 0x3A] + ldrh r1, [r4, 0x3C] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0817BAE0 + ldrh r0, [r4, 0x38] + subs r0, 0x1 + strh r0, [r4, 0x38] +_0817BAE0: + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + movs r1, 0x26 + ldrsh r0, [r4, r1] + cmp r0, 0 + ble _0817BAF6 + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x1 + b _0817BAFC +_0817BAF6: + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x14 +_0817BAFC: + strb r0, [r1] + movs r2, 0x38 + ldrsh r0, [r4, r2] + cmp r0, 0 + bge _0817BB08 + adds r0, 0x3 +_0817BB08: + asrs r0, 2 + adds r0, 0x14 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x1F + bls _0817BB16 + movs r2, 0x1F +_0817BB16: + movs r0, 0x1F + ands r2, r0 + lsls r2, 1 + ldrb r1, [r4, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x3] + b _0817BB30 +_0817BB2A: + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_0817BB30: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_817BA7C + + thumb_func_start sub_817BB38 +sub_817BB38: @ 817BB38 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gUnknown_085F5440 + movs r1, 0x78 + movs r2, 0x58 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _0817BB82 + ldr r4, =gUnknown_02020630 + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r2, r3, r4 + movs r1, 0 + movs r0, 0x30 + strh r0, [r2, 0x38] + strh r5, [r2, 0x3A] + strh r1, [r2, 0x3C] + ldrb r1, [r2, 0x1] + subs r0, 0x34 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x1] + ldrb r0, [r2, 0x3] + movs r1, 0x3E + orrs r0, r1 + strb r0, [r2, 0x3] + adds r4, 0x1C + adds r3, r4 + ldr r0, =sub_817BA7C + str r0, [r3] +_0817BB82: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817BB38 + + thumb_func_start sub_817BB94 +sub_817BB94: @ 817BB94 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x22 + ldrsh r0, [r4, r1] + cmp r0, 0x57 + bgt _0817BBFA + movs r2, 0x3C + ldrsh r0, [r4, r2] + adds r1, r0, 0 + muls r1, r0 + adds r0, r1, 0 + movs r1, 0x5 + bl __divsi3 + adds r0, 0x8 + strh r0, [r4, 0x22] + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl Sin + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0817BBCC + adds r0, 0x3 +_0817BBCC: + asrs r0, 2 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl Cos + strh r0, [r4, 0x24] + movs r1, 0x3C + ldrsh r0, [r4, r1] + lsls r0, 26 + lsrs r0, 24 + movs r1, 0x28 + bl Sin + adds r0, 0x8 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + b _0817BC00 +_0817BBFA: + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_0817BC00: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_817BB94 + + thumb_func_start sub_817BC08 +sub_817BC08: @ 817BC08 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gUnknown_085F5440 + movs r1, 0x78 + movs r2, 0x8 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _0817BC5E + ldr r4, =gUnknown_02020630 + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r2, r3, r4 + movs r1, 0 + movs r0, 0x8 + strh r0, [r2, 0x38] + strh r5, [r2, 0x3A] + strh r1, [r2, 0x3C] + ldrb r1, [r2, 0x1] + subs r0, 0xC + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x1] + ldrb r1, [r2, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x32 + orrs r0, r1 + strb r0, [r2, 0x3] + adds r2, 0x43 + movs r0, 0x1 + strb r0, [r2] + adds r4, 0x1C + adds r3, r4 + ldr r0, =sub_817BB94 + str r0, [r3] +_0817BC5E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817BC08 + + thumb_func_start sub_817BC70 +sub_817BC70: @ 817BC70 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0x8 + ble _0817BCAC + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl Sin + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl Cos + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x38] + ldrh r1, [r4, 0x34] + subs r0, r1 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x3A] + adds r0, 0x4 + strh r0, [r4, 0x3A] + b _0817BCB2 +_0817BCAC: + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_0817BCB2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_817BC70 + + thumb_func_start sub_817BCB8 +sub_817BCB8: @ 817BCB8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, =gUnknown_085F5440 + movs r1, 0x78 + movs r2, 0x38 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _0817BD0E + ldr r4, =gUnknown_02020630 + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r2, r3, r4 + movs r1, 0 + strh r5, [r2, 0x34] + movs r0, 0x78 + strh r0, [r2, 0x38] + strh r6, [r2, 0x3A] + strh r1, [r2, 0x3C] + ldrb r1, [r2, 0x1] + subs r0, 0x7C + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x1] + ldrb r0, [r2, 0x3] + movs r1, 0x3E + orrs r0, r1 + strb r0, [r2, 0x3] + adds r2, 0x43 + movs r0, 0x1 + strb r0, [r2] + adds r4, 0x1C + adds r3, r4 + ldr r0, =sub_817BC70 + str r0, [r3] +_0817BD0E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817BCB8 + + thumb_func_start sub_817BD20 +sub_817BD20: @ 817BD20 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x3C] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _0817BD34 + ldrh r0, [r4, 0x22] + adds r0, 0x1 + strh r0, [r4, 0x22] +_0817BD34: + ldrh r1, [r4, 0x3A] + movs r2, 0x3A + ldrsh r0, [r4, r2] + cmp r0, 0x7F + bgt _0817BDE4 + lsls r0, r1, 24 + lsrs r0, 24 + movs r5, 0x38 + ldrsh r1, [r4, r5] + bl Sin + negs r0, r0 + strh r0, [r4, 0x26] + movs r0, 0x34 + ldrsh r1, [r4, r0] + movs r2, 0x3C + ldrsh r0, [r4, r2] + muls r0, r1 + movs r1, 0x3 + bl __divsi3 + adds r0, 0x78 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x3A] + adds r3, r0, 0x1 + strh r3, [r4, 0x3A] + movs r5, 0x3A + ldrsh r1, [r4, r5] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + cmp r0, 0 + bge _0817BD78 + adds r0, 0x7F +_0817BD78: + asrs r0, 7 + movs r1, 0x1F + subs r1, r0 + lsls r1, 24 + lsrs r2, r1, 24 + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, 0x40 + ble _0817BD94 + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x1 + strb r0, [r1] + b _0817BDC4 +_0817BD94: + adds r3, r4, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x14 + strb r0, [r1] + ldrh r1, [r4, 0x3A] + movs r5, 0x3A + ldrsh r0, [r4, r5] + cmp r0, 0x70 + ble _0817BDC4 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0817BDC4 + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r3] +_0817BDC4: + cmp r2, 0x13 + bhi _0817BDCA + movs r2, 0x14 +_0817BDCA: + movs r0, 0x1F + ands r2, r0 + lsls r2, 1 + ldrb r1, [r4, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x3] + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + b _0817BDEA +_0817BDE4: + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_0817BDEA: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_817BD20 + + thumb_func_start sub_817BDF0 +sub_817BDF0: @ 817BDF0 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, =gUnknown_085F5440 + movs r1, 0x78 + movs r2, 0x38 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x40 + beq _0817BE60 + bl Random + ldr r6, =gUnknown_02020630 + lsls r5, r4, 4 + adds r5, r4 + lsls r5, 2 + adds r4, r5, r6 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x7 + bl __umodsi3 + movs r1, 0x3 + subs r1, r0 + movs r0, 0 + mov r8, r0 + strh r1, [r4, 0x34] + bl Random + movs r1, 0x3F + ands r1, r0 + adds r1, 0x30 + strh r1, [r4, 0x38] + mov r0, r8 + strh r0, [r4, 0x3C] + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x3] + movs r1, 0x3E + orrs r0, r1 + strb r0, [r4, 0x3] + adds r4, 0x43 + movs r0, 0x14 + strb r0, [r4] + adds r6, 0x1C + adds r5, r6 + ldr r0, =sub_817BD20 + str r0, [r5] +_0817BE60: + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817BDF0 + + thumb_func_start sub_817BE78 +sub_817BE78: @ 817BE78 + push {lr} + ldr r0, =gUnknown_085F540C + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_085F541C + bl LoadTaggedObjectPalettes + pop {r0} + bx r0 + .pool + thumb_func_end sub_817BE78 + + thumb_func_start sub_817BE94 +sub_817BE94: @ 817BE94 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, =sub_817BEC4 + 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, 0xA] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_817BE94 + + thumb_func_start sub_817BEC4 +sub_817BEC4: @ 817BEC4 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_817BA44 + ldr r0, =gTasks + lsls r5, r4, 2 + adds r5, r4 + lsls r5, 3 + adds r5, r0 + movs r0, 0 + strh r0, [r5, 0x26] + movs r0, 0xA + ldrsh r1, [r5, r0] + movs r0, 0x3 + lsls r0, r1 + ldr r1, =0x00007fff + str r1, [sp] + movs r1, 0xA + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =sub_817BF14 + str r0, [r5] + movs r0, 0x8C + bl audio_play + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817BEC4 + + thumb_func_start sub_817BF14 +sub_817BF14: @ 817BF14 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r3, r5, 2 + adds r0, r3, r5 + lsls r0, 3 + adds r1, r0, r1 + ldrh r2, [r1, 0x26] + movs r4, 0x26 + ldrsh r0, [r1, r4] + cmp r0, 0x3F + bgt _0817BF70 + movs r0, 0x7 + ands r0, r2 + adds r7, r3, 0 + cmp r0, 0 + bne _0817BF5A + movs r4, 0 + adds r6, r1, 0 +_0817BF3C: + ldrh r1, [r6, 0x26] + movs r0, 0x78 + ands r0, r1 + lsls r0, 1 + lsls r1, r4, 6 + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl sub_817BB38 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _0817BF3C +_0817BF5A: + ldr r0, =gTasks + adds r1, r7, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _0817BF78 + .pool +_0817BF70: + movs r0, 0x60 + strh r0, [r1, 0x26] + ldr r0, =sub_817BF84 + str r0, [r1] +_0817BF78: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817BF14 + + thumb_func_start sub_817BF84 +sub_817BF84: @ 817BF84 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0, r1 + ldrh r3, [r1, 0x26] + movs r4, 0x26 + ldrsh r0, [r1, r4] + cmp r0, 0 + beq _0817BFA8 + subs r0, r3, 0x1 + strh r0, [r1, 0x26] + b _0817BFAE + .pool +_0817BFA8: + adds r0, r2, 0 + bl DestroyTask +_0817BFAE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_817BF84 + + thumb_func_start sub_817BFB4 +sub_817BFB4: @ 817BFB4 + push {lr} + ldr r0, =sub_817BFCC + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_817BFB4 + + thumb_func_start sub_817BFCC +sub_817BFCC: @ 817BFCC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_817BA44 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x26] + ldr r1, =sub_817C000 + str r1, [r0] + movs r0, 0xB7 + bl audio_play + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817BFCC + + thumb_func_start sub_817C000 +sub_817C000: @ 817C000 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 3 + adds r1, r0, r1 + movs r3, 0x26 + ldrsh r0, [r1, r3] + cmp r0, 0x5F + bgt _0817C048 + adds r6, r2, 0 + cmp r0, 0x5 + bgt _0817C032 + movs r4, 0 +_0817C020: + lsls r0, r4, 28 + lsrs r0, 24 + bl sub_817BC08 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x8 + bls _0817C020 +_0817C032: + ldr r0, =gTasks + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _0817C04C + .pool +_0817C048: + ldr r0, =sub_817C058 + str r0, [r1] +_0817C04C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C000 + + thumb_func_start sub_817C058 +sub_817C058: @ 817C058 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + pop {r0} + bx r0 + thumb_func_end sub_817C058 + + thumb_func_start sub_817C068 +sub_817C068: @ 817C068 + push {lr} + ldr r0, =sub_817C080 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_817C068 + + thumb_func_start sub_817C080 +sub_817C080: @ 817C080 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_817BA44 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x26] + ldr r1, =sub_817C0B4 + str r1, [r0] + movs r0, 0x66 + bl audio_play + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C080 + + thumb_func_start sub_817C0B4 +sub_817C0B4: @ 817C0B4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 3 + adds r1, r0, r1 + movs r3, 0x26 + ldrsh r0, [r1, r3] + cmp r0, 0x2F + bgt _0817C124 + adds r6, r2, 0 + cmp r0, 0 + bne _0817C0E8 + movs r4, 0 +_0817C0D4: + lsls r0, r4, 28 + lsrs r0, 24 + movs r1, 0x4 + bl sub_817BCB8 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _0817C0D4 +_0817C0E8: + ldr r0, =gTasks + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + movs r2, 0x26 + ldrsh r0, [r1, r2] + cmp r0, 0x20 + bne _0817C10E + movs r4, 0 +_0817C0FA: + lsls r0, r4, 28 + lsrs r0, 24 + movs r1, 0x8 + bl sub_817BCB8 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _0817C0FA +_0817C10E: + ldr r0, =gTasks + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _0817C128 + .pool +_0817C124: + ldr r0, =sub_817C134 + str r0, [r1] +_0817C128: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C0B4 + + thumb_func_start sub_817C134 +sub_817C134: @ 817C134 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + pop {r0} + bx r0 + thumb_func_end sub_817C134 + + thumb_func_start sub_817C144 +sub_817C144: @ 817C144 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, =sub_817C174 + 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, 0xC] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_817C144 + + thumb_func_start sub_817C174 +sub_817C174: @ 817C174 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_817BA44 + ldr r0, =gTasks + lsls r5, r4, 2 + adds r5, r4 + lsls r5, 3 + adds r5, r0 + movs r0, 0 + strh r0, [r5, 0x26] + ldr r0, =gUnknown_02037B54 + ldr r1, =gUnknown_02037754 + movs r2, 0x30 + bl CpuSet + ldr r0, =0xfff9041c + ldr r1, =0x00007fff + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =sub_817C1D4 + str r0, [r5] + movs r0, 0xCA + bl audio_play + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C174 + + thumb_func_start sub_817C1D4 +sub_817C1D4: @ 817C1D4 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gTasks + lsls r5, r6, 2 + adds r0, r5, r6 + lsls r0, 3 + adds r1, r0, r1 + movs r0, 0x26 + ldrsh r2, [r1, r0] + cmp r2, 0x7F + bgt _0817C250 + adds r0, r2, 0 + cmp r0, 0 + beq _0817C210 + cmp r0, 0x20 + beq _0817C224 + cmp r2, 0x31 + bgt _0817C234 + bl Random + movs r1, 0x7 + ands r0, r1 + bl sub_817BDF0 + b _0817C234 + .pool +_0817C210: + movs r4, 0 +_0817C212: + adds r0, r4, 0 + bl sub_817BDF0 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _0817C212 + b _0817C234 +_0817C224: + ldr r0, =0xffff041c + ldr r1, =0x00007fff + str r1, [sp] + movs r1, 0x10 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe +_0817C234: + ldr r0, =gTasks + adds r1, r5, r6 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _0817C254 + .pool +_0817C250: + ldr r0, =sub_817C260 + str r0, [r1] +_0817C254: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C1D4 + + thumb_func_start sub_817C260 +sub_817C260: @ 817C260 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0817C278 + adds r0, r2, 0 + bl DestroyTask +_0817C278: + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C260 + + thumb_func_start sub_817C280 +sub_817C280: @ 817C280 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, =sub_817C2B0 + 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, 0xC] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_817C280 + + thumb_func_start sub_817C2B0 +sub_817C2B0: @ 817C2B0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_817BA44 + ldr r0, =gTasks + lsls r5, r4, 2 + adds r5, r4 + lsls r5, 3 + adds r5, r0 + movs r0, 0 + strh r0, [r5, 0x26] + ldr r0, =gUnknown_02037B54 + ldr r1, =gUnknown_02037754 + movs r2, 0x30 + bl CpuSet + ldr r0, =0xfff90400 + ldr r1, =0x00007fff + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =sub_817C310 + str r0, [r5] + movs r0, 0xCA + bl audio_play + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C2B0 + + thumb_func_start sub_817C310 +sub_817C310: @ 817C310 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gTasks + lsls r5, r6, 2 + adds r0, r5, r6 + lsls r0, 3 + adds r1, r0, r1 + movs r0, 0x26 + ldrsh r2, [r1, r0] + cmp r2, 0x7F + bgt _0817C38C + adds r0, r2, 0 + cmp r0, 0 + beq _0817C34C + cmp r0, 0x20 + beq _0817C360 + cmp r2, 0x31 + bgt _0817C370 + bl Random + movs r1, 0x7 + ands r0, r1 + bl sub_817BDF0 + b _0817C370 + .pool +_0817C34C: + movs r4, 0 +_0817C34E: + adds r0, r4, 0 + bl sub_817BDF0 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _0817C34E + b _0817C370 +_0817C360: + ldr r0, =0xffff0400 + ldr r1, =0x00007fff + str r1, [sp] + movs r1, 0x10 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe +_0817C370: + ldr r0, =gTasks + adds r1, r5, r6 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _0817C390 + .pool +_0817C38C: + ldr r0, =sub_817C260 + str r0, [r1] +_0817C390: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C310 + + thumb_func_start nullsub_68 +nullsub_68: @ 817C39C + bx lr + thumb_func_end nullsub_68 + + thumb_func_start sub_817C3A0 +sub_817C3A0: @ 817C3A0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + movs r1, 0 + ldr r3, =sub_817C4EC + ldr r2, =0x00007fff +_0817C3BA: + lsls r0, r1, 1 + add r0, sp + adds r0, 0x4 + strh r2, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0xF + bls _0817C3BA + adds r0, r3, 0 + movs r1, 0 + bl CreateTask + mov r8, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, =gTasks + mov r1, r8 + lsls r6, r1, 2 + add r6, r8 + lsls r6, 3 + adds r6, r0 + strh r5, [r6, 0xA] + strh r7, [r6, 0xC] + movs r1, 0x80 + lsls r1, 1 + strh r1, [r6, 0xE] + movs r0, 0x10 + strh r0, [r6, 0x10] + movs r4, 0x80 + lsls r4, 9 + str r1, [sp] + movs r0, 0x1E + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + movs r0, 0x10 + ldrsh r1, [r6, r0] + adds r0, r4, 0 + bl __divsi3 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + movs r0, 0x1F + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + ldr r1, =gUnknown_02020630 + mov r9, r1 + lsls r2, r5, 4 + adds r2, r5 + lsls r2, 2 + mov r3, r9 + adds r3, 0x1C + adds r0, r2, r3 + ldr r1, =nullsub_68 + str r1, [r0] + add r2, r9 + ldrb r1, [r2, 0x1] + movs r4, 0x4 + negs r4, r4 + adds r0, r4, 0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x1] + ldrb r1, [r2, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x3C + orrs r0, r1 + strb r0, [r2, 0x3] + movs r0, 0x3E + adds r0, r2 + mov r10, r0 + ldrb r1, [r0] + movs r5, 0x5 + negs r5, r5 + adds r0, r5, 0 + ands r0, r1 + mov r1, r10 + strb r0, [r1] + ldrb r1, [r2, 0x5] + lsrs r1, 4 + lsls r1, 5 + ldr r0, =gUnknown_02037D14 + mov r10, r0 + add r1, r10 + add r0, sp, 0x4 + movs r2, 0x10 + str r3, [sp, 0x24] + bl CpuSet + lsls r1, r7, 4 + adds r1, r7 + lsls r1, 2 + ldr r3, [sp, 0x24] + adds r3, r1, r3 + ldr r0, =nullsub_68 + str r0, [r3] + add r1, r9 + ldrb r0, [r1, 0x1] + ands r4, r0 + movs r0, 0x1 + orrs r4, r0 + strb r4, [r1, 0x1] + ldrb r0, [r1, 0x3] + movs r2, 0x3E + orrs r0, r2 + strb r0, [r1, 0x3] + adds r2, r1, 0 + adds r2, 0x3E + ldrb r0, [r2] + ands r5, r0 + strb r5, [r2] + ldrb r1, [r1, 0x5] + lsrs r1, 4 + lsls r1, 5 + add r1, r10 + add r0, sp, 0x4 + movs r2, 0x10 + bl CpuSet + movs r1, 0 + strh r1, [r6, 0x18] + mov r0, r8 + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_817C3A0 + + thumb_func_start sub_817C4EC +sub_817C4EC: @ 817C4EC + 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 r0, [r1, 0x12] + movs r0, 0x8 + strh r0, [r1, 0x14] + ldr r0, =sub_817C510 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_817C4EC + + thumb_func_start sub_817C510 +sub_817C510: @ 817C510 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, =gTasks + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r2, r0, r1 + movs r1, 0x18 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0817C534 + adds r0, r3, 0 + bl sub_817C72C + b _0817C556 + .pool +_0817C534: + ldrh r1, [r2, 0x14] + movs r4, 0x14 + ldrsh r0, [r2, r4] + cmp r0, 0x80 + bne _0817C546 + adds r0, r3, 0 + bl sub_817C67C + b _0817C556 +_0817C546: + adds r0, r1, 0x2 + strh r0, [r2, 0x14] + ldrh r0, [r2, 0x12] + movs r1, 0x1 + eors r0, r1 + strh r0, [r2, 0x12] + ldr r0, =sub_817C560 + str r0, [r2] +_0817C556: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C510 + + thumb_func_start sub_817C560 +sub_817C560: @ 817C560 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r1 + movs r3, 0x18 + ldrsh r0, [r2, r3] + adds r5, r1, 0 + cmp r0, 0 + beq _0817C58C + ldr r0, =sub_817C72C + str r0, [r2] + b _0817C670 + .pool +_0817C58C: + movs r6, 0 + movs r7, 0x12 + ldrsh r0, [r2, r7] + cmp r0, 0 + bne _0817C5DC + movs r0, 0xE + ldrsh r1, [r2, r0] + movs r3, 0x14 + ldrsh r0, [r2, r3] + movs r3, 0x80 + lsls r3, 1 + subs r0, r3, r0 + cmp r1, r0 + bge _0817C5B2 + ldrh r0, [r2, 0x14] + ldrh r7, [r2, 0xE] + adds r0, r7 + strh r0, [r2, 0xE] + b _0817C5B6 +_0817C5B2: + strh r3, [r2, 0xE] + movs r6, 0x1 +_0817C5B6: + lsls r2, r4, 2 + adds r0, r2, r4 + lsls r0, 3 + adds r3, r0, r5 + movs r0, 0x10 + ldrsh r1, [r3, r0] + movs r7, 0x14 + ldrsh r0, [r3, r7] + adds r0, 0x10 + cmp r1, r0 + ble _0817C5D6 + ldrh r0, [r3, 0x10] + ldrh r1, [r3, 0x14] + subs r0, r1 + strh r0, [r3, 0x10] + b _0817C626 +_0817C5D6: + movs r0, 0x10 + strh r0, [r3, 0x10] + b _0817C620 +_0817C5DC: + movs r0, 0x10 + ldrsh r1, [r2, r0] + movs r3, 0x14 + ldrsh r0, [r2, r3] + movs r3, 0x80 + lsls r3, 1 + subs r0, r3, r0 + cmp r1, r0 + bge _0817C5F8 + ldrh r0, [r2, 0x14] + ldrh r7, [r2, 0x10] + adds r0, r7 + strh r0, [r2, 0x10] + b _0817C5FC +_0817C5F8: + strh r3, [r2, 0x10] + movs r6, 0x1 +_0817C5FC: + lsls r2, r4, 2 + adds r0, r2, r4 + lsls r0, 3 + adds r3, r0, r5 + movs r0, 0xE + ldrsh r1, [r3, r0] + movs r7, 0x14 + ldrsh r0, [r3, r7] + adds r0, 0x10 + cmp r1, r0 + ble _0817C61C + ldrh r0, [r3, 0xE] + ldrh r1, [r3, 0x14] + subs r0, r1 + strh r0, [r3, 0xE] + b _0817C626 +_0817C61C: + movs r0, 0x10 + strh r0, [r3, 0xE] +_0817C620: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0817C626: + adds r0, r2, r4 + lsls r0, 3 + adds r5, r0, r5 + movs r0, 0xE + ldrsh r1, [r5, r0] + movs r4, 0x80 + lsls r4, 9 + adds r0, r4, 0 + bl __divsi3 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + movs r0, 0x1E + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + movs r3, 0x10 + ldrsh r1, [r5, r3] + adds r0, r4, 0 + bl __divsi3 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + movs r0, 0x1F + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + cmp r6, 0x2 + bne _0817C670 + ldr r0, =sub_817C510 + str r0, [r5] +_0817C670: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C560 + + thumb_func_start sub_817C67C +sub_817C67C: @ 817C67C + push {r4-r6,lr} + mov r6, r8 + push {r6} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_02020630 + mov r8, r1 + ldr r1, =gTasks + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r2, 0xA + ldrsh r1, [r4, r2] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + add r2, r8 + ldrb r3, [r2, 0x1] + movs r6, 0x4 + negs r6, r6 + adds r1, r6, 0 + ands r1, r3 + strb r1, [r2, 0x1] + movs r2, 0xA + ldrsh r1, [r4, r2] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + add r2, r8 + ldrb r3, [r2, 0x3] + movs r5, 0x3F + negs r5, r5 + adds r1, r5, 0 + ands r1, r3 + strb r1, [r2, 0x3] + movs r1, 0xA + ldrsh r2, [r4, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + adds r1, 0x3E + ldrb r2, [r1] + movs r3, 0x4 + orrs r2, r3 + strb r2, [r1] + movs r1, 0xC + ldrsh r2, [r4, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x1] + ands r6, r2 + strb r6, [r1, 0x1] + movs r1, 0xC + ldrsh r2, [r4, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x3] + ands r5, r2 + strb r5, [r1, 0x3] + movs r1, 0xC + ldrsh r2, [r4, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + ands r2, r3 + strb r2, [r1] + bl DestroyTask + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C67C + + thumb_func_start sub_817C72C +sub_817C72C: @ 817C72C + push {r4-r6,lr} + mov r6, r8 + push {r6} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_02020630 + mov r8, r1 + ldr r1, =gTasks + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r2, 0xA + ldrsh r1, [r4, r2] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + add r2, r8 + ldrb r3, [r2, 0x1] + movs r6, 0x4 + negs r6, r6 + adds r1, r6, 0 + ands r1, r3 + strb r1, [r2, 0x1] + movs r2, 0xA + ldrsh r1, [r4, r2] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + add r2, r8 + ldrb r3, [r2, 0x3] + movs r5, 0x3F + negs r5, r5 + adds r1, r5, 0 + ands r1, r3 + strb r1, [r2, 0x3] + movs r1, 0xA + ldrsh r2, [r4, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + ands r2, r3 + strb r2, [r1] + movs r1, 0xC + ldrsh r2, [r4, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x1] + ands r6, r2 + strb r6, [r1, 0x1] + movs r1, 0xC + ldrsh r2, [r4, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x3] + ands r5, r2 + strb r5, [r1, 0x3] + movs r1, 0xC + ldrsh r2, [r4, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + adds r1, 0x3E + ldrb r2, [r1] + movs r3, 0x4 + orrs r2, r3 + strb r2, [r1] + bl DestroyTask + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C72C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/evolution_scene.s b/asm/evolution_scene.s index 979efe3c0..edc7318ca 100644 --- a/asm/evolution_scene.s +++ b/asm/evolution_scene.s @@ -57,7 +57,7 @@ _0813DA00: ldrsh r1, [r6, r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r7, r1, r0 ldrh r4, [r6, 0xC] ldrb r5, [r6, 0xE] @@ -206,31 +206,31 @@ evolution_cutscene: @ 813DA8C adds r0, r4, 0 movs r1, 0x2 mov r2, sp - bl pokemon_getattr - ldr r0, =gUnknown_02021CC4 + bl GetMonData + ldr r0, =gStringVar1 mov r1, sp - bl CopyString_Limit10 - ldr r0, =gUnknown_02021DC4 + bl StringCopy10 + ldr r0, =gStringVar2 movs r1, 0xB mov r2, r10 muls r2, r1 adds r1, r2, 0 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 adds r0, r4, 0 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x20] adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData mov r9, r0 lsls r0, r5, 3 ldr r1, =gMonFrontPicTable @@ -416,16 +416,16 @@ sub_813DD7C: @ 813DD7C movs r1, 0x64 adds r4, r2, 0 muls r4, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r4, r1 ldrh r5, [r0, 0xC] adds r0, r4, 0 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData mov r9, r0 adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData adds r6, r0, 0 movs r0, 0 bl SetHBlankCallback @@ -588,10 +588,10 @@ sub_813DF70: @ 813DF70 ldrsh r2, [r0, r1] movs r1, 0x64 muls r2, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r4, r2, r1 ldrh r6, [r0, 0xC] - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r3, 0x87 lsls r3, 3 adds r0, r3 @@ -657,7 +657,7 @@ _0813E050: bl SetHBlankCallback ldr r0, =sub_813FD64 bl SetVBlankCallback - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r3, 0x87 lsls r3, 3 adds r1, r3 @@ -679,7 +679,7 @@ _0813E07E: bl FillBgTilemapBufferRect movs r0, 0x1 bl CopyBgTilemapBufferToVram - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r3, 0x87 lsls r3, 3 adds r1, r3 @@ -688,11 +688,11 @@ _0813E07E: _0813E0A8: adds r0, r4, 0 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData adds r5, r0, 0 adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r0, r6, 3 ldr r1, =gMonFrontPicTable @@ -745,7 +745,7 @@ _0813E0F0: movs r2, 0x20 orrs r0, r2 strb r0, [r1, 0x5] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r3, 0x87 lsls r3, 3 adds r1, r3 @@ -756,7 +756,7 @@ _0813E0F0: b _0813E1C8 .pool _0813E160: - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _0813E174 @@ -771,7 +771,7 @@ _0813E174: movs r2, 0 bl BlendPalettes _0813E180: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -828,33 +828,33 @@ sub_813E1D4: @ 813E1D4 str r3, [sp, 0x14] movs r1, 0x2 mov r2, sp - bl pokemon_getattr - ldr r0, =gUnknown_02021CC4 + bl GetMonData + ldr r0, =gStringVar1 mov r1, sp - bl CopyString_Limit10 - ldr r0, =gUnknown_02021DC4 + bl StringCopy10 + ldr r0, =gStringVar2 movs r1, 0xB muls r1, r5 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy ldr r1, =gUnknown_02021CC0 movs r0, 0x1 strb r0, [r1] adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData mov r8, r0 lsls r0, 16 lsrs r0, 16 mov r8, r0 adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData adds r7, r0, 0 adds r0, r4, 0 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData mov r10, r0 ldr r1, =gUnknown_0203AB80 mov r9, r1 @@ -1039,7 +1039,7 @@ _0813E40C: _0813E416: movs r5, 0x64 muls r0, r5 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 mov r9, r0 ldr r1, [sp, 0x4] @@ -1090,7 +1090,7 @@ _0813E484: ldrb r1, [r5] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 adds r1, r4, 0 mov r2, sp @@ -1104,7 +1104,7 @@ _0813E4A0: ldrb r0, [r7] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5 adds r1, r4, 0 mov r2, sp @@ -1151,18 +1151,18 @@ _0813E4A0: bl pokedex_flag_operation mov r0, r9 movs r1, 0xB - bl pokemon_getattr + bl GetMonData ldr r1, =0x0000012f cmp r0, r1 bne _0813E546 mov r0, r9 movs r1, 0x3 - bl pokemon_getattr + bl GetMonData cmp r0, 0x1 bne _0813E546 ldr r0, [sp, 0x4] movs r1, 0xB - bl pokemon_getattr + bl GetMonData movs r1, 0x97 lsls r1, 1 cmp r0, r1 @@ -1201,10 +1201,10 @@ evovle_mon_maybe: @ 813E570 ldrsh r1, [r3, r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r1, r0 mov r9, r1 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2C] adds r5, r2, 0 adds r6, r0, 0 @@ -1332,10 +1332,10 @@ _0813E6D4: beq _0813E6E4 bl _0813F1A4 _0813E6E4: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085CC990 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0 bl battle_show_message_maybe @@ -1620,10 +1620,10 @@ _0813E990: bne _0813E99E bl _0813F1A4 _0813E99E: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085CC9A6 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0 bl battle_show_message_maybe @@ -1705,10 +1705,10 @@ _0813EA5E: mov r0, r9 movs r1, 0x2 add r2, sp, 0x4 - bl pokemon_getattr + bl GetMonData ldr r0, =gUnknown_02022F58 add r1, sp, 0x4 - bl CopyString_Limit10 + bl StringCopy10 ldr r0, =0x0000ffff cmp r6, r0 bne _0813EA94 @@ -1856,17 +1856,17 @@ _0813EBB8: ldrsh r0, [r1, r3] cmp r0, 0 beq _0813EBE4 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085CC9EE - bl ExpandStringRefs + bl StringExpandPlaceholders b _0813EBEC .pool _0813EBE4: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085CC9D3 - bl ExpandStringRefs + bl StringExpandPlaceholders _0813EBEC: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 movs r1, 0 bl battle_show_message_maybe ldr r1, =gTasks @@ -2104,7 +2104,7 @@ _0813EDEA: b _0813F1A4 .pool _0813EE34: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 @@ -2122,7 +2122,7 @@ _0813EE34: strb r0, [r4, 0x1] bl sub_8056B74 _0813EE5C: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x80 ands r0, r1 @@ -2140,7 +2140,7 @@ _0813EE5C: strb r0, [r4, 0x1] bl sub_8056B74 _0813EE84: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r2, 0x1 adds r0, r2, 0 @@ -2188,7 +2188,7 @@ _0813EECC: movs r3, 0x10 bl BeginNormalPaletteFade _0813EEF2: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -2224,7 +2224,7 @@ _0813EF30: b _0813F1A4 _0813EF3E: bl FreeAllWindowBuffers - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty ldr r1, =gTasks mov r3, r8 adds r5, r3, r7 @@ -2278,7 +2278,7 @@ _0813EFC8: adds r1, r6, 0 adds r1, 0xD mov r0, r9 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 adds r0, r4, 0 @@ -2492,7 +2492,7 @@ sub_813F1B8: @ 813F1B8 ldrsh r2, [r0, r1] movs r1, 0x64 muls r2, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r2, r1 mov r9, r2 movs r2, 0x8 @@ -2532,10 +2532,10 @@ _0813F204: .4byte _0813F7A4 .4byte _0813F7E4 _0813F258: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085CC990 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0 adds r1, r4, 0 movs r2, 0x1 @@ -2803,10 +2803,10 @@ _0813F4E4: bne _0813F4F2 bl _0813FCC4 _0813F4F2: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085CC9A6 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0 adds r1, r4, 0 movs r2, 0x1 @@ -2889,10 +2889,10 @@ _0813F58C: mov r0, r9 movs r1, 0x2 add r2, sp, 0x4 - bl pokemon_getattr + bl GetMonData ldr r0, =gUnknown_02022F58 add r1, sp, 0x4 - bl CopyString_Limit10 + bl StringCopy10 ldr r0, =0x0000ffff cmp r6, r0 bne _0813F5E8 @@ -3028,10 +3028,10 @@ _0813F704: bne _0813F714 b _0813FCC4 _0813F714: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085CC9EE adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0 adds r1, r4, 0 movs r2, 0x1 @@ -3359,7 +3359,7 @@ _0813FA24: beq _0813FA32 b _0813FCC4 _0813FA32: - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _0813FA3E @@ -3375,7 +3375,7 @@ _0813FA3E: bl GetBgTilemapBuffer bl Free bl FreeAllWindowBuffers - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty ldr r1, =gTasks mov r2, r8 adds r5, r2, r7 @@ -3406,7 +3406,7 @@ _0813FAA8: beq _0813FAB6 b _0813FCC4 _0813FAB6: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, [r0, 0x4] ldr r0, =sub_813E3C0 cmp r1, r0 @@ -3430,7 +3430,7 @@ _0813FAEC: adds r1, r6, 0 adds r1, 0xD mov r0, r9 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 adds r0, r4, 0 @@ -3888,27 +3888,27 @@ _0813FF2C: movs r1, 0x8 ldrsh r0, [r4, r1] movs r1, 0x4 - bl cosine + bl Cos adds r0, 0x8 mov r2, r8 strh r0, [r2] movs r1, 0x8 ldrsh r0, [r4, r1] movs r1, 0x4 - bl sine + bl Sin adds r0, 0x10 mov r2, r9 strh r0, [r2] movs r1, 0xA ldrsh r0, [r4, r1] movs r1, 0x4 - bl cosine + bl Cos adds r0, 0x8 strh r0, [r7] movs r2, 0xA ldrsh r0, [r4, r2] movs r1, 0x4 - bl sine + bl Sin adds r0, 0x10 strh r0, [r6] ldr r0, =sub_813FDEC diff --git a/asm/field_camera.s b/asm/field_camera.s index 0e3925aeb..354dd8f36 100644 --- a/asm/field_camera.s +++ b/asm/field_camera.s @@ -129,7 +129,7 @@ sub_8089C08: @ 8089C08 @ void DrawWholeMapView() DrawWholeMapView: @ 8089C34 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] movs r2, 0 ldrsh r0, [r1, r2] @@ -291,7 +291,7 @@ _08089D5E: adds r1, r6, r0 lsls r1, 16 lsrs r1, 16 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r3, [r0] movs r0, 0 ldrsh r2, [r3, r0] @@ -334,7 +334,7 @@ _08089D9C: lsrs r0, 24 _08089DAE: adds r1, r6, r0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r3, [r0] movs r0, 0 ldrsh r2, [r3, r0] @@ -380,7 +380,7 @@ _08089DFC: adds r1, r6 lsls r1, 16 lsrs r1, 16 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r3, 0 ldrsh r2, [r0, r3] @@ -438,7 +438,7 @@ _08089E66: adds r1, r5 lsls r1, 16 lsrs r1, 16 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r3, 0 ldrsh r2, [r0, r3] @@ -724,7 +724,7 @@ _0808A082: MapPosToBgTilemapOffset: @ 808A0AC push {r4,r5,lr} adds r4, r0, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r3, [r0] movs r5, 0 ldrsh r0, [r3, r5] diff --git a/asm/rom_809BEDC.s b/asm/field_control_avatar.s similarity index 88% rename from asm/rom_809BEDC.s rename to asm/field_control_avatar.s index 559bfc00a..5a50ed284 100644 --- a/asm/rom_809BEDC.s +++ b/asm/field_control_avatar.s @@ -1514,7 +1514,7 @@ happiness_algorithm_step: @ 809CB44 strh r1, [r0] cmp r1, 0 bne _0809CB72 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty movs r4, 0x5 _0809CB62: adds r0, r5, 0 @@ -2019,7 +2019,7 @@ _0809CF20: lsls r0, r3, 3 adds r0, r1 ldrb r0, [r0, 0x5] - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] movs r1, 0x4 ldrsb r1, [r2, r1] @@ -2509,346 +2509,4 @@ sub_809D2BC: @ 809D2BC .pool thumb_func_end sub_809D2BC - thumb_func_start sub_809D300 -sub_809D300: @ 809D300 - push {r4,lr} - ldr r4, =gUnknown_03005D8C - ldr r0, [r4] - ldr r1, =0x00001270 - adds r0, r1 - movs r2, 0x96 - lsls r2, 1 - movs r1, 0 - bl memset - ldr r0, [r4] - ldr r1, =0x0000139c - adds r0, r1 - movs r2, 0x80 - lsls r2, 2 - movs r1, 0 - bl memset - ldr r0, =gUnknown_020375FC - movs r1, 0 - movs r2, 0x10 - bl memset - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D300 - - thumb_func_start sub_809D344 -sub_809D344: @ 809D344 - push {lr} - ldr r0, =gUnknown_03005D8C - ldr r0, [r0] - ldr r1, =0x00001270 - adds r2, r0, r1 - movs r1, 0 - str r1, [r2] - ldr r1, =0x0000139c - adds r0, r1 - movs r1, 0 - movs r2, 0x20 - bl memset - ldr r0, =0x000008ad - bl FlagReset - ldr r0, =0x000008ae - bl FlagReset - ldr r0, =0x00000889 - bl FlagReset - ldr r0, =0x000008c1 - bl FlagReset - movs r0, 0x88 - lsls r0, 4 - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D344 - - thumb_func_start sub_809D3A0 -sub_809D3A0: @ 809D3A0 - push {lr} - ldr r0, =gUnknown_03005D8C - ldr r0, [r0] - ldr r1, =0x00001394 - adds r0, r1 - movs r1, 0 - movs r2, 0x8 - bl memset - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D3A0 - - thumb_func_start sub_809D3C0 -sub_809D3C0: @ 809D3C0 - push {lr} - ldr r0, =0x00004046 - bl GetVarPointer - ldr r1, =gUnknown_03005D90 - ldr r2, [r1] - movs r1, 0 - strb r1, [r2, 0x1A] - strh r1, [r0] - ldr r0, =0x00000896 - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D3C0 - - thumb_func_start sub_809D3E8 -sub_809D3E8: @ 809D3E8 - push {r4,r5,lr} - ldr r0, =0x00004046 - bl GetVarPointer - ldr r4, =gUnknown_03005D90 - ldr r2, [r4] - movs r5, 0 - movs r1, 0xDA - strb r1, [r2, 0x1A] - ldr r2, =0x00000302 - adds r1, r2, 0 - strh r1, [r0] - ldr r0, =0x00000896 - bl FlagSet - ldr r1, [r4] - movs r0, 0x1 - strb r0, [r1, 0x19] - ldr r0, [r4] - strb r5, [r0, 0x18] - bl sub_80BB358 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D3E8 - - thumb_func_start sub_809D42C -sub_809D42C: @ 809D42C - push {lr} - ldr r0, =gUnknown_03005D90 - ldr r0, [r0] - ldrb r0, [r0, 0x1A] - cmp r0, 0xDA - bne _0809D468 - ldr r0, =0x00004046 - bl VarGet - lsls r0, 16 - ldr r1, =0x03020000 - cmp r0, r1 - bne _0809D468 - ldr r0, =0x00000896 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0809D468 - movs r0, 0x1 - b _0809D46A - .pool -_0809D468: - movs r0, 0 -_0809D46A: - pop {r1} - bx r1 - thumb_func_end sub_809D42C - - thumb_func_start sub_809D470 -sub_809D470: @ 809D470 - push {lr} - ldr r0, =0x000008ac - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D470 - - thumb_func_start sub_809D480 -sub_809D480: @ 809D480 - push {lr} - ldr r0, =0x000008ac - bl FlagSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D480 - - thumb_func_start sub_809D490 -sub_809D490: @ 809D490 - push {lr} - ldr r0, =0x000008ac - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809D490 - - thumb_func_start sub_809D4A4 -sub_809D4A4: @ 809D4A4 - push {lr} - ldr r0, =0x000008db - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D4A4 - - thumb_func_start sub_809D4B4 -sub_809D4B4: @ 809D4B4 - push {lr} - ldr r0, =0x000008db - bl FlagSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D4B4 - - thumb_func_start sub_809D4C4 -sub_809D4C4: @ 809D4C4 - push {lr} - ldr r0, =0x000008db - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809D4C4 - - thumb_func_start sub_809D4D8 -sub_809D4D8: @ 809D4D8 - push {lr} - movs r0, 0xF2 - lsls r0, 1 - bl FlagReset - ldr r0, =0x000001e5 - bl FlagReset - movs r0, 0xF3 - lsls r0, 1 - bl FlagReset - ldr r0, =0x000001e7 - bl FlagReset - movs r0, 0xF4 - lsls r0, 1 - bl FlagReset - ldr r0, =0x000001e9 - bl FlagReset - movs r0, 0xF5 - lsls r0, 1 - bl FlagReset - ldr r0, =0x000001eb - bl FlagReset - movs r0, 0xF6 - lsls r0, 1 - bl FlagReset - ldr r0, =0x000001ed - bl FlagReset - movs r0, 0xF7 - lsls r0, 1 - bl FlagReset - ldr r0, =0x000001ef - bl FlagReset - movs r0, 0xF8 - lsls r0, 1 - bl FlagReset - ldr r0, =0x000001f1 - bl FlagReset - movs r0, 0xF9 - lsls r0, 1 - bl FlagReset - ldr r0, =0x000001f3 - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D4D8 - - thumb_func_start sub_809D570 -sub_809D570: @ 809D570 - push {lr} - ldr r0, =0x000040dd - movs r1, 0 - bl VarSet - ldr r0, =0x000040de - movs r1, 0 - bl VarSet - ldr r0, =0x000040df - movs r1, 0 - bl VarSet - ldr r0, =0x000040e0 - movs r1, 0 - bl VarSet - ldr r0, =0x000040e1 - movs r1, 0 - bl VarSet - ldr r0, =0x000040e2 - movs r1, 0 - bl VarSet - ldr r0, =0x000040e3 - movs r1, 0 - bl VarSet - ldr r0, =0x000040e4 - movs r1, 0 - bl VarSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D570 - - thumb_func_start sub_809D5D8 -sub_809D5D8: @ 809D5D8 - push {lr} - ldr r0, =0x0000402c - movs r1, 0 - bl VarSet - ldr r0, =0x000008c2 - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D5D8 - - thumb_func_start sub_809D5F4 -sub_809D5F4: @ 809D5F4 - push {lr} - ldr r0, =0x0000402c - movs r1, 0x92 - lsls r1, 4 - bl VarSet - ldr r0, =0x000008c2 - bl FlagSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D5F4 - - thumb_func_start sub_809D614 -sub_809D614: @ 809D614 - push {lr} - ldr r0, =0x000008c2 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0809D640 - ldr r0, =0x0000402c - bl VarGet - lsls r0, 16 - movs r1, 0x92 - lsls r1, 20 - cmp r0, r1 - bne _0809D640 - movs r0, 0x1 - b _0809D642 - .pool -_0809D640: - movs r0, 0 -_0809D642: - pop {r1} - bx r1 - thumb_func_end sub_809D614 - .align 2, 0 @ Don't pad with nop. diff --git a/asm/field_door.s b/asm/field_door.s index 917a2ac99..9cdcf7d90 100644 --- a/asm/field_door.s +++ b/asm/field_door.s @@ -735,7 +735,7 @@ sub_808A964: @ 808A964 lsls r0, 24 cmp r0, 0 beq _0808A990 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0, 0x4] ldr r0, =0x0000101a diff --git a/asm/field_effect.s b/asm/field_effect.s index aa3359a7d..3d704b2f2 100644 --- a/asm/field_effect.s +++ b/asm/field_effect.s @@ -498,4 +498,8036 @@ _080B5E68: bx r1 thumb_func_end FieldEffectActiveListContains + thumb_func_start sub_80B5E6C +sub_80B5E6C: @ 80B5E6C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + mov r9, r3 + ldr r7, [sp, 0x34] + lsls r4, 24 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsrs r4, 21 + ldr r3, =gTrainerFrontPicPaletteTable + mov r8, r3 + add r8, r4 + mov r0, r8 + adds r1, r7, 0 + bl LoadCompressedObjectPaletteOverrideBuffer + ldr r0, =gTrainerFrontPicTable + adds r4, r0 + adds r0, r4, 0 + adds r1, r7, 0 + bl LoadCompressedObjectPicOverrideBuffer + mov r1, sp + ldrh r0, [r4, 0x6] + movs r2, 0 + strh r0, [r1] + mov r3, r8 + ldrh r0, [r3, 0x4] + strh r0, [r1, 0x2] + ldr r0, =gNewGameBirchOamAttributes + str r0, [sp, 0x4] + ldr r0, =gDummyObjectImageAnimTable + str r0, [sp, 0x8] + str r2, [sp, 0xC] + ldr r0, =gDummyObjectRotScalAnimTable + str r0, [sp, 0x10] + ldr r0, =DummyObjectCallback + str r0, [sp, 0x14] + lsls r5, 16 + asrs r5, 16 + lsls r6, 16 + asrs r6, 16 + mov r0, sp + adds r1, r5, 0 + adds r2, r6, 0 + mov r3, r9 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B5E6C + + thumb_func_start sub_80B5F0C +sub_80B5F0C: @ 80B5F0C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r1, r2, 0 + lsls r4, 24 + lsls r5, 16 + lsrs r5, 16 + ldr r0, =gTrainerFrontPicTable + lsrs r4, 21 + adds r0, r4, r0 + ldr r0, [r0] + bl LZDecompressVram + ldr r0, =gTrainerFrontPicPaletteTable + adds r4, r0 + ldr r0, [r4] + adds r1, r5, 0 + movs r2, 0x20 + bl decompress_palette + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B5F0C + + thumb_func_start AddNewGameBirchObject +AddNewGameBirchObject: @ 80B5F44 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 24 + lsrs r6, 24 + ldr r0, =gNewGameBirchObjectPaletteInfo + bl LoadTaggedObjectPalette + ldr r0, =gNewGameBirchObjectTemplate + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end AddNewGameBirchObject + + thumb_func_start sub_80B5F84 +sub_80B5F84: @ 80B5F84 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 16 + lsrs r0, 16 + movs r3, 0x80 + lsls r3, 8 + lsls r1, 16 + asrs r1, 16 + str r1, [sp] + lsls r2, 16 + asrs r2, 16 + str r2, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + ldr r1, =gMonPaletteTable + lsls r4, r0, 3 + adds r4, r1 + ldrh r1, [r4, 0x4] + str r1, [sp, 0xC] + movs r1, 0 + adds r2, r3, 0 + movs r3, 0x1 + bl sub_818D7D8 + lsls r0, 16 + lsrs r5, r0, 16 + ldrh r0, [r4, 0x4] + bl IndexOfObjectPaletteTag + adds r0, 0x10 + lsls r0, 24 + lsrs r0, 24 + bl sub_80AC3F8 + ldr r0, =0x0000ffff + cmp r5, r0 + beq _080B5FDC + lsls r0, r5, 24 + lsrs r0, 24 + b _080B5FDE + .pool +_080B5FDC: + movs r0, 0x40 +_080B5FDE: + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B5F84 + + thumb_func_start sub_80B5FE8 +sub_80B5FE8: @ 80B5FE8 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x10 + adds r6, r0, 0 + mov r9, r1 + mov r10, r2 + adds r4, r3, 0 + ldr r5, [sp, 0x2C] + lsls r6, 16 + lsrs r6, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + adds r0, r6, 0 + bl sub_806E7CC + mov r8, r0 + lsls r4, 16 + asrs r4, 16 + str r4, [sp] + lsls r5, 16 + asrs r5, 16 + str r5, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + mov r1, r8 + ldrh r0, [r1, 0x4] + str r0, [sp, 0xC] + adds r0, r6, 0 + mov r1, r9 + mov r2, r10 + movs r3, 0x1 + bl sub_818D7D8 + lsls r0, 16 + lsrs r4, r0, 16 + mov r1, r8 + ldrh r0, [r1, 0x4] + bl IndexOfObjectPaletteTag + adds r0, 0x10 + lsls r0, 24 + lsrs r0, 24 + bl sub_80AC3F8 + ldr r0, =0x0000ffff + cmp r4, r0 + beq _080B605C + lsls r0, r4, 24 + lsrs r0, 24 + b _080B605E + .pool +_080B605C: + movs r0, 0x40 +_080B605E: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80B5FE8 + + thumb_func_start sub_80B6070 +sub_80B6070: @ 80B6070 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + bl sub_80AC428 + ldrb r0, [r4, 0x1] + lsls r0, 30 + cmp r0, 0 + beq _080B608E + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry +_080B608E: + adds r0, r5, 0 + bl sub_818D820 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80B6070 + + thumb_func_start sub_80B609C +sub_80B609C: @ 80B609C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 16 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r4, =gUnknown_02037714 + lsrs r0, 15 + adds r4, r0, r4 + ldrh r4, [r4] + movs r5, 0x1F + mov r9, r5 + mov r8, r4 + mov r6, r8 + ands r6, r5 + mov r8, r6 + movs r6, 0xF8 + lsls r6, 2 + ands r6, r4 + lsrs r6, 5 + movs r5, 0xF8 + lsls r5, 7 + ands r4, r5 + lsrs r4, 10 + mov r7, r9 + mov r5, r8 + subs r7, r5 + mov r12, r7 + mov r7, r12 + muls r7, r1 + adds r1, r7, 0 + asrs r1, 4 + add r8, r1 + mov r5, r9 + subs r1, r5, r6 + muls r1, r2 + asrs r1, 4 + adds r6, r1 + subs r5, r4 + mov r9, r5 + mov r1, r9 + muls r1, r3 + asrs r1, 4 + adds r4, r1 + mov r7, r8 + lsls r7, 16 + lsls r6, 21 + orrs r6, r7 + lsls r4, 26 + orrs r4, r6 + lsrs r4, 16 + ldr r1, =gUnknown_02037B14 + adds r0, r1 + strh r4, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B609C + + thumb_func_start sub_80B6128 +sub_80B6128: @ 80B6128 + push {r4-r6,lr} + mov r6, r8 + push {r6} + lsls r0, 16 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r4, =gUnknown_02037714 + lsrs r0, 15 + adds r4, r0, r4 + ldrh r4, [r4] + movs r5, 0x1F + mov r8, r5 + mov r6, r8 + ands r6, r4 + mov r8, r6 + movs r5, 0xF8 + lsls r5, 2 + ands r5, r4 + lsrs r5, 5 + movs r6, 0xF8 + lsls r6, 7 + ands r4, r6 + lsrs r4, 10 + mov r6, r8 + muls r6, r1 + adds r1, r6, 0 + asrs r1, 4 + mov r6, r8 + subs r6, r1 + adds r1, r5, 0 + muls r1, r2 + asrs r1, 4 + subs r5, r1 + adds r1, r4, 0 + muls r1, r3 + asrs r1, 4 + subs r4, r1 + lsls r6, 16 + lsls r5, 21 + orrs r5, r6 + lsls r4, 26 + orrs r4, r5 + lsrs r4, 16 + ldr r1, =gUnknown_02037B14 + adds r0, r1 + strh r4, [r0] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B6128 + + thumb_func_start sub_80B61A0 +sub_80B61A0: @ 80B61A0 + push {r4,lr} + bl calc_player_party_count + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =sub_80B61E4 + movs r1, 0xFF + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + adds r1, r0 + strh r4, [r1, 0xA] + movs r0, 0x5D + strh r0, [r1, 0xC] + movs r0, 0x24 + strh r0, [r1, 0xE] + movs r0, 0x7C + strh r0, [r1, 0x10] + movs r0, 0x18 + strh r0, [r1, 0x12] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B61A0 + + thumb_func_start sub_80B61E4 +sub_80B61E4: @ 80B61E4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + adds r1, r0 + ldr r2, =gUnknown_0855C364 + movs r3, 0x8 + ldrsh r0, [r1, r3] + lsls r0, 2 + adds r0, r2 + ldr r2, [r0] + adds r0, r1, 0 + bl _call_via_r2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B61E4 + + thumb_func_start sub_80B6214 +sub_80B6214: @ 80B6214 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r1, 0xA + ldrsh r0, [r4, r1] + movs r2, 0xC + ldrsh r1, [r4, r2] + movs r3, 0xE + ldrsh r2, [r4, r3] + movs r3, 0x1 + bl sub_80B646C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x14] + movs r1, 0x10 + ldrsh r0, [r4, r1] + movs r2, 0x12 + ldrsh r1, [r4, r2] + bl sub_80B6850 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x16] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B6214 + + thumb_func_start sub_80B6250 +sub_80B6250: @ 80B6250 + push {r4,lr} + adds r2, r0, 0 + ldr r3, =gUnknown_02020630 + movs r1, 0x14 + ldrsh r0, [r2, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + movs r4, 0x2E + ldrsh r0, [r1, r4] + cmp r0, 0x1 + ble _080B6282 + movs r0, 0x16 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x2E] + adds r1, 0x1 + strh r1, [r0, 0x2E] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] +_080B6282: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B6250 + + thumb_func_start sub_80B628C +sub_80B628C: @ 80B628C + push {lr} + adds r3, r0, 0 + ldr r2, =gUnknown_02020630 + movs r0, 0x14 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2E + ldrsh r0, [r0, r1] + cmp r0, 0x4 + ble _080B62AC + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_080B62AC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B628C + + thumb_func_start sub_80B62B4 +sub_80B62B4: @ 80B62B4 + push {lr} + ldr r2, =gUnknown_02020630 + movs r3, 0x14 + ldrsh r1, [r0, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0x6 + ble _080B62E6 + adds r0, r1, 0 + bl RemoveObjectAndFreeTiles + movs r0, 0x19 + bl FieldEffectActiveListRemove + ldr r0, =sub_80B61E4 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080B62E6: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B62B4 + + thumb_func_start sub_80B62F4 +sub_80B62F4: @ 80B62F4 + push {r4,lr} + bl calc_player_party_count + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =sub_80B6330 + movs r1, 0xFF + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + adds r1, r0 + strh r4, [r1, 0xA] + movs r0, 0x75 + strh r0, [r1, 0xC] + movs r0, 0x34 + strh r0, [r1, 0xE] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B62F4 + + thumb_func_start sub_80B6330 +sub_80B6330: @ 80B6330 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + adds r1, r0 + ldr r2, =gUnknown_0855C374 + movs r3, 0x8 + ldrsh r0, [r1, r3] + lsls r0, 2 + adds r0, r2 + ldr r2, [r0] + adds r0, r1, 0 + bl _call_via_r2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B6330 + + thumb_func_start sub_80B6360 +sub_80B6360: @ 80B6360 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r1, 0xA + ldrsh r0, [r4, r1] + movs r2, 0xC + ldrsh r1, [r4, r2] + movs r3, 0xE + ldrsh r2, [r4, r3] + movs r3, 0 + bl sub_80B646C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x14] + ldr r0, =sub_80B6330 + bl FindTaskIdByFunc + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x78 + movs r2, 0x18 + movs r3, 0 + bl sub_80B68EC + adds r0, r4, 0 + movs r1, 0x28 + movs r2, 0x8 + movs r3, 0x1 + bl sub_80B68EC + adds r0, r4, 0 + movs r1, 0x48 + movs r2, 0x8 + movs r3, 0x1 + bl sub_80B68EC + adds r0, r4, 0 + movs r1, 0xA8 + movs r2, 0x8 + movs r3, 0x1 + bl sub_80B68EC + adds r0, r4, 0 + movs r1, 0xC8 + movs r2, 0x8 + movs r3, 0x1 + bl sub_80B68EC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B6360 + + thumb_func_start sub_80B63D4 +sub_80B63D4: @ 80B63D4 + push {lr} + adds r3, r0, 0 + ldr r2, =gUnknown_02020630 + movs r0, 0x14 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2E + ldrsh r0, [r0, r1] + cmp r0, 0x1 + ble _080B63FA + ldrh r0, [r3, 0x26] + adds r0, 0x1 + strh r0, [r3, 0x26] + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_080B63FA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B63D4 + + thumb_func_start sub_80B6404 +sub_80B6404: @ 80B6404 + push {lr} + adds r3, r0, 0 + ldr r2, =gUnknown_02020630 + movs r0, 0x14 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2E + ldrsh r0, [r0, r1] + cmp r0, 0x4 + ble _080B6424 + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_080B6424: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B6404 + + thumb_func_start sub_80B642C +sub_80B642C: @ 80B642C + push {lr} + ldr r2, =gUnknown_02020630 + movs r3, 0x14 + ldrsh r1, [r0, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0x6 + ble _080B645E + adds r0, r1, 0 + bl RemoveObjectAndFreeTiles + movs r0, 0x3E + bl FieldEffectActiveListRemove + ldr r0, =sub_80B6330 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080B645E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B642C + + thumb_func_start sub_80B646C +sub_80B646C: @ 80B646C + 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, 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 + ldr r0, =sub_80B64C0 + bl obj_add_empty_with_callback + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r2, =gUnknown_02020630 + adds r1, r2 + strh r4, [r1, 0x24] + strh r5, [r1, 0x26] + strh r6, [r1, 0x38] + mov r2, r8 + strh r2, [r1, 0x3A] + strh r0, [r1, 0x3C] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B646C + + thumb_func_start sub_80B64C0 +sub_80B64C0: @ 80B64C0 + push {lr} + ldr r2, =gUnknown_0855C384 + movs r3, 0x2E + ldrsh r1, [r0, r3] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B64C0 + + thumb_func_start sub_80B64DC +sub_80B64DC: @ 80B64DC + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080B64F4 + subs r0, r1, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _080B6550 +_080B64F4: + movs r0, 0x19 + strh r0, [r4, 0x30] + ldr r0, =gUnknown_0855C304 + ldr r1, =gUnknown_0855C3A4 + movs r2, 0x32 + ldrsh r3, [r4, r2] + lsls r3, 2 + adds r3, r1 + ldrh r1, [r4, 0x24] + ldrh r2, [r3] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + ldrh r2, [r4, 0x26] + ldrh r3, [r3, 0x2] + adds r2, r3 + lsls r2, 16 + asrs r2, 16 + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_02020630 + 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 + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1, 0x5] + ldrh r0, [r4, 0x3C] + strh r0, [r1, 0x2E] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x3A] + subs r0, 0x1 + strh r0, [r4, 0x3A] + movs r0, 0x17 + bl audio_play +_080B6550: + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B6562 + movs r0, 0x20 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_080B6562: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B64DC + + thumb_func_start sub_80B6574 +sub_80B6574: @ 80B6574 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x30] + subs r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0 + bne _080B65A4 + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + movs r0, 0x8 + strh r0, [r1, 0x30] + strh r2, [r1, 0x32] + strh r2, [r1, 0x34] + movs r2, 0x38 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _080B65A4 + movs r0, 0xB8 + lsls r0, 1 + bl fanfare_play +_080B65A4: + pop {r0} + bx r0 + thumb_func_end sub_80B6574 + + thumb_func_start sub_80B65A8 +sub_80B65A8: @ 80B65A8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r7, r0, 0 + ldrh r0, [r7, 0x30] + subs r0, 0x1 + strh r0, [r7, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _080B65D8 + movs r0, 0x8 + strh r0, [r7, 0x30] + ldrh r0, [r7, 0x32] + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + strh r0, [r7, 0x32] + cmp r0, 0 + bne _080B65D8 + ldrh r0, [r7, 0x34] + adds r0, 0x1 + strh r0, [r7, 0x34] +_080B65D8: + ldrh r4, [r7, 0x32] + adds r4, 0x3 + movs r0, 0x3 + mov r8, r0 + mov r1, r8 + ands r4, r1 + ldr r3, =0x00001007 + mov r10, r3 + mov r0, r10 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 4 + movs r1, 0x84 + lsls r1, 17 + adds r0, r1 + lsrs r0, 16 + ldr r6, =gUnknown_0855C3BC + adds r1, r4, r6 + ldrb r1, [r1] + ldr r5, =gUnknown_0855C3C0 + adds r2, r4, r5 + ldrb r2, [r2] + ldr r3, =gUnknown_0855C3C4 + mov r9, r3 + add r4, r9 + ldrb r3, [r4] + bl sub_80B609C + ldrh r4, [r7, 0x32] + adds r4, 0x2 + mov r0, r8 + ands r4, r0 + mov r0, r10 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 4 + movs r1, 0x83 + lsls r1, 17 + adds r0, r1 + lsrs r0, 16 + adds r1, r4, r6 + ldrb r1, [r1] + adds r2, r4, r5 + ldrb r2, [r2] + add r4, r9 + ldrb r3, [r4] + bl sub_80B609C + ldrh r4, [r7, 0x32] + adds r4, 0x1 + mov r3, r8 + ands r4, r3 + mov r0, r10 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 4 + movs r1, 0x81 + lsls r1, 17 + adds r0, r1 + lsrs r0, 16 + adds r1, r4, r6 + ldrb r1, [r1] + adds r2, r4, r5 + ldrb r2, [r2] + add r4, r9 + ldrb r3, [r4] + bl sub_80B609C + ldrh r4, [r7, 0x32] + lsls r4, 24 + lsrs r4, 24 + mov r0, r10 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 4 + ldr r3, =0x01050000 + adds r0, r3 + lsrs r0, 16 + adds r6, r4, r6 + ldrb r6, [r6] + adds r5, r4, r5 + ldrb r5, [r5] + add r4, r9 + ldrb r4, [r4] + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80B609C + mov r0, r10 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 4 + ldr r1, =0x01030000 + adds r0, r1 + lsrs r0, 16 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80B609C + movs r3, 0x34 + ldrsh r0, [r7, r3] + cmp r0, 0x2 + ble _080B66C2 + ldrh r0, [r7, 0x2E] + adds r0, 0x1 + movs r1, 0 + strh r0, [r7, 0x2E] + movs r0, 0x8 + strh r0, [r7, 0x30] + strh r1, [r7, 0x32] +_080B66C2: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B65A8 + + thumb_func_start sub_80B66E8 +sub_80B66E8: @ 80B66E8 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r2, r0, 0 + ldrh r0, [r2, 0x30] + subs r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _080B6718 + movs r0, 0x8 + strh r0, [r2, 0x30] + ldrh r0, [r2, 0x32] + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + strh r0, [r2, 0x32] + cmp r0, 0x3 + bne _080B6718 + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + movs r0, 0x1E + strh r0, [r2, 0x30] +_080B6718: + ldrh r4, [r2, 0x32] + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x00001007 + mov r8, r0 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 4 + movs r1, 0x84 + lsls r1, 17 + adds r0, r1 + lsrs r0, 16 + ldr r1, =gUnknown_0855C3BC + adds r1, r4, r1 + ldrb r6, [r1] + ldr r1, =gUnknown_0855C3C0 + adds r1, r4, r1 + ldrb r5, [r1] + ldr r1, =gUnknown_0855C3C4 + adds r4, r1 + ldrb r4, [r4] + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80B609C + mov r0, r8 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 4 + movs r1, 0x83 + lsls r1, 17 + adds r0, r1 + lsrs r0, 16 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80B609C + mov r0, r8 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 4 + movs r1, 0x81 + lsls r1, 17 + adds r0, r1 + lsrs r0, 16 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80B609C + mov r0, r8 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 4 + ldr r1, =0x01050000 + adds r0, r1 + lsrs r0, 16 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80B609C + mov r0, r8 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 4 + ldr r1, =0x01030000 + adds r0, r1 + lsrs r0, 16 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80B609C + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B66E8 + + thumb_func_start sub_80B67DC +sub_80B67DC: @ 80B67DC + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x30] + subs r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _080B67F2 + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] +_080B67F2: + pop {r0} + bx r0 + thumb_func_end sub_80B67DC + + thumb_func_start sub_80B67F8 +sub_80B67F8: @ 80B67F8 + ldrh r1, [r0, 0x2E] + adds r1, 0x1 + strh r1, [r0, 0x2E] + bx lr + thumb_func_end sub_80B67F8 + + thumb_func_start sub_80B6800 +sub_80B6800: @ 80B6800 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080B6816 + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + beq _080B681C +_080B6816: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_080B681C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B6800 + + thumb_func_start nullsub_97 +nullsub_97: @ 80B6824 + bx lr + thumb_func_end nullsub_97 + + thumb_func_start sub_80B6828 +sub_80B6828: @ 80B6828 + push {lr} + adds r3, r0, 0 + ldr r2, =gUnknown_02020630 + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2E + ldrsh r0, [r0, r1] + cmp r0, 0x4 + ble _080B6848 + adds r0, r3, 0 + bl FieldEffectFreeGraphicsResources +_080B6848: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B6828 + + thumb_func_start sub_80B6850 +sub_80B6850: @ 80B6850 + push {r4,lr} + adds r3, r0, 0 + adds r2, r1, 0 + ldr r0, =gUnknown_0855C31C + lsls r3, 16 + asrs r3, 16 + lsls r2, 16 + asrs r2, 16 + adds r1, r3, 0 + movs r3, 0 + bl AddObjectToBack + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =gUnknown_02020630 + adds r0, r1 + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0, 0x5] + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r3] + ldr r1, =gUnknown_0855C2AC + bl SetSpriteOamTables_NoPriorityFromTable + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B6850 + + thumb_func_start sub_80B68AC +sub_80B68AC: @ 80B68AC + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080B68D0 + movs r0, 0 + strh r0, [r4, 0x2E] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + subs r0, 0x5 + ands r0, r1 + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectImageAnim +_080B68D0: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080B68E4 + adds r0, r4, 0 + bl FieldEffectFreeGraphicsResources +_080B68E4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B68AC + + thumb_func_start sub_80B68EC +sub_80B68EC: @ 80B68EC + push {r4,r5,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 24 + cmp r3, 0 + bne _080B6934 + ldr r0, =gUnknown_0855C334 + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =gUnknown_02020630 + adds r0, r1 + ldr r1, =gUnknown_0855C2C4 + bl SetSpriteOamTables_NoPriorityFromTable + b _080B6948 + .pool +_080B6934: + ldr r0, =gUnknown_0855C34C + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r4, r0, 24 +_080B6948: + ldr r1, =gUnknown_02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r3] + strh r5, [r0, 0x2E] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B68EC + + thumb_func_start sub_80B6970 +sub_80B6970: @ 80B6970 + push {lr} + adds r3, r0, 0 + ldr r2, =gTasks + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x26 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _080B69C6 + ldrh r1, [r3, 0x30] + movs r2, 0x30 + ldrsh r0, [r3, r2] + cmp r0, 0 + beq _080B699E + subs r0, r1, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _080B69C0 +_080B699E: + movs r0, 0x10 + strh r0, [r3, 0x30] + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + ldrb r2, [r0] + lsls r0, r2, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] +_080B69C0: + ldrh r0, [r3, 0x32] + adds r0, 0x1 + strh r0, [r3, 0x32] +_080B69C6: + movs r2, 0x32 + ldrsh r0, [r3, r2] + cmp r0, 0x7F + ble _080B69D4 + adds r0, r3, 0 + bl FieldEffectFreeGraphicsResources +_080B69D4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B6970 + + thumb_func_start sub_80B69DC +sub_80B69DC: @ 80B69DC + push {lr} + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + ldr r1, =gUnknown_03005DAC + ldr r0, =mapldr_080842E8 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B69DC + + thumb_func_start mapldr_080842E8 +mapldr_080842E8: @ 80B69FC + push {lr} + bl pal_fill_black + ldr r0, =task00_8084310 + movs r1, 0 + bl CreateTask + bl script_env_2_enable + bl player_bitmagic + ldr r1, =gUnknown_03005DAC + movs r0, 0 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end mapldr_080842E8 + + thumb_func_start task00_8084310 +task00_8084310: @ 80B6A24 + push {r4-r6,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 r0, 0x8 + ldrsh r6, [r4, r0] + cmp r6, 0 + bne _080B6A64 + bl sub_80ABDFC + lsls r0, 24 + cmp r0, 0 + beq _080B6A8A + bl brm_get_pokemon_selection + ldr r1, =gUnknown_02038C08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + cmp r0, 0x5 + ble _080B6A58 + str r6, [r1] +_080B6A58: + movs r0, 0x1F + bl FieldEffectStart + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B6A64: + movs r0, 0x1F + bl FieldEffectActiveListContains + lsls r0, 24 + cmp r0, 0 + bne _080B6A8A + bl flag_var_implications_of_teleport_ + bl warp_in + ldr r0, =c2_load_new_map + bl SetMainCallback2 + ldr r1, =gUnknown_03005DAC + ldr r0, =mapldr_08084390 + str r0, [r1] + adds r0, r5, 0 + bl DestroyTask +_080B6A8A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end task00_8084310 + + thumb_func_start mapldr_08084390 +mapldr_08084390: @ 80B6AA4 + push {r4,lr} + bl sub_8085784 + bl pal_fill_black + ldr r0, =c3_080843F8 + movs r1, 0 + bl CreateTask + ldr r4, =gUnknown_02037350 + ldr r3, =gUnknown_02037590 + ldrb r1, [r3, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x1] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0, 0x1] + ldrb r1, [r3] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080B6AE6 + ldrb r1, [r3, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x3 + bl FieldObjectTurn +_080B6AE6: + bl script_env_2_enable + bl player_bitmagic + ldr r1, =gUnknown_03005DAC + movs r0, 0 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end mapldr_08084390 + + thumb_func_start c3_080843F8 +c3_080843F8: @ 80B6B0C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + 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 + bne _080B6B3E + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B6B58 + movs r0, 0x20 + bl FieldEffectStart + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B6B3E: + movs r0, 0x20 + bl FieldEffectActiveListContains + lsls r0, 24 + cmp r0, 0 + bne _080B6B58 + bl script_env_2_disable + bl sub_809757C + adds r0, r5, 0 + bl DestroyTask +_080B6B58: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end c3_080843F8 + + thumb_func_start sub_80B6B68 +sub_80B6B68: @ 80B6B68 + push {lr} + bl sub_8085784 + bl pal_fill_for_maplights + bl script_env_2_enable + bl player_bitmagic + ldr r0, =sub_80B6B94 + movs r1, 0 + bl CreateTask + ldr r1, =gUnknown_03005DAC + movs r0, 0 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B6B68 + + thumb_func_start sub_80B6B94 +sub_80B6B94: @ 80B6B94 + push {r4,r5,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 r5, =gUnknown_0855C3C8 +_080B6BA6: + 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 _080B6BA6 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B6B94 + + thumb_func_start sub_80B6BCC +sub_80B6BCC: @ 80B6BCC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + mov r9, r0 + ldr r6, =gUnknown_02037590 + ldrb r0, [r6, 0x5] + lsls r5, r0, 3 + adds r5, r0 + lsls r5, 2 + ldr r0, =gUnknown_02037350 + mov r8, r0 + add r5, r8 + ldrb r0, [r6, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_02020630 + adds r4, r0 + bl CameraObjectReset2 + ldrb r1, [r6, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r1, [r0, 0x1] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0, 0x1] + movs r0, 0x1 + strb r0, [r6, 0x6] + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + bl GetFaceDirectionAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl FieldObjectSetSpecialAnim + adds r3, r4, 0 + adds r3, 0x42 + ldrb r0, [r3] + lsrs r0, 6 + mov r1, r9 + strh r0, [r1, 0x10] + ldrb r0, [r5, 0x3] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r5, 0x3] + ldrb r1, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x5] + ldrb r1, [r3] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r3] + mov r1, r9 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0x1 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B6BCC + + thumb_func_start sub_80B6C74 +sub_80B6C74: @ 80B6C74 + push {r4,lr} + adds r4, r0, 0 + bl sub_80ABDFC + lsls r0, 24 + cmp r0, 0 + beq _080B6C88 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B6C88: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B6C74 + + thumb_func_start sub_80B6C90 +sub_80B6C90: @ 80B6C90 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, =gUnknown_02037590 + ldrb r0, [r6, 0x4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =gUnknown_02020630 + adds r2, r0 + adds r0, r2, 0 + adds r0, 0x29 + movs r4, 0 + ldrsb r4, [r0, r4] + lsls r0, r4, 17 + negs r0, r0 + ldrh r1, [r2, 0x22] + ldr r3, =gUnknown_02021BBE + adds r1, r4 + ldrh r3, [r3] + adds r1, r3 + asrs r0, 16 + adds r0, r1 + negs r0, r0 + movs r1, 0 + strh r0, [r2, 0x26] + movs r0, 0x1 + strh r0, [r5, 0xA] + strh r1, [r5, 0xC] + ldr r2, =gUnknown_02037350 + ldrb r0, [r6, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + movs r0, 0x2B + bl audio_play + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B6C90 + + thumb_func_start sub_80B6D04 +sub_80B6D04: @ 80B6D04 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r2, =gUnknown_02037590 + ldrb r1, [r2, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r6, r0, r1 + ldrb r1, [r2, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02020630 + adds r5, r0, r1 + ldrh r0, [r4, 0xA] + ldrh r1, [r5, 0x26] + adds r0, r1 + strh r0, [r5, 0x26] + ldrh r2, [r4, 0xA] + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x7 + bgt _080B6D46 + ldrh r1, [r4, 0xC] + adds r0, r2, r1 + strh r0, [r4, 0xC] + movs r1, 0xF + ands r0, r1 + cmp r0, 0 + beq _080B6D46 + lsls r0, r2, 1 + strh r0, [r4, 0xA] +_080B6D46: + ldrh r2, [r4, 0xE] + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B6D84 + movs r0, 0x26 + ldrsh r1, [r5, r0] + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + blt _080B6D84 + adds r0, r2, 0x1 + strh r0, [r4, 0xE] + ldrb r1, [r6, 0x3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r6, 0x3] + ldrb r1, [r4, 0x10] + adds r3, r5, 0 + adds r3, 0x42 + lsls r1, 6 + ldrb r2, [r3] + movs r0, 0x3F + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + ldrb r0, [r6] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r6] +_080B6D84: + movs r1, 0x26 + ldrsh r0, [r5, r1] + cmp r0, 0 + blt _080B6DA8 + movs r0, 0xD6 + bl audio_play + ldrb r0, [r6] + movs r1, 0x8 + orrs r0, r1 + movs r1, 0x20 + orrs r0, r1 + strb r0, [r6] + movs r0, 0 + strh r0, [r5, 0x26] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B6DA8: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B6D04 + + thumb_func_start sub_80B6DBC +sub_80B6DBC: @ 80B6DBC + push {lr} + ldrh r1, [r0, 0x8] + adds r1, 0x1 + movs r2, 0 + strh r1, [r0, 0x8] + movs r1, 0x4 + strh r1, [r0, 0xA] + strh r2, [r0, 0xC] + movs r0, 0 + bl SetCameraPanningCallback + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_80B6DBC + + thumb_func_start sub_80B6DD8 +sub_80B6DD8: @ 80B6DD8 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0 + bl SetCameraPanning + ldrh r0, [r4, 0xA] + negs r2, r0 + strh r2, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080B6E00 + lsls r0, r2, 16 + asrs r0, 17 + strh r0, [r4, 0xA] +_080B6E00: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B6E0E + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B6E0E: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B6DD8 + + thumb_func_start sub_80B6E18 +sub_80B6E18: @ 80B6E18 + push {lr} + ldr r1, =gUnknown_02037590 + movs r0, 0 + strb r0, [r1, 0x6] + bl script_env_2_disable + bl CameraObjectReset1 + bl sub_809757C + bl InstallCameraPanAheadCallback + ldr r0, =sub_80B6B94 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B6E18 + + thumb_func_start sub_80B6E4C +sub_80B6E4C: @ 80B6E4C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =sub_80B6E88 + 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 r0, [r1, 0xA] + cmp r4, 0x6A + bne _080B6E78 + movs r0, 0x1 + strh r0, [r1, 0xA] +_080B6E78: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B6E4C + + thumb_func_start sub_80B6E88 +sub_80B6E88: @ 80B6E88 + push {r4,r5,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 r5, =gUnknown_0855C3E4 +_080B6E9A: + 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 _080B6E9A + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B6E88 + + thumb_func_start sub_80B6EC0 +sub_80B6EC0: @ 80B6EC0 + push {r4,lr} + adds r4, r0, 0 + bl player_bitmagic + bl CameraObjectReset2 + ldrb r0, [r4, 0xA] + bl sub_80E1558 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B6EC0 + + thumb_func_start sub_80B6EE0 +sub_80B6EE0: @ 80B6EE0 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r4, r0, r1 + adds r0, r4, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + beq _080B6F0A + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B6F3E +_080B6F0A: + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + bl GetFaceDirectionAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + ldrh r0, [r5, 0x8] + adds r0, 0x1 + movs r1, 0 + strh r0, [r5, 0x8] + strh r1, [r5, 0xC] + strh r1, [r5, 0xE] + ldrb r0, [r5, 0xA] + cmp r0, 0 + bne _080B6F38 + movs r0, 0x4 + strh r0, [r5, 0x8] +_080B6F38: + movs r0, 0x50 + bl audio_play +_080B6F3E: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B6EE0 + + thumb_func_start sub_80B6F50 +sub_80B6F50: @ 80B6F50 + push {r4,lr} + adds r4, r0, 0 + bl sub_80B6FB8 + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x3 + ble _080B6F6A + bl sub_80B7050 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B6F6A: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B6F50 + + thumb_func_start sub_80B6F74 +sub_80B6F74: @ 80B6F74 + push {lr} + bl sub_80B6FB8 + bl sub_80B7060 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_80B6F74 + + thumb_func_start sub_80B6F84 +sub_80B6F84: @ 80B6F84 + push {r4,lr} + adds r4, r0, 0 + bl sub_80B7004 + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x3 + ble _080B6F9E + bl sub_80B7050 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B6F9E: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B6F84 + + thumb_func_start sub_80B6FA8 +sub_80B6FA8: @ 80B6FA8 + push {lr} + bl sub_80B7004 + bl sub_80B7060 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_80B6FA8 + + thumb_func_start sub_80B6FB8 +sub_80B6FB8: @ 80B6FB8 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =gUnknown_02037590 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_02020630 + adds r4, r0 + movs r0, 0xC + ldrsh r1, [r5, r0] + movs r0, 0x84 + bl Cos + strh r0, [r4, 0x24] + movs r0, 0xC + ldrsh r1, [r5, r0] + movs r0, 0x94 + bl Sin + strh r0, [r4, 0x26] + ldrh r0, [r5, 0xE] + adds r0, 0x1 + strh r0, [r5, 0xE] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B6FF6 + ldrh r0, [r5, 0xC] + adds r0, 0x1 + strh r0, [r5, 0xC] +_080B6FF6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B6FB8 + + thumb_func_start sub_80B7004 +sub_80B7004: @ 80B7004 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =gUnknown_02037590 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_02020630 + adds r4, r0 + movs r0, 0xC + ldrsh r1, [r5, r0] + movs r0, 0x7C + bl Cos + strh r0, [r4, 0x24] + movs r0, 0xC + ldrsh r1, [r5, r0] + movs r0, 0x76 + bl Sin + strh r0, [r4, 0x26] + ldrh r0, [r5, 0xE] + adds r0, 0x1 + strh r0, [r5, 0xE] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B7042 + ldrh r0, [r5, 0xC] + adds r0, 0x1 + strh r0, [r5, 0xC] +_080B7042: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B7004 + + thumb_func_start sub_80B7050 +sub_80B7050: @ 80B7050 + push {lr} + bl music_something + bl sub_80AF0B4 + pop {r0} + bx r0 + thumb_func_end sub_80B7050 + + thumb_func_start sub_80B7060 +sub_80B7060: @ 80B7060 + push {lr} + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B709C + bl sub_80859A0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B709C + bl sub_80E1570 + bl warp_in + ldr r1, =gUnknown_03005DAC + ldr r0, =sub_80B70B4 + str r0, [r1] + ldr r0, =c2_load_new_map + bl SetMainCallback2 + ldr r0, =sub_80B6E88 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080B709C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B7060 + + thumb_func_start sub_80B70B4 +sub_80B70B4: @ 80B70B4 + push {lr} + bl sub_8085784 + bl pal_fill_for_maplights + bl script_env_2_enable + ldr r0, =sub_80B70DC + movs r1, 0 + bl CreateTask + ldr r1, =gUnknown_03005DAC + movs r0, 0 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B70B4 + + thumb_func_start sub_80B70DC +sub_80B70DC: @ 80B70DC + push {r4,r5,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 r5, =gUnknown_0855C3FC +_080B70EE: + 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 _080B70EE + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B70DC + + thumb_func_start sub_80B7114 +sub_80B7114: @ 80B7114 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + bl CameraObjectReset2 + ldr r0, =gUnknown_02037590 + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_02037350 + adds r4, r0 + movs r0, 0x4 + bl GetFaceDirectionAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + 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 r1, r0, 24 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0x10 + strh r0, [r5, 0xA] + cmp r1, 0x6B + bne _080B717C + movs r1, 0x1 + movs r0, 0x3 + strh r0, [r5, 0x8] + b _080B717E + .pool +_080B717C: + movs r1, 0 +_080B717E: + adds r0, r1, 0 + bl sub_80E1558 + movs r0, 0x1 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B7114 + + thumb_func_start sub_80B7190 +sub_80B7190: @ 80B7190 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =gUnknown_02037590 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_02020630 + adds r4, r0 + movs r0, 0xA + ldrsh r1, [r5, r0] + movs r0, 0x84 + bl Cos + strh r0, [r4, 0x24] + movs r0, 0xA + ldrsh r1, [r5, r0] + movs r0, 0x94 + bl Sin + strh r0, [r4, 0x26] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B7190 + + thumb_func_start sub_80B71D0 +sub_80B71D0: @ 80B71D0 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, =gUnknown_02037590 + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02020630 + adds r5, r0, r1 + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0x84 + bl Cos + strh r0, [r5, 0x24] + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0x94 + bl Sin + strh r0, [r5, 0x26] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B720E + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] +_080B720E: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B721E + strh r0, [r5, 0x24] + strh r0, [r5, 0x26] + movs r0, 0x5 + strh r0, [r4, 0x8] +_080B721E: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B71D0 + + thumb_func_start sub_80B7230 +sub_80B7230: @ 80B7230 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =gUnknown_02037590 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_02020630 + adds r4, r0 + movs r0, 0xA + ldrsh r1, [r5, r0] + movs r0, 0x7C + bl Cos + strh r0, [r4, 0x24] + movs r0, 0xA + ldrsh r1, [r5, r0] + movs r0, 0x76 + bl Sin + strh r0, [r4, 0x26] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B7230 + + thumb_func_start sub_80B7270 +sub_80B7270: @ 80B7270 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, =gUnknown_02037590 + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02020630 + adds r5, r0, r1 + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0x7C + bl Cos + strh r0, [r5, 0x24] + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0x76 + bl Sin + strh r0, [r5, 0x26] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B72AE + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] +_080B72AE: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B72C0 + strh r0, [r5, 0x24] + strh r0, [r5, 0x26] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B72C0: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B7270 + + thumb_func_start sub_80B72D0 +sub_80B72D0: @ 80B72D0 + push {r4,lr} + adds r4, r0, 0 + bl sub_80E1584 + lsls r0, 24 + cmp r0, 0 + bne _080B72EC + bl sub_80E1570 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + b _080B72EE +_080B72EC: + movs r0, 0 +_080B72EE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B72D0 + + thumb_func_start sub_80B72F4 +sub_80B72F4: @ 80B72F4 + push {r4,lr} + ldr r0, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r4, r0, r1 + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B7338 + bl CameraObjectReset1 + bl script_env_2_disable + movs r0, 0x4 + bl GetGoSpeed0AnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + ldr r0, =sub_80B70DC + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080B7338: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B72F4 + + thumb_func_start oei_waterfall +oei_waterfall: @ 80B734C + push {r4,lr} + ldr r4, =sub_80B7384 + adds r0, r4, 0 + movs r1, 0xFF + 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 r2, =gUnknown_02038C08 + ldr r2, [r2] + strh r2, [r1, 0xA] + bl _call_via_r4 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end oei_waterfall + + thumb_func_start sub_80B7384 +sub_80B7384: @ 80B7384 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_0855C418 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_080B7396: + movs r0, 0x8 + ldrsh r2, [r4, r0] + lsls r2, 2 + adds r2, r5 + ldr r0, =gUnknown_02037590 + ldrb r0, [r0, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =gUnknown_02037350 + adds r1, r0 + ldr r2, [r2] + adds r0, r4, 0 + bl _call_via_r2 + lsls r0, 24 + cmp r0, 0 + bne _080B7396 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B7384 + + thumb_func_start sub_80B73D0 +sub_80B73D0: @ 80B73D0 + push {r4,lr} + adds r4, r0, 0 + bl script_env_2_enable + ldr r1, =gUnknown_02037590 + movs r0, 0x1 + strb r0, [r1, 0x6] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B73D0 + + thumb_func_start waterfall_1_do_anim_probably +waterfall_1_do_anim_probably: @ 80B73F0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl script_env_2_enable + adds r0, r5, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + bne _080B7420 + adds r0, r5, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + ldr r1, =gUnknown_02038C08 + movs r2, 0xA + ldrsh r0, [r4, r2] + str r0, [r1] + movs r0, 0x3B + bl FieldEffectStart + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B7420: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end waterfall_1_do_anim_probably + + thumb_func_start waterfall_2_wait_anim_finish_probably +waterfall_2_wait_anim_finish_probably: @ 80B742C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x6 + bl FieldEffectActiveListContains + lsls r0, 24 + cmp r0, 0 + bne _080B7446 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + b _080B7448 +_080B7446: + movs r0, 0 +_080B7448: + pop {r4} + pop {r1} + bx r1 + thumb_func_end waterfall_2_wait_anim_finish_probably + + thumb_func_start sub_80B7450 +sub_80B7450: @ 80B7450 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r0, 0x2 + bl GetSimpleGoAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B7450 + + thumb_func_start sub_80B7478 +sub_80B7478: @ 80B7478 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + bne _080B748E + movs r0, 0 + b _080B74CA +_080B748E: + ldrb r0, [r4, 0x1E] + bl MetatileBehavior_IsWaterfall + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080B74C4 + bl script_env_2_disable + ldr r0, =gUnknown_02037590 + strb r4, [r0, 0x6] + ldr r0, =sub_80B7384 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + movs r0, 0x2B + bl FieldEffectActiveListRemove + movs r0, 0 + b _080B74CA + .pool +_080B74C4: + movs r0, 0x3 + strh r0, [r5, 0x8] + movs r0, 0x1 +_080B74CA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B7478 + + thumb_func_start sub_80B74D0 +sub_80B74D0: @ 80B74D0 + push {r4,lr} + ldr r4, =sub_80B750C + adds r0, r4, 0 + movs r1, 0xFF + 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 r3, =gUnknown_02038C08 + ldr r2, [r3] + strh r2, [r1, 0x26] + ldr r2, [r3, 0x4] + strh r2, [r1, 0x24] + bl _call_via_r4 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B74D0 + + thumb_func_start sub_80B750C +sub_80B750C: @ 80B750C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_0855C42C + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_080B751E: + 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 _080B751E + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B750C + + thumb_func_start dive_1_lock +dive_1_lock: @ 80B7544 + ldr r2, =gUnknown_02037590 + movs r1, 0x1 + strb r1, [r2, 0x6] + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + movs r0, 0 + bx lr + .pool + thumb_func_end dive_1_lock + + thumb_func_start dive_2_unknown +dive_2_unknown: @ 80B7558 + push {r4,lr} + adds r4, r0, 0 + bl script_env_2_enable + ldr r1, =gUnknown_02038C08 + movs r2, 0x26 + ldrsh r0, [r4, r2] + str r0, [r1] + movs r0, 0x3B + bl FieldEffectStart + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end dive_2_unknown + + thumb_func_start dive_3_unknown +dive_3_unknown: @ 80B7580 + push {lr} + sub sp, 0x8 + mov r1, sp + adds r1, 0x2 + mov r0, sp + bl PlayerGetDestCoords + movs r0, 0x6 + bl FieldEffectActiveListContains + lsls r0, 24 + cmp r0, 0 + bne _080B75C4 + ldr r2, =gUnknown_02037350 + ldr r0, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1E] + mov r0, sp + bl dive_warp + ldr r0, =sub_80B750C + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + movs r0, 0x2C + bl FieldEffectActiveListRemove +_080B75C4: + movs r0, 0 + add sp, 0x8 + pop {r1} + bx r1 + .pool + thumb_func_end dive_3_unknown + + thumb_func_start sub_80B75D8 +sub_80B75D8: @ 80B75D8 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =sub_80B75F0 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B75D8 + + thumb_func_start sub_80B75F0 +sub_80B75F0: @ 80B75F0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r6, =gUnknown_0855C438 + ldr r2, =gTasks + ldr r5, =gUnknown_02037590 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_080B7604: + movs r0, 0x8 + ldrsh r3, [r4, r0] + lsls r3, 2 + adds r3, r6 + ldrb r0, [r5, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =gUnknown_02037350 + adds r1, r0 + ldrb r0, [r5, 0x4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =gUnknown_02020630 + adds r2, r0 + ldr r3, [r3] + adds r0, r4, 0 + bl _call_via_r3 + lsls r0, 24 + cmp r0, 0 + bne _080B7604 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B75F0 + + thumb_func_start sub_80B764C +sub_80B764C: @ 80B764C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl player_bitmagic + bl CameraObjectReset2 + movs r0, 0 + bl SetCameraPanningCallback + ldr r0, =gUnknown_02037590 + movs r2, 0x1 + strb r2, [r0, 0x6] + ldrb r0, [r5, 0x3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r5, 0x3] + strh r2, [r4, 0xA] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B764C + + thumb_func_start sub_80B7684 +sub_80B7684: @ 80B7684 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0 + bl SetCameraPanning + ldrh r0, [r4, 0xA] + negs r0, r0 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _080B76B0 + movs r0, 0 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B76B0: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B7684 + + thumb_func_start sub_80B76B8 +sub_80B76B8: @ 80B76B8 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0 + strh r0, [r2, 0x26] + movs r0, 0x1 + strh r0, [r4, 0xE] + ldr r3, =gUnknown_02038C08 + movs r5, 0x10 + ldrsh r0, [r1, r5] + str r0, [r3] + movs r5, 0x12 + ldrsh r0, [r1, r5] + str r0, [r3, 0x4] + adds r0, r2, 0 + adds r0, 0x43 + ldrb r0, [r0] + subs r0, 0x1 + str r0, [r3, 0x8] + ldrb r0, [r2, 0x5] + lsls r0, 28 + lsrs r0, 30 + str r0, [r3, 0xC] + movs r0, 0x32 + bl FieldEffectStart + movs r0, 0xB2 + bl audio_play + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B76B8 + + thumb_func_start sub_80B7704 +sub_80B7704: @ 80B7704 + push {r4-r7,lr} + adds r4, r0, 0 + adds r6, r1, 0 + adds r5, r2, 0 + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0 + bl SetCameraPanning + ldrh r0, [r4, 0xA] + negs r2, r0 + strh r2, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r1, r0, 0x1 + strh r1, [r4, 0xC] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x11 + bgt _080B773E + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + bne _080B7750 + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x3 + bgt _080B7750 + lsls r0, r2, 1 + b _080B774E +_080B773E: + movs r0, 0x4 + ands r1, r0 + cmp r1, 0 + bne _080B7750 + lsls r0, r2, 16 + cmp r0, 0 + ble _080B7750 + asrs r0, 17 +_080B774E: + strh r0, [r4, 0xA] +_080B7750: + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x6 + ble _080B779C + adds r0, r5, 0 + adds r0, 0x29 + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r2, r1, 17 + negs r2, r2 + movs r7, 0x26 + ldrsh r3, [r5, r7] + movs r7, 0x22 + ldrsh r0, [r5, r7] + adds r0, r1 + ldr r1, =gUnknown_02021BBE + movs r7, 0 + ldrsh r1, [r1, r7] + adds r0, r1 + asrs r2, 16 + adds r0, r2 + cmn r3, r0 + ble _080B7798 + ldrh r0, [r5, 0x26] + ldrh r1, [r4, 0xE] + subs r0, r1 + strh r0, [r5, 0x26] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x7 + bgt _080B779C + adds r0, r1, 0x1 + strh r0, [r4, 0xE] + b _080B779C + .pool +_080B7798: + movs r0, 0x1 + strh r0, [r4, 0x10] +_080B779C: + ldrh r2, [r4, 0x12] + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B77DA + movs r7, 0x26 + ldrsh r1, [r5, r7] + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + bge _080B77DA + adds r0, r2, 0x1 + strh r0, [r4, 0x12] + ldrb r0, [r6, 0x3] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r6, 0x3] + ldrb r1, [r5, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + adds r2, r5, 0 + adds r2, 0x42 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] +_080B77DA: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B77F0 + movs r7, 0x10 + ldrsh r0, [r4, r7] + cmp r0, 0 + beq _080B77F0 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B77F0: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80B7704 + + thumb_func_start sub_80B77F8 +sub_80B77F8: @ 80B77F8 + push {r4,lr} + adds r4, r0, 0 + bl music_something + bl sub_80AF0B4 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B77F8 + + thumb_func_start sub_80B7814 +sub_80B7814: @ 80B7814 + push {lr} + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B784C + bl sub_80859A0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B784C + bl warp_in + ldr r1, =gUnknown_03005DAC + ldr r0, =mapldr_080851BC + str r0, [r1] + ldr r0, =c2_load_new_map + bl SetMainCallback2 + ldr r0, =sub_80B75F0 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080B784C: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B7814 + + thumb_func_start mapldr_080851BC +mapldr_080851BC: @ 80B7868 + push {lr} + bl sub_8085784 + bl pal_fill_for_maplights + bl script_env_2_enable + ldr r0, =gUnknown_03005DAC + movs r1, 0 + str r1, [r0] + ldr r0, =sub_80B7890 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end mapldr_080851BC + + thumb_func_start sub_80B7890 +sub_80B7890: @ 80B7890 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r6, =gUnknown_0855C450 + ldr r2, =gTasks + ldr r5, =gUnknown_02037590 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_080B78A4: + movs r0, 0x8 + ldrsh r3, [r4, r0] + lsls r3, 2 + adds r3, r6 + ldrb r0, [r5, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =gUnknown_02037350 + adds r1, r0 + ldrb r0, [r5, 0x4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =gUnknown_02020630 + adds r2, r0 + ldr r3, [r3] + adds r0, r4, 0 + bl _call_via_r3 + lsls r0, 24 + cmp r0, 0 + bne _080B78A4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B7890 + + thumb_func_start sub_80B78EC +sub_80B78EC: @ 80B78EC + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + bl CameraObjectReset2 + bl player_bitmagic + ldr r1, =gUnknown_02037590 + movs r0, 0x1 + strb r0, [r1, 0x6] + ldrb r0, [r4, 0x1] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B78EC + + thumb_func_start sub_80B791C +sub_80B791C: @ 80B791C + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + bl sub_80ABDFC + lsls r0, 24 + cmp r0, 0 + beq _080B795C + ldr r1, =gUnknown_02038C08 + movs r2, 0x10 + ldrsh r0, [r5, r2] + str r0, [r1] + movs r2, 0x12 + ldrsh r0, [r5, r2] + str r0, [r1, 0x4] + adds r0, r6, 0 + adds r0, 0x43 + ldrb r0, [r0] + subs r0, 0x1 + str r0, [r1, 0x8] + ldrb r0, [r6, 0x5] + lsls r0, 28 + lsrs r0, 30 + str r0, [r1, 0xC] + movs r0, 0x31 + bl FieldEffectStart + strh r0, [r4, 0xA] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B795C: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B791C + + thumb_func_start sub_80B7968 +sub_80B7968: @ 80B7968 + push {r4,lr} + adds r2, r0, 0 + adds r4, r1, 0 + movs r0, 0xA + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02020630 + adds r0, r1 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0x1 + bls _080B79B0 + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + ldrb r1, [r4, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] + bl CameraObjectReset1 + movs r0, 0xAF + bl audio_play + movs r0, 0x4 + bl sub_8093514 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim +_080B79B0: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B7968 + + thumb_func_start sub_80B79BC +sub_80B79BC: @ 80B79BC + push {lr} + adds r0, r1, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B79E6 + ldr r1, =gUnknown_02037590 + movs r0, 0 + strb r0, [r1, 0x6] + bl script_env_2_disable + bl sub_809757C + ldr r0, =sub_80B7890 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080B79E6: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B79BC + + thumb_func_start sub_80B79F4 +sub_80B79F4: @ 80B79F4 + push {r4,lr} + ldr r4, =gUnknown_02038C08 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, =gFieldEffectObjectTemplatePointers + adds r0, 0x84 + ldr r0, [r0] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0x8] + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_02020630 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + movs r1, 0x3 + ldrb r3, [r4, 0xC] + ands r3, r1 + lsls r3, 2 + ldrb r4, [r2, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r4 + orrs r1, r3 + strb r1, [r2, 0x5] + adds r2, 0x3E + ldrb r1, [r2] + movs r3, 0x2 + orrs r1, r3 + strb r1, [r2] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B79F4 + + thumb_func_start sub_80B7A58 +sub_80B7A58: @ 80B7A58 + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080B7A70 + adds r0, r2, 0 + movs r1, 0x32 + bl FieldEffectStop +_080B7A70: + pop {r0} + bx r0 + thumb_func_end sub_80B7A58 + + thumb_func_start sub_80B7A74 +sub_80B7A74: @ 80B7A74 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =sub_80B7A8C + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B7A74 + + thumb_func_start sub_80B7A8C +sub_80B7A8C: @ 80B7A8C + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r6, =gUnknown_0855C460 + ldr r2, =gTasks + ldr r5, =gUnknown_02037590 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_080B7AA0: + movs r0, 0x8 + ldrsh r3, [r4, r0] + lsls r3, 2 + adds r3, r6 + ldrb r0, [r5, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =gUnknown_02037350 + adds r1, r0 + ldrb r0, [r5, 0x4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =gUnknown_02020630 + adds r2, r0 + ldr r3, [r3] + adds r0, r4, 0 + bl _call_via_r3 + lsls r0, 24 + cmp r0, 0 + bne _080B7AA0 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B7A8C + + thumb_func_start sub_80B7AE8 +sub_80B7AE8: @ 80B7AE8 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + bl player_bitmagic + bl CameraObjectReset2 + ldr r1, =gUnknown_02037590 + movs r0, 0x1 + strb r0, [r1, 0x6] + ldrb r0, [r4, 0x3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4, 0x3] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B7AE8 + + thumb_func_start sub_80B7B18 +sub_80B7B18: @ 80B7B18 + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r6, r2, 0 + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B7B8C + ldrh r1, [r5, 0xA] + movs r2, 0xA + ldrsh r0, [r5, r2] + cmp r0, 0x3 + ble _080B7B6C + ldr r1, =gUnknown_02038C08 + movs r2, 0x10 + ldrsh r0, [r4, r2] + str r0, [r1] + movs r2, 0x12 + ldrsh r0, [r4, r2] + str r0, [r1, 0x4] + adds r0, r6, 0 + adds r0, 0x43 + ldrb r0, [r0] + subs r0, 0x1 + str r0, [r1, 0x8] + ldrb r0, [r6, 0x5] + lsls r0, 28 + lsrs r0, 30 + str r0, [r1, 0xC] + movs r0, 0x31 + bl FieldEffectStart + strh r0, [r5, 0xA] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _080B7B8C + .pool +_080B7B6C: + adds r0, r1, 0x1 + strh r0, [r5, 0xA] + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetStepInPlaceDelay4AnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + movs r0, 0x27 + bl audio_play +_080B7B8C: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80B7B18 + + thumb_func_start sub_80B7B94 +sub_80B7B94: @ 80B7B94 + push {r4,lr} + adds r3, r0, 0 + adds r4, r1, 0 + ldr r2, =gUnknown_02020630 + movs r0, 0xA + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0x2 + bne _080B7BBE + ldrb r0, [r4, 0x1] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_080B7BBE: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B7B94 + + thumb_func_start sub_80B7BCC +sub_80B7BCC: @ 80B7BCC + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x31 + bl FieldEffectActiveListContains + lsls r0, 24 + cmp r0, 0 + bne _080B7BEA + bl music_something + bl sub_80AF0B4 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B7BEA: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B7BCC + + thumb_func_start sub_80B7BF4 +sub_80B7BF4: @ 80B7BF4 + push {lr} + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B7C2C + bl sub_80859A0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B7C2C + bl warp_in + ldr r1, =gUnknown_03005DAC + ldr r0, =sub_80B6B68 + str r0, [r1] + ldr r0, =c2_load_new_map + bl SetMainCallback2 + ldr r0, =sub_80B7A8C + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080B7C2C: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B7BF4 + + thumb_func_start sub_80B7C48 +sub_80B7C48: @ 80B7C48 + push {r4,lr} + ldr r4, =gUnknown_02038C08 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, =gFieldEffectObjectTemplatePointers + adds r0, 0x80 + ldr r0, [r0] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0x8] + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_02020630 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + movs r1, 0x3 + ldrb r3, [r4, 0xC] + ands r3, r1 + lsls r3, 2 + ldrb r4, [r2, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r4 + orrs r1, r3 + strb r1, [r2, 0x5] + adds r2, 0x3E + ldrb r1, [r2] + movs r3, 0x2 + orrs r1, r3 + strb r1, [r2] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B7C48 + + thumb_func_start sub_80B7CAC +sub_80B7CAC: @ 80B7CAC + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080B7CC4 + adds r0, r2, 0 + movs r1, 0x31 + bl FieldEffectStop +_080B7CC4: + pop {r0} + bx r0 + thumb_func_end sub_80B7CAC + + thumb_func_start sub_80B7CC8 +sub_80B7CC8: @ 80B7CC8 + push {lr} + bl script_env_2_enable + bl player_bitmagic + ldr r0, =sub_80B7CE4 + movs r1, 0x50 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B7CC8 + + thumb_func_start sub_80B7CE4 +sub_80B7CE4: @ 80B7CE4 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gUnknown_0855C474 + ldr r2, =gTasks + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B7CE4 + + thumb_func_start sub_80B7D14 +sub_80B7D14: @ 80B7D14 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x40 + strh r0, [r4, 0x24] + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B7D14 + + thumb_func_start sub_80B7D34 +sub_80B7D34: @ 80B7D34 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r1, =gUnknown_0855C47C + mov r0, sp + movs r2, 0x5 + bl memcpy + ldrh r1, [r4, 0x24] + movs r2, 0x24 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080B7D60 + subs r0, r1, 0x1 + strh r0, [r4, 0x24] + lsls r0, 16 + cmp r0, 0 + bne _080B7D60 + bl music_something + bl sub_80AF0B4 +_080B7D60: + ldr r0, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r5, r0, r1 + adds r0, r5, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + beq _080B7D86 + adds r0, r5, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B7E40 +_080B7D86: + movs r1, 0x24 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B7DF8 + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B7DF8 + bl sub_80859A0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B7DF8 + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl FieldObjectSetDirection + bl sub_8084E14 + bl warp_in + ldr r1, =gUnknown_03005DAC + ldr r0, =mapldr_080859D4 + str r0, [r1] + ldr r0, =c2_load_new_map + bl SetMainCallback2 + ldr r0, =sub_80B7CE4 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + b _080B7E40 + .pool +_080B7DF8: + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080B7E0C + subs r0, r1, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + bne _080B7E40 +_080B7E0C: + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + add r0, sp + ldrb r0, [r0] + bl GetFaceDirectionAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl FieldObjectSetSpecialAnim + ldrh r1, [r4, 0xC] + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0xB + bgt _080B7E34 + adds r0, r1, 0x1 + strh r0, [r4, 0xC] +_080B7E34: + ldrh r1, [r4, 0xC] + lsls r1, 16 + asrs r1, 18 + movs r0, 0x8 + asrs r0, r1 + strh r0, [r4, 0xA] +_080B7E40: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80B7D34 + + thumb_func_start mapldr_080859D4 +mapldr_080859D4: @ 80B7E48 + push {lr} + bl sub_8085784 + bl pal_fill_for_maplights + bl script_env_2_enable + bl player_bitmagic + ldr r1, =gUnknown_03005DAC + movs r0, 0 + str r0, [r1] + ldr r2, =gUnknown_02037350 + ldr r0, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0, 0x1] + ldr r0, =sub_80B7E94 + movs r1, 0 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end mapldr_080859D4 + + thumb_func_start sub_80B7E94 +sub_80B7E94: @ 80B7E94 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gUnknown_0855C484 + ldr r2, =gTasks + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B7E94 + + thumb_func_start sub_80B7EC4 +sub_80B7EC4: @ 80B7EC4 + push {r4,lr} + adds r4, r0, 0 + bl sub_80ABDFC + lsls r0, 24 + cmp r0, 0 + beq _080B7EE2 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] +_080B7EE2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B7EC4 + + thumb_func_start sub_80B7EE8 +sub_80B7EE8: @ 80B7EE8 + push {r4-r6,lr} + sub sp, 0x8 + adds r5, r0, 0 + ldr r1, =gUnknown_0855C47C + mov r0, sp + movs r2, 0x5 + bl memcpy + ldr r0, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r6, r0, r1 + ldrh r1, [r5, 0xA] + movs r2, 0xA + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _080B7F1A + subs r0, r1, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + cmp r0, 0 + bne _080B7FAC +_080B7F1A: + adds r0, r6, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + beq _080B7F32 + adds r0, r6, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B7FC0 +_080B7F32: + movs r1, 0xC + ldrsh r0, [r5, r1] + cmp r0, 0x1F + ble _080B7F7C + movs r2, 0x26 + ldrsh r4, [r5, r2] + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _080B7F7C + ldrb r1, [r6, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + strb r0, [r6, 0x1] + bl script_env_2_disable + bl sub_809757C + ldr r0, =sub_80B7E94 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + b _080B7FC0 + .pool +_080B7F7C: + ldrb r0, [r6, 0x18] + lsls r0, 28 + lsrs r0, 28 + add r0, sp + ldrb r0, [r0] + bl GetFaceDirectionAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl FieldObjectSetSpecialAnim + ldrh r1, [r5, 0xC] + movs r2, 0xC + ldrsh r0, [r5, r2] + cmp r0, 0x1F + bgt _080B7FA4 + adds r0, r1, 0x1 + strh r0, [r5, 0xC] +_080B7FA4: + ldrh r0, [r5, 0xC] + lsls r0, 16 + asrs r0, 18 + strh r0, [r5, 0xA] +_080B7FAC: + ldrb r2, [r6, 0x1] + lsls r1, r2, 26 + lsrs r1, 31 + movs r0, 0x1 + eors r1, r0 + lsls r1, 5 + subs r0, 0x22 + ands r0, r2 + orrs r0, r1 + strb r0, [r6, 0x1] +_080B7FC0: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80B7EE8 + + thumb_func_start sub_80B7FC8 +sub_80B7FC8: @ 80B7FC8 + push {lr} + ldr r0, =sub_80B7FDC + movs r1, 0 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B7FC8 + + thumb_func_start sub_80B7FDC +sub_80B7FDC: @ 80B7FDC + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gUnknown_0855C48C + ldr r2, =gTasks + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B7FDC + + thumb_func_start sub_80B800C +sub_80B800C: @ 80B800C + push {r4,lr} + adds r4, r0, 0 + bl script_env_2_enable + bl player_bitmagic + bl CameraObjectReset2 + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B800C + + thumb_func_start sub_80B8034 +sub_80B8034: @ 80B8034 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r1, =gUnknown_0855C47C + mov r0, sp + movs r2, 0x5 + bl memcpy + ldr r0, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r5, r0, r1 + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080B8066 + subs r0, r1, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + bne _080B8080 +_080B8066: + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + add r0, sp + ldrb r1, [r0] + adds r0, r5, 0 + bl FieldObjectTurn + movs r0, 0x8 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] +_080B8080: + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x7 + ble _080B80AE + movs r2, 0x26 + ldrsh r1, [r4, r2] + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + cmp r1, r0 + bne _080B80AE + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x4 + strh r0, [r4, 0xA] + movs r0, 0x8 + strh r0, [r4, 0xC] + movs r0, 0x1 + strh r0, [r4, 0xE] + movs r0, 0x2D + bl audio_play +_080B80AE: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8034 + + thumb_func_start sub_80B80C4 +sub_80B80C4: @ 80B80C4 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r1, =gUnknown_0855C47C + mov r0, sp + movs r2, 0x5 + bl memcpy + ldr r2, =gUnknown_02037590 + ldrb r1, [r2, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r3, r0, r1 + ldrb r1, [r2, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02020630 + adds r5, r0, r1 + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + bgt _080B810E + movs r0, 0x4 + strh r0, [r4, 0xA] + ldrb r0, [r3, 0x18] + lsls r0, 28 + lsrs r0, 28 + add r0, sp + ldrb r1, [r0] + adds r0, r3, 0 + bl FieldObjectTurn +_080B810E: + ldrh r0, [r5, 0x22] + ldrh r1, [r4, 0xE] + subs r0, r1 + strh r0, [r5, 0x22] + ldrh r1, [r4, 0xE] + ldrh r2, [r4, 0x10] + adds r0, r1, r2 + strh r0, [r4, 0x10] + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + bgt _080B813A + movs r0, 0x4 + strh r0, [r4, 0xC] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x7 + bgt _080B813A + lsls r0, r1, 1 + strh r0, [r4, 0xE] +_080B813A: + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r0, 0x8 + ble _080B8168 + ldrb r1, [r5, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r5, 0x5] + adds r2, r5, 0 + adds r2, 0x42 + ldrb r1, [r2] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0 + beq _080B8168 + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] +_080B8168: + movs r2, 0x10 + ldrsh r0, [r4, r2] + cmp r0, 0xA7 + ble _080B817E + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + bl music_something + bl sub_80AF0B4 +_080B817E: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B80C4 + + thumb_func_start sub_80B8198 +sub_80B8198: @ 80B8198 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B81E6 + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B81B8 + bl sub_81BE72C + movs r0, 0x1 + strh r0, [r4, 0x12] +_080B81B8: + bl sub_80859A0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B81E6 + bl copy_saved_warp3_bank_and_enter_x_to_warp1 + bl warp_in + ldr r0, =c2_load_new_map + bl SetMainCallback2 + ldr r1, =gUnknown_03005DAC + ldr r0, =mapldr_08085D88 + str r0, [r1] + ldr r0, =sub_80B7FDC + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080B81E6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8198 + + thumb_func_start mapldr_08085D88 +mapldr_08085D88: @ 80B8200 + push {lr} + bl sub_8085784 + bl pal_fill_for_maplights + bl script_env_2_enable + bl player_bitmagic + ldr r1, =gUnknown_03005DAC + movs r0, 0 + str r0, [r1] + ldr r2, =gUnknown_02037350 + ldr r0, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0, 0x1] + bl CameraObjectReset2 + ldr r0, =sub_80B8250 + movs r1, 0 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end mapldr_08085D88 + + thumb_func_start sub_80B8250 +sub_80B8250: @ 80B8250 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gUnknown_0855C49C + ldr r2, =gTasks + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8250 + + thumb_func_start sub_80B8280 +sub_80B8280: @ 80B8280 + push {r4-r6,lr} + adds r6, r0, 0 + bl sub_80ABDFC + lsls r0, 24 + cmp r0, 0 + beq _080B82F6 + ldr r5, =gUnknown_02037590 + ldrb r0, [r5, 0x4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =gUnknown_02020630 + adds r2, r0 + adds r0, r2, 0 + adds r0, 0x29 + movs r4, 0 + ldrsb r4, [r0, r4] + lsls r0, r4, 17 + negs r0, r0 + ldrh r1, [r2, 0x22] + ldr r3, =gUnknown_02021BBE + adds r1, r4 + ldrh r3, [r3] + adds r1, r3 + asrs r0, 16 + adds r0, r1 + negs r0, r0 + strh r0, [r2, 0x26] + ldr r3, =gUnknown_02037350 + ldrb r0, [r5, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r3, [r1, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r3 + strb r0, [r1, 0x1] + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + movs r0, 0x8 + strh r0, [r6, 0xA] + movs r0, 0x1 + strh r0, [r6, 0xC] + adds r2, 0x42 + ldrb r0, [r2] + lsrs r0, 6 + strh r0, [r6, 0x24] + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x26] + movs r0, 0x2D + bl audio_play +_080B82F6: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8280 + + thumb_func_start sub_80B830C +sub_80B830C: @ 80B830C + push {r4-r7,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r1, =gUnknown_0855C47C + mov r0, sp + movs r2, 0x5 + bl memcpy + ldr r2, =gUnknown_02037590 + ldrb r1, [r2, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r6, r0, r1 + ldrb r1, [r2, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02020630 + adds r5, r0, r1 + ldrh r0, [r4, 0xA] + ldrh r1, [r5, 0x26] + adds r0, r1 + strh r0, [r5, 0x26] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x8 + negs r1, r1 + cmp r0, r1 + blt _080B8384 + ldrh r1, [r4, 0x22] + movs r2, 0x22 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _080B83AA + adds r0, r1, 0x1 + strh r0, [r4, 0x22] + ldrb r0, [r6] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r6] + ldrh r1, [r4, 0x24] + adds r3, r5, 0 + adds r3, 0x42 + lsls r1, 6 + ldrb r2, [r3] + movs r0, 0x3F + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + b _080B83AA + .pool +_080B8384: + ldrb r1, [r5, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r5, 0x5] + adds r2, r5, 0 + adds r2, 0x42 + ldrb r1, [r2] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0 + beq _080B83AA + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] +_080B83AA: + ldrh r2, [r5, 0x26] + movs r3, 0x26 + ldrsh r1, [r5, r3] + movs r0, 0x30 + negs r0, r0 + cmp r1, r0 + blt _080B83CE + ldrh r1, [r4, 0xA] + movs r3, 0xA + ldrsh r0, [r4, r3] + cmp r0, 0x1 + ble _080B83CE + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + bne _080B83CE + subs r0, r1, 0x1 + strh r0, [r4, 0xA] +_080B83CE: + ldrh r0, [r4, 0xC] + subs r0, 0x1 + movs r7, 0 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _080B83F0 + movs r0, 0x4 + strh r0, [r4, 0xC] + ldrb r0, [r6, 0x18] + lsls r0, 28 + lsrs r0, 28 + add r0, sp + ldrb r1, [r0] + adds r0, r6, 0 + bl FieldObjectTurn +_080B83F0: + movs r1, 0x26 + ldrsh r0, [r5, r1] + cmp r0, 0 + blt _080B8406 + strh r7, [r5, 0x26] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + strh r0, [r4, 0xA] + strh r7, [r4, 0xC] +_080B8406: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80B830C + + thumb_func_start sub_80B8410 +sub_80B8410: @ 80B8410 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r1, =gUnknown_0855C47C + mov r0, sp + movs r2, 0x5 + bl memcpy + ldr r0, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r5, r0, r1 + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + bne _080B8484 + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + add r0, sp + ldrb r1, [r0] + adds r0, r5, 0 + bl FieldObjectTurn + movs r0, 0x8 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _080B8484 + movs r0, 0x24 + ldrsh r1, [r4, r0] + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + cmp r1, r0 + bne _080B8484 + bl script_env_2_disable + bl CameraObjectReset1 + bl sub_809757C + ldr r0, =sub_80B8250 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080B8484: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8410 + + thumb_func_start sub_80B849C +sub_80B849C: @ 80B849C + push {r4,lr} + bl sav1_map_get_light_level + lsls r0, 24 + lsrs r0, 24 + bl is_light_level_1_2_3_5_or_6 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B84BC + ldr r0, =sub_80B8554 + b _080B84BE + .pool +_080B84BC: + ldr r0, =sub_80B88B4 +_080B84BE: + movs r1, 0xFF + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, =gUnknown_02038C08 + ldr r0, [r2] + ldr r1, [r2, 0x4] + ldr r2, [r2, 0x8] + bl sub_80B8C60 + ldr r2, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x26] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B849C + + thumb_func_start sub_80B84F8 +sub_80B84F8: @ 80B84F8 + push {r4-r6,lr} + ldr r5, =gUnknown_02038C08 + ldr r0, [r5] + movs r6, 0x80 + lsls r6, 24 + ands r6, r0 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + adds r4, r0, 0 + muls r4, r1 + ldr r0, =gPlayerParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + bl GetMonData + str r0, [r5] + adds r0, r4, 0 + movs r1, 0x1 + bl GetMonData + str r0, [r5, 0x4] + adds r0, r4, 0 + movs r1, 0 + bl GetMonData + str r0, [r5, 0x8] + ldr r0, [r5] + orrs r0, r6 + str r0, [r5] + movs r0, 0x6 + bl FieldEffectStart + movs r0, 0x3B + bl FieldEffectActiveListRemove + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B84F8 + + thumb_func_start sub_80B8554 +sub_80B8554: @ 80B8554 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gUnknown_0855C4A8 + ldr r2, =gTasks + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8554 + + thumb_func_start sub_80B8584 +sub_80B8584: @ 80B8584 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x04000048 + ldrh r0, [r0] + strh r0, [r4, 0x1E] + ldr r0, =0x0400004a + ldrh r0, [r0] + strh r0, [r4, 0x20] + adds r0, r4, 0 + adds r0, 0x22 + ldr r1, =gMain + ldr r1, [r1, 0xC] + bl StoreWordInTwoHalfwords + ldr r1, =0x0000f0f1 + strh r1, [r4, 0xA] + ldr r0, =0x00005051 + strh r0, [r4, 0xC] + movs r0, 0x3F + strh r0, [r4, 0xE] + movs r0, 0x3E + strh r0, [r4, 0x10] + movs r0, 0x40 + bl SetGpuReg + ldrh r1, [r4, 0xC] + movs r0, 0x44 + bl SetGpuReg + ldrh r1, [r4, 0xE] + movs r0, 0x48 + bl SetGpuReg + ldrh r1, [r4, 0x10] + movs r0, 0x4A + bl SetGpuReg + ldr r0, =sub_80B880C + bl SetVBlankCallback + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8584 + + thumb_func_start sub_80B85F8 +sub_80B85F8: @ 80B85F8 + push {r4-r6,lr} + sub sp, 0x4 + adds r6, r0, 0 + ldr r0, =0x04000008 + ldrh r1, [r0] + lsrs r1, 2 + lsls r1, 30 + lsrs r1, 16 + ldrh r4, [r0] + lsrs r4, 8 + lsls r4, 27 + lsrs r4, 16 + ldr r0, =gUnknown_0855AE50 + movs r5, 0xC0 + lsls r5, 19 + adds r1, r5 + movs r2, 0x80 + lsls r2, 1 + bl CpuSet + movs r0, 0 + str r0, [sp] + adds r5, r4, r5 + ldr r2, =0x05000200 + mov r0, sp + adds r1, r5, 0 + bl CpuSet + ldr r0, =gUnknown_0855B050 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + adds r0, r4, 0 + bl sub_80B8874 + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B85F8 + + thumb_func_start sub_80B8660 +sub_80B8660: @ 80B8660 + push {r4-r7,lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x12] + subs r0, 0x10 + strh r0, [r3, 0x12] + ldrh r6, [r3, 0xA] + ldrh r2, [r3, 0xC] + movs r7, 0xFF + lsrs r1, r6, 8 + subs r1, 0x10 + lsls r1, 16 + lsrs r0, r2, 8 + subs r0, 0x2 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r7, 0 + ands r0, r2 + adds r5, r0, 0x2 + lsrs r2, r1, 16 + cmp r1, 0 + bge _080B868C + movs r2, 0 +_080B868C: + lsls r0, r4, 16 + asrs r0, 16 + cmp r0, 0x27 + bgt _080B8696 + movs r4, 0x28 +_080B8696: + cmp r5, 0x78 + ble _080B869C + movs r5, 0x78 +_080B869C: + lsls r2, 16 + asrs r2, 16 + lsls r1, r2, 8 + adds r0, r7, 0 + ands r0, r6 + orrs r1, r0 + strh r1, [r3, 0xA] + lsls r0, r4, 16 + asrs r4, r0, 16 + lsls r0, r4, 8 + adds r1, r5, 0 + orrs r0, r1 + strh r0, [r3, 0xC] + cmp r2, 0 + bne _080B86DC + cmp r4, 0x28 + bne _080B86DC + cmp r1, 0x78 + bne _080B86DC + ldr r2, =gUnknown_02020630 + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_80B8CC0 + str r1, [r0] + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_080B86DC: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8660 + + thumb_func_start sub_80B86EC +sub_80B86EC: @ 80B86EC + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x12] + subs r0, 0x10 + strh r0, [r3, 0x12] + ldr r2, =gUnknown_02020630 + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3C + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _080B8712 + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_080B8712: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B86EC + + thumb_func_start sub_80B871C +sub_80B871C: @ 80B871C + push {r4,lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x12] + subs r0, 0x10 + strh r0, [r3, 0x12] + ldrh r2, [r3, 0xC] + lsls r1, r2, 16 + movs r0, 0xFF + asrs r1, 24 + adds r1, 0x6 + lsls r1, 16 + ands r0, r2 + subs r0, 0x6 + lsls r0, 16 + lsrs r2, r0, 16 + lsrs r4, r1, 16 + asrs r1, 16 + cmp r1, 0x50 + ble _080B8744 + movs r4, 0x50 +_080B8744: + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x50 + bgt _080B874E + movs r2, 0x51 +_080B874E: + lsls r0, r4, 16 + asrs r0, 16 + lsls r1, r0, 8 + lsls r2, 16 + asrs r2, 16 + orrs r1, r2 + strh r1, [r3, 0xC] + cmp r0, 0x50 + bne _080B876A + cmp r2, 0x51 + bne _080B876A + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_080B876A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B871C + + thumb_func_start sub_80B8770 +sub_80B8770: @ 80B8770 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r0, =0x04000008 + ldrh r1, [r0] + lsrs r1, 8 + lsls r1, 27 + lsrs r1, 16 + movs r0, 0 + str r0, [sp] + movs r0, 0xC0 + lsls r0, 19 + adds r1, r0 + ldr r2, =0x05000200 + mov r0, sp + bl CpuSet + movs r0, 0xF1 + strh r0, [r4, 0xA] + movs r0, 0xA1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x1E] + strh r0, [r4, 0xE] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x10] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8770 + + thumb_func_start overworld_bg_setup_2 +overworld_bg_setup_2: @ 80B87B8 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r0, 0x22 + mov r1, sp + bl LoadWordFromTwoHalfwords + ldr r0, [sp] + bl SetVBlankCallback + bl sub_8197200 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02020630 + adds r0, r1 + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + bl sub_80B6070 + movs r0, 0x6 + bl FieldEffectActiveListRemove + ldr r0, =sub_80B8554 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end overworld_bg_setup_2 + + thumb_func_start sub_80B880C +sub_80B880C: @ 80B880C + push {r4,lr} + sub sp, 0x4 + ldr r0, =sub_80B8554 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + adds r4, r0 + adds r0, r4, 0 + adds r0, 0x22 + mov r1, sp + bl LoadWordFromTwoHalfwords + ldr r0, [sp] + bl _call_via_r0 + ldrh r1, [r4, 0xA] + movs r0, 0x40 + bl SetGpuReg + ldrh r1, [r4, 0xC] + movs r0, 0x44 + bl SetGpuReg + ldrh r1, [r4, 0xE] + movs r0, 0x48 + bl SetGpuReg + ldrh r1, [r4, 0x10] + movs r0, 0x4A + bl SetGpuReg + ldrh r1, [r4, 0x12] + movs r0, 0x10 + bl SetGpuReg + ldrh r1, [r4, 0x14] + movs r0, 0x12 + bl SetGpuReg + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B880C + + thumb_func_start sub_80B8874 +sub_80B8874: @ 80B8874 + push {r4,r5,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x06000140 + adds r2, r0, r1 + movs r1, 0 + ldr r5, =gUnknown_0855B070 + movs r0, 0xF0 + lsls r0, 8 + adds r4, r0, 0 + ldr r3, =0x0000013f +_080B888A: + lsls r0, r1, 1 + adds r0, r5 + ldrh r0, [r0] + orrs r0, r4 + strh r0, [r2] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + adds r2, 0x2 + cmp r1, r3 + bls _080B888A + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8874 + + thumb_func_start sub_80B88B4 +sub_80B88B4: @ 80B88B4 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gUnknown_0855C4C4 + ldr r2, =gTasks + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B88B4 + + thumb_func_start sub_80B88E4 +sub_80B88E4: @ 80B88E4 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0xA] + movs r0, 0x10 + bl SetGpuReg + ldrh r1, [r4, 0xC] + movs r0, 0x12 + bl SetGpuReg + adds r0, r4, 0 + adds r0, 0x22 + ldr r1, =gMain + ldr r1, [r1, 0xC] + bl StoreWordInTwoHalfwords + ldr r0, =sub_80B8AE0 + bl SetVBlankCallback + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B88E4 + + thumb_func_start sub_80B8920 +sub_80B8920: @ 80B8920 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + adds r6, r0, 0 + ldr r0, =0x04000008 + ldrh r1, [r0] + lsrs r1, 2 + lsls r1, 30 + lsrs r1, 16 + ldrh r4, [r0] + lsrs r4, 8 + lsls r4, 27 + lsrs r4, 16 + movs r0, 0 + mov r8, r0 + strh r4, [r6, 0x20] + ldr r0, =gUnknown_0855B2F0 + movs r5, 0xC0 + lsls r5, 19 + adds r1, r5 + movs r2, 0x40 + bl CpuSet + mov r0, r8 + str r0, [sp] + adds r4, r5 + ldr r2, =0x05000200 + mov r0, sp + adds r1, r4, 0 + bl CpuSet + ldr r0, =gUnknown_0855B370 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8920 + + thumb_func_start sub_80B898C +sub_80B898C: @ 80B898C + push {r4,lr} + adds r4, r0, 0 + bl sub_80B8B38 + lsls r0, 24 + cmp r0, 0 + beq _080B89C4 + movs r0, 0x42 + movs r1, 0xF0 + bl SetGpuReg + ldr r1, =0x00002878 + movs r0, 0x46 + bl SetGpuReg + ldr r2, =gUnknown_02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_80B8CC0 + str r1, [r0] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B89C4: + adds r0, r4, 0 + bl sub_80B8B28 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B898C + + thumb_func_start sub_80B89DC +sub_80B89DC: @ 80B89DC + push {r4,lr} + adds r4, r0, 0 + bl sub_80B8B28 + ldr r2, =gUnknown_02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3C + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _080B8A00 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B8A00: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B89DC + + thumb_func_start sub_80B8A0C +sub_80B8A0C: @ 80B8A0C + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_80B8B28 + ldrh r1, [r4, 0xA] + movs r0, 0x7 + ands r0, r1 + movs r1, 0 + strh r0, [r4, 0xE] + strh r1, [r4, 0x10] + ldr r5, =0x0000ffff + movs r0, 0x42 + adds r1, r5, 0 + bl SetGpuReg + movs r0, 0x46 + adds r1, r5, 0 + bl SetGpuReg + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8A0C + + thumb_func_start sub_80B8A44 +sub_80B8A44: @ 80B8A44 + push {r4,lr} + adds r4, r0, 0 + bl sub_80B8B28 + adds r0, r4, 0 + bl sub_80B8BF0 + lsls r0, 24 + cmp r0, 0 + beq _080B8A5E + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B8A5E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B8A44 + + thumb_func_start sub_80B8A64 +sub_80B8A64: @ 80B8A64 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r0, =0x04000008 + ldrh r1, [r0] + lsrs r1, 8 + lsls r1, 27 + lsrs r1, 16 + movs r0, 0 + str r0, [sp] + movs r0, 0xC0 + lsls r0, 19 + adds r1, r0 + ldr r2, =0x05000200 + mov r0, sp + bl CpuSet + adds r0, r4, 0 + adds r0, 0x22 + add r1, sp, 0x4 + bl LoadWordFromTwoHalfwords + ldr r0, [sp, 0x4] + bl SetVBlankCallback + bl sub_8197200 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02020630 + adds r0, r1 + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + bl sub_80B6070 + movs r0, 0x6 + bl FieldEffectActiveListRemove + ldr r0, =sub_80B88B4 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8A64 + + thumb_func_start sub_80B8AE0 +sub_80B8AE0: @ 80B8AE0 + push {r4,lr} + sub sp, 0x4 + ldr r0, =sub_80B88B4 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + adds r4, r0 + adds r0, r4, 0 + adds r0, 0x22 + mov r1, sp + bl LoadWordFromTwoHalfwords + ldr r0, [sp] + bl _call_via_r0 + ldrh r1, [r4, 0xA] + movs r0, 0x10 + bl SetGpuReg + ldrh r1, [r4, 0xC] + movs r0, 0x12 + bl SetGpuReg + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8AE0 + + thumb_func_start sub_80B8B28 +sub_80B8B28: @ 80B8B28 + ldrh r1, [r0, 0xA] + subs r1, 0x10 + strh r1, [r0, 0xA] + ldrh r1, [r0, 0xE] + adds r1, 0x10 + strh r1, [r0, 0xE] + bx lr + thumb_func_end sub_80B8B28 + + thumb_func_start sub_80B8B38 +sub_80B8B38: @ 80B8B38 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r5, r0, 0 + ldrh r2, [r5, 0x10] + movs r1, 0x10 + ldrsh r0, [r5, r1] + cmp r0, 0x1F + ble _080B8B54 + movs r0, 0x1 + b _080B8BD8 +_080B8B54: + ldrh r0, [r5, 0xE] + lsls r0, 16 + asrs r3, r0, 19 + movs r1, 0x1F + ands r3, r1 + movs r4, 0x10 + ldrsh r0, [r5, r4] + cmp r3, r0 + blt _080B8BD6 + movs r0, 0x20 + subs r3, r0, r3 + ands r3, r1 + subs r0, r2 + mov r12, r0 + mov r7, r12 + ands r7, r1 + mov r12, r7 + ldrh r0, [r5, 0x20] + ldr r1, =0x06000140 + adds r1, r0 + mov r8, r1 + movs r4, 0 + ldr r7, =gUnknown_0855B390 + mov r10, r7 + movs r0, 0xF0 + lsls r0, 8 + mov r9, r0 + adds r1, r3, 0x1 + movs r0, 0x1F + ands r1, r0 + str r1, [sp] + mov r6, r12 + adds r6, 0x1 + ands r6, r0 +_080B8B98: + lsls r1, r4, 5 + adds r2, r1, r3 + lsls r2, 1 + add r2, r8 + mov r7, r12 + adds r0, r7, r1 + lsls r0, 1 + add r0, r10 + ldrh r0, [r0] + mov r7, r9 + orrs r0, r7 + strh r0, [r2] + ldr r0, [sp] + adds r2, r1, r0 + lsls r2, 1 + add r2, r8 + adds r1, r6, r1 + lsls r1, 1 + add r1, r10 + ldrh r0, [r1] + mov r1, r9 + orrs r0, r1 + strh r0, [r2] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x9 + bls _080B8B98 + ldrh r0, [r5, 0x10] + adds r0, 0x2 + strh r0, [r5, 0x10] +_080B8BD6: + movs r0, 0 +_080B8BD8: + 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_80B8B38 + + thumb_func_start sub_80B8BF0 +sub_80B8BF0: @ 80B8BF0 + push {r4-r7,lr} + adds r5, r0, 0 + movs r1, 0x10 + ldrsh r0, [r5, r1] + cmp r0, 0x1F + ble _080B8C00 + movs r0, 0x1 + b _080B8C54 +_080B8C00: + ldrh r0, [r5, 0xE] + lsls r0, 16 + asrs r0, 19 + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0x10 + ldrsh r0, [r5, r1] + cmp r2, r0 + blt _080B8C52 + ldrh r0, [r5, 0xA] + lsls r0, 16 + asrs r2, r0, 19 + movs r0, 0x1F + ands r2, r0 + ldrh r0, [r5, 0x20] + ldr r1, =0x06000140 + adds r6, r0, r1 + movs r3, 0 + movs r0, 0xF0 + lsls r0, 8 + adds r7, r0, 0 + adds r4, r2, 0x1 + movs r0, 0x1F + ands r4, r0 +_080B8C30: + lsls r0, r3, 5 + adds r1, r0, r2 + lsls r1, 1 + adds r1, r6 + strh r7, [r1] + adds r0, r4 + lsls r0, 1 + adds r0, r6 + strh r7, [r0] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x9 + bls _080B8C30 + ldrh r0, [r5, 0x10] + adds r0, 0x2 + strh r0, [r5, 0x10] +_080B8C52: + movs r0, 0 +_080B8C54: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B8BF0 + + thumb_func_start sub_80B8C60 +sub_80B8C60: @ 80B8C60 + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r0, 0 + movs r5, 0x80 + lsls r5, 24 + ands r5, r6 + lsrs r5, 16 + lsls r5, 16 + lsrs r5, 16 + ldr r0, =0x7fffffff + ands r6, r0 + lsls r0, r6, 16 + lsrs r0, 16 + movs r3, 0xA0 + lsls r3, 1 + movs r4, 0x50 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + bl sub_80B5FE8 + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r1, =gUnknown_02020630 + adds r2, r1 + ldr r1, =DummyObjectCallback + str r1, [r2, 0x1C] + ldrb r3, [r2, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r3 + strb r1, [r2, 0x5] + strh r6, [r2, 0x2E] + strh r5, [r2, 0x3A] + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B8C60 + + thumb_func_start sub_80B8CC0 +sub_80B8CC0: @ 80B8CC0 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x20] + subs r0, 0x14 + strh r0, [r1, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x78 + bgt _080B8D00 + movs r0, 0x78 + strh r0, [r1, 0x20] + movs r0, 0x1E + strh r0, [r1, 0x30] + ldr r0, =sub_80B8D04 + str r0, [r1, 0x1C] + movs r2, 0x3A + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _080B8CF8 + ldrh r0, [r1, 0x2E] + movs r1, 0 + movs r2, 0x7D + movs r3, 0xA + bl sub_80A32C0 + b _080B8D00 + .pool +_080B8CF8: + ldrh r0, [r1, 0x2E] + movs r1, 0 + bl cry_related +_080B8D00: + pop {r0} + bx r0 + thumb_func_end sub_80B8CC0 + + thumb_func_start sub_80B8D04 +sub_80B8D04: @ 80B8D04 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x30] + subs r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _080B8D18 + ldr r0, =sub_80B8D20 + str r0, [r1, 0x1C] +_080B8D18: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8D04 + + thumb_func_start sub_80B8D20 +sub_80B8D20: @ 80B8D20 + push {lr} + adds r2, r0, 0 + ldrh r3, [r2, 0x20] + movs r0, 0x20 + ldrsh r1, [r2, r0] + movs r0, 0x40 + negs r0, r0 + cmp r1, r0 + bge _080B8D38 + movs r0, 0x1 + strh r0, [r2, 0x3C] + b _080B8D3E +_080B8D38: + adds r0, r3, 0 + subs r0, 0x14 + strh r0, [r2, 0x20] +_080B8D3E: + pop {r0} + bx r0 + thumb_func_end sub_80B8D20 + + thumb_func_start sub_80B8D44 +sub_80B8D44: @ 80B8D44 + push {lr} + ldr r0, =sub_80B8D84 + movs r1, 0xFF + 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 r0, =gUnknown_02038C08 + ldr r0, [r0] + strh r0, [r1, 0x26] + bl sav1_reset_battle_music_maybe + ldr r0, =0x0000016d + bl sub_80858C4 + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B8D44 + + thumb_func_start sub_80B8D84 +sub_80B8D84: @ 80B8D84 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gUnknown_0855C4E0 + ldr r2, =gTasks + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8D84 + + thumb_func_start sub_80B8DB4 +sub_80B8DB4: @ 80B8DB4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r4, r0, 0 + bl script_env_2_enable + bl player_bitmagic + ldr r5, =gUnknown_02037590 + movs r0, 0x1 + strb r0, [r5, 0x6] + movs r0, 0x8 + bl SetPlayerAvatarStateMask + adds r6, r4, 0 + adds r6, 0xA + movs r0, 0xC + adds r0, r4 + mov r8, r0 + adds r0, r6, 0 + mov r1, r8 + bl PlayerGetDestCoords + ldr r2, =gUnknown_02037350 + ldrb r1, [r5, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x18] + lsrs r0, 4 + adds r1, r6, 0 + mov r2, r8 + bl MoveCoords + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8DB4 + + thumb_func_start sub_80B8E14 +sub_80B8E14: @ 80B8E14 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r4, r0, r1 + adds r0, r4, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + beq _080B8E3E + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B8E50 +_080B8E3E: + bl sub_808C114 + adds r0, r4, 0 + movs r1, 0x39 + bl FieldObjectSetSpecialAnim + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_080B8E50: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8E14 + + thumb_func_start sub_80B8E60 +sub_80B8E60: @ 80B8E60 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r0, r1 + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive + lsls r0, 24 + cmp r0, 0 + beq _080B8E96 + ldr r2, =gUnknown_02038C08 + movs r1, 0x26 + ldrsh r0, [r4, r1] + movs r1, 0x80 + lsls r1, 24 + orrs r0, r1 + str r0, [r2] + movs r0, 0x3B + bl FieldEffectStart + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B8E96: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8E60 + + thumb_func_start sub_80B8EA8 +sub_80B8EA8: @ 80B8EA8 + push {r4-r6,lr} + adds r6, r0, 0 + movs r0, 0x6 + bl FieldEffectActiveListContains + lsls r0, 24 + cmp r0, 0 + bne _080B8F12 + ldr r5, =gUnknown_02037590 + ldrb r0, [r5, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_02037350 + adds r4, r0 + movs r0, 0x3 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl sub_8093540 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + ldr r1, =gUnknown_02038C08 + movs r2, 0xA + ldrsh r0, [r6, r2] + str r0, [r1] + movs r2, 0xC + ldrsh r0, [r6, r2] + str r0, [r1, 0x4] + ldrb r0, [r5, 0x5] + str r0, [r1, 0x8] + movs r0, 0x8 + bl FieldEffectStart + strb r0, [r4, 0x1A] + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] +_080B8F12: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8EA8 + + thumb_func_start sub_80B8F24 +sub_80B8F24: @ 80B8F24 + push {r4,r5,lr} + ldr r5, =gUnknown_02037590 + ldrb r1, [r5, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r4, r0, r1 + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B8F84 + movs r0, 0 + strb r0, [r5, 0x6] + ldrb r1, [r5] + movs r0, 0xDF + ands r0, r1 + strb r0, [r5] + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl GetFaceDirectionAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + ldrb r0, [r4, 0x1A] + movs r1, 0x1 + bl sub_81555AC + bl sub_809757C + bl script_env_2_disable + movs r0, 0x9 + bl FieldEffectActiveListRemove + ldr r0, =sub_80B8D84 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080B8F84: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8F24 + + thumb_func_start sub_80B8F98 +sub_80B8F98: @ 80B8F98 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =gFieldEffectObjectTemplatePointers + adds r0, 0x90 + ldr r0, [r0] + movs r2, 0x18 + negs r2, r2 + movs r1, 0x78 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, r0, 4 + add r1, r8 + lsls r1, 2 + ldr r0, =gUnknown_02020630 + adds r1, r0 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + movs r2, 0x4 + orrs r0, r2 + movs r2, 0xF + ands r0, r2 + movs r2, 0x40 + orrs r0, r2 + strb r0, [r1, 0x5] + movs r2, 0 + strh r2, [r1, 0x2E] + strh r2, [r1, 0x30] + strh r2, [r1, 0x32] + ldr r0, =0x0000ffff + strh r0, [r1, 0x34] + ldrh r0, [r1, 0x22] + strh r0, [r1, 0x36] + strh r2, [r1, 0x38] + ldr r1, =0x00003e41 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x00000e0e + movs r0, 0x52 + bl SetGpuReg + ldr r1, =0x00003f3f + movs r0, 0x48 + bl SetGpuReg + ldr r0, =gUnknown_0855B610 + movs r1, 0xC0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0x12 + movs r1, 0x78 + bl SetGpuReg + movs r4, 0x3 + ldr r7, =0x0600f800 + ldr r0, =0x0000bff4 + adds r6, r0, 0 +_080B901A: + movs r2, 0xC + lsls r0, r4, 1 + lsls r5, r4, 5 + adds r0, r4 + lsls r3, r0, 1 +_080B9024: + adds r0, r5, r2 + lsls r0, 1 + adds r0, r7 + adds r1, r2, r6 + adds r1, r3, r1 + adds r1, 0x1 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x11 + bls _080B9024 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xE + bls _080B901A + movs r0, 0 + ldr r5, =gUnknown_0855B630 +_080B904A: + movs r4, 0 + adds r7, r0, 0x1 + lsls r6, r0, 5 +_080B9050: + lsls r1, r4, 2 + adds r1, r6, r1 + ldr r0, =0x06008020 + adds r3, r1, r0 + adds r0, r1, 0x1 + adds r0, r5 + ldrb r2, [r0] + lsls r2, 8 + adds r0, r1, r5 + ldrb r0, [r0] + adds r0, r2 + strh r0, [r3] + ldr r0, =0x06008022 + adds r3, r1, r0 + adds r0, r1, 0x3 + adds r0, r5 + ldrb r2, [r0] + lsls r2, 8 + adds r1, 0x2 + adds r1, r5 + ldrb r0, [r1] + adds r0, r2 + strh r0, [r3] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _080B9050 + lsls r0, r7, 24 + lsrs r0, 24 + cmp r0, 0x59 + bls _080B904A + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B8F98 + + thumb_func_start sub_80B90CC +sub_80B90CC: @ 80B90CC + push {r4,lr} + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x68] + movs r1, 0x78 + movs r2, 0 + movs r3, 0x1 + bl AddObjectToFront + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r2, r4, 4 + adds r2, r4 + lsls r2, 2 + ldr r0, =gUnknown_02020630 + adds r2, r0 + ldrb r1, [r2, 0x5] + movs r0, 0xF + ands r0, r1 + movs r1, 0xD + negs r1, r1 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, =sub_80B9128 + str r0, [r2, 0x1C] + ldr r0, =gUnknown_02038C08 + ldr r0, [r0] + strh r0, [r2, 0x30] + movs r0, 0x9E + bl audio_play + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B90CC + + thumb_func_start sub_80B9128 +sub_80B9128: @ 80B9128 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r1, 0x8C + bl Cos + movs r5, 0 + strh r0, [r4, 0x24] + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r1, 0x48 + bl Sin + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x4 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x32] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080B918A + movs r2, 0x30 + ldrsh r0, [r4, r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =gUnknown_02020630 + adds r1, r0 + adds r3, r1, 0 + adds r3, 0x3E + ldrb r2, [r3] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r3] + ldrh r0, [r4, 0x24] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r1, 0x20] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + subs r0, 0x8 + strh r0, [r1, 0x22] + strh r5, [r1, 0x24] + strh r5, [r1, 0x26] +_080B918A: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x7F + ble _080B919A + adds r0, r4, 0 + movs r1, 0x1E + bl FieldEffectStop +_080B919A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9128 + + thumb_func_start sub_80B91A4 +sub_80B91A4: @ 80B91A4 + push {lr} + ldr r0, =sub_80B91D4 + movs r1, 0xFE + 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 r0, =gUnknown_02038C08 + ldr r0, [r0] + strh r0, [r1, 0xA] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B91A4 + + thumb_func_start sub_80B91D4 +sub_80B91D4: @ 80B91D4 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gUnknown_0855C4F4 + ldr r2, =gTasks + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B91D4 + + thumb_func_start sub_80B9204 +sub_80B9204: @ 80B9204 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, =gUnknown_02037590 + ldrb r1, [r6, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r4, r0, r1 + adds r0, r4, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + beq _080B922E + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B924C +_080B922E: + ldrb r0, [r6] + strh r0, [r5, 0x26] + movs r0, 0x1 + strb r0, [r6, 0x6] + bl SetPlayerAvatarStateMask + bl sub_808C114 + adds r0, r4, 0 + movs r1, 0x39 + bl FieldObjectSetSpecialAnim + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_080B924C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9204 + + thumb_func_start sub_80B925C +sub_80B925C: @ 80B925C + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r0, r1 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B928C + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldr r1, =gUnknown_02038C08 + movs r2, 0xA + ldrsh r0, [r4, r2] + str r0, [r1] + movs r0, 0x3B + bl FieldEffectStart +_080B928C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B925C + + thumb_func_start sub_80B92A0 +sub_80B92A0: @ 80B92A0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x6 + bl FieldEffectActiveListContains + lsls r0, 24 + cmp r0, 0 + bne _080B92E8 + ldr r0, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r5, r0, r1 + ldrh r1, [r4, 0x26] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080B92D8 + ldrb r0, [r5, 0x1A] + movs r1, 0x2 + bl sub_81555AC + ldrb r0, [r5, 0x1A] + movs r1, 0 + bl sub_81555D8 +_080B92D8: + bl sub_80B94C4 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B92E8: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B92A0 + + thumb_func_start sub_80B92F8 +sub_80B92F8: @ 80B92F8 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0xA] + bl sub_80B9508 + lsls r0, 24 + cmp r0, 0 + beq _080B932C + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x10 + strh r0, [r4, 0xC] + movs r0, 0x1 + bl SetPlayerAvatarTransitionFlags + ldr r0, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r0, r1 + movs r1, 0x2 + bl FieldObjectSetSpecialAnim +_080B932C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B92F8 + + thumb_func_start sub_80B933C +sub_80B933C: @ 80B933C + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r2, r0, r1 + ldrh r1, [r4, 0xC] + movs r3, 0xC + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _080B9362 + subs r0, r1, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _080B9380 +_080B9362: + adds r0, r2, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B9380 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x9E + bl audio_play + ldrb r0, [r4, 0xA] + bl sub_80B9524 +_080B9380: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B933C + + thumb_func_start sub_80B9390 +sub_80B9390: @ 80B9390 + push {r4-r6,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0xC] + adds r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _080B9406 + ldr r0, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r4, r0, r1 + movs r0, 0x3 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r6, =gUnknown_02020630 + adds r0, r6 + movs r1, 0x16 + bl StartObjectImageAnim + ldrb r0, [r4, 0x1] + movs r1, 0x10 + orrs r0, r1 + strb r0, [r4, 0x1] + adds r0, r4, 0 + movs r1, 0x48 + bl FieldObjectSetSpecialAnim + ldrh r1, [r5, 0x26] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080B93FC + ldrb r1, [r4, 0x1A] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl RemoveObjectAndFreeTiles +_080B93FC: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + strh r0, [r5, 0xC] +_080B9406: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9390 + + thumb_func_start sub_80B9418 +sub_80B9418: @ 80B9418 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0xC] + adds r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + ble _080B9464 + ldr r0, =gUnknown_02037590 + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_02037350 + adds r4, r0 + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimActive + ldrb r1, [r4, 0x1] + movs r0, 0x11 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] + ldrb r1, [r4, 0x2] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x2] + ldrb r0, [r5, 0xA] + ldrb r1, [r4, 0x4] + bl sub_80B9560 + bl CameraObjectReset2 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_080B9464: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9418 + + thumb_func_start sub_80B9474 +sub_80B9474: @ 80B9474 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0xA] + bl sub_80B9508 + lsls r0, 24 + cmp r0, 0 + beq _080B948E + bl sub_80AF0B4 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B948E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B9474 + + thumb_func_start sub_80B9494 +sub_80B9494: @ 80B9494 + push {lr} + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B94B6 + movs r0, 0x1F + bl FieldEffectActiveListRemove + ldr r0, =sub_80B91D4 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080B94B6: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9494 + + thumb_func_start sub_80B94C4 +sub_80B94C4: @ 80B94C4 + push {lr} + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x68] + movs r1, 0xFF + movs r2, 0xB4 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r1, =gUnknown_02020630 + adds r2, r1 + ldrb r3, [r2, 0x5] + movs r1, 0xF + ands r1, r3 + movs r3, 0xD + negs r3, r3 + ands r1, r3 + movs r3, 0x4 + orrs r1, r3 + strb r1, [r2, 0x5] + ldr r1, =sub_80B957C + str r1, [r2, 0x1C] + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B94C4 + + thumb_func_start sub_80B9508 +sub_80B9508: @ 80B9508 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x3C] + lsls r0, 24 + lsrs r0, 24 + bx lr + .pool + thumb_func_end sub_80B9508 + + thumb_func_start sub_80B9524 +sub_80B9524: @ 80B9524 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_02020630 + adds r4, r0 + ldr r0, =sub_80B963C + str r0, [r4, 0x1C] + movs r1, 0 + movs r0, 0x78 + strh r0, [r4, 0x20] + strh r1, [r4, 0x22] + strh r1, [r4, 0x24] + strh r1, [r4, 0x26] + adds r0, r4, 0 + adds r0, 0x2E + movs r2, 0x10 + bl memset + movs r0, 0x40 + strh r0, [r4, 0x3A] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9524 + + thumb_func_start sub_80B9560 +sub_80B9560: @ 80B9560 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gUnknown_02020630 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + strh r1, [r2, 0x3A] + bx lr + .pool + thumb_func_end sub_80B9560 + + thumb_func_start sub_80B957C +sub_80B957C: @ 80B957C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B9628 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B95C0 + ldrb r0, [r4, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r4, 0x1] + ldr r0, =gUnknown_0855C548 + str r0, [r4, 0x10] + adds r0, r4, 0 + bl obj_alloc_rotscale_entry + adds r0, r4, 0 + movs r1, 0 + bl StartObjectRotScalAnim + movs r0, 0x76 + strh r0, [r4, 0x20] + ldr r0, =0x0000ffd0 + strh r0, [r4, 0x22] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0x40 + strh r0, [r4, 0x30] + adds r0, 0xC0 + strh r0, [r4, 0x32] +_080B95C0: + ldrh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r4, 0x30] + adds r0, r1 + strh r0, [r4, 0x30] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x78 + bl Cos + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x78 + bl Sin + strh r0, [r4, 0x26] + ldrh r2, [r4, 0x32] + movs r0, 0x32 + ldrsh r1, [r4, r0] + ldr r0, =0x000007ff + cmp r1, r0 + bgt _080B95F6 + adds r0, r2, 0 + adds r0, 0x60 + strh r0, [r4, 0x32] +_080B95F6: + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0x81 + ble _080B9628 + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldrb r1, [r4, 0x1] + lsrs r1, 6 + ldrb r2, [r4, 0x3] + lsrs r2, 6 + adds r0, r4, 0 + movs r3, 0 + bl CalcVecFromObjectCenterToObjectUpperLeft +_080B9628: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B957C + + thumb_func_start sub_80B963C +sub_80B963C: @ 80B963C + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r1, 0x8C + bl Cos + movs r5, 0 + strh r0, [r4, 0x24] + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r1, 0x48 + bl Sin + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x4 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x32] + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0x40 + beq _080B969A + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =gUnknown_02020630 + adds r1, r0 + adds r3, r1, 0 + adds r3, 0x3E + ldrb r2, [r3] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r3] + ldrh r0, [r4, 0x24] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r1, 0x20] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + subs r0, 0x8 + strh r0, [r1, 0x22] + strh r5, [r1, 0x24] + strh r5, [r1, 0x26] +_080B969A: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x7F + ble _080B96A6 + movs r0, 0x1 + strh r0, [r4, 0x3C] +_080B96A6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B963C + + thumb_func_start sub_80B96B0 +sub_80B96B0: @ 80B96B0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B9784 + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _080B96FA + ldrb r0, [r4, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r4, 0x1] + ldr r0, =gUnknown_0855C548 + str r0, [r4, 0x10] + adds r0, r4, 0 + bl obj_alloc_rotscale_entry + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + movs r0, 0x5E + strh r0, [r4, 0x20] + ldr r0, =0x0000ffe0 + strh r0, [r4, 0x22] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0xF0 + strh r0, [r4, 0x30] + movs r0, 0x80 + lsls r0, 4 + strh r0, [r4, 0x32] + movs r0, 0x80 + strh r0, [r4, 0x36] +_080B96FA: + ldrh r1, [r4, 0x32] + lsls r1, 16 + asrs r1, 24 + ldrh r2, [r4, 0x30] + adds r2, r1 + ldrh r0, [r4, 0x34] + adds r0, r1 + strh r0, [r4, 0x34] + movs r0, 0xFF + ands r2, r0 + strh r2, [r4, 0x30] + movs r3, 0x30 + ldrsh r0, [r4, r3] + movs r1, 0x20 + bl Cos + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x78 + bl Sin + strh r0, [r4, 0x26] + ldrh r1, [r4, 0x32] + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r2, 0x80 + lsls r2, 1 + cmp r0, r2 + ble _080B973C + ldrh r0, [r4, 0x36] + subs r0, r1, r0 + strh r0, [r4, 0x32] +_080B973C: + ldrh r1, [r4, 0x36] + movs r3, 0x36 + ldrsh r0, [r4, r3] + cmp r0, 0xFF + bgt _080B974C + adds r0, r1, 0 + adds r0, 0x18 + strh r0, [r4, 0x36] +_080B974C: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0xFF + bgt _080B9756 + strh r2, [r4, 0x32] +_080B9756: + movs r2, 0x34 + ldrsh r0, [r4, r2] + cmp r0, 0x3B + ble _080B9784 + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_080B9784: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B96B0 + + thumb_func_start sub_80B9794 +sub_80B9794: @ 80B9794 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_80B9524 + ldr r1, =gUnknown_02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_80B96B0 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9794 + + thumb_func_start sub_80B97C0 +sub_80B97C0: @ 80B97C0 + push {lr} + ldr r0, =sub_80B97D4 + movs r1, 0xFE + bl CreateTask + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B97C0 + + thumb_func_start sub_80B97D4 +sub_80B97D4: @ 80B97D4 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gUnknown_0855C550 + ldr r2, =gTasks + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B97D4 + + thumb_func_start sub_80B9804 +sub_80B9804: @ 80B9804 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, =gUnknown_02037590 + ldrb r1, [r6, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r4, r0, r1 + adds r0, r4, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + beq _080B982E + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B98A6 +_080B982E: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0x11 + strh r0, [r5, 0xC] + ldrb r0, [r6] + strh r0, [r5, 0x26] + movs r0, 0x1 + strb r0, [r6, 0x6] + bl SetPlayerAvatarStateMask + ldrh r1, [r5, 0x26] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080B9856 + ldrb r0, [r4, 0x1A] + movs r1, 0 + bl sub_81555AC +_080B9856: + movs r0, 0x3 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + bl CameraObjectReset2 + adds r0, r4, 0 + movs r1, 0x3 + bl FieldObjectTurn + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02020630 + adds r0, r1 + movs r1, 0x16 + bl StartObjectImageAnim + ldrb r1, [r4, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] + bl sub_80B94C4 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0xA] + bl sub_80B9524 + ldrb r0, [r5, 0xA] + ldrb r1, [r4, 0x4] + bl sub_80B9560 +_080B98A6: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9804 + + thumb_func_start sub_80B98B8 +sub_80B98B8: @ 80B98B8 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r1, [r5, 0xC] + movs r2, 0xC + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _080B98D0 + subs r0, r1, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _080B9910 +_080B98D0: + ldr r0, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r0, r1 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_02020630 + adds r4, r0 + ldrb r0, [r5, 0xA] + movs r1, 0x40 + bl sub_80B9560 + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + movs r1, 0 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + strh r1, [r4, 0x24] + strh r1, [r4, 0x26] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + strh r1, [r5, 0xC] +_080B9910: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B98B8 + + thumb_func_start sub_80B9924 +sub_80B9924: @ 80B9924 + push {r4,lr} + sub sp, 0x24 + adds r4, r0, 0 + ldr r1, =gUnknown_0855C56C + mov r0, sp + movs r2, 0x24 + bl memcpy + ldr r0, =gUnknown_02037590 + ldrb r0, [r0, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =gUnknown_02020630 + adds r1, r0 + movs r2, 0xC + ldrsh r0, [r4, r2] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + strh r0, [r1, 0x26] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x11 + ble _080B9962 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B9962: + add sp, 0x24 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9924 + + thumb_func_start sub_80B9978 +sub_80B9978: @ 80B9978 + push {r4-r6,lr} + adds r6, r0, 0 + ldrb r0, [r6, 0xA] + bl sub_80B9508 + lsls r0, 24 + cmp r0, 0 + beq _080B99DC + ldr r0, =gUnknown_02037590 + ldrb r0, [r0, 0x5] + lsls r5, r0, 3 + adds r5, r0 + lsls r5, 2 + ldr r0, =gUnknown_02037350 + adds r5, r0 + ldrb r0, [r5, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_02020630 + adds r4, r0 + ldrb r1, [r5, 0x1] + movs r0, 0x11 + negs r0, r0 + ands r0, r1 + strb r0, [r5, 0x1] + movs r0, 0x10 + ldrsh r1, [r5, r0] + movs r0, 0x12 + ldrsh r2, [r5, r0] + adds r0, r5, 0 + bl sub_808EB08 + movs r0, 0 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + adds r4, 0x3E + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + bl sub_808C114 + adds r0, r5, 0 + movs r1, 0x39 + bl FieldObjectSetSpecialAnim + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] +_080B99DC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9978 + + thumb_func_start sub_80B99F0 +sub_80B99F0: @ 80B99F0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r0, r1 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B9A18 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldrb r0, [r4, 0xA] + bl sub_80B9794 +_080B9A18: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B99F0 + + thumb_func_start sub_80B9A28 +sub_80B9A28: @ 80B9A28 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0xA] + bl sub_80B9508 + lsls r0, 24 + cmp r0, 0 + beq _080B9A54 + movs r0, 0xA + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x10 + strh r0, [r4, 0xA] +_080B9A54: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9A28 + + thumb_func_start sub_80B9A60 +sub_80B9A60: @ 80B9A60 + push {r4-r7,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0xA] + subs r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + cmp r0, 0 + bne _080B9ACA + ldr r6, =gUnknown_02037590 + ldrb r1, [r6, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r4, r0, r1 + movs r7, 0 + ldrh r1, [r5, 0x26] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080B9A94 + movs r7, 0x3 + ldrb r0, [r4, 0x1A] + movs r1, 0x1 + bl sub_81555AC +_080B9A94: + adds r0, r7, 0 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + adds r0, r4, 0 + movs r1, 0x1 + bl FieldObjectTurn + ldrh r0, [r5, 0x26] + strb r0, [r6] + movs r0, 0 + strb r0, [r6, 0x6] + movs r0, 0x20 + bl FieldEffectActiveListRemove + ldr r0, =sub_80B97D4 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080B9ACA: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9A60 + + thumb_func_start sub_80B9ADC +sub_80B9ADC: @ 80B9ADC + push {r4,lr} + sub sp, 0x4 + ldr r4, =gUnknown_02038C08 + ldrb r0, [r4] + ldrb r1, [r4, 0x4] + ldrb r2, [r4, 0x8] + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _080B9B2C + ldr r0, =sub_80B9BE8 + movs r1, 0x50 + 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, sp + ldrb r0, [r0] + strh r0, [r1, 0xC] + ldr r0, [r4] + strh r0, [r1, 0x14] + ldr r0, [r4, 0x4] + strh r0, [r1, 0x16] + ldr r0, [r4, 0x8] + strh r0, [r1, 0x18] + b _080B9B32 + .pool +_080B9B2C: + movs r0, 0x41 + bl FieldEffectActiveListRemove +_080B9B32: + movs r0, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B9ADC + + thumb_func_start sub_80B9B3C +sub_80B9B3C: @ 80B9B3C + 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, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080B9B78 + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _080B9B7C + movs r0, 0 + strh r0, [r4, 0xC] + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080B9B7C + subs r0, r1, 0x1 + b _080B9B7A + .pool +_080B9B78: + movs r0, 0x4 +_080B9B7A: + strh r0, [r4, 0xA] +_080B9B7C: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _080B9BB6 + movs r0, 0 + strh r0, [r4] + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B9BAC + ldrh r1, [r4, 0xA] + negs r1, r1 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl SetCameraPanning + b _080B9BB6 +_080B9BAC: + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0 + bl SetCameraPanning +_080B9BB6: + bl UpdateCameraPanning + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B9BC8 + adds r0, r5, 0 + bl DestroyTask +_080B9BC8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80B9B3C + + thumb_func_start sub_80B9BD0 +sub_80B9BD0: @ 80B9BD0 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x1 + strh r0, [r1, 0x16] + bx lr + .pool + thumb_func_end sub_80B9BD0 + + thumb_func_start sub_80B9BE8 +sub_80B9BE8: @ 80B9BE8 + 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 InstallCameraPanAheadCallback + movs r0, 0 + bl SetCameraPanningCallback + ldr r1, =gUnknown_0855C590 + movs r2, 0x2 + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r1 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl _call_via_r2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9BE8 + + thumb_func_start sub_80B9C28 +sub_80B9C28: @ 80B9C28 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =sub_80B9B3C + movs r1, 0x5A + bl CreateTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x58 + bl audio_play + strh r4, [r5, 0xA] + ldrh r0, [r5, 0x2] + adds r0, 0x1 + strh r0, [r5, 0x2] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9C28 + + thumb_func_start sub_80B9C54 +sub_80B9C54: @ 80B9C54 + push {r4-r7,lr} + sub sp, 0x4 + adds r7, r0, 0 + ldrh r0, [r7, 0x6] + adds r0, 0x1 + strh r0, [r7, 0x6] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x78 + ble _080B9CC2 + ldr r2, =gUnknown_02037350 + movs r1, 0x4 + ldrsh r0, [r7, r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_02020630 + adds r4, r0 + ldrb r0, [r1, 0x1] + movs r2, 0x20 + orrs r0, r2 + strb r0, [r1, 0x1] + ldr r6, =0x0000ffff + ldr r5, =0x00007fff + adds r0, r6, 0 + movs r1, 0x10 + adds r2, r5, 0 + bl sub_80A2A20 + str r5, [sp] + adds r0, r6, 0 + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + adds r0, r4, 0 + bl sub_80B9D24 + movs r0, 0x57 + bl audio_play + ldrb r0, [r7, 0xA] + bl sub_80B9BD0 + movs r0, 0 + strh r0, [r7, 0x6] + ldrh r0, [r7, 0x2] + adds r0, 0x1 + strh r0, [r7, 0x2] +_080B9CC2: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9C54 + + thumb_func_start sub_80B9CDC +sub_80B9CDC: @ 80B9CDC + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B9D16 + ldr r0, =sub_80B9B3C + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + bne _080B9D16 + bl InstallCameraPanAheadCallback + ldrb r0, [r4, 0xC] + ldrb r1, [r4, 0xE] + ldrb r2, [r4, 0x10] + bl RemoveFieldObjectByLocalIdAndMap + movs r0, 0x41 + bl FieldEffectActiveListRemove + adds r0, r5, 0 + bl DestroyTask +_080B9D16: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9CDC + + thumb_func_start sub_80B9D24 +sub_80B9D24: @ 80B9D24 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + ldr r0, =gUnknown_03005DEC + movs r1, 0 + ldrsh r2, [r0, r1] + movs r3, 0x20 + ldrsh r0, [r6, r3] + adds r2, r0 + movs r1, 0x24 + ldrsh r0, [r6, r1] + adds r2, r0 + ldr r0, =gUnknown_03005DE8 + movs r3, 0 + ldrsh r0, [r0, r3] + movs r3, 0x22 + ldrsh r1, [r6, r3] + adds r0, r1 + movs r3, 0x26 + ldrsh r1, [r6, r3] + adds r0, r1 + subs r0, 0x4 + movs r5, 0 + lsls r2, 16 + mov r8, r2 + lsls r7, r0, 16 +_080B9D5A: + ldr r0, =gUnknown_0855C5EC + mov r2, r8 + asrs r1, r2, 16 + asrs r2, r7, 16 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _080B9D96 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_02020630 + adds r4, r0 + lsls r1, r5, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + strh r5, [r4, 0x2E] + ldrb r1, [r6, 0x5] + lsrs r1, 4 + lsls r1, 4 + ldrb r2, [r4, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x5] +_080B9D96: + adds r5, 0x1 + cmp r5, 0x3 + ble _080B9D5A + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9D24 + + thumb_func_start sub_80B9DB8 +sub_80B9DB8: @ 80B9DB8 + push {lr} + adds r1, r0, 0 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0x1 + beq _080B9DE4 + cmp r0, 0x1 + bgt _080B9DCE + cmp r0, 0 + beq _080B9DD8 + b _080B9E02 +_080B9DCE: + cmp r0, 0x2 + beq _080B9DF0 + cmp r0, 0x3 + beq _080B9DF6 + b _080B9E02 +_080B9DD8: + ldrh r0, [r1, 0x20] + subs r0, 0x10 + strh r0, [r1, 0x20] + ldrh r0, [r1, 0x22] + subs r0, 0xC + b _080B9E00 +_080B9DE4: + ldrh r0, [r1, 0x20] + adds r0, 0x10 + strh r0, [r1, 0x20] + ldrh r0, [r1, 0x22] + subs r0, 0xC + b _080B9E00 +_080B9DF0: + ldrh r0, [r1, 0x20] + subs r0, 0x10 + b _080B9DFA +_080B9DF6: + ldrh r0, [r1, 0x20] + adds r0, 0x10 +_080B9DFA: + strh r0, [r1, 0x20] + ldrh r0, [r1, 0x22] + adds r0, 0xC +_080B9E00: + strh r0, [r1, 0x22] +_080B9E02: + ldrh r0, [r1, 0x20] + adds r0, 0x4 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xF8 + bhi _080B9E1E + movs r0, 0x22 + ldrsh r2, [r1, r0] + movs r0, 0x4 + negs r0, r0 + cmp r2, r0 + blt _080B9E1E + cmp r2, 0xA4 + ble _080B9E24 +_080B9E1E: + adds r0, r1, 0 + bl RemoveObjectAndFreeTiles +_080B9E24: + pop {r0} + bx r0 + thumb_func_end sub_80B9DB8 + + thumb_func_start sub_80B9E28 +sub_80B9E28: @ 80B9E28 + push {r4-r7,lr} + sub sp, 0x4 + ldr r7, =gUnknown_02038C08 + ldrb r0, [r7] + ldrb r1, [r7, 0x4] + ldrb r2, [r7, 0x8] + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _080B9EBE + mov r0, sp + ldrb r0, [r0] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_02037350 + adds r4, r0 + movs r0, 0x10 + ldrsh r5, [r4, r0] + subs r5, 0x7 + movs r0, 0x12 + ldrsh r6, [r4, r0] + subs r6, 0x7 + ldr r1, [r7, 0xC] + subs r5, r1, r5 + lsls r5, 4 + ldr r2, [r7, 0x10] + subs r6, r2, r6 + lsls r6, 4 + adds r1, 0x7 + lsls r1, 16 + asrs r1, 16 + adds r2, 0x7 + lsls r2, 16 + asrs r2, 16 + adds r0, r4, 0 + bl npc_coords_shift + ldr r0, =sub_80B9EDC + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gTasks + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r1 + ldrb r0, [r4, 0x4] + strh r0, [r2, 0xA] + ldr r3, =gUnknown_02020630 + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0, 0x20] + adds r0, r5 + strh r0, [r2, 0xC] + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0, 0x22] + adds r0, r6 + strh r0, [r2, 0xE] + ldr r0, [r7, 0x14] + strh r0, [r2, 0x18] + mov r0, sp + ldrb r0, [r0] + strh r0, [r2, 0x1A] +_080B9EBE: + movs r0, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B9E28 + + thumb_func_start sub_80B9EDC +sub_80B9EDC: @ 80B9EDC + 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 r5, r0, r1 + movs r0, 0x2 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02020630 + adds r6, r0, r1 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _080B9F10 + cmp r0, 0x1 + beq _080B9F4E + b _080B9FAC + .pool +_080B9F10: + ldrh r0, [r6, 0x20] + lsls r0, 4 + strh r0, [r5, 0x8] + ldrh r0, [r6, 0x22] + lsls r0, 4 + strh r0, [r5, 0xA] + movs r2, 0x4 + ldrsh r0, [r5, r2] + lsls r0, 4 + movs r2, 0x8 + ldrsh r1, [r5, r2] + subs r0, r1 + movs r2, 0x10 + ldrsh r1, [r5, r2] + bl __divsi3 + strh r0, [r5, 0xC] + movs r1, 0x6 + ldrsh r0, [r5, r1] + lsls r0, 4 + movs r2, 0xA + ldrsh r1, [r5, r2] + subs r0, r1 + movs r2, 0x10 + ldrsh r1, [r5, r2] + bl __divsi3 + strh r0, [r5, 0xE] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] +_080B9F4E: + ldrh r1, [r5, 0x10] + movs r2, 0x10 + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _080B9F7C + subs r0, r1, 0x1 + strh r0, [r5, 0x10] + ldrh r1, [r5, 0xC] + ldrh r0, [r5, 0x8] + adds r1, r0 + strh r1, [r5, 0x8] + ldrh r0, [r5, 0xE] + ldrh r2, [r5, 0xA] + adds r0, r2 + strh r0, [r5, 0xA] + lsls r1, 16 + asrs r1, 20 + strh r1, [r6, 0x20] + ldrh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 20 + strh r0, [r6, 0x22] + b _080B9FAC +_080B9F7C: + movs r1, 0x12 + ldrsh r0, [r5, r1] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_02037350 + adds r4, r0 + ldrh r0, [r5, 0x4] + strh r0, [r6, 0x20] + ldrh r0, [r5, 0x6] + strh r0, [r6, 0x22] + adds r0, r4, 0 + bl npc_coords_shift_still + ldrb r0, [r4] + movs r1, 0x8 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x42 + bl FieldEffectActiveListRemove + adds r0, r7, 0 + bl DestroyTask +_080B9FAC: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9EDC + .align 2, 0 @ Don't pad with nop. diff --git a/asm/field_effect_helpers.s b/asm/field_effect_helpers.s index a6ae0ac33..9a0460934 100644 --- a/asm/field_effect_helpers.s +++ b/asm/field_effect_helpers.s @@ -833,7 +833,7 @@ unc_grass_normal: @ 8154550 ands r0, r1 cmp r0, 0 beq _0815459C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] movs r0, 0x5 ldrsb r0, [r2, r0] @@ -1172,7 +1172,7 @@ unc_grass_tall: @ 8154800 ands r0, r1 cmp r0, 0 beq _0815484C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] movs r0, 0x5 ldrsb r0, [r2, r0] diff --git a/asm/field_ground_effect.s b/asm/field_ground_effect.s index abdda24a9..0fb3bdc85 100644 --- a/asm/field_ground_effect.s +++ b/asm/field_ground_effect.s @@ -1185,7 +1185,7 @@ GroundEffect_SpawnOnTallGrass: @ 8096E90 str r1, [r3, 0x10] ldrb r0, [r0, 0xA] str r0, [r3, 0x14] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldrb r0, [r1, 0x5] lsls r0, 8 @@ -1224,7 +1224,7 @@ GroundEffect_StepOnTallGrass: @ 8096EDC str r1, [r3, 0x10] ldrb r0, [r0, 0xA] str r0, [r3, 0x14] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldrb r0, [r1, 0x5] lsls r0, 8 @@ -1263,7 +1263,7 @@ GroundEffect_SpawnOnLongGrass: @ 8096F28 str r1, [r3, 0x10] ldrb r0, [r0, 0xA] str r0, [r3, 0x14] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldrb r0, [r1, 0x5] lsls r0, 8 @@ -1302,7 +1302,7 @@ GroundEffect_StepOnLongGrass: @ 8096F74 str r1, [r3, 0x10] ldrb r0, [r0, 0xA] str r0, [r3, 0x14] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldrb r0, [r1, 0x5] lsls r0, 8 diff --git a/asm/field_map_obj.s b/asm/field_map_obj.s index 44f8f0c06..01471c59f 100644 --- a/asm/field_map_obj.s +++ b/asm/field_map_obj.s @@ -535,7 +535,7 @@ _0808D7CA: movs r5, 0 cmp r5, r6 bcs _0808D7FE - ldr r7, =gUnknown_03005D8C + ldr r7, =gSaveBlock1Ptr _0808D7D2: lsls r0, r5, 1 adds r0, r5 @@ -1099,7 +1099,7 @@ SpawnSpecialFieldObject: @ 808DC08 add r0, sp, 0x4 adds r1, r4, 0 bl GetFieldObjectMovingCameraOffset - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrb r1, [r0, 0x5] ldrb r2, [r0, 0x4] @@ -1557,7 +1557,7 @@ SpawnFieldObjectsInView: @ 808DF80 ldr r0, [r5, 0x4] cmp r0, 0 beq _0808E078 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldrh r1, [r2] subs r0, r1, 0x2 @@ -1610,7 +1610,7 @@ _0808E004: movs r2, 0xC7 lsls r2, 4 adds r0, r2 - ldr r3, =gUnknown_03005D8C + ldr r3, =gSaveBlock1Ptr ldr r1, [r3] adds r4, r1, r0 ldrh r0, [r4, 0x4] @@ -1642,7 +1642,7 @@ _0808E004: lsls r0, 24 cmp r0, 0 bne _0808E06E - ldr r3, =gUnknown_03005D8C + ldr r3, =gSaveBlock1Ptr ldr r0, [r3] ldrb r1, [r0, 0x5] ldrb r2, [r0, 0x4] @@ -1729,7 +1729,7 @@ _0808E0D2: RemoveFieldObjectIfOutsideView: @ 808E0EC push {r4-r7,lr} adds r3, r0, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldrh r0, [r2] subs r1, r0, 0x2 @@ -3952,7 +3952,7 @@ GetFieldObjectTemplateByLocalIdAndMap: @ 808F128 lsrs r3, r1, 24 lsls r2, 24 lsrs r2, 24 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] movs r0, 0x5 ldrsb r0, [r1, r0] @@ -4026,7 +4026,7 @@ sub_808F1B4: @ 808F1B4 push {r4,r5,lr} adds r3, r0, 0 ldrb r0, [r3, 0x9] - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] movs r1, 0x5 ldrsb r1, [r2, r1] @@ -4414,7 +4414,7 @@ sub_808F48C: @ 808F48C cmp r0, 0 beq _0808F4C0 ldr r5, =gUnknown_0850D6DC - bl GenerateRandomNumber + bl Random movs r4, 0x3 adds r1, r4, 0 ands r1, r0 @@ -4467,7 +4467,7 @@ sub_808F4E8: @ 808F4E8 mov r0, sp movs r2, 0x4 bl memcpy - bl GenerateRandomNumber + bl Random movs r1, 0x3 ands r1, r0 mov r2, sp @@ -5158,7 +5158,7 @@ sub_808F9C8: @ 808F9C8 cmp r0, 0 beq _0808F9FE ldr r4, =gUnknown_0850D6DC - bl GenerateRandomNumber + bl Random movs r5, 0x3 adds r1, r5, 0 ands r1, r0 @@ -5229,7 +5229,7 @@ sub_808FA3C: @ 808FA3C lsrs r1, r0, 24 cmp r1, 0 bne _0808FA6C - bl GenerateRandomNumber + bl Random movs r1, 0x3 ands r1, r0 mov r2, sp @@ -5328,7 +5328,7 @@ sub_808FB08: @ 808FB08 cmp r0, 0 beq _0808FB3C ldr r5, =gUnknown_0850D6DC - bl GenerateRandomNumber + bl Random movs r4, 0x3 adds r1, r4, 0 ands r1, r0 @@ -5383,7 +5383,7 @@ sub_808FB64: @ 808FB64 mov r0, sp movs r2, 0x2 bl memcpy - bl GenerateRandomNumber + bl Random movs r7, 0x1 adds r1, r7, 0 ands r1, r0 @@ -5540,7 +5540,7 @@ sub_808FC8C: @ 808FC8C cmp r0, 0 beq _0808FCC0 ldr r5, =gUnknown_0850D6DC - bl GenerateRandomNumber + bl Random movs r4, 0x3 adds r1, r4, 0 ands r1, r0 @@ -5593,7 +5593,7 @@ sub_808FCE8: @ 808FCE8 mov r0, sp movs r2, 0x2 bl memcpy - bl GenerateRandomNumber + bl Random movs r7, 0x1 adds r1, r7, 0 ands r1, r0 @@ -6143,7 +6143,7 @@ sub_80900D4: @ 80900D4 cmp r0, 0 beq _0809010A ldr r4, =gUnknown_0850D6DC - bl GenerateRandomNumber + bl Random movs r5, 0x3 adds r1, r5, 0 ands r1, r0 @@ -6212,7 +6212,7 @@ sub_8090148: @ 8090148 lsrs r1, r0, 24 cmp r1, 0 bne _08090178 - bl GenerateRandomNumber + bl Random movs r1, 0x1 ands r1, r0 mov r2, sp @@ -6311,7 +6311,7 @@ sub_8090214: @ 8090214 cmp r0, 0 beq _0809024A ldr r4, =gUnknown_0850D6DC - bl GenerateRandomNumber + bl Random movs r5, 0x3 adds r1, r5, 0 ands r1, r0 @@ -6380,7 +6380,7 @@ sub_8090288: @ 8090288 lsrs r1, r0, 24 cmp r1, 0 bne _080902B8 - bl GenerateRandomNumber + bl Random movs r1, 0x1 ands r1, r0 mov r2, sp @@ -6479,7 +6479,7 @@ sub_8090354: @ 8090354 cmp r0, 0 beq _0809038A ldr r4, =gUnknown_0850D6EC - bl GenerateRandomNumber + bl Random movs r5, 0x3 adds r1, r5, 0 ands r1, r0 @@ -6548,7 +6548,7 @@ sub_80903C8: @ 80903C8 lsrs r1, r0, 24 cmp r1, 0 bne _080903F8 - bl GenerateRandomNumber + bl Random movs r1, 0x1 ands r1, r0 mov r2, sp @@ -6647,7 +6647,7 @@ sub_8090494: @ 8090494 cmp r0, 0 beq _080904CA ldr r4, =gUnknown_0850D6EC - bl GenerateRandomNumber + bl Random movs r5, 0x3 adds r1, r5, 0 ands r1, r0 @@ -6716,7 +6716,7 @@ sub_8090508: @ 8090508 lsrs r1, r0, 24 cmp r1, 0 bne _08090538 - bl GenerateRandomNumber + bl Random movs r1, 0x1 ands r1, r0 mov r2, sp @@ -6815,7 +6815,7 @@ sub_80905D4: @ 80905D4 cmp r0, 0 beq _0809060A ldr r4, =gUnknown_0850D6EC - bl GenerateRandomNumber + bl Random movs r5, 0x3 adds r1, r5, 0 ands r1, r0 @@ -6884,7 +6884,7 @@ sub_8090648: @ 8090648 lsrs r1, r0, 24 cmp r1, 0 bne _08090678 - bl GenerateRandomNumber + bl Random movs r1, 0x1 ands r1, r0 mov r2, sp @@ -6983,7 +6983,7 @@ sub_8090714: @ 8090714 cmp r0, 0 beq _0809074A ldr r4, =gUnknown_0850D6EC - bl GenerateRandomNumber + bl Random movs r5, 0x3 adds r1, r5, 0 ands r1, r0 @@ -7052,7 +7052,7 @@ sub_8090788: @ 8090788 lsrs r1, r0, 24 cmp r1, 0 bne _080907B8 - bl GenerateRandomNumber + bl Random movs r1, 0x1 ands r1, r0 mov r2, sp @@ -7151,7 +7151,7 @@ sub_8090854: @ 8090854 cmp r0, 0 beq _0809088A ldr r4, =gUnknown_0850D6EC - bl GenerateRandomNumber + bl Random movs r5, 0x3 adds r1, r5, 0 ands r1, r0 @@ -7220,7 +7220,7 @@ sub_80908C8: @ 80908C8 lsrs r1, r0, 24 cmp r1, 0 bne _080908F8 - bl GenerateRandomNumber + bl Random movs r1, 0x3 ands r1, r0 mov r2, sp @@ -7319,7 +7319,7 @@ sub_8090994: @ 8090994 cmp r0, 0 beq _080909CA ldr r4, =gUnknown_0850D6EC - bl GenerateRandomNumber + bl Random movs r5, 0x3 adds r1, r5, 0 ands r1, r0 @@ -7388,7 +7388,7 @@ sub_8090A08: @ 8090A08 lsrs r1, r0, 24 cmp r1, 0 bne _08090A38 - bl GenerateRandomNumber + bl Random movs r1, 0x3 ands r1, r0 mov r2, sp @@ -7487,7 +7487,7 @@ sub_8090AD4: @ 8090AD4 cmp r0, 0 beq _08090B0A ldr r4, =gUnknown_0850D6EC - bl GenerateRandomNumber + bl Random movs r5, 0x3 adds r1, r5, 0 ands r1, r0 @@ -7556,7 +7556,7 @@ sub_8090B48: @ 8090B48 lsrs r1, r0, 24 cmp r1, 0 bne _08090B78 - bl GenerateRandomNumber + bl Random movs r1, 0x3 ands r1, r0 mov r2, sp @@ -7655,7 +7655,7 @@ sub_8090C14: @ 8090C14 cmp r0, 0 beq _08090C4A ldr r4, =gUnknown_0850D6EC - bl GenerateRandomNumber + bl Random movs r5, 0x3 adds r1, r5, 0 ands r1, r0 @@ -7724,7 +7724,7 @@ sub_8090C88: @ 8090C88 lsrs r1, r0, 24 cmp r1, 0 bne _08090CB8 - bl GenerateRandomNumber + bl Random movs r1, 0x3 ands r1, r0 mov r2, sp @@ -12477,7 +12477,7 @@ _08092FE4: thumb_func_start sub_8092FF0 sub_8092FF0: @ 8092FF0 push {r4,r5,lr} - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r4, [r5] ldrh r4, [r4] lsls r0, 16 @@ -12562,7 +12562,7 @@ _0809308C: adds r0, r1 lsrs r4, r0, 16 _08093098: - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, [r2] ldrh r1, [r0] lsls r0, r5, 16 diff --git a/asm/field_message_box.s b/asm/field_message_box.s index 1bff785c2..6f5e6dda8 100644 --- a/asm/field_message_box.s +++ b/asm/field_message_box.s @@ -160,9 +160,9 @@ sub_8098238: @ 8098238 ldrb r0, [r5] cmp r0, 0 bne _08098270 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 adds r1, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r0, =sub_8098214 movs r1, 0 bl CreateTask @@ -243,9 +243,9 @@ textbox_fdecode_auto_and_task_add: @ 80982DC push {r4,lr} adds r2, r0, 0 adds r4, r1, 0 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 adds r1, r2, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders lsls r4, 24 lsrs r4, 24 adds r0, r4, 0 diff --git a/asm/field_player_avatar.s b/asm/field_player_avatar.s index 3a722da43..146e360bb 100644 --- a/asm/field_player_avatar.s +++ b/asm/field_player_avatar.s @@ -2760,11 +2760,11 @@ _0808BE2A: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0808BE12 _0808BE44: @@ -4112,7 +4112,7 @@ fish1: @ 808C918 bl memcpy movs r0, 0 strh r0, [r5, 0x20] - bl GenerateRandomNumber + bl Random movs r2, 0x26 ldrsh r1, [r5, r2] lsls r1, 1 @@ -4197,7 +4197,7 @@ fish3: @ 808C9D4 strh r0, [r4, 0x8] strh r1, [r4, 0xA] strh r1, [r4, 0xC] - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xA @@ -4238,7 +4238,7 @@ fish4: @ 808CA20 ldrh r0, [r4, 0xA] adds r1, r0, 0x1 strh r1, [r4, 0xA] - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r0, [r0, 0x2E] movs r5, 0x1 adds r2, r5, 0 @@ -4324,10 +4324,10 @@ fish5: @ 808CABC strh r0, [r5, 0x8] b _0808CB5C _0808CADC: - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4, 0 movs r1, 0x6 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0808CB14 adds r0, r4, 0 @@ -4339,7 +4339,7 @@ _0808CADC: cmp r0, 0x3C bne _0808CB14 _0808CAFC: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -4352,7 +4352,7 @@ _0808CAFC: _0808CB14: cmp r6, 0 bne _0808CB32 - bl GenerateRandomNumber + bl Random movs r1, 0x1 ands r1, r0 cmp r1, 0 @@ -4445,7 +4445,7 @@ fish7: @ 808CBA4 b _0808CBEC .pool _0808CBDC: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -4485,7 +4485,7 @@ fish8: @ 808CBFC blt _0808CC52 cmp r1, 0x1 bgt _0808CC56 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 diff --git a/asm/field_poison.s b/asm/field_poison.s index a63c2b623..d1405ce30 100644 --- a/asm/field_poison.s +++ b/asm/field_poison.s @@ -9,7 +9,7 @@ sub_80F9568: @ 80F9568 push {lr} movs r1, 0x41 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0 @@ -31,7 +31,7 @@ _080F9586: thumb_func_start sub_80F958C sub_80F958C: @ 80F958C push {r4,r5,lr} - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty movs r5, 0 _080F9592: adds r0, r4, 0 @@ -40,7 +40,7 @@ _080F9592: beq _080F95B0 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _080F95B0 movs r0, 0 @@ -67,7 +67,7 @@ sub_80F95C0: @ 80F95C0 movs r1, 0x64 adds r4, r0, 0 muls r4, r1 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 movs r0, 0 str r0, [sp] @@ -78,13 +78,13 @@ sub_80F95C0: @ 80F95C0 movs r1, 0x37 mov r2, sp bl pokemon_setattr - ldr r5, =gUnknown_02021CC4 + ldr r5, =gStringVar1 adds r0, r4, 0 movs r1, 0x2 adds r2, r5, 0 - bl pokemon_getattr + bl GetMonData adds r0, r5, 0 - bl GetStringEnd_Limit7 + bl StringGetEnd10 add sp, 0x4 pop {r4,r5} pop {r0} @@ -99,7 +99,7 @@ sub_80F960C: @ 80F960C lsrs r0, 24 movs r1, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 bl sub_80F9568 @@ -107,12 +107,12 @@ sub_80F960C: @ 80F960C beq _080F964C adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _080F964C adds r0, r4, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData bl pokemon_ailments_get_primary lsls r0, 24 lsrs r0, 24 @@ -253,19 +253,19 @@ sub_80F972C: @ 80F972C overworld_poison: @ 80F9744 push {r4-r7,lr} sub sp, 0x4 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty movs r7, 0 movs r6, 0 movs r5, 0x5 _080F9750: adds r0, r4, 0 movs r1, 0x5 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _080F9794 adds r0, r4, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData bl pokemon_ailments_get_primary lsls r0, 24 lsrs r0, 24 @@ -273,7 +273,7 @@ _080F9750: bne _080F9794 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData str r0, [sp] cmp r0, 0 beq _080F9786 diff --git a/asm/field_region_map.s b/asm/field_region_map.s new file mode 100644 index 000000000..67fc08a2b --- /dev/null +++ b/asm/field_region_map.s @@ -0,0 +1,325 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_817018C +sub_817018C: @ 817018C + push {r4,r5,lr} + adds r5, r0, 0 + movs r0, 0 + bl SetVBlankCallback + ldr r4, =gUnknown_0203BCD0 + movs r0, 0x89 + lsls r0, 4 + bl Alloc + str r0, [r4] + ldr r1, =0x0000088c + adds r2, r0, r1 + movs r1, 0 + strh r1, [r2] + str r5, [r0] + ldr r0, =sub_81701C4 + bl SetMainCallback2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817018C + + thumb_func_start sub_81701C4 +sub_81701C4: @ 81701C4 + push {lr} + movs r0, 0 + 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, 0x18 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + movs r1, 0 + bl SetGpuReg + movs r0, 0x1C + movs r1, 0 + bl SetGpuReg + movs r0, 0x1E + movs r1, 0 + bl SetGpuReg + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085E5068 + movs r0, 0x1 + movs r2, 0x2 + bl InitBgsFromTemplates + ldr r0, =gUnknown_085E5070 + bl InitWindows + bl DeactivateAllTextPrinters + movs r0, 0 + movs r1, 0x27 + movs r2, 0xD0 + bl sub_809882C + bl clear_scheduled_bg_copies_to_vram + ldr r0, =sub_8170274 + bl SetMainCallback2 + ldr r0, =sub_8170260 + bl SetVBlankCallback + pop {r0} + bx r0 + .pool + thumb_func_end sub_81701C4 + + thumb_func_start sub_8170260 +sub_8170260: @ 8170260 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_8170260 + + thumb_func_start sub_8170274 +sub_8170274: @ 8170274 + push {lr} + bl sub_8170290 + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + bl do_scheduled_bg_tilemap_copies_to_vram + pop {r0} + bx r0 + thumb_func_end sub_8170274 + + thumb_func_start sub_8170290 +sub_8170290: @ 8170290 + push {r4,r5,lr} + sub sp, 0xC + ldr r1, =gUnknown_0203BCD0 + ldr r0, [r1] + ldr r2, =0x0000088c + adds r0, r2 + ldrh r0, [r0] + adds r4, r1, 0 + cmp r0, 0x6 + bls _081702A6 + b _08170416 +_081702A6: + lsls r0, 2 + ldr r1, =_081702BC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081702BC: + .4byte _081702D8 + .4byte _08170300 + .4byte _08170358 + .4byte _08170380 + .4byte _08170394 + .4byte _081703C0 + .4byte _081703E8 +_081702D8: + ldr r0, [r4] + adds r0, 0x8 + movs r1, 0 + bl sub_8122CDC + movs r0, 0 + movs r1, 0 + bl sub_8124288 + movs r0, 0x1 + movs r1, 0x1 + bl sub_81240D4 + ldr r1, [r4] + ldr r0, =0x0000088c + adds r1, r0 + b _081703D8 + .pool +_08170300: + movs r0, 0x1 + movs r1, 0 + movs r2, 0x27 + movs r3, 0xD + bl SetWindowBorderStyle + ldr r5, =gUnknown_085EE8F1 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x38 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r4, 0 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + bl Print + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0 + movs r1, 0 + movs r2, 0x27 + movs r3, 0xD + bl SetWindowBorderStyle + bl sub_8170428 + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + b _081703CC + .pool +_08170358: + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuRegBits + movs r0, 0 + bl ShowBg + movs r0, 0x2 + bl ShowBg + ldr r0, =gUnknown_0203BCD0 + ldr r1, [r0] + ldr r0, =0x0000088c + adds r1, r0 + b _081703D8 + .pool +_08170380: + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08170416 + ldr r1, [r4] + b _081703D4 + .pool +_08170394: + bl sub_81230AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _081703A6 + bl sub_8170428 + b _08170416 +_081703A6: + cmp r0, 0x3 + blt _08170416 + cmp r0, 0x5 + bgt _08170416 + ldr r0, =gUnknown_0203BCD0 + ldr r1, [r0] + ldr r0, =0x0000088c + adds r1, r0 + b _081703D8 + .pool +_081703C0: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 +_081703CC: + bl pal_fade_maybe + ldr r0, =gUnknown_0203BCD0 + ldr r1, [r0] +_081703D4: + ldr r2, =0x0000088c + adds r1, r2 +_081703D8: + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _08170416 + .pool +_081703E8: + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _08170416 + bl sub_812305C + ldr r4, =gUnknown_0203BCD0 + ldr r0, [r4] + ldr r0, [r0] + bl SetMainCallback2 + ldr r0, [r4] + cmp r0, 0 + beq _08170412 + bl Free + str r5, [r4] +_08170412: + bl FreeAllWindowBuffers +_08170416: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8170290 + + thumb_func_start sub_8170428 +sub_8170428: @ 8170428 + push {r4,lr} + sub sp, 0xC + ldr r4, =gUnknown_0203BCD0 + ldr r0, [r4] + ldrb r0, [r0, 0xA] + cmp r0, 0 + beq _08170460 + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r2, [r4] + adds r2, 0xC + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + b _08170470 + .pool +_08170460: + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram +_08170470: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8170428 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_809D7BC.s b/asm/field_tasks.s similarity index 85% rename from asm/rom_809D7BC.s rename to asm/field_tasks.s index 04f709937..7368eed85 100644 --- a/asm/rom_809D7BC.s +++ b/asm/field_tasks.s @@ -5,154 +5,6 @@ .text - thumb_func_start sub_809D7BC -sub_809D7BC: @ 809D7BC - push {lr} - movs r0, 0x1 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D7BC - - thumb_func_start sub_809D7C8 -sub_809D7C8: @ 809D7C8 - push {lr} - movs r0, 0x2 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D7C8 - - thumb_func_start sub_809D7D4 -sub_809D7D4: @ 809D7D4 - push {lr} - movs r0, 0x3 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D7D4 - - thumb_func_start sub_809D7E0 -sub_809D7E0: @ 809D7E0 - push {lr} - movs r0, 0x4 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D7E0 - - thumb_func_start sub_809D7EC -sub_809D7EC: @ 809D7EC - push {lr} - movs r0, 0x5 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D7EC - - thumb_func_start sub_809D7F8 -sub_809D7F8: @ 809D7F8 - push {lr} - movs r0, 0x6 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D7F8 - - thumb_func_start sub_809D804 -sub_809D804: @ 809D804 - push {lr} - movs r0, 0x9 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D804 - - thumb_func_start sub_809D810 -sub_809D810: @ 809D810 - push {lr} - movs r0, 0x7 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D810 - - thumb_func_start sub_809D81C -sub_809D81C: @ 809D81C - push {lr} - movs r0, 0x8 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D81C - - thumb_func_start sub_809D828 -sub_809D828: @ 809D828 - push {lr} - movs r0, 0xB - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D828 - - thumb_func_start sub_809D834 -sub_809D834: @ 809D834 - push {lr} - movs r0, 0xC - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D834 - - thumb_func_start sub_809D840 -sub_809D840: @ 809D840 - push {lr} - movs r0, 0x14 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D840 - - thumb_func_start sub_809D84C -sub_809D84C: @ 809D84C - push {lr} - movs r0, 0x15 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D84C - - thumb_func_start trigger_activate_weather -trigger_activate_weather: @ 809D858 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r2, 0 - ldr r3, =gUnknown_085102E0 -_0809D862: - lsls r1, r2, 3 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r4 - bne _0809D87C - adds r0, r3, 0x4 - adds r0, r1, r0 - ldr r0, [r0] - bl _call_via_r0 - b _0809D886 - .pool -_0809D87C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xC - bls _0809D862 -_0809D886: - pop {r4} - pop {r0} - bx r0 - thumb_func_end trigger_activate_weather - thumb_func_start task_per_step_callback_manager task_per_step_callback_manager: @ 809D88C push {lr} @@ -187,7 +39,7 @@ sub_809D8B8: @ 809D8B8 beq _0809D8E8 b _0809D8FC _0809D8CA: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r0, [r0, 0x20] movs r1, 0x80 lsls r1, 5 @@ -200,7 +52,7 @@ _0809D8CA: b _0809D8FA .pool _0809D8E8: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r0, [r0, 0x20] movs r1, 0x80 lsls r1, 5 @@ -1918,7 +1770,7 @@ sub_809E638: @ 809E638 mov r0, sp adds r1, r5, 0 bl PlayerGetDestCoords - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x4 ldrsb r1, [r0, r1] @@ -2066,171 +1918,4 @@ _0809E762: bx r0 thumb_func_end sub_809E638 - thumb_func_start sub_809E778 -sub_809E778: @ 809E778 - push {lr} - ldr r0, =0x00000895 - bl FlagSet - bl GameFreakRTC_CalcLocalDateTime - ldr r0, =gUnknown_03005D90 - ldr r2, [r0] - adds r2, 0xA0 - ldr r3, =gUnknown_03005CF8 - ldr r0, [r3] - ldr r1, [r3, 0x4] - str r0, [r2] - str r1, [r2, 0x4] - ldr r0, =0x00004040 - ldrh r1, [r3] - bl VarSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E778 - - thumb_func_start sub_809E7B0 -sub_809E7B0: @ 809E7B0 - push {r4,lr} - ldr r0, =0x00000895 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0809E7DA - bl sub_813B9C0 - lsls r0, 24 - cmp r0, 0 - bne _0809E7DA - bl GameFreakRTC_CalcLocalDateTime - ldr r4, =gUnknown_03005CF8 - adds r0, r4, 0 - bl sub_809E7E8 - adds r0, r4, 0 - bl sub_809E858 -_0809E7DA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E7B0 - - thumb_func_start sub_809E7E8 -sub_809E7E8: @ 809E7E8 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r0, =0x00004040 - bl GetVarPointer - adds r6, r0, 0 - ldrh r0, [r6] - movs r2, 0 - ldrsh r1, [r5, r2] - cmp r0, r1 - beq _0809E84E - cmp r0, r1 - bgt _0809E84E - ldrh r4, [r5] - subs r4, r0 - lsls r4, 16 - lsrs r4, 16 - bl sub_809D3A0 - adds r0, r4, 0 - bl sub_8122580 - adds r0, r4, 0 - bl sub_80ED888 - adds r0, r4, 0 - bl sub_80AEFBC - adds r0, r4, 0 - bl sub_806DE44 - adds r0, r4, 0 - bl sub_8137904 - adds r0, r4, 0 - bl sub_8137A20 - adds r0, r4, 0 - bl sub_8139EF4 - adds r0, r4, 0 - bl sub_813A7F4 - adds r0, r4, 0 - bl sub_813945C - adds r0, r4, 0 - bl sub_8177584 - ldrh r0, [r5] - strh r0, [r6] -_0809E84E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E7E8 - - thumb_func_start sub_809E858 -sub_809E858: @ 809E858 - push {r4-r6,lr} - sub sp, 0x8 - adds r5, r0, 0 - mov r4, sp - ldr r6, =gUnknown_03005D90 - ldr r1, [r6] - adds r1, 0xA0 - mov r0, sp - adds r2, r5, 0 - bl GameFreakRTC_GetDelta - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - lsls r0, r1, 1 - adds r0, r1 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 5 - movs r2, 0x2 - ldrsb r2, [r4, r2] - lsls r0, r2, 4 - subs r0, r2 - lsls r0, 2 - adds r1, r0 - movs r0, 0x3 - ldrsb r0, [r4, r0] - adds r0, r1, r0 - cmp r0, 0 - beq _0809E8A8 - cmp r0, 0 - blt _0809E8A8 - bl BerryTreeTimeUpdate - ldr r2, [r6] - adds r2, 0xA0 - ldr r0, [r5] - ldr r1, [r5, 0x4] - str r0, [r2] - str r1, [r2, 0x4] -_0809E8A8: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E858 - - thumb_func_start sub_809E8B4 -sub_809E8B4: @ 809E8B4 - push {lr} - bl sub_809E778 - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E8B4 - - thumb_func_start Special_StartWallClock -Special_StartWallClock: @ 809E8C8 - push {lr} - ldr r0, =Cb2_StartWallClock - bl SetMainCallback2 - ldr r1, =gUnknown_030022C0 - ldr r0, =sub_809E8B4 - str r0, [r1, 0x8] - pop {r0} - bx r0 - .pool - thumb_func_end Special_StartWallClock - .align 2, 0 @ Don't pad with nop. diff --git a/asm/fieldmap.s b/asm/fieldmap.s index 33d9953f9..037133d1e 100644 --- a/asm/fieldmap.s +++ b/asm/fieldmap.s @@ -876,7 +876,7 @@ save_serialize_map: @ 80883C4 mov r7, r9 mov r6, r8 push {r6,r7} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] adds r4, r1, 0 adds r4, 0x34 @@ -936,7 +936,7 @@ sub_8088438: @ 8088438 push {r4,lr} movs r2, 0 movs r1, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] adds r3, r0, 0 adds r3, 0x34 @@ -971,7 +971,7 @@ sav2_mapdata_clear: @ 8088474 mov r1, sp movs r0, 0 strh r0, [r1] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] adds r1, 0x34 ldr r2, =0x01000100 @@ -991,7 +991,7 @@ mapdata_from_sav2: @ 808849C mov r5, r8 push {r5-r7} sub sp, 0x10 - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] adds r7, r0, 0 adds r7, 0x34 @@ -1147,7 +1147,7 @@ sub_80885C4: @ 80885C4 lsls r0, 24 lsrs r3, r0, 24 adds r2, r3, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] adds r0, r1, 0 adds r0, 0x34 @@ -1373,7 +1373,7 @@ _08088782: GetPostCameraMoveMapBorderId: @ 8088788 push {r4,lr} adds r3, r1, 0 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r1, [r1] movs r4, 0 ldrsh r2, [r1, r4] @@ -1395,7 +1395,7 @@ GetPostCameraMoveMapBorderId: @ 8088788 @ bool32 CanCameraMoveInDirection(u8 direction) CanCameraMoveInDirection: @ 80887B0 push {r4,r5,lr} - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r4, [r1] movs r1, 0 ldrsh r3, [r4, r1] @@ -1450,7 +1450,7 @@ _08088816: beq _08088834 cmp r4, 0x4 bne _08088872 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] negs r0, r6 strh r0, [r1] @@ -1460,7 +1460,7 @@ _08088816: b _08088870 .pool _08088834: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, [r3] ldr r0, [r0] @@ -1471,7 +1471,7 @@ _08088834: b _08088870 .pool _0808884C: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r2, [r5, 0x4] ldrh r0, [r1] @@ -1481,7 +1481,7 @@ _0808884C: b _08088870 .pool _08088860: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r2, [r5, 0x4] ldrh r0, [r1] @@ -1522,7 +1522,7 @@ CameraMove: @ 808887C adds r0, r7, 0x1 cmp r0, 0x1 bhi _080888C4 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldrh r0, [r1] add r0, r10 @@ -1535,7 +1535,7 @@ CameraMove: @ 808887C _080888C4: bl save_serialize_map bl sub_81BE72C - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r0, [r1] movs r2, 0 ldrsh r5, [r0, r2] @@ -1562,7 +1562,7 @@ _080888C4: orrs r0, r1 ldr r2, =gUnknown_02037334 strb r0, [r2] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] movs r2, 0 ldrsh r0, [r1, r2] @@ -1884,7 +1884,7 @@ sub_8088B3C: @ 8088B3C lsrs r0, 16 lsls r1, 16 lsrs r1, 16 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r2, [r2] subs r0, 0x7 strh r0, [r2] @@ -1896,7 +1896,7 @@ sub_8088B3C: @ 8088B3C thumb_func_start sav1_camera_get_focus_coords sav1_camera_get_focus_coords: @ 8088B58 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r3, [r2] ldrh r2, [r3] adds r2, 0x7 @@ -1911,7 +1911,7 @@ sav1_camera_get_focus_coords: @ 8088B58 thumb_func_start SetCameraCoords @ void SetCameraCoords(u16 x, u16 y) SetCameraCoords: @ 8088B70 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r2, [r2] strh r0, [r2] strh r1, [r2, 0x2] @@ -1922,7 +1922,7 @@ SetCameraCoords: @ 8088B70 thumb_func_start GetCameraCoords @ void GetCameraCoords(u16 *x, u16 *y) GetCameraCoords: @ 8088B80 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r3, [r2] ldrh r2, [r3] strh r2, [r0] diff --git a/asm/flag.s b/asm/flag.s deleted file mode 100644 index 24b70f5e1..000000000 --- a/asm/flag.s +++ /dev/null @@ -1,126 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start GetFlagPointer -@ u8 *GetFlagPointer(u16 flagId) -GetFlagPointer: @ 809D6EC - push {lr} - lsls r1, r0, 16 - lsrs r2, r1, 16 - adds r3, r2, 0 - cmp r2, 0 - bne _0809D6FC - movs r0, 0 - b _0809D72E -_0809D6FC: - ldr r0, =0x00003fff - cmp r2, r0 - bhi _0809D71C - ldr r0, =gUnknown_03005D8C - lsrs r1, 19 - ldr r2, =0x00001270 - adds r1, r2 - ldr r0, [r0] - b _0809D72C - .pool -_0809D71C: - ldr r1, =0xffffc000 - adds r0, r3, r1 - cmp r0, 0 - bge _0809D728 - ldr r2, =0xffffc007 - adds r0, r3, r2 -_0809D728: - asrs r0, 3 - ldr r1, =gUnknown_020375FC -_0809D72C: - adds r0, r1 -_0809D72E: - pop {r1} - bx r1 - .pool - thumb_func_end GetFlagPointer - - thumb_func_start FlagSet -@ bool8 FlagSet(u16 flagId) -FlagSet: @ 809D740 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl GetFlagPointer - adds r2, r0, 0 - cmp r2, 0 - beq _0809D760 - movs r0, 0x7 - ands r0, r4 - movs r1, 0x1 - lsls r1, r0 - ldrb r0, [r2] - orrs r1, r0 - strb r1, [r2] -_0809D760: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end FlagSet - - thumb_func_start FlagReset -@ bool8 FlagReset(u16 flagId) -FlagReset: @ 809D768 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl GetFlagPointer - adds r2, r0, 0 - cmp r2, 0 - beq _0809D788 - movs r0, 0x7 - ands r0, r4 - movs r1, 0x1 - lsls r1, r0 - ldrb r0, [r2] - bics r0, r1 - strb r0, [r2] -_0809D788: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end FlagReset - - thumb_func_start FlagGet -@ bool8 FlagGet(u16 flagId) -FlagGet: @ 809D790 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl GetFlagPointer - cmp r0, 0 - beq _0809D7B4 - ldrb r0, [r0] - movs r1, 0x7 - ands r1, r4 - asrs r0, r1 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0809D7B4 - movs r0, 0x1 - b _0809D7B6 -_0809D7B4: - movs r0, 0 -_0809D7B6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end FlagGet - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/fldeff_80F9BCC.s b/asm/fldeff_80F9BCC.s index 41c207bf1..a881d207a 100644 --- a/asm/fldeff_80F9BCC.s +++ b/asm/fldeff_80F9BCC.s @@ -2055,14 +2055,14 @@ _080FACB4: beq _080FACC2 b _080FADCE _080FACC2: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r1, 0x64 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r0, =gUnknown_02021DC4 + bl ConvertIntToDecimalStringN + ldr r0, =gStringVar2 ldr r1, =gUnknown_085EA88B - bl CopyString + bl StringCopy ldr r1, =gUnknown_020375F0 movs r0, 0 strh r0, [r1] @@ -2079,14 +2079,14 @@ _080FACC2: b _080FAD8A .pool _080FAD14: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r1, 0x32 movs r2, 0 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, =gUnknown_02021DC4 + bl ConvertIntToDecimalStringN + ldr r0, =gStringVar2 ldr r1, =gUnknown_085EA890 - bl CopyString + bl StringCopy ldr r1, =gUnknown_020375F0 movs r0, 0 strh r0, [r1] diff --git a/asm/fldeff_emotion.s b/asm/fldeff_emotion.s index 9e76fa1c7..64a099744 100644 --- a/asm/fldeff_emotion.s +++ b/asm/fldeff_emotion.s @@ -287,7 +287,7 @@ sub_80B4808: @ 80B4808 strb r0, [r3] movs r0, 0xFE strb r0, [r3, 0x1] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrb r1, [r0, 0x5] ldrb r2, [r0, 0x4] @@ -311,7 +311,7 @@ _080B4870: strb r0, [r3] movs r0, 0xFE strb r0, [r3, 0x1] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrb r1, [r0, 0x5] ldrb r2, [r0, 0x4] diff --git a/asm/fldeff_strength.s b/asm/fldeff_strength.s index a19bdbd25..738ff3bba 100644 --- a/asm/fldeff_strength.s +++ b/asm/fldeff_strength.s @@ -70,9 +70,9 @@ sub_8145E2C: @ 8145E2C ldr r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl GetMonNickname movs r0, 0 pop {r1} diff --git a/asm/fldeff_teleport.s b/asm/fldeff_teleport.s new file mode 100644 index 000000000..bbca5095f --- /dev/null +++ b/asm/fldeff_teleport.s @@ -0,0 +1,84 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start SetUpFieldMove_Teleport +SetUpFieldMove_Teleport: @ 817C8BC + push {lr} + ldr r0, =gUnknown_02037318 + ldrb r0, [r0, 0x17] + bl is_light_level_1_2_3_or_6 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0817C8D8 + movs r0, 0 + b _0817C8E6 + .pool +_0817C8D8: + ldr r1, =gUnknown_03005DB0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =gUnknown_0203CEEC + ldr r0, =hm_teleport_run_dp02scr + str r0, [r1] + movs r0, 0x1 +_0817C8E6: + pop {r1} + bx r1 + .pool + thumb_func_end SetUpFieldMove_Teleport + + thumb_func_start hm_teleport_run_dp02scr +hm_teleport_run_dp02scr: @ 817C8FC + push {lr} + bl sub_808469C + movs r0, 0x3F + 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 hm_teleport_run_dp02scr + + thumb_func_start sub_817C91C +sub_817C91C: @ 817C91C + 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_817C94C + lsrs r0, r2, 16 + strh r0, [r1, 0x18] + strh r2, [r1, 0x1A] + movs r0, 0x1 + bl SetPlayerAvatarTransitionFlags + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_817C91C + + thumb_func_start sub_817C94C +sub_817C94C: @ 817C94C + push {lr} + movs r0, 0x3F + bl FieldEffectActiveListRemove + bl sub_80B7FC8 + pop {r0} + bx r0 + thumb_func_end sub_817C94C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/front_pic_anim.s b/asm/front_pic_anim.s index 6b9e4b6db..aaa150644 100644 --- a/asm/front_pic_anim.s +++ b/asm/front_pic_anim.s @@ -157,7 +157,7 @@ sub_817F594: @ 817F594 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 bl GetNature lsls r0, 24 @@ -497,7 +497,7 @@ _0817F854: asrs r4, 16 adds r0, r4, 0 movs r1, 0x20 - bl sine + bl Sin movs r1, 0x80 lsls r1, 1 adds r5, r1, 0 @@ -505,7 +505,7 @@ _0817F854: strh r0, [r6, 0x36] adds r0, r4, 0 movs r1, 0x20 - bl cosine + bl Cos adds r0, r5 strh r0, [r6, 0x38] movs r0, 0x36 @@ -562,7 +562,7 @@ _0817F8D4: lsls r0, 16 asrs r0, 16 movs r1, 0x6 - bl sine + bl Sin lsls r1, r5, 24 asrs r1, 24 adds r2, r0, 0 @@ -614,7 +614,7 @@ _0817F936: lsls r0, 16 asrs r0, 16 movs r1, 0x6 - bl sine + bl Sin _0817F946: strh r0, [r4, 0x24] ldrh r0, [r4, 0x32] @@ -679,7 +679,7 @@ _0817F9B2: lsls r0, 16 asrs r0, 16 movs r1, 0x6 - bl sine + bl Sin negs r0, r0 _0817F9C4: strh r0, [r4, 0x26] @@ -761,7 +761,7 @@ _0817FA48: lsls r1, 17 _0817FA56: asrs r1, 16 - bl sine + bl Sin negs r0, r0 _0817FA5E: strh r0, [r4, 0x26] @@ -900,7 +900,7 @@ _0817FB44: lsls r0, 16 asrs r0, 16 movs r1, 0x8 - bl sine + bl Sin negs r0, r0 _0817FB56: strh r0, [r4, 0x26] @@ -964,7 +964,7 @@ _0817FBB0: asrs r4, 16 adds r0, r4, 0 movs r1, 0x20 - bl sine + bl Sin movs r1, 0x80 lsls r1, 1 adds r5, r1, 0 @@ -978,7 +978,7 @@ _0817FBE0: asrs r4, 16 adds r0, r4, 0 movs r1, 0x8 - bl sine + bl Sin movs r1, 0x80 lsls r1, 1 adds r5, r1, 0 @@ -987,7 +987,7 @@ _0817FBE0: adds r0, r4, 0 movs r1, 0x8 _0817FBFA: - bl sine + bl Sin adds r0, r5 strh r0, [r6, 0x38] movs r0, 0x36 @@ -1131,7 +1131,7 @@ _0817FD00: asrs r0, 16 movs r2, 0x3C ldrsh r1, [r4, r2] - bl sine + bl Sin _0817FD12: strh r0, [r4, 0x24] ldrh r0, [r4, 0x2E] @@ -1188,7 +1188,7 @@ _0817FD68: lsls r0, 16 asrs r0, 16 movs r1, 0x3 - bl sine + bl Sin _0817FD78: strh r0, [r4, 0x26] ldrh r0, [r4, 0x2E] @@ -1250,7 +1250,7 @@ _0817FDD4: _0817FDDE: asrs r0, 2 movs r1, 0x8 - bl sine + bl Sin lsls r0, 16 asrs r6, r0, 16 movs r0, 0x32 @@ -1267,7 +1267,7 @@ _0817FDF6: asrs r4, 16 adds r0, r4, 0 adds r1, r6, 0 - bl sine + bl Sin lsls r5, 24 asrs r5, 24 adds r1, r0, 0 @@ -1276,7 +1276,7 @@ _0817FDF6: strh r0, [r7, 0x26] adds r0, r4, 0 adds r1, r6, 0 - bl cosine + bl Cos adds r1, r0, 0 muls r1, r5 adds r0, r1, 0 @@ -1378,7 +1378,7 @@ _0817FED0: asrs r0, 16 movs r1, 0x80 lsls r1, 5 - bl sine + bl Sin strh r0, [r4, 0x3A] movs r2, 0x80 lsls r2, 1 @@ -1558,13 +1558,13 @@ _0818003E: lsls r1, 17 asrs r1, 16 adds r0, r4, 0 - bl cosine + bl Cos negs r0, r0 strh r0, [r5, 0x24] movs r2, 0x8 ldrsh r1, [r6, r2] adds r0, r4, 0 - bl sine + bl Sin ldrh r1, [r6, 0x8] adds r0, r1 strh r0, [r5, 0x26] @@ -1650,7 +1650,7 @@ _0818010C: movs r2, 0x32 ldrsh r0, [r4, r2] movs r1, 0x10 - bl sine + bl Sin adds r2, r0, 0 strh r2, [r4, 0x3A] ldrh r0, [r4, 0x3C] @@ -1724,11 +1724,11 @@ _08180196: lsls r5, r4, 16 asrs r0, r5, 16 movs r1, 0x28 - bl sine + bl Sin adds r4, r0, 0 adds r0, r7, 0 movs r1, 0x10 - bl sine + bl Sin ldr r1, =0xffffff00 adds r0, r1 adds r4, r0 @@ -1739,12 +1739,12 @@ _08180196: _081801C4: adds r0, r7, 0 movs r1, 0x10 - bl sine + bl Sin adds r5, r0, 0 lsls r4, 16 asrs r0, r4, 16 movs r1, 0x28 - bl sine + bl Sin movs r2, 0x80 lsls r2, 1 adds r1, r2, 0 @@ -1754,7 +1754,7 @@ _081801C4: _081801E4: asrs r0, r4, 16 movs r1, 0x10 - bl sine + bl Sin movs r1, 0x80 lsls r1, 1 adds r0, r1 @@ -1837,7 +1837,7 @@ _0818027E: lsls r4, 16 asrs r0, r4, 16 movs r1, 0x10 - bl sine + bl Sin ldr r2, =0xffffff00 adds r1, r2, 0 subs r1, r0 @@ -1848,7 +1848,7 @@ _081802A0: lsls r4, 16 asrs r0, r4, 16 movs r1, 0x10 - bl sine + bl Sin movs r1, 0x80 lsls r1, 1 adds r0, r1 @@ -1857,11 +1857,11 @@ _081802B2: adds r6, r4, 0 adds r0, r7, 0 movs r1, 0x8 - bl sine + bl Sin adds r4, r0, 0 asrs r0, r6, 16 movs r1, 0x28 - bl sine + bl Sin movs r2, 0x80 lsls r2, 1 adds r1, r2, 0 @@ -1950,7 +1950,7 @@ _08180358: .pool _08180370: mov r0, r8 - bl sine + bl Sin strh r0, [r4, 0x26] cmp r7, r6 bne _08180386 @@ -2052,7 +2052,7 @@ _0818042A: lsls r0, r1, 16 asrs r0, 16 movs r1, 0x5 - bl sine + bl Sin negs r0, r0 strh r0, [r4, 0x24] b _0818045E @@ -2123,13 +2123,13 @@ _081804B0: asrs r4, 16 adds r0, r4, 0 movs r1, 0xA - bl sine + bl Sin strh r0, [r6, 0x26] movs r5, 0x80 lsls r5, 1 ldr r1, =0x00000ccc adds r0, r4, 0 - bl sine + bl Sin adds r3, r0, 0 lsls r3, 16 lsrs r3, 16 @@ -2197,13 +2197,13 @@ _08180534: movs r0, 0x2E ldrsh r1, [r6, r0] adds r0, r4, 0 - bl sine + bl Sin strh r0, [r6, 0x26] movs r4, 0x80 lsls r4, 1 adds r0, r5, 0 ldr r1, =0x00000ccc - bl sine + bl Sin adds r3, r0, 0 lsls r3, 16 lsrs r3, 16 @@ -2291,14 +2291,14 @@ _081805EC: ldrsh r1, [r6, r2] lsls r1, 17 asrs r1, 16 - bl sine + bl Sin negs r0, r0 strh r0, [r6, 0x26] movs r4, 0x80 lsls r4, 1 adds r0, r5, 0 ldr r1, =0x00000ccc - bl sine + bl Sin adds r3, r0, 0 lsls r3, 16 lsrs r3, 16 @@ -2382,13 +2382,13 @@ _081806B0: asrs r4, 16 adds r0, r4, 0 movs r1, 0x8 - bl sine + bl Sin strh r0, [r6, 0x24] movs r4, 0x80 lsls r4, 1 adds r0, r5, 0 ldr r1, =0x00000ccc - bl sine + bl Sin adds r3, r0, 0 lsls r3, 16 lsrs r3, 16 @@ -2448,7 +2448,7 @@ _08180760: movs r1, 0x36 ldrsh r0, [r4, r1] movs r1, 0x20 - bl sine + bl Sin movs r2, 0x80 lsls r2, 1 adds r0, r2 @@ -2489,7 +2489,7 @@ _081807B0: movs r1, 0x34 ldrsh r0, [r4, r1] movs r1, 0xA - bl sine + bl Sin negs r0, r0 lsls r1, r6, 16 asrs r1, 16 @@ -2498,7 +2498,7 @@ _081807B0: movs r2, 0x36 ldrsh r0, [r4, r2] movs r1, 0x20 - bl sine + bl Sin movs r2, 0x80 lsls r2, 1 adds r1, r2, 0 @@ -2578,7 +2578,7 @@ _08180868: movs r1, 0x36 ldrsh r0, [r5, r1] movs r1, 0x20 - bl sine + bl Sin movs r2, 0x80 lsls r2, 1 adds r1, r2, 0 @@ -2605,7 +2605,7 @@ _08180894: movs r1, 0x36 ldrsh r0, [r5, r1] movs r1, 0x30 - bl sine + bl Sin adds r1, r0, 0 movs r2, 0x80 lsls r2, 1 @@ -2746,7 +2746,7 @@ _081809B0: lsls r0, 16 asrs r0, 16 movs r1, 0xA - bl sine + bl Sin negs r0, r0 strh r0, [r4, 0x26] mov r3, r10 @@ -2879,7 +2879,7 @@ _08180ACC: movs r2, 0x32 ldrsh r0, [r4, r2] movs r1, 0xC - bl sine + bl Sin adds r2, r0, 0 strh r2, [r4, 0x3A] ldrh r0, [r4, 0x3C] @@ -2932,7 +2932,7 @@ _08180B34: movs r2, 0x32 ldrsh r0, [r4, r2] movs r1, 0xC - bl sine + bl Sin adds r2, r0, 0 strh r2, [r4, 0x3A] ldrh r0, [r4, 0x3C] @@ -2985,7 +2985,7 @@ _08180B98: movs r2, 0x32 ldrsh r0, [r4, r2] movs r1, 0xC - bl sine + bl Sin adds r2, r0, 0 strh r2, [r4, 0x3A] ldrh r0, [r4, 0x3C] @@ -3038,7 +3038,7 @@ _08180C04: movs r2, 0x32 ldrsh r0, [r4, r2] movs r1, 0xC - bl sine + bl Sin adds r2, r0, 0 strh r2, [r4, 0x3A] ldrh r0, [r4, 0x3C] @@ -3091,7 +3091,7 @@ _08180C70: movs r2, 0x32 ldrsh r0, [r4, r2] movs r1, 0xC - bl sine + bl Sin adds r2, r0, 0 strh r2, [r4, 0x3A] ldrh r0, [r4, 0x3C] @@ -3407,13 +3407,13 @@ sub_8180ED0: @ 8180ED0 movs r1, 0x36 ldrsh r0, [r4, r1] movs r1, 0x10 - bl cosine + bl Cos subs r0, 0x8 strh r0, [r4, 0x24] movs r1, 0x36 ldrsh r0, [r4, r1] movs r1, 0x10 - bl sine + bl Sin subs r0, 0x8 strh r0, [r4, 0x26] movs r1, 0x36 @@ -3462,14 +3462,14 @@ _08180F44: movs r1, 0x32 ldrsh r0, [r4, r1] movs r1, 0x5 - bl cosine + bl Cos subs r0, 0x4 movs r5, 0 strh r0, [r4, 0x24] movs r2, 0x32 ldrsh r0, [r4, r2] movs r1, 0x5 - bl sine + bl Sin negs r0, r0 adds r0, 0x4 strh r0, [r4, 0x26] @@ -3619,12 +3619,12 @@ sub_8181068: @ 8181068 movs r1, 0x32 ldrsh r0, [r4, r1] movs r1, 0x16 - bl cosine + bl Cos strh r0, [r4, 0x24] movs r1, 0x32 ldrsh r0, [r4, r1] movs r1, 0x16 - bl sine + bl Sin negs r0, r0 strh r0, [r4, 0x26] movs r0, 0x32 @@ -4010,7 +4010,7 @@ sub_8181370: @ 8181370 movs r1, 0x3A ldrsh r0, [r4, r1] movs r1, 0x10 - bl sine + bl Sin negs r0, r0 strh r0, [r4, 0x24] movs r1, 0x3A @@ -4019,7 +4019,7 @@ sub_8181370: @ 8181370 movs r1, 0xFF ands r0, r1 movs r1, 0x8 - bl sine + bl Sin negs r0, r0 strh r0, [r4, 0x26] movs r1, 0x3A @@ -4243,14 +4243,14 @@ _0818154C: asrs r4, 16 adds r0, r4, 0 movs r1, 0xA - bl sine + bl Sin negs r0, r0 strh r0, [r6, 0x24] movs r5, 0x80 lsls r5, 1 ldr r1, =0x00000ccc adds r0, r4, 0 - bl sine + bl Sin adds r3, r0, 0 lsls r3, 16 lsrs r3, 16 @@ -4364,14 +4364,14 @@ _0818164C: asrs r4, 16 adds r0, r4, 0 movs r1, 0xA - bl sine + bl Sin negs r0, r0 strh r0, [r6, 0x24] movs r5, 0x80 lsls r5, 1 ldr r1, =0x00000ccc adds r0, r4, 0 - bl sine + bl Sin adds r3, r0, 0 negs r3, r3 lsls r3, 16 @@ -4455,7 +4455,7 @@ sub_8181708: @ 8181708 ldrsh r0, [r4, r1] movs r2, 0x3A ldrsh r1, [r4, r2] - bl cosine + bl Cos ldrh r1, [r4, 0x3A] adds r0, r1 strh r0, [r4, 0x24] @@ -4463,7 +4463,7 @@ sub_8181708: @ 8181708 ldrsh r0, [r4, r2] movs r2, 0x3A ldrsh r1, [r4, r2] - bl sine + bl Sin negs r0, r0 strh r0, [r4, 0x26] movs r2, 0x80 @@ -4528,7 +4528,7 @@ sub_8181794: @ 8181794 ldrsh r0, [r4, r1] movs r2, 0x3A ldrsh r1, [r4, r2] - bl cosine + bl Cos ldrh r1, [r4, 0x3A] adds r0, r1 strh r0, [r4, 0x24] @@ -4536,7 +4536,7 @@ sub_8181794: @ 8181794 ldrsh r0, [r4, r2] movs r2, 0x3A ldrsh r1, [r4, r2] - bl sine + bl Sin negs r0, r0 strh r0, [r4, 0x26] movs r5, 0x80 @@ -4614,17 +4614,17 @@ _0818184A: movs r4, 0x80 lsls r4, 1 adds r1, r4, 0 - bl sine + bl Sin strh r0, [r5, 0x3C] movs r3, 0x36 ldrsh r0, [r5, r3] movs r1, 0x10 - bl sine + bl Sin strh r0, [r5, 0x26] movs r1, 0x36 ldrsh r0, [r5, r1] movs r1, 0x20 - bl sine + bl Sin adds r1, r0, 0 strh r1, [r5, 0x3A] subs r1, r4, r1 @@ -4651,18 +4651,18 @@ _081818A2: movs r1, 0x36 ldrsh r0, [r5, r1] movs r1, 0x20 - bl sine + bl Sin strh r0, [r5, 0x3C] movs r3, 0x36 ldrsh r0, [r5, r3] movs r1, 0x8 - bl sine + bl Sin negs r0, r0 strh r0, [r5, 0x26] movs r1, 0x36 ldrsh r0, [r5, r1] movs r1, 0x80 - bl sine + bl Sin adds r1, r0, 0 strh r1, [r5, 0x3A] movs r3, 0x80 @@ -4879,7 +4879,7 @@ _08181A50: lsls r0, 16 asrs r0, 16 movs r1, 0x8 - bl sine + bl Sin negs r0, r0 _08181A62: strh r0, [r5, 0x26] @@ -4983,7 +4983,7 @@ _08181B26: lsls r0, r1, 16 asrs r0, 16 movs r1, 0x8 - bl sine + bl Sin negs r0, r0 strh r0, [r4, 0x26] ldrh r0, [r4, 0x32] @@ -5024,7 +5024,7 @@ _08181B7C: movs r2, 0x36 ldrsh r0, [r4, r2] movs r1, 0x40 - bl sine + bl Sin movs r1, 0x80 lsls r1, 1 adds r6, r1, 0 @@ -5071,7 +5071,7 @@ _08181BD6: movs r1, 0x34 ldrsh r0, [r4, r1] movs r1, 0x14 - bl sine + bl Sin negs r0, r0 lsls r1, r5, 16 asrs r1, 16 @@ -5080,7 +5080,7 @@ _08181BD6: movs r2, 0x36 ldrsh r0, [r4, r2] movs r1, 0x20 - bl sine + bl Sin movs r2, 0x80 lsls r2, 1 adds r1, r2, 0 @@ -5188,7 +5188,7 @@ _08181CBC: lsls r0, r2, 16 asrs r0, 16 movs r1, 0x8 - bl sine + bl Sin negs r0, r0 _08181CD0: strh r0, [r4, 0x26] @@ -5264,13 +5264,13 @@ _08181D60: movs r1, 0x3C ldrsh r0, [r4, r1] movs r1, 0x10 - bl sine + bl Sin negs r0, r0 strh r0, [r4, 0x24] movs r3, 0x3C ldrsh r0, [r4, r3] movs r1, 0x20 - bl sine + bl Sin adds r3, r0, 0 movs r2, 0x80 lsls r2, 1 @@ -5365,7 +5365,7 @@ _08181E34: movs r1, 0x3C ldrsh r0, [r4, r1] movs r1, 0x10 - bl sine + bl Sin negs r0, r0 strh r0, [r4, 0x24] movs r0, 0x3C @@ -5381,13 +5381,13 @@ _08181E4E: lsls r0, 16 asrs r0, 16 movs r1, 0x10 - bl sine + bl Sin negs r0, r0 strh r0, [r4, 0x26] movs r1, 0x3C ldrsh r0, [r4, r1] movs r1, 0x20 - bl sine + bl Sin adds r3, r0, 0 movs r2, 0x80 lsls r2, 1 @@ -5557,7 +5557,7 @@ _08181F94: lsls r0, 16 asrs r0, 16 movs r1, 0x4 - bl sine + bl Sin negs r0, r0 strh r0, [r4, 0x26] ldrh r0, [r4, 0x32] @@ -5598,7 +5598,7 @@ _08181FEC: lsls r0, 17 asrs r0, 16 movs r1, 0x10 - bl sine + bl Sin negs r0, r0 strh r0, [r4, 0x24] _08181FFE: @@ -5666,7 +5666,7 @@ _08182072: lsls r0, 16 asrs r0, 16 movs r1, 0x8 - bl sine + bl Sin negs r0, r0 strh r0, [r4, 0x24] movs r2, 0x3C @@ -5682,7 +5682,7 @@ _08182092: lsls r0, 16 asrs r0, 16 movs r1, 0x8 - bl sine + bl Sin negs r0, r0 strh r0, [r4, 0x26] _081820A6: @@ -5699,7 +5699,7 @@ _081820B2: lsls r0, 16 asrs r0, 16 movs r1, 0x10 - bl sine + bl Sin adds r3, r0, 0 movs r2, 0x80 lsls r2, 1 @@ -5760,12 +5760,12 @@ _0818212C: movs r1, 0x3C ldrsh r0, [r4, r1] movs r1, 0x8 - bl sine + bl Sin strh r0, [r4, 0x24] movs r2, 0x3C ldrsh r0, [r4, r2] movs r1, 0x8 - bl sine + bl Sin negs r0, r0 strh r0, [r4, 0x26] _0818214A: @@ -5807,12 +5807,12 @@ _0818218C: movs r1, 0x3C ldrsh r0, [r4, r1] movs r1, 0x8 - bl sine + bl Sin strh r0, [r4, 0x24] movs r2, 0x3C ldrsh r0, [r4, r2] movs r1, 0x8 - bl sine + bl Sin negs r0, r0 strh r0, [r4, 0x26] _081821AA: @@ -5855,12 +5855,12 @@ _081821F0: movs r1, 0x3C ldrsh r0, [r4, r1] movs r1, 0x8 - bl sine + bl Sin strh r0, [r4, 0x24] movs r1, 0x3C ldrsh r0, [r4, r1] movs r1, 0x8 - bl sine + bl Sin negs r0, r0 strh r0, [r4, 0x26] ldrh r0, [r4, 0x3C] @@ -5918,12 +5918,12 @@ _08182270: movs r1, 0x3C ldrsh r0, [r4, r1] movs r1, 0x8 - bl sine + bl Sin strh r0, [r4, 0x24] movs r2, 0x3C ldrsh r0, [r4, r2] movs r1, 0x8 - bl sine + bl Sin negs r0, r0 strh r0, [r4, 0x26] _0818228E: @@ -5998,7 +5998,7 @@ _0818230C: lsls r0, 16 asrs r0, 16 movs r1, 0x10 - bl sine + bl Sin lsls r1, r5, 24 asrs r1, 24 adds r2, r0, 0 @@ -6022,7 +6022,7 @@ _0818233C: lsls r0, 16 asrs r0, 16 movs r1, 0x10 - bl sine + bl Sin lsls r0, 16 asrs r0, 16 negs r0, r0 @@ -6085,7 +6085,7 @@ _08182392: lsls r0, 16 asrs r0, 16 movs r1, 0x40 - bl sine + bl Sin movs r1, 0x80 lsls r1, 1 adds r2, r1, 0 @@ -6124,7 +6124,7 @@ _08182410: movs r2, 0x3C ldrsh r0, [r4, r2] movs r1, 0x40 - bl cosine + bl Cos lsls r0, 16 lsrs r3, r0, 16 b _08182474 @@ -6133,7 +6133,7 @@ _08182424: movs r1, 0x3C ldrsh r0, [r4, r1] movs r1, 0x40 - bl sine + bl Sin lsls r0, 16 lsrs r3, r0, 16 movs r2, 0x3C @@ -6245,7 +6245,7 @@ _081824F4: lsls r0, 16 asrs r0, 16 movs r1, 0x8 - bl sine + bl Sin strh r0, [r4, 0x26] ldrh r0, [r4, 0x3C] adds r0, 0x8 @@ -6263,7 +6263,7 @@ _08182518: lsls r0, 16 asrs r0, 16 movs r1, 0x60 - bl sine + bl Sin adds r2, r0, 0 movs r1, 0x80 lsls r1, 1 @@ -6319,7 +6319,7 @@ _08182590: movs r1, 0x3C ldrsh r0, [r4, r1] movs r1, 0x10 - bl sine + bl Sin strh r0, [r4, 0x26] ldrh r0, [r4, 0x3C] adds r0, 0x4 @@ -6337,7 +6337,7 @@ _081825AE: lsls r0, 17 asrs r0, 16 movs r1, 0x80 - bl sine + bl Sin adds r2, r0, 0 lsls r2, 16 asrs r2, 16 @@ -6393,7 +6393,7 @@ _0818261C: ldrsh r0, [r4, r1] _08182620: movs r1, 0x80 - bl sine + bl Sin lsls r0, 16 lsrs r0, 16 movs r1, 0x80 @@ -6424,7 +6424,7 @@ sub_8182648: @ 8182648 ble _08182672 movs r0, 0 movs r1, 0x80 - bl cosine + bl Cos lsls r0, 16 lsrs r2, r0, 16 movs r0, 0 @@ -6437,7 +6437,7 @@ _08182672: movs r1, 0x3C ldrsh r0, [r4, r1] movs r1, 0x8 - bl sine + bl Sin movs r2, 0x3A ldrsh r1, [r4, r2] lsls r1, 2 @@ -6467,7 +6467,7 @@ _081826A8: lsls r0, 16 asrs r0, 16 movs r1, 0x80 - bl cosine + bl Cos lsls r1, r5, 16 asrs r1, 16 adds r2, r1, 0 @@ -6511,13 +6511,13 @@ sub_81826F8: @ 81826F8 movs r1, 0x3C ldrsh r0, [r4, r1] movs r1, 0x80 - bl cosine + bl Cos lsls r0, 16 lsrs r5, r0, 16 movs r1, 0x3C ldrsh r0, [r4, r1] movs r1, 0xC - bl cosine + bl Cos negs r0, r0 strh r0, [r4, 0x26] movs r1, 0x3C @@ -6592,7 +6592,7 @@ _081827A4: asrs r0, 16 movs r2, 0x36 ldrsh r1, [r4, r2] - bl sine + bl Sin strh r0, [r4, 0x24] ldrh r0, [r4, 0x3A] ldrh r1, [r4, 0x3C] @@ -6611,7 +6611,7 @@ _081827CC: lsls r0, 16 asrs r0, 16 movs r1, 0x60 - bl sine + bl Sin adds r1, r0, 0 lsls r1, 16 movs r0, 0x80 @@ -6696,7 +6696,7 @@ _08182870: asrs r0, 16 movs r2, 0x36 ldrsh r1, [r4, r2] - bl sine + bl Sin strh r0, [r4, 0x24] ldrh r0, [r4, 0x3A] ldrh r1, [r4, 0x3C] @@ -6715,7 +6715,7 @@ _08182898: lsls r0, 17 asrs r0, 16 movs r1, 0x80 - bl sine + bl Sin adds r1, r0, 0 lsls r1, 16 movs r0, 0x80 @@ -6811,7 +6811,7 @@ _08182954: lsls r0, 16 asrs r0, 16 movs r1, 0x8 - bl sine + bl Sin strh r0, [r4, 0x24] ldrh r0, [r4, 0x3C] adds r0, 0x8 @@ -6829,7 +6829,7 @@ _08182978: lsls r0, 16 asrs r0, 16 movs r1, 0x60 - bl sine + bl Sin adds r2, r0, 0 lsls r2, 16 movs r0, 0x80 @@ -6901,7 +6901,7 @@ _08182A04: adds r0, r1 asrs r0, 1 movs r1, 0x10 - bl sine + bl Sin negs r0, r0 strh r0, [r4, 0x24] ldrh r0, [r4, 0x3C] @@ -6923,7 +6923,7 @@ _08182A30: adds r0, r1 asrs r0, 1 movs r1, 0x40 - bl sine + bl Sin adds r2, r0, 0 negs r2, r2 lsls r2, 16 @@ -6993,7 +6993,7 @@ _08182AC4: lsls r0, 16 asrs r0, 16 movs r1, 0x8 - bl sine + bl Sin negs r0, r0 strh r0, [r4, 0x24] ldrh r0, [r4, 0x3C] @@ -7015,7 +7015,7 @@ _08182AEA: adds r0, r1 asrs r0, 1 movs r1, 0x60 - bl sine + bl Sin adds r2, r0, 0 lsls r2, 16 movs r0, 0x80 @@ -7152,7 +7152,7 @@ _08182BEE: lsls r0, 16 asrs r0, 16 movs r1, 0x4 - bl sine + bl Sin negs r0, r0 strh r0, [r4, 0x26] ldrh r0, [r4, 0x32] @@ -7229,13 +7229,13 @@ _08182C8C: movs r2, 0x3C ldrsh r0, [r4, r2] movs r1, 0x8 - bl cosine + bl Cos negs r0, r0 strh r0, [r4, 0x24] movs r5, 0x3C ldrsh r0, [r4, r5] movs r1, 0x8 - bl sine + bl Sin subs r0, 0x8 strh r0, [r4, 0x26] b _08182D12 @@ -7245,13 +7245,13 @@ _08182CAA: lsls r0, 16 asrs r0, 16 movs r1, 0x8 - bl sine + bl Sin adds r0, 0x8 strh r0, [r4, 0x24] movs r1, 0x3C ldrsh r0, [r4, r1] movs r1, 0x8 - bl cosine + bl Cos negs r0, r0 strh r0, [r4, 0x26] b _08182D12 @@ -7259,14 +7259,14 @@ _08182CCC: movs r2, 0x3C ldrsh r0, [r4, r2] movs r1, 0x8 - bl cosine + bl Cos strh r0, [r4, 0x24] ldrh r0, [r4, 0x3C] adds r0, 0x80 lsls r0, 16 asrs r0, 16 movs r1, 0x8 - bl sine + bl Sin adds r0, 0x8 strh r0, [r4, 0x26] b _08182D12 @@ -7274,13 +7274,13 @@ _08182CEC: movs r5, 0x3C ldrsh r0, [r4, r5] movs r1, 0x8 - bl sine + bl Sin subs r0, 0x8 strh r0, [r4, 0x24] movs r1, 0x3C ldrsh r0, [r4, r1] movs r1, 0x8 - bl cosine + bl Cos strh r0, [r4, 0x26] b _08182D12 _08182D08: @@ -7863,7 +7863,7 @@ _0818316A: asrs r0, 16 movs r2, 0x3C ldrsh r1, [r4, r2] - bl sine + bl Sin ldrh r1, [r4, 0x3C] adds r0, r1 _08183180: @@ -8033,7 +8033,7 @@ _081832A4: lsls r0, 16 asrs r0, 16 movs r1, 0x4 - bl sine + bl Sin strh r0, [r4, 0x26] ldrh r0, [r4, 0x32] adds r0, 0x18 @@ -8127,7 +8127,7 @@ _08183358: lsls r4, r2, 16 asrs r0, r4, 16 movs r1, 0x10 - bl sine + bl Sin ldr r2, =0xffffff00 adds r1, r2, 0 subs r1, r0 @@ -8140,7 +8140,7 @@ _0818337C: lsls r4, r2, 16 asrs r0, r4, 16 movs r1, 0x10 - bl sine + bl Sin movs r1, 0x80 lsls r1, 1 adds r0, r1 @@ -8160,11 +8160,11 @@ _08183392: lsls r1, 24 lsrs r1, 24 adds r0, r5, 0 - bl sine + bl Sin adds r5, r0, 0 asrs r0, r7, 16 adds r1, r4, 0 - bl sine + bl Sin movs r1, 0x80 lsls r1, 1 adds r2, r1, 0 @@ -8302,7 +8302,7 @@ _081834AC: lsls r0, r2, 16 asrs r0, 16 adds r1, r7, 0 - bl sine + bl Sin adds r4, r0, 0 mov r5, r8 adds r0, r7, 0 @@ -8312,7 +8312,7 @@ _081834AC: lsls r1, 24 lsrs r1, 23 adds r0, r5, 0 - bl sine + bl Sin ldr r1, =0xffffff00 adds r0, r1 adds r4, r0 @@ -8329,13 +8329,13 @@ _081834F0: lsls r1, 24 lsrs r1, 23 adds r0, r4, 0 - bl sine + bl Sin adds r4, r0, 0 mov r2, r9 lsls r0, r2, 16 asrs r0, 16 adds r1, r7, 0 - bl sine + bl Sin movs r2, 0x80 lsls r2, 1 adds r1, r2, 0 @@ -8447,7 +8447,7 @@ _081835D8: lsls r0, 8 subs r0, r1, r0 adds r1, r7, 0 - bl sine + bl Sin adds r0, r7 strh r0, [r4, 0x26] cmp r9, r6 @@ -8565,7 +8565,7 @@ _081836B0: lsls r0, 16 asrs r0, 16 movs r1, 0x9 - bl sine + bl Sin lsls r1, r5, 24 asrs r1, 24 adds r2, r0, 0 @@ -8619,7 +8619,7 @@ _08183714: lsls r0, 16 asrs r0, 16 movs r1, 0xC - bl sine + bl Sin lsls r1, r5, 24 asrs r1, 24 adds r2, r0, 0 @@ -8801,7 +8801,7 @@ _08183866: mov r8, r2 asrs r0, r2, 16 mov r1, r9 - bl sine + bl Sin adds r4, r0, 0 lsls r6, r5, 16 asrs r5, r6, 16 @@ -8812,7 +8812,7 @@ _08183866: lsls r1, 24 lsrs r1, 23 adds r0, r5, 0 - bl sine + bl Sin ldr r2, =0xffffff00 adds r4, r2 adds r0, r4 @@ -8827,7 +8827,7 @@ _081838B0: mov r8, r2 asrs r0, r2, 16 mov r1, r9 - bl sine + bl Sin adds r6, r0, 0 lsls r5, 16 asrs r4, r5, 16 @@ -8838,7 +8838,7 @@ _081838B0: lsls r1, 24 lsrs r1, 23 adds r0, r4, 0 - bl sine + bl Sin movs r2, 0x80 lsls r2, 1 adds r1, r2, 0 @@ -8852,7 +8852,7 @@ _081838B0: _081838EA: asrs r0, 16 mov r1, r9 - bl sine + bl Sin adds r5, r0, 0 asrs r4, r6, 16 mov r0, r9 @@ -8862,7 +8862,7 @@ _081838EA: lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl sine + bl Sin movs r1, 0x80 lsls r1, 1 adds r2, r1, 0 @@ -9034,7 +9034,7 @@ _08183A3C: lsls r0, 16 asrs r0, 16 movs r1, 0x4 - bl sine + bl Sin strh r0, [r4, 0x26] ldrh r0, [r4, 0x32] adds r0, 0x30 @@ -9160,7 +9160,7 @@ _08183B24: lsls r0, 16 asrs r0, 16 movs r1, 0x4 - bl sine + bl Sin strh r0, [r4, 0x26] ldrh r0, [r4, 0x32] adds r0, 0x40 @@ -9372,7 +9372,7 @@ _08183CC2: adds r0, r1 asrs r0, 1 movs r1, 0x40 - bl sine + bl Sin adds r2, r0, 0 lsls r2, 16 asrs r2, 16 @@ -9808,7 +9808,7 @@ _08183FEA: ldrsh r0, [r4, r1] movs r2, 0x38 ldrsh r1, [r4, r2] - bl sine + bl Sin negs r0, r0 strh r0, [r4, 0x24] movs r3, 0x3C @@ -9828,7 +9828,7 @@ _0818400C: asrs r0, 16 movs r2, 0x36 ldrsh r1, [r4, r2] - bl sine + bl Sin strh r0, [r4, 0x26] lsls r0, 16 cmp r0, 0 @@ -9977,7 +9977,7 @@ _08184112: lsls r0, 16 asrs r0, 16 movs r1, 0x8 - bl sine + bl Sin negs r0, r0 b _08184154 _08184126: @@ -9985,7 +9985,7 @@ _08184126: ble _0818414A movs r0, 0x60 movs r1, 0x6 - bl sine + bl Sin adds r4, r0, 0 movs r1, 0x3C ldrsh r0, [r5, r1] @@ -9993,7 +9993,7 @@ _08184126: lsls r0, 17 asrs r0, 16 movs r1, 0x4 - bl sine + bl Sin subs r4, r0 strh r4, [r5, 0x26] b _08184156 @@ -10001,7 +10001,7 @@ _0818414A: movs r2, 0x3C ldrsh r0, [r5, r2] movs r1, 0x6 - bl sine + bl Sin _08184154: strh r0, [r5, 0x26] _08184156: @@ -10012,7 +10012,7 @@ _08184156: asrs r0, 1 movs r2, 0x38 ldrsh r1, [r5, r2] - bl sine + bl Sin negs r0, r0 lsls r0, 16 lsrs r2, r0, 16 @@ -10199,7 +10199,7 @@ sub_8184290: @ 8184290 asrs r0, 16 movs r2, 0x38 ldrsh r1, [r4, r2] - bl sine + bl Sin adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -10474,7 +10474,7 @@ _081844BC: asrs r4, 16 adds r0, r4, 0 movs r1, 0x20 - bl sine + bl Sin movs r1, 0x80 lsls r1, 1 adds r5, r1, 0 @@ -10482,7 +10482,7 @@ _081844BC: strh r0, [r6, 0x36] adds r0, r4, 0 movs r1, 0x20 - bl sine + bl Sin adds r0, r5 strh r0, [r6, 0x38] adds r0, r4, 0 @@ -10493,7 +10493,7 @@ _081844F8: asrs r4, 16 adds r0, r4, 0 movs r1, 0x8 - bl sine + bl Sin movs r2, 0x80 lsls r2, 1 adds r5, r2, 0 @@ -10501,13 +10501,13 @@ _081844F8: strh r0, [r6, 0x36] adds r0, r4, 0 movs r1, 0x8 - bl sine + bl Sin adds r0, r5 strh r0, [r6, 0x38] adds r0, r4, 0 movs r1, 0x8 _0818451E: - bl sine + bl Sin lsls r0, 24 lsrs r0, 24 lsls r0, 24 @@ -11046,7 +11046,7 @@ _08184904: movs r5, 0x32 ldrsh r0, [r4, r5] movs r1, 0xC - bl sine + bl Sin adds r2, r0, 0 strh r2, [r4, 0x3A] ldrh r0, [r4, 0x3C] @@ -11132,7 +11132,7 @@ _081849A4: lsls r0, 16 asrs r0, 16 movs r1, 0x6 - bl sine + bl Sin lsls r1, r5, 24 asrs r1, 24 adds r2, r1, 0 diff --git a/asm/hall_of_fame.s b/asm/hall_of_fame.s new file mode 100644 index 000000000..8c73e42e5 --- /dev/null +++ b/asm/hall_of_fame.s @@ -0,0 +1,3603 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_817354C +sub_817354C: @ 817354C + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_817354C + + thumb_func_start sub_8173560 +sub_8173560: @ 8173560 + push {lr} + bl RunTasks + bl RunTextPrinters + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_8173560 + + thumb_func_start sub_817357C +sub_817357C: @ 817357C + push {r4,lr} + sub sp, 0x4 + ldr r0, =gMain + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x4 + bls _08173590 + b _08173688 +_08173590: + lsls r0, 2 + ldr r1, =_081735A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081735A4: + .4byte _081735B8 + .4byte _081735E8 + .4byte _081735EE + .4byte _08173620 + .4byte _0817365C +_081735B8: + movs r0, 0 + bl SetVBlankCallback + bl sub_8174EC4 + ldr r4, =gUnknown_0203BCDC + ldr r0, =0x00002014 + bl AllocZeroed + str r0, [r4] + ldr r0, =gMain + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + b _08173688 + .pool +_081735E8: + bl sub_8174F70 + b _08173642 +_081735EE: + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0xE2 + lsls r1, 3 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + bl sub_8174FAC + ldr r0, =gUnknown_0203BCDC + ldr r1, [r0] + movs r0, 0 + strh r0, [r1] + b _08173642 + .pool +_08173620: + bl sub_8175024 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _08173688 + ldr r0, =sub_817354C + bl SetVBlankCallback + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe +_08173642: + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08173688 + .pool +_0817365C: + bl fade_and_return_progress_probably + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08173688 + ldr r0, =sub_8173560 + bl SetMainCallback2 + movs r0, 0xDA + lsls r0, 1 + bl song_play_for_text + movs r0, 0 + b _0817368A + .pool +_08173688: + movs r0, 0x1 +_0817368A: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_817357C + + thumb_func_start sub_8173694 +sub_8173694: @ 8173694 + push {r4,lr} + bl sub_817357C + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081736C4 + ldr r0, =sub_817371C + 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] + ldr r4, =gUnknown_0203BCD8 + movs r0, 0x78 + bl AllocZeroed + str r0, [r4] +_081736C4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8173694 + + thumb_func_start sub_81736D8 +sub_81736D8: @ 81736D8 + push {r4,lr} + bl sub_817357C + lsls r0, 24 + cmp r0, 0 + bne _08173708 + ldr r0, =sub_817371C + 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 r0, 0x1 + strh r0, [r1, 0x8] + ldr r4, =gUnknown_0203BCD8 + movs r0, 0x78 + bl AllocZeroed + str r0, [r4] +_08173708: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81736D8 + + thumb_func_start sub_817371C +sub_817371C: @ 817371C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + 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 r1, 0 + strh r1, [r0, 0xC] + movs r7, 0 + ldr r0, =gUnknown_0203BCD8 + mov r9, r0 +_08173740: + 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 + adds r5, r0, 0 + cmp r5, 0 + beq _0817380C + adds r0, r6, 0 + movs r1, 0x41 + bl GetMonData + mov r1, r9 + ldr r3, [r1] + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 2 + adds r3, r4 + ldr r2, =0x000001ff + adds r1, r2, 0 + ands r0, r1 + ldrh r1, [r3, 0x8] + ldr r5, =0xfffffe00 + adds r2, r5, 0 + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x8] + adds r0, r6, 0 + movs r1, 0x1 + bl GetMonData + mov r2, r9 + ldr r1, [r2] + adds r1, r4 + str r0, [r1] + adds r0, r6, 0 + movs r1, 0 + bl GetMonData + mov r5, r9 + ldr r1, [r5] + adds r1, 0x4 + adds r1, r4 + str r0, [r1] + adds r0, r6, 0 + movs r1, 0x38 + bl GetMonData + ldr r2, [r5] + adds r2, r4 + lsls r0, 1 + ldrb r3, [r2, 0x9] + movs r1, 0x1 + ands r1, r3 + orrs r1, r0 + strb r1, [r2, 0x9] + adds r0, r6, 0 + movs r1, 0x2 + mov r2, sp + bl GetMonData + movs r2, 0 + mov r6, r8 + lsls r5, r6, 2 + ldr r3, =gUnknown_0203BCD8 +_081737CA: + ldr r0, [r3] + adds r1, r2, r4 + adds r0, 0xA + adds r0, r1 + mov r6, sp + adds r1, r6, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x9 + bls _081737CA + ldr r0, =gTasks + mov r2, r8 + adds r1, r5, r2 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0xC] + adds r0, 0x1 + strh r0, [r1, 0xC] + b _08173840 + .pool +_0817380C: + mov r6, r9 + ldr r3, [r6] + lsls r2, r7, 2 + adds r2, r7 + lsls r2, 2 + adds r4, r3, r2 + ldrh r0, [r4, 0x8] + ldr r6, =0xfffffe00 + adds r1, r6, 0 + ands r0, r1 + strh r0, [r4, 0x8] + str r5, [r4] + adds r3, 0x4 + adds r3, r2 + str r5, [r3] + ldrb r1, [r4, 0x9] + movs r0, 0x1 + ands r0, r1 + strb r0, [r4, 0x9] + mov r1, r9 + ldr r0, [r1] + adds r0, r2 + movs r1, 0xFF + strb r1, [r0, 0xA] + mov r2, r8 + lsls r5, r2, 2 +_08173840: + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0x5 + bhi _0817384C + b _08173740 +_0817384C: + ldr r0, =gUnknown_0203BCD4 + movs r3, 0 + str r3, [r0] + ldr r4, =gTasks + mov r6, r8 + adds r1, r5, r6 + lsls r1, 3 + adds r2, r1, r4 + strh r3, [r2, 0xA] + movs r0, 0xFF + strh r0, [r2, 0x10] + movs r7, 0 + adds r3, r4, 0 + adds r3, 0x8 + movs r2, 0xFF +_0817386A: + adds r0, r7, 0x5 + lsls r0, 1 + adds r0, r1 + adds r0, r3 + strh r2, [r0] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0x5 + bls _0817386A + mov r1, r8 + adds r0, r5, r1 + lsls r0, 3 + adds r1, r0, r4 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _081738A4 + ldr r0, =sub_8173A8C + b _081738A6 + .pool +_081738A4: + ldr r0, =sub_81738BC +_081738A6: + str 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_817371C + + thumb_func_start sub_81738BC +sub_81738BC: @ 81738BC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r7, =0x0201c000 + ldr r0, =gUnknown_0203BCE4 + ldrb r0, [r0] + cmp r0, 0 + bne _081738EC + movs r2, 0x80 + lsls r2, 6 + adds r0, r7, 0 + movs r1, 0 + bl memset + b _08173906 + .pool +_081738EC: + movs r0, 0x3 + bl sub_81534D0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08173906 + movs r2, 0x80 + lsls r2, 6 + adds r0, r7, 0 + movs r1, 0 + bl memset +_08173906: + movs r5, 0 + ldrh r1, [r7, 0x8] + ldr r2, =0x000001ff + adds r0, r2, 0 + ands r0, r1 + mov r1, r9 + lsls r1, 2 + mov r8, r1 + cmp r0, 0 + beq _08173930 +_0817391A: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r7, 0x78 + cmp r5, 0x31 + bhi _08173934 + ldrh r1, [r7, 0x8] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _0817391A +_08173930: + cmp r5, 0x31 + bls _08173956 +_08173934: + ldr r4, =0x0201c000 + adds r6, r4, 0 + adds r4, 0x78 + movs r5, 0 + subs r7, 0x78 +_0817393E: + adds r0, r6, 0 + adds r1, r4, 0 + movs r2, 0x78 + bl memcpy + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r6, 0x78 + adds r4, 0x78 + cmp r5, 0x30 + bls _0817393E +_08173956: + ldr r0, =gUnknown_0203BCD8 + ldr r1, [r0] + adds r0, r7, 0 + movs r2, 0x78 + bl memcpy + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + ldr r2, =gUnknown_082C8959 + 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, 0 + movs r1, 0x1 + movs r3, 0 + bl AddTextPrinterParametrized + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r1, =gTasks + mov r0, r8 + add r0, r9 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81739C4 + str r1, [r0] + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81738BC + + thumb_func_start sub_81739C4 +sub_81739C4: @ 81739C4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_03006214 + ldr r0, =sub_81736D8 + str r0, [r1] + movs r0, 0x3 + bl save_game_when_memory_present + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _08173A34 + ldr r0, =gUnknown_030061FC + ldr r0, [r0] + cmp r0, 0 + beq _08173A34 + movs r0, 0x1 + bl UnsetBgTilemapBuffer + movs r0, 0x3 + bl UnsetBgTilemapBuffer + bl FreeAllWindowBuffers + ldr r5, =gUnknown_0203BCDC + ldr r0, [r5] + cmp r0, 0 + beq _08173A06 + bl Free + movs r0, 0 + str r0, [r5] +_08173A06: + ldr r5, =gUnknown_0203BCD8 + ldr r0, [r5] + cmp r0, 0 + beq _08173A16 + bl Free + movs r0, 0 + str r0, [r5] +_08173A16: + adds r0, r4, 0 + bl DestroyTask + b _08173A4C + .pool +_08173A34: + movs r0, 0x37 + bl audio_play + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_8173A5C + str r1, [r0] + movs r1, 0x20 + strh r1, [r0, 0xE] +_08173A4C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81739C4 + + thumb_func_start sub_8173A5C +sub_8173A5C: @ 8173A5C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrh r2, [r1, 0xE] + movs r3, 0xE + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _08173A80 + subs r0, r2, 0x1 + strh r0, [r1, 0xE] + b _08173A84 + .pool +_08173A80: + ldr r0, =sub_8173A8C + str r0, [r1] +_08173A84: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8173A5C + + thumb_func_start sub_8173A8C +sub_8173A8C: @ 8173A8C + 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_8173AA8 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_8173A8C + + thumb_func_start sub_8173AA8 +sub_8173AA8: @ 8173AA8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, =gTasks + mov r2, r8 + lsls r1, r2, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + ldrh r6, [r1, 0xA] + ldr r2, =gUnknown_0203BCD8 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 2 + ldr r2, [r2] + adds r7, r2, r0 + movs r2, 0xC + ldrsh r0, [r1, r2] + cmp r0, 0x3 + ble _08173AEC + ldr r1, =gUnknown_085E53B4 + b _08173AEE + .pool +_08173AEC: + ldr r1, =gUnknown_085E53E4 +_08173AEE: + lsls r2, r6, 3 + adds r0, r2, r1 + ldrh r3, [r0] + adds r0, r1, 0x2 + adds r0, r2, r0 + ldrh r4, [r0] + adds r0, r1, 0x4 + adds r0, r2, r0 + ldrh r0, [r0] + mov r9, r0 + adds r1, 0x6 + adds r2, r1 + ldrh r5, [r2] + ldrh r2, [r7, 0x8] + ldr r0, =0x000001ff + ands r0, r2 + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + bne _08173B20 + lsls r0, r5, 16 + movs r1, 0xA0 + lsls r1, 12 + adds r0, r1 + lsrs r5, r0, 16 +_08173B20: + lsls r0, r2, 23 + lsrs r0, 23 + ldr r1, [r7] + ldr r2, [r7, 0x4] + lsls r3, 16 + asrs r3, 16 + str r3, [sp] + lsls r3, r4, 16 + asrs r3, 16 + str r3, [sp, 0x4] + lsls r3, r6, 24 + lsrs r3, 24 + str r3, [sp, 0x8] + ldr r3, =0x0000ffff + str r3, [sp, 0xC] + movs r3, 0x1 + bl sub_818D3E4 + lsls r0, 24 + lsrs r0, 24 + ldr r4, =gUnknown_02020630 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r3, r2, r4 + movs r1, 0 + mov r12, r1 + mov r1, r9 + strh r1, [r3, 0x30] + strh r5, [r3, 0x32] + mov r1, r12 + strh r1, [r3, 0x2E] + ldrh r1, [r7, 0x8] + lsls r1, 23 + lsrs r1, 23 + strh r1, [r3, 0x3C] + adds r4, 0x1C + adds r2, r4 + ldr r1, =sub_8175120 + str r1, [r2] + ldr r5, =gTasks + adds r1, r6, 0x5 + lsls r1, 1 + mov r2, r8 + lsls r4, r2, 2 + add r4, r8 + lsls r4, 3 + adds r1, r4 + adds r2, r5, 0 + adds r2, 0x8 + adds r1, r2 + strh r0, [r1] + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + adds r4, r5 + ldr r0, =sub_8173BC0 + str r0, [r4] + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8173AA8 + + thumb_func_start sub_8173BC0 +sub_8173BC0: @ 8173BC0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r4, =gTasks + lsls r3, r0, 2 + adds r3, r0 + lsls r3, 3 + adds r5, r3, r4 + ldrh r0, [r5, 0xA] + ldr r2, =gUnknown_0203BCD8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + ldr r2, [r2] + adds r2, r1 + adds r0, 0x5 + lsls r0, 1 + adds r0, r3 + adds r4, 0x8 + adds r0, r4 + movs r3, 0 + ldrsh r1, [r0, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02020630 + adds r3, r0, r1 + ldr r1, [r3, 0x1C] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _08173C1A + ldrb r1, [r3, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r3, 0x1] + adds r0, r2, 0 + movs r1, 0 + movs r2, 0xE + bl sub_8174A88 + movs r0, 0x78 + strh r0, [r5, 0xE] + ldr r0, =sub_8173C34 + str r0, [r5] +_08173C1A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8173BC0 + + thumb_func_start sub_8173C34 +sub_8173C34: @ 8173C34 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r6, r0, 3 + adds r4, r6, r2 + ldrh r3, [r4, 0xA] + ldr r1, =gUnknown_0203BCD8 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 2 + ldr r1, [r1] + adds r1, r0 + mov r9, r1 + ldrh r1, [r4, 0xE] + movs r7, 0xE + ldrsh r0, [r4, r7] + mov r12, r2 + cmp r0, 0 + beq _08173C78 + subs r0, r1, 0x1 + strh r0, [r4, 0xE] + b _08173D10 + .pool +_08173C78: + ldr r2, =gUnknown_0203BCD4 + ldr r0, =gUnknown_02020630 + mov r8, r0 + adds r0, r3, 0x5 + lsls r0, 1 + adds r0, r6 + mov r1, r12 + adds r1, 0x8 + adds r6, r0, r1 + movs r7, 0 + ldrsh r1, [r6, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + movs r1, 0x80 + lsls r1, 9 + lsls r1, r0 + ldr r3, [r2] + orrs r3, r1 + str r3, [r2] + ldrh r2, [r4, 0xA] + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bgt _08173D04 + mov r7, r9 + ldrh r1, [r7, 0x1C] + ldr r0, =0x000001ff + ands r0, r1 + cmp r0, 0 + beq _08173D04 + adds r0, r2, 0x1 + strh r0, [r4, 0xA] + ldr r0, =0x000063b0 + str r0, [sp] + adds r0, r3, 0 + movs r1, 0 + movs r2, 0xC + movs r3, 0xC + bl pal_fade_maybe + movs r0, 0 + ldrsh r1, [r6, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0, 0x5] + ldr r0, =sub_8173AA8 + str r0, [r4] + b _08173D10 + .pool +_08173D04: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + add r0, r12 + ldr r1, =sub_8173D24 + str r1, [r0] +_08173D10: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8173C34 + + thumb_func_start sub_8173D24 +sub_8173D24: @ 8173D24 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0xffff0000 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0 + bl pal_fade_maybe + movs r3, 0 + lsls r1, r4, 2 + adds r0, r1, r4 + lsls r5, r0, 3 + ldr r0, =gTasks + 0x8 + mov r12, r0 + mov r8, r1 + ldr r6, =gUnknown_02020630 + movs r7, 0xD + negs r7, r7 +_08173D52: + adds r0, r3, 0x5 + lsls r0, 1 + adds r0, r5 + mov r2, r12 + adds r1, r0, r2 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0xFF + beq _08173D74 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r2, [r1, 0x5] + adds r0, r7, 0 + ands r0, r2 + strb r0, [r1, 0x5] +_08173D74: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x5 + bls _08173D52 + movs r0, 0 + movs r1, 0xF + bl sub_8174A38 + movs r0, 0x69 + bl audio_play + ldr r1, =gTasks + mov r2, r8 + adds r0, r2, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0xC8 + lsls r1, 1 + strh r1, [r0, 0xE] + ldr r1, =sub_8173DC0 + str r1, [r0] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8173D24 + + thumb_func_start sub_8173DC0 +sub_8173DC0: @ 8173DC0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, =gTasks + lsls r4, r6, 2 + adds r0, r4, r6 + lsls r5, r0, 3 + adds r1, r5, r7 + ldrh r2, [r1, 0xE] + movs r3, 0xE + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _08173E04 + subs r2, 0x1 + strh r2, [r1, 0xE] + movs r0, 0x3 + ands r0, r2 + cmp r0, 0 + bne _08173E7E + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x6E + ble _08173E7E + bl sub_81751FC + b _08173E7E + .pool +_08173E04: + movs r3, 0 + mov r9, r4 + ldr r0, =gUnknown_0203BCD4 + mov r10, r0 + adds r4, r5, 0 + adds r7, 0x8 + mov r8, r7 + ldr r7, =gUnknown_02020630 + movs r1, 0xD + negs r1, r1 + mov r12, r1 + movs r5, 0x4 +_08173E1C: + adds r0, r3, 0x5 + lsls r0, 1 + adds r0, r4 + mov r2, r8 + adds r1, r0, r2 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0xFF + beq _08173E40 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x5] + mov r0, r12 + ands r0, r2 + orrs r0, r5 + strb r0, [r1, 0x5] +_08173E40: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x5 + bls _08173E1C + mov r3, r10 + ldr r0, [r3] + ldr r1, =0x000063b0 + str r1, [sp] + movs r1, 0 + movs r2, 0xC + movs r3, 0xC + bl pal_fade_maybe + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r1, =gTasks + mov r2, r9 + adds r0, r2, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0x7 + strh r1, [r0, 0xE] + ldr r1, =sub_8173EA4 + str r1, [r0] +_08173E7E: + 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_8173DC0 + + thumb_func_start sub_8173EA4 +sub_8173EA4: @ 8173EA4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrh r2, [r1, 0xE] + movs r3, 0xE + ldrsh r0, [r1, r3] + cmp r0, 0xF + ble _08173ECC + ldr r0, =sub_8173EE4 + str r0, [r1] + b _08173EDE + .pool +_08173ECC: + adds r0, r2, 0x1 + strh r0, [r1, 0xE] + movs r0, 0xE + ldrsh r1, [r1, r0] + lsls r1, 24 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg +_08173EDE: + pop {r0} + bx r0 + thumb_func_end sub_8173EA4 + + thumb_func_start sub_8173EE4 +sub_8173EE4: @ 8173EE4 + push {r4-r6,lr} + sub sp, 0x8 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x3 + bl ShowBg + ldr r6, =gSaveBlock2Ptr + ldr r0, [r6] + ldrb r0, [r0, 0x8] + movs r1, 0x1 + bl sub_818D97C + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + str r1, [sp] + ldr r1, =0x0000ffff + str r1, [sp, 0x4] + movs r1, 0x1 + movs r2, 0x78 + movs r3, 0x48 + bl sub_818D8AC + ldr r1, =gTasks + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r1 + strh r0, [r4, 0x10] + ldr r0, =gUnknown_085E5380 + bl AddWindow + ldr r0, [r6] + ldrb r1, [r0, 0x14] + lsrs r1, 3 + ldr r2, =0x0000021d + movs r0, 0x1 + movs r3, 0xD0 + bl sub_80987D4 + movs r0, 0x1 + bl stdpal_get + movs r1, 0xE0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0x78 + strh r0, [r4, 0xE] + ldr r0, =sub_8173F84 + str r0, [r4] + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8173EE4 + + thumb_func_start sub_8173F84 +sub_8173F84: @ 8173F84 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0xE] + movs r1, 0xE + ldrsh r5, [r4, r1] + cmp r5, 0 + beq _08173FAC + subs r0, 0x1 + strh r0, [r4, 0xE] + b _08174018 + .pool +_08173FAC: + ldr r2, =gUnknown_02020630 + movs r3, 0x10 + ldrsh r1, [r4, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + ldrh r2, [r1, 0x20] + movs r3, 0x20 + ldrsh r0, [r1, r3] + cmp r0, 0xC0 + beq _08173FD0 + adds r0, r2, 0x1 + strh r0, [r1, 0x20] + b _08174018 + .pool +_08173FD0: + 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, 0x2 + bl sub_8174C98 + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + ldr r2, =gUnknown_085E8C14 + str r5, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + movs r3, 0 + bl AddTextPrinterParametrized + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =sub_8174028 + str r0, [r4] +_08174018: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8173F84 + + thumb_func_start sub_8174028 +sub_8174028: @ 8174028 + 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 _0817404E + movs r0, 0x4 + bl play_sound_effect + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_8174060 + str r0, [r1] +_0817404E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174028 + + thumb_func_start sub_8174060 +sub_8174060: @ 8174060 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_02037B14 + ldr r1, =gUnknown_02037714 + movs r2, 0x80 + lsls r2, 2 + bl CpuSet + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r1, 0x8 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81740B0 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174060 + + thumb_func_start sub_81740B0 +sub_81740B0: @ 81740B0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08174164 + lsls r0, r7, 2 + mov r8, r0 + ldr r1, =gTasks + adds r0, r7 + lsls r0, 3 + adds r1, 0x12 + adds r5, r0, r1 + ldr r2, =gUnknown_02020630 + mov r9, r2 + movs r6, 0x5 +_081740DC: + ldrb r4, [r5] + cmp r4, 0xFF + beq _081740FA + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + add r0, r9 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r0, r4, 0 + bl sub_818D820 +_081740FA: + adds r5, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _081740DC + ldr r0, =gTasks + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x10] + bl sub_818D8F0 + movs r0, 0 + bl HideBg + movs r0, 0x1 + bl HideBg + movs r0, 0x3 + bl HideBg + bl FreeAllWindowBuffers + movs r0, 0x1 + bl UnsetBgTilemapBuffer + movs r0, 0x3 + bl UnsetBgTilemapBuffer + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + adds r0, r7, 0 + bl DestroyTask + ldr r4, =gUnknown_0203BCDC + ldr r0, [r4] + cmp r0, 0 + beq _08174150 + bl Free + movs r0, 0 + str r0, [r4] +_08174150: + ldr r4, =gUnknown_0203BCD8 + ldr r0, [r4] + cmp r0, 0 + beq _08174160 + bl Free + movs r0, 0 + str r0, [r4] +_08174160: + bl sub_8174184 +_08174164: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81740B0 + + thumb_func_start sub_8174184 +sub_8174184: @ 8174184 + push {lr} + ldr r0, =sub_8175620 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174184 + + thumb_func_start sub_8174194 +sub_8174194: @ 8174194 + push {r4,lr} + ldr r0, =gMain + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x5 + bhi _081741D0 + lsls r0, 2 + ldr r1, =_081741B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081741B8: + .4byte _081741D0 + .4byte _08174200 + .4byte _08174214 + .4byte _08174240 + .4byte _08174280 + .4byte _081742B0 +_081741D0: + movs r0, 0 + bl SetVBlankCallback + bl sub_8174EC4 + ldr r4, =gUnknown_0203BCDC + ldr r0, =0x00002014 + bl AllocZeroed + str r0, [r4] + ldr r0, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0] + b _08174308 + .pool +_08174200: + bl sub_8174F70 + ldr r1, =gMain + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _081742A2 + .pool +_08174214: + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + bl sub_8174FAC + ldr r1, =gMain + movs r4, 0x87 + lsls r4, 3 + adds r1, r4 + b _081742A2 + .pool +_08174240: + bl sub_8175024 + lsls r0, 24 + cmp r0, 0 + bne _08174308 + ldr r1, =0x0201c000 + ldr r0, =gUnknown_085E56D4 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r3} + stm r1!, {r2,r3} + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl sub_80F9BCC + ldr r0, =sub_817354C + bl SetVBlankCallback + ldr r1, =gMain + movs r4, 0x87 + lsls r4, 3 + adds r1, r4 + b _081742A2 + .pool +_08174280: + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + bl sub_80F9C1C + lsls r0, 24 + cmp r0, 0 + bne _08174308 + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_081742A2: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08174308 + .pool +_081742B0: + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0xE2 + lsls r1, 3 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + ldr r0, =sub_8174324 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + movs r2, 0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r4, =gTasks + 0x8 + movs r3, 0xFF +_081742E2: + adds r0, r2, 0x5 + lsls r0, 1 + adds r0, r1 + adds r0, r4 + strh r3, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _081742E2 + ldr r4, =gUnknown_0203BCD8 + movs r0, 0x80 + lsls r0, 6 + bl AllocZeroed + str r0, [r4] + ldr r0, =sub_8173560 + bl SetMainCallback2 +_08174308: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174194 + + thumb_func_start sub_8174324 +sub_8174324: @ 8174324 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x00000226 + str r0, [sp] + movs r0, 0 + movs r1, 0x1E + movs r2, 0 + movs r3, 0xC + bl sub_81980F0 + movs r0, 0x3 + bl sub_81534D0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08174364 + ldr r0, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81749A0 + b _081743DA + .pool +_08174364: + ldr r0, =0x0201c000 + ldr r4, =gUnknown_0203BCD8 + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 5 + bl CpuSet + ldr r4, [r4] + movs r2, 0 + ldrh r1, [r4, 0x8] + ldr r3, =0x000001ff + adds r0, r3, 0 + ands r0, r1 + lsls r5, r6, 2 + cmp r0, 0 + beq _0817439A +_08174384: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + adds r4, 0x78 + cmp r2, 0x31 + bhi _081743BC + ldrh r1, [r4, 0x8] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _08174384 +_0817439A: + cmp r2, 0x31 + bhi _081743BC + ldr r0, =gTasks + adds r1, r5, r6 + lsls r1, 3 + adds r1, r0 + subs r0, r2, 0x1 + b _081743C6 + .pool +_081743BC: + ldr r0, =gTasks + adds r1, r5, r6 + lsls r1, 3 + adds r1, r0 + movs r0, 0x31 +_081743C6: + strh r0, [r1, 0x8] + movs r0, 0xA + bl sub_80847F8 + ldr r2, =gTasks + adds r1, r5, r6 + lsls r1, 3 + adds r1, r2 + strh r0, [r1, 0xA] + ldr r0, =sub_81743EC +_081743DA: + str r0, [r1] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174324 + + thumb_func_start sub_81743EC +sub_81743EC: @ 81743EC + 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 + mov r8, r0 + ldr r0, =gUnknown_0203BCD8 + ldr r3, [r0] + movs r5, 0 + ldr r1, =gTasks + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r4, 0x8 + ldrsh r0, [r0, r4] + adds r4, r1, 0 + ldr r2, =gUnknown_0203BCD4 + cmp r5, r0 + bge _0817442A + adds r1, r0, 0 +_0817441E: + adds r3, 0x78 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r1 + blt _0817441E +_0817442A: + adds r6, r3, 0 + movs r0, 0 + str r0, [r2] + mov r5, r8 + lsls r2, r5, 2 + adds r1, r2, r5 + lsls r1, 3 + adds r1, r4 + strh r0, [r1, 0xC] + strh r0, [r1, 0x10] + movs r5, 0 + str r2, [sp, 0x14] + ldr r4, =0x000001ff + adds r2, r1, 0 +_08174446: + ldrh r1, [r6, 0x8] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _08174456 + ldrh r0, [r2, 0x10] + adds r0, 0x1 + strh r0, [r2, 0x10] +_08174456: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r6, 0x14 + cmp r5, 0x5 + bls _08174446 + adds r6, r3, 0 + movs r5, 0 + ldr r1, =gTasks + ldr r0, [sp, 0x14] + add r0, r8 + lsls r0, 3 + mov r9, r0 + adds r0, r1 + str r0, [sp, 0x10] + ldr r1, =0x000001ff + mov r10, r1 +_08174478: + ldrh r0, [r6, 0x8] + mov r1, r10 + ands r1, r0 + adds r7, r0, 0 + cmp r1, 0 + beq _08174540 + ldr r2, [sp, 0x10] + movs r4, 0x10 + ldrsh r0, [r2, r4] + cmp r0, 0x3 + ble _081744B8 + lsls r1, r5, 3 + ldr r0, =gUnknown_085E53B4 + adds r0, 0x4 + adds r0, r1, r0 + ldrh r3, [r0] + ldr r0, =gUnknown_085E53BA + adds r1, r0 + ldrh r4, [r1] + b _081744C8 + .pool +_081744B8: + ldr r0, =gUnknown_085E53E4 + lsls r2, r5, 3 + adds r1, r0, 0x4 + adds r1, r2, r1 + ldrh r3, [r1] + adds r0, 0x6 + adds r2, r0 + ldrh r4, [r2] +_081744C8: + mov r1, r10 + ands r1, r7 + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + bne _081744DE + lsls r0, r4, 16 + movs r1, 0xA0 + lsls r1, 12 + adds r0, r1 + lsrs r4, r0, 16 +_081744DE: + lsls r0, r7, 23 + lsrs r0, 23 + ldr r1, [r6] + ldr r2, [r6, 0x4] + lsls r3, 16 + asrs r3, 16 + str r3, [sp] + lsls r3, r4, 16 + asrs r3, 16 + str r3, [sp, 0x4] + lsls r3, r5, 24 + lsrs r3, 24 + str r3, [sp, 0x8] + ldr r3, =0x0000ffff + str r3, [sp, 0xC] + movs r3, 0x1 + bl sub_818D7D8 + lsls r0, 16 + lsrs r0, 16 + ldr r2, =gUnknown_02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r3, [r1, 0x5] + movs r4, 0xD + negs r4, r4 + adds r2, r4, 0 + ands r3, r2 + movs r2, 0x4 + orrs r3, r2 + strb r3, [r1, 0x5] + adds r1, r5, 0x5 + lsls r1, 1 + add r1, r9 + ldr r2, =gTasks + 0x8 + adds r1, r2 + strh r0, [r1] + b _0817454E + .pool +_08174540: + adds r0, r5, 0x5 + lsls r0, 1 + add r0, r9 + ldr r4, =gTasks + 0x8 + adds r0, r4 + movs r1, 0xFF + strh r1, [r0] +_0817454E: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r6, 0x14 + cmp r5, 0x5 + bls _08174478 + ldr r0, =0xffff0000 + ldr r2, =0x000063b0 + movs r1, 0xC + bl sub_80A2A20 + ldr r0, =gStringVar1 + ldr r1, =gTasks + ldr r4, [sp, 0x14] + add r4, r8 + lsls r4, 3 + adds r4, r1 + movs r5, 0xA + ldrsh r1, [r4, r5] + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r5, =gStringVar4 + ldr r1, =gUnknown_085E8C00 + adds r0, r5, 0 + bl StringExpandPlaceholders + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bgt _081745C0 + ldr r1, =gUnknown_085E8574 + movs r0, 0x1 + str r0, [sp] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0 + bl sub_8198204 + b _081745D0 + .pool +_081745C0: + ldr r1, =gUnknown_085E855C + movs r0, 0x1 + str r0, [sp] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0 + bl sub_8198204 +_081745D0: + ldr r0, =gTasks + ldr r1, [sp, 0x14] + add r1, r8 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81745FC + str r0, [r1] + 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_81743EC + + thumb_func_start sub_81745FC +sub_81745FC: @ 81745FC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_0203BCD8 + ldr r5, [r0] + movs r3, 0 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + cmp r3, r0 + bge _08174630 + adds r1, r0, 0 +_08174624: + adds r5, 0x78 + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r1 + blt _08174624 +_08174630: + movs r3, 0 + lsls r7, r4, 2 + adds r0, r7, r4 + lsls r6, r0, 3 + ldr r0, =gTasks + 0x8 + mov r10, r0 + ldr r1, =gUnknown_02020630 + mov r8, r1 + movs r2, 0xD + negs r2, r2 + mov r9, r2 + movs r0, 0x4 + mov r12, r0 +_0817464A: + adds r0, r3, 0x5 + lsls r0, 1 + adds r0, r6 + add r0, r10 + ldrh r1, [r0] + cmp r1, 0xFF + beq _0817466C + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r2, [r0, 0x5] + mov r1, r9 + ands r1, r2 + mov r2, r12 + orrs r1, r2 + strb r1, [r0, 0x5] +_0817466C: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x5 + bls _0817464A + adds r1, r7, r4 + lsls r1, 3 + ldr r0, =gTasks + adds r6, r1, r0 + movs r2, 0xC + ldrsh r0, [r6, r2] + adds r0, 0x5 + lsls r0, 1 + adds r0, r1 + ldr r1, =gTasks + adds r1, 0x8 + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02020630 + adds r0, r1 + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + strb r1, [r0, 0x5] + lsrs r1, 4 + movs r0, 0x80 + lsls r0, 9 + lsls r0, r1 + ldr r1, =0xffff0000 + eors r0, r1 + ldr r2, =gUnknown_0203BCD4 + str r0, [r2] + ldr r2, =0x000063b0 + movs r1, 0xC + bl sub_80A2A5C + movs r0, 0xC + ldrsh r1, [r6, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r4, r5, r0 + ldrh r1, [r4, 0x8] + ldr r0, =0x000001ff + ands r0, r1 + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _081746E6 + bl sub_80A369C + ldrh r0, [r4, 0x8] + lsls r0, 23 + lsrs r0, 23 + movs r1, 0 + bl cry_related +_081746E6: + adds r0, r4, 0 + movs r1, 0 + movs r2, 0xE + bl sub_8174A88 + ldr r0, =sub_8174728 + 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_81745FC + + thumb_func_start sub_8174728 +sub_8174728: @ 8174728 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gMain + ldrh r2, [r1, 0x2E] + movs r0, 0x1 + ands r0, r2 + adds r3, r1, 0 + cmp r0, 0 + beq _081747E4 + ldr r0, =gTasks + mov r12, r0 + lsls r0, r6, 2 + adds r1, r0, r6 + lsls r3, r1, 3 + mov r1, r12 + adds r4, r3, r1 + ldrh r2, [r4, 0x8] + movs r5, 0x8 + ldrsh r1, [r4, r5] + mov r9, r0 + cmp r1, 0 + beq _081747B8 + subs r0, r2, 0x1 + strh r0, [r4, 0x8] + movs r5, 0 + adds r7, r3, 0 + movs r0, 0x8 + add r0, r12 + mov r8, r0 +_0817476A: + adds r0, r5, 0x5 + lsls r0, 1 + adds r0, r7 + mov r1, r8 + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0xFF + beq _08174782 + bl sub_818D820 + movs r0, 0xFF + strh r0, [r4] +_08174782: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x5 + bls _0817476A + ldr r0, =gTasks + mov r2, r9 + adds r1, r2, r6 + lsls r1, 3 + adds r1, r0 + ldrh r2, [r1, 0xA] + movs r3, 0xA + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _081747A4 + subs r0, r2, 0x1 + strh r0, [r1, 0xA] +_081747A4: + ldr r0, =sub_81743EC + str r0, [r1] + b _08174884 + .pool +_081747B8: + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + beq _081747D2 + bl sub_80A369C + ldr r0, =gMPlay_BGM + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl m4aMPlayVolumeControl +_081747D2: + ldr r0, =sub_8174898 + str r0, [r4] + b _08174884 + .pool +_081747E4: + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _08174828 + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + beq _08174806 + bl sub_80A369C + ldr r0, =gMPlay_BGM + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl m4aMPlayVolumeControl +_08174806: + ldr r0, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_8174898 + str r0, [r1] + b _08174884 + .pool +_08174828: + movs r0, 0x40 + ands r0, r2 + cmp r0, 0 + beq _08174858 + ldr r0, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldrh r2, [r1, 0xC] + movs r4, 0xC + ldrsh r0, [r1, r4] + cmp r0, 0 + beq _08174858 + subs r0, r2, 0x1 + strh r0, [r1, 0xC] + ldr r0, =sub_81745FC + str r0, [r1] + b _08174884 + .pool +_08174858: + ldrh r1, [r3, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08174884 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r2, r0, r1 + movs r5, 0xC + ldrsh r1, [r2, r5] + movs r3, 0x10 + ldrsh r0, [r2, r3] + subs r0, 0x1 + cmp r1, r0 + bge _08174884 + ldrh r0, [r2, 0xC] + adds r0, 0x1 + strh r0, [r2, 0xC] + ldr r0, =sub_81745FC + str r0, [r2] +_08174884: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174728 + + thumb_func_start sub_8174898 +sub_8174898: @ 8174898 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_02037B14 + ldr r1, =gUnknown_02037714 + movs r2, 0x80 + lsls r2, 2 + bl CpuSet + ldr r1, =0x0201c000 + ldr r0, =gUnknown_085E56D4 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3} + stm r1!, {r2,r3} + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl sub_80F9BF4 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81748F0 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174898 + + thumb_func_start sub_81748F0 +sub_81748F0: @ 81748F0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_80F9C30 + lsls r0, 24 + cmp r0, 0 + bne _08174988 + movs r5, 0 + lsls r0, r6, 2 + adds r0, r6 + lsls r7, r0, 3 + ldr r0, =gTasks + 0x8 + mov r8, r0 +_08174910: + adds r0, r5, 0x5 + lsls r0, 1 + adds r0, r7 + mov r1, r8 + adds r4, r0, r1 + ldrh r0, [r4] + cmp r0, 0xFF + beq _08174928 + bl sub_818D820 + movs r0, 0xFF + strh r0, [r4] +_08174928: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _08174910 + movs r0, 0 + bl HideBg + movs r0, 0x1 + bl HideBg + movs r0, 0x3 + bl HideBg + bl sub_8198314 + bl FreeAllWindowBuffers + movs r0, 0x1 + bl UnsetBgTilemapBuffer + movs r0, 0x3 + bl UnsetBgTilemapBuffer + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + adds r0, r6, 0 + bl DestroyTask + ldr r4, =gUnknown_0203BCDC + ldr r0, [r4] + cmp r0, 0 + beq _08174974 + bl Free + movs r0, 0 + str r0, [r4] +_08174974: + ldr r4, =gUnknown_0203BCD8 + ldr r0, [r4] + cmp r0, 0 + beq _08174984 + bl Free + movs r0, 0 + str r0, [r4] +_08174984: + bl sub_8137C3C +_08174988: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81748F0 + + thumb_func_start sub_81749A0 +sub_81749A0: @ 81749A0 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_085E8588 + movs r1, 0x8 + movs r2, 0x1 + bl sub_8198180 + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + ldr r2, =gUnknown_085E8BDC + 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, 0 + movs r1, 0x1 + movs r3, 0 + bl AddTextPrinterParametrized + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_8174A08 + str r1, [r0] + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81749A0 + + thumb_func_start sub_8174A08 +sub_8174A08: @ 8174A08 + 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 + beq _08174A28 + ldr r0, =gTasks + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_8174898 + str r0, [r1] +_08174A28: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174A08 + + thumb_func_start sub_8174A38 +sub_8174A38: @ 8174A38 + push {r4,lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0 + bl PutWindowTilemap + ldr r4, =gUnknown_085E8B3E + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xD0 + bl GetStringCenterAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_085E5388 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x1 + bl box_print + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174A38 + + thumb_func_start sub_8174A88 +sub_8174A88: @ 8174A88 + push {r4-r7,lr} + sub sp, 0x2C + adds r7, r0, 0 + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0 + bl PutWindowTilemap + ldrh r0, [r7, 0x8] + ldr r1, =0x000001ff + ands r1, r0 + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + beq _08174B30 + ldr r1, =gUnknown_085E8C36 + add r0, sp, 0xC + bl StringCopy + adds r6, r0, 0 + ldrh r0, [r7, 0x8] + lsls r0, 23 + lsrs r0, 23 + bl sub_806E3C0 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x0000ffff + cmp r4, r0 + beq _08174B04 + adds r0, r4, 0 + movs r1, 0x64 + bl __divsi3 + subs r0, 0x5F + strb r0, [r6] + adds r6, 0x1 + adds r0, r4, 0 + movs r1, 0x64 + bl __modsi3 + adds r4, r0, 0 + movs r1, 0xA + bl __divsi3 + subs r0, 0x5F + strb r0, [r6] + adds r6, 0x1 + adds r0, r4, 0 + movs r1, 0xA + bl __modsi3 + subs r0, 0x5F + b _08174B0E + .pool +_08174B04: + movs r0, 0xAC + strb r0, [r6] + adds r6, 0x1 + strb r0, [r6] + adds r6, 0x1 +_08174B0E: + strb r0, [r6] + adds r6, 0x1 + movs r0, 0xFF + strb r0, [r6] + ldr r0, =gUnknown_085E5388 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0x10 + movs r3, 0x1 + bl box_print +_08174B30: + adds r1, r7, 0 + adds r1, 0xA + add r0, sp, 0xC + movs r2, 0xA + bl memcpy + add r1, sp, 0xC + movs r0, 0xFF + strb r0, [r1, 0xA] + ldrh r1, [r7, 0x8] + ldr r4, =0x000001ff + adds r0, r4, 0 + ands r0, r1 + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + bne _08174B8C + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0xD0 + bl GetStringCenterAlignXOffset + lsls r2, r0, 24 + lsrs r2, 24 + ldr r0, =gUnknown_085E5388 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + b _08174C82 + .pool +_08174B8C: + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x80 + bl GetStringRightAlignXOffset + lsls r2, r0, 24 + lsrs r2, 24 + ldr r0, =gUnknown_085E5388 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + add r1, sp, 0xC + movs r0, 0xBA + strb r0, [r1] + mov r0, sp + adds r0, 0xD + ldrh r1, [r7, 0x8] + lsls r1, 23 + lsrs r1, 23 + movs r2, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl StringCopy + adds r6, r0, 0 + ldrh r1, [r7, 0x8] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0x20 + beq _08174C0A + cmp r0, 0x1D + beq _08174C0A + lsls r0, r1, 23 + lsrs r0, 23 + ldr r1, [r7, 0x4] + bl pokemon_species_get_gender_info + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08174C00 + cmp r0, 0xFE + beq _08174C04 + b _08174C0A + .pool +_08174C00: + movs r0, 0xB5 + b _08174C06 +_08174C04: + movs r0, 0xB6 +_08174C06: + strb r0, [r6] + adds r6, 0x1 +_08174C0A: + movs r0, 0xFF + strb r0, [r6] + ldr r5, =gUnknown_085E5388 + str r5, [sp] + movs r4, 0x1 + negs r4, r4 + str r4, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0x80 + movs r3, 0x1 + bl box_print + ldr r1, =gUnknown_085E8C3B + add r0, sp, 0xC + bl StringCopy + adds r6, r0, 0 + ldrb r1, [r7, 0x9] + lsrs r1, 1 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + str r5, [sp] + str r4, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0x24 + movs r3, 0x11 + bl box_print + ldr r1, =gUnknown_085E8C4D + add r0, sp, 0xC + bl StringCopy + adds r6, r0, 0 + ldrh r1, [r7] + movs r2, 0x2 + movs r3, 0x5 + bl ConvertIntToDecimalStringN + str r5, [sp] + str r4, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0x68 + movs r3, 0x11 + bl box_print + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram +_08174C82: + add sp, 0x2C + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174A88 + + thumb_func_start sub_8174C98 +sub_8174C98: @ 8174C98 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + movs r0, 0x1 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0x1 + bl PutWindowTilemap + ldr r2, =0x0000021d + movs r0, 0x1 + movs r1, 0 + movs r3, 0xD + bl SetWindowBorderStyle + ldr r0, =gUnknown_085E538C + mov r8, r0 + str r0, [sp] + movs r1, 0x1 + negs r1, r1 + mov r9, r1 + str r1, [sp, 0x4] + ldr r0, =gUnknown_085E8C48 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl box_print + ldr r0, =gSaveBlock2Ptr + mov r10, r0 + ldr r1, [r0] + movs r0, 0x1 + movs r2, 0x70 + bl GetStringRightAlignXOffset + lsls r2, r0, 24 + lsrs r2, 24 + mov r1, r8 + str r1, [sp] + mov r0, r9 + str r0, [sp, 0x4] + mov r1, r10 + ldr r0, [r1] + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + mov r1, r10 + ldr r0, [r1] + ldrb r4, [r0, 0xA] + ldrb r0, [r0, 0xB] + lsls r0, 8 + orrs r4, r0 + mov r0, r8 + str r0, [sp] + movs r7, 0 + str r7, [sp, 0x4] + ldr r0, =gUnknown_085E8C4D + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x11 + bl box_print + add r6, sp, 0xC + ldr r1, =0x000186a0 + adds r0, r4, 0 + bl __modsi3 + ldr r5, =0x00002710 + adds r1, r5, 0 + bl __divsi3 + subs r0, 0x5F + strb r0, [r6] + add r6, sp, 0xC + adds r0, r4, 0 + adds r1, r5, 0 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r5, 0xFA + lsls r5, 2 + adds r1, r5, 0 + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r6, 0x1] + add r6, sp, 0xC + adds r0, r4, 0 + adds r1, r5, 0 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r6, 0x2] + add r5, sp, 0xC + adds r0, r4, 0 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r5, 0x3] + add r5, sp, 0xC + adds r0, r4, 0 + movs r1, 0xA + bl __umodsi3 + adds r0, 0xA1 + strb r0, [r5, 0x4] + add r1, sp, 0xC + movs r0, 0xFF + strb r0, [r1, 0x5] + movs r0, 0x1 + movs r2, 0x70 + bl GetStringRightAlignXOffset + lsls r2, r0, 24 + lsrs r2, 24 + mov r1, r8 + str r1, [sp] + mov r0, r9 + str r0, [sp, 0x4] + add r1, sp, 0xC + str r1, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x11 + bl box_print + mov r0, r8 + str r0, [sp] + mov r1, r9 + str r1, [sp, 0x4] + ldr r0, =gUnknown_085E84CE + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x21 + bl box_print + add r5, sp, 0xC + mov r0, r10 + ldr r4, [r0] + ldrh r0, [r4, 0xE] + movs r1, 0x64 + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r5] + add r5, sp, 0xC + ldrh r0, [r4, 0xE] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r5, 0x1] + add r5, sp, 0xC + ldrh r0, [r4, 0xE] + movs r1, 0xA + bl __umodsi3 + adds r0, 0xA1 + strb r0, [r5, 0x2] + add r0, sp, 0xC + ldrb r0, [r0] + cmp r0, 0xA1 + bne _08174E1E + add r0, sp, 0xC + strb r7, [r0] +_08174E1E: + add r0, sp, 0xC + ldrb r1, [r0] + cmp r1, 0 + bne _08174E30 + ldrb r0, [r0, 0x1] + cmp r0, 0xA1 + bne _08174E30 + add r0, sp, 0xC + strb r1, [r0, 0x8] +_08174E30: + add r1, sp, 0xC + movs r0, 0xF0 + strb r0, [r1, 0x3] + adds r4, r1, 0 + ldr r0, =gSaveBlock2Ptr + ldr r5, [r0] + ldrb r0, [r5, 0x10] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0xA + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r4, 0x4] + add r4, sp, 0xC + ldrb r0, [r5, 0x10] + movs r1, 0xA + bl __umodsi3 + adds r0, 0xA1 + strb r0, [r4, 0x5] + add r1, sp, 0xC + movs r0, 0xFF + strb r0, [r1, 0x6] + movs r0, 0x1 + movs r2, 0x70 + bl GetStringRightAlignXOffset + lsls r2, r0, 24 + lsrs r2, 24 + ldr r0, =gUnknown_085E538C + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + add r1, sp, 0xC + str r1, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x21 + bl box_print + movs r0, 0x1 + movs r1, 0x3 + bl CopyWindowToVram + 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_8174C98 + + thumb_func_start sub_8174EC4 +sub_8174EC4: @ 8174EC4 + 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 +_08174EEA: + 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 _08174EEA + 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] + bl sub_80A1A74 + ldr r0, =gUnknown_085E54E8 + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174EC4 + + thumb_func_start sub_8174F70 +sub_8174F70: @ 8174F70 + push {lr} + bl remove_some_task + bl ResetTasks + bl ResetAllObjectData + bl reset_temp_tile_data_buffers + bl dp13_810BB8C + bl ResetObjectPaletteAllocator + ldr r1, =gUnknown_0300301C + movs r0, 0x8 + strb r0, [r1] + ldr r0, =gUnknown_085E5394 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085E53A4 + bl LoadCompressedObjectPalette + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174F70 + + thumb_func_start sub_8174FAC +sub_8174FAC: @ 8174FAC + push {r4,lr} + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085E5374 + movs r0, 0 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r4, =gUnknown_0203BCDC + ldr r1, [r4] + adds r1, 0x12 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00001012 + adds r1, r0 + movs r0, 0x3 + bl SetBgTilemapBuffer + 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 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174FAC + + thumb_func_start sub_8175024 +sub_8175024: @ 8175024 + push {r4,lr} + sub sp, 0x8 + ldr r0, =gUnknown_0203BCDC + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0x4 + bhi _08175108 + lsls r0, 2 + ldr r1, =_08175044 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08175044: + .4byte _08175058 + .4byte _08175070 + .4byte _0817507C + .4byte _081750D2 + .4byte _081750DC +_08175058: + ldr r1, =gUnknown_085E5508 + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + b _08175108 + .pool +_08175070: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + beq _08175108 + b _08175112 +_0817507C: + movs r4, 0x20 + str r4, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r4, [sp] + movs r0, 0xB + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0x3 + bl FillBgTilemapBufferRect_Palette0 + str r4, [sp] + movs r0, 0x6 + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + movs r3, 0xE + bl FillBgTilemapBufferRect_Palette0 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + movs r1, 0x2 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + b _08175108 +_081750D2: + bl sub_81971D0 + bl sub_8197200 + b _08175108 +_081750DC: + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x3 + bl ShowBg + ldr r0, =gUnknown_0203BCDC + ldr r1, [r0] + movs r0, 0 + strh r0, [r1] + b _08175114 + .pool +_08175108: + ldr r0, =gUnknown_0203BCDC + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_08175112: + movs r0, 0x1 +_08175114: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8175024 + + thumb_func_start sub_8175120 +sub_8175120: @ 8175120 + push {r4,lr} + adds r2, r0, 0 + ldr r1, [r2, 0x20] + ldr r0, [r2, 0x30] + cmp r1, r0 + beq _08175176 + ldrh r3, [r2, 0x20] + movs r1, 0x20 + ldrsh r0, [r2, r1] + movs r4, 0x30 + ldrsh r1, [r2, r4] + cmp r0, r1 + bge _08175140 + adds r0, r3, 0 + adds r0, 0xF + strh r0, [r2, 0x20] +_08175140: + ldrh r3, [r2, 0x20] + movs r4, 0x20 + ldrsh r0, [r2, r4] + cmp r0, r1 + ble _08175150 + adds r0, r3, 0 + subs r0, 0xF + strh r0, [r2, 0x20] +_08175150: + ldrh r3, [r2, 0x22] + movs r1, 0x22 + ldrsh r0, [r2, r1] + movs r4, 0x32 + ldrsh r1, [r2, r4] + cmp r0, r1 + bge _08175164 + adds r0, r3, 0 + adds r0, 0xA + strh r0, [r2, 0x22] +_08175164: + ldrh r3, [r2, 0x22] + movs r4, 0x22 + ldrsh r0, [r2, r4] + cmp r0, r1 + ble _0817519C + adds r0, r3, 0 + subs r0, 0xA + strh r0, [r2, 0x22] + b _0817519C +_08175176: + ldrh r0, [r2, 0x3C] + lsls r1, r0, 16 + movs r0, 0xCE + lsls r0, 17 + cmp r1, r0 + bne _08175190 + lsrs r1, 16 + adds r0, r2, 0 + movs r2, 0x1 + movs r3, 0x3 + bl sub_806ED40 + b _0817519C +_08175190: + lsrs r1, 16 + adds r0, r2, 0 + movs r2, 0 + movs r3, 0x3 + bl sub_806ED40 +_0817519C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8175120 + + thumb_func_start sub_81751A4 +sub_81751A4: @ 81751A4 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r1, [r5, 0x26] + movs r2, 0x26 + ldrsh r0, [r5, r2] + cmp r0, 0x78 + ble _081751BA + adds r0, r5, 0 + bl RemoveObjectAndFreeTiles + b _081751F2 +_081751BA: + adds r0, r1, 0x1 + ldrh r1, [r5, 0x30] + adds r0, r1 + strh r0, [r5, 0x26] + ldrh r4, [r5, 0x2E] + lsls r4, 24 + lsrs r4, 24 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + ands r0, r1 + adds r0, 0x8 + ldr r1, =gUnknown_08329F40 + lsls r4, 1 + adds r4, r1 + movs r2, 0 + ldrsh r1, [r4, r2] + muls r0, r1 + cmp r0, 0 + bge _081751E8 + adds r0, 0xFF +_081751E8: + asrs r0, 8 + strh r0, [r5, 0x24] + ldrh r0, [r5, 0x2E] + adds r0, 0x4 + strh r0, [r5, 0x2E] +_081751F2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81751A4 + + thumb_func_start sub_81751FC +sub_81751FC: @ 81751FC + push {r4,lr} + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF0 + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl Random + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x7 + ands r2, r0 + negs r2, r2 + ldr r0, =gUnknown_085E54D0 + lsls r4, 16 + asrs r4, 16 + lsls r2, 16 + asrs r2, 16 + adds r1, r4, 0 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =gUnknown_02020630 + adds r4, r1, r0 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x11 + bl __umodsi3 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + bl Random + movs r1, 0x3 + ands r1, r0 + cmp r1, 0 + beq _08175274 + movs r0, 0 + b _08175276 + .pool +_08175274: + movs r0, 0x1 +_08175276: + strh r0, [r4, 0x30] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81751FC + + thumb_func_start sub_8175280 +sub_8175280: @ 8175280 + push {r4,lr} + ldr r4, =gUnknown_020375E0 + movs r0, 0xB4 + strh r0, [r4] + ldr r0, =sub_8175364 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _081752AA + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r4] + strh r1, [r0, 0xA] + ldr r0, =gUnknown_020375E2 + strh r2, [r0] +_081752AA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175280 + + thumb_func_start sub_81752C0 +sub_81752C0: @ 81752C0 + push {r4,lr} + ldr r0, =sub_8175364 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _081752D4 + bl DestroyTask +_081752D4: + bl sub_8152254 + ldr r4, =0x000003e9 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81752C0 + + thumb_func_start sub_81752F4 +sub_81752F4: @ 81752F4 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r1, [r5, 0xE] + movs r2, 0xE + ldrsh r0, [r5, r2] + cmp r0, 0x6E + ble _08175324 + ldr r2, =gTasks + movs r0, 0x28 + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0x26] + subs r1, 0x1 + strh r1, [r0, 0x26] + ldrb r0, [r5, 0x16] + bl sub_81525D0 + b _08175358 + .pool +_08175324: + adds r0, r1, 0x1 + ldrh r1, [r5, 0x1C] + adds r0, r1 + strh r0, [r5, 0xE] + ldrb r4, [r5, 0x1A] + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + ands r0, r1 + adds r0, 0x8 + ldr r1, =gUnknown_08329F40 + lsls r4, 1 + adds r4, r1 + movs r2, 0 + ldrsh r1, [r4, r2] + muls r0, r1 + cmp r0, 0 + bge _0817534E + adds r0, 0xFF +_0817534E: + asrs r0, 8 + strh r0, [r5, 0xC] + ldrh r0, [r5, 0x1A] + adds r0, 0x4 + strh r0, [r5, 0x1A] +_08175358: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81752F4 + + thumb_func_start sub_8175364 +sub_8175364: @ 8175364 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r4, r0, 24 + mov r8, r4 + movs r7, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r6, r0, r1 + ldrh r0, [r6] + cmp r0, 0x1 + beq _081753E0 + cmp r0, 0x1 + bgt _08175394 + cmp r0, 0 + beq _0817539C + b _081754B0 + .pool +_08175394: + cmp r0, 0xFF + bne _0817539A + b _081754A0 +_0817539A: + b _081754B0 +_0817539C: + movs r0, 0x40 + bl sub_81521C0 + cmp r0, 0 + bne _081753B8 + adds r0, r4, 0 + bl DestroyTask + ldr r0, =gUnknown_020375E0 + strh r7, [r0] + ldr r1, =gUnknown_020375E2 + ldr r2, =0x0000ffff + adds r0, r2, 0 + strh r0, [r1] +_081753B8: + ldr r0, =gUnknown_085E5394 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085E53A4 + bl LoadCompressedObjectPalette + ldrh r0, [r6] + adds r0, 0x1 + strh r0, [r6] + b _081754B0 + .pool +_081753E0: + ldrh r0, [r6, 0x2] + cmp r0, 0 + beq _08175478 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _08175478 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF0 + bl __umodsi3 + adds r5, r0, 0 + lsls r5, 16 + asrs r5, 16 + bl Random + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0x7 + ands r4, r0 + negs r4, r4 + lsls r4, 16 + asrs r4, 16 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x11 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_085E53FC + ldr r2, =0x000003e9 + str r4, [sp] + str r0, [sp, 0x4] + str r7, [sp, 0x8] + adds r0, r1, 0 + adds r1, r2, 0 + adds r3, r5, 0 + bl sub_81524C4 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0xFF + beq _08175478 + adds r4, r7, 0 + ldr r1, =sub_81752F4 + adds r0, r4, 0 + bl sub_8152438 + bl Random + movs r1, 0x3 + ands r1, r0 + cmp r1, 0 + bne _08175468 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_8152474 +_08175468: + adds r0, r4, 0 + movs r1, 0x7 + mov r2, r8 + bl sub_8152474 + ldrh r0, [r6, 0x1E] + adds r0, 0x1 + strh r0, [r6, 0x1E] +_08175478: + bl sub_81522D4 + ldrh r0, [r6, 0x2] + cmp r0, 0 + beq _08175494 + subs r0, 0x1 + strh r0, [r6, 0x2] + b _081754B0 + .pool +_08175494: + ldrh r0, [r6, 0x1E] + cmp r0, 0 + bne _081754B0 + movs r0, 0xFF + strh r0, [r6] + b _081754B0 +_081754A0: + bl sub_81752C0 + ldr r0, =gUnknown_020375E0 + strh r7, [r0] + ldr r1, =gUnknown_020375E2 + ldr r2, =0x0000ffff + adds r0, r2, 0 + strh r0, [r1] +_081754B0: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175364 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/intro.s b/asm/intro.s index fc548bc93..aff010d54 100644 --- a/asm/intro.s +++ b/asm/intro.s @@ -23,7 +23,7 @@ sub_816CC00: @ 816CC00 bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl UpdatePaletteFade - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r0, [r0, 0x2E] cmp r0, 0 beq _0816CC3C @@ -114,7 +114,7 @@ SerialCb_CopyrightScreen: @ 816CCB8 do_copyright_screen: @ 816CCC8 push {r4-r6,lr} sub sp, 0x10 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r5, r0, r1 @@ -216,7 +216,7 @@ _0816CCF4: bl GameCubeMultiBoot_Init _0816CDBC: bl UpdatePaletteFade - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -321,7 +321,7 @@ c2_copyright_1: @ 816CEAC _0816CEDE: bl init_sav2 _0816CEE2: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x15] lsls r0, 31 @@ -359,7 +359,7 @@ task_intro_1: @ 816CF18 movs r0, 0 bl SetVBlankCallback ldr r4, =gUnknown_0203BCC8 - bl GenerateRandomNumber + bl Random movs r1, 0x1 ands r1, r0 strh r1, [r4] @@ -1258,7 +1258,7 @@ _0816D774: movs r1, 0x7F ands r0, r1 movs r1, 0x30 - bl sine + bl Sin ldr r1, =gUnknown_0203BCCC strh r0, [r1] ldrh r2, [r4, 0xE] @@ -1433,13 +1433,13 @@ _0816D912: lsls r0, 24 lsrs r0, 24 movs r1, 0x3C - bl sine + bl Sin strh r0, [r4, 0x24] ldrh r0, [r4, 0x38] lsls r0, 24 lsrs r0, 24 movs r1, 0x14 - bl sine + bl Sin strh r0, [r4, 0x26] ldrh r1, [r4, 0x36] adds r1, 0x2 @@ -1481,7 +1481,7 @@ _0816D96E: lsls r0, 24 lsrs r0, 24 movs r1, 0x14 - bl sine + bl Sin strh r0, [r4, 0x26] ldrh r0, [r4, 0x38] adds r0, 0x4 @@ -1500,7 +1500,7 @@ _0816D99C: lsls r0, 24 lsrs r0, 24 movs r1, 0x2 - bl cosine + bl Cos strh r0, [r4, 0x26] ldrh r0, [r4, 0x30] subs r0, 0x1 @@ -1751,7 +1751,7 @@ _0816DB7C: lsrs r0, 24 movs r1, 0x40 _0816DB84: - bl sine + bl Sin strh r0, [r4, 0x24] ldrh r0, [r4, 0x30] adds r0, 0x1 @@ -1760,7 +1760,7 @@ _0816DB84: lsls r0, 24 lsrs r0, 24 movs r1, 0xC - bl cosine + bl Cos strh r0, [r4, 0x26] ldrh r0, [r4, 0x32] adds r0, 0x1 @@ -2359,7 +2359,7 @@ _0816E0DE: ands r0, r1 lsrs r0, 8 movs r1, 0x40 - bl sine + bl Sin movs r1, 0x80 lsls r1, 1 adds r5, r1, 0 @@ -2695,7 +2695,7 @@ _0816E3E0: ldrsh r0, [r5, r2] movs r1, 0x80 lsls r1, 1 - bl sine + bl Sin ldr r1, =gTasks lsls r4, r6, 2 adds r4, r6 @@ -2709,7 +2709,7 @@ _0816E3E0: movs r1, 0xC ldrsh r0, [r5, r1] movs r1, 0x40 - bl cosine + bl Cos movs r1, 0x54 subs r1, r0 strh r1, [r4, 0xC] @@ -2974,7 +2974,7 @@ _0816E61A: movs r1, 0xC ldrsh r0, [r5, r1] movs r1, 0x3C - bl sine + bl Sin ldr r2, =gTasks lsls r1, r6, 2 adds r1, r6 @@ -3006,7 +3006,7 @@ _0816E664: movs r1, 0xC ldrsh r0, [r5, r1] movs r1, 0x14 - bl sine + bl Sin ldr r2, =gTasks lsls r1, r6, 2 adds r1, r6 @@ -3183,7 +3183,7 @@ _0816E7C6: movs r1, 0x30 ldrsh r0, [r4, r1] movs r1, 0x4 - bl sine + bl Sin strh r0, [r4, 0x24] ldrh r0, [r4, 0x32] adds r0, 0x30 @@ -4487,4 +4487,1784 @@ sub_816F2A8: @ 816F2A8 bx r0 thumb_func_end sub_816F2A8 + thumb_func_start sub_816F318 +sub_816F318: @ 816F318 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0xBF + ble _0816F394 + ldrh r1, [r4, 0x34] + movs r2, 0x34 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0816F336 + subs r0, r1, 0x1 + strh r0, [r4, 0x34] + b _0816F39A +_0816F336: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x30] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x32] + str r1, [sp] + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + movs r0, 0x32 + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 5 + subs r0, r1 + movs r1, 0x64 + bl __divsi3 + strh r0, [r4, 0x32] + movs r2, 0x32 + ldrsh r1, [r4, r2] + adds r0, r1, 0 + subs r0, 0xC0 + cmp r0, 0 + bge _0816F378 + adds r0, 0x7F +_0816F378: + asrs r0, 7 + adds r0, 0x9 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xF + bls _0816F386 + movs r0, 0xF +_0816F386: + lsls r2, r0, 4 + ldrb r1, [r4, 0x5] + movs r0, 0xF + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x5] + b _0816F39A +_0816F394: + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_0816F39A: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816F318 + + thumb_func_start sub_816F3A4 +sub_816F3A4: @ 816F3A4 + push {r4,lr} + adds r4, r0, 0 + ldr r2, =gUnknown_02020630 + movs r1, 0x3C + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r3, 0x3C + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _0816F420 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r3, [r4, 0x22] + adds r0, r3 + strh r0, [r4, 0x22] + adds r0, r4, 0 + movs r1, 0x3 + bl StartObjectImageAnim + movs r0, 0x80 + lsls r0, 3 + strh r0, [r4, 0x32] + ldrh r1, [r4, 0x30] + movs r0, 0x3 + ands r0, r1 + lsls r0, 3 + strh r0, [r4, 0x34] + ldr r0, =sub_816F318 + str r0, [r4, 0x1C] + ldrb r1, [r4, 0x1] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x3] + movs r1, 0xC0 + orrs r0, r1 + strb r0, [r4, 0x3] + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0x3 + movs r3, 0x2 + bl CalcVecFromObjectCenterToObjectUpperLeft + b _0816F44C + .pool +_0816F420: + ldrh r0, [r1, 0x24] + strh r0, [r4, 0x24] + movs r0, 0x3C + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x26] + strh r0, [r4, 0x26] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x20] + strh r0, [r4, 0x20] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x22] + strh r0, [r4, 0x22] +_0816F44C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816F3A4 + + thumb_func_start sub_816F454 +sub_816F454: @ 816F454 + push {lr} + adds r1, r0, 0 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _0816F464 + ldr r0, =sub_816F46C + str r0, [r1, 0x1C] +_0816F464: + pop {r0} + bx r0 + .pool + thumb_func_end sub_816F454 + + thumb_func_start sub_816F46C +sub_816F46C: @ 816F46C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r7, r0, 0 + ldrh r4, [r7, 0x20] + movs r1, 0x20 + ldrsh r0, [r7, r1] + cmp r0, 0x74 + bgt _0816F4AC + ldrh r0, [r7, 0x26] + ldrh r1, [r7, 0x22] + adds r0, r1 + movs r1, 0 + strh r0, [r7, 0x22] + strh r1, [r7, 0x26] + adds r0, r4, 0x4 + strh r0, [r7, 0x20] + ldr r0, =0x0000fffc + strh r0, [r7, 0x24] + movs r0, 0x80 + strh r0, [r7, 0x36] + ldr r0, =sub_816F5B4 + str r0, [r7, 0x1C] + b _0816F59E + .pool +_0816F4AC: + ldrh r1, [r7, 0x36] + ldr r5, =gUnknown_08329F40 + lsls r0, r1, 24 + lsrs r0, 23 + adds r0, r5 + ldrh r2, [r0] + adds r0, r1, 0 + adds r0, 0x40 + lsls r0, 24 + lsrs r0, 23 + adds r0, r5 + ldrh r3, [r0] + adds r1, 0x2 + strh r1, [r7, 0x36] + lsls r2, 16 + asrs r0, r2, 16 + cmp r0, 0 + bge _0816F4D2 + adds r0, 0x1F +_0816F4D2: + asrs r0, 5 + strh r0, [r7, 0x26] + subs r0, r4, 0x1 + strh r0, [r7, 0x20] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0816F4E8 + ldrh r0, [r7, 0x22] + adds r0, 0x1 + strh r0, [r7, 0x22] +_0816F4E8: + lsls r0, r3, 16 + asrs r0, 16 + negs r0, r0 + cmp r0, 0 + bge _0816F4F4 + adds r0, 0xF +_0816F4F4: + lsls r1, r0, 12 + lsrs r1, 16 + ldrh r4, [r7, 0x32] + ldrh r3, [r7, 0x34] + adds r0, r1, 0 + subs r0, 0x10 + lsls r0, 24 + lsrs r0, 23 + adds r0, r5 + ldrh r2, [r0] + adds r1, 0x30 + lsls r1, 24 + lsrs r1, 23 + adds r1, r5 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r1, 0 + muls r0, r4 + cmp r0, 0 + bge _0816F51E + adds r0, 0xFF +_0816F51E: + lsls r0, 8 + lsrs r0, 16 + mov r8, r0 + lsls r0, r2, 16 + asrs r2, r0, 16 + negs r0, r2 + muls r0, r3 + cmp r0, 0 + bge _0816F532 + adds r0, 0xFF +_0816F532: + lsls r0, 8 + lsrs r0, 16 + mov r10, r0 + adds r0, r2, 0 + muls r0, r4 + cmp r0, 0 + bge _0816F542 + adds r0, 0xFF +_0816F542: + lsls r0, 8 + lsrs r5, r0, 16 + adds r0, r1, 0 + muls r0, r3 + cmp r0, 0 + bge _0816F550 + adds r0, 0xFF +_0816F550: + lsls r6, r0, 8 + lsrs r6, 16 + ldrh r0, [r7, 0x30] + lsls r0, 24 + lsrs r0, 24 + str r3, [sp] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + ldrh r0, [r7, 0x30] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r5 + mov r1, r10 + lsls r5, r1, 16 + lsrs r3, r5, 16 + lsls r4, r6, 16 + str r6, [sp] + mov r1, r8 + mov r2, r9 + bl SetSpriteTransformationMatrix + ldrh r0, [r7, 0x30] + adds r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + lsls r5, 1 + lsrs r5, 16 + lsls r4, 1 + lsrs r4, 16 + str r4, [sp] + mov r1, r8 + mov r2, r9 + adds r3, r5, 0 + bl SetSpriteTransformationMatrix +_0816F59E: + 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_816F46C + + thumb_func_start sub_816F5B4 +sub_816F5B4: @ 816F5B4 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x3A] + adds r1, 0x40 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + ldrh r0, [r4, 0x30] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x3A] + adds r1, 0x40 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + ldrh r0, [r4, 0x30] + adds r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x3A] + adds r1, 0x40 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + ldrh r1, [r4, 0x36] + movs r2, 0x36 + ldrsh r0, [r4, r2] + cmp r0, 0x40 + beq _0816F64C + adds r0, r1, 0 + subs r0, 0x8 + strh r0, [r4, 0x36] + ldrh r0, [r4, 0x36] + adds r1, r0, 0 + ldr r2, =gUnknown_08329F40 + adds r0, 0x40 + lsls r0, 24 + lsrs r0, 23 + adds r0, r2 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0 + bge _0816F62E + adds r0, 0x3F +_0816F62E: + asrs r0, 6 + strh r0, [r4, 0x24] + lsls r0, r1, 24 + lsrs r0, 23 + adds r0, r2 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _0816F642 + adds r0, 0x3F +_0816F642: + asrs r0, 6 + strh r0, [r4, 0x26] + b _0816F654 + .pool +_0816F64C: + movs r0, 0 + strh r0, [r4, 0x36] + ldr r0, =sub_816F660 + str r0, [r4, 0x1C] +_0816F654: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816F5B4 + + thumb_func_start sub_816F660 +sub_816F660: @ 816F660 + push {r4,lr} + adds r1, r0, 0 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0x2 + beq _0816F6C0 + ldrh r0, [r1, 0x36] + adds r0, 0x8 + strh r0, [r1, 0x36] + ldr r3, =gUnknown_08329F40 + lsls r0, 24 + lsrs r0, 23 + adds r0, r3 + movs r4, 0 + ldrsh r0, [r0, r4] + cmp r0, 0 + bge _0816F684 + adds r0, 0xF +_0816F684: + asrs r0, 4 + adds r0, 0x40 + lsls r0, 16 + lsrs r2, r0, 16 + adds r0, r2, 0 + adds r0, 0x40 + lsls r0, 24 + lsrs r0, 23 + adds r0, r3 + movs r4, 0 + ldrsh r0, [r0, r4] + cmp r0, 0 + bge _0816F6A0 + adds r0, 0x3F +_0816F6A0: + asrs r0, 6 + strh r0, [r1, 0x24] + lsls r0, r2, 24 + lsrs r0, 23 + adds r0, r3 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + bge _0816F6B4 + adds r0, 0x3F +_0816F6B4: + asrs r0, 6 + strh r0, [r1, 0x26] + b _0816F6C4 + .pool +_0816F6C0: + ldr r0, =sub_816F6D0 + str r0, [r1, 0x1C] +_0816F6C4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816F660 + + thumb_func_start sub_816F6D0 +sub_816F6D0: @ 816F6D0 + push {r4,lr} + adds r4, r0, 0 + ldrh r2, [r4, 0x22] + movs r0, 0x22 + ldrsh r1, [r4, r0] + movs r3, 0x38 + ldrsh r0, [r4, r3] + cmp r1, r0 + bge _0816F6E8 + adds r0, r2, 0x4 + strh r0, [r4, 0x22] + b _0816F744 +_0816F6E8: + movs r0, 0x1 + strh r0, [r4, 0x3C] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r3, [r4, 0x22] + adds r0, r3 + strh r0, [r4, 0x22] + adds r0, r4, 0 + movs r1, 0x3 + bl StartObjectImageAnim + movs r0, 0x80 + lsls r0, 3 + strh r0, [r4, 0x32] + ldrh r1, [r4, 0x30] + movs r0, 0x3 + ands r0, r1 + lsls r0, 3 + strh r0, [r4, 0x34] + ldr r0, =sub_816F318 + str r0, [r4, 0x1C] + ldrb r1, [r4, 0x1] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x3] + movs r1, 0xC0 + orrs r0, r1 + strb r0, [r4, 0x3] + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0x3 + movs r3, 0x2 + bl CalcVecFromObjectCenterToObjectUpperLeft +_0816F744: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816F6D0 + + thumb_func_start sub_816F750 +sub_816F750: @ 816F750 + push {r4,lr} + adds r4, r0, 0 + ldrh r2, [r4, 0x22] + movs r0, 0x22 + ldrsh r1, [r4, r0] + movs r3, 0x38 + ldrsh r0, [r4, r3] + cmp r1, r0 + bge _0816F768 + adds r0, r2, 0x4 + strh r0, [r4, 0x22] + b _0816F7C4 +_0816F768: + movs r0, 0x1 + strh r0, [r4, 0x3C] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r3, [r4, 0x22] + adds r0, r3 + strh r0, [r4, 0x22] + adds r0, r4, 0 + movs r1, 0x3 + bl StartObjectImageAnim + movs r0, 0x80 + lsls r0, 3 + strh r0, [r4, 0x32] + ldrh r1, [r4, 0x30] + movs r0, 0x3 + ands r0, r1 + lsls r0, 3 + strh r0, [r4, 0x34] + ldr r0, =sub_816F318 + str r0, [r4, 0x1C] + ldrb r1, [r4, 0x1] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x3] + movs r1, 0xC0 + orrs r0, r1 + strb r0, [r4, 0x3] + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0x3 + movs r3, 0x2 + bl CalcVecFromObjectCenterToObjectUpperLeft +_0816F7C4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816F750 + + thumb_func_start sub_816F7D0 +sub_816F7D0: @ 816F7D0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r6, [sp, 0x34] + ldr r0, [sp, 0x38] + mov r8, r0 + lsls r4, 16 + lsls r5, 16 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0x8] + lsls r3, 16 + lsrs r3, 16 + str r3, [sp, 0xC] + lsls r6, 16 + lsrs r6, 16 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + ldr r0, =gUnknown_085E4D64 + lsrs r2, r4, 16 + mov r10, r2 + asrs r4, 16 + lsrs r1, r5, 16 + str r1, [sp, 0x4] + asrs r5, 16 + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, =gUnknown_02020630 + mov r9, r2 + lsls r0, r7, 4 + adds r0, r7 + lsls r5, r0, 2 + adds r4, r5, r2 + movs r0, 0 + strh r0, [r4, 0x2E] + strh r0, [r4, 0x3C] + mov r0, sp + ldrh r0, [r0, 0xC] + strh r0, [r4, 0x30] + mov r1, sp + ldrh r1, [r1, 0x8] + strh r1, [r4, 0x32] + mov r2, sp + ldrh r2, [r2, 0x8] + strh r2, [r4, 0x34] + strh r6, [r4, 0x38] + mov r0, sp + ldrh r0, [r0, 0x8] + strh r0, [r4, 0x3A] + ldrb r0, [r4, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r4, 0x1] + movs r0, 0x1F + ldr r1, [sp, 0xC] + ands r1, r0 + lsls r1, 1 + ldrb r2, [r4, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x3] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x2 + movs r3, 0x2 + bl CalcVecFromObjectCenterToObjectUpperLeft + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectImageAnim + mov r1, r8 + cmp r1, 0 + bne _0816F898 + mov r0, r9 + adds r0, 0x1C + adds r0, r5, r0 + ldr r1, =sub_816F454 + b _0816F8A0 + .pool +_0816F898: + mov r0, r9 + adds r0, 0x1C + adds r0, r5, r0 + ldr r1, =sub_816F750 +_0816F8A0: + str r1, [r0] + str r7, [sp, 0x10] + mov r2, r10 + lsls r2, 16 + asrs r2, 16 + mov r10, r2 + ldr r0, [sp, 0x4] + lsls r0, 16 + asrs r0, 16 + mov r8, r0 + ldr r0, =gUnknown_085E4D64 + mov r1, r10 + mov r2, r8 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + ldr r5, =gUnknown_02020630 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + adds r0, r4, r5 + mov r1, sp + ldrh r1, [r1, 0x10] + strh r1, [r0, 0x3C] + ldr r2, [sp, 0xC] + adds r2, 0x1 + mov r9, r2 + strh r2, [r0, 0x30] + ldrb r1, [r0, 0x1] + movs r2, 0x3 + orrs r1, r2 + strb r1, [r0, 0x1] + mov r2, r9 + movs r1, 0x1F + ands r2, r1 + lsls r2, 1 + ldrb r3, [r0, 0x3] + movs r6, 0x3F + negs r6, r6 + adds r1, r6, 0 + ands r1, r3 + orrs r1, r2 + strb r1, [r0, 0x3] + movs r1, 0 + movs r2, 0x2 + movs r3, 0x2 + bl CalcVecFromObjectCenterToObjectUpperLeft + ldr r2, =gUnknown_0202064C + adds r4, r2 + ldr r0, =sub_816F3A4 + str r0, [r4] + ldr r0, =gUnknown_085E4D64 + mov r1, r10 + mov r2, r8 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + adds r5, r4, r5 + mov r1, sp + ldrh r1, [r1, 0x10] + strh r1, [r5, 0x3C] + ldr r2, [sp, 0xC] + adds r2, 0x2 + mov r8, r2 + strh r2, [r5, 0x30] + adds r0, r5, 0 + movs r1, 0x1 + bl StartObjectImageAnim + ldrb r0, [r5, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r5, 0x1] + mov r0, r8 + movs r2, 0x1F + ands r0, r2 + lsls r0, 1 + ldrb r1, [r5, 0x3] + ands r6, r1 + orrs r6, r0 + strb r6, [r5, 0x3] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x2 + movs r3, 0x2 + bl CalcVecFromObjectCenterToObjectUpperLeft + ldr r0, =gUnknown_0202064C + adds r4, r0 + ldr r1, =sub_816F3A4 + str r1, [r4] + ldr r2, [sp, 0xC] + lsls r0, r2, 24 + lsrs r0, 24 + ldr r5, [sp, 0x8] + adds r5, 0x20 + lsls r4, r5, 16 + lsrs r4, 16 + str r4, [sp] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + str r4, [sp] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r5, 17 + lsrs r5, 16 + str r5, [sp] + mov r0, r8 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + ldr r0, [sp, 0x10] + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_816F7D0 + + thumb_func_start sub_816F9D4 +sub_816F9D4: @ 816F9D4 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bhi _0816FA62 + lsls r0, 2 + ldr r1, =_0816F9F0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0816F9F0: + .4byte _0816FA04 + .4byte _0816FA12 + .4byte _0816FA30 + .4byte _0816FA62 + .4byte _0816FA50 +_0816FA04: + adds r0, r4, 0 + movs r1, 0 + bl StartObjectImageAnimIfDifferent + ldrh r0, [r4, 0x20] + subs r0, 0x1 + b _0816FA60 +_0816FA12: + adds r0, r4, 0 + movs r1, 0 + bl StartObjectImageAnimIfDifferent + ldr r0, =gUnknown_030062A0 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0816FAAA + ldrh r0, [r4, 0x20] + adds r0, 0x1 + b _0816FA60 + .pool +_0816FA30: + ldrh r2, [r4, 0x20] + movs r1, 0x20 + ldrsh r0, [r4, r1] + cmp r0, 0x78 + ble _0816FA46 + ldr r0, =gUnknown_030062A0 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + beq _0816FA6E +_0816FA46: + adds r0, r2, 0x1 + b _0816FA60 + .pool +_0816FA50: + ldrh r2, [r4, 0x20] + movs r0, 0x20 + ldrsh r1, [r4, r0] + movs r0, 0x20 + negs r0, r0 + cmp r1, r0 + ble _0816FA62 + subs r0, r2, 0x2 +_0816FA60: + strh r0, [r4, 0x20] +_0816FA62: + ldr r0, =gUnknown_030062A0 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0816FAAA +_0816FA6E: + movs r1, 0x26 + ldrsh r5, [r4, r1] + cmp r5, 0 + beq _0816FA80 + movs r0, 0 + strh r0, [r4, 0x26] + b _0816FAAA + .pool +_0816FA80: + bl Random + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x1 + beq _0816FAA8 + cmp r1, 0x1 + bgt _0816FA96 + cmp r1, 0 + beq _0816FA9E + b _0816FAAA +_0816FA96: + cmp r1, 0x3 + bgt _0816FAAA + strh r5, [r4, 0x26] + b _0816FAAA +_0816FA9E: + ldr r0, =0x0000ffff + strh r0, [r4, 0x26] + b _0816FAAA + .pool +_0816FAA8: + strh r1, [r4, 0x26] +_0816FAAA: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_816F9D4 + + thumb_func_start sub_816FAB0 +sub_816FAB0: @ 816FAB0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0816FACA + cmp r0, 0x1 + ble _0816FB12 + cmp r0, 0x2 + beq _0816FAEA + cmp r0, 0x3 + beq _0816FB04 + b _0816FB12 +_0816FACA: + movs r2, 0x24 + ldrsh r0, [r4, r2] + movs r2, 0x20 + ldrsh r1, [r4, r2] + adds r0, r1 + ldr r1, =0x0000012f + cmp r0, r1 + bgt _0816FAE4 + ldrh r0, [r4, 0x24] + adds r0, 0x8 + b _0816FB10 + .pool +_0816FAE4: + movs r0, 0x2 + strh r0, [r4, 0x2E] + b _0816FB12 +_0816FAEA: + movs r1, 0x24 + ldrsh r0, [r4, r1] + movs r2, 0x20 + ldrsh r1, [r4, r2] + adds r0, r1 + cmp r0, 0x78 + ble _0816FAFE + ldrh r0, [r4, 0x24] + subs r0, 0x1 + b _0816FB10 +_0816FAFE: + movs r0, 0x3 + strh r0, [r4, 0x2E] + b _0816FB12 +_0816FB04: + ldrh r1, [r4, 0x24] + movs r2, 0x24 + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _0816FB12 + subs r0, r1, 0x2 +_0816FB10: + strh r0, [r4, 0x24] +_0816FB12: + ldrh r0, [r4, 0x30] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x8 + bl Sin + ldr r1, =gUnknown_0203BCCC + ldrh r1, [r1] + subs r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x4 + strh r0, [r4, 0x30] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816FAB0 + + thumb_func_start sub_816FB38 +sub_816FB38: @ 816FB38 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x2E + ldrsh r0, [r6, r1] + cmp r0, 0x5 + bls _0816FB46 + b _0816FD38 +_0816FB46: + lsls r0, 2 + ldr r1, =_0816FB54 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0816FB54: + .4byte _0816FB6C + .4byte _0816FB94 + .4byte _0816FBB4 + .4byte _0816FC5C + .4byte _0816FCC4 + .4byte _0816FCF4 +_0816FB6C: + ldrh r1, [r6, 0x30] + movs r2, 0x30 + ldrsh r0, [r6, r2] + cmp r0, 0 + beq _0816FB7C + subs r0, r1, 0x1 + strh r0, [r6, 0x30] + b _0816FD38 +_0816FB7C: + adds r2, r6, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x5 + negs r1, r1 + ands r1, r0 + strb r1, [r2] + adds r0, r6, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + b _0816FCE6 +_0816FB94: + ldr r0, =gUnknown_030062A0 + ldr r0, [r0] + cmp r0, 0x90 + beq _0816FB9E + b _0816FD38 +_0816FB9E: + ldrh r0, [r6, 0x2E] + adds r0, 0x1 + strh r0, [r6, 0x2E] + movs r0, 0x9 + strh r0, [r6, 0x30] + movs r0, 0x2 + strh r0, [r6, 0x34] + b _0816FD38 + .pool +_0816FBB4: + ldrh r1, [r6, 0x34] + movs r2, 0x34 + ldrsh r0, [r6, r2] + cmp r0, 0 + bne _0816FC66 + movs r0, 0x2 + strh r0, [r6, 0x34] + movs r1, 0x30 + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _0816FC14 + lsls r0, 1 + ldr r4, =gUnknown_08D85C50 + adds r0, r4 + ldr r5, =gUnknown_02037D52 + adds r1, r5, 0 + movs r2, 0x1 + bl CpuSet + movs r1, 0x30 + ldrsh r0, [r6, r1] + lsls r0, 1 + adds r1, r4, 0 + adds r1, 0x20 + adds r0, r1 + adds r1, r5, 0 + subs r1, 0x16 + movs r2, 0x1 + bl CpuSet + movs r2, 0x30 + ldrsh r0, [r6, r2] + lsls r0, 1 + adds r4, 0x40 + adds r0, r4 + subs r5, 0xA + adds r1, r5, 0 + movs r2, 0x1 + bl CpuSet + ldrh r0, [r6, 0x30] + subs r0, 0x1 + strh r0, [r6, 0x30] + b _0816FD38 + .pool +_0816FC14: + movs r1, 0x30 + ldrsh r0, [r6, r1] + lsls r0, 1 + ldr r4, =gUnknown_08D85C50 + adds r0, r4 + ldr r5, =gUnknown_02037D52 + adds r1, r5, 0 + movs r2, 0x1 + bl CpuSet + movs r2, 0x30 + ldrsh r0, [r6, r2] + lsls r0, 1 + adds r1, r4, 0 + adds r1, 0x20 + adds r0, r1 + adds r1, r5, 0 + subs r1, 0x16 + movs r2, 0x1 + bl CpuSet + movs r1, 0x30 + ldrsh r0, [r6, r1] + lsls r0, 1 + adds r4, 0x40 + adds r0, r4 + subs r5, 0xA + adds r1, r5, 0 + movs r2, 0x1 + bl CpuSet + b _0816FCE6 + .pool +_0816FC5C: + ldrh r1, [r6, 0x34] + movs r2, 0x34 + ldrsh r0, [r6, r2] + cmp r0, 0 + beq _0816FC6C +_0816FC66: + subs r0, r1, 0x1 + strh r0, [r6, 0x34] + b _0816FD38 +_0816FC6C: + movs r0, 0x2 + strh r0, [r6, 0x34] + movs r1, 0x30 + ldrsh r0, [r6, r1] + cmp r0, 0x9 + bgt _0816FCE6 + lsls r0, 1 + ldr r4, =gUnknown_08D85C50 + adds r0, r4 + ldr r5, =gUnknown_02037D52 + adds r1, r5, 0 + movs r2, 0x1 + bl CpuSet + movs r1, 0x30 + ldrsh r0, [r6, r1] + lsls r0, 1 + adds r1, r4, 0 + adds r1, 0x20 + adds r0, r1 + adds r1, r5, 0 + subs r1, 0x16 + movs r2, 0x1 + bl CpuSet + movs r2, 0x30 + ldrsh r0, [r6, r2] + lsls r0, 1 + adds r4, 0x40 + adds r0, r4 + subs r5, 0xA + adds r1, r5, 0 + movs r2, 0x1 + bl CpuSet + ldrh r0, [r6, 0x30] + adds r0, 0x1 + strh r0, [r6, 0x30] + b _0816FD38 + .pool +_0816FCC4: + ldr r0, =gUnknown_030062A0 + ldr r1, [r0] + movs r0, 0x88 + lsls r0, 1 + cmp r1, r0 + bne _0816FD38 + adds r0, r6, 0 + movs r1, 0x2 + bl StartObjectRotScalAnim + ldrb r1, [r6, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r6, 0x1] +_0816FCE6: + ldrh r0, [r6, 0x2E] + adds r0, 0x1 + strh r0, [r6, 0x2E] + b _0816FD38 + .pool +_0816FCF4: + ldr r1, =gUnknown_085E4F48 + movs r2, 0x32 + ldrsh r0, [r6, r2] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + ldrh r1, [r6, 0x34] + adds r0, r1 + strh r0, [r6, 0x34] + movs r2, 0x34 + ldrsh r0, [r6, r2] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + asrs r0, 8 + strh r0, [r6, 0x24] + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0x3 + bgt _0816FD24 + movs r2, 0x24 + ldrsh r0, [r6, r2] + negs r0, r0 + strh r0, [r6, 0x24] +_0816FD24: + adds r0, r6, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0816FD38 + adds r0, r6, 0 + bl RemoveObjectAndFreeTiles +_0816FD38: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816FB38 + + thumb_func_start sub_816FD44 +sub_816FD44: @ 816FD44 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0816FD7C + cmp r0, 0x1 + bgt _0816FD5A + cmp r0, 0 + beq _0816FD60 + b _0816FDB0 +_0816FD5A: + cmp r0, 0x2 + beq _0816FD9C + b _0816FDB0 +_0816FD60: + ldr r0, =gUnknown_030062A0 + ldr r0, [r0] + cmp r0, 0x80 + bne _0816FDB0 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x5 + negs r1, r1 + ands r1, r0 + strb r1, [r2] + b _0816FD90 + .pool +_0816FD7C: + ldr r0, =gUnknown_030062A0 + ldr r1, [r0] + movs r0, 0x88 + lsls r0, 1 + cmp r1, r0 + bne _0816FDB0 + adds r0, r4, 0 + movs r1, 0x3 + bl StartObjectRotScalAnim +_0816FD90: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0816FDB0 + .pool +_0816FD9C: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0816FDB0 + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_0816FDB0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816FD44 + + thumb_func_start sub_816FDB8 +sub_816FDB8: @ 816FDB8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x4] + movs r7, 0 +_0816FDD2: + lsls r5, r7, 2 + ldr r0, =gUnknown_085E4E94 + adds r0, 0x2 + adds r0, r5, r0 + ldr r2, [sp] + lsls r1, r2, 16 + asrs r1, 16 + ldrh r0, [r0] + adds r1, r0 + lsls r1, 16 + asrs r1, 16 + ldr r3, [sp, 0x4] + lsls r2, r3, 16 + asrs r0, r2, 16 + str r0, [sp, 0x8] + ldr r3, =0xfffc0000 + adds r2, r3 + ldr r0, =gUnknown_085E4F5C + asrs r2, 16 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + ldr r0, =gUnknown_02020630 + adds r4, r0 + movs r1, 0 + strh r1, [r4, 0x2E] + ldr r0, =gUnknown_085E4FA4 + adds r0, r7, r0 + ldrb r0, [r0] + strh r0, [r4, 0x30] + strh r7, [r4, 0x32] + adds r1, r4, 0 + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + mov r10, r2 + mov r3, r10 + orrs r0, r3 + strb r0, [r1] + adds r1, r7, 0 + adds r1, 0xC + movs r0, 0x1F + mov r9, r0 + mov r2, r9 + ands r1, r2 + lsls r1, 1 + ldrb r0, [r4, 0x3] + movs r3, 0x3F + negs r3, r3 + mov r8, r3 + mov r2, r8 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x3] + ldr r3, =gUnknown_085E4E94 + adds r5, r3 + ldrb r1, [r5] + adds r0, r4, 0 + bl StartObjectImageAnim + adds r0, r4, 0 + movs r1, 0 + bl StartObjectRotScalAnim + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0x8 + bls _0816FDD2 + ldr r0, =gUnknown_085E4F8C + ldr r2, [sp, 0x8] + subs r2, 0x6 + lsls r2, 16 + asrs r2, 16 + movs r1, 0x78 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + ldr r1, =gUnknown_02020630 + adds r0, r1 + movs r2, 0 + strh r2, [r0, 0x2E] + adds r2, r0, 0 + adds r2, 0x3E + ldrb r1, [r2] + mov r3, r10 + orrs r1, r3 + strb r1, [r2] + adds r2, r7, 0 + adds r2, 0xC + mov r1, r9 + ands r2, r1 + lsls r2, 1 + ldrb r1, [r0, 0x3] + mov r3, r8 + ands r1, r3 + orrs r1, r2 + strb r1, [r0, 0x3] + movs r1, 0x1 + bl StartObjectRotScalAnim + 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_816FDB8 + + thumb_func_start sub_816FEDC +sub_816FEDC: @ 816FEDC + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0816FF48 + ldr r2, =gUnknown_08329F40 + ldrh r1, [r4, 0x32] + lsls r0, r1, 24 + lsrs r0, 23 + adds r0, r2 + ldrh r3, [r0] + adds r1, 0x40 + lsls r1, 24 + lsrs r1, 23 + adds r1, r2 + movs r2, 0 + ldrsh r0, [r1, r2] + movs r1, 0x30 + ldrsh r2, [r4, r1] + adds r1, r0, 0 + muls r1, r2 + adds r0, r1, 0 + cmp r1, 0 + bge _0816FF18 + adds r0, 0xFF +_0816FF18: + lsls r0, 8 + lsrs r6, r0, 16 + lsls r0, r3, 16 + asrs r3, r0, 16 + negs r0, r3 + muls r0, r2 + cmp r0, 0 + bge _0816FF2A + adds r0, 0xFF +_0816FF2A: + lsls r0, 8 + lsrs r5, r0, 16 + adds r0, r3, 0 + muls r0, r2 + cmp r0, 0 + bge _0816FF38 + adds r0, 0xFF +_0816FF38: + lsls r0, 8 + lsrs r2, r0, 16 + adds r1, r6, 0 + adds r3, r5, 0 + str r1, [sp] + movs r0, 0x1 + bl SetSpriteTransformationMatrix +_0816FF48: + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0x1 + beq _0816FF9C + cmp r0, 0x1 + ble _0816FF58 + cmp r0, 0x2 + beq _0816FFFE +_0816FF58: + ldrb r0, [r4, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r1, [r4, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4, 0x3] + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0x3 + movs r3, 0x3 + bl CalcVecFromObjectCenterToObjectUpperLeft + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + movs r1, 0 + movs r0, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0x80 + strh r0, [r4, 0x30] + strh r1, [r4, 0x32] + strh r1, [r4, 0x34] + b _08170038 + .pool +_0816FF9C: + ldrh r0, [r4, 0x34] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x8C + bl Sin + negs r0, r0 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x34] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x78 + bl Sin + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x7 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x34] + adds r0, 0x3 + strh r0, [r4, 0x34] + movs r1, 0x20 + ldrsh r0, [r4, r1] + movs r2, 0x24 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bgt _08170038 + ldrb r0, [r4, 0x5] + movs r1, 0xC + orrs r0, r1 + strb r0, [r4, 0x5] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0x14 + strh r0, [r4, 0x20] + movs r0, 0x28 + strh r0, [r4, 0x22] + movs r0, 0x80 + lsls r0, 2 + strh r0, [r4, 0x30] + movs r0, 0 + strh r0, [r4, 0x32] + movs r0, 0x10 + b _08170036 +_0816FFFE: + ldrh r0, [r4, 0x34] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x22 + bl Sin + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x34] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3C + bl Cos + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x2 + strh r0, [r4, 0x30] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x5 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _08170038 + ldrh r0, [r4, 0x34] + adds r0, 0x1 +_08170036: + strh r0, [r4, 0x34] +_08170038: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_816FEDC + + thumb_func_start sub_8170040 +sub_8170040: @ 8170040 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08170056 + adds r4, r5, 0 + adds r4, 0x3E + cmp r0, 0x1 + beq _0817008E +_08170056: + adds r4, r5, 0 + adds r4, 0x3E + ldrb r1, [r4] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r4] + ldrb r0, [r5, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r5, 0x1] + ldrb r1, [r5, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x24 + orrs r0, r1 + strb r0, [r5, 0x3] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x3 + movs r3, 0x3 + bl CalcVecFromObjectCenterToObjectUpperLeft + movs r0, 0 + strh r0, [r5, 0x30] + movs r0, 0x1 + strh r0, [r5, 0x2E] +_0817008E: + ldrh r0, [r5, 0x3C] + adds r0, 0x1 + strh r0, [r5, 0x3C] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081700A6 + ldrb r0, [r4] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4] + b _081700BE +_081700A6: + ldrb r0, [r4] + movs r1, 0x5 + negs r1, r1 + ands r1, r0 + strb r1, [r4] + ldrh r1, [r5, 0x30] + movs r2, 0x30 + ldrsh r0, [r5, r2] + cmp r0, 0x3F + bgt _081700BE + adds r0, r1, 0x1 + strh r0, [r5, 0x30] +_081700BE: + ldr r1, =gUnknown_08329F40 + ldrh r0, [r5, 0x30] + lsls r0, 24 + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + subs r1, r0 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + movs r0, 0x12 + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8170040 + .align 2, 0 @ Don't pad with nop. diff --git a/asm/intro_credits_graphics.s b/asm/intro_credits_graphics.s new file mode 100644 index 000000000..9a933c66b --- /dev/null +++ b/asm/intro_credits_graphics.s @@ -0,0 +1,1077 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start load_intro_part2_graphics +load_intro_part2_graphics: @ 817B064 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_085F0740 + ldr r1, =0x06004000 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F0BC0 + ldr r1, =0x06007800 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F06E0 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + cmp r4, 0 + beq _0817B08C + cmp r4, 0x1 + beq _0817B0EC +_0817B08C: + ldr r0, =gUnknown_085F0DBC + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F1398 + ldr r1, =0x06003000 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F0CFC + movs r1, 0 + movs r2, 0x60 + bl gpu_pal_apply + ldr r0, =gUnknown_085F5064 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085F1668 + movs r1, 0x80 + lsls r1, 1 + movs r2, 0x20 + bl gpu_pal_apply + bl sub_817B76C + b _0817B11E + .pool +_0817B0EC: + ldr r0, =gUnknown_085F1824 + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F1EAC + ldr r1, =0x06003000 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F17E4 + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_085F50EC + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085F21B0 + movs r1, 0x80 + lsls r1, 1 + movs r2, 0x20 + bl gpu_pal_apply + bl sub_817B788 +_0817B11E: + ldr r1, =gUnknown_0203BD28 + movs r0, 0 + strh r0, [r1] + ldr r1, =gUnknown_0300301C + movs r0, 0x8 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end load_intro_part2_graphics + + thumb_func_start sub_817B150 +sub_817B150: @ 817B150 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0817B162 + cmp r0, 0x1 + ble _0817B162 + cmp r0, 0x2 + beq _0817B194 +_0817B162: + ldr r1, =0x00000603 + movs r0, 0xE + bl SetGpuReg + ldr r1, =0x00000702 + movs r0, 0xC + bl SetGpuReg + ldr r1, =0x00000f05 + movs r0, 0xA + bl SetGpuReg + movs r1, 0xF2 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + b _0817B1B6 + .pool +_0817B194: + ldr r1, =0x00000603 + movs r0, 0xE + bl SetGpuReg + ldr r1, =0x00000702 + movs r0, 0xC + bl SetGpuReg + ldr r1, =0x00000f05 + movs r0, 0xA + bl SetGpuReg + movs r1, 0xF2 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg +_0817B1B6: + pop {r0} + bx r0 + .pool + thumb_func_end sub_817B150 + + thumb_func_start sub_817B1C8 +sub_817B1C8: @ 817B1C8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_085F0740 + ldr r1, =0x06004000 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F0BC0 + ldr r1, =0x06007800 + bl LZ77UnCompVram + cmp r4, 0x4 + bhi _0817B214 + lsls r0, r4, 2 + ldr r1, =_0817B200 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0817B200: + .4byte _0817B214 + .4byte _0817B270 + .4byte _0817B2DC + .4byte _0817B2DC + .4byte _0817B334 +_0817B214: + ldr r0, =gUnknown_085F06E0 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_085F0DBC + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F1398 + ldr r1, =0x06003000 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F0CFC + movs r1, 0 + movs r2, 0x60 + bl gpu_pal_apply + ldr r0, =gUnknown_085F5064 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085F16A8 + ldr r1, =0x06010000 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F1668 + b _0817B2A6 + .pool +_0817B270: + ldr r0, =gUnknown_085F0700 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_085F0DBC + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F1398 + ldr r1, =0x06003000 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F0D5C + movs r1, 0 + movs r2, 0x60 + bl gpu_pal_apply + ldr r0, =gUnknown_085F5064 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085F16A8 + ldr r1, =0x06010000 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F1688 +_0817B2A6: + movs r1, 0x80 + lsls r1, 1 + movs r2, 0x20 + bl gpu_pal_apply + bl sub_817B76C + b _0817B370 + .pool +_0817B2DC: + ldr r0, =gUnknown_085F0700 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_085F1824 + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F1EAC + ldr r1, =0x06003000 + bl LZ77UnCompVram + ldr r4, =gUnknown_085F1804 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_085F50EC + bl LoadCompressedObjectPic + movs r1, 0x80 + lsls r1, 1 + adds r0, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply + bl sub_817B788 + b _0817B370 + .pool +_0817B334: + ldr r0, =gUnknown_085F0720 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_085F235C + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F2568 + ldr r1, =0x06003000 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F231C + movs r1, 0 + movs r2, 0x40 + bl gpu_pal_apply + ldr r0, =gUnknown_085F5180 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085F2548 + movs r1, 0x80 + lsls r1, 1 + movs r2, 0x20 + bl gpu_pal_apply + bl sub_817B7A4 +_0817B370: + ldr r1, =gUnknown_0300301C + movs r0, 0x8 + strb r0, [r1] + ldr r1, =gUnknown_0203BD28 + movs r0, 0 + strh r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817B1C8 + + thumb_func_start sub_817B3A8 +sub_817B3A8: @ 817B3A8 + push {lr} + ldr r1, =0x00000603 + movs r0, 0xE + bl SetGpuReg + ldr r1, =0x00000702 + movs r0, 0xC + bl SetGpuReg + ldr r1, =0x00000f05 + movs r0, 0xA + bl SetGpuReg + movs r1, 0xFA + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end sub_817B3A8 + + thumb_func_start sub_817B3DC +sub_817B3DC: @ 817B3DC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + mov r8, r2 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 16 + lsrs r6, 16 + mov r0, r8 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r3, 16 + lsrs r3, 16 + ldr r1, =sub_817B458 + mov r9, r1 + mov r0, r9 + movs r1, 0 + str r3, [sp] + bl CreateTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + strh r5, [r0, 0x8] + strh r6, [r0, 0xA] + strh r2, [r0, 0xC] + strh r2, [r0, 0xE] + mov r1, r8 + strh r1, [r0, 0x10] + strh r2, [r0, 0x12] + strh r2, [r0, 0x14] + ldr r3, [sp] + strh r3, [r0, 0x16] + movs r1, 0x8 + strh r1, [r0, 0x18] + strh r2, [r0, 0x1A] + adds r0, r4, 0 + bl _call_via_r9 + adds r0, r4, 0 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_817B3DC + + thumb_func_start sub_817B458 +sub_817B458: @ 817B458 + 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, 0xA] + lsls r2, r0, 16 + cmp r2, 0 + beq _0817B4A0 + movs r1, 0xC + ldrsh r0, [r4, r1] + lsls r0, 16 + ldrh r1, [r4, 0xE] + adds r1, r0, r1 + lsrs r0, r2, 12 + subs r1, r0 + asrs r0, r1, 16 + strh r0, [r4, 0xC] + strh r1, [r4, 0xE] + ldrh r1, [r4, 0xC] + movs r0, 0x14 + bl SetGpuReg + ldr r2, =gUnknown_0203BD24 + ldr r0, =gUnknown_0203BD26 + ldrh r1, [r0] + ldrh r2, [r2] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x16 + bl SetGpuReg +_0817B4A0: + ldrh r0, [r4, 0x10] + lsls r2, r0, 16 + cmp r2, 0 + beq _0817B4FA + movs r1, 0x12 + ldrsh r0, [r4, r1] + lsls r0, 16 + ldrh r1, [r4, 0x14] + adds r1, r0, r1 + lsrs r0, r2, 12 + subs r1, r0 + asrs r0, r1, 16 + strh r0, [r4, 0x12] + strh r1, [r4, 0x14] + ldrh r1, [r4, 0x12] + movs r0, 0x18 + bl SetGpuReg + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0817B4F0 + ldr r2, =gUnknown_0203BD24 + ldr r0, =gUnknown_0203BD26 + ldrh r1, [r0] + ldrh r2, [r2] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1A + bl SetGpuReg + b _0817B4FA + .pool +_0817B4F0: + ldr r0, =gUnknown_0203BD24 + ldrh r1, [r0] + movs r0, 0x1A + bl SetGpuReg +_0817B4FA: + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r2, r1, r0 + ldrh r0, [r2, 0x16] + lsls r3, r0, 16 + cmp r3, 0 + beq _0817B532 + movs r1, 0x18 + ldrsh r0, [r2, r1] + lsls r0, 16 + ldrh r1, [r2, 0x1A] + adds r1, r0, r1 + lsrs r0, r3, 12 + subs r1, r0 + asrs r0, r1, 16 + strh r0, [r2, 0x18] + strh r1, [r2, 0x1A] + ldrh r1, [r2, 0x18] + movs r0, 0x1C + bl SetGpuReg + ldr r0, =gUnknown_0203BD24 + ldrh r1, [r0] + movs r0, 0x1E + bl SetGpuReg +_0817B532: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817B458 + + thumb_func_start sub_817B540 +sub_817B540: @ 817B540 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0817B620 + cmp r0, 0x1 + ble _0817B554 + cmp r0, 0x2 + beq _0817B5B8 +_0817B554: + ldr r0, =gMain + ldr r2, [r0, 0x20] + movs r0, 0x3 + ands r0, r2 + cmp r0, 0 + bne _0817B620 + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0817B620 + movs r0, 0x4 + ands r2, r0 + cmp r2, 0 + beq _0817B58C + ldr r2, =gUnknown_02037714 + ldrh r1, [r2, 0x12] + mov r0, sp + strh r1, [r0] + ldrh r1, [r2, 0x14] + b _0817B596 + .pool +_0817B58C: + ldr r2, =gUnknown_02037714 + ldrh r1, [r2, 0x14] + mov r0, sp + strh r1, [r0] + ldrh r1, [r2, 0x12] +_0817B596: + adds r0, 0x2 + strh r1, [r0] + adds r4, r0, 0 + mov r0, sp + movs r1, 0x9 + movs r2, 0x2 + bl gpu_pal_apply + adds r0, r4, 0 + movs r1, 0xA + movs r2, 0x2 + bl gpu_pal_apply + b _0817B620 + .pool +_0817B5B8: + ldr r0, =gMain + ldr r2, [r0, 0x20] + movs r0, 0x3 + ands r0, r2 + cmp r0, 0 + bne _0817B620 + ldr r0, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0817B620 + movs r0, 0x4 + ands r2, r0 + cmp r2, 0 + beq _0817B5F8 + mov r1, sp + ldr r2, =0x00003d27 + adds r0, r2, 0 + strh r0, [r1] + adds r1, 0x2 + ldr r2, =0x00000295 + b _0817B606 + .pool +_0817B5F8: + mov r1, sp + movs r2, 0xC7 + lsls r2, 2 + adds r0, r2, 0 + strh r0, [r1] + adds r1, 0x2 + ldr r2, =0x00003d27 +_0817B606: + adds r0, r2, 0 + strh r0, [r1] + adds r4, r1, 0 + mov r0, sp + movs r1, 0xC + movs r2, 0x2 + bl gpu_pal_apply + adds r0, r4, 0 + movs r1, 0xD + movs r2, 0x2 + bl gpu_pal_apply +_0817B620: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817B540 + + thumb_func_start sub_817B62C +sub_817B62C: @ 817B62C + push {lr} + adds r2, r0, 0 + ldr r0, =gUnknown_0203BD28 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x2 + beq _0817B690 + cmp r0, 0 + beq _0817B64C + adds r0, r2, 0 + bl RemoveObjectAndFreeTiles + b _0817B690 + .pool +_0817B64C: + movs r1, 0x20 + ldrsh r0, [r2, r1] + lsls r0, 16 + ldrh r1, [r2, 0x32] + orrs r0, r1 + ldrh r1, [r2, 0x30] + adds r0, r1 + asrs r1, r0, 16 + strh r1, [r2, 0x20] + strh r0, [r2, 0x32] + cmp r1, 0xFF + ble _0817B668 + ldr r0, =0x0000ffe0 + strh r0, [r2, 0x20] +_0817B668: + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0817B688 + ldr r1, =gUnknown_0203BD24 + ldr r0, =gUnknown_0203BD26 + ldrh r0, [r0] + ldrh r1, [r1] + adds r0, r1 + b _0817B68C + .pool +_0817B688: + ldr r0, =gUnknown_0203BD24 + ldrh r0, [r0] +_0817B68C: + negs r0, r0 + strh r0, [r2, 0x26] +_0817B690: + pop {r0} + bx r0 + .pool + thumb_func_end sub_817B62C + + thumb_func_start sub_817B698 +sub_817B698: @ 817B698 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + str r1, [sp, 0x4] + str r2, [sp, 0x8] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + movs r7, 0 + cmp r7, r8 + bcs _0817B74E + ldr r0, =gUnknown_02020630 + mov r10, r0 + movs r2, 0x3F + mov r9, r2 +_0817B6C2: + lsls r6, r7, 3 + ldr r0, [sp, 0x4] + adds r6, r0 + ldrb r1, [r6, 0x1] + ldrb r2, [r6, 0x2] + ldrb r3, [r6, 0x3] + ldr r0, =gUnknown_085F504C + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + mov r2, r10 + adds r4, r5, r2 + ldrb r2, [r6] + lsls r1, r2, 26 + lsrs r1, 30 + lsrs r2, 6 + adds r0, r4, 0 + movs r3, 0 + bl CalcVecFromObjectCenterToObjectUpperLeft + ldrb r3, [r4, 0x5] + movs r0, 0xC + orrs r3, r0 + strb r3, [r4, 0x5] + ldrb r1, [r6] + lsls r1, 26 + lsrs r1, 30 + lsls r1, 6 + ldrb r2, [r4, 0x1] + mov r0, r9 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r1, [r6] + lsrs r1, 6 + lsls r1, 6 + ldrb r2, [r4, 0x3] + mov r0, r9 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x3] + movs r0, 0xF + ands r3, r0 + strb r3, [r4, 0x5] + ldr r0, =gUnknown_02020638 + adds r5, r0 + ldr r2, [sp, 0x8] + str r2, [r5] + ldrb r1, [r6] + lsls r1, 28 + lsrs r1, 28 + adds r0, r4, 0 + bl StartObjectImageAnim + movs r1, 0 + mov r0, sp + ldrh r0, [r0] + strh r0, [r4, 0x2E] + ldrh r0, [r6, 0x4] + strh r0, [r4, 0x30] + strh r1, [r4, 0x32] + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, r8 + bcc _0817B6C2 +_0817B74E: + 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_817B698 + + thumb_func_start sub_817B76C +sub_817B76C: @ 817B76C + push {lr} + ldr r1, =gUnknown_085F50A4 + ldr r2, =gUnknown_085F5094 + movs r0, 0 + movs r3, 0x9 + bl sub_817B698 + pop {r0} + bx r0 + .pool + thumb_func_end sub_817B76C + + thumb_func_start sub_817B788 +sub_817B788: @ 817B788 + push {lr} + ldr r1, =gUnknown_085F5120 + ldr r2, =gUnknown_085F5114 + movs r0, 0x1 + movs r3, 0xC + bl sub_817B698 + pop {r0} + bx r0 + .pool + thumb_func_end sub_817B788 + + thumb_func_start sub_817B7A4 +sub_817B7A4: @ 817B7A4 + push {lr} + ldr r1, =gUnknown_085F519C + ldr r2, =gUnknown_085F5198 + movs r0, 0x1 + movs r3, 0x6 + bl sub_817B698 + pop {r0} + bx r0 + .pool + thumb_func_end sub_817B7A4 + + thumb_func_start nullsub_65 +nullsub_65: @ 817B7C0 + bx lr + thumb_func_end nullsub_65 + + thumb_func_start sub_817B7C4 +sub_817B7C4: @ 817B7C4 + push {r4,lr} + ldr r4, =gUnknown_02020630 + movs r1, 0x2E + ldrsh r2, [r0, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r1, [r1] + movs r2, 0x3E + adds r2, r0 + mov r12, r2 + movs r2, 0x4 + ands r2, r1 + mov r1, r12 + ldrb r3, [r1] + movs r1, 0x5 + negs r1, r1 + ands r1, r3 + orrs r1, r2 + mov r2, r12 + strb r1, [r2] + movs r1, 0x2E + ldrsh r2, [r0, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x20] + strh r1, [r0, 0x20] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x24] + strh r1, [r0, 0x24] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x26] + strh r1, [r0, 0x26] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817B7C4 + + thumb_func_start sub_817B834 +sub_817B834: @ 817B834 + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldr r0, =gUnknown_085F51EC + lsls r5, 16 + asrs r5, 16 + lsls r4, 16 + asrs r4, 16 + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x2 + bl AddObjectToFront + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldr r0, =gUnknown_085F523C + adds r4, 0x8 + lsls r4, 16 + asrs r4, 16 + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x3 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + strh r6, [r1, 0x2E] + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_817B834 + + thumb_func_start sub_817B88C +sub_817B88C: @ 817B88C + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldr r0, =gUnknown_085F5204 + lsls r5, 16 + asrs r5, 16 + lsls r4, 16 + asrs r4, 16 + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x2 + bl AddObjectToFront + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldr r0, =gUnknown_085F5254 + adds r4, 0x8 + lsls r4, 16 + asrs r4, 16 + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x3 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + strh r6, [r1, 0x2E] + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_817B88C + + thumb_func_start nullsub_66 +nullsub_66: @ 817B8E4 + bx lr + thumb_func_end nullsub_66 + + thumb_func_start sub_817B8E8 +sub_817B8E8: @ 817B8E8 + push {r4,lr} + ldr r4, =gUnknown_02020630 + movs r1, 0x2E + ldrsh r2, [r0, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r1, [r1] + movs r2, 0x3E + adds r2, r0 + mov r12, r2 + movs r2, 0x4 + ands r2, r1 + mov r1, r12 + ldrb r3, [r1] + movs r1, 0x5 + negs r1, r1 + ands r1, r3 + orrs r1, r2 + mov r2, r12 + strb r1, [r2] + movs r1, 0x2E + ldrsh r2, [r0, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x22] + strh r1, [r0, 0x22] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x24] + strh r1, [r0, 0x24] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x26] + strh r1, [r0, 0x26] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817B8E8 + + thumb_func_start sub_817B948 +sub_817B948: @ 817B948 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r2, r0, 0 + adds r5, r1, 0 + ldr r0, =gUnknown_085F528C + mov r8, r0 + lsls r2, 16 + asrs r4, r2, 16 + ldr r0, =0xffe00000 + adds r2, r0 + asrs r2, 16 + lsls r5, 16 + asrs r5, 16 + mov r0, r8 + adds r1, r2, 0 + adds r2, r5, 0 + movs r3, 0x5 + bl AddObjectToFront + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + adds r4, 0x20 + lsls r4, 16 + asrs r4, 16 + mov r0, r8 + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0x6 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_02020630 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r0, r4, r5 + strh r6, [r0, 0x2E] + movs r1, 0x1 + bl StartObjectImageAnim + adds r5, 0x1C + adds r4, r5 + ldr r0, =sub_817B8E8 + str r0, [r4] + adds r0, r6, 0 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_817B948 + + thumb_func_start sub_817B9C4 +sub_817B9C4: @ 817B9C4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r2, r0, 0 + adds r5, r1, 0 + ldr r0, =gUnknown_085F52A4 + mov r8, r0 + lsls r2, 16 + asrs r4, r2, 16 + ldr r0, =0xffe00000 + adds r2, r0 + asrs r2, 16 + lsls r5, 16 + asrs r5, 16 + mov r0, r8 + adds r1, r2, 0 + adds r2, r5, 0 + movs r3, 0x5 + bl AddObjectToFront + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + adds r4, 0x20 + lsls r4, 16 + asrs r4, 16 + mov r0, r8 + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0x6 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_02020630 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r0, r4, r5 + strh r6, [r0, 0x2E] + movs r1, 0x1 + bl StartObjectImageAnim + adds r5, 0x1C + adds r4, r5 + ldr r0, =sub_817B8E8 + str r0, [r4] + adds r0, r6, 0 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_817B9C4 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/item.s b/asm/item.s index aeb02e3f3..fcc7eb6a8 100644 --- a/asm/item.s +++ b/asm/item.s @@ -8,7 +8,7 @@ thumb_func_start decrypt_bag_item_quantity decrypt_bag_item_quantity: @ 80D6554 adds r1, r0, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xAC ldr r0, [r0] @@ -24,7 +24,7 @@ decrypt_bag_item_quantity: @ 80D6554 encrypt_bag_item_quantity: @ 80D656C lsls r1, 16 lsrs r1, 16 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r2, [r2] adds r2, 0xAC ldr r2, [r2] @@ -108,7 +108,7 @@ call_encrypt_decrypt_all_item_quantities: @ 80D65E4 init_bag_pockets: @ 80D65F0 push {r4,lr} ldr r1, =gUnknown_02039DD8 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] movs r3, 0xAC lsls r3, 3 @@ -156,7 +156,7 @@ itemid_get_name: @ 80D6644 bl itemid_get_item adds r1, r0, 0 adds r0, r4, 0 - bl CopyString + bl StringCopy pop {r4} pop {r0} bx r0 @@ -181,7 +181,7 @@ _080D667C: ldr r1, =gUnknown_085EFCD4 _080D667E: adds r0, r4, 0 - bl CopyString + bl StringCopy b _080D66BE .pool _080D668C: @@ -205,7 +205,7 @@ _080D66B0: bl itemid_get_item adds r1, r0, 0 adds r0, r4, 0 - bl CopyString + bl StringCopy _080D66BE: pop {r4} pop {r0} @@ -221,12 +221,12 @@ GetBerryCountString: @ 80D66C4 bhi _080D66CE ldr r4, =gUnknown_085EFCDF _080D66CE: - bl CopyString + bl StringCopy movs r1, 0 strb r1, [r0] adds r0, 0x1 adds r1, r4, 0 - bl CopyString + bl StringCopy pop {r4} pop {r0} bx r0 @@ -992,7 +992,7 @@ _080D6CA6: sub_80D6CAC: @ 80D6CAC push {lr} movs r1, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] movs r3, 0x93 lsls r3, 3 @@ -1027,7 +1027,7 @@ sub_80D6CE4: @ 80D6CE4 push {r4,lr} movs r2, 0 movs r1, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r3, [r0] movs r4, 0x93 lsls r4, 3 @@ -1063,7 +1063,7 @@ sub_80D6D1C: @ 80D6D1C lsrs r5, r1, 16 movs r4, 0 _080D6D28: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] lsls r1, r4, 2 adds r0, r2, r1 @@ -1110,7 +1110,7 @@ sub_80D6D70: @ 80D6D70 movs r0, 0xC8 bl AllocZeroed adds r7, r0, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] movs r0, 0x93 lsls r0, 3 @@ -1179,7 +1179,7 @@ _080D6E10: adds r1, r5, 0 bl sub_80D6588 _080D6E20: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x93 lsls r1, 3 @@ -1205,7 +1205,7 @@ sub_80D6E48: @ 80D6E48 lsls r0, 24 lsls r1, 16 lsrs r1, 16 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r2, [r2] lsrs r0, 22 adds r3, r2, r0 @@ -1240,7 +1240,7 @@ _080D6E88: adds r6, r1, 0 cmp r4, 0x31 bhi _080D6ECA - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr mov r12, r0 lsls r5, r2, 2 movs r7, 0x93 @@ -1283,7 +1283,7 @@ _080D6ECA: thumb_func_start sub_80D6EDC sub_80D6EDC: @ 80D6EDC push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00000496 adds r1, r0, r2 @@ -1604,7 +1604,7 @@ sub_80D710C: @ 80D710C lsrs r5, r0, 16 lsls r1, 16 lsrs r4, r1, 16 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] ldr r1, =0x00000ca9 adds r0, r3, r1 @@ -1664,7 +1664,7 @@ sub_80D7184: @ 80D7184 lsrs r5, r0, 16 lsls r1, 16 lsrs r4, r1, 16 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] ldr r1, =0x00000ca9 adds r0, r3, r1 @@ -1731,7 +1731,7 @@ sub_80D7204: @ 80D7204 lsrs r7, r0, 16 lsls r1, 16 lsrs r4, r1, 16 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] ldr r1, =0x00000ca9 adds r0, r3, r1 @@ -1879,7 +1879,7 @@ sub_80D7334: @ 80D7334 mov r9, r0 lsls r1, 16 lsrs r4, r1, 16 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] ldr r1, =0x00000ca9 adds r0, r3, r1 diff --git a/asm/item_use.s b/asm/item_use.s index 987616448..e98b359fa 100644 --- a/asm/item_use.s +++ b/asm/item_use.s @@ -140,9 +140,9 @@ DisplayCannotUseItemMessage: @ 80FD164 lsrs r5, r0, 24 lsls r4, 24 lsrs r4, 24 - ldr r6, =gUnknown_02021FC4 + ldr r6, =gStringVar4 adds r0, r6, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders cmp r4, 0 bne _080FD1B4 bl InBattlePyramid @@ -1532,7 +1532,7 @@ ItemUseOutOfBattle_CoinCase: @ 80FDC34 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 bl GetCoins adds r1, r0, 0 lsls r1, 16 @@ -1540,11 +1540,11 @@ ItemUseOutOfBattle_CoinCase: @ 80FDC34 adds r0, r4, 0 movs r2, 0 movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E9026 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r1, =gTasks lsls r0, r5, 2 adds r0, r5 @@ -1578,17 +1578,17 @@ ItemUseOutOfBattle_PowderJar: @ 80FDCA4 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 bl sub_80247BC adds r1, r0, 0 adds r0, r4, 0 movs r2, 0 movs r3, 0x5 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E9138 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r1, =gTasks lsls r0, r5, 2 adds r0, r5 @@ -1938,13 +1938,13 @@ task08_0809AD8C: @ 80FDFBC push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 beq _080FE000 - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 ldr r0, =gUnknown_0203CE7C ldrh r0, [r0] bl ItemIdToBattleMoveId @@ -1955,11 +1955,11 @@ task08_0809AD8C: @ 80FDFBC ldr r0, =gMoveNames adds r1, r0 adds r0, r4, 0 - bl CopyString - ldr r4, =gUnknown_02021FC4 + bl StringCopy + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E9058 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r3, =sub_80FE024 adds r0, r5, 0 movs r1, 0x1 @@ -2007,11 +2007,11 @@ sub_80FE058: @ 80FE058 movs r1, 0x1 bl remove_item ldrh r0, [r4] - ldr r1, =gUnknown_02021DC4 + ldr r1, =gStringVar2 bl itemid_get_name - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E9080 - bl ExpandStringRefs + bl StringExpandPlaceholders bl InBattlePyramid lsls r0, 24 cmp r0, 0 @@ -2138,7 +2138,7 @@ sub_80FE164: @ 80FE164 lsls r0, 24 cmp r0, 0 bne _080FE1B8 - ldr r2, =gUnknown_02021FC4 + ldr r2, =gStringVar4 ldr r3, =bag_menu_inits_lists_menu adds r0, r5, 0 movs r1, 0x1 @@ -2146,7 +2146,7 @@ sub_80FE164: @ 80FE164 b _080FE1C2 .pool _080FE1B8: - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 ldr r2, =sub_81C6714 adds r0, r6, 0 bl DisplayItemMessageInBattlePyramid @@ -2181,7 +2181,7 @@ sub_80FE1D0: @ 80FE1D0 lsls r0, 24 cmp r0, 0 bne _080FE21C - ldr r2, =gUnknown_02021FC4 + ldr r2, =gStringVar4 ldr r3, =bag_menu_inits_lists_menu adds r0, r4, 0 movs r1, 0x1 @@ -2189,7 +2189,7 @@ sub_80FE1D0: @ 80FE1D0 b _080FE226 .pool _080FE21C: - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 ldr r2, =sub_81C6714 adds r0, r5, 0 bl DisplayItemMessageInBattlePyramid @@ -2207,7 +2207,7 @@ ItemUseOutOfBattle_BlackWhiteFlute: @ 80FE234 lsrs r5, r0, 24 ldr r4, =gUnknown_0203CE7C ldrh r0, [r4] - ldr r1, =gUnknown_02021DC4 + ldr r1, =gStringVar2 bl itemid_get_name ldrh r0, [r4] cmp r0, 0x2B @@ -2216,9 +2216,9 @@ ItemUseOutOfBattle_BlackWhiteFlute: @ 80FE234 bl FlagSet ldr r0, =0x000008ae bl FlagReset - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E90C6 - bl ExpandStringRefs + bl StringExpandPlaceholders b _080FE28C .pool _080FE278: @@ -2226,9 +2226,9 @@ _080FE278: bl FlagSet ldr r0, =0x000008ad bl FlagReset - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E90F4 - bl ExpandStringRefs + bl StringExpandPlaceholders _080FE28C: ldr r1, =gTasks lsls r0, r5, 2 @@ -2275,7 +2275,7 @@ re_escape_rope: @ 80FE2D8 adds r0, r1 movs r1, 0 strh r1, [r0, 0x8] - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 ldr r2, =task08_080A1C44 adds r0, r4, 0 bl DisplayItemMessageOnField @@ -2407,7 +2407,7 @@ sub_80FE408: @ 80FE408 lsls r0, 24 lsrs r4, r0, 24 adds r5, r4, 0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -2494,7 +2494,7 @@ ItemUseInBattle_StatIncrease: @ 80FE4B8 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_0203CE7C ldrh r1, [r1] @@ -2618,7 +2618,7 @@ ItemUseInBattle_Escape: @ 80FE5E4 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x8 ands r0, r1 @@ -2629,7 +2629,7 @@ ItemUseInBattle_Escape: @ 80FE5E4 lsls r0, 24 cmp r0, 0 bne _080FE620 - ldr r2, =gUnknown_02021FC4 + ldr r2, =gStringVar4 ldr r3, =unknown_ItemMenu_Confirm adds r0, r4, 0 movs r1, 0x1 @@ -2637,7 +2637,7 @@ ItemUseInBattle_Escape: @ 80FE5E4 b _080FE646 .pool _080FE620: - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 ldr r2, =sub_81C5B14 adds r0, r4, 0 bl DisplayItemMessageInBattlePyramid diff --git a/asm/libagbsyscall.s b/asm/libagbsyscall.s index 6161eb2df..d5639f689 100644 --- a/asm/libagbsyscall.s +++ b/asm/libagbsyscall.s @@ -1,3 +1,4 @@ + .include "constants/gba_constants.inc" .include "asm/macros.inc" .syntax unified @@ -87,10 +88,10 @@ RegisterRamReset: @ 82E70A8 thumb_func_start SoftReset @ void SoftReset() SoftReset: @ 82E70AC - ldr r3, =0x04000208 + ldr r3, =REG_IME movs r2, 0 strb r2, [r3] - ldr r1, =gUnknown_03007F00 + ldr r1, =0x3007F00 mov sp, r1 swi 0x1 swi 0 diff --git a/asm/librtc.s b/asm/librtc.s deleted file mode 100644 index 87ce5b415..000000000 --- a/asm/librtc.s +++ /dev/null @@ -1,1160 +0,0 @@ - .include "asm/macros.inc" - - .syntax unified - - .text - - thumb_func_start RTC_SetReadWrite -@ void RTC_SetReadWrite() -RTC_SetReadWrite: @ 82E2150 - push {r7,lr} - mov r7, sp - bl RTC_SetReadWriteInternal - ldr r0, =gUnknown_03001A7E - movs r1, 0 - strb r1, [r0] - pop {r7} - pop {r0} - bx r0 - .pool - thumb_func_end RTC_SetReadWrite - - thumb_func_start RTC_SetReadOnly -@ void RTC_SetReadOnly() -RTC_SetReadOnly: @ 82E2168 - push {r7,lr} - mov r7, sp - bl RTC_SetReadOnlyInternal - ldr r0, =gUnknown_03001A7E - movs r1, 0x1 - strb r1, [r0] - pop {r7} - pop {r0} - bx r0 - .pool - thumb_func_end RTC_SetReadOnly - - thumb_func_start RTC_Init -@ u8 RTC_Init() -RTC_Init: @ 82E2180 - push {r7,lr} - sub sp, 0x10 - mov r7, sp - adds r1, r7, 0x4 - adds r0, r1, 0 - bl RTC_GetControlReg - lsls r1, r0, 24 - lsrs r0, r1, 24 - cmp r0, 0 - bne _082E219A - movs r0, 0 - b _082E224E -_082E219A: - adds r0, r7, 0 - movs r1, 0 - strb r1, [r0] - adds r0, r7, 0x4 - ldrb r1, [r0, 0x7] - movs r2, 0xC0 - adds r0, r1, 0 - ands r0, r2 - adds r2, r0, 0 - lsls r1, r2, 24 - lsrs r0, r1, 24 - cmp r0, 0x80 - beq _082E21CA - adds r0, r7, 0x4 - ldrb r1, [r0, 0x7] - movs r2, 0xC0 - adds r0, r1, 0 - ands r0, r2 - adds r2, r0, 0 - lsls r1, r2, 24 - lsrs r0, r1, 24 - cmp r0, 0 - bne _082E21E8 - b _082E21CA -_082E21CA: - bl RTC_Reset - lsls r1, r0, 24 - lsrs r0, r1, 24 - cmp r0, 0 - bne _082E21DA - movs r0, 0 - b _082E224E -_082E21DA: - adds r1, r7, 0 - adds r0, r7, 0 - adds r1, r7, 0 - ldrb r2, [r1] - adds r1, r2, 0x1 - adds r2, r1, 0 - strb r2, [r0] -_082E21E8: - adds r1, r7, 0x4 - adds r0, r1, 0 - bl RTC_GetTime - adds r0, r7, 0x4 - ldrb r1, [r0, 0x6] - movs r2, 0x80 - adds r0, r1, 0 - ands r0, r2 - adds r2, r0, 0 - lsls r1, r2, 24 - lsrs r0, r1, 24 - cmp r0, 0 - beq _082E2236 - bl RTC_Reset - lsls r1, r0, 24 - lsrs r0, r1, 24 - cmp r0, 0 - bne _082E2228 - adds r0, r7, 0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r1, r0, 0 - movs r2, 0xF - adds r0, r1, 0 - bics r0, r2 - adds r1, r0, 0 - lsls r0, r1, 24 - lsrs r1, r0, 24 - adds r0, r1, 0 - b _082E224E -_082E2228: - adds r1, r7, 0 - adds r0, r7, 0 - adds r1, r7, 0 - ldrb r2, [r1] - adds r1, r2, 0x1 - adds r2, r1, 0 - strb r2, [r0] -_082E2236: - adds r0, r7, 0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r1, r0, 0 - movs r2, 0x1 - adds r0, r1, 0 - orrs r0, r2 - adds r1, r0, 0 - lsls r0, r1, 24 - lsrs r1, r0, 24 - adds r0, r1, 0 - b _082E224E -_082E224E: - add sp, 0x10 - pop {r7} - pop {r1} - bx r1 - thumb_func_end RTC_Init - - thumb_func_start RTC_Reset -@ u8 RTC_Reset() -RTC_Reset: @ 82E2258 - push {r7,lr} - sub sp, 0x10 - mov r7, sp - ldr r0, =gUnknown_03001A7E - ldrb r1, [r0] - cmp r1, 0x1 - bne _082E2270 - movs r0, 0 - b _082E22D4 - .pool -_082E2270: - ldr r0, =gUnknown_03001A7E - movs r1, 0x1 - strb r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x1 - strh r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x5 - strh r1, [r0] - ldr r0, =GPIOPortDirection - movs r1, 0x7 - strh r1, [r0] - movs r0, 0x60 - bl RTC_WriteByte - ldr r0, =GPIOPortData - movs r1, 0x1 - strh r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x1 - strh r1, [r0] - ldr r0, =gUnknown_03001A7E - movs r1, 0 - strb r1, [r0] - adds r0, r7, 0x4 - ldrb r1, [r0, 0x7] - movs r2, 0 - ands r1, r2 - adds r2, r1, 0 - movs r3, 0x40 - adds r1, r2, 0 - orrs r1, r3 - adds r2, r1, 0 - strb r2, [r0, 0x7] - adds r1, r7, 0x4 - adds r0, r1, 0 - bl RTC_SetControlReg - adds r1, r7, 0 - strb r0, [r1] - adds r0, r7, 0 - ldrb r1, [r0] - adds r0, r1, 0 - b _082E22D4 - .pool -_082E22D4: - add sp, 0x10 - pop {r7} - pop {r1} - bx r1 - thumb_func_end RTC_Reset - - thumb_func_start RTC_GetControlReg -@ u8 RTC_GetControlReg(struct RTCInfo *rtc) -RTC_GetControlReg: @ 82E22DC - push {r4,r7,lr} - sub sp, 0x8 - mov r7, sp - str r0, [r7] - ldr r0, =gUnknown_03001A7E - ldrb r1, [r0] - cmp r1, 0x1 - bne _082E22F4 - movs r0, 0 - b _082E23A0 - .pool -_082E22F4: - ldr r0, =gUnknown_03001A7E - movs r1, 0x1 - strb r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x1 - strh r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x5 - strh r1, [r0] - ldr r0, =GPIOPortDirection - movs r1, 0x7 - strh r1, [r0] - movs r0, 0x63 - bl RTC_WriteByte - ldr r0, =GPIOPortDirection - movs r1, 0x5 - strh r1, [r0] - bl RTC_ReadByte - adds r1, r7, 0x4 - strb r0, [r1] - ldr r0, [r7] - adds r1, r7, 0x4 - ldrb r2, [r1] - movs r3, 0xC0 - adds r1, r2, 0 - ands r1, r3 - adds r2, r7, 0x4 - ldrb r3, [r2] - movs r4, 0x20 - adds r2, r3, 0 - ands r2, r4 - adds r4, r2, 0 - lsls r3, r4, 24 - lsrs r2, r3, 24 - lsrs r3, r2, 3 - adds r2, r3, 0 - orrs r1, r2 - adds r2, r7, 0x4 - ldrb r3, [r2] - movs r4, 0x8 - adds r2, r3, 0 - ands r2, r4 - adds r4, r2, 0 - lsls r3, r4, 24 - lsrs r2, r3, 24 - lsrs r3, r2, 2 - adds r2, r3, 0 - orrs r1, r2 - adds r2, r7, 0x4 - ldrb r3, [r2] - movs r4, 0x2 - adds r2, r3, 0 - ands r2, r4 - adds r4, r2, 0 - lsls r3, r4, 24 - lsrs r2, r3, 24 - lsrs r3, r2, 1 - adds r2, r3, 0 - orrs r1, r2 - ldrb r2, [r0, 0x7] - movs r3, 0 - ands r2, r3 - adds r3, r2, 0 - adds r2, r3, 0 - orrs r2, r1 - adds r1, r2, 0 - strb r1, [r0, 0x7] - ldr r0, =GPIOPortData - movs r1, 0x1 - strh r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x1 - strh r1, [r0] - ldr r0, =gUnknown_03001A7E - movs r1, 0 - strb r1, [r0] - movs r0, 0x1 - b _082E23A0 - .pool -_082E23A0: - add sp, 0x8 - pop {r4,r7} - pop {r1} - bx r1 - thumb_func_end RTC_GetControlReg - - thumb_func_start RTC_SetControlReg -@ u8 RTC_SetControlReg(struct RTCInfo *rtc) -RTC_SetControlReg: @ 82E23A8 - push {r4,r7,lr} - sub sp, 0x8 - mov r7, sp - str r0, [r7] - ldr r0, =gUnknown_03001A7E - ldrb r1, [r0] - cmp r1, 0x1 - bne _082E23C0 - movs r0, 0 - b _082E2448 - .pool -_082E23C0: - ldr r0, =gUnknown_03001A7E - movs r1, 0x1 - strb r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x1 - strh r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x5 - strh r1, [r0] - adds r0, r7, 0x4 - ldr r1, [r7] - ldrb r2, [r1, 0x7] - movs r3, 0x4 - adds r1, r2, 0 - ands r1, r3 - adds r2, r1, 0 - lsls r1, r2, 3 - ldr r2, [r7] - ldrb r3, [r2, 0x7] - movs r4, 0x2 - adds r2, r3, 0 - ands r2, r4 - adds r3, r2, 0 - lsls r2, r3, 2 - adds r3, r2, 0 - movs r4, 0x40 - adds r2, r3, 0 - orrs r2, r4 - orrs r1, r2 - ldr r2, [r7] - ldrb r3, [r2, 0x7] - movs r4, 0x1 - adds r2, r3, 0 - ands r2, r4 - adds r3, r2, 0 - lsls r2, r3, 1 - orrs r1, r2 - adds r2, r1, 0 - strb r2, [r0] - ldr r0, =GPIOPortDirection - movs r1, 0x7 - strh r1, [r0] - movs r0, 0x62 - bl RTC_WriteByte - adds r0, r7, 0x4 - ldrb r1, [r0] - adds r0, r1, 0 - bl RTC_WriteByteReversed - ldr r0, =GPIOPortData - movs r1, 0x1 - strh r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x1 - strh r1, [r0] - ldr r0, =gUnknown_03001A7E - movs r1, 0 - strb r1, [r0] - movs r0, 0x1 - b _082E2448 - .pool -_082E2448: - add sp, 0x8 - pop {r4,r7} - pop {r1} - bx r1 - thumb_func_end RTC_SetControlReg - - thumb_func_start RTC_GetDateTime -@ u8 RTC_GetDateTime(u8 *rtcDateTime) -RTC_GetDateTime: @ 82E2450 - push {r7,lr} - sub sp, 0x8 - mov r7, sp - str r0, [r7] - ldr r0, =gUnknown_03001A7E - ldrb r1, [r0] - cmp r1, 0x1 - bne _082E2468 - movs r0, 0 - b _082E24F8 - .pool -_082E2468: - ldr r0, =gUnknown_03001A7E - movs r1, 0x1 - strb r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x1 - strh r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x5 - strh r1, [r0] - ldr r0, =GPIOPortDirection - movs r1, 0x7 - strh r1, [r0] - movs r0, 0x65 - bl RTC_WriteByte - ldr r0, =GPIOPortDirection - movs r1, 0x5 - strh r1, [r0] - adds r0, r7, 0x4 - movs r1, 0 - strb r1, [r0] -_082E2492: - adds r0, r7, 0x4 - ldrb r1, [r0] - cmp r1, 0x6 - bls _082E24A8 - b _082E24C6 - .pool -_082E24A8: - bl RTC_ReadByte - adds r1, r7, 0x4 - ldrb r2, [r1] - ldr r3, [r7] - adds r1, r2, r3 - strb r0, [r1] - adds r1, r7, 0x4 - adds r0, r7, 0x4 - adds r1, r7, 0x4 - ldrb r2, [r1] - adds r1, r2, 0x1 - adds r2, r1, 0 - strb r2, [r0] - b _082E2492 -_082E24C6: - ldr r1, [r7] - adds r0, r1, 0x4 - ldr r2, [r7] - adds r1, r2, 0x4 - ldrb r2, [r1] - movs r3, 0x7F - adds r1, r2, 0 - ands r1, r3 - adds r2, r1, 0 - strb r2, [r0] - ldr r0, =GPIOPortData - movs r1, 0x1 - strh r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x1 - strh r1, [r0] - ldr r0, =gUnknown_03001A7E - movs r1, 0 - strb r1, [r0] - movs r0, 0x1 - b _082E24F8 - .pool -_082E24F8: - add sp, 0x8 - pop {r7} - pop {r1} - bx r1 - thumb_func_end RTC_GetDateTime - - thumb_func_start RTC_SetDateTime -@ u8 RTC_SetDateTime(u8 *rtcDateTime) -RTC_SetDateTime: @ 82E2500 - push {r7,lr} - sub sp, 0x8 - mov r7, sp - str r0, [r7] - ldr r0, =gUnknown_03001A7E - ldrb r1, [r0] - cmp r1, 0x1 - bne _082E2518 - movs r0, 0 - b _082E2594 - .pool -_082E2518: - ldr r0, =gUnknown_03001A7E - movs r1, 0x1 - strb r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x1 - strh r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x5 - strh r1, [r0] - ldr r0, =GPIOPortDirection - movs r1, 0x7 - strh r1, [r0] - movs r0, 0x64 - bl RTC_WriteByte - adds r0, r7, 0x4 - movs r1, 0 - strb r1, [r0] -_082E253C: - adds r0, r7, 0x4 - ldrb r1, [r0] - cmp r1, 0x6 - bls _082E2554 - b _082E2574 - .pool -_082E2554: - adds r0, r7, 0x4 - ldrb r1, [r0] - ldr r2, [r7] - adds r0, r1, r2 - ldrb r1, [r0] - adds r0, r1, 0 - bl RTC_WriteByteReversed - adds r1, r7, 0x4 - adds r0, r7, 0x4 - adds r1, r7, 0x4 - ldrb r2, [r1] - adds r1, r2, 0x1 - adds r2, r1, 0 - strb r2, [r0] - b _082E253C -_082E2574: - ldr r0, =GPIOPortData - movs r1, 0x1 - strh r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x1 - strh r1, [r0] - ldr r0, =gUnknown_03001A7E - movs r1, 0 - strb r1, [r0] - movs r0, 0x1 - b _082E2594 - .pool -_082E2594: - add sp, 0x8 - pop {r7} - pop {r1} - bx r1 - thumb_func_end RTC_SetDateTime - - thumb_func_start RTC_GetTime -@ u8 RTC_GetTime(u8 *rtcTime) -RTC_GetTime: @ 82E259C - push {r7,lr} - sub sp, 0x8 - mov r7, sp - str r0, [r7] - ldr r0, =gUnknown_03001A7E - ldrb r1, [r0] - cmp r1, 0x1 - bne _082E25B4 - movs r0, 0 - b _082E2648 - .pool -_082E25B4: - ldr r0, =gUnknown_03001A7E - movs r1, 0x1 - strb r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x1 - strh r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x5 - strh r1, [r0] - ldr r0, =GPIOPortDirection - movs r1, 0x7 - strh r1, [r0] - movs r0, 0x67 - bl RTC_WriteByte - ldr r0, =GPIOPortDirection - movs r1, 0x5 - strh r1, [r0] - adds r0, r7, 0x4 - movs r1, 0 - strb r1, [r0] -_082E25DE: - adds r0, r7, 0x4 - ldrb r1, [r0] - cmp r1, 0x2 - bls _082E25F4 - b _082E2614 - .pool -_082E25F4: - bl RTC_ReadByte - adds r1, r7, 0x4 - ldrb r2, [r1] - ldr r3, [r7] - adds r1, r2, r3 - adds r2, r1, 0x4 - strb r0, [r2] - adds r1, r7, 0x4 - adds r0, r7, 0x4 - adds r1, r7, 0x4 - ldrb r2, [r1] - adds r1, r2, 0x1 - adds r2, r1, 0 - strb r2, [r0] - b _082E25DE -_082E2614: - ldr r1, [r7] - adds r0, r1, 0x4 - ldr r2, [r7] - adds r1, r2, 0x4 - ldrb r2, [r1] - movs r3, 0x7F - adds r1, r2, 0 - ands r1, r3 - adds r2, r1, 0 - strb r2, [r0] - ldr r0, =GPIOPortData - movs r1, 0x1 - strh r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x1 - strh r1, [r0] - ldr r0, =gUnknown_03001A7E - movs r1, 0 - strb r1, [r0] - movs r0, 0x1 - b _082E2648 - .pool -_082E2648: - add sp, 0x8 - pop {r7} - pop {r1} - bx r1 - thumb_func_end RTC_GetTime - - thumb_func_start RTC_SetTime -@ u8 RTC_SetTime(u8 *rtcTime) -RTC_SetTime: @ 82E2650 - push {r7,lr} - sub sp, 0x8 - mov r7, sp - str r0, [r7] - ldr r0, =gUnknown_03001A7E - ldrb r1, [r0] - cmp r1, 0x1 - bne _082E2668 - movs r0, 0 - b _082E26E4 - .pool -_082E2668: - ldr r0, =gUnknown_03001A7E - movs r1, 0x1 - strb r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x1 - strh r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x5 - strh r1, [r0] - ldr r0, =GPIOPortDirection - movs r1, 0x7 - strh r1, [r0] - movs r0, 0x66 - bl RTC_WriteByte - adds r0, r7, 0x4 - movs r1, 0 - strb r1, [r0] -_082E268C: - adds r0, r7, 0x4 - ldrb r1, [r0] - cmp r1, 0x2 - bls _082E26A4 - b _082E26C6 - .pool -_082E26A4: - adds r0, r7, 0x4 - ldrb r1, [r0] - ldr r2, [r7] - adds r0, r1, r2 - adds r1, r0, 0x4 - ldrb r2, [r1] - adds r0, r2, 0 - bl RTC_WriteByteReversed - adds r1, r7, 0x4 - adds r0, r7, 0x4 - adds r1, r7, 0x4 - ldrb r2, [r1] - adds r1, r2, 0x1 - adds r2, r1, 0 - strb r2, [r0] - b _082E268C -_082E26C6: - ldr r0, =GPIOPortData - movs r1, 0x1 - strh r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x1 - strh r1, [r0] - ldr r0, =gUnknown_03001A7E - movs r1, 0 - strb r1, [r0] - movs r0, 0x1 - b _082E26E4 - .pool -_082E26E4: - add sp, 0x8 - pop {r7} - pop {r1} - bx r1 - thumb_func_end RTC_SetTime - - thumb_func_start RTC_SetUnknownData -@ u8 RTC_SetUnknownData(struct RTCInfo *rtc) -RTC_SetUnknownData: @ 82E26EC - push {r4,r7,lr} - sub sp, 0xC - mov r7, sp - str r0, [r7] - ldr r0, =gUnknown_03001A7E - ldrb r1, [r0] - cmp r1, 0x1 - bne _082E2704 - movs r0, 0 - b _082E2818 - .pool -_082E2704: - ldr r0, =gUnknown_03001A7E - movs r1, 0x1 - strb r1, [r0] - adds r0, r7, 0 - adds r0, 0x8 - ldr r1, [r7] - ldrb r2, [r1, 0x8] - movs r3, 0xF - adds r1, r2, 0 - ands r1, r3 - ldr r2, [r7] - ldrb r3, [r2, 0x8] - lsrs r2, r3, 4 - adds r3, r2, 0 - movs r4, 0xF - adds r2, r3, 0 - ands r2, r4 - adds r4, r2, 0 - lsls r3, r4, 24 - lsrs r2, r3, 24 - adds r4, r2, 0 - lsls r3, r4, 2 - adds r3, r2 - lsls r2, r3, 1 - adds r1, r2 - ldrb r2, [r0] - movs r3, 0 - ands r2, r3 - adds r3, r2, 0 - adds r2, r3, 0 - orrs r2, r1 - adds r1, r2, 0 - strb r1, [r0] - adds r0, r7, 0 - adds r0, 0x8 - ldrb r1, [r0] - cmp r1, 0xB - bhi _082E2770 - adds r0, r7, 0 - adds r0, 0x8 - ldr r1, [r7] - ldrb r2, [r0] - movs r3, 0 - ands r2, r3 - adds r3, r2, 0 - ldrb r1, [r1, 0x8] - adds r2, r3, 0 - orrs r2, r1 - adds r1, r2, 0 - strb r1, [r0] - b _082E278E - .pool -_082E2770: - adds r0, r7, 0 - adds r0, 0x8 - ldr r1, [r7] - ldrb r2, [r1, 0x8] - movs r3, 0x80 - adds r1, r2, 0 - orrs r1, r3 - ldrb r2, [r0] - movs r3, 0 - ands r2, r3 - adds r3, r2, 0 - adds r2, r3, 0 - orrs r2, r1 - adds r1, r2, 0 - strb r1, [r0] -_082E278E: - adds r0, r7, 0 - adds r0, 0x8 - ldr r1, [r7] - ldrb r2, [r0, 0x1] - movs r3, 0 - ands r2, r3 - adds r3, r2, 0 - ldrb r1, [r1, 0x9] - adds r2, r3, 0 - orrs r2, r1 - adds r1, r2, 0 - strb r1, [r0, 0x1] - ldr r0, =GPIOPortData - movs r1, 0x1 - strh r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x5 - strh r1, [r0] - ldr r0, =GPIOPortDirection - movs r1, 0x7 - strh r1, [r0] - movs r0, 0x68 - bl RTC_WriteByte - adds r0, r7, 0x4 - movs r1, 0 - strb r1, [r0] -_082E27C4: - adds r0, r7, 0x4 - ldrb r1, [r0] - cmp r1, 0x1 - bls _082E27D8 - b _082E27FA - .pool -_082E27D8: - adds r0, r7, 0 - adds r0, 0x8 - adds r1, r7, 0x4 - ldrb r2, [r1] - adds r0, r2 - ldrb r1, [r0] - adds r0, r1, 0 - bl RTC_WriteByteReversed - adds r1, r7, 0x4 - adds r0, r7, 0x4 - adds r1, r7, 0x4 - ldrb r2, [r1] - adds r1, r2, 0x1 - adds r2, r1, 0 - strb r2, [r0] - b _082E27C4 -_082E27FA: - ldr r0, =GPIOPortData - movs r1, 0x1 - strh r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x1 - strh r1, [r0] - ldr r0, =gUnknown_03001A7E - movs r1, 0 - strb r1, [r0] - movs r0, 0x1 - b _082E2818 - .pool -_082E2818: - add sp, 0xC - pop {r4,r7} - pop {r1} - bx r1 - thumb_func_end RTC_SetUnknownData - - thumb_func_start RTC_WriteByte -@ u8 RTC_WriteByte(u8 value) -RTC_WriteByte: @ 82E2820 - push {r4,r5,r7,lr} - sub sp, 0x4 - mov r7, sp - adds r1, r0, 0 - adds r2, r7, 0 - strb r1, [r2] - adds r1, r7, 0x1 - movs r2, 0 - strb r2, [r1] -_082E2832: - adds r1, r7, 0x1 - ldrb r2, [r1] - cmp r2, 0x7 - bls _082E283C - b _082E28BC -_082E283C: - adds r1, r7, 0x2 - adds r3, r7, 0 - ldrb r2, [r3] - adds r3, r7, 0x1 - ldrb r4, [r3] - movs r5, 0x7 - subs r3, r5, r4 - asrs r2, r3 - adds r3, r2, 0 - movs r4, 0x1 - adds r2, r3, 0 - ands r2, r4 - adds r3, r2, 0 - strb r3, [r1] - ldr r1, =GPIOPortData - adds r2, r7, 0x2 - ldrb r3, [r2] - adds r2, r3, 0 - lsls r3, r2, 1 - adds r2, r3, 0 - movs r3, 0x4 - orrs r2, r3 - adds r3, r2, 0 - strh r3, [r1] - ldr r1, =GPIOPortData - adds r2, r7, 0x2 - ldrb r3, [r2] - adds r2, r3, 0 - lsls r3, r2, 1 - adds r2, r3, 0 - movs r3, 0x4 - orrs r2, r3 - adds r3, r2, 0 - strh r3, [r1] - ldr r1, =GPIOPortData - adds r2, r7, 0x2 - ldrb r3, [r2] - adds r2, r3, 0 - lsls r3, r2, 1 - adds r2, r3, 0 - movs r3, 0x4 - orrs r2, r3 - adds r3, r2, 0 - strh r3, [r1] - ldr r1, =GPIOPortData - adds r2, r7, 0x2 - ldrb r3, [r2] - adds r2, r3, 0 - lsls r3, r2, 1 - adds r2, r3, 0 - movs r3, 0x5 - orrs r2, r3 - adds r3, r2, 0 - strh r3, [r1] - adds r2, r7, 0x1 - adds r1, r7, 0x1 - adds r2, r7, 0x1 - ldrb r3, [r2] - adds r2, r3, 0x1 - adds r3, r2, 0 - strb r3, [r1] - b _082E2832 - .pool -_082E28BC: - add sp, 0x4 - pop {r4,r5,r7} - pop {r1} - bx r1 - thumb_func_end RTC_WriteByte - - thumb_func_start RTC_WriteByteReversed -@ u8 RTC_WriteByteReversed(u8 value) -RTC_WriteByteReversed: @ 82E28C4 - push {r4,r7,lr} - sub sp, 0x4 - mov r7, sp - adds r1, r0, 0 - adds r2, r7, 0 - strb r1, [r2] - adds r1, r7, 0x1 - movs r2, 0 - strb r2, [r1] -_082E28D6: - adds r1, r7, 0x1 - ldrb r2, [r1] - cmp r2, 0x7 - bls _082E28E0 - b _082E295C -_082E28E0: - adds r1, r7, 0x2 - adds r3, r7, 0 - ldrb r2, [r3] - adds r3, r7, 0x1 - ldrb r4, [r3] - asrs r2, r4 - adds r3, r2, 0 - movs r4, 0x1 - adds r2, r3, 0 - ands r2, r4 - adds r3, r2, 0 - strb r3, [r1] - ldr r1, =GPIOPortData - adds r2, r7, 0x2 - ldrb r3, [r2] - adds r2, r3, 0 - lsls r3, r2, 1 - adds r2, r3, 0 - movs r3, 0x4 - orrs r2, r3 - adds r3, r2, 0 - strh r3, [r1] - ldr r1, =GPIOPortData - adds r2, r7, 0x2 - ldrb r3, [r2] - adds r2, r3, 0 - lsls r3, r2, 1 - adds r2, r3, 0 - movs r3, 0x4 - orrs r2, r3 - adds r3, r2, 0 - strh r3, [r1] - ldr r1, =GPIOPortData - adds r2, r7, 0x2 - ldrb r3, [r2] - adds r2, r3, 0 - lsls r3, r2, 1 - adds r2, r3, 0 - movs r3, 0x4 - orrs r2, r3 - adds r3, r2, 0 - strh r3, [r1] - ldr r1, =GPIOPortData - adds r2, r7, 0x2 - ldrb r3, [r2] - adds r2, r3, 0 - lsls r3, r2, 1 - adds r2, r3, 0 - movs r3, 0x5 - orrs r2, r3 - adds r3, r2, 0 - strh r3, [r1] - adds r2, r7, 0x1 - adds r1, r7, 0x1 - adds r2, r7, 0x1 - ldrb r3, [r2] - adds r2, r3, 0x1 - adds r3, r2, 0 - strb r3, [r1] - b _082E28D6 - .pool -_082E295C: - add sp, 0x4 - pop {r4,r7} - pop {r1} - bx r1 - thumb_func_end RTC_WriteByteReversed - - thumb_func_start RTC_ReadByte -@ u8 RTC_ReadByte() -RTC_ReadByte: @ 82E2964 - push {r7,lr} - sub sp, 0x4 - mov r7, sp - adds r0, r7, 0 - movs r1, 0 - strb r1, [r0] -_082E2970: - adds r0, r7, 0 - ldrb r1, [r0] - cmp r1, 0x7 - bls _082E297A - b _082E29E0 -_082E297A: - ldr r0, =GPIOPortData - movs r1, 0x4 - strh r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x4 - strh r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x4 - strh r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x4 - strh r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x4 - strh r1, [r0] - ldr r0, =GPIOPortData - movs r1, 0x5 - strh r1, [r0] - adds r0, r7, 0x1 - ldr r1, =GPIOPortData - ldrh r2, [r1] - movs r3, 0x2 - adds r1, r2, 0 - ands r1, r3 - adds r3, r1, 0 - lsls r2, r3, 16 - lsrs r1, r2, 16 - lsrs r2, r1, 1 - adds r1, r2, 0 - strb r1, [r0] - adds r0, r7, 0x2 - adds r1, r7, 0x2 - ldrb r2, [r1] - lsrs r1, r2, 1 - adds r2, r7, 0x1 - ldrb r3, [r2] - lsls r2, r3, 7 - orrs r1, r2 - adds r2, r1, 0 - strb r2, [r0] - adds r1, r7, 0 - adds r0, r7, 0 - adds r1, r7, 0 - ldrb r2, [r1] - adds r1, r2, 0x1 - adds r2, r1, 0 - strb r2, [r0] - b _082E2970 - .pool -_082E29E0: - adds r0, r7, 0x2 - ldrb r1, [r0] - adds r0, r1, 0 - b _082E29E8 -_082E29E8: - add sp, 0x4 - pop {r7} - pop {r1} - bx r1 - thumb_func_end RTC_ReadByte - - thumb_func_start RTC_SetReadWriteInternal -@ void RTC_SetReadWriteInternal() -RTC_SetReadWriteInternal: @ 82E29F0 - push {r7,lr} - mov r7, sp - ldr r0, =GPIOPortReadEnable - movs r1, 0x1 - strh r1, [r0] - pop {r7} - pop {r0} - bx r0 - .pool - thumb_func_end RTC_SetReadWriteInternal - - thumb_func_start RTC_SetReadOnlyInternal -@ void RTC_SetReadOnlyInternal() -RTC_SetReadOnlyInternal: @ 82E2A04 - push {r7,lr} - mov r7, sp - ldr r0, =GPIOPortReadEnable - movs r1, 0 - strh r1, [r0] - pop {r7} - pop {r0} - bx r0 - .pool - thumb_func_end RTC_SetReadOnlyInternal - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/link.s b/asm/link.s index 72c296413..9436f909b 100644 --- a/asm/link.s +++ b/asm/link.s @@ -211,13 +211,13 @@ sub_8009570: @ 8009570 adds r0, r2, 0 strh r0, [r1] bl sub_8009734 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r0, [r0, 0x24] bl SeedRng movs r4, 0 _080095A0: - bl GenerateRandomNumber - ldr r1, =gUnknown_03005D90 + bl Random + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] adds r1, 0xA adds r1, r4 @@ -272,7 +272,7 @@ sub_8009628: @ 8009628 sub_8009638: @ 8009638 push {r4,r5,lr} ldr r5, =gUnknown_020229CC - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r1, [r4] ldrb r2, [r1, 0xA] ldrb r0, [r1, 0xB] @@ -287,17 +287,17 @@ sub_8009638: @ 8009638 str r2, [r5, 0x4] adds r0, r5, 0 adds r0, 0x8 - bl CopyString + bl StringCopy ldr r0, [r4] ldrb r0, [r0, 0x8] strb r0, [r5, 0x13] ldr r0, =gUnknown_020229C6 ldrh r0, [r0] str r0, [r5, 0x14] - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strh r0, [r5, 0x1A] - ldr r0, =gUnknown_82E9530 + ldr r0, =gGameVersion ldrb r0, [r0] movs r2, 0x80 lsls r2, 7 @@ -387,7 +387,7 @@ _08009726: thumb_func_start sub_8009734 sub_8009734: @ 8009734 push {r4-r6,lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r4, [r0] cmp r4, 0 bne _080097A8 @@ -451,7 +451,7 @@ sub_80097E8: @ 80097E8 ldr r0, =gUnknown_03003124 movs r4, 0 strb r4, [r0] - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _080097FC @@ -573,7 +573,7 @@ _080098CE: sub_8009900: @ 8009900 push {r4,r5,lr} sub sp, 0x4 - ldr r4, =gUnknown_030022C0 + ldr r4, =gMain ldrh r1, [r4, 0x2E] movs r0, 0x1 ands r0, r1 @@ -1192,7 +1192,7 @@ _08009E38: _08009E4C: ldr r0, =gUnknown_03003110 strh r2, [r0] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldrh r1, [r1, 0x2C] b _08009F04 .pool @@ -1278,7 +1278,7 @@ _08009F06: thumb_func_start sub_8009F18 sub_8009F18: @ 8009F18 push {lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _08009F26 @@ -1295,7 +1295,7 @@ _08009F26: thumb_func_start sub_8009F3C sub_8009F3C: @ 8009F3C push {lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _08009F50 @@ -1336,7 +1336,7 @@ _08009F80: thumb_func_start sub_8009F8C sub_8009F8C: @ 8009F8C push {lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r1, [r0] cmp r1, 0 beq _08009FA0 @@ -1355,7 +1355,7 @@ _08009FA4: thumb_func_start sub_8009FAC sub_8009FAC: @ 8009FAC push {lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r1, [r0] cmp r1, 0 beq _08009FC0 @@ -1374,7 +1374,7 @@ _08009FC4: thumb_func_start sub_8009FCC sub_8009FCC: @ 8009FCC push {lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _08009FEC @@ -1934,7 +1934,7 @@ sub_800A418: @ 800A418 ldr r1, =gUnknown_020223C0 movs r0, 0 str r0, [r1] - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _0800A438 @@ -1972,7 +1972,7 @@ sub_800A458: @ 800A458 thumb_func_start link_get_multiplayer_id link_get_multiplayer_id: @ 800A468 push {lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0x1 beq _0800A484 @@ -2014,7 +2014,7 @@ link_0800A448: @ 800A4AC adds r3, r1, 0 lsls r2, 16 lsrs r1, r2, 16 - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0x1 beq _0800A4C8 @@ -2038,7 +2038,7 @@ sub_800A4D8: @ 800A4D8 lsls r0, 24 lsrs r1, r0, 24 adds r2, r1, 0 - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0x1 bne _0800A4F8 @@ -2071,7 +2071,7 @@ _0800A514: thumb_func_start sub_800A520 sub_800A520: @ 800A520 push {lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0x1 bne _0800A538 @@ -2098,7 +2098,7 @@ _0800A546: thumb_func_start sub_800A550 sub_800A550: @ 800A550 push {lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0x1 beq _0800A57C @@ -2129,7 +2129,7 @@ sub_800A588: @ 800A588 push {lr} lsls r0, 24 lsrs r1, r0, 24 - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0x1 bne _0800A5A4 @@ -2151,7 +2151,7 @@ _0800A5AC: thumb_func_start sub_800A5B4 sub_800A5B4: @ 800A5B4 push {r4,lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0x1 bne _0800A5D4 @@ -2186,7 +2186,7 @@ sub_800A5EC: @ 800A5EC push {lr} lsls r0, 24 lsrs r1, r0, 24 - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0x1 bne _0800A608 @@ -2880,7 +2880,7 @@ _0800AB36: mov r1, r8 adds r0, r2, r1 adds r1, r2, r7 - bl CompareString + bl StringCompare cmp r0, 0 beq _0800AB6A _0800AB5A: @@ -2932,7 +2932,7 @@ sub_800ABAC: @ 800ABAC thumb_func_start sub_800ABBC sub_800ABBC: @ 800ABBC push {lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _0800ABDC @@ -2965,7 +2965,7 @@ sub_800ABF4: @ 800ABF4 push {lr} lsls r0, 16 lsrs r3, r0, 16 - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0x1 bne _0800AC0C @@ -2992,7 +2992,7 @@ _0800AC20: thumb_func_start sub_800AC34 sub_800AC34: @ 800AC34 push {lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0x1 bne _0800AC48 @@ -3065,7 +3065,7 @@ _0800ACCA: _0800ACD0: cmp r3, r2 bne _0800ACF4 - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r0, [r2] movs r1, 0x21 negs r1, r1 @@ -3090,7 +3090,7 @@ _0800ACF4: thumb_func_start sub_800AD10 sub_800AD10: @ 800AD10 push {lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0x1 bne _0800AD24 @@ -3169,7 +3169,7 @@ _0800ADAE: _0800ADB6: cmp r1, r3 bne _0800ADDA - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r0, [r2] movs r1, 0x21 negs r1, r1 @@ -3194,7 +3194,7 @@ _0800ADDA: thumb_func_start sub_800ADF8 sub_800ADF8: @ 800ADF8 push {lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0x1 bne _0800AE0C @@ -3361,7 +3361,7 @@ c2_800ACD4: @ 800AF30 bl FillPalette bl ResetTasks bl remove_some_task - ldr r1, =gUnknown_030030FC + ldr r1, =gLinkVSyncDisabled ldrb r0, [r1] cmp r0, 0 beq _0800AF8C @@ -3423,14 +3423,14 @@ _0800AF8C: movs r1, 0xF0 movs r2, 0x20 bl LoadPalette - ldr r1, =gUnknown_03002700 + ldr r1, =gSoftResetDisabled movs r0, 0 strb r0, [r1] ldr r0, =sub_8009404 movs r1, 0 bl CreateTask bl sub_80A2F30 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0 str r0, [r1] bl RunTasks @@ -3561,7 +3561,7 @@ sub_800B138: @ 800B138 sub_800B1A0: @ 800B1A0 push {r4,lr} sub sp, 0xC - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -3615,7 +3615,7 @@ _0800B20C: bl audio_play b _0800B260 _0800B214: - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0x2 bne _0800B244 @@ -3647,14 +3647,14 @@ _0800B244: movs r3, 0x14 bl box_print _0800B260: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r0, r2 ldrb r1, [r1] cmp r1, 0xA0 bne _0800B2D0 - ldr r4, =gUnknown_030030FC + ldr r4, =gLinkVSyncDisabled ldrb r2, [r4] cmp r2, 0x1 bne _0800B2A8 @@ -3682,9 +3682,9 @@ _0800B2A8: beq _0800B2C2 bl rfu_REQ_stopMode bl rfu_waitREQComplete - bl Reset + bl DoSoftReset _0800B2C2: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r0, r2 @@ -3856,7 +3856,7 @@ _0800B3F4: thumb_func_start HandleLinkConnection HandleLinkConnection: @ 800B40C push {r4,r5,lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _0800B45C @@ -3911,7 +3911,7 @@ sub_800B488: @ 800B488 ldrb r0, [r0] cmp r0, 0 bne _0800B498 - ldr r1, =gUnknown_030030FC + ldr r1, =gLinkVSyncDisabled movs r0, 0x1 strb r0, [r1] _0800B498: @@ -3927,7 +3927,7 @@ sub_800B4A4: @ 800B4A4 ldrb r1, [r0] cmp r1, 0 bne _0800B4B2 - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled strb r1, [r0] _0800B4B2: pop {r0} @@ -3942,7 +3942,7 @@ sub_800B4C0: @ 800B4C0 ldrb r1, [r0] cmp r1, 0 bne _0800B4CE - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled strb r1, [r0] _0800B4CE: pop {r0} @@ -3953,7 +3953,7 @@ _0800B4CE: thumb_func_start sub_800B4DC sub_800B4DC: @ 800B4DC push {lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _0800B4FC @@ -3987,7 +3987,7 @@ _0800B514: thumb_func_start sub_800B518 sub_800B518: @ 800B518 - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] bx lr .pool @@ -4002,7 +4002,7 @@ sub_800B524: @ 800B524 adds r2, 0x8 ldrb r1, [r0, 0x1A] adds r0, r2, 0 - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString pop {r0} bx r0 thumb_func_end sub_800B524 @@ -8971,7 +8971,7 @@ _0800DC3C: _0800DC56: movs r4, 0 _0800DC58: - bl GenerateRandomNumber + bl Random lsls r0, 24 lsrs r0, 24 adds r1, r6, r4 @@ -9162,7 +9162,7 @@ sub_800DD94: @ 800DD94 lsrs r1, 24 mov r9, r1 movs r4, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr mov r8, r0 adds r6, r7, 0x2 ldr r0, [r0] @@ -9524,7 +9524,7 @@ sub_800E084: @ 800E084 lsls r0, 2 adds r0, r4 bl RemoveObjectAndFreeTiles - ldr r3, =gUnknown_030022C0 + ldr r3, =gMain movs r0, 0x84 lsls r0, 3 adds r3, r0 @@ -9780,7 +9780,7 @@ _0800E2AC: adds r0, 0x1 strh r0, [r6, 0x34] _0800E2B2: - ldr r4, =gUnknown_030022C0 + ldr r4, =gMain movs r1, 0x84 lsls r1, 3 adds r0, r4, r1 @@ -9865,7 +9865,7 @@ sub_800E378: @ 800E378 push {lr} stm r0!, {r1} adds r1, r2, 0 - bl CopyString + bl StringCopy pop {r0} bx r0 thumb_func_end sub_800E378 @@ -9900,7 +9900,7 @@ sub_800E3A8: @ 800E3A8 mov r5, r8 push {r5-r7} sub sp, 0x20 - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _0800E3BE @@ -9937,7 +9937,7 @@ _0800E3D0: adds r3, r1, r0 _0800E3FC: ldrh r1, [r3] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r7, =0x00003b98 adds r0, r2, r7 @@ -9950,7 +9950,7 @@ _0800E3FC: ldr r0, [sp, 0x1C] add r0, r10 str r3, [sp, 0x18] - bl CompareString + bl StringCompare ldr r3, [sp, 0x18] cmp r0, 0 bne _0800E428 @@ -9999,7 +9999,7 @@ _0800E45C: ldr r2, [r7] cmp r2, 0 blt _0800E4A0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] lsls r0, r2, 1 adds r0, r2 @@ -10025,7 +10025,7 @@ _0800E4AC: cmp r4, r0 blt _0800E45C movs r4, 0 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr mov r9, r1 ldr r6, =0x00003b98 movs r7, 0 @@ -10066,7 +10066,7 @@ _0800E500: cmp r4, 0x13 ble _0800E4CE _0800E50A: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r7, =0x00003b98 adds r0, r7 @@ -10098,7 +10098,7 @@ sub_800E540: @ 800E540 lsrs r0, 16 mov r8, r0 movs r7, 0 - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr ldr r4, =0x00003b98 movs r5, 0 _0800E558: @@ -10106,7 +10106,7 @@ _0800E558: adds r0, r4 adds r0, 0x4 mov r1, r9 - bl CompareString + bl StringCompare cmp r0, 0 bne _0800E584 ldr r0, [r6] @@ -10155,7 +10155,7 @@ sub_800E5AC: @ 800E5AC movs r5, 0 movs r4, 0x13 _0800E5C0: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] mov r2, r8 adds r0, r1, r2 @@ -10274,7 +10274,7 @@ _0800E64A: thumb_func_start sub_800E6D0 sub_800E6D0: @ 800E6D0 push {r4-r6,lr} - ldr r4, =gUnknown_03002710 + ldr r4, =gIntrTable ldr r5, [r4, 0x4] ldr r6, [r4, 0x8] bl sub_800E700 @@ -10298,7 +10298,7 @@ sub_800E700: @ 800E700 push {r4,lr} ldr r0, =gUnknown_03004190 ldr r1, =0x00000e64 - ldr r4, =gUnknown_03002714 + ldr r4, =gIntrTable + 0x4 adds r2, r4, 0 movs r3, 0x1 bl rfu_initializeAPI @@ -13026,7 +13026,7 @@ _0800FE00: .pool _0800FE14: strh r1, [r5] - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r0, [r0, 0x2C] b _0800FE44 .pool @@ -13509,7 +13509,7 @@ _080101E6: ble _080101DC cmp r2, r5 bne _08010220 - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r0, [r2] movs r1, 0x21 negs r1, r1 @@ -14973,7 +14973,7 @@ sub_8010DB4: @ 8010DB4 ldrb r0, [r2, 0x2] cmp r0, 0 bne _08010E5C - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, [r0, 0x4] ldr r0, =sub_8018438 cmp r1, r0 @@ -14983,14 +14983,14 @@ sub_8010DB4: @ 8010DB4 cmp r0, 0 beq _08010DE4 _08010DDE: - ldr r1, =gUnknown_030030FC + ldr r1, =gLinkVSyncDisabled movs r0, 0x2 strb r0, [r1] _08010DE4: ldr r4, =c2_800ACD4 adds r0, r4, 0 bl SetMainCallback2 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain str r4, [r0, 0x8] ldr r5, =gUnknown_03005000 ldrh r0, [r5, 0xA] @@ -15085,7 +15085,7 @@ sub_8010EC0: @ 8010EC0 ldr r1, =0x00000ccd adds r0, r4, r1 strb r5, [r0] - bl GenerateRandomNumber2 + bl Random2 lsls r0, 16 lsrs r0, 16 bl sub_800C54C @@ -15152,9 +15152,9 @@ _08010F3C: sub_8010F48: @ 8010F48 push {lr} ldr r0, =gUnknown_02022B22 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy pop {r0} bx r0 .pool @@ -16561,13 +16561,13 @@ sub_8011AB0: @ 8011AB0 .pool thumb_func_end sub_8011AB0 - thumb_func_start rfu_syncVBlank__ -rfu_syncVBlank__: @ 8011ABC + thumb_func_start LinkVSync +LinkVSync: @ 8011ABC push {lr} bl rfu_syncVBlank_ pop {r0} bx r0 - thumb_func_end rfu_syncVBlank__ + thumb_func_end LinkVSync thumb_func_start sub_8011AC8 sub_8011AC8: @ 8011AC8 @@ -16614,13 +16614,13 @@ sub_8011AFC: @ 8011AFC strh r0, [r1] bl sub_800B488 bl sub_8009734 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r0, [r0, 0x24] bl SeedRng movs r4, 0 _08011B38: - bl GenerateRandomNumber - ldr r1, =gUnknown_03005D90 + bl Random + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] adds r1, 0xA adds r1, r4 @@ -16838,7 +16838,7 @@ _08011D02: adds r1, r5 adds r1, 0x15 ldr r0, [sp] - bl CompareString + bl StringCompare cmp r0, 0 bne _08011D4C cmp r10, r6 @@ -17173,7 +17173,7 @@ sub_8011FC8: @ 8011FC8 adds r4, r0 adds r0, r4, 0 adds r1, r6, 0 - bl CopyString + bl StringCopy strh r5, [r4, 0x10] pop {r4-r6} pop {r0} @@ -17378,7 +17378,7 @@ sub_8012188: @ 8012188 ldr r1, =0x00000119 adds r0, r6, r1 adds r1, r3, 0 - bl CopyString + bl StringCopy movs r1, 0x85 lsls r1, 1 adds r0, r6, r1 @@ -17884,7 +17884,7 @@ sub_80125BC: @ 80125BC adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r2, [r6] movs r0, 0x1 str r0, [sp] @@ -17897,7 +17897,7 @@ sub_80125BC: @ 80125BC bl sub_80173E0 ldr r1, =gUnknown_082ED8CC add r0, sp, 0x8 - bl CopyString + bl StringCopy adds r5, r0, 0 ldr r0, [r6] adds r0, 0xA @@ -17908,7 +17908,7 @@ sub_80125BC: @ 80125BC adds r0, r5, 0 movs r2, 0x2 movs r3, 0x5 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x11 str r0, [sp] mov r0, r8 @@ -17972,9 +17972,9 @@ _08012648: .4byte _080126B8 .4byte _080126B8 _080126B8: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_082ED960 - bl ExpandStringRefs + bl StringExpandPlaceholders _080126C0: pop {r0} bx r0 @@ -18111,7 +18111,7 @@ _08012828: adds r3, r0, 0 cmp r2, 0x14 bne _08012848 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 @@ -18272,14 +18272,14 @@ _08012938: b _08012F50 .pool _080129C8: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r2, =gUnknown_082F0048 ldr r4, =gUnknown_02022C2C ldrb r1, [r4] lsls r1, 2 adds r1, r2 ldr r1, [r1] - bl CopyString + bl StringCopy ldr r0, =gUnknown_02022C2D ldrb r2, [r0] lsrs r0, r2, 4 @@ -18293,19 +18293,19 @@ _080129C8: ands r0, r2 cmp r0, 0 beq _08012A18 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_082ED990 - bl ExpandStringRefs + bl StringExpandPlaceholders b _08012A34 .pool _08012A18: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_082ED960 - bl ExpandStringRefs + bl StringExpandPlaceholders b _08012A34 .pool _08012A2C: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldrb r1, [r4] bl sub_801262C _08012A34: @@ -18321,7 +18321,7 @@ _08012A34: _08012A50: adds r0, r6, 0 adds r0, 0xD - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 bl sub_8017064 lsls r0, 24 cmp r0, 0 @@ -18337,7 +18337,7 @@ _08012A6C: movs r1, 0x7 movs r2, 0xA bl sub_801320C - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -18381,7 +18381,7 @@ _08012AA8: bl sub_8012240 cmp r0, 0 beq _08012ADE - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x8 ands r0, r1 @@ -18472,7 +18472,7 @@ _08012B7E: _08012B8C: adds r0, r6, 0 adds r0, 0xD - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 bl sub_8017064 lsls r0, 24 cmp r0, 0 @@ -18622,16 +18622,16 @@ _08012CBC: b _08012CE0 .pool _08012CC4: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrb r2, [r6, 0x13] lsls r2, 5 subs r2, 0x20 ldr r1, [r6] adds r1, r2 bl sub_8018404 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_082EDC9C - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0xD strb r0, [r6, 0xC] _08012CE0: @@ -18689,7 +18689,7 @@ _08012D50: _08012D5A: adds r0, r6, 0 adds r0, 0xD - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 bl sub_8017064 lsls r0, 24 cmp r0, 0 @@ -19033,13 +19033,13 @@ _08013058: ldr r1, =gUnknown_082EDC0C _0801305A: adds r0, r2, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders b _08013070 .pool _08013068: ldr r1, =gUnknown_082EDC34 adds r0, r2, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders _08013070: pop {r0} bx r0 @@ -19067,12 +19067,12 @@ _0801308E: b _080130AA _08013098: ldr r1, =gUnknown_082EE560 - bl ExpandStringRefs + bl StringExpandPlaceholders b _080130AA .pool _080130A4: ldr r1, =gUnknown_082EE57C - bl ExpandStringRefs + bl StringExpandPlaceholders _080130AA: pop {r0} bx r0 @@ -19127,13 +19127,13 @@ _080130D0: _08013140: ldr r1, =gUnknown_082EFC3C adds r0, r2, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders b _08013158 .pool _08013150: ldr r1, =gUnknown_082EFC54 adds r0, r2, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders _08013158: pop {r0} bx r0 @@ -19188,13 +19188,13 @@ _0801317C: _080131EC: ldr r1, =gUnknown_082EDDF4 adds r0, r2, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders b _08013204 .pool _080131FC: ldr r1, =gUnknown_082EDE0C adds r0, r2, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders _08013204: pop {r0} bx r0 @@ -19221,13 +19221,13 @@ _08013228: bl audio_play ldrb r0, [r4, 0x12] bl sub_81AE70C - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrb r2, [r4, 0x13] lsls r2, 5 ldr r1, [r4] adds r1, r2 bl sub_8018404 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_02022C2C ldrb r1, [r1] bl sub_8012FC4 @@ -19627,7 +19627,7 @@ _08013570: adds r3, r0, 0 cmp r2, 0x14 bne _08013590 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 @@ -19771,7 +19771,7 @@ _080136F2: ldrb r0, [r6, 0xE] bl ListMenuHandleInput adds r4, r0, 0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -19806,13 +19806,13 @@ _080136F2: b _08013756 .pool _08013744: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r2, =gUnknown_082EDD50 subs r1, 0x1 lsls r1, 2 adds r1, r2 ldr r1, [r1] - bl CopyString + bl StringCopy movs r0, 0x12 _08013756: strb r0, [r6, 0x8] @@ -19825,7 +19825,7 @@ _08013768: bl audio_play b _08013B82 _08013770: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -19838,7 +19838,7 @@ _0801377E: b _08013B82 .pool _08013788: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r0, =gUnknown_02022C2C ldrb r1, [r0] adds r0, r4, 0 @@ -19852,7 +19852,7 @@ _08013788: bne _080137A6 b _08013B82 _080137A6: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrb r2, [r6, 0xF] lsls r2, 5 ldr r1, [r6] @@ -19956,7 +19956,7 @@ _080138C2: strb r0, [r6, 0x8] b _080139EC _080138C8: - ldr r5, =gUnknown_02021FC4 + ldr r5, =gStringVar4 ldr r4, =gUnknown_02022C2C ldrb r1, [r4] adds r0, r5, 0 @@ -19985,16 +19985,16 @@ _08013904: movs r0, 0x7 movs r1, 0 bl sub_8011A64 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r2, =gUnknown_082F0048 ldrb r1, [r4] lsls r1, 2 adds r1, r2 ldr r1, [r1] - bl CopyString + bl StringCopy ldr r1, =gUnknown_082EDE48 adds r0, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders b _080139EC .pool _08013934: @@ -20004,7 +20004,7 @@ _08013934: bls _0801395C adds r0, r6, 0 adds r0, 0x9 - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 bl sub_8017064 lsls r0, 24 cmp r0, 0 @@ -20068,7 +20068,7 @@ _080139EC: beq _080139F8 b _08013B82 _080139F8: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -20220,7 +20220,7 @@ _08013B24: _08013B44: adds r0, r6, 0 adds r0, 0x9 - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 _08013B4A: bl sub_8017064 lsls r0, 24 @@ -20266,7 +20266,7 @@ sub_8013B8C: @ 8013B8C ands r0, r1 cmp r0, 0xC beq _08013BCE - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r1, [r0, 0x9] movs r2, 0x80 @@ -20304,7 +20304,7 @@ sub_8013BD8: @ 8013BD8 bl sub_800DFB4 ldrb r0, [r4, 0xE] bl sub_81AE70C - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrb r2, [r4, 0xF] lsls r2, 5 ldr r1, [r4] @@ -20802,7 +20802,7 @@ _08013FDE: movs r0, 0x64 adds r1, r7, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r1, r0 movs r0, 0 movs r2, 0x64 @@ -20817,7 +20817,7 @@ _08013FFC: bne _080140BC bl link_get_multiplayer_id adds r1, r0, 0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty movs r2, 0x1 eors r1, r2 lsls r1, 24 @@ -20833,7 +20833,7 @@ _08013FFC: .pool _08014038: ldr r4, =gUnknown_020228C4 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =0x00002be0 adds r1, r0 @@ -20876,7 +20876,7 @@ _08014070: strb r7, [r1] movs r0, 0x6 strb r0, [r1, 0x1] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =c2_exit_to_overworld_2_switch str r0, [r1, 0x8] ldr r0, =sub_807AE50 @@ -20988,7 +20988,7 @@ _0801419E: thumb_func_start sub_80141A4 sub_80141A4: @ 80141A4 push {r4,lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r4, r0, r1 @@ -21071,10 +21071,10 @@ sub_8014210: @ 8014210 lsls r0, 24 lsrs r0, 24 strh r0, [r1, 0x18] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =sub_80B360C str r0, [r1, 0x8] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags str r6, [r0] bl sub_806E64C pop {r4-r6} @@ -21101,7 +21101,7 @@ sub_8014290: @ 8014290 ldr r0, =0x00004087 adds r1, r3, 0 bl VarSet - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr ldr r1, [r6] movs r0, 0x4 ldrsb r0, [r1, r0] @@ -21196,7 +21196,7 @@ sub_8014304: @ 8014304 thumb_func_start sub_8014384 sub_8014384: @ 8014384 push {r4,lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r4, r0, r1 @@ -21394,7 +21394,7 @@ _08014494: .4byte _080145D8 _080145D8: bl overworld_free_bg_tilemaps - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =sub_801AC54 str r0, [r1, 0x8] movs r0, 0x3 @@ -21648,7 +21648,7 @@ _08014854: ldr r4, =gUnknown_02024488 adds r0, r4 movs r1, 0xB - bl pokemon_getattr + bl GetMonData mov r1, r9 strh r0, [r1] ldrb r0, [r6, 0x1] @@ -21656,10 +21656,10 @@ _08014854: adds r0, r4 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData mov r2, r9 strh r0, [r2, 0x2] - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain mov r1, r8 str r1, [r0, 0x8] movs r0, 0x4 @@ -21989,15 +21989,15 @@ _08014AEC: b _08014C42 .pool _08014BBC: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r2, =gUnknown_082F0048 ldr r4, =gUnknown_02022C2C ldrb r1, [r4] lsls r1, 2 adds r1, r2 ldr r1, [r1] - bl CopyString - ldr r0, =gUnknown_02021FC4 + bl StringCopy + ldr r0, =gStringVar4 ldrb r1, [r4] bl sub_801262C movs r0, 0x3 @@ -22005,7 +22005,7 @@ _08014BBC: b _08014EF2 .pool _08014BEC: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 bl sub_8018884 movs r0, 0x4 strb r0, [r5, 0xC] @@ -22016,7 +22016,7 @@ _08014BFC: movs r1, 0x5 movs r2, 0x6 bl sub_801320C - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -22057,7 +22057,7 @@ _08014C52: adds r0, 0xD adds r1, r5, 0 adds r1, 0x14 - ldr r3, =gUnknown_02021FC4 + ldr r3, =gStringVar4 movs r2, 0 bl sub_8018B08 lsls r0, 24 @@ -22161,16 +22161,16 @@ _08014CF2: ldrb r0, [r5, 0x13] adds r0, 0x1 strb r0, [r5, 0x13] - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrb r2, [r5, 0x13] lsls r2, 5 subs r2, 0x20 ldr r1, [r5] adds r1, r2 bl sub_8018404 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_082EDC9C - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x9 strb r0, [r5, 0xC] bl sub_800EF38 @@ -22220,7 +22220,7 @@ _08014DB0: strb r4, [r5, 0xC] b _08014EF2 _08014DBC: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 bl sub_8018884 movs r0, 0xA strb r0, [r5, 0xC] @@ -22551,7 +22551,7 @@ _080150D6: ldrb r0, [r7, 0xE] bl ListMenuHandleInput adds r2, r0, 0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -22580,7 +22580,7 @@ _080150D6: bl sub_800DFB4 ldrb r0, [r7, 0xE] bl sub_81AE70C - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrb r2, [r7, 0xF] lsls r2, 5 ldr r1, [r7] @@ -22610,7 +22610,7 @@ _08015160: bl audio_play b _080152A0 _08015168: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -22625,7 +22625,7 @@ _08015176: _08015180: ldr r0, =gUnknown_082EFC3C bl sub_8018884 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrb r2, [r7, 0xF] lsls r2, 5 ldr r1, [r7] @@ -22972,7 +22972,7 @@ _080154B4: strb r0, [r5, 0x8] b _080154D4 _080154C0: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -22991,7 +22991,7 @@ _080154D4: _080154E0: ldr r0, =gUnknown_082EFC90 bl sub_8018884 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrb r2, [r5, 0xF] lsls r2, 5 ldr r1, [r5] @@ -23170,11 +23170,11 @@ sub_8015664: @ 8015664 movs r1, 0x8 strb r1, [r2, 0x14] strb r0, [r2, 0x15] - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 cmp r3, r0 beq _0801567E adds r1, r3, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders _0801567E: pop {r0} bx r0 @@ -23189,11 +23189,11 @@ sub_801568C: @ 801568C ldr r1, [r0] movs r0, 0x1A strb r0, [r1, 0x14] - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 cmp r2, r0 beq _080156A4 adds r1, r2, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders _080156A4: pop {r0} bx r0 @@ -23498,10 +23498,10 @@ _080159A6: bl sub_8011090 movs r0, 0x2 bl audio_play - ldr r0, =gUnknown_02021CC4 - ldr r1, =gUnknown_03005D90 + ldr r0, =gStringVar1 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy movs r1, 0 movs r0, 0x2A b _08015A02 @@ -23536,7 +23536,7 @@ _08015A0A: bne _08015A1A bl _08016878 _08015A1A: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -23567,10 +23567,10 @@ _08015A4C: movs r0, 0x2 bl audio_play bl sub_80181CC - ldr r0, =gUnknown_02021CC4 - ldr r1, =gUnknown_03005D90 + ldr r0, =gStringVar1 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy movs r0, 0x2D bl _08016876 .pool @@ -23677,7 +23677,7 @@ _08015B44: bl _08016876 .pool _08015B68: - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 movs r0, 0x13 bl sub_8015664 bl _08016878 @@ -23813,14 +23813,14 @@ _08015CB2: movs r1, 0x40 strh r1, [r0] bl sub_800FE50 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r2, =gUnknown_082EEB80 ldr r1, =gUnknown_020229E8 ldrb r1, [r1, 0x13] lsls r1, 2 adds r1, r2 ldr r1, [r1] - bl CopyString + bl StringCopy movs r0, 0x20 bl _08016876 .pool @@ -23855,9 +23855,9 @@ _08015D18: bl _08016876 .pool _08015D34: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_082EEB88 - bl CopyString + bl StringCopy movs r0, 0x24 bl _08016876 .pool @@ -23922,9 +23922,9 @@ _08015DD0: ldrb r0, [r0] cmp r0, 0 bne _08015DF4 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_082EEB88 - bl CopyString + bl StringCopy movs r0, 0x1C bl _08016876 .pool @@ -23940,7 +23940,7 @@ _08015DF4: ldrb r0, [r0] cmp r0, 0x8 bne _08015E24 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 adds r1, r6, 0 movs r2, 0 bl sub_8018220 @@ -23958,7 +23958,7 @@ _08015E32: movs r5, 0 movs r0, 0x20 strb r0, [r6, 0x14] - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r4, =gUnknown_02022C2C ldrb r2, [r4] movs r1, 0x40 @@ -23995,7 +23995,7 @@ _08015E5C: _08015E94: adds r0, r6, 0 adds r0, 0x16 - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 bl sub_8017064 lsls r0, 24 cmp r0, 0 @@ -24024,7 +24024,7 @@ _08015ED2: lsls r0, 24 cmp r0, 0 bne _08015F2C - ldr r5, =gUnknown_02021CC4 + ldr r5, =gStringVar1 bl link_get_multiplayer_id movs r1, 0x1 eors r0, r1 @@ -24036,18 +24036,18 @@ _08015ED2: ldr r4, =gUnknown_020229F0 adds r1, r4 adds r0, r5, 0 - bl CopyString + bl StringCopy ldrh r0, [r4, 0x18] adds r4, 0x1C adds r1, r4, 0 bl sub_800E540 adds r5, r0, 0 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r2, =gUnknown_082EE378 lsls r1, r5, 2 adds r1, r2 ldr r1, [r1] - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x21 bl _08016876 .pool @@ -24268,22 +24268,22 @@ _08016104: _08016118: movs r0, 0x21 strb r0, [r6, 0x14] - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r4, =gUnknown_02022A0C adds r1, r4, 0 - bl CopyString + bl StringCopy adds r0, r4, 0 subs r0, 0x24 ldrh r0, [r0, 0x20] adds r1, r4, 0 bl sub_800E540 adds r5, r0, 0 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r2, =gUnknown_082EE324 lsls r1, r5, 2 adds r1, r2 ldr r1, [r1] - bl ExpandStringRefs + bl StringExpandPlaceholders b _08016878 .pool _08016158: @@ -24291,7 +24291,7 @@ _08016158: bl sub_801689C adds r0, r6, 0 adds r0, 0x16 - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 bl sub_8017064 lsls r0, 24 cmp r0, 0 @@ -24310,7 +24310,7 @@ _08016178: bne _0801618A b _08016878 _0801618A: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -24320,14 +24320,14 @@ _0801618A: _08016198: movs r0, 0x1 bl sub_8011DE0 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_082EE598 - bl CopyString + bl StringCopy movs r0, 0x24 b _08016876 .pool _080161B8: - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 movs r0, 0x9 bl sub_8015664 b _08016878 @@ -24406,9 +24406,9 @@ _0801623E: bl sub_800FE50 movs r0, 0xA strb r0, [r6, 0x14] - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_082EEC14 - bl CopyString + bl StringCopy b _08016878 .pool _0801627C: @@ -24421,7 +24421,7 @@ _08016286: bne _080162A4 adds r0, r5, 0 bl sub_800FE50 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 adds r1, r6, 0 movs r2, 0x1 bl sub_8018220 @@ -24441,7 +24441,7 @@ _080162AE: bl sub_800FE50 movs r0, 0xA strb r0, [r6, 0x14] - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_02022C2C ldrb r1, [r1] bl sub_8013078 @@ -24461,7 +24461,7 @@ _080162E6: ldr r1, =gUnknown_02022C2C movs r0, 0x40 strb r0, [r1] - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 movs r0, 0x25 bl sub_8015664 adds r0, r6, 0 @@ -24483,7 +24483,7 @@ _08016318: bl sub_801818C b _08016878 _08016324: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r0, =gUnknown_02022C2C ldrb r0, [r0] movs r1, 0x40 @@ -24572,13 +24572,13 @@ _080163E4: lsls r1, 1 cmp r0, r1 bne _08016408 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_082EF590 - bl CopyString + bl StringCopy b _0801643E .pool _08016408: - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 bl sub_800F7DC ldrh r0, [r0, 0x8] lsls r0, 22 @@ -24588,20 +24588,20 @@ _08016408: ldr r0, =gSpeciesNames adds r1, r0 adds r0, r4, 0 - bl CopyString - ldr r4, =gUnknown_02021DC4 + bl StringCopy + ldr r4, =gStringVar2 bl sub_800F7DC ldrb r1, [r0, 0xB] lsrs r1, 1 adds r0, r4, 0 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r0, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r0, =gStringVar4 ldr r1, =gUnknown_082EF564 - bl ExpandStringRefs + bl StringExpandPlaceholders _0801643E: - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 movs r0, 0x2C bl sub_8015664 b _08016878 @@ -24870,7 +24870,7 @@ _080166A2: beq _080166FC b _08016878 _080166A8: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, [r6] adds r1, r4 bl sub_8018404 @@ -24881,11 +24881,11 @@ _080166A8: b _08016878 .pool _080166C8: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, [r6] adds r1, r4 bl sub_8018404 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, [r6] adds r1, r4 ldrb r2, [r1, 0x9] @@ -24894,16 +24894,16 @@ _080166C8: subs r1, r2 ldr r2, =gTypeNames adds r1, r2 - bl CopyString + bl StringCopy ldr r1, =gUnknown_082EF6E4 b _0801671E .pool _080166FC: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, [r6] adds r1, r4 bl sub_8018404 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, [r6] adds r1, r4 ldrb r2, [r1, 0x9] @@ -24912,7 +24912,7 @@ _080166FC: subs r1, r2 ldr r2, =gTypeNames adds r1, r2 - bl CopyString + bl StringCopy ldr r1, =gUnknown_082EF718 _0801671E: movs r0, 0x2E @@ -25012,7 +25012,7 @@ _080167F4: adds r0, 0x10 movs r2, 0x44 bl sub_8012188 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r3, 0x2 ldrsh r2, [r7, r3] lsls r2, 5 @@ -25028,7 +25028,7 @@ _080167F4: _08016838: adds r0, r6, 0 adds r0, 0x16 - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 bl sub_8017064 lsls r0, 24 cmp r0, 0 @@ -25047,7 +25047,7 @@ _08016838: _08016864: adds r0, r6, 0 adds r0, 0x16 - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 bl sub_8017064 lsls r0, 24 cmp r0, 0 @@ -25122,7 +25122,7 @@ sub_80168DC: @ 80168DC ldrh r0, [r5] cmp r0, 0 beq _0801692C - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_020229E8 adds r1, 0x2F ldrb r1, [r1] @@ -25305,7 +25305,7 @@ _08016A78: _08016A84: ldr r0, =gUnknown_02022C20 mov r1, sp - bl CopyString + bl StringCopy b _08016AC8 .pool _08016A94: @@ -25346,9 +25346,9 @@ sp182_move_string: @ 8016AD4 b _08016AF6 .pool _08016AE8: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 - bl CopyString + bl StringCopy movs r0, 0xFF strb r0, [r4] movs r0, 0x1 @@ -26037,9 +26037,9 @@ sub_8017020: @ 8017020 movs r0, 0 movs r1, 0x1 bl sub_81973C4 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 adds r1, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0 movs r1, 0x1 bl AddTextPrinterWithCustomSpeedForMessage @@ -26082,9 +26082,9 @@ _08017076: movs r0, 0 movs r1, 0x1 bl sub_81973C4 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 adds r1, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 bl AddTextPrinterForMessage_2 ldrb r0, [r4] @@ -26297,7 +26297,7 @@ _08017228: ldrb r0, [r3] bl ListMenuHandleInput mov r8, r0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] ands r4, r1 cmp r4, 0 @@ -26413,7 +26413,7 @@ _0801731C: ldrb r0, [r3] bl ListMenuHandleInput adds r1, r0, 0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r2, [r0, 0x2E] movs r0, 0x3 ands r0, r2 @@ -27060,15 +27060,15 @@ sub_80177B8: @ 80177B8 mov r9, r3 lsls r1, 24 lsrs r1, 24 - ldr r5, =gUnknown_02021FC4 + ldr r5, =gStringVar4 adds r1, 0x1 adds r0, r5, 0 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r1, =gUnknown_082ED8C8 adds r0, r5, 0 - bl AppendString + bl StringAppend str r7, [sp] movs r0, 0 str r0, [sp, 0x4] @@ -27110,13 +27110,13 @@ sub_80177B8: @ 80177B8 add r0, sp, 0x8 movs r2, 0x2 movs r3, 0x5 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r1, =gUnknown_082ED8CC adds r0, r5, 0 - bl CopyString + bl StringCopy adds r0, r5, 0 add r1, sp, 0x8 - bl AppendString + bl StringAppend movs r0, 0x1 adds r1, r5, 0 movs r2, 0x88 @@ -27166,7 +27166,7 @@ sub_80178A0: @ 80178A0 ands r0, r1 cmp r0, 0x1 bne _0801792A - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 adds r0, r4, 0 adds r1, r5, 0 bl sub_8018404 @@ -27185,13 +27185,13 @@ sub_80178A0: @ 80178A0 add r0, sp, 0x8 movs r2, 0x2 movs r3, 0x5 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r1, =gUnknown_082ED8CC adds r0, r4, 0 - bl CopyString + bl StringCopy adds r0, r4, 0 add r1, sp, 0x8 - bl AppendString + bl StringAppend movs r0, 0x1 adds r1, r4, 0 movs r2, 0x68 @@ -27319,7 +27319,7 @@ sub_80179D4: @ 80179D4 bne _08017A4C cmp r4, 0 bne _08017A4C - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 adds r0, r4, 0 adds r1, r5, 0 bl sub_8018404 @@ -27335,14 +27335,14 @@ sub_80179D4: @ 80179D4 ands r0, r1 cmp r0, 0x45 bne _08017A38 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r3, =gUnknown_082EE6B8 lsls r1, r6, 2 lsls r2, 3 adds r1, r2 adds r1, r3 ldr r1, [r1] - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x2 b _08017B2A .pool @@ -27356,7 +27356,7 @@ _08017A38: b _08017B2A .pool _08017A4C: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0 bl sub_8018404 cmp r4, 0 @@ -27387,9 +27387,9 @@ _08017A80: beq _08017AF4 b _08017B20 _08017A8A: - ldr r5, =gUnknown_02021FC4 + ldr r5, =gStringVar4 ldr r4, =gUnknown_082EEEAC - bl GenerateRandomNumber + bl Random lsls r0, 16 movs r1, 0xC0 lsls r1, 10 @@ -27402,9 +27402,9 @@ _08017A8A: b _08017B0E .pool _08017AB0: - ldr r5, =gUnknown_02021FC4 + ldr r5, =gStringVar4 ldr r4, =gUnknown_082EF1CC - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x1 @@ -27414,9 +27414,9 @@ _08017AB0: b _08017B08 .pool _08017AD0: - ldr r5, =gUnknown_02021FC4 + ldr r5, =gStringVar4 ldr r4, =gUnknown_082EF010 - bl GenerateRandomNumber + bl Random lsls r0, 16 movs r1, 0xC0 lsls r1, 10 @@ -27429,9 +27429,9 @@ _08017AD0: b _08017B0E .pool _08017AF4: - ldr r5, =gUnknown_02021FC4 + ldr r5, =gStringVar4 ldr r4, =gUnknown_082EF100 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x1 @@ -27444,13 +27444,13 @@ _08017B08: ldr r1, [r0] _08017B0E: adds r0, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders b _08017B28 .pool _08017B20: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_082EE6C8 - bl ExpandStringRefs + bl StringExpandPlaceholders _08017B28: movs r0, 0 _08017B2A: @@ -27529,7 +27529,7 @@ _08017B94: mov r1, r9 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN str r5, [sp] str r4, [sp, 0x4] adds r0, r6, 0 @@ -27581,7 +27581,7 @@ sub_8017BE8: @ 8017BE8 ands r0, r1 cmp r0, 0 beq _08017CA0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] movs r0, 0x5 str r0, [sp] @@ -27708,10 +27708,10 @@ sub_8017D04: @ 8017D04 _08017D14: movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 movs r0, 0xCE lsls r0, 1 @@ -27736,10 +27736,10 @@ _08017D44: _08017D50: movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r0, r1, 3 subs r0, r1 @@ -27805,7 +27805,7 @@ _08017DD8: ldr r1, =gUnknown_082EF7B0 _08017DDA: adds r0, r3, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders b _08017DF6 .pool _08017DE8: @@ -27814,7 +27814,7 @@ _08017DE8: adds r1, r0 ldr r1, [r1] adds r0, r3, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders _08017DF6: pop {r0} bx r0 @@ -27877,7 +27877,7 @@ _08017E66: adds r1, r2 ldr r1, [r1] adds r0, r5, 0 - bl CopyString + bl StringCopy b _08017E94 .pool _08017E78: @@ -27893,7 +27893,7 @@ _08017E78: adds r1, r2 ldr r1, [r1] adds r0, r5, 0 - bl CopyString + bl StringCopy _08017E94: pop {r4-r6} pop {r0} @@ -27949,7 +27949,7 @@ _08017EFC: ldrh r1, [r4, 0xC] movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r0, r6, 0 adds r0, 0x68 ldrh r2, [r4, 0xA] @@ -27957,7 +27957,7 @@ _08017EFC: muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy movs r4, 0 b _08017F2E .pool @@ -27978,7 +27978,7 @@ _08017F2E: adds r0, 0x78 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldrh r1, [r5, 0x2] movs r0, 0xB muls r1, r0 @@ -27986,7 +27986,7 @@ _08017F2E: adds r1, r0 adds r0, r6, 0 adds r0, 0x88 - bl CopyString + bl StringCopy ldrh r5, [r5, 0x2] mov r8, r5 _08017F64: @@ -27996,7 +27996,7 @@ _08017F64: bne _08017F84 ldr r1, =gUnknown_082EE4F0 adds r0, r7, 0 - bl CopyString + bl StringCopy b _08017FB4 .pool _08017F84: @@ -28021,7 +28021,7 @@ _08017FAC: ldr r1, =gUnknown_082EE380 _08017FAE: adds r0, r7, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders _08017FB4: movs r2, 0x1 b _08017FC6 @@ -28029,7 +28029,7 @@ _08017FB4: _08017FBC: ldr r1, =gUnknown_082EE544 adds r0, r7, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r2, 0x2 _08017FC6: adds r0, r2, 0 @@ -28071,7 +28071,7 @@ _08017FFE: InUnionRoom: @ 8018004 push {lr} movs r2, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0, 0x4] ldr r0, =0x00003c19 @@ -28098,16 +28098,16 @@ _08018032: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData cmp r0, 0x1E bhi _0801805A adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData movs r1, 0xCE lsls r1, 1 cmp r0, r1 @@ -28164,19 +28164,19 @@ sub_80180A0: @ 80180A0 movs r1, 0x64 adds r4, r0, 0 muls r4, r1 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData strh r0, [r5, 0xA] adds r0, r4, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData strh r0, [r5, 0xC] adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData str r0, [r5, 0x4] ldrh r1, [r5, 0xA] movs r0, 0xCE @@ -28201,19 +28201,19 @@ sub_80180E8: @ 80180E8 movs r1, 0x64 adds r4, r0, 0 muls r4, r1 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData strh r0, [r5, 0xE] adds r0, r4, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData strh r0, [r5, 0x10] adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData str r0, [r5, 0x14] pop {r4,r5} pop {r0} @@ -28249,16 +28249,16 @@ _08018146: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData cmp r0, r6 bne _0801816C adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 cmp r0, r7 @@ -28390,7 +28390,7 @@ sub_8018220: @ 8018220 ldr r0, =gTrainerClassNames adds r1, r0 adds r0, r6, 0 - bl CopyString + bl StringCopy movs r0, 0 adds r1, r6, 0 bl sub_81AFC0C @@ -28408,7 +28408,7 @@ sub_8018220: @ 8018220 adds r0, r1 ldr r1, [r0] adds r0, r4, 0 - bl CopyString + bl StringCopy movs r0, 0x2 adds r1, r4, 0 bl sub_81AFC0C @@ -28419,7 +28419,7 @@ sub_8018220: @ 8018220 adds r0, r5, 0 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x3 adds r1, r5, 0 bl sub_81AFC0C @@ -28431,7 +28431,7 @@ sub_8018220: @ 8018220 mov r0, r10 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN mov r4, r9 adds r4, 0xFC mov r2, r8 @@ -28439,7 +28439,7 @@ sub_8018220: @ 8018220 adds r0, r4, 0 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x4 mov r1, r10 bl sub_81AFC0C @@ -28452,9 +28452,9 @@ sub_8018220: @ 8018220 ldr r1, =gUnknown_082EFF64 adds r0, r4, 0 bl sub_81AFC28 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 adds r1, r4, 0 - bl CopyString + bl StringCopy mov r0, r8 ldrh r1, [r0, 0x14] ldr r4, =0x0000270f @@ -28465,7 +28465,7 @@ _0801830C: adds r0, r6, 0 movs r2, 0 movs r3, 0x4 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0 adds r1, r6, 0 bl sub_81AFC0C @@ -28480,7 +28480,7 @@ _08018328: adds r0, r4, 0 movs r2, 0 movs r3, 0x4 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x2 adds r1, r4, 0 bl sub_81AFC0C @@ -28489,7 +28489,7 @@ _08018328: adds r0, r5, 0 movs r2, 0 movs r3, 0x5 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x3 adds r1, r5, 0 bl sub_81AFC0C @@ -28520,10 +28520,10 @@ _08018360: ldr r1, =gUnknown_082EFFA4 adds r0, r4, 0 bl sub_81AFC28 - ldr r5, =gUnknown_02021FC4 + ldr r5, =gStringVar4 adds r0, r5, 0 adds r1, r4, 0 - bl AppendString + bl StringAppend ldr r0, [sp] cmp r0, 0x1 bne _080183D0 @@ -28532,7 +28532,7 @@ _08018360: bl sub_81AFC28 adds r0, r5, 0 adds r1, r4, 0 - bl AppendString + bl StringAppend b _080183F0 .pool _080183D0: @@ -28549,7 +28549,7 @@ _080183D0: bl sub_81AFC28 adds r0, r5, 0 adds r1, r4, 0 - bl AppendString + bl StringAppend _080183F0: add sp, 0x4 pop {r3-r5} @@ -28568,12 +28568,12 @@ sub_8018404: @ 8018404 adds r5, r0, 0 adds r4, r1, 0 adds r1, 0x10 - bl CopyString_Limit7 + bl StringCopy7 ldrb r1, [r4] lsls r1, 28 lsrs r1, 28 adds r0, r5, 0 - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString pop {r4,r5} pop {r0} bx r0 @@ -28605,7 +28605,7 @@ sub_8018450: @ 8018450 push {r4-r7,lr} sub sp, 0xC adds r7, r0, 0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r6, r0, r1 @@ -29082,9 +29082,9 @@ sub_8018884: @ 8018884 push {r4,lr} sub sp, 0x14 adds r1, r0, 0 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 movs r1, 0x11 bl FillWindowPixelBuffer @@ -29165,7 +29165,7 @@ _08018920: movs r2, 0x14 movs r3, 0x1 bl DrawDownArrow - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -29261,7 +29261,7 @@ sub_80189DC: @ 80189DC b _08018A14 _080189EC: bl sub_801898C - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -29426,8 +29426,8 @@ _08018B26: beq _08018C1A b _08018C3E _08018B30: - ldr r0, =gUnknown_02021FC4 - bl ExpandStringRefs + ldr r0, =gStringVar4 + bl StringExpandPlaceholders cmp r6, 0 bne _08018B48 ldr r0, =gUnknown_082F05C8 @@ -29448,7 +29448,7 @@ _08018B4A: ldr r1, =gUnknown_082F0728 str r1, [sp, 0x8] str r2, [sp, 0xC] - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 str r1, [sp, 0x10] movs r1, 0x1 movs r3, 0x1 @@ -29570,15 +29570,15 @@ _08018C6A: _08018C6C: cmp r2, 0 bne _08018C84 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085EF2FC - bl ExpandStringRefs + bl StringExpandPlaceholders b _08018C8C .pool _08018C84: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085EF330 - bl ExpandStringRefs + bl StringExpandPlaceholders _08018C8C: ldr r0, =gUnknown_082F05D8 bl AddWindow @@ -29594,7 +29594,7 @@ _08018C8C: ldr r1, =gUnknown_082F0728 str r1, [sp, 0x8] str r2, [sp, 0xC] - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 str r1, [sp, 0x10] movs r1, 0x1 movs r3, 0x1 @@ -29868,7 +29868,7 @@ _08018ED4: b _08018EEC .pool _08018EE0: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -30434,12 +30434,12 @@ _080193A6: movs r0, 0 b _080198FE _080193AC: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r1, 0xFF strb r1, [r0] - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 strb r1, [r0] - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 strb r1, [r0] ldrb r0, [r5, 0xC] cmp r0, 0 @@ -30556,9 +30556,9 @@ _080194AE: _080194B4: movs r0, 0xB strb r0, [r5, 0x8] - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_020229F0 - bl CopyString + bl StringCopy b _08019922 .pool _080194CC: @@ -30669,9 +30669,9 @@ _0801959C: ldrb r0, [r5, 0xD] cmp r0, 0x1 bne _080195AA - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_020229F0 - bl CopyString + bl StringCopy _080195AA: movs r0, 0xF strb r0, [r5, 0x8] @@ -30750,7 +30750,7 @@ _0801963C: ldrb r0, [r5, 0xC] cmp r0, 0 bne _08019664 - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r0, 0x1 ands r0, r1 @@ -30769,7 +30769,7 @@ _0801965E: b _08019682 .pool _08019664: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r0, [r0, 0x2E] bl sub_801CCD0 cmp r0, 0 @@ -31006,12 +31006,12 @@ _08019820: b _08019922 .pool _0801982C: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r1, 0xFF strb r1, [r0] - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 strb r1, [r0] - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 strb r1, [r0] ldrb r0, [r5, 0xC] cmp r0, 0 @@ -31042,9 +31042,9 @@ _08019870: b _08019922 _08019884: bl task_add_05_task_del_08FA224_when_no_RfuFunc - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_02022A0C - bl CopyString + bl StringCopy movs r0, 0x22 strb r0, [r5, 0x8] b _08019922 @@ -31319,7 +31319,7 @@ sub_8019A98: @ 8019A98 ldr r1, =gUnknown_082F0774 adds r0, r1 ldrb r0, [r0] - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] @@ -31335,7 +31335,7 @@ sub_8019AB8: @ 8019AB8 ldr r1, =gUnknown_082F0774 adds r0, r1 ldrb r0, [r0] - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] @@ -31353,7 +31353,7 @@ sub_8019AD8: @ 8019AD8 ldr r1, =gUnknown_082F0774 adds r0, r1 ldrb r0, [r0] - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] @@ -31399,7 +31399,7 @@ sub_8019B3C: @ 8019B3C ldr r1, =gUnknown_082F0774 adds r0, r1 ldrb r0, [r0] - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] @@ -32931,7 +32931,7 @@ _0801A768: movs r1, 0 bl FillWindowPixelBuffer movs r4, 0 - ldr r6, =gUnknown_02021FC4 + ldr r6, =gStringVar4 movs r7, 0x80 lsls r7, 20 _0801A796: @@ -32943,7 +32943,7 @@ _0801A796: adds r0, r6, 0 movs r2, 0x1 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN cmp r4, 0x3 beq _0801A7CC lsrs r0, r7, 24 @@ -32979,7 +32979,7 @@ _0801A7DE: movs r1, 0x3 bl CopyWindowToVram _0801A7F8: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -33368,8 +33368,8 @@ sub_801AAD4: @ 801AAD4 bl sub_8014210 movs r4, 0 movs r7, 0x64 - ldr r6, =gUnknown_020244EC - ldr r5, =gUnknown_02024744 + ldr r6, =gPlayerParty + ldr r5, =gEnemyParty _0801AAE4: ldr r0, =gUnknown_0203CEF8 adds r0, r4, r0 @@ -33385,7 +33385,7 @@ _0801AAE4: adds r4, 0x1 cmp r4, 0x1 ble _0801AAE4 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty movs r0, 0xFA lsls r0, 1 adds r5, r4, r0 @@ -33395,12 +33395,12 @@ _0801AB0A: adds r4, 0x64 cmp r4, r5 ble _0801AB0A - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty movs r5, 0 adds r6, r4, 0 adds r6, 0x64 _0801AB1E: - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r1, r5, r1 adds r0, r4, 0 movs r2, 0x64 @@ -33550,7 +33550,7 @@ sub_801AC40: @ 801AC40 sub_801AC54: @ 801AC54 push {r4,lr} sub sp, 0xC - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 @@ -33676,7 +33676,7 @@ _0801AD8C: bl sub_819789C ldr r0, =sub_801AC40 bl SetVBlankCallback - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -33692,7 +33692,7 @@ _0801ADFC: bne _0801AE0E b _0801AFAE _0801AE0E: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -33708,7 +33708,7 @@ _0801AE24: bl BeginNormalPaletteFade movs r0, 0 bl ShowBg - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -33742,7 +33742,7 @@ _0801AE7A: movs r0, 0 movs r2, 0x20 bl link_0800A448 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -33773,7 +33773,7 @@ _0801AEA6: movs r2, 0 movs r3, 0x10 bl BeginNormalPaletteFade - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -33790,7 +33790,7 @@ _0801AEE0: ldrh r0, [r0] cmp r0, 0x52 bne _0801AF0C - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r2 @@ -33798,7 +33798,7 @@ _0801AEE0: b _0801AF16 .pool _0801AF0C: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -33814,7 +33814,7 @@ _0801AF24: cmp r0, 0 bne _0801AFAE bl sub_800ADF8 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -33885,7 +33885,7 @@ sub_801AFD8: @ 801AFD8 sub sp, 0x4 movs r0, 0 str r0, [sp] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =0x0000322c adds r1, r0 @@ -33902,7 +33902,7 @@ sub_801AFD8: @ 801AFD8 thumb_func_start sub_801B00C sub_801B00C: @ 801B00C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003230 adds r0, r1 @@ -33912,7 +33912,7 @@ sub_801B00C: @ 801B00C thumb_func_start sav1_get_mevent_buffer_1 sav1_get_mevent_buffer_1: @ 801B020 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000033f0 adds r0, r1 @@ -33922,7 +33922,7 @@ sav1_get_mevent_buffer_1: @ 801B020 thumb_func_start sav1_get_mevent_buffer_2 sav1_get_mevent_buffer_2: @ 801B034 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0xD5 lsls r1, 6 @@ -33933,7 +33933,7 @@ sav1_get_mevent_buffer_2: @ 801B034 thumb_func_start sub_801B044 sub_801B044: @ 801B044 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x0000356c adds r0, r1 @@ -33943,7 +33943,7 @@ sub_801B044: @ 801B044 thumb_func_start sub_801B058 sub_801B058: @ 801B058 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003564 adds r0, r1 @@ -33967,7 +33967,7 @@ sub_801B078: @ 801B078 cmp r0, 0 beq _0801B0C4 bl sub_801B14C - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] ldr r5, =0x00003230 adds r0, r5 @@ -33979,7 +33979,7 @@ sub_801B078: @ 801B078 ldr r0, [r4] adds r0, r5 adds r1, r6, 0 - bl sub_806F928 + bl CalcCRC16WithTable ldr r1, [r4] ldr r2, =0x0000322c adds r1, r2 @@ -34000,13 +34000,13 @@ _0801B0C6: thumb_func_start sub_801B0CC sub_801B0CC: @ 801B0CC push {r4,lr} - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] ldr r1, =0x00003230 adds r0, r1 movs r1, 0xDE lsls r1, 1 - bl sub_806F928 + bl CalcCRC16WithTable lsls r0, 16 lsrs r0, 16 ldr r4, [r4] @@ -34049,7 +34049,7 @@ _0801B122: thumb_func_start sub_801B128 sub_801B128: @ 801B128 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003230 adds r0, r1 @@ -34077,7 +34077,7 @@ sub_801B14C: @ 801B14C ldr r2, =0x0500006f mov r0, sp bl CpuSet - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x0000322c adds r0, r1 @@ -34111,7 +34111,7 @@ sub_801B180: @ 801B180 sub_801B1A4: @ 801B1A4 push {r4,r5,lr} adds r5, r0, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003230 adds r4, r0, r1 @@ -34152,7 +34152,7 @@ sub_801B1E8: @ 801B1E8 bl killram bl sub_809D4D8 bl sub_809D570 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000bec adds r0, r1 @@ -34170,7 +34170,7 @@ sub_801B21C: @ 801B21C cmp r0, 0 beq _0801B274 bl sub_801B1E8 - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] ldr r5, =0x000033f0 adds r0, r5 @@ -34182,7 +34182,7 @@ sub_801B21C: @ 801B21C ldr r0, [r4] adds r0, r5 adds r1, r6, 0 - bl sub_806F928 + bl CalcCRC16WithTable ldr r1, [r4] ldr r3, =0x000033ec adds r2, r1, r3 @@ -34209,7 +34209,7 @@ _0801B276: thumb_func_start sub_801B27C sub_801B27C: @ 801B27C push {r4,r5,lr} - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r0, [r5] ldr r1, =0x000033ec adds r4, r0, r1 @@ -34217,7 +34217,7 @@ sub_801B27C: @ 801B27C adds r0, r1 movs r1, 0xA6 lsls r1, 1 - bl sub_806F928 + bl CalcCRC16WithTable lsls r0, 16 lsrs r0, 16 ldr r1, [r4] @@ -34283,7 +34283,7 @@ _0801B304: thumb_func_start sub_801B308 sub_801B308: @ 801B308 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000033f0 adds r0, r1 @@ -34308,7 +34308,7 @@ sub_801B330: @ 801B330 sub sp, 0x4 movs r5, 0 str r5, [sp] - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r1, [r4] ldr r0, =0x000033f0 adds r1, r0 @@ -34337,7 +34337,7 @@ sub_801B368: @ 801B368 ldr r2, =0x05000009 mov r0, sp bl CpuSet - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x0000353c adds r0, r1 @@ -34358,7 +34358,7 @@ sub_801B39C: @ 801B39C movs r0, 0 b _0801B3B4 _0801B3AA: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000033f0 adds r0, r1 @@ -34535,7 +34535,7 @@ sub_801B4CC: @ 801B4CC bl sub_801B27C cmp r0, 0 beq _0801B500 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r3, [r0] ldr r0, =0x000033f0 adds r2, r3, r0 @@ -34562,7 +34562,7 @@ _0801B502: sub_801B508: @ 801B508 push {r4-r6,lr} adds r5, r0, 0 - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr ldr r0, [r6] ldr r1, =0x000033f0 adds r0, r1 @@ -34681,7 +34681,7 @@ _0801B5FC: _0801B5FE: adds r4, r5, 0 adds r4, 0x4C - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr mov r8, r0 adds r6, r5, 0 adds r6, 0x45 @@ -34693,7 +34693,7 @@ _0801B5FE: movs r2, 0x60 adds r2, r5 mov r10, r2 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r3, =0x00003564 adds r2, r0, r3 @@ -34716,8 +34716,8 @@ _0801B628: mov r2, r8 ldr r1, [r2] adds r0, r6, 0 - bl CopyString - ldr r0, =gUnknown_03005D8C + bl StringCopy + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r3, =0x00002bb0 adds r2, r0, r3 @@ -34942,7 +34942,7 @@ _0801B7D2: sub_801B7D8: @ 801B7D8 push {r4,lr} adds r4, r0, 0 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, [r2] ldr r1, =0x000033f0 adds r0, r1 @@ -35021,7 +35021,7 @@ _0801B874: .4byte _0801B8F4 .4byte _0801B918 _0801B888: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r1, =0x000033f0 adds r0, r2, r1 @@ -35037,7 +35037,7 @@ _0801B888: b _0801B93A .pool _0801B8AC: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r1, =0x000033f0 adds r0, r2, r1 @@ -35053,7 +35053,7 @@ _0801B8AC: b _0801B93A .pool _0801B8D0: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r1, =0x000033f0 adds r0, r2, r1 @@ -35069,7 +35069,7 @@ _0801B8D0: b _0801B93A .pool _0801B8F4: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000033f0 adds r0, r1 @@ -35084,7 +35084,7 @@ _0801B8F4: b _0801B93A .pool _0801B918: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000033f0 adds r2, r0, r1 @@ -35126,7 +35126,7 @@ sub_801B94C: @ 801B94C bl sub_801B27C cmp r0, 0 beq _0801B988 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000033f0 adds r0, r1 @@ -35159,7 +35159,7 @@ sub_801B990: @ 801B990 bcc _0801B9C0 cmp r2, 0x2 bne _0801B9EC - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r0, =0x00003584 adds r2, r0 @@ -35167,7 +35167,7 @@ sub_801B990: @ 801B990 b _0801B9CA .pool _0801B9C0: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r0, =0x00003570 adds r2, r0 @@ -35178,7 +35178,7 @@ _0801B9CA: b _0801B9EC .pool _0801B9DC: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r0, =0x00003570 adds r2, r0 @@ -35197,7 +35197,7 @@ sub_801B9F8: @ 801B9F8 sub sp, 0x4 movs r0, 0 str r0, [sp] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =0x00003570 adds r1, r0 @@ -35852,7 +35852,7 @@ _0801BF54: ldr r1, [r1, 0x4] movs r2, 0 movs r3, 0x6 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r6, r4, 0 _0801BF66: ldr r2, [r6] @@ -36060,7 +36060,7 @@ _0801C108: ldrh r1, [r1] movs r2, 0x2 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN mov r0, r8 ldr r1, [r0] adds r0, r1, r7 @@ -38861,7 +38861,7 @@ _0801D7C4: bl sub_80992A0 b _0801D804 _0801D7D0: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000bec adds r0, r1 @@ -38947,9 +38947,9 @@ sub_801D860: @ 801D860 adds r4, r0, 0 ldr r3, =0x0201c000 adds r0, r4, 0x4 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r2, [r2] bl _call_via_r3 cmp r0, 0x1 @@ -39205,7 +39205,7 @@ _0801DA30: _0801DA38: ldr r0, [r5, 0x18] ldrh r1, [r5, 0xC] - bl sub_806F928 + bl CalcCRC16WithTable lsls r0, 16 lsrs r0, 16 ldrh r1, [r5, 0xA] @@ -39260,7 +39260,7 @@ _0801DA7C: orrs r0, r1 str r0, [sp, 0x4] ldr r0, [r4, 0x1C] - bl sub_806F928 + bl CalcCRC16WithTable lsls r0, 16 ldr r2, =0x0000ffff ldr r1, [sp] @@ -39322,7 +39322,7 @@ _0801DB1C: beq _0801DB5E ldr r0, [r4, 0x1C] ldrh r1, [r4, 0x14] - bl sub_806F928 + bl CalcCRC16WithTable lsls r0, 16 lsrs r0, 16 ldrh r1, [r4, 0x12] @@ -39380,7 +39380,7 @@ _0801DB8E: beq _0801DBA6 b _0801DBB8 _0801DB94: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xF @@ -39388,7 +39388,7 @@ _0801DB94: adds r0, 0x10 b _0801DBB6 _0801DBA6: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xF @@ -39668,7 +39668,7 @@ sub_801DD98: @ 801DD98 bl Alloc str r0, [r4] bl sub_801DDD0 - ldr r1, =gUnknown_030022B0 + ldr r1, =gKeyRepeatStartDelay movs r0, 0x14 strh r0, [r1] movs r0, 0 @@ -39707,7 +39707,7 @@ sub_801DDD0: @ 801DDD0 lsls r1, 1 adds r0, r4, r1 bl sub_801EF1C - ldr r7, =gUnknown_03005D8C + ldr r7, =gSaveBlock1Ptr ldr r6, =0x00003c88 adds r4, 0xB9 movs r5, 0x9 @@ -39715,7 +39715,7 @@ _0801DE0E: ldr r1, [r7] adds r1, r6 adds r0, r4, 0 - bl CopyString + bl StringCopy adds r6, 0x15 adds r4, 0x15 subs r5, 0x1 @@ -39749,7 +39749,7 @@ sub_801DE30: @ 801DE30 c2_081284E0: @ 801DE54 push {r4-r6,lr} sub sp, 0x4 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r6, r0, r1 @@ -39978,7 +39978,7 @@ sub_801E030: @ 801E030 b _0801E118 .pool _0801E048: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldrh r2, [r1, 0x2E] movs r0, 0x8 ands r0, r2 @@ -40151,7 +40151,7 @@ _0801E17C: b _0801E1DC .pool _0801E1B4: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x4 ands r0, r1 @@ -40971,7 +40971,7 @@ _0801E890: b _0801E966 .pool _0801E8A4: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -41046,7 +41046,7 @@ _0801E934: b _0801E966 .pool _0801E94C: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -41353,7 +41353,7 @@ sub_801EBD4: @ 801EBD4 thumb_func_start sub_801EBE4 sub_801EBE4: @ 801EBE4 push {lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r2, [r0, 0x30] movs r0, 0x40 ands r0, r2 @@ -41490,14 +41490,14 @@ _0801ECDC: adds r1, 0xB9 adds r1, r5, r1 mov r0, sp - bl CopyString + bl StringCopy movs r1, 0 strb r1, [r0] movs r1, 0xFF strb r1, [r0, 0x1] mov r4, sp mov r0, sp - bl GetStringLength_Multibyte + bl StringLength_Multibyte adds r5, r0, 0 _0801ED02: ldr r6, =gUnknown_02022C84 @@ -41636,7 +41636,7 @@ sub_801EDE0: @ 801EDE0 adds r2, r3 adds r2, 0xB9 adds r0, r2 - bl CopyString + bl StringCopy ldr r1, [r4] movs r0, 0x1 strb r0, [r1, 0x18] @@ -41667,7 +41667,7 @@ sub_801EE2C: @ 801EE2C push {r4-r7,lr} mov r7, r8 push {r7} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr mov r8, r0 ldr r7, =gUnknown_02022C84 movs r6, 0xB9 @@ -41679,7 +41679,7 @@ _0801EE3E: adds r0, r5 ldr r1, [r7] adds r1, r6 - bl CopyString + bl StringCopy adds r6, 0x15 adds r5, 0x15 subs r4, 0x1 @@ -41764,7 +41764,7 @@ sub_801EED8: @ 801EED8 ldr r4, =gUnknown_02022C84 ldr r0, [r4] adds r0, 0x1A - bl GetStringLength_Multibyte + bl StringLength_Multibyte adds r2, r0, 0 ldr r0, [r4] adds r1, r0, 0 @@ -41810,9 +41810,9 @@ sub_801EF24: @ 801EF24 movs r0, 0x2 strb r0, [r4] adds r0, r4, 0x1 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy ldr r0, =gUnknown_02022C84 ldr r0, [r0] ldrb r0, [r0, 0x13] @@ -41830,15 +41830,15 @@ sub_801EF4C: @ 801EF4C movs r0, 0x1 strb r0, [r4] adds r0, r4, 0x1 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy adds r4, 0x9 ldr r0, =gUnknown_02022C84 ldr r1, [r0] adds r1, 0x1A adds r0, r4, 0 - bl CopyString + bl StringCopy pop {r4} pop {r0} bx r0 @@ -41852,9 +41852,9 @@ sub_801EF7C: @ 801EF7C movs r0, 0x3 strb r0, [r4] adds r0, r4, 0x1 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy ldr r0, =gUnknown_02022C84 ldr r0, [r0] ldrb r0, [r0, 0x13] @@ -41873,9 +41873,9 @@ sub_801EFA8: @ 801EFA8 movs r0, 0x4 strb r0, [r4] adds r0, r4, 0x1 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy ldr r0, =gUnknown_02022C84 ldr r0, [r0] ldrb r0, [r0, 0x13] @@ -41893,9 +41893,9 @@ sub_801EFD0: @ 801EFD0 movs r0, 0x5 strb r0, [r4] adds r0, r4, 0x1 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy ldr r0, =gUnknown_02022C84 ldr r0, [r0] ldrb r0, [r0, 0x13] @@ -41946,7 +41946,7 @@ _0801F020: _0801F044: adds r0, r6, 0 adds r1, r4, 0 - bl CopyString + bl StringCopy movs r1, 0xFC strb r1, [r0] adds r0, 0x1 @@ -41960,7 +41960,7 @@ _0801F044: strb r1, [r0] adds r0, 0x1 adds r1, r5, 0 - bl CopyString + bl StringCopy movs r0, 0x1 b _0801F0AA _0801F06E: @@ -41968,7 +41968,7 @@ _0801F06E: ldr r0, [r0] adds r0, 0x79 adds r1, r4, 0 - bl CopyString + bl StringCopy _0801F07A: ldr r0, =gUnknown_02022C84 ldr r0, [r0] @@ -42029,7 +42029,7 @@ sub_801F0D0: @ 801F0D0 sub_801F0DC: @ 801F0DC push {lr} bl sub_801F0D0 - bl GetStringLength_Multibyte + bl StringLength_Multibyte pop {r1} bx r1 thumb_func_end sub_801F0DC @@ -42186,57 +42186,57 @@ sub_801F1D0: @ 801F1D0 thumb_func_start copy_strings_to_sav1 copy_strings_to_sav1: @ 801F1DC push {r4,lr} - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] ldr r1, =0x00003c88 adds r0, r1 ldr r1, =gUnknown_085ED40F - bl CopyString + bl StringCopy ldr r0, [r4] ldr r1, =0x00003c9d adds r0, r1 ldr r1, =gUnknown_085ED415 - bl CopyString + bl StringCopy ldr r0, [r4] ldr r1, =0x00003cb2 adds r0, r1 ldr r1, =gUnknown_085ED41D - bl CopyString + bl StringCopy ldr r0, [r4] ldr r1, =0x00003cc7 adds r0, r1 ldr r1, =gUnknown_085ED423 - bl CopyString + bl StringCopy ldr r0, [r4] ldr r1, =0x00003cdc adds r0, r1 ldr r1, =gUnknown_085ED42A - bl CopyString + bl StringCopy ldr r0, [r4] ldr r1, =0x00003cf1 adds r0, r1 ldr r1, =gUnknown_085ED430 - bl CopyString + bl StringCopy ldr r0, [r4] ldr r1, =0x00003d06 adds r0, r1 ldr r1, =gUnknown_085ED434 - bl CopyString + bl StringCopy ldr r0, [r4] ldr r1, =0x00003d1b adds r0, r1 ldr r1, =gUnknown_085ED43A - bl CopyString + bl StringCopy ldr r0, [r4] ldr r1, =0x00003d30 adds r0, r1 ldr r1, =gUnknown_085ED440 - bl CopyString + bl StringCopy ldr r0, [r4] ldr r1, =0x00003d45 adds r0, r1 ldr r1, =gUnknown_085ED44A - bl CopyString + bl StringCopy pop {r4} pop {r0} bx r0 @@ -43065,7 +43065,7 @@ _0801F8FC: lsrs r4, 16 bl sub_801F114 adds r5, r0, 0 - bl GetStringLength_Multibyte + bl StringLength_Multibyte adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -43148,7 +43148,7 @@ _0801F9A4: lsrs r4, 16 bl sub_801F114 adds r5, r0, 0 - bl GetStringLength_Multibyte + bl StringLength_Multibyte adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -43618,7 +43618,7 @@ sub_801FD30: @ 801FD30 b _0801FD7E _0801FD40: bl sub_81AFBF0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] movs r0, 0 bl sub_81AFC0C @@ -44135,7 +44135,7 @@ _08020154: mov r0, sp adds r0, 0x13 mov r1, r10 - bl CopyString + bl StringCopy mov r0, r9 lsls r2, r0, 27 lsrs r2, 24 @@ -44213,7 +44213,7 @@ _080201FE: _08020206: mov r0, sp adds r0, 0x13 - bl CopyString + bl StringCopy lsls r3, r6, 24 lsrs r3, 24 add r1, sp, 0xC @@ -44273,7 +44273,7 @@ _08020248: b _08020300 _08020286: adds r0, r5, 0 - bl GetStringLength_Multibyte + bl StringLength_Multibyte adds r4, r0, 0 mov r1, sp adds r1, 0x10 @@ -44295,7 +44295,7 @@ _080202AC: adds r0, r6, 0 adds r1, r5, 0 adds r2, r4, 0 - bl CopyString_LimitN_Multibyte + bl StringCopyN_Multibyte movs r0, 0 adds r1, r6, 0 movs r2, 0 @@ -45490,7 +45490,7 @@ sub_8020C70: @ 8020C70 ldrb r0, [r0] cmp r0, 0 beq _08020C8E - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _08020CAC @@ -45740,7 +45740,7 @@ _08020EA4: beq _08020F20 b _08020F48 _08020EAE: - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r1, [r5] movs r0, 0xF6 lsls r0, 1 @@ -45763,14 +45763,14 @@ _08020EAE: b _08020F14 .pool _08020EDC: - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r0, [r5] movs r6, 0xF7 lsls r6, 1 b _08020F28 .pool _08020EEC: - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r1, [r5] movs r0, 0xF8 lsls r0, 1 @@ -45796,7 +45796,7 @@ _08020F14: b _08020F48 .pool _08020F20: - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r0, [r5] movs r6, 0xF9 lsls r6, 1 @@ -45895,7 +45895,7 @@ _08020FCC: lsls r1, 2 ldr r2, =gUnknown_020229F0 adds r1, r2 - bl CopyString + bl StringCopy adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 @@ -45923,7 +45923,7 @@ _08020FF0: cmp r5, 0x4 bls _08020FF0 _08021012: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x14] lsls r0, 29 @@ -46632,7 +46632,7 @@ sub_8021608: @ 8021608 asrs r0, 23 movs r2, 0xC ldrsh r1, [r4, r2] - bl sine + bl Sin strh r0, [r5, 0x24] movs r1, 0xE ldrsh r0, [r4, r1] @@ -47268,15 +47268,15 @@ _08021B04: adds r0, r3, r0 adds r0, r2, r0 ldrh r1, [r0] - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 movs r2, 0x1 movs r3, 0x4 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, =gUnknown_082F43B4 adds r0, r4, r0 ldr r1, [r0] - ldr r0, =gUnknown_02021FC4 - bl AppendString + ldr r0, =gStringVar4 + bl StringAppend ldr r4, [sp, 0x14] subs r4, 0x4 lsls r2, r6, 24 @@ -47320,10 +47320,10 @@ _08021B72: adds r4, r2, r4 ldrh r1, [r4] lsrs r1, 4 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r7, 0 ldrb r0, [r4] movs r3, 0xF @@ -47370,17 +47370,17 @@ _08021BD0: bl __udivsi3 lsls r0, 24 lsrs r3, r0, 24 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r3, 0 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, =gUnknown_082F43B4 ldr r2, [sp, 0x28] adds r0, r2, r0 ldr r1, [r0] - ldr r0, =gUnknown_02021FC4 - bl ExpandStringRefs + ldr r0, =gStringVar4 + bl StringExpandPlaceholders b _08021C5E .pool _08021C1C: @@ -47400,12 +47400,12 @@ _08021C30: lsls r1, 2 ldr r0, =gBerries adds r1, r0 - ldr r0, =gUnknown_02021CC4 - bl CopyString + ldr r0, =gStringVar1 + bl StringCopy ldr r0, =gUnknown_082F43B4 ldr r1, [r0, 0x8] - ldr r0, =gUnknown_02021FC4 - bl ExpandStringRefs + ldr r0, =gStringVar4 + bl StringExpandPlaceholders ldr r4, [sp, 0x14] subs r4, 0x4 lsls r0, r6, 24 @@ -47419,7 +47419,7 @@ _08021C5A: adds r5, 0x1 _08021C5E: movs r0, 0x2 - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 adds r2, r4, 0 bl GetStringRightAlignXOffset adds r2, r0, 0 @@ -47436,7 +47436,7 @@ _08021C5E: str r1, [sp] movs r4, 0 str r4, [sp, 0x4] - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 str r1, [sp, 0x8] movs r1, 0x2 bl box_print @@ -47445,17 +47445,17 @@ _08021C5E: ldrb r2, [r2, 0x8] cmp r3, r2 bne _08021CC0 - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldr r1, =gUnknown_085ED7D4 - bl CopyString + bl StringCopy b _08021CC8 .pool _08021CC0: - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldr r1, =gUnknown_085ED7E0 - bl CopyString + bl StringCopy _08021CC8: - ldr r4, =gUnknown_02021EC4 + ldr r4, =gStringVar3 mov r3, r9 strb r3, [r4] mov r1, r8 @@ -47464,7 +47464,7 @@ _08021CC8: adds r1, r0, r1 movs r0, 0 bl sub_81AFC0C - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 adds r1, r4, 0 bl sub_81AFC28 ldr r1, [sp, 0xC] @@ -47478,7 +47478,7 @@ _08021CC8: str r1, [sp] movs r1, 0 str r1, [sp, 0x4] - ldr r2, =gUnknown_02021FC4 + ldr r2, =gStringVar4 str r2, [sp, 0x8] movs r1, 0x2 movs r2, 0x4 @@ -47573,11 +47573,11 @@ sub_8021D34: @ 8021D34 add r0, r8 movs r4, 0 ldrsh r1, [r0, r4] - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, =gUnknown_02021DC4 + bl ConvertIntToDecimalStringN + ldr r0, =gStringVar2 movs r1, 0xA0 lsls r1, 1 add r1, r8 @@ -47585,11 +47585,11 @@ sub_8021D34: @ 8021D34 ldrsh r1, [r1, r2] movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r5, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r5, =gStringVar4 ldr r1, =gUnknown_085ED838 adds r0, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x2 adds r1, r5, 0 movs r2, 0x1 @@ -47634,13 +47634,13 @@ sub_8021D34: @ 8021D34 add r0, r8 movs r2, 0 ldrsh r1, [r0, r2] - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r2, 0x2 movs r3, 0x1 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r1, =gUnknown_085ED82C adds r0, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x2 adds r1, r5, 0 movs r2, 0x1 @@ -47729,13 +47729,13 @@ _08021F0A: mov r10, r0 cmp r0, 0x7 bls _08021EEC - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 mov r2, r12 lsrs r1, r2, 8 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021DC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar2 ldr r1, =0x000f4240 ldr r0, [sp, 0xC] bl __udivsi3 @@ -47743,11 +47743,11 @@ _08021F0A: adds r0, r4, 0 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085ED848 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r2, 0x1 negs r2, r2 movs r0, 0x2 @@ -47814,16 +47814,16 @@ _08021FDE: movs r2, 0 adds r3, r7, 0 bl box_print - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r4, [sp, 0x10] ldrh r1, [r4, 0x8] movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085ED85C adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r2, 0x1 negs r2, r2 movs r0, 0x2 @@ -48190,19 +48190,19 @@ _080222D0: _08022336: mov r1, r9 adds r1, 0x2 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r2, 0 movs r3, 0x1 - bl ConvertIntToDecimalString - ldr r0, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r0, =gStringVar4 ldr r1, =gUnknown_085ED8F4 - bl ExpandStringRefs + bl StringExpandPlaceholders ldrb r0, [r6, 0x2] ldr r1, =gUnknown_082F32D8 str r1, [sp] movs r1, 0 str r1, [sp, 0x4] - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 str r1, [sp, 0x8] movs r1, 0x1 movs r2, 0 @@ -48267,23 +48267,23 @@ _080223CA: adds r0, r4, r6 ldrh r1, [r0, 0x4] lsrs r1, 8 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, [sp, 0xC] ldr r1, =0x000f4240 bl __udivsi3 adds r1, r0, 0 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r0, =gStringVar4 ldr r1, =gUnknown_085ED848 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 movs r2, 0x1 negs r2, r2 bl GetStringWidth @@ -48295,7 +48295,7 @@ _080223CA: str r1, [sp] movs r1, 0 str r1, [sp, 0x4] - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 str r1, [sp, 0x8] movs r1, 0x1 adds r2, r7, 0 @@ -48321,7 +48321,7 @@ _08022444: b _080224BA .pool _08022480: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -48373,7 +48373,7 @@ sub_80224D0: @ 80224D0 adds r1, r0 lsls r1, 3 adds r1, r2 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] movs r3, 0xF6 lsls r3, 1 @@ -49093,7 +49093,7 @@ sub_8022A94: @ 8022A94 asrs r0, 23 movs r2, 0xC ldrsh r1, [r4, r2] - bl sine + bl Sin strh r0, [r5, 0x24] movs r1, 0xE ldrsh r0, [r4, r1] @@ -49432,14 +49432,14 @@ _08022D42: lsrs r4, r0, 24 cmp r4, 0 beq _08022D90 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_082F32A4 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, [r0] adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldrb r3, [r7, 0xB] str r6, [sp] mov r0, r8 @@ -49490,7 +49490,7 @@ _08022DC0: strb r0, [r7, 0xC] b _08022E08 _08022DD8: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r0, [r0, 0x2E] ands r4, r0 cmp r4, 0 @@ -50640,7 +50640,7 @@ sub_80236B8: @ 80236B8 mov r7, r8 push {r7} adds r5, r0, 0 - ldr r3, =gUnknown_030022C0 + ldr r3, =gMain ldrh r1, [r3, 0x2E] movs r4, 0x1 adds r0, r4, 0 @@ -51353,11 +51353,11 @@ _08023C5C: lsls r0, 24 cmp r0, 0 beq _08023CA2 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, [r5, 0x1C] movs r2, 0 movs r3, 0x6 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r4, 0 str r4, [sp] adds r0, r6, 0 @@ -51565,7 +51565,7 @@ _08023DA0: adds r4, r0, 0 asrs r0, r4, 8 str r0, [r7, 0x68] - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -51900,7 +51900,7 @@ _0802409C: strb r0, [r1] b _0802412A _080240AE: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -51922,18 +51922,18 @@ _080240CC: strb r1, [r5, 0xC] b _0802412A _080240DC: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, [r5, 0x1C] movs r2, 0 movs r3, 0x6 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021DC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar2 bl sub_80247BC adds r1, r0, 0 adds r0, r4, 0 movs r2, 0 movs r3, 0x6 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r4, 0 str r4, [sp] adds r0, r6, 0 @@ -52650,7 +52650,7 @@ sub_8024644: @ 8024644 thumb_func_start sub_8024668 sub_8024668: @ 8024668 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] adds r1, 0xAC ldr r0, [r0] @@ -52662,7 +52662,7 @@ sub_8024668: @ 8024668 thumb_func_start sub_802467C sub_802467C: @ 802467C - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r2, [r2] adds r2, 0xAC ldr r2, [r2] @@ -52676,7 +52676,7 @@ sub_802467C: @ 802467C sub_8024690: @ 8024690 push {lr} adds r1, r0, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r2, 0xFA lsls r2, 1 @@ -52691,7 +52691,7 @@ sub_8024690: @ 8024690 sub_80246AC: @ 80246AC push {r4,lr} adds r4, r0, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r1, 0xFA lsls r1, 1 @@ -52713,7 +52713,7 @@ _080246CE: thumb_func_start sub_80246D4 sub_80246D4: @ 80246D4 push {lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r1, 0xFA lsls r1, 1 @@ -52737,7 +52737,7 @@ _080246FA: sub_8024700: @ 8024700 push {r4,r5,lr} adds r4, r0, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r1, 0xFA lsls r1, 1 @@ -52768,7 +52768,7 @@ _0802473A: sub_8024740: @ 8024740 push {r4,r5,lr} adds r5, r0, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r1, 0xFA lsls r1, 1 @@ -52798,7 +52798,7 @@ _08024776: thumb_func_start sub_802477C sub_802477C: @ 802477C push {r4,r5,lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r1, 0xFA lsls r1, 1 @@ -52830,7 +52830,7 @@ _080247B6: thumb_func_start sub_80247BC sub_80247BC: @ 80247BC push {lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r1, 0xFA lsls r1, 1 @@ -52862,11 +52862,11 @@ sub_80247D4: @ 80247D4 lsrs r4, 24 lsls r5, 24 lsrs r5, 24 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 mov r9, r0 movs r2, 0x1 movs r3, 0x5 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN str r4, [sp] str r5, [sp, 0x4] movs r0, 0 @@ -53066,7 +53066,7 @@ sub_802493C: @ 802493C adds r0, r1 movs r1, 0x64 muls r1, r6 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 bl sub_80261F8 ldr r0, =sub_8024BC8 @@ -53733,7 +53733,7 @@ sub_8024F38: @ 8024F38 ldrb r0, [r0] cmp r0, 0 bne _08024FEE - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 @@ -53819,7 +53819,7 @@ sub_8024FFC: @ 8024FFC ldrb r0, [r0] cmp r0, 0x9 bhi _080250C4 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 @@ -56425,7 +56425,7 @@ _08026528: adds r1, 0xF5 add r1, r8 ldrb r6, [r1] - bl GenerateRandomNumber + bl Random movs r1, 0x1 ands r1, r0 cmp r1, 0 @@ -58342,7 +58342,7 @@ _0802740C: _08027410: movs r4, 0x2 _08027412: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xA @@ -58428,7 +58428,7 @@ sub_802749C: @ 802749C ldr r1, =0x000f4236 bl sub_8027A38 adds r2, r0, 0 - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r0, [r3] movs r6, 0x83 lsls r6, 2 @@ -58513,7 +58513,7 @@ sub_8027554: @ 8027554 ldrb r0, [r2] cmp r0, 0 bne _080275FC - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r2, [r0, 0x2E] movs r0, 0x40 ands r0, r2 @@ -59195,16 +59195,16 @@ _08027A62: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x5 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08027A94 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData cmp r0, 0x55 bne _08027A94 movs r0, 0x1 @@ -59341,7 +59341,7 @@ _08027B94: bne _08027BE2 b _08027BBA _08027BA0: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -59387,7 +59387,7 @@ sub_8027BEC: @ 8027BEC str r1, [sp, 0x18] lsls r0, 24 lsrs r7, r0, 24 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] movs r2, 0x84 lsls r2, 2 @@ -59434,7 +59434,7 @@ sub_8027BEC: @ 8027BEC adds r2, r4, 0 bl Print movs r6, 0 - ldr r2, =gUnknown_02021CC4 + ldr r2, =gStringVar1 mov r8, r2 movs r0, 0xFF mov r10, r0 @@ -59452,7 +59452,7 @@ _08027C76: ldrb r3, [r0] mov r0, r8 movs r2, 0 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x1 mov r1, r8 movs r2, 0x1 @@ -59540,7 +59540,7 @@ _08027D48: lsls r1, r4, 2 adds r1, r5 ldr r1, [r1] - bl CopyString + bl StringCopy adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 @@ -62425,7 +62425,7 @@ _080293D8: b _0802941C .pool _08029404: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x14] lsrs r0, 3 @@ -62904,7 +62904,7 @@ _080297CC: mov r1, r9 movs r2, 0 movs r3, 0x7 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x1 add r1, sp, 0xC movs r2, 0x1 @@ -63136,7 +63136,7 @@ _080299F2: mov r0, r9 adds r0, 0x1 str r0, [sp, 0x10] - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 mov r10, r1 _08029A36: mov r0, r9 @@ -63159,7 +63159,7 @@ _08029A36: adds r1, r4, 0 movs r2, 0 movs r3, 0x4 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x1 mov r1, r10 movs r2, 0x1 @@ -63218,7 +63218,7 @@ _08029AE0: movs r1, 0 str r1, [sp, 0x8] movs r1, 0x1 - ldr r2, =gUnknown_02021FC4 + ldr r2, =gStringVar4 bl Print _08029B10: adds r0, r7, 0x1 @@ -63294,7 +63294,7 @@ _08029BB8: bhi _08029BD0 b _08029FF8 _08029BD0: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -63410,7 +63410,7 @@ _08029CE0: bhi _08029CF8 b _08029FF8 _08029CF8: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -63518,13 +63518,13 @@ _08029DA0: bl sub_802762C lsls r0, 16 lsrs r0, 16 - ldr r5, =gUnknown_02021CC4 + ldr r5, =gStringVar1 adds r1, r5, 0 bl itemid_get_name movs r0, 0 adds r1, r5, 0 bl sub_81AFC0C - ldr r7, =gUnknown_02021FC4 + ldr r7, =gStringVar4 ldr r1, =gUnknown_085EDDBD adds r0, r7, 0 bl sub_81AFC28 @@ -63576,7 +63576,7 @@ _08029EA8: ldr r2, =0x00003009 adds r0, r2 ldrb r0, [r0] - ldr r2, =gUnknown_02021FC4 + ldr r2, =gStringVar4 movs r1, 0x29 str r1, [sp] movs r1, 0xFF @@ -63646,7 +63646,7 @@ _08029F5C: lsrs r0, 16 cmp r0, 0x1D bls _08029FF8 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -63959,7 +63959,7 @@ _0802A1DC: ldrb r0, [r0] movs r1, 0x3 bl CopyWindowToVram - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r5, 0x1 movs r2, 0x1 @@ -64853,7 +64853,7 @@ sub_802A9A8: @ 802A9A8 adds r0, r1 movs r1, 0x64 muls r1, r7 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 bl sub_802AC2C ldr r0, [r5] @@ -65119,15 +65119,15 @@ sub_802AC2C: @ 802AC2C adds r4, r1, 0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData strh r0, [r5] adds r0, r4, 0 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData str r0, [r5, 0x4] adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData str r0, [r5, 0x8] pop {r4,r5} pop {r0} @@ -66352,7 +66352,7 @@ _0802B5F2: beq _0802B61E adds r0, r1, 0 bl sub_802AA94 - bl GenerateRandomNumber + bl Random ldr r1, [r4] lsls r0, 16 lsrs r0, 16 @@ -66741,7 +66741,7 @@ _0802B902: adds r0, 0x1 strh r0, [r1, 0xA] _0802B914: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -66958,7 +66958,7 @@ _0802BAD0: ldrh r0, [r1, 0x3C] adds r2, r0, 0x1 strh r2, [r1, 0x3C] - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -67371,7 +67371,7 @@ _0802BDFE: ldr r1, =gUnknown_020229F0 add r1, r9 adds r0, r7, 0 - bl CopyString + bl StringCopy movs r0, 0x1 strh r0, [r5] ldrh r0, [r6, 0x2] @@ -68693,7 +68693,7 @@ sub_802C808: @ 802C808 thumb_func_start sub_802C818 sub_802C818: @ 802C818 push {lr} - bl GenerateRandomNumber + bl Random lsls r0, 16 movs r1, 0xE0 lsls r1, 11 @@ -68847,16 +68847,16 @@ _0802C924: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x5 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0802C95C adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 bl sub_802C908 @@ -70728,7 +70728,7 @@ sub_802D7E8: @ 802D7E8 adds r1, r4, 0 movs r2, 0 movs r3, 0x1 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN bl sub_81AFBF0 ldr r1, [r5] adds r1, 0x26 @@ -72137,7 +72137,7 @@ _0802E322: thumb_func_start sub_802E32C sub_802E32C: @ 802E32C - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r1, 0xFE lsls r1, 1 @@ -72338,7 +72338,7 @@ _0802E4A8: bne _0802E4F6 b _0802E4CE _0802E4B4: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -72437,7 +72437,7 @@ sub_802E500: @ 802E500 movs r0, 0xC8 lsls r0, 21 mov r8, r0 - ldr r5, =gUnknown_02021CC4 + ldr r5, =gStringVar1 _0802E58A: ldr r1, =gUnknown_082FE278 lsls r0, r6, 2 @@ -72460,7 +72460,7 @@ _0802E58A: adds r0, r5, 0 movs r2, 0 movs r3, 0x5 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r0, r5, 0 bl sub_802E620 movs r0, 0x1 diff --git a/asm/load_save.s b/asm/load_save.s index f3685a083..6cbb2bdb2 100644 --- a/asm/load_save.s +++ b/asm/load_save.s @@ -13,14 +13,14 @@ CheckForFlashMemory: @ 8076B68 lsls r0, 16 cmp r0, 0 bne _08076B84 - ldr r1, =gUnknown_03005D88 + ldr r1, =gFlashMemoryPresent movs r0, 0x1 str r0, [r1] bl StartFlashMemoryTimer b _08076B8A .pool _08076B84: - ldr r1, =gUnknown_03005D88 + ldr r1, =gFlashMemoryPresent movs r0, 0 str r0, [r1] _08076B8A: @@ -70,12 +70,12 @@ InitSaveBlockPointersWithRandomOffset: @ 8076BDC adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 - ldr r5, =gUnknown_03005D8C - bl GenerateRandomNumber + ldr r5, =gSaveBlock1Ptr + bl Random adds r4, r0 movs r0, 0x7C ands r4, r0 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, =gUnknown_02024A54 adds r0, r4, r0 str r0, [r1] @@ -102,7 +102,7 @@ saveblock_randomize_and_relocate: @ 8076C2C mov r5, r8 push {r5-r7} sub sp, 0x8 - ldr r5, =gUnknown_030022C0 + ldr r5, =gMain ldr r0, [r5, 0xC] str r0, [sp] ldr r1, [r5, 0x10] @@ -113,13 +113,13 @@ saveblock_randomize_and_relocate: @ 8076C2C ldr r1, =gUnknown_0203CF5C str r0, [r1] ldr r4, =0x02000000 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r6, =0x00000f2c adds r0, r4, 0 adds r2, r6, 0 bl memcpy - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr mov r10, r1 ldr r1, [r1] ldr r7, =0x00003d88 @@ -142,7 +142,7 @@ saveblock_randomize_and_relocate: @ 8076C2C ldrb r0, [r4, 0xD] adds r0, r1 bl InitSaveBlockPointersWithRandomOffset - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] adds r1, r4, 0 adds r2, r6, 0 @@ -165,16 +165,16 @@ saveblock_randomize_and_relocate: @ 8076C2C str r0, [r5, 0x10] ldr r1, [sp] str r1, [r5, 0xC] - bl GenerateRandomNumber + bl Random adds r4, r0, 0 - bl GenerateRandomNumber + bl Random lsls r4, 16 lsls r0, 16 lsrs r0, 16 adds r4, r0 adds r0, r4, 0 bl saveblock_apply_crypto - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] adds r0, 0xAC str r4, [r0] @@ -191,7 +191,7 @@ saveblock_randomize_and_relocate: @ 8076C2C thumb_func_start sav2_x1_query_bit1 sav2_x1_query_bit1: @ 8076D24 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r1, [r0, 0x9] movs r0, 0x1 @@ -202,7 +202,7 @@ sav2_x1_query_bit1: @ 8076D24 thumb_func_start sav2_x9_clear_bit1 sav2_x9_clear_bit1: @ 8076D34 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldrb r1, [r2, 0x9] movs r0, 0xFE @@ -214,7 +214,7 @@ sav2_x9_clear_bit1: @ 8076D34 thumb_func_start sub_8076D48 sub_8076D48: @ 8076D48 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldrb r1, [r2, 0x9] movs r0, 0x1 @@ -229,7 +229,7 @@ sub_8076D5C: @ 8076D5C push {lr} movs r0, 0 bl sub_8084FAC - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldrb r1, [r2, 0x9] movs r0, 0x1 @@ -242,7 +242,7 @@ sub_8076D5C: @ 8076D5C thumb_func_start sav2_gender2_inplace_and_xFE sav2_gender2_inplace_and_xFE: @ 8076D78 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldrb r1, [r2, 0x9] movs r0, 0xFE @@ -256,7 +256,7 @@ sav2_gender2_inplace_and_xFE: @ 8076D78 @ void copy_player_party_to_sav1() copy_player_party_to_sav1: @ 8076D8C push {r4,lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =gUnknown_020244E9 ldrb r1, [r1] @@ -266,7 +266,7 @@ copy_player_party_to_sav1: @ 8076D8C strb r1, [r0] movs r4, 0 _08076DA0: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x64 muls r1, r4 @@ -274,7 +274,7 @@ _08076DA0: movs r2, 0x8E lsls r2, 2 adds r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 movs r2, 0x64 bl memcpy @@ -291,7 +291,7 @@ _08076DA0: copy_player_party_from_sav1: @ 8076DD4 push {r4,r5,lr} ldr r1, =gUnknown_020244E9 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r2, 0x8D lsls r2, 2 @@ -299,13 +299,13 @@ copy_player_party_from_sav1: @ 8076DD4 ldrb r0, [r0] strb r0, [r1] movs r4, 0 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty _08076DEA: movs r0, 0x64 adds r2, r4, 0 muls r2, r0 adds r0, r2, r5 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r1, [r1] adds r1, r2 movs r2, 0x8E @@ -327,7 +327,7 @@ save_serialize_npcs: @ 8076E1C push {r4-r7,lr} mov r7, r8 push {r7} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr mov r12, r0 movs r5, 0xA3 lsls r5, 4 @@ -365,7 +365,7 @@ save_deserialize_npcs: @ 8076E64 push {r4-r7,lr} mov r7, r8 push {r7} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr mov r12, r0 movs r5, 0xA3 lsls r5, 4 @@ -426,9 +426,9 @@ copy_bags_and_unk_data_from_save_blocks: @ 8076ECC movs r2, 0 ldr r0, =gUnknown_02032180 mov r12, r0 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr mov r10, r1 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr movs r3, 0xAC lsls r3, 3 ldr r4, =gUnknown_02031C58 @@ -444,7 +444,7 @@ _08076EE8: ble _08076EE8 movs r2, 0 ldr r0, =gUnknown_02031C58 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr movs r3, 0xBB lsls r3, 3 adds r4, r0, 0 @@ -461,7 +461,7 @@ _08076F08: ble _08076F08 movs r2, 0 ldr r0, =gUnknown_02031C58 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr movs r3, 0xCA lsls r3, 3 adds r4, r0, 0 @@ -478,7 +478,7 @@ _08076F28: ble _08076F28 movs r2, 0 ldr r0, =gUnknown_02031C58 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr movs r6, 0x98 lsls r6, 1 adds r4, r0, r6 @@ -496,7 +496,7 @@ _08076F4A: ble _08076F4A movs r2, 0 ldr r0, =gUnknown_02031C58 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr movs r7, 0x8C lsls r7, 2 adds r4, r0, r7 @@ -513,7 +513,7 @@ _08076F6C: cmp r2, 0x2D ble _08076F6C ldr r0, =gUnknown_02031C58 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr mov r8, r1 movs r5, 0xBA lsls r5, 2 @@ -563,11 +563,11 @@ copy_bags_and_unk_data_to_save_blocks: @ 8076FE0 mov r5, r8 push {r5-r7} movs r2, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr mov r8, r0 ldr r1, =gUnknown_02032180 mov r12, r1 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr movs r3, 0xAC lsls r3, 3 ldr r4, =gUnknown_02031C58 @@ -582,7 +582,7 @@ _08076FFC: cmp r2, 0x1D ble _08076FFC movs r2, 0 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr movs r4, 0xBB lsls r4, 3 ldr r0, =gUnknown_02031C58 @@ -599,7 +599,7 @@ _0807701C: cmp r2, 0x1D ble _0807701C movs r2, 0 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr movs r4, 0xCA lsls r4, 3 ldr r0, =gUnknown_02031C58 @@ -616,7 +616,7 @@ _0807703C: cmp r2, 0xF ble _0807703C movs r2, 0 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr movs r4, 0xD2 lsls r4, 3 ldr r0, =gUnknown_02031C58 @@ -634,7 +634,7 @@ _0807705E: cmp r2, 0x3F ble _0807705E movs r2, 0 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr movs r4, 0xF2 lsls r4, 3 ldr r0, =gUnknown_02031C58 @@ -651,7 +651,7 @@ _08077080: adds r2, 0x1 cmp r2, 0x2D ble _08077080 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr mov r9, r0 ldr r1, =0x00002be0 mov r10, r1 @@ -701,7 +701,7 @@ _080770A0: thumb_func_start apply_u16_xor_crypto apply_u16_xor_crypto: @ 8077100 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r2, [r2] adds r2, 0xAC ldr r2, [r2] @@ -715,7 +715,7 @@ apply_u16_xor_crypto: @ 8077100 thumb_func_start apply_u32_xor_crypto apply_u32_xor_crypto: @ 8077118 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r3, [r2] adds r3, 0xAC ldr r2, [r0] @@ -736,7 +736,7 @@ saveblock_apply_crypto: @ 8077130 bl call_encrypt_decrypt_all_item_quantities adds r0, r4, 0 bl sub_8024690 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r0, [r5] movs r1, 0x92 lsls r1, 3 diff --git a/asm/lottery_corner.s b/asm/lottery_corner.s index babde2a8e..49f20137f 100644 --- a/asm/lottery_corner.s +++ b/asm/lottery_corner.s @@ -8,11 +8,11 @@ thumb_func_start sub_8177558 sub_8177558: @ 8177558 push {r4,lr} - bl GenerateRandomNumber + bl Random adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 - bl GenerateRandomNumber + bl Random lsls r0, 16 orrs r0, r4 bl sub_8177814 @@ -30,7 +30,7 @@ sub_8177584: @ 8177584 push {r4,r5,lr} lsls r0, 16 lsrs r4, r0, 16 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r1, r0, 16 subs r0, r4, 0x1 @@ -91,21 +91,21 @@ _081775FC: movs r0, 0x64 adds r1, r7, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08177658 adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0817764E adds r0, r4, 0 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 ldr r0, =gUnknown_020375F0 ldrh r0, [r0] @@ -222,11 +222,11 @@ _081776D2: movs r0, 0x64 ldr r1, [sp, 0x4] muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 - ldr r2, =gUnknown_02021CC4 + ldr r2, =gStringVar1 movs r1, 0x2 - bl pokemon_getattr + bl GetMonData b _08177768 .pool _0817773C: @@ -248,12 +248,12 @@ _0817773C: adds r1, r2 lsls r1, 4 adds r0, r1 - ldr r2, =gUnknown_02021CC4 + ldr r2, =gStringVar1 movs r1, 0x2 bl pokemon_getattr_encrypted _08177768: - ldr r0, =gUnknown_02021CC4 - bl GetStringEnd_Limit7 + ldr r0, =gStringVar1 + bl StringGetEnd10 _0817776E: add sp, 0x8 pop {r3-r5} diff --git a/asm/m4a_1.s b/asm/m4a_1.s index 0afc8aad4..361f66c1a 100644 --- a/asm/m4a_1.s +++ b/asm/m4a_1.s @@ -302,7 +302,7 @@ _081DD044: ldrb r0, [r4, o_SoundChannel_type] tst r0, 0x30 beq _081DD068 - bl sub_81DD264 + bl sub_82DF49C b _081DD228 _081DD068: mov r10, r10, lsl 16 @@ -465,8 +465,8 @@ _081DD25E: .pool thumb_func_end SoundMainRAM - arm_func_start sub_81DD264 -sub_81DD264: + arm_func_start sub_82DF49C +sub_82DF49C: ldr r6, [r4, o_SoundChannel_wav] ldrb r0, [r4, o_SoundChannel_status] tst r0, 0x20 @@ -505,10 +505,10 @@ _081DD2B4: ldrb r0, [r4, o_SoundChannel_type] tst r0, 0x10 bne _081DD3C0 - bl sub_81DD520 + bl sub_82DF758 mov r0, r1 add r3, r3, 0x1 - bl sub_81DD520 + bl sub_82DF758 sub r1, r1, r0 _081DD308: ldr r6, [r5] @@ -534,11 +534,11 @@ _081DD310: b _081DD364 _081DD358: add r3, r3, lr - bl sub_81DD520 + bl sub_82DF758 mov r0, r1 _081DD364: add r3, r3, 0x1 - bl sub_81DD520 + bl sub_82DF758 sub r1, r1, r0 _081DD370: adds r5, r5, 0x40000000 @@ -565,10 +565,10 @@ _081DD3B0: b _081DD3B0 _081DD3C0: sub r3, r3, 0x1 - bl sub_81DD520 + bl sub_82DF758 mov r0, r1 sub r3, r3, 0x1 - bl sub_81DD520 + bl sub_82DF758 sub r1, r1, r0 _081DD3D8: ldr r6, [r5] @@ -594,11 +594,11 @@ _081DD3E0: b _081DD434 _081DD428: sub r3, r3, lr - bl sub_81DD520 + bl sub_82DF758 mov r0, r1 _081DD434: sub r3, r3, 0x1 - bl sub_81DD520 + bl sub_82DF758 sub r1, r1, r0 _081DD440: adds r5, r5, 0x40000000 @@ -663,10 +663,10 @@ _081DD4F4: str r7, [r5, 0x630] str r6, [r5], 0x4 pop {r8,r12,pc} - arm_func_end sub_81DD264 + arm_func_end sub_82DF49C - arm_func_start sub_81DD520 -sub_81DD520: + arm_func_start sub_82DF758 +sub_82DF758: push {r0,r2,r5-r7,lr} mov r0, r3, lsr 6 ldr r1, [r4, o_SoundChannel_xpi] @@ -704,7 +704,7 @@ _081DD594: ldrsb r1, [r5, r0] pop {r0,r2,r5-r7,pc} .pool - arm_func_end sub_81DD520 + arm_func_end sub_82DF758 thumb_func_start SoundMainBTM SoundMainBTM: diff --git a/asm/mail.s b/asm/mail.s index a2f6e8ce5..b53707a0d 100644 --- a/asm/mail.s +++ b/asm/mail.s @@ -167,7 +167,7 @@ _081215BA: sub_81215EC: @ 81215EC push {r4-r6,lr} sub sp, 0xC - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -420,7 +420,7 @@ _081217EC: movs r2, 0x20 bl LoadPalette ldr r1, =gUnknown_0859F2B0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldrb r0, [r2, 0x8] lsls r0, 2 @@ -574,7 +574,7 @@ _08121980: b _081219E4 .pool _081219D4: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -683,7 +683,7 @@ _08121A8A: adds r1, r3 ldr r1, [r1] adds r1, 0x12 - bl CopyString + bl StringCopy adds r2, r0, 0 ldr r1, [r4] ldr r3, =0x0000021e @@ -693,12 +693,12 @@ _08121A8A: bne _08121AF0 ldr r1, =gUnknown_085EEA78 adds r0, r2, 0 - bl CopyString + bl StringCopy ldr r0, [r4] movs r1, 0x80 lsls r1, 2 adds r0, r1 - bl GetStringLength + bl StringLength ldr r2, [r4] movs r3, 0x8A lsls r3, 2 @@ -827,13 +827,13 @@ _08121BB8: _08121BCC: ldr r1, =gUnknown_085EEA78 add r0, sp, 0xC - bl CopyString + bl StringCopy ldr r4, =gUnknown_0203A134 ldr r1, [r4] movs r2, 0x80 lsls r2, 2 adds r1, r2 - bl CopyString + bl StringCopy ldr r0, [r4] ldr r1, =0x00000219 adds r0, r1 @@ -939,7 +939,7 @@ _08121CB2: sub_8121CC0: @ 8121CC0 push {lr} sub sp, 0x4 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 diff --git a/asm/main.s b/asm/main.s deleted file mode 100644 index d70b1ff96..000000000 --- a/asm/main.s +++ /dev/null @@ -1,722 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start Main -Main: @ 80003A4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r0, 0xFF - bl RegisterRamReset - movs r1, 0xA0 - lsls r1, 19 - ldr r2, =0x00007fff - adds r0, r2, 0 - strh r0, [r1] - bl InitGpuRegManager - ldr r1, =0x04000204 - ldr r3, =0x00004014 - adds r0, r3, 0 - strh r0, [r1] - bl InitKeypadData - bl InitIntrHandlers - bl m4aSoundInit - bl EnableVCountIntrAtLine150 - bl sub_800E6D0 - bl GameFreakRTC_Init - bl CheckForFlashMemory - bl InitVariablesAndSetCopyrightScreenCallback - bl sound_sources_off - bl ClearDma3Requests - bl ResetBgs - bl SetDefaultFontsPointer - ldr r0, =0x02000000 - movs r1, 0xE0 - lsls r1, 9 - bl InitHeap - ldr r0, =gUnknown_03002700 - movs r4, 0 - strb r4, [r0] - ldr r0, =gUnknown_03005D88 - ldr r0, [r0] - cmp r0, 0x1 - beq _08000414 - movs r0, 0 - bl SetMainCallback2 -_08000414: - ldr r2, =gUnknown_030022B4 - strb r4, [r2] - ldr r1, =gUnknown_03000000 - movs r3, 0xFC - lsls r3, 4 - adds r0, r3, 0 - strh r0, [r1] - ldr r7, =gUnknown_030022C0 - movs r0, 0 - mov r8, r0 - adds r6, r2, 0 -_0800042A: - bl ReadKeypad - ldr r0, =gUnknown_03002700 - ldrb r0, [r0] - cmp r0, 0 - bne _08000454 - ldrh r1, [r7, 0x28] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08000454 - movs r0, 0xE - ands r0, r1 - cmp r0, 0xE - bne _08000454 - bl rfu_REQ_stopMode - bl rfu_waitREQComplete - bl Reset -_08000454: - bl sub_8087634 - cmp r0, 0x1 - bne _0800048C - strb r0, [r6] - bl HandleLinkConnectionAndCallMainCallbacks - movs r0, 0 - strb r0, [r6] - b _080004B2 - .pool -_0800048C: - ldr r5, =gUnknown_030022B4 - movs r0, 0 - strb r0, [r5] - bl HandleLinkConnectionAndCallMainCallbacks - bl sub_80875C8 - adds r4, r0, 0 - cmp r4, 0x1 - bne _080004B2 - movs r0, 0 - strh r0, [r7, 0x2E] - bl ClearObjectCopyRequests - strb r4, [r5] - bl HandleLinkConnectionAndCallMainCallbacks - mov r2, r8 - strb r2, [r5] -_080004B2: - bl gametime_increment - bl sound_something - bl WaitForVBlankIntr - b _0800042A - .pool - thumb_func_end Main - - thumb_func_start HandleLinkConnectionAndCallMainCallbacks -@ void HandleLinkConnectionAndCallMainCallbacks() -HandleLinkConnectionAndCallMainCallbacks: @ 80004C4 - push {lr} - bl HandleLinkConnection - lsls r0, 24 - cmp r0, 0 - bne _080004D4 - bl CallMainCallbacks -_080004D4: - pop {r0} - bx r0 - thumb_func_end HandleLinkConnectionAndCallMainCallbacks - - thumb_func_start InitVariablesAndSetCopyrightScreenCallback -@ void InitVariablesAndSetCopyrightScreenCallback() -InitVariablesAndSetCopyrightScreenCallback: @ 80004D8 - push {lr} - ldr r2, =gUnknown_030022C0 - movs r0, 0 - str r0, [r2, 0x20] - ldr r1, =gUnknown_0203CF5C - str r0, [r1] - str r0, [r2, 0x24] - str r0, [r2] - ldr r0, =c2_copyright_1 - bl SetMainCallback2 - ldr r1, =gUnknown_03005D90 - ldr r0, =gUnknown_02024A54 - str r0, [r1] - ldr r1, =gUnknown_03005D94 - ldr r0, =gUnknown_02029808 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end InitVariablesAndSetCopyrightScreenCallback - - thumb_func_start CallMainCallbacks -@ void CallMainCallbacks() -CallMainCallbacks: @ 800051C - push {r4,lr} - ldr r4, =gUnknown_030022C0 - ldr r0, [r4] - cmp r0, 0 - beq _0800052A - bl _call_via_r0 -_0800052A: - ldr r0, [r4, 0x4] - cmp r0, 0 - beq _08000534 - bl _call_via_r0 -_08000534: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end CallMainCallbacks - - thumb_func_start SetMainCallback2 -@ void SetMainCallback2(void ( *func)()) -SetMainCallback2: @ 8000540 - ldr r1, =gUnknown_030022C0 - str r0, [r1, 0x4] - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end SetMainCallback2 - - thumb_func_start StartTimer1 -@ void StartTimer1() -StartTimer1: @ 8000554 - ldr r1, =0x04000106 - movs r0, 0x80 - strh r0, [r1] - bx lr - .pool - thumb_func_end StartTimer1 - - thumb_func_start SeedRngAndSetTrainerId -@ void SeedRngAndSetTrainerId() -SeedRngAndSetTrainerId: @ 8000560 - push {r4,lr} - ldr r0, =0x04000104 - ldrh r4, [r0] - adds r0, r4, 0 - bl SeedRng - ldr r1, =0x04000106 - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_02020000 - strh r4, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end SeedRngAndSetTrainerId - - thumb_func_start GetTrainerId -@ u16 GetTrainerId() -GetTrainerId: @ 8000588 - ldr r0, =gUnknown_02020000 - ldrh r0, [r0] - bx lr - .pool - thumb_func_end GetTrainerId - - thumb_func_start EnableVCountIntrAtLine150 -@ void EnableVCountIntrAtLine150() -EnableVCountIntrAtLine150: @ 8000594 - push {lr} - movs r0, 0x4 - bl GetGpuReg - movs r1, 0xFF - ands r1, r0 - movs r2, 0x96 - lsls r2, 8 - adds r0, r2, 0 - orrs r1, r0 - movs r0, 0x20 - orrs r1, r0 - movs r0, 0x4 - bl SetGpuReg - movs r0, 0x4 - bl EnableInterrupts - pop {r0} - bx r0 - thumb_func_end EnableVCountIntrAtLine150 - - thumb_func_start InitKeypadData -@ void InitKeypadData() -InitKeypadData: @ 80005BC - ldr r1, =gUnknown_030026FC - movs r0, 0x5 - strh r0, [r1] - ldr r1, =gUnknown_030022B0 - movs r0, 0x28 - strh r0, [r1] - ldr r1, =gUnknown_030022C0 - movs r0, 0 - strh r0, [r1, 0x2C] - strh r0, [r1, 0x2E] - strh r0, [r1, 0x30] - strh r0, [r1, 0x28] - strh r0, [r1, 0x2A] - bx lr - .pool - thumb_func_end InitKeypadData - - thumb_func_start ReadKeypad -@ void ReadKeypad() -ReadKeypad: @ 80005E4 - push {lr} - ldr r0, =0x04000130 - ldrh r1, [r0] - ldr r2, =0x000003ff - adds r0, r2, 0 - adds r3, r0, 0 - eors r3, r1 - ldr r1, =gUnknown_030022C0 - ldrh r2, [r1, 0x28] - adds r0, r3, 0 - bics r0, r2 - strh r0, [r1, 0x2A] - strh r0, [r1, 0x2E] - strh r0, [r1, 0x30] - adds r2, r1, 0 - cmp r3, 0 - beq _08000630 - ldrh r0, [r2, 0x2C] - cmp r0, r3 - bne _08000630 - ldrh r0, [r2, 0x32] - subs r0, 0x1 - strh r0, [r2, 0x32] - lsls r0, 16 - cmp r0, 0 - bne _08000636 - strh r3, [r2, 0x30] - ldr r0, =gUnknown_030026FC - b _08000632 - .pool -_08000630: - ldr r0, =gUnknown_030022B0 -_08000632: - ldrh r0, [r0] - strh r0, [r2, 0x32] -_08000636: - strh r3, [r2, 0x28] - strh r3, [r2, 0x2C] - ldr r0, =gUnknown_03005D90 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0x2 - bne _08000668 - ldrh r1, [r2, 0x2E] - movs r3, 0x80 - lsls r3, 2 - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _08000658 - movs r0, 0x1 - orrs r0, r1 - strh r0, [r2, 0x2E] -_08000658: - ldrh r1, [r2, 0x2C] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _08000668 - movs r0, 0x1 - orrs r0, r1 - strh r0, [r2, 0x2C] -_08000668: - ldrh r1, [r2, 0x2E] - ldrh r0, [r2, 0x36] - ands r0, r1 - cmp r0, 0 - beq _08000676 - movs r0, 0x1 - strh r0, [r2, 0x34] -_08000676: - pop {r0} - bx r0 - .pool - thumb_func_end ReadKeypad - - thumb_func_start InitIntrHandlers -@ void InitIntrHandlers() -InitIntrHandlers: @ 8000684 - push {r4,r5,lr} - ldr r5, =InterruptMain - ldr r4, =gUnknown_03002750 - ldr r3, =gRomInterruptTable - ldr r2, =gUnknown_03002710 - movs r1, 0xD -_08000690: - ldm r3!, {r0} - stm r2!, {r0} - subs r1, 0x1 - cmp r1, 0 - bge _08000690 - ldr r0, =0x040000d4 - str r5, [r0] - str r4, [r0, 0x4] - ldr r1, =0x84000200 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] - ldr r0, =gUnknown_03007FFC - str r4, [r0] - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetSerialCallback - ldr r1, =0x04000208 - movs r0, 0x1 - strh r0, [r1] - movs r0, 0x1 - bl EnableInterrupts - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end InitIntrHandlers - - thumb_func_start SetVBlankCallback -@ void SetVBlankCallback(void ( *func)()) -SetVBlankCallback: @ 80006F0 - ldr r1, =gUnknown_030022C0 - str r0, [r1, 0xC] - bx lr - .pool - thumb_func_end SetVBlankCallback - - thumb_func_start SetHBlankCallback -@ void SetHBlankCallback(void ( *func)()) -SetHBlankCallback: @ 80006FC - ldr r1, =gUnknown_030022C0 - str r0, [r1, 0x10] - bx lr - .pool - thumb_func_end SetHBlankCallback - - thumb_func_start SetVCountCallback -@ void SetVCountCallback(void ( *func)()) -SetVCountCallback: @ 8000708 - ldr r1, =gUnknown_030022C0 - str r0, [r1, 0x14] - bx lr - .pool - thumb_func_end SetVCountCallback - - thumb_func_start RestoreSerialTimer3IntrHandlers -@ void RestoreSerialTimer3IntrHandlers() -RestoreSerialTimer3IntrHandlers: @ 8000714 - ldr r0, =gUnknown_03002710 - ldr r1, =SerialIntr - str r1, [r0, 0x4] - ldr r1, =Timer3Intr - str r1, [r0, 0x8] - bx lr - .pool - thumb_func_end RestoreSerialTimer3IntrHandlers - - thumb_func_start SetSerialCallback -@ void SetSerialCallback(void ( *func)()) -SetSerialCallback: @ 800072C - ldr r1, =gUnknown_030022C0 - str r0, [r1, 0x18] - bx lr - .pool - thumb_func_end SetSerialCallback - - thumb_func_start VBlankIntr -@ void VBlankIntr() -VBlankIntr: @ 8000738 - push {r4,lr} - ldr r0, =gUnknown_030030FC - ldrb r0, [r0] - cmp r0, 0 - beq _0800074C - bl rfu_syncVBlank__ - b _08000758 - .pool -_0800074C: - ldr r0, =gUnknown_03002748 - ldrb r0, [r0] - cmp r0, 0 - bne _08000758 - bl sub_800B9B8 -_08000758: - ldr r0, =gUnknown_030022C0 - ldr r1, [r0, 0x20] - adds r1, 0x1 - str r1, [r0, 0x20] - ldr r1, =gUnknown_0203CF5C - ldr r1, [r1] - adds r4, r0, 0 - cmp r1, 0 - beq _08000778 - ldr r2, [r1] - movs r0, 0x2 - negs r0, r0 - cmp r2, r0 - bhi _08000778 - adds r0, r2, 0x1 - str r0, [r1] -_08000778: - ldr r0, [r4, 0xC] - cmp r0, 0 - beq _08000782 - bl _call_via_r0 -_08000782: - ldr r0, [r4, 0x24] - adds r0, 0x1 - str r0, [r4, 0x24] - bl CopyBufferedValuesToGpuRegs - bl ProcessDma3Requests - ldr r1, =gUnknown_03002F50 - ldr r0, =gSoundInfo - ldrb r0, [r0, 0x4] - strb r0, [r1] - bl m4aSoundMain - bl sub_8033648 - ldr r1, =0x00000439 - adds r0, r4, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080007BA - ldr r0, =gUnknown_02022FEC - ldr r0, [r0] - ldr r1, =0x013f0102 - ands r0, r1 - cmp r0, 0 - bne _080007BE -_080007BA: - bl GenerateRandomNumber -_080007BE: - bl sub_800E174 - ldr r2, =gUnknown_03007FF8 - ldrh r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strh r0, [r2] - ldr r0, =gUnknown_030022C0 - ldrh r2, [r0, 0x1C] - ldrh r3, [r0, 0x1C] - orrs r1, r2 - strh r1, [r0, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end VBlankIntr - - thumb_func_start StartFlashMemoryTimer -@ void StartFlashMemoryTimer() -StartFlashMemoryTimer: @ 8000800 - push {lr} - ldr r1, =gUnknown_0300272C - movs r0, 0x2 - bl SetFlashTimerIntr - pop {r0} - bx r0 - .pool - thumb_func_end StartFlashMemoryTimer - - thumb_func_start HBlankIntr -@ void HBlankIntr() -HBlankIntr: @ 8000814 - push {r4,lr} - ldr r4, =gUnknown_030022C0 - ldr r0, [r4, 0x10] - cmp r0, 0 - beq _08000822 - bl _call_via_r0 -_08000822: - ldr r2, =gUnknown_03007FF8 - ldrh r0, [r2] - movs r1, 0x2 - orrs r0, r1 - strh r0, [r2] - ldrh r0, [r4, 0x1C] - ldrh r2, [r4, 0x1C] - orrs r1, r0 - strh r1, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end HBlankIntr - - thumb_func_start VCountIntr -@ void VCountIntr() -VCountIntr: @ 8000844 - push {r4,lr} - ldr r4, =gUnknown_030022C0 - ldr r0, [r4, 0x14] - cmp r0, 0 - beq _08000852 - bl _call_via_r0 -_08000852: - bl m4aSoundVSync - ldr r2, =gUnknown_03007FF8 - ldrh r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strh r0, [r2] - ldrh r0, [r4, 0x1C] - ldrh r2, [r4, 0x1C] - orrs r1, r0 - strh r1, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end VCountIntr - - thumb_func_start SerialIntr -@ void SerialIntr() -SerialIntr: @ 8000878 - push {r4,lr} - ldr r4, =gUnknown_030022C0 - ldr r0, [r4, 0x18] - cmp r0, 0 - beq _08000886 - bl _call_via_r0 -_08000886: - ldr r2, =gUnknown_03007FF8 - ldrh r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strh r0, [r2] - ldrh r0, [r4, 0x1C] - ldrh r2, [r4, 0x1C] - orrs r1, r0 - strh r1, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end SerialIntr - - thumb_func_start DummyIntrHandler -@ void DummyIntrHandler() -DummyIntrHandler: @ 80008A8 - bx lr - thumb_func_end DummyIntrHandler - - thumb_func_start WaitForVBlankIntr -@ void WaitForVBlankIntr() -WaitForVBlankIntr: @ 80008AC - push {lr} - ldr r2, =gUnknown_030022C0 - ldrh r1, [r2, 0x1C] - ldr r0, =0x0000fffe - ands r0, r1 - ldrh r1, [r2, 0x1C] - strh r0, [r2, 0x1C] - ldrh r1, [r2, 0x1C] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080008D0 - movs r3, 0x1 -_080008C6: - ldrh r1, [r2, 0x1C] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _080008C6 -_080008D0: - pop {r0} - bx r0 - .pool - thumb_func_end WaitForVBlankIntr - - thumb_func_start sub_80008DC -sub_80008DC: @ 80008DC - ldr r1, =gUnknown_0203CF5C - str r0, [r1] - bx lr - .pool - thumb_func_end sub_80008DC - - thumb_func_start sub_80008E8 -sub_80008E8: @ 80008E8 - ldr r1, =gUnknown_0203CF5C - movs r0, 0 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_80008E8 - - thumb_func_start Reset -@ void Reset() -Reset: @ 80008F4 - push {r4,lr} - ldr r1, =0x04000208 - movs r0, 0 - strh r0, [r1] - bl m4aSoundVSyncOff - bl remove_some_task - ldr r1, =0x040000bc - ldrh r2, [r1, 0xA] - ldr r3, =0x0000c5ff - adds r0, r3, 0 - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r4, [r1, 0xA] - ldr r2, =0x00007fff - adds r0, r2, 0 - ands r0, r4 - strh r0, [r1, 0xA] - ldrh r0, [r1, 0xA] - adds r1, 0xC - ldrh r4, [r1, 0xA] - adds r0, r3, 0 - ands r0, r4 - strh r0, [r1, 0xA] - ldrh r4, [r1, 0xA] - adds r0, r2, 0 - ands r0, r4 - strh r0, [r1, 0xA] - ldrh r0, [r1, 0xA] - ldr r0, =0x040000d4 - ldrh r1, [r0, 0xA] - ands r3, r1 - strh r3, [r0, 0xA] - ldrh r1, [r0, 0xA] - ands r2, r1 - strh r2, [r0, 0xA] - ldrh r0, [r0, 0xA] - bl RTC_SetReadOnly - movs r0, 0xFF - bl SoftReset - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end Reset - - thumb_func_start sub_8000964 -sub_8000964: @ 8000964 - push {lr} - sub sp, 0x4 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, =gPokemonCrySongs - ldr r2, =0x01000034 - mov r0, sp - bl CpuSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8000964 - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/main_menu.s b/asm/main_menu.s index 660b6c599..050c38c80 100644 --- a/asm/main_menu.s +++ b/asm/main_menu.s @@ -421,7 +421,7 @@ Task_WaitForSaveFileErrorWindow: @ 802FA5C lsls r0, 16 cmp r0, 0 bne _0802FA98 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -523,7 +523,7 @@ Task_WaitForBatteryDryErrorWindow: @ 802FB50 lsls r0, 16 cmp r0, 0 bne _0802FB8C - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -622,7 +622,7 @@ _0802FBCE: movs r1, 0xFC movs r2, 0x2 bl LoadPalette - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 @@ -1078,7 +1078,7 @@ HandleMainMenuInput: @ 80300E0 lsls r4, r1, 3 ldr r7, =gTasks + 0x8 adds r5, r4, r7 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldrh r2, [r1, 0x2E] movs r0, 0x1 ands r0, r2 @@ -1484,7 +1484,7 @@ _08030444: b _0803048A .pool _08030460: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =CB2_ReinitMainMenu str r1, [r0, 0x8] ldr r0, =CB2_OptionsMenu @@ -1714,7 +1714,7 @@ _08030658: strh r0, [r4, 0xA] b _08030688 _08030664: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r0, [r0, 0x2E] ands r1, r0 cmp r1, 0 @@ -2086,9 +2086,9 @@ _08030970: bl CopyWindowToVram movs r0, 0 bl sub_8032318 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_082C897B - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 bl AddTextPrinterForMessage ldr r0, =task_new_game_prof_birch_speech_4 @@ -2122,9 +2122,9 @@ task_new_game_prof_birch_speech_4: @ 80309CC adds r0, r1 ldr r1, =task_new_game_prof_birch_speech_5 str r1, [r0] - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E8692 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r1, =sub_80323A0 movs r0, 0x1 bl AddTextPrinterWithCallbackForMessage @@ -2146,9 +2146,9 @@ task_new_game_prof_birch_speech_5: @ 8030A2C lsls r0, 16 cmp r0, 0 bne _08030A58 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_082C8A1F - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 bl AddTextPrinterForMessage ldr r1, =gTasks @@ -2341,9 +2341,9 @@ task_new_game_prof_birch_speech_6: @ 8030BCC bne _08030BFE ldr r0, =gUnknown_02022D04 strb r1, [r0] - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_082C8BD0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 bl AddTextPrinterForMessage ldr r1, =gTasks @@ -2580,9 +2580,9 @@ task_new_game_prof_birch_speech_11: @ 8030DC8 lsrs r4, 24 movs r0, 0 bl sub_8032318 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_082C8BDD - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 bl AddTextPrinterForMessage ldr r1, =gTasks @@ -2639,7 +2639,7 @@ task_new_game_prof_birch_speech_13: @ 8030E38 _08030E52: movs r0, 0x5 bl audio_play - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] strb r4, [r0, 0x8] movs r0, 0x1 @@ -2831,9 +2831,9 @@ task_new_game_prof_birch_speech_14: @ 8030FD4 lsrs r4, 24 movs r0, 0 bl sub_8032318 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_082C8BFF - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 bl AddTextPrinterForMessage ldr r1, =gTasks @@ -2878,7 +2878,7 @@ task_new_game_prof_birch_speech_16: @ 8031040 sub sp, 0x4 lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -2933,7 +2933,7 @@ task_new_game_prof_birch_speech_17: @ 8031090 adds r0, r1 ldrh r0, [r0, 0x1A] bl sub_818D820 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x14 @@ -2943,7 +2943,7 @@ task_new_game_prof_birch_speech_17: @ 8031090 bl set_default_player_name adds r0, r4, 0 bl DestroyTask - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldrb r2, [r1, 0x8] str r5, [sp] @@ -2968,9 +2968,9 @@ task_new_game_prof_birch_speech_part2_2: @ 8031104 lsrs r4, 24 movs r0, 0 bl sub_8032318 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_082C8C1C - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 bl AddTextPrinterForMessage ldr r1, =gTasks @@ -3211,9 +3211,9 @@ task_new_game_prof_birch_speech_part2_6: @ 8031258 bl sub_8031D34 movs r0, 0 bl sub_8032318 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_082C8C2A - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 bl AddTextPrinterForMessage ldr r0, =task_new_game_prof_birch_speech_part2_7 @@ -3353,7 +3353,7 @@ task_new_game_prof_birch_speech_part2_8: @ 80313E4 b _080314B0 .pool _08031444: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 @@ -3396,9 +3396,9 @@ _0803145A: adds r0, r6, 0 movs r1, 0x1 bl sub_8031D34 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_082C8C7A - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 bl AddTextPrinterForMessage ldr r0, =task_new_game_prof_birch_speech_part2_9 @@ -3714,7 +3714,7 @@ new_game_prof_birch_speech_part2_start: @ 8031678 bl dp13_810BB8C adds r0, r5, 0 bl AddBirchSpeechObjects - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 @@ -4453,7 +4453,7 @@ set_default_player_name: @ 8031DC4 push {r4,r5,lr} lsls r0, 24 lsrs r2, r0, 24 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] ldrb r0, [r0, 0x8] adds r5, r1, 0 @@ -4469,7 +4469,7 @@ _08031DE6: adds r0, r1 ldr r3, [r0] movs r2, 0 - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr _08031DF0: ldr r1, [r4] adds r1, r2 @@ -4546,10 +4546,10 @@ fmt_savegame: @ 8031E7C fmt_time: @ 8031E94 push {r4-r6,lr} sub sp, 0xC - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EDCC3 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r6, =gUnknown_082FF0E3 str r6, [sp] movs r5, 0x1 @@ -4561,7 +4561,7 @@ fmt_time: @ 8031E94 movs r2, 0 movs r3, 0x11 bl box_print - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r1, [r4] movs r0, 0x1 movs r2, 0x64 @@ -4588,10 +4588,10 @@ fmt_time: @ 8031E94 fmt_player: @ 8031EF8 push {r4-r6,lr} sub sp, 0x2C - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EDCCA adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r6, =gUnknown_082FF0E3 str r6, [sp] movs r5, 0x1 @@ -4603,13 +4603,13 @@ fmt_player: @ 8031EF8 movs r2, 0x6C movs r3, 0x11 bl box_print - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldrh r1, [r0, 0xE] add r0, sp, 0xC movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r1, 0xF0 strb r1, [r0] adds r0, 0x1 @@ -4617,7 +4617,7 @@ fmt_player: @ 8031EF8 ldrb r1, [r1, 0x10] movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x1 add r1, sp, 0xC movs r2, 0xD0 @@ -4663,10 +4663,10 @@ _08031FA4: _08031FAA: lsls r0, 16 lsrs r7, r0, 16 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EDCCF adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r6, =gUnknown_082FF0E3 str r6, [sp] movs r5, 0x1 @@ -4682,7 +4682,7 @@ _08031FAA: adds r1, r7, 0 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x1 add r1, sp, 0xC movs r2, 0x64 @@ -4727,10 +4727,10 @@ _08032030: ldr r0, =0x0000086e cmp r4, r0 bls _0803201C - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EDCD7 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r6, =gUnknown_082FF0E3 str r6, [sp] movs r5, 0x1 @@ -4746,7 +4746,7 @@ _08032030: adds r1, r7, 0 movs r2, 0x2 movs r3, 0x1 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x1 add r1, sp, 0xC movs r2, 0xD0 @@ -4779,7 +4779,7 @@ LoadMainMenuWindowFrameTiles: @ 80320A4 lsrs r4, 24 lsls r5, 16 lsrs r5, 16 - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r0, [r6] ldrb r0, [r0, 0x14] lsrs r0, 3 diff --git a/asm/map_obj_8097404.s b/asm/map_obj_8097404.s index b997ec15a..b8e2f98f7 100644 --- a/asm/map_obj_8097404.s +++ b/asm/map_obj_8097404.s @@ -1665,7 +1665,7 @@ sub_8097FA4: @ 8097FA4 adds r0, r4, 0 adds r0, 0x8 adds r1, r6, 0 - bl sub_806F67C + bl StoreWordInTwoHalfwords strb r5, [r6, 0x1B] ldr r0, =0x0000ffff strh r0, [r4, 0xE] @@ -1689,7 +1689,7 @@ sub_8097FE4: @ 8097FE4 adds r0, r4, 0 adds r0, 0x8 mov r1, sp - bl sub_806F684 + bl LoadWordFromTwoHalfwords ldr r0, [sp] ldrb r1, [r0, 0x4] lsls r0, r1, 4 @@ -1739,7 +1739,7 @@ sub_8098044: @ 8098044 adds r0, r1 adds r0, 0x8 mov r1, sp - bl sub_806F684 + bl LoadWordFromTwoHalfwords adds r0, r4, 0 bl DestroyTask add sp, 0x4 diff --git a/asm/mauville_old_man.s b/asm/mauville_old_man.s index 260182dd1..213a24e2b 100644 --- a/asm/mauville_old_man.s +++ b/asm/mauville_old_man.s @@ -8,7 +8,7 @@ thumb_func_start sub_81200A0 sub_81200A0: @ 81200A0 push {r4,lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r1, =0x00002e28 adds r0, r2, r1 @@ -17,7 +17,7 @@ sub_81200A0: @ 81200A0 ldr r3, =0x00002e51 adds r0, r2, r3 strb r1, [r0] - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r1, [r0] adds r3, 0x1 adds r0, r2, r3 @@ -45,7 +45,7 @@ _081200C6: thumb_func_start sub_81200F8 sub_81200F8: @ 81200F8 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =0x00002e28 adds r1, r0 @@ -53,7 +53,7 @@ sub_81200F8: @ 81200F8 movs r0, 0x1 strb r0, [r1] strb r2, [r1, 0x1] - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r1, 0x2] bx lr @@ -70,7 +70,7 @@ sub_812011C: @ 812011C thumb_func_start sub_8120128 sub_8120128: @ 8120128 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =0x00002e28 adds r2, r1, r0 @@ -78,7 +78,7 @@ sub_8120128: @ 8120128 movs r0, 0x4 strb r0, [r2] strb r3, [r2, 0x1] - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] ldr r2, =0x00002e48 adds r1, r2 @@ -98,7 +98,7 @@ sub_8120154: @ 8120154 thumb_func_start sub_8120160 sub_8120160: @ 8120160 push {lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r1, [r0, 0xB] lsls r1, 8 @@ -145,7 +145,7 @@ _081201C0: thumb_func_start sub_81201C8 sub_81201C8: @ 81201C8 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002e28 adds r0, r1 @@ -171,7 +171,7 @@ sub_81201DC: @ 81201DC thumb_func_start sub_81201F4 sub_81201F4: @ 81201F4 ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00002e51 adds r0, r2 @@ -184,15 +184,15 @@ sub_81201F4: @ 81201F4 thumb_func_start sub_8120210 sub_8120210: @ 8120210 push {r4-r6,lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r4, [r0] ldr r0, =0x00002e28 adds r6, r4, r0 ldr r1, =0x00002e42 adds r0, r4, r1 - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r1, [r5] - bl CopyString + bl StringCopy movs r2, 0 ldr r0, =0x00002e4d adds r4, r0 @@ -236,7 +236,7 @@ _0812024E: thumb_func_start sub_8120280 sub_8120280: @ 8120280 push {r4-r7,lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =gUnknown_020375E0 ldrh r0, [r0] @@ -247,7 +247,7 @@ sub_8120280: @ 8120280 ldr r0, =0x00002e2a adds r5, r1, r0 _08120296: - ldr r2, =gUnknown_02021FC4 + ldr r2, =gStringVar4 adds r4, r2, 0 movs r6, 0 _0812029C: @@ -348,7 +348,7 @@ sub_8120340: @ 8120340 thumb_func_start sub_8120358 sub_8120358: @ 8120358 ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00002e28 adds r0, r2 @@ -360,7 +360,7 @@ sub_8120358: @ 8120358 thumb_func_start sub_8120374 sub_8120374: @ 8120374 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002e28 adds r0, r1 @@ -384,7 +384,7 @@ sub_812038C: @ 812038C b _081203B6 .pool _081203AC: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 bl CopyEasyChatWord ldr r1, =gUnknown_020375F0 movs r0, 0x1 @@ -398,7 +398,7 @@ _081203B6: thumb_func_start sub_81203C4 sub_81203C4: @ 81203C4 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002e28 adds r2, r0, r1 @@ -424,7 +424,7 @@ _081203F2: thumb_func_start sub_81203FC sub_81203FC: @ 81203FC push {r4-r6,lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r4, [r0] ldr r0, =0x00002e28 adds r5, r4, r0 @@ -442,13 +442,13 @@ _08120410: ldr r0, =0x0000ffff cmp r1, r0 beq _08120480 - bl GenerateRandomNumber + bl Random adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 movs r0, 0x7 ands r4, r0 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldrb r1, [r5, 0x1] lsls r1, 1 adds r1, r6, r1 @@ -456,21 +456,21 @@ _08120410: bl CopyEasyChatWord adds r2, r0, 0 ldr r1, =gUnknown_082942FD - bl CopyString + bl StringCopy adds r2, r0, 0 ldr r0, =gUnknown_0859EFF0 lsls r4, 2 adds r4, r0 ldr r1, [r4] adds r0, r2, 0 - bl CopyString + bl StringCopy adds r2, r0, 0 ldr r1, =gUnknown_08294301 - bl CopyString + bl StringCopy b _081204A2 .pool _08120480: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r3, =gUnknown_0859F010 ldrb r2, [r5, 0x2] adds r1, r2, 0x1 @@ -485,9 +485,9 @@ _08120480: lsls r1, 2 adds r1, r3 ldr r1, [r1] - bl CopyString + bl StringCopy _081204A2: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xA @@ -520,7 +520,7 @@ sub_81204DC: @ 81204DC mov r5, r8 push {r5-r7} sub sp, 0x1C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r4, [r0] ldr r0, =0x00002e28 adds r0, r4, r0 @@ -551,7 +551,7 @@ _0812050C: mov r9, r3 adds r6, r1, 0 _08120524: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r4, r5, 0x1 @@ -595,7 +595,7 @@ _08120552: movs r7, 0 movs r5, 0 _0812057E: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xA @@ -617,7 +617,7 @@ _0812057E: b _0812060E .pool _081205BC: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 mov r1, r10 @@ -676,7 +676,7 @@ _0812060E: thumb_func_start sub_8120628 sub_8120628: @ 8120628 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002e51 adds r0, r1 @@ -688,7 +688,7 @@ sub_8120628: @ 8120628 thumb_func_start sub_8120640 sub_8120640: @ 8120640 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002e28 adds r0, r1 @@ -848,7 +848,7 @@ _08120764: .4byte _081207F8 .4byte _08120938 _0812077C: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r0, =gUnknown_020375E0 ldrh r0, [r0] @@ -1106,7 +1106,7 @@ _0812097C: .4byte _08120A6E _08120994: bl sub_8120280 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 bl sub_8120708 movs r0, 0 strh r0, [r5, 0xA] @@ -1128,13 +1128,13 @@ _081209C4: movs r0, 0x2 b _08120B4E _081209C8: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00002e28 adds r4, r0, r2 movs r0, 0xE ldrsh r1, [r5, r0] - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 adds r1, r0 movs r3, 0 ldrb r0, [r1] @@ -1219,7 +1219,7 @@ _08120A6E: strh r0, [r5, 0xC] b _08120B50 _08120A7E: - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 movs r2, 0xE ldrsh r0, [r5, r2] adds r0, r1 @@ -1367,7 +1367,7 @@ _08120B84: adds r0, 0x5 adds r0, r5, r0 movs r1, 0x1 - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString _08120B9E: adds r4, 0x1 cmp r4, 0x3 @@ -1401,7 +1401,7 @@ _08120BB0: bl memset mov r0, sp ldr r1, =gUnknown_085EDFB0 - bl CopyString + bl StringCopy adds r0, r5, 0 mov r1, sp movs r2, 0x7 @@ -1639,7 +1639,7 @@ _08120D78: cmp r0, 0x15 bne _08120D98 adds r0, r1, 0 - bl StripExtendedControlCodes + bl StripExtCtrlCodes movs r0, 0x1 strb r0, [r4] b _08120D9A @@ -1664,7 +1664,7 @@ _08120DAA: muls r0, r5 adds r0, 0x5 adds r0, r7, r0 - bl StripExtendedControlCodes + bl StripExtCtrlCodes _08120DBE: adds r5, 0x1 cmp r5, 0x3 @@ -1717,7 +1717,7 @@ _08120E02: sub_8120E08: @ 8120E08 push {r4,r5,lr} ldr r2, =gUnknown_0203A12C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002e28 adds r0, r1 @@ -1752,7 +1752,7 @@ _08120E24: thumb_func_start sub_8120E50 sub_8120E50: @ 8120E50 ldr r3, =gUnknown_0203A12C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002e28 adds r0, r1 @@ -1987,7 +1987,7 @@ sub_8120FDC: @ 8120FDC adds r0, 0x4 add r0, r8 strb r6, [r0] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] mov r0, r8 bl sub_8120FAC @@ -1998,25 +1998,25 @@ sub_8120FDC: @ 8120FDC adds r1, r0, 0 mov r0, r8 bl sub_8120F2C - ldr r5, =gUnknown_02021CC4 + ldr r5, =gStringVar1 adds r0, r4, 0 bl sub_8120E74 adds r1, r0, 0 adds r0, r5, 0 movs r2, 0 movs r3, 0xA - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021DC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar2 adds r0, r6, 0 bl sub_8120ECC adds r1, r0, 0 adds r0, r4, 0 - bl CopyString + bl StringCopy mov r1, r9 ldr r0, [r1] adds r0, 0x34 add r0, r8 - ldr r1, =gUnknown_82E9531 + ldr r1, =gGameLanguage ldrb r1, [r1] strb r1, [r0] pop {r3,r4} @@ -2047,13 +2047,13 @@ _0812107A: ble _081210B0 adds r5, r6, 0 _08121080: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r6, 0 bl __modsi3 adds r4, r0, 0 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r6, 0 @@ -2179,21 +2179,21 @@ sub_8121178: @ 8121178 adds r0, r5 ldrb r0, [r0] mov r8, r0 - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 adds r0, r5, 0 bl sub_8120F08 adds r1, r0, 0 adds r0, r4, 0 movs r2, 0 movs r3, 0xA - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021DC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar2 mov r0, r8 bl sub_8120ECC adds r1, r0, 0 adds r0, r4, 0 - bl CopyString - ldr r4, =gUnknown_02021EC4 + bl StringCopy + ldr r4, =gStringVar3 adds r0, r5, 0 adds r1, r4, 0 bl sub_8120F7C @@ -2202,7 +2202,7 @@ sub_8121178: @ 8121178 adds r0, r5 ldrb r1, [r0] adds r0, r4, 0 - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString mov r0, r8 bl sub_8120EC0 bl box_related_two__2 @@ -2432,7 +2432,7 @@ sub_812139C: @ 812139C sub_81213B0: @ 81213B0 push {lr} ldr r1, =gUnknown_0203A12C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00002e28 adds r0, r2 @@ -2449,7 +2449,7 @@ sub_81213B0: @ 81213B0 sub_81213D8: @ 81213D8 push {r4,r5,lr} ldr r2, =gUnknown_0203A12C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r3, =0x00002e28 adds r0, r1, r3 @@ -2481,7 +2481,7 @@ _0812141E: sub_8121424: @ 8121424 push {lr} ldr r1, =gUnknown_0203A12C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00002e28 adds r0, r2 @@ -2503,7 +2503,7 @@ _0812144A: sub_8121450: @ 8121450 push {lr} ldr r1, =gUnknown_0203A12C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00002e28 adds r0, r2 diff --git a/asm/menu_helpers.s b/asm/menu_helpers.s index 6529e74a6..32ed2997e 100644 --- a/asm/menu_helpers.s +++ b/asm/menu_helpers.s @@ -131,13 +131,13 @@ DisplayMessageAndContinueTask: @ 8121E7C adds r0, r6, 0 movs r1, 0x1 bl sub_8197B1C - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r0, [sp, 0x30] cmp r0, r4 beq _08121EC0 adds r0, r4, 0 ldr r1, [sp, 0x30] - bl ExpandStringRefs + bl StringExpandPlaceholders _08121EC0: ldr r2, =gUnknown_03003014 ldrb r0, [r2] @@ -326,7 +326,7 @@ AdjustQuantityAccordingToDPadInput: @ 8122034 adds r5, r1, 0 ldrh r4, [r2] adds r6, r4, 0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r0, [r0, 0x30] movs r3, 0xF0 ands r3, r0 @@ -409,12 +409,12 @@ _081220C8: thumb_func_start GetLRKeysState GetLRKeysState: @ 81220D0 push {lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0x1 bne _08122106 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x80 lsls r0, 2 @@ -442,12 +442,12 @@ _08122108: thumb_func_start sub_812210C sub_812210C: @ 812210C push {lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0x1 bne _08122142 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x30] movs r0, 0x80 lsls r0, 2 @@ -479,7 +479,7 @@ sub_8122148: @ 8122148 lsrs r0, 16 cmp r0, 0xAF bne _08122174 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0, 0x4] ldr r0, =0x00001919 diff --git a/asm/mon_markings.s b/asm/mon_markings.s index 17bbf76bb..0270a71a6 100644 --- a/asm/mon_markings.s +++ b/asm/mon_markings.s @@ -17,7 +17,7 @@ sub_811F90C: @ 811F90C sub_811F918: @ 811F918 push {lr} sub sp, 0x4 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x14] lsrs r0, 3 @@ -337,7 +337,7 @@ _0811FB9A: thumb_func_start sub_811FBA4 sub_811FBA4: @ 811FBA4 push {r4,r5,lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 diff --git a/asm/money.s b/asm/money.s index e236777c1..5f83e756a 100644 --- a/asm/money.s +++ b/asm/money.s @@ -8,7 +8,7 @@ thumb_func_start DecryptMoney @ int DecryptMoney(u32 *moneyPointer) DecryptMoney: @ 80E5114 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] adds r1, 0xAC ldr r0, [r0] @@ -21,7 +21,7 @@ DecryptMoney: @ 80E5114 thumb_func_start EncryptMoney @ void EncryptMoney(u32 *moneyPointer, u32 moneyAmount) EncryptMoney: @ 80E5128 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r2, [r2] adds r2, 0xAC ldr r2, [r2] @@ -103,7 +103,7 @@ _080E51A2: thumb_func_start sub_80E51B0 sub_80E51B0: @ 80E51B0 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x92 lsls r1, 3 @@ -121,7 +121,7 @@ sub_80E51B0: @ 80E51B0 thumb_func_start sub_80E51D4 sub_80E51D4: @ 80E51D4 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x92 lsls r1, 3 @@ -170,19 +170,19 @@ PrintMoneyAmount: @ 80E5214 lsrs r6, r2, 24 lsls r4, 24 lsrs r5, r4, 24 - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 adds r0, r4, 0 adds r1, r3, 0 movs r2, 0 movs r3, 0x6 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r0, r4, 0 - bl GetStringLength + bl StringLength lsls r0, 16 lsrs r0, 16 movs r1, 0x6 subs r1, r0 - ldr r2, =gUnknown_02021FC4 + ldr r2, =gStringVar4 adds r0, r1, 0 subs r1, 0x1 cmp r0, 0 @@ -198,8 +198,8 @@ _080E5258: _080E5264: ldr r1, =gUnknown_085E969C adds r0, r2, 0 - bl ExpandStringRefs - ldr r2, =gUnknown_02021FC4 + bl StringExpandPlaceholders + ldr r2, =gStringVar4 str r6, [sp] str r5, [sp, 0x4] movs r0, 0 diff --git a/asm/multiboot.s b/asm/multiboot.s deleted file mode 100644 index e0e3055c2..000000000 --- a/asm/multiboot.s +++ /dev/null @@ -1,906 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start MultiBootInit -@ void MultiBootInit(MultiBootParam *mp) -MultiBootInit: @ 81BA6D0 - adds r2, r0, 0 - movs r1, 0 - strb r1, [r2, 0x1E] - strb r1, [r2, 0x18] - strb r1, [r2, 0x1D] - adds r3, r2, 0 - adds r3, 0x4A - movs r0, 0xF - strb r0, [r3] - adds r0, r2, 0 - adds r0, 0x48 - strb r1, [r0] - strh r1, [r2, 0x16] - ldr r0, =0x04000134 - strh r1, [r0] - ldr r2, =0x04000128 - ldr r3, =0x00002003 - adds r0, r3, 0 - strh r0, [r2] - ldr r0, =0x0400012a - strh r1, [r0] - bx lr - .pool - thumb_func_end MultiBootInit - - thumb_func_start MultiBootMain -@ int MultiBootMain(MultiBootParam *mp) -MultiBootMain: @ 81BA70C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r7, r0, 0 - bl MultiBootCheckComplete - cmp r0, 0 - beq _081BA722 - b _081BAAEA -_081BA722: - adds r0, r7, 0 - adds r0, 0x4A - ldrb r1, [r0] - mov r10, r0 - cmp r1, 0xF - bls _081BA736 - subs r0, r1, 0x1 - mov r1, r10 - strb r0, [r1] - b _081BAAEA -_081BA736: - adds r1, r7, 0 - adds r1, 0x48 - ldrb r0, [r1] - cmp r0, 0 - beq _081BA760 - movs r0, 0 - strb r0, [r1] - ldr r0, =0x04000128 - ldrh r0, [r0] - movs r5, 0xFC - ands r5, r0 - cmp r5, 0x8 - beq _081BA760 - adds r0, r7, 0 - bl MultiBootInit - movs r0, 0x8 - eors r0, r5 - b _081BAAEC - .pool -_081BA760: - ldrb r0, [r7, 0x18] - cmp r0, 0xDF - bls _081BA7B2 - adds r0, r7, 0 - bl MultiBootHandShake - adds r5, r0, 0 - cmp r5, 0 - beq _081BA774 - b _081BAAEC -_081BA774: - adds r0, r7, 0 - adds r0, 0x4B - ldrb r0, [r0] - cmp r0, 0x1 - bne _081BA790 - ldrb r0, [r7, 0x18] - cmp r0, 0xE1 - bls _081BA790 - adds r0, r7, 0 - bl MultiBootCheckComplete - cmp r0, 0 - bne _081BA790 - b _081BAADA -_081BA790: - adds r0, r7, 0 - bl MultiBootCheckComplete - cmp r0, 0 - beq _081BA79C - b _081BAAEA -_081BA79C: - ldrh r0, [r7, 0x16] - cmp r0, 0 - bne _081BA7AC - adds r0, r7, 0 - bl MultiBootInit - movs r0, 0x71 - b _081BAAEC -_081BA7AC: - subs r0, 0x1 - strh r0, [r7, 0x16] - b _081BAAEA -_081BA7B2: - ldrb r0, [r7, 0x18] - cmp r0, 0x2 - bne _081BA7BA - b _081BA8F0 -_081BA7BA: - cmp r0, 0x2 - bgt _081BA7C8 - cmp r0, 0 - beq _081BA7D6 - cmp r0, 0x1 - beq _081BA892 - b _081BAA28 -_081BA7C8: - cmp r0, 0xD0 - bne _081BA7CE - b _081BA93C -_081BA7CE: - cmp r0, 0xD1 - bne _081BA7D4 - b _081BA9D6 -_081BA7D4: - b _081BAA28 -_081BA7D6: - movs r3, 0xE - movs r5, 0x3 - ldr r0, =0x04000120 - ldrh r0, [r0, 0x6] - adds r1, r0, 0 - ldr r0, =0x0000ffff - ldrb r2, [r7, 0x1E] - adds r6, r2, 0 - cmp r1, r0 - bne _081BA7FE - adds r4, r1, 0 - ldr r1, =0x04000126 -_081BA7EE: - asrs r3, 1 - subs r1, 0x2 - subs r5, 0x1 - cmp r5, 0 - beq _081BA7FE - ldrh r0, [r1] - cmp r0, r4 - beq _081BA7EE -_081BA7FE: - movs r0, 0xE - ands r3, r0 - strb r3, [r7, 0x1D] - movs r5, 0x3 - ldr r0, =0x04000120 - ldrh r0, [r0, 0x6] - adds r4, r0, 0 - asrs r0, r2, 3 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081BA82C - ldr r0, =0x00007208 - b _081BA852 - .pool -_081BA82C: - subs r5, 0x1 - cmp r5, 0 - beq _081BA858 - lsls r0, r5, 1 - ldr r1, =0x04000120 - adds r0, r1 - ldrh r0, [r0] - adds r4, r0, 0 - adds r0, r2, 0 - asrs r0, r5 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081BA82C - adds r0, r1, 0 - lsls r0, r5 - movs r1, 0xE4 - lsls r1, 7 - orrs r0, r1 -_081BA852: - cmp r4, r0 - beq _081BA82C - movs r3, 0 -_081BA858: - adds r0, r3, 0 - ands r0, r6 - strb r0, [r7, 0x1E] - cmp r3, 0 - bne _081BA868 - movs r0, 0xF - mov r2, r10 - strb r0, [r2] -_081BA868: - mov r1, r10 - ldrb r0, [r1] - cmp r0, 0 - bne _081BA884 - ldrb r0, [r7, 0x1D] - ldrb r2, [r7, 0x1E] - cmp r0, r2 - beq _081BA88A - adds r0, r7, 0 - bl MultiBootStartProbe - b _081BA892 - .pool -_081BA884: - subs r0, 0x1 - mov r1, r10 - strb r0, [r1] -_081BA88A: - ldrb r1, [r7, 0x1E] - movs r2, 0xC4 - lsls r2, 7 - b _081BA992 -_081BA892: - adds r1, r7, 0 - adds r1, 0x49 - movs r0, 0 - strb r0, [r1] - movs r5, 0x3 - mov r12, r1 - ldr r3, =gUnknown_0300129C -_081BA8A0: - lsls r0, r5, 1 - ldr r2, =0x04000120 - adds r0, r2 - ldrh r0, [r0] - adds r4, r0, 0 - asrs r0, r4, 8 - subs r2, r5, 0x1 - cmp r0, 0x72 - bne _081BA8CA - lsls r0, r2, 1 - adds r0, r3 - strh r4, [r0] - movs r0, 0xFF - ands r4, r0 - movs r0, 0x1 - lsls r0, r5 - cmp r4, r0 - bne _081BA8CA - ldrb r0, [r1] - orrs r4, r0 - strb r4, [r1] -_081BA8CA: - adds r5, r2, 0 - cmp r5, 0 - bne _081BA8A0 - ldrb r0, [r7, 0x1D] - mov r1, r12 - ldrb r1, [r1] - cmp r0, r1 - bne _081BA88A - movs r0, 0x2 - strb r0, [r7, 0x18] - mov r2, r12 - ldrb r1, [r2] - movs r2, 0xC2 - lsls r2, 7 - b _081BA992 - .pool -_081BA8F0: - movs r5, 0x3 - movs r0, 0x49 - adds r0, r7 - mov r12, r0 - mov r4, r12 - movs r6, 0x1 - ldr r1, =gUnknown_0300129C - mov r9, r1 - ldr r2, =0x04000120 - mov r8, r2 -_081BA904: - ldrb r3, [r4] - adds r0, r3, 0 - asrs r0, r5 - ands r0, r6 - subs r2, r5, 0x1 - cmp r0, 0 - beq _081BA92A - lsls r0, r5, 1 - add r0, r8 - ldrh r1, [r0] - lsls r0, r2, 1 - add r0, r9 - ldrh r0, [r0] - cmp r1, r0 - beq _081BA92A - adds r0, r6, 0 - lsls r0, r5 - eors r3, r0 - strb r3, [r4] -_081BA92A: - adds r5, r2, 0 - cmp r5, 0 - bne _081BA904 - b _081BAA90 - .pool -_081BA93C: - movs r3, 0x1 - movs r5, 0x3 - movs r0, 0x49 - adds r0, r7 - mov r12, r0 - adds r6, r7, 0 - adds r6, 0x19 - ldr r1, =gUnknown_0300129C - mov r8, r1 -_081BA94E: - lsls r0, r5, 1 - ldr r2, =0x04000120 - adds r0, r2 - ldrh r0, [r0] - adds r4, r0, 0 - subs r2, r5, 0x1 - adds r0, r6, r2 - strb r4, [r0] - mov r0, r12 - ldrb r1, [r0] - asrs r1, r5 - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - beq _081BA982 - asrs r0, r4, 8 - subs r0, 0x72 - cmp r0, 0x1 - bls _081BA976 - b _081BAAE0 -_081BA976: - lsls r0, r2, 1 - add r0, r8 - ldrh r0, [r0] - cmp r4, r0 - bne _081BA982 - movs r3, 0 -_081BA982: - adds r5, r2, 0 - cmp r5, 0 - bne _081BA94E - cmp r3, 0 - bne _081BA9A8 - ldrb r1, [r7, 0x1C] - movs r2, 0xC6 - lsls r2, 7 -_081BA992: - adds r0, r2, 0 - orrs r1, r0 - adds r0, r7, 0 - bl MultiBootSend - b _081BAAEC - .pool -_081BA9A8: - movs r0, 0xD1 - strb r0, [r7, 0x18] - movs r3, 0x11 - movs r5, 0x3 - adds r1, r6, 0x2 -_081BA9B2: - ldrb r0, [r1] - adds r3, r0 - subs r1, 0x1 - subs r5, 0x1 - cmp r5, 0 - bne _081BA9B2 - strb r3, [r7, 0x14] - movs r0, 0xFF - ands r3, r0 - movs r1, 0xC8 - lsls r1, 7 - adds r0, r1, 0 - orrs r3, r0 - adds r0, r7, 0 - adds r1, r3, 0 - bl MultiBootSend - b _081BAAEC -_081BA9D6: - movs r5, 0x3 - movs r2, 0x49 - ldrb r1, [r2, r7] - ldr r2, =0x04000126 - movs r3, 0x1 -_081BA9E0: - ldrh r0, [r2] - adds r4, r0, 0 - adds r0, r1, 0 - asrs r0, r5 - ands r0, r3 - cmp r0, 0 - beq _081BA9F4 - asrs r0, r4, 8 - cmp r0, 0x73 - bne _081BAAE0 -_081BA9F4: - subs r2, 0x2 - subs r5, 0x1 - cmp r5, 0 - bne _081BA9E0 - adds r0, r7, 0 - bl MultiBoot - adds r5, r0, 0 - cmp r5, 0 - bne _081BAA18 - movs r0, 0xE0 - strb r0, [r7, 0x18] - adds r0, 0xB0 - strh r0, [r7, 0x16] - b _081BAAEA - .pool -_081BAA18: - adds r0, r7, 0 - bl MultiBootInit - movs r0, 0x1E - mov r1, r10 - strb r0, [r1] - movs r0, 0x70 - b _081BAAEC -_081BAA28: - movs r5, 0x3 - movs r2, 0x49 - adds r2, r7 - mov r12, r2 - mov r8, r12 - movs r0, 0x1 - mov r9, r0 -_081BAA36: - mov r1, r8 - ldrb r6, [r1] - adds r0, r6, 0 - asrs r0, r5 - mov r2, r9 - ands r0, r2 - cmp r0, 0 - beq _081BAA70 - lsls r0, r5, 1 - ldr r1, =0x04000120 - adds r0, r1 - ldrh r0, [r0] - adds r4, r0, 0 - asrs r2, r4, 8 - ldrb r0, [r7, 0x18] - lsrs r0, 1 - movs r1, 0x62 - subs r1, r0 - mov r3, r9 - lsls r3, r5 - cmp r2, r1 - bne _081BAA6A - movs r0, 0xFF - ands r4, r0 - cmp r4, r3 - beq _081BAA70 -_081BAA6A: - eors r6, r3 - mov r2, r8 - strb r6, [r2] -_081BAA70: - subs r5, 0x1 - cmp r5, 0 - bne _081BAA36 - ldrb r0, [r7, 0x18] - cmp r0, 0xC4 - bne _081BAA90 - mov r0, r12 - ldrb r1, [r0] - movs r0, 0xE - ands r0, r1 - strb r0, [r7, 0x1E] - strb r5, [r7, 0x18] - b _081BA88A - .pool -_081BAA90: - mov r1, r12 - ldrb r0, [r1] - cmp r0, 0 - bne _081BAAA2 - adds r0, r7, 0 - bl MultiBootInit - movs r0, 0x50 - b _081BAAEC -_081BAAA2: - ldrb r0, [r7, 0x18] - adds r0, 0x2 - strb r0, [r7, 0x18] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xC4 - bne _081BAAB2 - b _081BA88A -_081BAAB2: - ldrb r0, [r7, 0x18] - ldr r1, [r7, 0x28] - adds r0, r1 - subs r1, r0, 0x3 - ldrb r2, [r1] - lsls r2, 8 - subs r0, 0x4 - ldrb r1, [r0] - orrs r1, r2 - adds r0, r7, 0 - bl MultiBootSend - adds r5, r0, 0 - cmp r5, 0 - bne _081BAAEC - adds r0, r7, 0 - adds r0, 0x4B - ldrb r0, [r0] - cmp r0, 0x1 - bne _081BAAEA -_081BAADA: - bl MultiBootWaitSendDone - b _081BA736 -_081BAAE0: - adds r0, r7, 0 - bl MultiBootInit - movs r0, 0x60 - b _081BAAEC -_081BAAEA: - movs r0, 0 -_081BAAEC: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end MultiBootMain - - thumb_func_start MultiBootSend -@ int MultiBootSend(MultiBootParam *mp, u16 data) -MultiBootSend: @ 81BAAFC - push {r4,lr} - adds r2, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r3, =0x04000128 - ldrh r0, [r3] - movs r4, 0x8C - ands r4, r0 - cmp r4, 0x8 - bne _081BAB34 - ldr r0, =0x0400012a - strh r1, [r0] - ldr r1, =0x00002083 - adds r0, r1, 0 - strh r0, [r3] - adds r1, r2, 0 - adds r1, 0x48 - movs r0, 0x1 - strb r0, [r1] - movs r0, 0 - b _081BAB40 - .pool -_081BAB34: - adds r0, r2, 0 - bl MultiBootInit - movs r0, 0x8 - eors r4, r0 - adds r0, r4, 0 -_081BAB40: - pop {r4} - pop {r1} - bx r1 - thumb_func_end MultiBootSend - - thumb_func_start MultiBootStartProbe -@ void MultiBootStartProbe(MultiBootParam *mp) -MultiBootStartProbe: @ 81BAB48 - push {lr} - adds r1, r0, 0 - ldrb r0, [r1, 0x18] - cmp r0, 0 - beq _081BAB5A - adds r0, r1, 0 - bl MultiBootInit - b _081BAB66 -_081BAB5A: - adds r2, r1, 0 - adds r2, 0x4A - strb r0, [r2] - strb r0, [r1, 0x1E] - movs r0, 0x1 - strb r0, [r1, 0x18] -_081BAB66: - pop {r0} - bx r0 - thumb_func_end MultiBootStartProbe - - thumb_func_start MultiBootStartMaster -@ void MultiBootStartMaster(MultiBootParam *mp, u8 *srcp, int length, u8 palette_color, s8 palette_speed) -MultiBootStartMaster: @ 81BAB6C - push {r4-r7,lr} - adds r4, r0, 0 - adds r6, r1, 0 - ldr r0, [sp, 0x14] - lsls r3, 24 - lsrs r5, r3, 24 - lsls r0, 24 - lsrs r7, r0, 24 - movs r3, 0 - ldrb r0, [r4, 0x18] - cmp r0, 0 - bne _081BABA8 - ldrb r0, [r4, 0x1E] - cmp r0, 0 - beq _081BABA8 - adds r0, r4, 0 - adds r0, 0x4A - ldrb r0, [r0] - cmp r0, 0 - bne _081BABA8 - str r6, [r4, 0x20] - adds r2, 0xF - movs r0, 0x10 - negs r0, r0 - ands r2, r0 - subs r0, 0xF0 - adds r1, r2, r0 - ldr r0, =0x0003ff00 - cmp r1, r0 - bls _081BABB4 -_081BABA8: - adds r0, r4, 0 - bl MultiBootInit - b _081BAC28 - .pool -_081BABB4: - adds r0, r6, r2 - str r0, [r4, 0x24] - lsls r1, r7, 24 - movs r2, 0x80 - lsls r2, 19 - adds r0, r1, r2 - asrs r0, 24 - adds r2, r1, 0 - cmp r0, 0x8 - bhi _081BAC14 - lsls r0, 2 - ldr r1, =_081BABD8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081BABD8: - .4byte _081BABFC - .4byte _081BABFC - .4byte _081BABFC - .4byte _081BABFC - .4byte _081BAC06 - .4byte _081BAC0C - .4byte _081BAC0C - .4byte _081BAC0C - .4byte _081BAC0C -_081BABFC: - lsls r3, r5, 3 - asrs r1, r2, 24 - movs r0, 0x3 - subs r0, r1 - b _081BAC12 -_081BAC06: - movs r0, 0x38 - adds r3, r5, 0 - b _081BAC12 -_081BAC0C: - lsls r3, r5, 3 - asrs r0, r2, 24 - subs r0, 0x1 -_081BAC12: - orrs r3, r0 -_081BAC14: - movs r0, 0x3F - ands r3, r0 - lsls r0, r3, 1 - movs r2, 0x7F - negs r2, r2 - adds r1, r2, 0 - orrs r0, r1 - strb r0, [r4, 0x1C] - movs r0, 0xD0 - strb r0, [r4, 0x18] -_081BAC28: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end MultiBootStartMaster - - thumb_func_start MultiBootCheckComplete -@ s32 MultiBootCheckComplete(MultiBootParam *mp) -MultiBootCheckComplete: @ 81BAC30 - push {lr} - ldrb r0, [r0, 0x18] - cmp r0, 0xE9 - beq _081BAC3C - movs r0, 0 - b _081BAC3E -_081BAC3C: - movs r0, 0x1 -_081BAC3E: - pop {r1} - bx r1 - thumb_func_end MultiBootCheckComplete - - thumb_func_start MultiBootHandShake -@ int MultiBootHandShake(MultiBootParam *mp) -MultiBootHandShake: @ 81BAC44 - push {r4-r6,lr} - adds r3, r0, 0 - ldrb r0, [r3, 0x18] - cmp r0, 0xE0 - beq _081BAC60 - cmp r0, 0xE0 - blt _081BAC70 - cmp r0, 0xE8 - bgt _081BAC70 - cmp r0, 0xE7 - blt _081BAC70 - movs r4, 0x3 - ldrb r5, [r3, 0x1E] - b _081BACD0 -_081BAC60: - movs r1, 0 - movs r0, 0xE1 - strb r0, [r3, 0x18] - str r1, [r3, 0x4] - movs r0, 0x80 - lsls r0, 13 - str r0, [r3] - b _081BACC2 -_081BAC70: - movs r4, 0x3 - ldrb r5, [r3, 0x1E] - movs r6, 0x1 - ldr r1, =0x04000126 -_081BAC78: - ldrh r0, [r1] - adds r2, r0, 0 - adds r0, r5, 0 - asrs r0, r4 - ands r0, r6 - cmp r0, 0 - beq _081BAC8C - ldr r0, [r3, 0x4] - cmp r2, r0 - bne _081BAC60 -_081BAC8C: - subs r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bne _081BAC78 - ldrb r0, [r3, 0x18] - adds r0, 0x1 - strb r0, [r3, 0x18] - ldr r1, [r3] - ldrh r0, [r3] - str r0, [r3, 0x4] - cmp r1, 0 - bne _081BACBA - ldr r0, [r3, 0x28] - adds r1, r0, 0 - adds r1, 0xAC - ldrb r1, [r1] - adds r0, 0xAD - ldrb r0, [r0] - lsls r0, 8 - orrs r1, r0 - str r1, [r3, 0x4] - lsls r1, 5 - str r1, [r3] -_081BACBA: - ldr r0, [r3] - lsrs r0, 5 - str r0, [r3] -_081BACC0: - ldrh r1, [r3] -_081BACC2: - adds r0, r3, 0 - bl MultiBootSend - b _081BAD28 - .pool -_081BACD0: - lsls r0, r4, 1 - ldr r1, =0x04000120 - adds r0, r1 - ldrh r0, [r0] - adds r2, r0, 0 - adds r0, r5, 0 - asrs r0, r4 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081BACEC - ldr r0, [r3, 0x4] - cmp r2, r0 - bne _081BAD1C -_081BACEC: - subs r4, 0x1 - cmp r4, 0 - bne _081BACD0 - ldrb r0, [r3, 0x18] - adds r0, 0x1 - strb r0, [r3, 0x18] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE9 - beq _081BAD26 - ldr r0, [r3, 0x28] - adds r1, r0, 0 - adds r1, 0xAE - ldrb r1, [r1] - adds r0, 0xAF - ldrb r0, [r0] - lsls r0, 8 - orrs r1, r0 - str r1, [r3] - str r1, [r3, 0x4] - b _081BACC0 - .pool -_081BAD1C: - adds r0, r3, 0 - bl MultiBootInit - movs r0, 0x71 - b _081BAD28 -_081BAD26: - movs r0, 0 -_081BAD28: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end MultiBootHandShake - - thumb_func_start MultiBootWaitCycles -@ void MultiBootWaitCycles(u32 cycles) -MultiBootWaitCycles: @ 81BAD30 - mov r2, pc - lsrs r2, 24 - movs r1, 0xC - cmp r2, 0x2 - beq _081BAD42 - movs r1, 0xD - cmp r2, 0x8 - beq _081BAD42 - movs r1, 0x4 -_081BAD42: - subs r0, r1 - bgt _081BAD42 - bx lr - thumb_func_end MultiBootWaitCycles - - thumb_func_start MultiBootWaitSendDone -@ void MultiBootWaitSendDone(void) -MultiBootWaitSendDone: @ 81BAD48 - push {r4,r5,lr} - movs r2, 0 - ldr r3, =0x04000128 - ldrh r1, [r3] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081BAD6C - ldr r5, =0x0000795c - movs r4, 0x80 -_081BAD5C: - adds r2, 0x1 - cmp r2, r5 - bgt _081BAD6C - ldrh r1, [r3] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - bne _081BAD5C -_081BAD6C: - movs r0, 0x96 - lsls r0, 2 - bl MultiBootWaitCycles - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end MultiBootWaitSendDone - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/mystery_event_menu.s b/asm/mystery_event_menu.s index 80512dbd7..a6086cf7a 100644 --- a/asm/mystery_event_menu.s +++ b/asm/mystery_event_menu.s @@ -116,7 +116,7 @@ sub_8178A40: @ 8178A40 cmp r4, 0 bne _08178A54 ldr r1, =gUnknown_085EE80A - bl CopyString + bl StringCopy movs r5, 0 _08178A54: cmp r4, 0x2 @@ -127,7 +127,7 @@ _08178A5A: bne _08178A66 ldr r1, =gUnknown_085EE827 adds r0, r6, 0 - bl CopyString + bl StringCopy _08178A66: adds r0, r5, 0 pop {r4-r6} @@ -140,7 +140,7 @@ _08178A66: sub_8178A78: @ 8178A78 push {r4-r6,lr} sub sp, 0x8 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 @@ -211,7 +211,7 @@ _08178B20: movs r2, 0x1 movs r3, 0x2 bl sub_8178EC4 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -225,7 +225,7 @@ _08178B48: beq _08178B56 b _08178E58 _08178B56: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -263,7 +263,7 @@ _08178B98: movs r2, 0x1 movs r3, 0x2 bl sub_8178EC4 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -287,7 +287,7 @@ _08178BDC: lsrs r2, r0, 24 cmp r2, 0x2 bne _08178CD0 - ldr r4, =gUnknown_030022C0 + ldr r4, =gMain ldrh r1, [r4, 0x2E] movs r0, 0x1 ands r0, r1 @@ -351,7 +351,7 @@ _08178C68: cmp r0, 0x3 bne _08178CAC bl sub_800AC34 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 adds r0, r4, 0 movs r1, 0x1 bl sub_8178A40 @@ -362,7 +362,7 @@ _08178C68: movs r2, 0x1 movs r3, 0x2 bl sub_8178EC4 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r2 @@ -385,7 +385,7 @@ _08178CAC: _08178CCC: bl sub_80097E8 _08178CD0: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 adds r0, r4, 0 movs r1, 0x1 bl sub_8178A40 @@ -396,7 +396,7 @@ _08178CD0: movs r2, 0x1 movs r3, 0x2 bl sub_8178EC4 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -406,7 +406,7 @@ _08178CF2: b _08178E58 .pool _08178D00: - ldr r4, =gUnknown_030022C0 + ldr r4, =gMain ldrh r1, [r4, 0x2E] movs r0, 0x2 ands r0, r1 @@ -442,7 +442,7 @@ _08178D38: b _08178E58 _08178D44: bl sub_800A5B4 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -455,7 +455,7 @@ _08178D58: b _08178E3C _08178D60: bl sub_800AC34 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -477,7 +477,7 @@ _08178D74: add r0, sp, 0x4 adds r1, r5, 0 bl CpuSet - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 adds r1, r4, 0 bl sub_8178A40 lsls r0, 24 @@ -488,14 +488,14 @@ _08178D74: b _08178E34 .pool _08178DBC: - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 movs r0, 0x1 str r0, [sp] movs r0, 0 movs r2, 0x1 movs r3, 0x2 bl sub_8178EC4 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -508,7 +508,7 @@ _08178DE0: lsrs r2, r0, 16 cmp r2, 0 bne _08178E58 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -541,7 +541,7 @@ _08178E24: _08178E30: bl BeginNormalPaletteFade _08178E34: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -558,7 +558,7 @@ _08178E48: ands r0, r1 cmp r0, 0 bne _08178E58 - bl Reset + bl DoSoftReset _08178E58: ldr r0, =gUnknown_030030E0 ldr r0, [r0] @@ -571,7 +571,7 @@ _08178E58: cmp r0, 0 bne _08178E98 bl sub_80097E8 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 adds r0, r4, 0 movs r1, 0x1 bl sub_8178A40 @@ -582,7 +582,7 @@ _08178E58: movs r2, 0x1 movs r3, 0x2 bl sub_8178EC4 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 diff --git a/asm/mystery_event_script.s b/asm/mystery_event_script.s index d888aad52..2430cd87c 100644 --- a/asm/mystery_event_script.s +++ b/asm/mystery_event_script.s @@ -42,9 +42,9 @@ _081537FE: thumb_func_start sub_8153804 sub_8153804: @ 8153804 push {lr} - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_08674C86 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x3 bl sub_81538C4 pop {r0} @@ -152,7 +152,7 @@ sub_81538C4: @ 81538C4 sub_81538D0: @ 81538D0 push {lr} movs r2, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003b18 adds r3, r0, r1 @@ -173,7 +173,7 @@ _081538DE: thumb_func_start sub_81538F8 sub_81538F8: @ 81538F8 push {r4,r5,lr} - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r0, [r5] ldr r1, =0x00003b18 adds r4, r0, r1 @@ -215,7 +215,7 @@ sub_8153944: @ 8153944 mov r1, sp movs r0, 0 strh r0, [r1] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =0x00003b14 adds r1, r0 @@ -250,7 +250,7 @@ _08153990: bl sub_8153944 b _081539BC _08153996: - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] ldr r1, =0x00003b18 adds r0, r1 @@ -278,7 +278,7 @@ _081539BC: thumb_func_start sub_81539D4 sub_81539D4: @ 81539D4 push {r4-r6,lr} - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr ldr r0, [r6] ldr r1, =0x00003b18 adds r4, r0, r1 @@ -399,8 +399,8 @@ sub_8153A94: @ 8153A94 cmp r5, r0 bne _08153ABE _08153AB8: - ldr r0, =gUnknown_02021FC4 - bl ExpandStringRefs + ldr r0, =gStringVar4 + bl StringExpandPlaceholders _08153ABE: movs r0, 0 pop {r4,r5} @@ -441,44 +441,44 @@ sub_8153AE8: @ 8153AE8 subs r4, r0 ldr r0, [r7, 0x64] adds r4, r0 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 mov r9, r0 - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr ldr r1, [r6] ldr r5, =0x000031f8 adds r1, r5 movs r2, 0x7 - bl CopyString_LimitN + bl StringCopyN adds r0, r4, 0 bl sub_80E15E4 - ldr r4, =gUnknown_02021DC4 + ldr r4, =gStringVar2 ldr r1, [r6] adds r1, r5 adds r0, r4, 0 movs r2, 0x7 - bl CopyString_LimitN + bl StringCopyN mov r0, r8 cmp r0, 0 bne _08153B54 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_08674AE4 b _08153B74 .pool _08153B54: mov r0, r9 adds r1, r4, 0 - bl CompareString + bl StringCompare cmp r0, 0 beq _08153B70 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_08674B16 b _08153B74 .pool _08153B70: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_08674B42 _08153B74: - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x2 str r0, [r7, 0x6C] bl sub_80E162C @@ -514,9 +514,9 @@ sub_8153BB0: @ 8153BB0 adds r2, 0x1 str r2, [r4, 0x8] bl sub_80F9B30 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_08674B6A - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x2 str r0, [r4, 0x6C] movs r0, 0 @@ -583,9 +583,9 @@ sub_8153C4C: @ 8153C4C push {r4,lr} adds r4, r0, 0 bl sub_809D3E8 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_08674B9E - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x2 str r0, [r4, 0x6C] movs r0, 0 @@ -604,9 +604,9 @@ sub_8153C70: @ 8153C70 adds r1, 0x1 str r1, [r4, 0x8] bl sub_811EFC0 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_08674BD4 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x2 str r0, [r4, 0x6C] movs r0, 0 @@ -661,32 +661,32 @@ sub_8153CC8: @ 8153CC8 bl memcpy adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 movs r0, 0xCE lsls r0, 1 cmp r4, r0 bne _08153D18 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085E8264 movs r2, 0xB - bl CopyString_LimitN + bl StringCopyN b _08153D22 .pool _08153D18: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085E8268 movs r2, 0xB - bl CopyString_LimitN + bl StringCopyN _08153D22: ldr r0, =gUnknown_020244E9 ldrb r0, [r0] cmp r0, 0x6 bne _08153D4C - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_08674C02 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x3 b _08153DB6 .pool @@ -718,7 +718,7 @@ _08153D4C: _08153D86: adds r0, r7, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 bl itemid_is_mail @@ -731,9 +731,9 @@ _08153D86: _08153DA4: bl party_compaction bl calc_player_party_count - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_08674BF0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x2 _08153DB6: str r0, [r6, 0x6C] @@ -757,16 +757,16 @@ sub_8153DD4: @ 8153DD4 subs r1, r0 ldr r0, [r4, 0x64] adds r1, r0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000bec adds r0, r2 movs r2, 0xBC bl memcpy bl sub_81652B4 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_08674C31 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x2 str r0, [r4, 0x6C] movs r0, 0 @@ -781,9 +781,9 @@ sub_8153E1C: @ 8153E1C push {r4,lr} adds r4, r0, 0 bl sub_809D5F4 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085ECAD8 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x2 str r0, [r4, 0x6C] movs r0, 0 @@ -815,7 +815,7 @@ sub_8153E40: @ 8153E40 adds r1, r0 subs r1, r4 adds r0, r4, 0 - bl sub_806F96C + bl CalcByteArraySum cmp r5, r0 beq _08153E7E movs r0, 0 @@ -851,7 +851,7 @@ sub_8153E88: @ 8153E88 adds r1, r0 subs r1, r4 adds r0, r4, 0 - bl sub_806F8D0 + bl CalcCRC16 lsls r0, 16 lsrs r0, 16 cmp r5, r0 diff --git a/asm/naming_screen.s b/asm/naming_screen.s index f84ad3946..63626fdb5 100644 --- a/asm/naming_screen.s +++ b/asm/naming_screen.s @@ -70,7 +70,7 @@ _080E2DE2: thumb_func_start c2_choose_name_or_words_screen c2_choose_name_or_words_screen: @ 80E2E04 push {lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -121,7 +121,7 @@ _080E2E7A: bl UpdatePaletteFade bl sub_80E501C _080E2E86: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -209,7 +209,7 @@ choose_name_or_words_screen_setup: @ 80E2EA8 strh r0, [r1] _080E2F2C: ldr r0, [r5] - ldr r4, =gUnknown_030022B0 + ldr r4, =gKeyRepeatStartDelay ldrh r1, [r4] ldr r2, =0x00001e25 adds r0, r2 @@ -233,7 +233,7 @@ _080E2F2C: ldr r2, =0x00001e30 adds r1, r2 ldr r1, [r1] - bl CopyString + bl StringCopy _080E2F64: movs r0, 0x10 strh r0, [r4] @@ -835,7 +835,7 @@ pokemon_transfer_to_pc_with_message: @ 80E34E4 lsls r0, 24 cmp r0, 0 bne _080E3534 - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 ldr r0, =0x00004036 bl VarGet lsls r0, 24 @@ -843,18 +843,18 @@ pokemon_transfer_to_pc_with_message: @ 80E34E4 bl sav3_get_box_name adds r1, r0, 0 adds r0, r4, 0 - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 ldr r1, =gUnknown_02039F94 ldr r1, [r1] ldr r2, =0x00001e30 adds r1, r2 ldr r1, [r1] - bl CopyString + bl StringCopy b _080E3574 .pool _080E3534: - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 ldr r0, =0x00004036 bl VarGet lsls r0, 24 @@ -862,22 +862,22 @@ _080E3534: bl sav3_get_box_name adds r1, r0, 0 adds r0, r4, 0 - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 ldr r1, =gUnknown_02039F94 ldr r1, [r1] ldr r2, =0x00001e30 adds r1, r2 ldr r1, [r1] - bl CopyString - ldr r4, =gUnknown_02021EC4 + bl StringCopy + ldr r4, =gStringVar3 bl get_unknown_box_id lsls r0, 24 lsrs r0, 24 bl sav3_get_box_name adds r1, r0, 0 adds r0, r4, 0 - bl CopyString + bl StringCopy movs r5, 0x2 _080E3574: ldr r0, =0x000008ab @@ -889,13 +889,13 @@ _080E3574: lsls r0, 24 lsrs r5, r0, 24 _080E3586: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_0858BDB8 lsls r0, r5, 2 adds r0, r1 ldr r1, [r0] adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0 movs r1, 0 bl sub_81973C4 @@ -939,7 +939,7 @@ sub_80E3604: @ 80E3604 lsls r0, 16 cmp r0, 0 bne _080E362E - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -1173,7 +1173,7 @@ sub_80E37DC: @ 80E37DC movs r2, 0xA ldrsh r0, [r4, r2] movs r1, 0x28 - bl sine + bl Sin ldr r1, [r5] movs r2, 0xF1 lsls r2, 5 @@ -1188,7 +1188,7 @@ sub_80E37DC: @ 80E37DC movs r1, 0xFF ands r0, r1 movs r1, 0x28 - bl sine + bl Sin ldr r1, [r5] ldr r2, =0x00001e21 adds r1, r2 @@ -1241,7 +1241,7 @@ sub_80E3870: @ 80E3870 movs r1, 0xA ldrsh r0, [r4, r1] movs r1, 0x28 - bl sine + bl Sin ldr r1, [r5] movs r2, 0xF1 lsls r2, 5 @@ -1256,7 +1256,7 @@ sub_80E3870: @ 80E3870 movs r1, 0xFF ands r0, r1 movs r1, 0x28 - bl sine + bl Sin ldr r1, [r5] ldr r3, =0x00001e21 adds r1, r3 @@ -2992,7 +2992,7 @@ sub_80E4692: @ 80E4692 adds r2, r0, 0 movs r0, 0 strh r0, [r2, 0xA] - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -3079,7 +3079,7 @@ sub_80E46F0: @ 80E46F0 adds r0, r4, 0 adds r1, r5, 0 bl sub_80E3DFC - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r2, [r0, 0x30] movs r0, 0x40 ands r0, r2 @@ -3302,7 +3302,7 @@ sub_80E48E8: @ 80E48E8 ldr r0, =gSpeciesNames adds r1, r0 add r0, sp, 0xC - bl CopyString + bl StringCopy ldr r0, [r5] ldr r1, =0x00001e28 adds r0, r1 @@ -3310,7 +3310,7 @@ sub_80E48E8: @ 80E48E8 ldr r1, [r0, 0x8] add r0, sp, 0xC movs r2, 0xF - bl AppendString_LimitN + bl StringAppendN ldr r0, [r5] ldr r4, =0x00001e14 adds r0, r4 @@ -3389,7 +3389,7 @@ sub_80E49BC: @ 80E49BC movs r4, 0 ldr r1, =gUnknown_085E8D49 add r0, sp, 0xC - bl CopyString + bl StringCopy ldr r5, =gUnknown_02039F94 ldr r0, [r5] ldr r1, =0x00001e36 @@ -3401,7 +3401,7 @@ sub_80E49BC: @ 80E49BC bne _080E49E6 ldr r1, =gUnknown_085E8D4B add r0, sp, 0xC - bl CopyString + bl StringCopy movs r4, 0x1 _080E49E6: ldr r0, [r5] @@ -3686,7 +3686,7 @@ _080E4C00: lsls r2, 24 lsrs r2, 24 adds r1, r3, 0 - bl CopyString_LimitN + bl StringCopyN b _080E4C4A .pool _080E4C34: @@ -3826,7 +3826,7 @@ sub_80E4D10: @ 80E4D10 bcs _080E4DA6 add r5, sp, 0xC mov r10, r4 - ldr r0, =gUnknown_085E8218 + ldr r0, =gExpandedPlaceholder_Empty ldrb r0, [r0] mov r8, r0 _080E4D52: @@ -4188,7 +4188,7 @@ _080E5066: sub_80E5074: @ 80E5074 push {lr} sub sp, 0x8 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldrb r2, [r1, 0x8] movs r0, 0 @@ -4208,7 +4208,7 @@ sub_80E5074: @ 80E5074 sub_80E509C: @ 80E509C push {lr} sub sp, 0x8 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldrb r2, [r1, 0x8] movs r0, 0 @@ -4228,7 +4228,7 @@ sub_80E509C: @ 80E509C sub_80E50C4: @ 80E50C4 push {lr} sub sp, 0x8 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldrb r2, [r1, 0x8] movs r0, 0 @@ -4248,7 +4248,7 @@ sub_80E50C4: @ 80E50C4 sub_80E50EC: @ 80E50EC push {lr} sub sp, 0x8 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldrb r2, [r1, 0x8] movs r0, 0 diff --git a/asm/new_game.s b/asm/new_game.s index ff562baf1..36b09aaf6 100644 --- a/asm/new_game.s +++ b/asm/new_game.s @@ -56,14 +56,14 @@ _080842FC: thumb_func_start set_player_trainer_id set_player_trainer_id: @ 8084310 push {r4,lr} - bl GenerateRandomNumber + bl Random adds r4, r0, 0 bl GetTrainerId lsls r4, 16 lsls r0, 16 lsrs r0, 16 orrs r4, r0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r1, 0xA adds r0, r4, 0 @@ -76,7 +76,7 @@ set_player_trainer_id: @ 8084310 thumb_func_start init_options init_options: @ 808433C - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r2, [r3] ldrb r1, [r2, 0x14] movs r0, 0x8 @@ -124,7 +124,7 @@ sub_8084390: @ 8084390 ldr r1, =gUnknown_030060B0 movs r0, 0 strb r0, [r1] - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] adds r0, 0x28 movs r1, 0 @@ -146,7 +146,7 @@ sub_80843C0: @ 80843C0 push {r4-r7,lr} bl sub_80DF040 movs r2, 0x8 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr mov r12, r0 ldr r4, =0x00002e90 ldr r3, =gUnknown_08339D1C @@ -178,7 +178,7 @@ sub_8084400: @ 8084400 sub sp, 0x4 movs r0, 0 str r0, [sp] - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r1, [r4] ldr r0, =0x0000064c adds r1, r0 @@ -261,7 +261,7 @@ _080844B2: ldr r1, =gUnknown_020322D4 movs r0, 0x1 strb r0, [r1] - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] adds r0, 0xAC movs r5, 0 @@ -285,7 +285,7 @@ _080844B2: bl GabbyAndTyNewGameInitData bl sub_80E8B28 bl RemoveAllBerryTrees - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] movs r1, 0x92 lsls r1, 3 @@ -345,7 +345,7 @@ sub_80845CC: @ 80845CC mov r0, sp movs r5, 0 strh r5, [r0] - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r1, [r4] movs r0, 0xF6 lsls r0, 1 diff --git a/asm/option_menu.s b/asm/option_menu.s index a9e13c7b8..eaa453e04 100644 --- a/asm/option_menu.s +++ b/asm/option_menu.s @@ -32,7 +32,7 @@ CB2_OptionsMenu: @ 80BA4DC mov r7, r8 push {r7} sub sp, 0xC - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 @@ -63,7 +63,7 @@ _080BA508: _080BA538: movs r0, 0 bl SetVBlankCallback - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -213,14 +213,14 @@ _080BA69C: bl remove_some_task bl ResetTasks bl ResetAllObjectData - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 b _080BA7F4 .pool _080BA6BC: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x14] lsrs r0, 3 @@ -239,7 +239,7 @@ _080BA6E0: movs r1, 0 movs r2, 0x2 bl LoadPalette - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x14] lsrs r0, 3 @@ -248,7 +248,7 @@ _080BA6E0: movs r1, 0x70 movs r2, 0x20 bl LoadPalette - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -265,7 +265,7 @@ _080BA728: movs r0, 0 bl PutWindowTilemap bl sub_80BB0D0 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -280,7 +280,7 @@ _080BA748: movs r0, 0x1 bl PutWindowTilemap bl sub_80BB104 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -289,7 +289,7 @@ _080BA748: strb r0, [r1] _080BA760: bl sub_80BB154 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -308,7 +308,7 @@ _080BA774: adds r4, r1 movs r0, 0 strh r0, [r4, 0x8] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldrb r0, [r2, 0x14] lsls r0, 29 @@ -348,7 +348,7 @@ _080BA774: movs r1, 0x3 bl CopyWindowToVram _080BA7EC: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -409,7 +409,7 @@ sub_80BA86C: @ 80BA86C push {r4-r7,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -654,7 +654,7 @@ sub_80BAA64: @ 80BAA64 sub sp, 0x4 lsls r0, 24 lsrs r0, 24 - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r3, [r6] ldr r1, =gTasks lsls r4, r0, 2 @@ -742,7 +742,7 @@ sub_80BAB08: @ 80BAB08 adds r0, r2, 0 bl DestroyTask bl FreeAllWindowBuffers - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r0, [r0, 0x8] bl SetMainCallback2 _080BAB2C: @@ -845,7 +845,7 @@ sub_80BABDC: @ 80BABDC push {lr} lsls r0, 24 lsrs r3, r0, 24 - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r0, 0x10 ands r0, r1 @@ -970,7 +970,7 @@ sub_80BACE0: @ 80BACE0 push {lr} lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x30 ands r0, r1 @@ -1031,7 +1031,7 @@ sub_80BAD5C: @ 80BAD5C push {lr} lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x30 ands r0, r1 @@ -1092,7 +1092,7 @@ sub_80BADD8: @ 80BADD8 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x30 ands r0, r1 @@ -1156,7 +1156,7 @@ sub_80BAE5C: @ 80BAE5C push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x10 ands r0, r1 @@ -1191,7 +1191,7 @@ _080BAE82: movs r0, 0x1 strb r0, [r1] _080BAEAE: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x20 ands r0, r1 @@ -1333,7 +1333,7 @@ sub_80BAFCC: @ 80BAFCC push {lr} lsls r0, 24 lsrs r3, r0, 24 - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r0, 0x10 ands r0, r1 diff --git a/asm/play_time.s b/asm/play_time.s index 2c4e28d82..8dc5aa53f 100644 --- a/asm/play_time.s +++ b/asm/play_time.s @@ -10,7 +10,7 @@ reset_playtime: @ 80841E4 ldr r1, =gUnknown_03000E08 movs r0, 0 strb r0, [r1] - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r3, [r2] movs r1, 0 movs r0, 0 @@ -30,7 +30,7 @@ set_max_playtime_if_appropriate: @ 8084208 ldr r1, =gUnknown_03000E08 movs r0, 0x1 strb r0, [r1] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrh r1, [r0, 0xE] ldr r0, =0x000003e7 @@ -52,14 +52,14 @@ sub_8084230: @ 8084230 .pool thumb_func_end sub_8084230 - thumb_func_start gametime_increment -gametime_increment: @ 808423C + thumb_func_start PlayTimeCounter_Update +PlayTimeCounter_Update: @ 808423C push {lr} ldr r0, =gUnknown_03000E08 ldrb r0, [r0] cmp r0, 0x1 bne _08084294 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r0, [r2] ldrb r1, [r0, 0x12] adds r1, 0x1 @@ -101,14 +101,14 @@ _08084294: pop {r0} bx r0 .pool - thumb_func_end gametime_increment + thumb_func_end PlayTimeCounter_Update thumb_func_start set_max_playtime set_max_playtime: @ 80842A4 ldr r1, =gUnknown_03000E08 movs r0, 0x2 strb r0, [r1] - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r3, [r2] ldr r0, =0x000003e7 strh r0, [r3, 0xE] diff --git a/asm/player_pc.s b/asm/player_pc.s index d2ce8084c..ad85fb330 100644 --- a/asm/player_pc.s +++ b/asm/player_pc.s @@ -9,7 +9,7 @@ sub_816ADF4: @ 816ADF4 push {r4-r6,lr} movs r4, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x93 lsls r1, 3 @@ -374,7 +374,7 @@ sub_816B148: @ 816B148 ldrb r0, [r0] cmp r0, 0x4 bne _0816B180 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 @@ -817,7 +817,7 @@ sub_816B510: @ 816B510 push {r4,lr} movs r2, 0 movs r1, 0x6 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r3, [r0] movs r4, 0xB0 lsls r4, 6 @@ -862,7 +862,7 @@ _0816B55A: mov r8, r1 cmp r4, 0xF bhi _0816B5D4 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr mov r10, r0 lsls r0, r2, 3 adds r0, r2 @@ -1078,8 +1078,8 @@ sub_816B730: @ 816B730 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r5, =gUnknown_02021CC4 - ldr r2, =gUnknown_03005D8C + ldr r5, =gStringVar1 + ldr r2, =gSaveBlock1Ptr ldr r1, =gUnknown_0203BCB8 ldrh r0, [r1] adds r0, 0x6 @@ -1093,14 +1093,14 @@ sub_816B730: @ 816B730 ldr r0, =0x00002bf2 adds r1, r0 adds r0, r5, 0 - bl CopyString + bl StringCopy adds r0, r5, 0 movs r1, 0 bl sub_81DB554 - ldr r5, =gUnknown_02021FC4 + ldr r5, =gStringVar4 ldr r1, =gUnknown_085EAC63 adds r0, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r2, =sub_816B7DC adds r0, r4, 0 adds r1, r5, 0 @@ -1248,7 +1248,7 @@ sub_816B8A4: @ 816B8A4 bne _0816B8E6 bl sub_81D1EC0 bl overworld_free_bg_tilemaps - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r1, =gUnknown_0203BCB8 ldrh r0, [r1] adds r0, 0x6 @@ -1413,7 +1413,7 @@ sub_816BA18: @ 816BA18 push {r4-r6,lr} lsls r0, 24 lsrs r6, r0, 24 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r4, =gUnknown_0203BCB8 ldrh r1, [r4] adds r1, 0x6 @@ -1773,7 +1773,7 @@ _0816BD14: adds r4, r0 ldr r0, [r5] adds r0, r4 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r1, [r1] lsls r2, r6, 2 adds r1, r2 @@ -1809,7 +1809,7 @@ _0816BD58: ldr r0, [r5] adds r0, r4 ldr r1, =gUnknown_085E8CF7 - bl CopyString + bl StringCopy ldr r0, [r5] lsls r2, r6, 3 adds r1, r0, r2 @@ -1878,7 +1878,7 @@ _0816BDEE: negs r0, r0 cmp r4, r0 beq _0816BE2C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] lsls r1, r4, 2 adds r0, r1 @@ -1938,8 +1938,8 @@ _0816BE84: movs r2, 0xFF bl sub_816BFE0 _0816BE8E: - ldr r0, =gUnknown_02021CC4 - ldr r1, =gUnknown_03005D8C + ldr r0, =gStringVar1 + ldr r1, =gSaveBlock1Ptr ldr r1, [r1] lsls r2, r4, 2 adds r1, r2 @@ -1948,11 +1948,11 @@ _0816BE8E: ldrh r1, [r1] movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E8DA0 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x7 adds r1, r4, 0 movs r2, 0x68 @@ -1991,7 +1991,7 @@ sub_816BEF0: @ 816BEF0 negs r0, r0 cmp r1, r0 beq _0816BF2C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] lsls r1, 2 adds r0, r1 @@ -2242,7 +2242,7 @@ sub_816C110: @ 816C110 push {lr} sub sp, 0x4 bl sub_80D6E84 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x93 lsls r1, 3 @@ -2435,10 +2435,10 @@ sub_816C2C0: @ 816C2C0 adds r0, r5, 0 movs r1, 0x11 bl FillWindowPixelBuffer - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 adds r0, r4, 0 adds r1, r6, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 str r0, [sp] movs r0, 0 @@ -2466,7 +2466,7 @@ sub_816C30C: @ 816C30C lsls r0, 3 ldr r1, =gTasks + 0x8 adds r4, r0, r1 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x4 ands r0, r1 @@ -2641,7 +2641,7 @@ sub_816C450: @ 816C450 adds r0, r5 ldrb r0, [r0] bl sub_816C690 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, [r6] adds r0, r5 @@ -2652,7 +2652,7 @@ sub_816C450: @ 816C450 lsls r0, 3 adds r1, r0 ldrh r0, [r1] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name ldr r0, =0x0000fff7 bl sub_816C228 @@ -2682,7 +2682,7 @@ sub_816C4FC: @ 816C4FC lsls r0, 3 ldr r1, =gTasks + 0x8 adds r4, r0, r1 - ldr r7, =gUnknown_030022C0 + ldr r7, =gMain ldrh r1, [r7, 0x2E] movs r0, 0x4 ands r0, r1 @@ -2790,7 +2790,7 @@ sub_816C5A0: @ 816C5A0 subs r0, r6, 0x1 cmp r2, r0 beq _0816C60A - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x93 lsls r1, 3 @@ -2889,12 +2889,12 @@ sub_816C6BC: @ 816C6BC lsrs r5, 24 lsls r3, 24 lsrs r3, 24 - ldr r0, =gUnknown_02021CC4 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + ldr r0, =gStringVar1 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E8DA0 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 adds r1, r4, 0 movs r2, 0x30 @@ -2941,7 +2941,7 @@ sub_816C71C: @ 816C71C ldrsh r0, [r6, r1] cmp r0, 0 bne _0816C798 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] lsls r0, r4, 2 adds r1, r0 @@ -2959,7 +2959,7 @@ _0816C774: lsls r2, 3 adds r0, r1, r2 ldrh r0, [r0] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name ldr r0, =0x0000fffe bl sub_816C228 @@ -2967,7 +2967,7 @@ _0816C774: b _0816C7D4 .pool _0816C798: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] lsls r0, r4, 2 adds r1, r0 @@ -2985,7 +2985,7 @@ _0816C7BC: lsls r2, 3 adds r0, r1, r2 ldrh r0, [r0] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name ldr r0, =0x0000fffc bl sub_816C228 @@ -3039,7 +3039,7 @@ sub_816C818: @ 816C818 adds r2, r0 lsls r2, 16 adds r0, r6, 0x4 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr mov r8, r1 ldr r1, [r1] lsrs r7, r2, 14 @@ -3066,7 +3066,7 @@ sub_816C818: @ 816C818 b _0816C8EC .pool _0816C888: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -3136,7 +3136,7 @@ sub_816C8FC: @ 816C8FC ldrh r0, [r0] adds r1, r0 lsls r1, 16 - ldr r7, =gUnknown_03005D8C + ldr r7, =gSaveBlock1Ptr ldr r0, [r7] lsrs r5, r1, 14 adds r0, r5 @@ -3156,14 +3156,14 @@ sub_816C8FC: @ 816C8FC lsls r2, 3 adds r0, r2 ldrh r0, [r0] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 movs r2, 0x4 ldrsh r1, [r4, r2] movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, =0x0000fffd bl sub_816C228 bl sub_816C2C0 @@ -3215,7 +3215,7 @@ sub_816C9B8: @ 816C9B8 ldrh r0, [r0] adds r1, r0 lsls r1, 16 - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr ldr r0, [r6] lsrs r4, r1, 14 adds r0, r4 @@ -3233,14 +3233,14 @@ sub_816C9B8: @ 816C9B8 lsls r2, 3 adds r0, r2 ldrh r0, [r0] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 movs r2, 0x4 ldrsh r1, [r7, r2] movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, =0x0000fff8 bl sub_816C228 bl sub_816C2C0 @@ -3310,7 +3310,7 @@ sub_816CAC8: @ 816CAC8 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r1, =gUnknown_0203BCB8 ldrh r0, [r1, 0x2] @@ -3342,7 +3342,7 @@ sub_816CB04: @ 816CB04 lsls r0, 3 ldr r1, =gTasks + 0x8 adds r5, r0, r1 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -3384,13 +3384,13 @@ sub_816CB74: @ 816CB74 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 beq _0816CBAC - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r1, =gUnknown_0203BCB8 ldrh r0, [r1, 0x2] diff --git a/asm/rom_81795E8.s b/asm/pokeblock_feed.s similarity index 73% rename from asm/rom_81795E8.s rename to asm/pokeblock_feed.s index 66e872c39..3cef9b2b0 100644 --- a/asm/rom_81795E8.s +++ b/asm/pokeblock_feed.s @@ -5,625 +5,6 @@ .text - thumb_func_start sub_81795E8 -sub_81795E8: @ 81795E8 - push {lr} - ldr r0, =0x000008af - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08179634 - ldr r0, =gUnknown_03005D8C - ldr r2, [r0] - ldrh r1, [r2, 0x4] - ldr r0, =0x00004718 - cmp r1, r0 - bne _08179634 - ldr r1, [r2] - ldr r0, =0x0003000a - cmp r1, r0 - beq _08179616 - ldr r0, =0x00030009 - cmp r1, r0 - beq _08179616 - ldr r0, =0x0003000b - cmp r1, r0 - bne _08179634 -_08179616: - movs r0, 0x1 - b _08179636 - .pool -_08179634: - movs r0, 0 -_08179636: - pop {r1} - bx r1 - thumb_func_end sub_81795E8 - - thumb_func_start sub_817963C -sub_817963C: @ 817963C - push {lr} - ldr r2, =0x0000022a - movs r0, 0x10 - movs r1, 0x8 - bl MapGridSetMetatileIdAt - ldr r2, =0x0000022b - movs r0, 0x11 - movs r1, 0x8 - bl MapGridSetMetatileIdAt - movs r2, 0x8B - lsls r2, 2 - movs r0, 0x12 - movs r1, 0x8 - bl MapGridSetMetatileIdAt - ldr r2, =0x00000e32 - movs r0, 0x10 - movs r1, 0x9 - bl MapGridSetMetatileIdAt - ldr r2, =0x00000233 - movs r0, 0x11 - movs r1, 0x9 - bl MapGridSetMetatileIdAt - ldr r2, =0x00000e34 - movs r0, 0x12 - movs r1, 0x9 - bl MapGridSetMetatileIdAt - bl DrawWholeMapView - movs r0, 0x14 - bl audio_play - ldr r0, =0x000008af - bl FlagSet - bl script_env_2_disable - pop {r0} - bx r0 - .pool - thumb_func_end sub_817963C - - thumb_func_start sub_81796AC -sub_81796AC: @ 81796AC - push {r4,lr} - ldr r4, =gUnknown_020244EC - adds r0, r4, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - movs r1, 0x9D - lsls r1, 1 - cmp r0, r1 - bne _081796F4 - bl calc_player_party_count - ldr r0, =gUnknown_020244E9 - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - adds r1, r4, 0 - subs r1, 0x64 - adds r0, r1 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - ldr r1, =0x0000017d - cmp r0, r1 - bne _081796F4 - movs r0, 0x1 - b _081796F6 - .pool -_081796F4: - movs r0, 0 -_081796F6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81796AC - - thumb_func_start nullsub_84 -nullsub_84: @ 81796FC - bx lr - thumb_func_end nullsub_84 - - thumb_func_start sub_8179700 -sub_8179700: @ 8179700 - push {lr} - ldr r0, =sub_8179778 - 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 r0, [r1, 0xA] - strh r0, [r1, 0xC] - movs r0, 0x2 - strh r0, [r1, 0x10] - movs r0, 0x5 - strh r0, [r1, 0x12] - movs r0, 0x32 - strh r0, [r1, 0x14] - movs r0, 0 - bl SetCameraPanningCallback - pop {r0} - bx r0 - .pool - thumb_func_end sub_8179700 - - thumb_func_start sub_817973C -sub_817973C: @ 817973C - push {lr} - ldr r0, =sub_8179778 - 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 r0, [r1, 0xA] - strh r0, [r1, 0xC] - movs r0, 0x3 - strh r0, [r1, 0x10] - movs r0, 0x5 - strh r0, [r1, 0x12] - movs r0, 0x2 - strh r0, [r1, 0x14] - movs r0, 0 - bl SetCameraPanningCallback - pop {r0} - bx r0 - .pool - thumb_func_end sub_817973C - - thumb_func_start sub_8179778 -sub_8179778: @ 8179778 - 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 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - movs r1, 0xA - ldrsh r0, [r4, r1] - movs r2, 0x12 - ldrsh r1, [r4, r2] - bl __modsi3 - cmp r0, 0 - bne _081797D0 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x10] - negs r0, r0 - strh r0, [r4, 0x10] - movs r0, 0x10 - ldrsh r1, [r4, r0] - movs r0, 0 - bl SetCameraPanning - movs r2, 0xC - ldrsh r1, [r4, r2] - movs r2, 0x14 - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _081797D0 - adds r0, r5, 0 - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running - bl InstallCameraPanAheadCallback -_081797D0: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8179778 - - thumb_func_start sub_81797DC -sub_81797DC: @ 81797DC - push {lr} - movs r0, 0x8B - lsls r0, 4 - bl FlagGet - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - bne _0817982C - ldr r0, =gUnknown_03005D8C - ldr r3, [r0] - ldrh r1, [r3, 0x4] - movs r0, 0xC3 - lsls r0, 3 - cmp r1, r0 - bne _0817982C - ldr r1, [r3] - ldr r0, =0x00170006 - cmp r1, r0 - beq _08179810 - ldr r0, =0x00170005 - cmp r1, r0 - beq _08179810 - ldr r0, =0x00170007 - cmp r1, r0 - bne _0817982C -_08179810: - ldr r0, =gUnknown_0203BD14 - strb r2, [r0] - movs r0, 0x1 - b _0817982E - .pool -_0817982C: - movs r0, 0 -_0817982E: - pop {r1} - bx r1 - thumb_func_end sub_81797DC - - thumb_func_start sub_8179834 -sub_8179834: @ 8179834 - push {lr} - bl brm_get_pokemon_selection - ldr r1, =gUnknown_02038C08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - movs r0, 0x3C - bl FieldEffectStart - pop {r0} - bx r0 - .pool - thumb_func_end sub_8179834 - - thumb_func_start sub_8179850 -sub_8179850: @ 8179850 - push {lr} - movs r0, 0x3C - bl FieldEffectActiveListRemove - bl sub_8179860 - pop {r0} - bx r0 - thumb_func_end sub_8179850 - - thumb_func_start sub_8179860 -sub_8179860: @ 8179860 - push {lr} - ldr r2, =0x0000022a - movs r0, 0xE - movs r1, 0x1A - bl MapGridSetMetatileIdAt - ldr r2, =0x0000022b - movs r0, 0xF - movs r1, 0x1A - bl MapGridSetMetatileIdAt - movs r2, 0x8B - lsls r2, 2 - movs r0, 0x10 - movs r1, 0x1A - bl MapGridSetMetatileIdAt - ldr r2, =0x00000e32 - movs r0, 0xE - movs r1, 0x1B - bl MapGridSetMetatileIdAt - ldr r2, =0x00000233 - movs r0, 0xF - movs r1, 0x1B - bl MapGridSetMetatileIdAt - ldr r2, =0x00000e34 - movs r0, 0x10 - movs r1, 0x1B - bl MapGridSetMetatileIdAt - bl DrawWholeMapView - movs r0, 0x14 - bl audio_play - movs r0, 0x8B - lsls r0, 4 - bl FlagSet - bl script_env_2_disable - pop {r0} - bx r0 - .pool - thumb_func_end sub_8179860 - - thumb_func_start sub_81798D0 -sub_81798D0: @ 81798D0 - push {lr} - ldr r0, =0x000008b2 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08179910 - ldr r0, =gUnknown_03005D8C - ldr r2, [r0] - ldrh r1, [r2, 0x4] - ldr r0, =0x00004418 - cmp r1, r0 - bne _08179910 - ldr r1, [r2] - ldr r0, =0x00190008 - cmp r1, r0 - bne _08179910 - ldr r1, =gUnknown_0203BD14 - movs r0, 0x1 - strb r0, [r1] - movs r0, 0x1 - b _08179912 - .pool -_08179910: - movs r0, 0 -_08179912: - pop {r1} - bx r1 - thumb_func_end sub_81798D0 - - thumb_func_start sub_8179918 -sub_8179918: @ 8179918 - push {lr} - bl brm_get_pokemon_selection - ldr r1, =gUnknown_02038C08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - movs r0, 0x3C - bl FieldEffectStart - pop {r0} - bx r0 - .pool - thumb_func_end sub_8179918 - - thumb_func_start sub_8179934 -sub_8179934: @ 8179934 - push {lr} - movs r0, 0x3C - bl FieldEffectActiveListRemove - bl sub_8179944 - pop {r0} - bx r0 - thumb_func_end sub_8179934 - - thumb_func_start sub_8179944 -sub_8179944: @ 8179944 - push {lr} - ldr r2, =0x0000022a - movs r0, 0xE - movs r1, 0x1A - bl MapGridSetMetatileIdAt - ldr r2, =0x0000022b - movs r0, 0xF - movs r1, 0x1A - bl MapGridSetMetatileIdAt - movs r2, 0x8B - lsls r2, 2 - movs r0, 0x10 - movs r1, 0x1A - bl MapGridSetMetatileIdAt - ldr r2, =0x00000e32 - movs r0, 0xE - movs r1, 0x1B - bl MapGridSetMetatileIdAt - ldr r2, =0x00000233 - movs r0, 0xF - movs r1, 0x1B - bl MapGridSetMetatileIdAt - ldr r2, =0x00000e34 - movs r0, 0x10 - movs r1, 0x1B - bl MapGridSetMetatileIdAt - bl DrawWholeMapView - movs r0, 0x14 - bl audio_play - ldr r0, =0x000008b2 - bl FlagSet - bl script_env_2_disable - pop {r0} - bx r0 - .pool - thumb_func_end sub_8179944 - - thumb_func_start nullsub_64 -nullsub_64: @ 81799B4 - bx lr - thumb_func_end nullsub_64 - - thumb_func_start sub_81799B8 -sub_81799B8: @ 81799B8 - push {lr} - bl oei_task_add - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gUnknown_0203BD14 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081799E4 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - ldr r2, =sub_8179934 - b _081799F0 - .pool -_081799E4: - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - ldr r2, =sub_8179850 -_081799F0: - lsrs r1, r2, 16 - strh r1, [r0, 0x18] - strh r2, [r0, 0x1A] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81799B8 - - thumb_func_start sub_8179A04 -sub_8179A04: @ 8179A04 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r4, =gUnknown_03005D8C - ldr r0, [r4] - ldrh r1, [r0, 0x4] - ldr r0, =0x00004318 - cmp r1, r0 - beq _08179A1A - b _08179B5A -_08179A1A: - ldr r0, =0x000008b1 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08179A28 - b _08179B5A -_08179A28: - movs r0, 0x2 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08179A36 - b _08179B5A -_08179A36: - movs r0, 0x3 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08179A58 - b _08179B5A - .pool -_08179A54: - movs r0, 0x1 - b _08179B5C -_08179A58: - movs r5, 0 - mov r8, r4 - ldr r4, =gUnknown_085EFE74 - adds r0, r4, 0x1 - mov r12, r0 - ldr r6, =0x0000403b - ldr r1, =0x0000403c - mov r9, r1 -_08179A68: - lsls r0, r5, 1 - adds r1, r0, r4 - add r0, r12 - ldrb r3, [r0] - mov r7, r8 - ldr r2, [r7] - movs r7, 0 - ldrsh r0, [r2, r7] - ldrb r1, [r1] - cmp r0, r1 - bne _08179B44 - movs r1, 0x2 - ldrsh r0, [r2, r1] - cmp r0, r3 - bne _08179B44 - cmp r5, 0xF - bhi _08179AB0 - adds r0, r6, 0 - bl VarGet - lsls r0, 16 - movs r1, 0x80 - lsls r1, 9 - lsls r1, r5 - orrs r1, r0 - lsrs r1, 16 - adds r0, r6, 0 - bl VarSet - b _08179AF0 - .pool -_08179AB0: - cmp r5, 0x1F - bhi _08179AD2 - mov r0, r9 - bl VarGet - lsls r0, 16 - adds r2, r5, 0 - subs r2, 0x10 - movs r1, 0x80 - lsls r1, 9 - lsls r1, r2 - orrs r1, r0 - lsrs r1, 16 - mov r0, r9 - bl VarSet - b _08179AF0 -_08179AD2: - ldr r4, =0x0000403d - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - adds r2, r5, 0 - subs r2, 0x20 - movs r1, 0x80 - lsls r1, 9 - lsls r1, r2 - orrs r1, r0 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet -_08179AF0: - ldr r0, =0x0000403b - bl VarGet - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x0000ffff - cmp r4, r0 - bne _08179B5A - ldr r0, =0x0000403c - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, r4 - bne _08179B5A - ldr r0, =0x0000403d - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xF - bne _08179B5A - ldr r0, =gUnknown_03005D8C - ldr r0, [r0] - ldr r1, [r0] - ldr r0, =0x00150008 - cmp r1, r0 - beq _08179A54 - b _08179B5A - .pool -_08179B44: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x23 - bls _08179A68 - movs r0, 0x3 - bl FlagSet - movs r0, 0x2 - bl FlagReset -_08179B5A: - movs r0, 0 -_08179B5C: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8179A04 - thumb_func_start sub_8179B68 sub_8179B68: @ 8179B68 push {lr} @@ -650,7 +31,7 @@ sub_8179B84: @ 8179B84 sub_8179B98: @ 8179B98 push {r4,lr} sub sp, 0x4 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -688,7 +69,7 @@ _08179BF8: str r0, [r4] bl SetVBlankHBlankCallbacksToNull bl clear_scheduled_bg_copies_to_vram - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -704,7 +85,7 @@ _08179C20: .pool _08179C34: bl ResetAllObjectData - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -715,7 +96,7 @@ _08179C48: b _08179D32 _08179C4E: bl init_uns_table_pokemon_copy - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -726,7 +107,7 @@ _08179C60: b _08179D32 _08179C66: bl sub_8179FAC - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -737,7 +118,7 @@ _08179C78: ldrb r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 bl sub_8179DF4 lsls r0, 24 @@ -759,7 +140,7 @@ _08179CB0: ldrb r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 bl sub_817A358 ldr r1, =gUnknown_0203BD18 @@ -775,7 +156,7 @@ _08179CDC: movs r2, 0x1 movs r3, 0xE bl SetWindowBorderStyle - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -790,7 +171,7 @@ _08179CFE: movs r1, 0x10 movs r2, 0 bl BlendPalettes - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -811,7 +192,7 @@ _08179D18: _08179D30: strb r0, [r2, 0x8] _08179D32: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -931,12 +312,12 @@ _08179E24: _08179E48: adds r0, r6, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r5, r0, 16 adds r0, r6, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r0, r5, 3 ldr r1, =gMonFrontPicTable @@ -954,16 +335,16 @@ _08179E48: _08179E84: adds r0, r6, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r5, r0, 16 adds r0, r6, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 adds r0, r6, 0 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 adds r0, r5, 0 adds r2, r4, 0 @@ -1094,7 +475,7 @@ sub_8179FAC: @ 8179FAC sub_8179FEC: @ 8179FEC push {lr} lsls r0, 24 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr lsrs r0, 21 ldr r2, =0x00000848 adds r0, r2 @@ -1308,9 +689,9 @@ sub_817A1C4: @ 817A1C4 movs r0, 0x64 adds r5, r1, 0 muls r5, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r0 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r0, =gUnknown_0203CE7C ldrh r0, [r0] lsls r0, 3 @@ -1326,33 +707,33 @@ sub_817A1C4: @ 817A1C4 bl sub_8136FE4 ldr r6, =gUnknown_0203BC9E strh r0, [r6] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 adds r0, r5, 0 bl GetMonNickname - ldr r1, =gUnknown_02021DC4 + ldr r1, =gStringVar2 adds r0, r4, 0 bl sub_8137044 movs r1, 0 ldrsh r0, [r6, r1] cmp r0, 0 bne _0817A248 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E937F - bl ExpandStringRefs + bl StringExpandPlaceholders b _0817A268 .pool _0817A248: cmp r0, 0 ble _0817A260 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E9390 - bl ExpandStringRefs + bl StringExpandPlaceholders b _0817A268 .pool _0817A260: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E93A9 - bl ExpandStringRefs + bl StringExpandPlaceholders _0817A268: ldr r2, =gUnknown_03003014 ldrb r0, [r2] @@ -1363,7 +744,7 @@ _0817A268: adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 - ldr r2, =gUnknown_02021FC4 + ldr r2, =gStringVar4 movs r0, 0 str r0, [sp] movs r0, 0x2 @@ -1407,7 +788,7 @@ sub_817A2C0: @ 817A2C0 movs r2, 0x80 lsls r2, 1 bl m4aMPlayVolumeControl - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r0, [r0, 0x8] bl SetMainCallback2 adds r0, r4, 0 @@ -1460,7 +841,7 @@ sub_817A358: @ 817A358 push {r6,r7} adds r5, r0, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 @@ -2092,7 +1473,7 @@ _0817A932: adds r1, r5, r2 movs r2, 0 ldrsh r1, [r1, r2] - bl sine + bl Sin ldr r2, =0x00001074 adds r1, r5, r2 strh r0, [r1] @@ -2102,7 +1483,7 @@ _0817A932: adds r1, r5, r2 movs r2, 0 ldrsh r1, [r1, r2] - bl cosine + bl Cos ldr r2, =0x00001076 adds r1, r5, r2 strh r0, [r1] @@ -2414,7 +1795,7 @@ _0817ABE2: adds r1, r2, r4 lsls r1, 16 asrs r1, 16 - bl sine + bl Sin lsls r5, 1 movs r2, 0x85 lsls r2, 4 @@ -2438,7 +1819,7 @@ _0817AC54: subs r1, r2, r4 lsls r1, 16 asrs r1, 16 - bl sine + bl Sin lsls r5, 1 movs r2, 0x85 lsls r2, 4 @@ -2455,7 +1836,7 @@ _0817AC54: _0817AC80: lsls r1, 16 asrs r1, 16 - bl cosine + bl Cos movs r3, 0xC5 lsls r3, 4 adds r1, r6, r3 diff --git a/asm/pokedex.s b/asm/pokedex.s index bcf5e2e61..2b9dd2d35 100644 --- a/asm/pokedex.s +++ b/asm/pokedex.s @@ -16,7 +16,7 @@ sub_80BB2D0: @ 80BB2D0 strb r0, [r1] ldr r0, =gUnknown_030060B0 strb r2, [r0] - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] movs r1, 0 strb r2, [r0, 0x19] @@ -33,7 +33,7 @@ sub_80BB2D0: @ 80BB2D0 bl sub_809D3C0 movs r1, 0 movs r2, 0 - ldr r3, =gUnknown_03005D8C + ldr r3, =gSaveBlock1Ptr ldr r6, =0x00000988 ldr r5, =0x00003b24 _080BB30C: @@ -288,7 +288,7 @@ sub_80BB534: @ 80BB534 mov r7, r8 push {r7} sub sp, 0x8 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r4, r0, r1 @@ -370,7 +370,7 @@ _080BB582: orrs r3, r0 str r3, [r2, 0x8] ldr r0, [r2, 0x8] - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r2 @@ -403,7 +403,7 @@ _080BB628: movs r1, 0 bl CreateTask ldr r1, [r4] - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r0, [r5] ldrb r0, [r0, 0x19] ldr r3, =0x00000612 @@ -472,7 +472,7 @@ _080BB6E4: adds r0, r1 movs r1, 0x8 strb r1, [r0] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -584,7 +584,7 @@ sub_80BB7D4: @ 80BB7D4 b _080BBA06 .pool _080BB810: - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r0, 0x1 mov r9, r0 @@ -857,7 +857,7 @@ sub_80BBA78: @ 80BBA78 b _080BBBE8 .pool _080BBAB0: - ldr r5, =gUnknown_030022C0 + ldr r5, =gMain ldrh r1, [r5, 0x2E] movs r0, 0x1 ands r0, r1 @@ -933,7 +933,7 @@ _080BBB34: movs r0, 0x3 bl audio_play _080BBB58: - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r0, 0xA ands r0, r1 @@ -1219,7 +1219,7 @@ sub_80BBDE8: @ 80BBDE8 ands r0, r1 cmp r0, 0 bne _080BBE4A - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r5, =gUnknown_02039B4C ldr r1, [r5] @@ -1317,7 +1317,7 @@ sub_80BBEB8: @ 80BBEB8 b _080BC08A .pool _080BBEEC: - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r7, 0x1 adds r0, r7, 0 @@ -1553,7 +1553,7 @@ sub_80BC0F8: @ 80BC0F8 b _080BC2C8 .pool _080BC130: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -1617,7 +1617,7 @@ _080BC1B2: movs r1, 0xE bl sub_80BD2B4 _080BC1C2: - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r0, 0x8 orrs r0, r1 @@ -1661,7 +1661,7 @@ _080BC214: movs r0, 0x3 bl audio_play _080BC238: - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r0, 0xA ands r0, r1 @@ -1977,7 +1977,7 @@ sub_80BC514: @ 80BC514 sub sp, 0x4 lsls r0, 24 lsrs r5, r0, 24 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 @@ -2127,7 +2127,7 @@ _080BC682: movs r0, 0 movs r1, 0x3 bl CopyWindowToVram - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r2 @@ -2203,7 +2203,7 @@ _080BC768: bl BeginNormalPaletteFade ldr r0, =sub_80BB370 bl SetVBlankCallback - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -2249,7 +2249,7 @@ _080BC790: movs r0, 0x3 bl ShowBg _080BC7F8: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -3526,7 +3526,7 @@ _080BD266: adds r3, r6, 0 bl sub_80BCE2C adds r0, r4, 0 - bl GetStringLength + bl StringLength lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -4018,7 +4018,7 @@ sub_80BD69C: @ 80BD69C lsrs r4, r1, 16 movs r0, 0 mov r10, r0 - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2C] movs r0, 0x40 ands r0, r1 @@ -4305,7 +4305,7 @@ sub_80BD930: @ 80BD930 ldr r1, =0x0000060e adds r0, r1 ldrh r4, [r0] - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r0, 0x40 ands r0, r1 @@ -6291,7 +6291,7 @@ sub_80BEA24: @ 80BEA24 sub sp, 0x4 lsls r0, 24 lsrs r4, r0, 24 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 @@ -6397,7 +6397,7 @@ _080BEAF0: movs r0, 0x1 movs r1, 0x2 bl CopyWindowToVram - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r3, 0x87 lsls r3, 3 adds r1, r3 @@ -6420,7 +6420,7 @@ _080BEB50: lsls r0, 31 lsrs r0, 31 bl sub_80BC844 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r3, 0x87 lsls r3, 3 adds r1, r3 @@ -6468,7 +6468,7 @@ _080BEBD0: bl CopyBgTilemapBufferToVram movs r0, 0x3 bl CopyBgTilemapBufferToVram - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r3, 0x87 lsls r3, 3 adds r1, r3 @@ -6505,7 +6505,7 @@ _080BEC08: ands r0, r2 strb r0, [r1, 0x5] _080BEC44: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -6575,7 +6575,7 @@ _080BECBC: bl ShowBg movs r0, 0x3 bl ShowBg - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r3, 0x87 lsls r3, 3 adds r1, r3 @@ -6626,7 +6626,7 @@ _080BED5E: cmp r0, 0 bne _080BEDA0 _080BED68: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -6724,7 +6724,7 @@ sub_80BEDF4: @ 80BEDF4 b _080BEFBA .pool _080BEE34: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldrh r2, [r1, 0x2E] movs r0, 0x2 ands r0, r2 @@ -6845,7 +6845,7 @@ _080BEF28: ands r0, r2 cmp r0, 0 beq _080BEF78 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0x1 @@ -6880,7 +6880,7 @@ _080BEF78: ands r0, r1 cmp r0, 0 beq _080BEFBA - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0x1 @@ -7018,7 +7018,7 @@ sub_80BF0AC: @ 80BF0AC push {r4-r7,lr} lsls r0, 24 lsrs r6, r0, 24 - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain movs r0, 0x87 lsls r0, 3 adds r7, r2, r0 @@ -7192,7 +7192,7 @@ sub_80BF250: @ 80BF250 sub sp, 0x14 lsls r0, 24 lsrs r4, r0, 24 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 @@ -7237,7 +7237,7 @@ _080BF2B6: movs r1, 0x6 strb r1, [r0] ldr r1, =gUnknown_030060B4 - ldr r4, =gUnknown_030022C0 + ldr r4, =gMain ldr r0, [r4, 0xC] str r0, [r1] movs r0, 0 @@ -7279,7 +7279,7 @@ _080BF310: bl PutWindowTilemap movs r0, 0x2 bl PutWindowTilemap - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r3, 0x87 lsls r3, 3 adds r1, r3 @@ -7303,7 +7303,7 @@ _080BF360: .pool _080BF38C: bl ResetPaletteFade - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -7321,7 +7321,7 @@ _080BF3A0: movs r2, 0x52 movs r3, 0x31 bl sub_80C0B44 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r3, 0x87 lsls r3, 3 adds r1, r3 @@ -7394,7 +7394,7 @@ _080BF41C: bne _080BF462 b _080BF5B2 _080BF462: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -7431,7 +7431,7 @@ _080BF498: lsls r0, 24 cmp r0, 0 beq _080BF4D8 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r3, 0x87 lsls r3, 3 adds r1, r3 @@ -7466,7 +7466,7 @@ _080BF514: ldr r0, =gUnknown_030060B4 ldr r0, [r0] bl SetVBlankCallback - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r4, 0x87 lsls r4, 3 adds r1, r4 @@ -7495,7 +7495,7 @@ _080BF540: movs r0, 0x3 bl ShowBg _080BF57A: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -7550,7 +7550,7 @@ _080BF5EC: movs r0, 0 bl sub_80BF7FC _080BF5F2: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldrh r2, [r1, 0x2E] movs r0, 0x1 ands r0, r2 @@ -7621,7 +7621,7 @@ _080BF694: ands r0, r2 cmp r0, 0 beq _080BF700 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0x1 @@ -7664,7 +7664,7 @@ _080BF700: ands r0, r1 cmp r0, 0 beq _080BF772 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0x1 @@ -7794,7 +7794,7 @@ sub_80BF82C: @ 80BF82C sub sp, 0x44 lsls r0, 24 lsrs r7, r0, 24 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 @@ -7895,11 +7895,11 @@ _080BF910: _080BF93C: ldr r1, =gUnknown_085E8723 add r0, sp, 0x4 - bl CopyString - ldr r0, =gUnknown_03005D90 + bl StringCopy + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] add r0, sp, 0x4 - bl AppendString + bl StringAppend movs r0, 0x1 add r1, sp, 0x4 movs r2, 0xF0 @@ -7910,7 +7910,7 @@ _080BF93C: add r0, sp, 0x4 movs r2, 0x79 bl sub_80BE8DC - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -7920,7 +7920,7 @@ _080BF97C: bl ResetPaletteFade b _080BFB4E _080BF982: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] bl sub_806F000 @@ -7986,7 +7986,7 @@ _080BF982: lsls r0, 3 adds r0, r1 strh r6, [r0, 0x12] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -8077,7 +8077,7 @@ _080BFAE8: ldr r0, =gUnknown_030060B4 ldr r0, [r0] bl SetVBlankCallback - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -8106,7 +8106,7 @@ _080BFB14: movs r0, 0x3 bl ShowBg _080BFB4E: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -8156,7 +8156,7 @@ sub_80BFBB0: @ 80BFBB0 lsls r0, 24 lsrs r4, r0, 24 adds r5, r4, 0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -8198,7 +8198,7 @@ _080BFC10: ands r0, r1 cmp r0, 0 beq _080BFC5C - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0x1 @@ -8504,7 +8504,7 @@ _080BFE84: b _080C0074 _080BFE92: ldr r1, =gUnknown_030060B4 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r0, [r0, 0xC] str r0, [r1] movs r0, 0 @@ -8707,7 +8707,7 @@ sub_80C0088: @ 80C0088 sub sp, 0x4 lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -8918,11 +8918,11 @@ _080C024C: _080C0250: ldr r1, =gUnknown_085E8D4F mov r0, sp - bl CopyString + bl StringCopy adds r1, r5, 0 movs r2, 0x2 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN mov r0, sp movs r1, 0x60 movs r2, 0x19 @@ -9448,7 +9448,7 @@ _080C06A2: _080C06A8: b _080C07E8 _080C06AA: - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] adds r0, 0x5C adds r0, r4 @@ -9459,7 +9459,7 @@ _080C06AA: bne _080C06BE b _080C07E8 _080C06BE: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r3, [r0] ldr r6, =0x00000988 adds r1, r3, r6 @@ -9484,7 +9484,7 @@ _080C06E0: b _080C076A .pool _080C06FC: - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r3, [r1] adds r0, r3, 0 adds r0, 0x28 @@ -9499,7 +9499,7 @@ _080C06FC: adds r0, r4 ldrb r0, [r0] ands r0, r5 - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr cmp r2, r0 bne _080C0754 ldr r1, [r6] @@ -9557,7 +9557,7 @@ _080C076A: b _080C07E8 .pool _080C079C: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r1, 0x5C adds r1, r4 @@ -9565,7 +9565,7 @@ _080C079C: adds r0, r5, 0 orrs r0, r2 strb r0, [r1] - ldr r3, =gUnknown_03005D8C + ldr r3, =gSaveBlock1Ptr ldr r1, [r3] ldr r0, =0x00000988 adds r1, r0 @@ -9580,7 +9580,7 @@ _080C079C: b _080C07DE .pool _080C07D8: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r1, 0x28 _080C07DE: @@ -10479,13 +10479,13 @@ sub_80C0E68: @ 80C0E68 lsls r0, 1 cmp r1, r0 bne _080C0E94 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r0, [r0, 0x20] b _080C0E96 .pool _080C0E88: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r0, [r0, 0x1C] b _080C0E96 @@ -11062,7 +11062,7 @@ sub_80C12E0: @ 80C12E0 sub sp, 0x4 lsls r0, 24 lsrs r4, r0, 24 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 @@ -11163,7 +11163,7 @@ _080C13F0: movs r1, 0x1 movs r2, 0x7E bl LoadPalette - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r2 @@ -11219,7 +11219,7 @@ _080C1480: movs r2, 0x10 movs r3, 0 bl BeginNormalPaletteFade - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -11248,7 +11248,7 @@ _080C14A0: movs r0, 0x3 bl ShowBg _080C14DA: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -11351,7 +11351,7 @@ sub_80C15B0: @ 80C15B0 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -11442,7 +11442,7 @@ _080C1640: movs r0, 0x3 bl CopyBgTilemapBufferToVram _080C167C: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x10 ands r0, r1 @@ -11534,7 +11534,7 @@ _080C1740: bne _080C174C ldr r6, =gUnknown_0856EDD4 _080C174C: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -11591,7 +11591,7 @@ _080C178C: adds r0, r5, 0 movs r1, 0x5 bl sub_80C2318 - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r1, [r4] strb r0, [r1, 0x19] bl sub_809D42C @@ -11677,7 +11677,7 @@ _080C1870: movs r0, 0x3 bl CopyBgTilemapBufferToVram _080C18B6: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x10 ands r0, r1 @@ -11711,7 +11711,7 @@ _080C18B6: movs r0, 0x3 bl CopyBgTilemapBufferToVram _080C1900: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 @@ -11745,7 +11745,7 @@ _080C1900: movs r0, 0x3 bl CopyBgTilemapBufferToVram _080C194A: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x80 ands r0, r1 @@ -11913,7 +11913,7 @@ sub_80C1AB8: @ 80C1AB8 lsls r0, 24 lsrs r4, r0, 24 adds r2, r4, 0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -12052,7 +12052,7 @@ sub_80C1BCC: @ 80C1BCC subs r0, 0x1 lsls r0, 16 lsrs r2, r0, 16 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain mov r12, r0 ldrh r1, [r0, 0x2E] movs r0, 0x1 diff --git a/asm/pokedex_area_screen.s b/asm/pokedex_area_screen.s index 0b58ca1b6..65a7c0b1c 100644 --- a/asm/pokedex_area_screen.s +++ b/asm/pokedex_area_screen.s @@ -138,7 +138,7 @@ sub_813CB40: @ 813CB40 bls _0813CB70 strh r4, [r1] _0813CB70: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r3, =0x000031dc adds r0, r3 @@ -1310,7 +1310,7 @@ _0813D4A8: adds r0, r1 movs r1, 0 movs r2, 0x10 - bl RepeatChar + bl StringFill b _0813D584 .pool _0813D4D4: @@ -1451,7 +1451,7 @@ _0813D5E2: b _0813D698 .pool _0813D5F8: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r2, [r0, 0x2E] movs r3, 0x2 adds r0, r3, 0 @@ -1473,7 +1473,7 @@ _0813D614: ands r0, r2 cmp r0, 0 beq _0813D6A8 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0x1 diff --git a/asm/pokedex_cry_screen.s b/asm/pokedex_cry_screen.s index 909d81483..2ef4cb544 100644 --- a/asm/pokedex_cry_screen.s +++ b/asm/pokedex_cry_screen.s @@ -295,7 +295,7 @@ sub_8145588: @ 8145588 thumb_func_start sub_81455A8 sub_81455A8: @ 81455A8 push {r4,lr} - ldr r3, =gUnknown_03002F50 + ldr r3, =gPcmDmaCounter movs r0, 0 ldrsb r0, [r3, r0] cmp r0, 0x1 diff --git a/asm/pokemon_1.s b/asm/pokemon_1.s index 45b3aab02..9d0d4d108 100644 --- a/asm/pokemon_1.s +++ b/asm/pokemon_1.s @@ -83,7 +83,7 @@ zero_pokemon_struct: @ 8067A8C @ void zero_player_party_data() zero_player_party_data: @ 8067B0C push {r4,r5,lr} - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty movs r0, 0xFA lsls r0, 1 adds r5, r4, r0 @@ -102,7 +102,7 @@ _08067B16: thumb_func_start zero_enemy_party_data zero_enemy_party_data: @ 8067B2C push {r4,r5,lr} - ldr r4, =gUnknown_02024744 + ldr r4, =gEnemyParty movs r0, 0xFA lsls r0, 1 adds r5, r4, r0 @@ -207,9 +207,9 @@ create_pokemon: @ 8067BBC str r0, [sp, 0x14] b _08067C0C _08067BF8: - bl GenerateRandomNumber + bl Random adds r4, r0, 0 - bl GenerateRandomNumber + bl Random lsls r4, 16 lsrs r4, 16 lsls r0, 16 @@ -230,9 +230,9 @@ _08067C0C: mov r8, r2 ldr r6, =0x0000ffff _08067C28: - bl GenerateRandomNumber + bl Random adds r4, r0, 0 - bl GenerateRandomNumber + bl Random lsls r4, 16 lsrs r4, 16 lsls r0, 16 @@ -263,7 +263,7 @@ _08067C64: str r0, [sp, 0x18] b _08067C8A _08067C70: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldrb r1, [r2, 0xA] ldrb r0, [r2, 0xB] @@ -297,11 +297,11 @@ _08067C8A: movs r1, 0x2 mov r2, sp bl pokemon_setattr_encrypted - ldr r2, =gUnknown_82E9531 + ldr r2, =gGameLanguage adds r0, r7, 0 movs r1, 0x3 bl pokemon_setattr_encrypted - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r2, [r5] adds r0, r7, 0 movs r1, 0x7 @@ -354,7 +354,7 @@ _08067C8A: movs r1, 0x24 add r2, sp, 0x10 bl pokemon_setattr_encrypted - ldr r2, =gUnknown_82E9530 + ldr r2, =gGameVersion adds r0, r7, 0 movs r1, 0x25 bl pokemon_setattr_encrypted @@ -405,7 +405,7 @@ _08067C8A: b _08067E50 .pool _08067DC8: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x18] @@ -438,7 +438,7 @@ _08067DC8: movs r1, 0x29 adds r2, r4, 0 bl pokemon_setattr_encrypted - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x18] @@ -517,9 +517,9 @@ pokemon_make_with_nature: @ 8067E90 lsls r0, 24 lsrs r5, r0, 24 _08067EB0: - bl GenerateRandomNumber + bl Random adds r4, r0, 0 - bl GenerateRandomNumber + bl Random lsls r4, 16 lsrs r4, 16 lsls r0, 16 @@ -585,9 +585,9 @@ sub_8067EF8: @ 8067EF8 cmp r0, 0x1B bhi _08067F9E _08067F38: - bl GenerateRandomNumber + bl Random adds r4, r0, 0 - bl GenerateRandomNumber + bl Random lsls r4, 16 lsrs r4, 16 lsls r0, 16 @@ -632,9 +632,9 @@ _08067F38: bne _08067F38 b _08067FCE _08067F9E: - bl GenerateRandomNumber + bl Random adds r4, r0, 0 - bl GenerateRandomNumber + bl Random lsls r4, 16 lsrs r4, 16 lsls r0, 16 @@ -686,16 +686,16 @@ sub_8067FF8: @ 8067FF8 lsls r2, 24 lsrs r7, r2, 24 _0806800A: - bl GenerateRandomNumber + bl Random adds r4, r0, 0 - bl GenerateRandomNumber + bl Random lsls r4, 16 lsrs r5, r4, 16 lsls r0, 16 orrs r5, r0 - bl GenerateRandomNumber + bl Random adds r4, r0, 0 - bl GenerateRandomNumber + bl Random lsls r4, 16 lsrs r4, 16 lsls r0, 16 @@ -936,7 +936,7 @@ _080681D2: adds r1, r6, 0 adds r1, 0x20 add r0, sp, 0x10 - bl CopyString + bl StringCopy add r0, sp, 0x10 ldrb r0, [r0] cmp r0, 0xFC @@ -949,7 +949,7 @@ _080681D2: mov r1, r9 strb r0, [r1] add r0, sp, 0x10 - bl StripExtendedControlCodes + bl StripExtCtrlCodes b _08068236 _08068230: movs r0, 0x2 @@ -1081,7 +1081,7 @@ sub_8068338: @ 8068338 adds r6, r1, 0 lsls r2, 24 lsrs r2, 24 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 @@ -1169,7 +1169,7 @@ _080683D2: bl pokemon_setattr add r0, sp, 0x10 ldr r1, [sp, 0x54] - bl CopyString + bl StringCopy add r0, sp, 0x10 ldrb r0, [r0] cmp r0, 0xFC @@ -1182,7 +1182,7 @@ _080683D2: mov r1, r9 strb r0, [r1] add r0, sp, 0x10 - bl StripExtendedControlCodes + bl StripExtCtrlCodes b _08068430 _0806842A: movs r0, 0x2 @@ -1454,9 +1454,9 @@ sub_8068634: @ 8068634 mov r8, r4 movs r6, 0 _08068664: - bl GenerateRandomNumber + bl Random adds r4, r0, 0 - bl GenerateRandomNumber + bl Random lsls r4, 16 lsrs r4, 16 lsls r0, 16 @@ -1538,12 +1538,12 @@ sub_80686FC: @ 80686FC adds r6, r1, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r6] adds r0, r7, 0 movs r1, 0xC movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 cmp r0, 0xAF @@ -1564,7 +1564,7 @@ _08068738: adds r1, 0xD adds r0, r7, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r4] adds r4, 0x2 adds r5, 0x1 @@ -1573,58 +1573,58 @@ _08068738: adds r0, r7, 0 movs r1, 0x38 movs r2, 0 - bl pokemon_getattr + bl GetMonData strb r0, [r6, 0xC] adds r0, r7, 0 movs r1, 0x15 movs r2, 0 - bl pokemon_getattr + bl GetMonData strb r0, [r6, 0xD] adds r0, r7, 0 movs r1, 0x1 movs r2, 0 - bl pokemon_getattr + bl GetMonData str r0, [r6, 0x14] adds r0, r7, 0 movs r1, 0x1A movs r2, 0 - bl pokemon_getattr + bl GetMonData strb r0, [r6, 0xE] adds r0, r7, 0 movs r1, 0x1B movs r2, 0 - bl pokemon_getattr + bl GetMonData strb r0, [r6, 0xF] adds r0, r7, 0 movs r1, 0x1C movs r2, 0 - bl pokemon_getattr + bl GetMonData strb r0, [r6, 0x10] adds r0, r7, 0 movs r1, 0x1D movs r2, 0 - bl pokemon_getattr + bl GetMonData strb r0, [r6, 0x11] adds r0, r7, 0 movs r1, 0x1E movs r2, 0 - bl pokemon_getattr + bl GetMonData strb r0, [r6, 0x12] adds r0, r7, 0 movs r1, 0x1F movs r2, 0 - bl pokemon_getattr + bl GetMonData strb r0, [r6, 0x13] adds r0, r7, 0 movs r1, 0x20 movs r2, 0 - bl pokemon_getattr + bl GetMonData mov r1, r8 strb r0, [r1] adds r0, r7, 0 movs r1, 0x27 movs r2, 0 - bl pokemon_getattr + bl GetMonData movs r4, 0x1F ands r0, r4 ldrb r2, [r6, 0x18] @@ -1636,7 +1636,7 @@ _08068738: adds r0, r7, 0 movs r1, 0x28 movs r2, 0 - bl pokemon_getattr + bl GetMonData movs r5, 0x1F ands r0, r5 lsls r0, 5 @@ -1648,7 +1648,7 @@ _08068738: adds r0, r7, 0 movs r1, 0x29 movs r2, 0 - bl pokemon_getattr + bl GetMonData ands r0, r4 lsls r0, 2 ldrb r2, [r6, 0x19] @@ -1660,7 +1660,7 @@ _08068738: adds r0, r7, 0 movs r1, 0x2A movs r2, 0 - bl pokemon_getattr + bl GetMonData movs r1, 0x1F ands r1, r0 lsls r1, 15 @@ -1672,7 +1672,7 @@ _08068738: adds r0, r7, 0 movs r1, 0x2B movs r2, 0 - bl pokemon_getattr + bl GetMonData ands r0, r5 lsls r0, 4 ldrh r2, [r6, 0x1A] @@ -1683,7 +1683,7 @@ _08068738: adds r0, r7, 0 movs r1, 0x2C movs r2, 0 - bl pokemon_getattr + bl GetMonData ands r0, r4 lsls r0, 1 ldrb r2, [r6, 0x1B] @@ -1695,7 +1695,7 @@ _08068738: adds r0, r7, 0 movs r1, 0x2E movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 7 ldrb r2, [r6, 0x1B] movs r1, 0x7F @@ -1705,12 +1705,12 @@ _08068738: adds r0, r7, 0 movs r1, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData str r0, [r6, 0x1C] adds r0, r7, 0 movs r1, 0x2 mov r2, r9 - bl pokemon_getattr + bl GetMonData pop {r3,r4} mov r8, r3 mov r9, r4 @@ -1785,13 +1785,13 @@ _08068914: .4byte _08068A00 .4byte _08068990 _0806892C: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq _080689CE - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -1802,13 +1802,13 @@ _0806892C: b _080689B6 .pool _08068958: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq _080689CE - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -1825,14 +1825,14 @@ _08068958: b _080689CE .pool _08068990: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r2, [r0] movs r3, 0x2 adds r0, r2, 0 ands r0, r3 cmp r0, 0 beq _080689E4 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -1861,7 +1861,7 @@ _080689CE: b _08068A02 .pool _080689E4: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -1889,7 +1889,7 @@ get_pokemon_data_3: @ 8068A10 push {r4-r6,lr} adds r5, r0, 0 adds r6, r1, 0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x20 ands r0, r1 @@ -1898,7 +1898,7 @@ get_pokemon_data_3: @ 8068A10 adds r0, r5, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData movs r1, 0xCD lsls r1, 1 cmp r0, r1 @@ -1912,13 +1912,13 @@ _08068A3C: adds r1, 0x27 adds r0, r5, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 adds r1, r6, 0 adds r1, 0x1A adds r0, r5, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r2, =gUnknown_08329D48 lsls r1, r6, 1 adds r1, r2 @@ -1967,12 +1967,12 @@ _08068AAA: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData movs r1, 0xCD lsls r1, 1 cmp r0, r1 @@ -1980,7 +1980,7 @@ _08068AAA: adds r0, r4, 0 movs r1, 0x3B movs r2, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp] adds r0, r4, 0 movs r1, 0x3B @@ -1989,7 +1989,7 @@ _08068AAA: adds r0, r4, 0 movs r1, 0x3C movs r2, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp] adds r0, r4, 0 movs r1, 0x3C @@ -1998,7 +1998,7 @@ _08068AAA: adds r0, r4, 0 movs r1, 0x3D movs r2, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp] adds r0, r4, 0 movs r1, 0x3D @@ -2007,7 +2007,7 @@ _08068AAA: adds r0, r4, 0 movs r1, 0x3E movs r2, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp] adds r0, r4, 0 movs r1, 0x3E @@ -2016,7 +2016,7 @@ _08068AAA: adds r0, r4, 0 movs r1, 0x3F movs r2, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp] adds r0, r4, 0 movs r1, 0x3F @@ -2036,7 +2036,7 @@ _08068B34: thumb_func_start sub_8068B48 sub_8068B48: @ 8068B48 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 18 @@ -2084,7 +2084,7 @@ _08068B78: thumb_func_start sub_8068BB0 sub_8068BB0: @ 8068BB0 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 18 @@ -2140,7 +2140,7 @@ DoScriptedWildBattle: @ 8068C18 ldr r0, =gUnknown_020375E4 ldrh r6, [r0] bl zero_enemy_party_data - ldr r7, =gUnknown_02024744 + ldr r7, =gEnemyParty lsls r4, 24 lsrs r4, 24 movs r0, 0 @@ -2261,77 +2261,77 @@ pokemon_calc_effective_stats: @ 8068D0C adds r5, r0, 0 movs r1, 0x3A movs r2, 0 - bl pokemon_getattr + bl GetMonData mov r8, r0 adds r0, r5, 0 movs r1, 0x39 movs r2, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x1C] adds r0, r5, 0 movs r1, 0x27 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r6, r0, 0 adds r0, r5, 0 movs r1, 0x1A movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 adds r0, r5, 0 movs r1, 0x28 movs r2, 0 - bl pokemon_getattr + bl GetMonData mov r10, r0 adds r0, r5, 0 movs r1, 0x1B movs r2, 0 - bl pokemon_getattr + bl GetMonData mov r9, r0 adds r0, r5, 0 movs r1, 0x29 movs r2, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x20] adds r0, r5, 0 movs r1, 0x1C movs r2, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x24] adds r0, r5, 0 movs r1, 0x2A movs r2, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x28] adds r0, r5, 0 movs r1, 0x1D movs r2, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x2C] adds r0, r5, 0 movs r1, 0x2B movs r2, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x30] adds r0, r5, 0 movs r1, 0x1E movs r2, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x34] adds r0, r5, 0 movs r1, 0x2C movs r2, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x38] adds r0, r5, 0 movs r1, 0x1F movs r2, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x3C] adds r0, r5, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r7, r0, 16 adds r0, r5, 0 @@ -2644,14 +2644,14 @@ level_by_exp: @ 8069054 adds r5, r0, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0x19 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r3, r0, 0 movs r2, 0x1 ldr r6, =gExperienceTables @@ -3020,14 +3020,14 @@ sub_8069318: @ 8069318 mov r0, r8 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 mov r9, r0 mov r0, r8 movs r1, 0x38 movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r0, 24 mov r10, r0 @@ -3154,13 +3154,13 @@ _08069440: adds r1, 0xE adds r0, r6, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r5] adds r1, r4, 0 adds r1, 0x12 adds r0, r6, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r7, r4 strb r0, [r1] adds r5, 0x2 @@ -3170,7 +3170,7 @@ _08069440: adds r0, r6, 0 movs r1, 0x15 movs r2, 0 - bl pokemon_getattr + bl GetMonData mov r1, r9 strb r0, [r1] ldrb r0, [r1] diff --git a/asm/pokemon_2.s b/asm/pokemon_2.s index 802df7092..c7d017580 100644 --- a/asm/pokemon_2.s +++ b/asm/pokemon_2.s @@ -28,7 +28,7 @@ _08069E0A: ldr r0, =gUnknown_02024064 ldrb r3, [r0] ldr r4, =gUnknown_02024210 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable _08069E14: cmp r5, r3 beq _08069E28 @@ -63,7 +63,7 @@ _08069E42: bne _08069E74 ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] @@ -86,7 +86,7 @@ _08069E8A: lsrs r0, 24 bl battle_side_get_owner adds r4, r0, 0 - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] bl battle_side_get_owner lsls r4, 24 @@ -95,7 +95,7 @@ _08069E8A: bne _08069EBC ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] @@ -124,7 +124,7 @@ sub_8069ED8: @ 8069ED8 lsrs r5, r0, 16 lsls r1, 24 lsrs r2, r1, 24 - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags ldr r0, [r4] ldr r1, =0x023f0902 ands r0, r1 @@ -176,7 +176,7 @@ sub_8069F34: @ 8069F34 ands r4, r0 eors r4, r1 adds r5, r4, 0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ands r0, r6 cmp r0, 0 @@ -191,7 +191,7 @@ _08069F5C: lsrs r0, 24 cmp r0, 0x1 bls _08069F80 - bl GenerateRandomNumber + bl Random adds r1, r6, 0 ands r1, r0 cmp r1, 0 @@ -205,7 +205,7 @@ _08069F7C: _08069F80: ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r4, 2 adds r0, r2 ldr r0, [r0] @@ -982,9 +982,9 @@ _0806A510: bx r1 thumb_func_end pokemon_data_permutator - thumb_func_start pokemon_getattr -@ int pokemon_getattr(pokemon *mon, enum pokemon_data_request req, void *data) -pokemon_getattr: @ 806A518 + thumb_func_start GetMonData +@ int GetMonData(pokemon *mon, enum pokemon_data_request req, void *data) +GetMonData: @ 806A518 push {r4,lr} adds r4, r0, 0 adds r3, r1, 0 @@ -1137,7 +1137,7 @@ _0806A66E: pop {r4} pop {r1} bx r1 - thumb_func_end pokemon_getattr + thumb_func_end GetMonData thumb_func_start pokemon_getattr_encrypted @ int pokemon_getattr_encrypted(pokemon *mon, enum pokemon_data_request req, void *data) @@ -1340,9 +1340,9 @@ _0806A89C: beq _0806A8BC ldr r1, =gUnknown_085E8264 adds r0, r6, 0 - bl CopyString + bl StringCopy adds r0, r6, 0 - bl GetStringLength + bl StringLength lsls r0, 16 lsrs r4, r0, 16 b _0806AC8C @@ -1748,7 +1748,7 @@ _0806AB34: ldrh r5, [r2] adds r7, r1, 0 adds r2, r6, 0 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable _0806AB3E: ldrh r3, [r2] cmp r5, r3 @@ -2879,7 +2879,7 @@ memcpy_pokemon: @ 806B408 pokemon_catch: @ 806B414 push {r4-r6,lr} adds r6, r0, 0 - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r2, [r4] movs r1, 0x7 bl pokemon_setattr @@ -2904,12 +2904,12 @@ _0806B446: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0806B444 adds r0, r4, 0 @@ -3032,11 +3032,11 @@ _0806B554: adds r1, r0, 0 movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0806B54C _0806B572: @@ -3069,11 +3069,11 @@ _0806B598: adds r1, r0, 0 movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0806B590 _0806B5B6: @@ -3101,12 +3101,12 @@ _0806B5DC: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x41 movs r2, 0 - bl pokemon_getattr + bl GetMonData movs r1, 0xCE lsls r1, 1 cmp r0, r1 @@ -3114,13 +3114,13 @@ _0806B5DC: adds r0, r4, 0 movs r1, 0x39 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0806B616 adds r0, r4, 0 movs r1, 0x41 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0806B616 adds r6, 0x1 @@ -3152,12 +3152,12 @@ _0806B63E: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x41 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 movs r0, 0xCE lsls r0, 1 @@ -3168,7 +3168,7 @@ _0806B63E: adds r0, r4, 0 movs r1, 0x39 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0806B670 adds r6, 0x1 @@ -3233,14 +3233,14 @@ GetMonAbility: @ 806B6D8 adds r5, r0, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0x2E movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -3288,7 +3288,7 @@ _0806B730: movs r0, 0x64 mov r6, r9 muls r6, r0 - ldr r4, =gUnknown_02024744 + ldr r4, =gEnemyParty mov r8, r4 adds r5, r6, r4 ldrh r1, [r1] @@ -3342,7 +3342,7 @@ _0806B7A0: movs r3, 0x64 mov r0, r9 muls r0, r3 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r7, r0, r1 mov r4, r10 lsls r0, r4, 1 @@ -3459,11 +3459,11 @@ sub_806B8B0: @ 806B8B0 _0806B8B4: movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0806B8D0 movs r0, 0 @@ -3604,7 +3604,7 @@ sub_806B9A8: @ 806B9A8 lsrs r4, 24 movs r1, 0x15 movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r0, 24 mov r1, sp @@ -3658,13 +3658,13 @@ battle_data_fill: @ 806B9FC movs r0, 0x64 mov r5, r9 muls r5, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r0 adds r0, r5, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr - ldr r1, =gUnknown_02024084 + bl GetMonData + ldr r1, =gBattleMons mov r8, r1 movs r1, 0x58 ldr r2, [sp, 0x14] @@ -3676,7 +3676,7 @@ battle_data_fill: @ 806B9FC adds r0, r5, 0 movs r1, 0xC movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r6, 0x2E] movs r6, 0 mov r0, r8 @@ -3687,7 +3687,7 @@ _0806BA4E: adds r1, 0xD adds r0, r5, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData movs r1, 0xC add r1, r8 mov r10, r1 @@ -3697,7 +3697,7 @@ _0806BA4E: adds r1, 0x11 adds r0, r5, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData strb r0, [r7] adds r7, 0x1 adds r4, 0x2 @@ -3707,12 +3707,12 @@ _0806BA4E: movs r0, 0x64 mov r4, r9 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x15 movs r2, 0 - bl pokemon_getattr + bl GetMonData movs r2, 0xC negs r2, r2 add r2, r10 @@ -3728,14 +3728,14 @@ _0806BA4E: adds r0, r4, 0 movs r1, 0x20 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r7, 0 adds r1, 0x2B strb r0, [r1] adds r0, r4, 0 movs r1, 0x19 movs r2, 0 - bl pokemon_getattr + bl GetMonData mov r1, r10 adds r1, 0x38 adds r1, r5, r1 @@ -3743,7 +3743,7 @@ _0806BA4E: adds r0, r4, 0 movs r1, 0x27 movs r2, 0 - bl pokemon_getattr + bl GetMonData movs r6, 0x1F ands r0, r6 ldrb r2, [r7, 0x14] @@ -3755,7 +3755,7 @@ _0806BA4E: adds r0, r4, 0 movs r1, 0x28 movs r2, 0 - bl pokemon_getattr + bl GetMonData movs r1, 0x1F mov r8, r1 mov r2, r8 @@ -3769,7 +3769,7 @@ _0806BA4E: adds r0, r4, 0 movs r1, 0x29 movs r2, 0 - bl pokemon_getattr + bl GetMonData ands r0, r6 lsls r0, 2 ldrb r2, [r7, 0x15] @@ -3781,7 +3781,7 @@ _0806BA4E: adds r0, r4, 0 movs r1, 0x2A movs r2, 0 - bl pokemon_getattr + bl GetMonData movs r1, 0x1F ands r1, r0 lsls r1, 15 @@ -3793,7 +3793,7 @@ _0806BA4E: adds r0, r4, 0 movs r1, 0x2B movs r2, 0 - bl pokemon_getattr + bl GetMonData mov r3, r8 ands r0, r3 lsls r0, 4 @@ -3805,7 +3805,7 @@ _0806BA4E: adds r0, r4, 0 movs r1, 0x2C movs r2, 0 - bl pokemon_getattr + bl GetMonData ands r0, r6 lsls r0, 1 ldrb r2, [r7, 0x17] @@ -3817,7 +3817,7 @@ _0806BA4E: adds r0, r4, 0 movs r1, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData mov r1, r10 adds r1, 0x3C adds r1, r5, r1 @@ -3825,7 +3825,7 @@ _0806BA4E: adds r0, r4, 0 movs r1, 0x37 movs r2, 0 - bl pokemon_getattr + bl GetMonData mov r1, r10 adds r1, 0x40 adds r1, r5, r1 @@ -3833,49 +3833,49 @@ _0806BA4E: adds r0, r4, 0 movs r1, 0x38 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r7, 0 adds r1, 0x2A strb r0, [r1] adds r0, r4, 0 movs r1, 0x39 movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r7, 0x28] adds r0, r4, 0 movs r1, 0x3A movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r7, 0x2C] adds r0, r4, 0 movs r1, 0x3B movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r7, 0x2] adds r0, r4, 0 movs r1, 0x3C movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r7, 0x4] adds r0, r4, 0 movs r1, 0x3D movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r7, 0x6] adds r0, r4, 0 movs r1, 0x3E movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r7, 0x8] adds r0, r4, 0 movs r1, 0x3F movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r7, 0xA] adds r0, r4, 0 movs r1, 0x2D movs r2, 0 - bl pokemon_getattr + bl GetMonData movs r1, 0x1 ands r0, r1 lsls r0, 6 @@ -3888,7 +3888,7 @@ _0806BA4E: adds r0, r4, 0 movs r1, 0x2E movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 7 ldrb r2, [r7, 0x17] movs r1, 0x7F @@ -3898,7 +3898,7 @@ _0806BA4E: adds r0, r4, 0 movs r1, 0x1 movs r2, 0 - bl pokemon_getattr + bl GetMonData mov r1, r10 adds r1, 0x48 adds r1, r5, r1 @@ -3932,18 +3932,18 @@ _0806BA4E: adds r0, r4, 0 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData mov r0, r10 adds r0, 0x24 adds r0, r5, r0 mov r1, sp - bl CopyString_Limit10 + bl StringCopy10 mov r2, r10 adds r2, 0x30 adds r2, r5, r2 adds r0, r4, 0 movs r1, 0x7 - bl pokemon_getattr + bl GetMonData ldr r0, [sp, 0x14] bl battle_side_get_owner ldr r1, =gUnknown_0202449C diff --git a/asm/rom_806BD04.s b/asm/pokemon_3.s similarity index 96% rename from asm/rom_806BD04.s rename to asm/pokemon_3.s index b9c42a231..ec4cc0050 100644 --- a/asm/rom_806BD04.s +++ b/asm/pokemon_3.s @@ -62,12 +62,12 @@ ExecuteTableBasedItemEffect: @ 806BD28 str r5, [sp, 0x3C] mov r0, r8 movs r1, 0xC - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 cmp r0, 0xAF bne _0806BDBC - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -86,7 +86,7 @@ ExecuteTableBasedItemEffect: @ 806BD28 b _0806BDC4 .pool _0806BDA8: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00003226 adds r0, r2 @@ -103,7 +103,7 @@ _0806BDC4: ldr r0, =gUnknown_020244B8 ldrb r2, [r0] strb r2, [r1] - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r3, =0x00000439 adds r0, r3 ldrb r1, [r0] @@ -191,7 +191,7 @@ _0806BE94: cmp r1, 0xAF bne _0806BEF6 _0806BE9A: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r2, =0x00000439 adds r0, r2 ldrb r1, [r0] @@ -209,7 +209,7 @@ _0806BE9A: b _0806BEF6 .pool _0806BECC: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r3, =0x00003214 adds r3, r0, r3 @@ -261,7 +261,7 @@ _0806BF2C: adds r6, r2, 0 cmp r0, 0 beq _0806BF76 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r5, =0x00000439 adds r0, r5 ldrb r1, [r0] @@ -272,7 +272,7 @@ _0806BF2C: ldr r0, [sp, 0x38] cmp r0, 0x4 beq _0806BF76 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 ldr r2, [sp, 0x38] muls r0, r2 @@ -295,7 +295,7 @@ _0806BF76: ands r0, r1 cmp r0, 0 beq _0806BFA4 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_02024064 ldrb r2, [r0] movs r0, 0x58 @@ -321,7 +321,7 @@ _0806BFA4: bne _0806BFB2 bl _0806CD4C _0806BFB2: - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldr r5, =gUnknown_02024064 ldrb r0, [r5] movs r4, 0x58 @@ -360,7 +360,7 @@ _0806BFFC: adds r6, r2, 0 cmp r3, 0 beq _0806C042 - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldr r5, =gUnknown_02024064 ldrb r0, [r5] movs r4, 0x58 @@ -394,7 +394,7 @@ _0806C042: bne _0806C050 bl _0806CD4C _0806C050: - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldr r5, =gUnknown_02024064 ldrb r0, [r5] movs r4, 0x58 @@ -431,7 +431,7 @@ _0806C08C: adds r6, r2, 0 cmp r3, 0 beq _0806C0D2 - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldr r5, =gUnknown_02024064 ldrb r0, [r5] movs r4, 0x58 @@ -465,7 +465,7 @@ _0806C0D2: bne _0806C0E0 bl _0806CD4C _0806C0E0: - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldr r5, =gUnknown_02024064 ldrb r0, [r5] movs r4, 0x58 @@ -538,19 +538,19 @@ _0806C168: mov r0, r8 movs r1, 0x38 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0x64 beq _0806C1CA ldr r5, =gExperienceTables mov r0, r8 movs r1, 0x38 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 mov r0, r8 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, 0x1 lsls r4, 2 ldr r2, =gBaseStats @@ -591,7 +591,7 @@ _0806C1CA: ldr r1, [sp, 0x38] cmp r1, 0x4 beq _0806C202 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 ldr r3, [sp, 0x38] adds r2, r3, 0 @@ -677,7 +677,7 @@ _0806C286: bne _0806C294 bl _0806CD4C _0806C294: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r5, =0x00000439 adds r0, r5 ldrb r1, [r0] @@ -692,7 +692,7 @@ _0806C2A8: bne _0806C2B2 bl _0806CD4C _0806C2B2: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 ldr r2, [sp, 0x38] muls r0, r2 @@ -730,7 +730,7 @@ _0806C300: mov r0, r8 movs r1, 0x15 movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r1, =gUnknown_08329D22 ldr r3, [sp, 0x14] adds r1, r3, r1 @@ -744,14 +744,14 @@ _0806C300: mov r0, r8 adds r1, r5, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 mov r0, r8 movs r1, 0x15 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -770,7 +770,7 @@ _0806C300: mov r0, r8 movs r1, 0x15 movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r1, =gUnknown_08329D2A ldr r2, [sp, 0x14] adds r1, r2, r1 @@ -784,7 +784,7 @@ _0806C300: mov r0, r8 adds r1, r5, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 ldr r1, [sp] @@ -802,7 +802,7 @@ _0806C300: mov r0, r8 adds r1, r4, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r1, [sp] adds r0, r1 str r0, [sp] @@ -863,7 +863,7 @@ _0806C430: ldrb r1, [r0] mov r0, r8 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 str r1, [sp, 0x4] lsls r0, r5, 24 @@ -944,7 +944,7 @@ _0806C4DC: mov r0, r8 movs r1, 0x39 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0806C4FC ldr r0, [sp, 0x28] @@ -952,7 +952,7 @@ _0806C4DC: lsls r0, 24 b _0806C83E _0806C4FC: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r2, =0x00000439 adds r0, r2 ldrb r1, [r0] @@ -965,7 +965,7 @@ _0806C4FC: cmp r3, 0x4 beq _0806C55C ldr r2, =gUnknown_02024210 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable lsls r0, r3, 2 adds r0, r1 ldr r1, [r0] @@ -988,7 +988,7 @@ _0806C4FC: .pool _0806C55C: ldr r3, =gUnknown_02024210 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r2, =gUnknown_02024064 ldrb r0, [r2] eors r0, r4 @@ -1016,7 +1016,7 @@ _0806C59C: mov r0, r8 movs r1, 0x39 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0806C5B2 ldr r0, [sp, 0x28] @@ -1047,12 +1047,12 @@ _0806C5D4: mov r0, r8 movs r1, 0x3A movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 mov r0, r8 movs r1, 0x39 movs r2, 0 - bl pokemon_getattr + bl GetMonData subs r4, r0 str r4, [sp] b _0806C612 @@ -1060,7 +1060,7 @@ _0806C5F4: mov r0, r8 movs r1, 0x3A movs r2, 0 - bl pokemon_getattr + bl GetMonData lsrs r0, 1 str r0, [sp] cmp r0, 0 @@ -1077,12 +1077,12 @@ _0806C612: mov r0, r8 movs r1, 0x3A movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 mov r0, r8 movs r1, 0x39 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r4, r0 beq _0806C6F0 ldr r0, [sp, 0x18] @@ -1091,28 +1091,28 @@ _0806C612: mov r0, r8 movs r1, 0x39 movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r1, [sp] adds r0, r1 str r0, [sp] mov r0, r8 movs r1, 0x3A movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r1, [sp] cmp r1, r0 bls _0806C65E mov r0, r8 movs r1, 0x3A movs r2, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp] _0806C65E: mov r0, r8 movs r1, 0x39 mov r2, sp bl pokemon_setattr - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -1123,7 +1123,7 @@ _0806C65E: ldr r2, [sp, 0x38] cmp r2, 0x4 beq _0806C6EC - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r2 adds r0, r1 @@ -1161,7 +1161,7 @@ _0806C6AE: b _0806C6EC .pool _0806C6E4: - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage ldr r0, [sp] negs r0, r0 str r0, [r1] @@ -1194,21 +1194,21 @@ _0806C714: mov r0, r8 mov r1, r9 movs r2, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp] adds r7, r5, 0 adds r7, 0xD mov r0, r8 adds r1, r7, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 mov r0, r8 movs r1, 0x15 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -1231,14 +1231,14 @@ _0806C714: mov r0, r8 adds r1, r7, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 mov r0, r8 movs r1, 0x15 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -1253,14 +1253,14 @@ _0806C714: mov r0, r8 adds r1, r7, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 mov r0, r8 movs r1, 0x15 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -1275,7 +1275,7 @@ _0806C7CC: mov r1, r9 mov r2, sp bl pokemon_setattr - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -1286,7 +1286,7 @@ _0806C7CC: ldr r2, [sp, 0x38] cmp r2, 0x4 beq _0806C82E - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons movs r0, 0x58 adds r3, r2, 0 muls r3, r0 @@ -1306,7 +1306,7 @@ _0806C7CC: adds r0, r1 ldrb r1, [r0, 0x18] lsrs r1, 4 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] @@ -1341,21 +1341,21 @@ _0806C858: mov r0, r8 adds r1, r6, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp] ldr r5, [sp, 0x14] adds r5, 0xD mov r0, r8 adds r1, r5, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 mov r0, r8 movs r1, 0x15 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -1382,14 +1382,14 @@ _0806C8A0: mov r0, r8 adds r1, r5, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 mov r0, r8 movs r1, 0x15 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -1404,14 +1404,14 @@ _0806C8A0: mov r0, r8 adds r1, r5, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 mov r0, r8 movs r1, 0x15 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -1426,7 +1426,7 @@ _0806C914: adds r1, r6, 0 mov r2, sp bl pokemon_setattr - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -1437,7 +1437,7 @@ _0806C914: ldr r2, [sp, 0x38] cmp r2, 0x4 beq _0806C978 - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons movs r0, 0x58 adds r3, r2, 0 muls r3, r0 @@ -1457,7 +1457,7 @@ _0806C914: adds r0, r1 ldrb r1, [r0, 0x18] lsrs r1, 4 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldr r5, [sp, 0x14] lsls r0, r5, 2 adds r0, r2 @@ -1555,7 +1555,7 @@ _0806CA18: ldrb r1, [r0] mov r0, r8 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 str r1, [sp, 0x4] lsls r0, r5, 24 @@ -1624,7 +1624,7 @@ _0806CAB8: mov r0, r8 movs r1, 0x15 movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r1, =gUnknown_08329D22 ldr r5, [sp, 0x14] adds r1, r5, r1 @@ -1638,14 +1638,14 @@ _0806CAB8: mov r0, r8 adds r1, r6, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 mov r0, r8 movs r1, 0x15 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -1666,7 +1666,7 @@ _0806CB10: mov r0, r8 movs r1, 0x15 movs r2, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp] ldr r1, =gUnknown_08329D26 ldr r2, [sp, 0x14] @@ -1689,7 +1689,7 @@ _0806CB10: mov r0, r8 adds r1, r6, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 ldr r1, [sp] @@ -1706,7 +1706,7 @@ _0806CB10: mov r0, r8 adds r1, r4, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r1, [sp] adds r0, r1 str r0, [sp] @@ -1722,7 +1722,7 @@ _0806CB94: mov r0, r8 movs r1, 0x20 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0x63 bls _0806CBA4 b _0806CD30 @@ -1754,7 +1754,7 @@ _0806CBC6: mov r0, r8 movs r1, 0x20 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r5, r0, 0 str r5, [sp, 0x8] ldr r0, [sp, 0x30] @@ -1777,7 +1777,7 @@ _0806CC00: mov r0, r8 movs r1, 0x20 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0x63 bhi _0806CC10 b _0806CD30 @@ -1785,7 +1785,7 @@ _0806CC10: mov r0, r8 movs r1, 0x20 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0xC7 bls _0806CC20 b _0806CD30 @@ -1813,7 +1813,7 @@ _0806CC2E: mov r0, r8 movs r1, 0x20 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 str r4, [sp, 0x8] ldr r0, [sp, 0x30] @@ -1829,7 +1829,7 @@ _0806CC68: mov r0, r8 movs r1, 0x20 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0xC7 bls _0806CD30 ldr r0, [sp, 0x20] @@ -1854,7 +1854,7 @@ _0806CC82: mov r0, r8 movs r1, 0x20 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 str r4, [sp, 0x8] ldr r0, [sp, 0x30] @@ -1887,7 +1887,7 @@ _0806CCD8: mov r0, r8 movs r1, 0x26 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0xB bne _0806CCF0 ldr r0, [sp, 0x8] @@ -1897,7 +1897,7 @@ _0806CCF0: mov r0, r8 movs r1, 0x23 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 bl sav1_map_get_name lsls r0, 24 @@ -1973,7 +1973,7 @@ HealStatusConditions: @ 806CD6C lsrs r6, r3, 24 movs r1, 0x37 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 str r1, [sp] ands r0, r4 @@ -1986,7 +1986,7 @@ HealStatusConditions: @ 806CD6C movs r1, 0x37 mov r2, sp bl pokemon_setattr - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -1996,7 +1996,7 @@ HealStatusConditions: @ 806CD6C beq _0806CDBE cmp r6, 0x4 beq _0806CDBE - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons movs r1, 0x58 muls r1, r6 adds r0, 0x4C @@ -2199,7 +2199,7 @@ _0806CF1C: thumb_func_start sub_806CF24 sub_806CF24: @ 806CF24 push {lr} - ldr r2, =gUnknown_0202420C + ldr r2, =gEnemyMonIndex ldr r1, =gUnknown_020244B8 ldrb r1, [r1] strb r1, [r2] @@ -2212,10 +2212,10 @@ sub_806CF24: @ 806CF24 adds r0, r2 ldr r1, [r0] adds r0, r3, 0 - bl CopyString + bl StringCopy ldr r0, =gUnknown_02022F68 ldr r1, =gUnknown_085CB38A - bl CopyString + bl StringCopy ldr r0, =gUnknown_085CB3AA bl get_battle_strings_ pop {r0} @@ -2232,7 +2232,7 @@ sub_806CF78: @ 806CF78 lsrs r0, 16 cmp r0, 0xAF bne _0806CFCC - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -2250,7 +2250,7 @@ sub_806CF78: @ 806CF78 b _0806CFD8 .pool _0806CFB8: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003214 adds r7, r0, r1 @@ -2332,7 +2332,7 @@ GetNature: @ 806D070 push {lr} movs r1, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData movs r1, 0x19 bl __umodsi3 lsls r0, 24 @@ -2372,24 +2372,24 @@ GetEvolutionTargetSpecies: @ 806D098 mov r0, r8 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r7, r0, 16 mov r0, r8 movs r1, 0xC movs r2, 0 - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1] mov r0, r8 movs r1, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 mov r0, r8 movs r1, 0x17 movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r0, 24 str r0, [sp, 0xC] @@ -2399,7 +2399,7 @@ GetEvolutionTargetSpecies: @ 806D098 ldrh r0, [r0] cmp r0, 0xAF bne _0806D10C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003226 adds r0, r1 @@ -2442,14 +2442,14 @@ _0806D144: mov r0, r8 movs r1, 0x38 movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r0, 24 mov r9, r0 mov r0, r8 movs r1, 0x20 movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x8] @@ -2567,12 +2567,12 @@ _0806D248: mov r0, r8 movs r1, 0x3B movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 mov r0, r8 movs r1, 0x3C movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r4, r0 bls _0806D332 b _0806D2C4 @@ -2587,12 +2587,12 @@ _0806D272: mov r0, r8 movs r1, 0x3B movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 mov r0, r8 movs r1, 0x3C movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r4, r0 bne _0806D332 b _0806D2C4 @@ -2607,12 +2607,12 @@ _0806D29C: mov r0, r8 movs r1, 0x3B movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 mov r0, r8 movs r1, 0x3C movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r4, r0 bcs _0806D332 _0806D2C4: @@ -3282,17 +3282,17 @@ sub_806D778: @ 806D778 lsls r2, 16 lsrs r2, 16 mov r8, r2 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 mov r9, r0 adds r0, r5, 0 movs r1, 0x2 mov r2, r9 - bl pokemon_getattr + bl GetMonData mov r4, sp adds r0, r5, 0 movs r1, 0x3 mov r2, sp - bl pokemon_getattr + bl GetMonData strb r0, [r4] lsls r0, 24 lsrs r0, 24 @@ -3304,7 +3304,7 @@ sub_806D778: @ 806D778 ldr r4, =gSpeciesNames adds r0, r4 mov r1, r9 - bl CompareString + bl StringCompare cmp r0, 0 bne _0806D7D4 mov r2, r8 @@ -3530,18 +3530,18 @@ _0806D94A: adds r0, r7, 0 movs r1, 0x41 movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r6, r0, 16 adds r0, r7, 0 movs r1, 0xC movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 cmp r0, 0xAF bne _0806D9A0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -3554,7 +3554,7 @@ _0806D94A: b _0806D9A8 .pool _0806D98C: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003226 adds r0, r1 @@ -3580,7 +3580,7 @@ _0806D9B8: adds r0, r7, 0 movs r1, 0x20 movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 mov r1, sp @@ -3599,7 +3599,7 @@ _0806D9D6: _0806D9E0: cmp r5, 0x5 bne _0806D9F0 - bl GenerateRandomNumber + bl Random movs r1, 0x1 ands r1, r0 cmp r1, 0 @@ -3607,7 +3607,7 @@ _0806D9E0: _0806D9F0: cmp r5, 0x3 bne _0806DA20 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x8 ands r0, r1 @@ -3662,7 +3662,7 @@ _0806DA46: adds r0, r7, 0 movs r1, 0x26 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0xB bne _0806DA74 mov r0, sp @@ -3675,7 +3675,7 @@ _0806DA74: adds r0, r7, 0 movs r1, 0x23 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 bl sav1_map_get_name lsls r0, 24 @@ -3736,7 +3736,7 @@ _0806DAF0: adds r1, 0x1A mov r0, r8 movs r2, 0 - bl pokemon_getattr + bl GetMonData mov r2, sp adds r1, r2, r6 strb r0, [r1] @@ -3842,12 +3842,12 @@ _0806DBC8: mov r0, r8 movs r1, 0xC movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 cmp r0, 0xAF bne _0806DC14 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -3860,7 +3860,7 @@ _0806DBC8: b _0806DC1C .pool _0806DC00: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00003226 adds r0, r2 @@ -3943,7 +3943,7 @@ _0806DC94: adds r1, 0x1A adds r0, r6, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r0, r5, r0 lsls r0, 16 lsrs r5, r0, 16 @@ -3961,7 +3961,7 @@ sub_806DCB4: @ 806DCB4 push {r4-r6,lr} sub sp, 0x4 adds r6, r0, 0 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r5, r0, 16 movs r0, 0x80 @@ -3977,7 +3977,7 @@ sub_806DCB4: @ 806DCB4 cmp r5, r0 bne _0806DD70 _0806DCDA: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x6 @@ -3990,16 +3990,16 @@ _0806DCDA: adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0806DCDA adds r0, r4, 0 movs r1, 0x2D movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0806DCDA - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable lsls r0, r5, 2 adds r0, r1 ldrb r1, [r0] @@ -4010,7 +4010,7 @@ _0806DCDA: bne _0806DD70 movs r4, 0x7 _0806DD24: - bl GenerateRandomNumber + bl Random lsls r0, 24 lsrs r0, 24 mov r1, sp @@ -4078,7 +4078,7 @@ _0806DD90: movs r1, 0x22 movs r2, 0 str r3, [sp] - bl pokemon_getattr + bl GetMonData movs r1, 0xF ands r1, r0 ldr r3, [sp] @@ -4098,7 +4098,7 @@ _0806DDC4: adds r0, r7, 0 movs r1, 0x22 movs r2, 0 - bl pokemon_getattr + bl GetMonData movs r1, 0xF ands r1, r0 cmp r1, 0 @@ -4135,7 +4135,7 @@ _0806DDF8: movs r1, 0x22 movs r2, 0 str r3, [sp] - bl pokemon_getattr + bl GetMonData ldr r3, [sp] cmp r0, 0 beq _0806DE1C @@ -4153,7 +4153,7 @@ _0806DE28: adds r0, r7, 0 movs r1, 0x22 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0806DE38 movs r5, 0x1 @@ -4177,18 +4177,18 @@ _0806DE50: movs r0, 0x64 adds r1, r6, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0806DEB2 adds r0, r4, 0 movs r1, 0x22 movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r0, 24 strb r0, [r5] @@ -4218,7 +4218,7 @@ _0806DE96: _0806DEA2: movs r0, 0x64 muls r0, r6 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x22 mov r2, sp @@ -4239,7 +4239,7 @@ sub_806DEC4: @ 806DEC4 push {r4-r7,lr} sub sp, 0x4 adds r7, r0, 0 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -4256,13 +4256,13 @@ _0806DEE0: adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0806DF64 adds r0, r4, 0 movs r1, 0x22 movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r1, r0, 24 mov r0, sp @@ -4281,7 +4281,7 @@ _0806DEE0: adds r0, r4, 0 movs r1, 0x22 movs r2, 0 - bl pokemon_getattr + bl GetMonData movs r1, 0xF0 ands r1, r0 cmp r1, 0 @@ -4300,7 +4300,7 @@ _0806DF3A: adds r0, r4, 0 movs r1, 0x22 movs r2, 0 - bl pokemon_getattr + bl GetMonData movs r1, 0xF0 ands r1, r0 cmp r1, 0 @@ -4328,21 +4328,21 @@ sub_806DF74: @ 806DF74 adds r5, r0, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0x38 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r0, 0x1 mov r1, sp strb r0, [r1] adds r0, r5, 0 movs r1, 0x19 movs r2, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x4] ldr r6, =gExperienceTables ldr r2, =gBaseStats @@ -4404,7 +4404,7 @@ sub_806E00C: @ 806E00C adds r5, r4, 0 movs r1, 0x41 movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r1, r0, 16 adds r3, r1, 0 @@ -4504,13 +4504,13 @@ sub_806E0B4: @ 806E0B4 adds r0, r6, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r7, r0, 16 adds r0, r6, 0 movs r1, 0x38 movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r0, 24 str r0, [sp, 0xC] @@ -4521,7 +4521,7 @@ _0806E0EA: adds r1, 0xD adds r0, r6, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r4] adds r4, 0x2 adds r5, 0x1 @@ -4719,13 +4719,13 @@ sub_806E25C: @ 806E25C adds r0, r6, 0 movs r1, 0x41 movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 adds r0, r6, 0 movs r1, 0x38 movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x30] @@ -4745,7 +4745,7 @@ _0806E2A0: adds r1, 0xD adds r0, r6, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r4] adds r4, 0x2 adds r5, 0x1 @@ -4956,7 +4956,7 @@ _0806E41C: thumb_func_start song_id_for_battle song_id_for_battle: @ 806E42C push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 5 @@ -5110,7 +5110,7 @@ _0806E5E0: lsls r0, 1 b _0806E646 _0806E5E6: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x003f0100 ands r0, r1 @@ -5129,7 +5129,7 @@ _0806E604: ldr r1, =gTrainers + 0x4 @ name offset adds r0, r1 ldr r1, =gUnknown_085CCB98 - bl CompareString + bl StringCompare cmp r0, 0 beq _0806E63C b _0806E5F2 @@ -5252,19 +5252,19 @@ pokemon_get_pal: @ 806E708 adds r5, r0, 0 movs r1, 0x41 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0x1 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r6, r0, 0 adds r0, r5, 0 movs r1, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r2, r0, 0 adds r0, r4, 0 adds r1, r6, 0 @@ -5323,19 +5323,19 @@ sub_806E794: @ 806E794 adds r5, r0, 0 movs r1, 0x41 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0x1 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r6, r0, 0 adds r0, r5, 0 movs r1, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r2, r0, 0 adds r0, r4, 0 adds r1, r6, 0 @@ -5472,11 +5472,11 @@ sub_806E8A8: @ 806E8A8 adds r4, r0, 0 movs r1, 0x7 mov r2, sp - bl pokemon_getattr + bl GetMonData adds r0, r4, 0 movs r1, 0x1 movs r2, 0 - bl pokemon_getattr + bl GetMonData mov r1, sp bl sub_806E8D4 lsls r0, 24 @@ -5491,7 +5491,7 @@ sub_806E8A8: @ 806E8A8 sub_806E8D4: @ 806E8D4 push {r4,r5,lr} adds r5, r1, 0 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r3, [r1] ldrb r2, [r3, 0xA] ldrb r1, [r3, 0xB] @@ -5654,7 +5654,7 @@ _0806E9F6: movs r0, 0xFF strb r0, [r4, 0x4] ldr r0, =gUnknown_085CB2A1 - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 bl get_battle_strings pop {r4,r5} pop {r0} @@ -5692,7 +5692,7 @@ sub_806EA68: @ 806EA68 push {r4-r7,lr} mov r7, r8 push {r7} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x00302008 ands r0, r1 @@ -5700,27 +5700,27 @@ sub_806EA68: @ 806EA68 beq _0806EA7C b _0806EB90 _0806EA7C: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 bl __umodsi3 lsls r0, 16 lsrs r6, r0, 16 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 movs r0, 0x2D mov r8, r0 movs r7, 0x5F - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5, 0 movs r1, 0x6 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0806EAC6 adds r0, r5, 0 @@ -5746,7 +5746,7 @@ _0806EAC6: beq _0806EB04 cmp r6, r7 bcc _0806EB90 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty lsls r2, 2 ldr r1, =gUnknown_08329EFE b _0806EB6C @@ -5756,12 +5756,12 @@ _0806EB04: bcc _0806EB90 cmp r6, r7 bcs _0806EB18 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty lsls r2, r4, 3 b _0806EB66 .pool _0806EB18: - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty lsls r2, r4, 3 subs r2, r4 lsls r2, 2 @@ -5783,7 +5783,7 @@ _0806EB2C: bne _0806EB5C cmp r3, 0 beq _0806EB5C - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty mov r2, r12 adds r2, 0xC adds r2, r5, r2 @@ -5794,7 +5794,7 @@ _0806EB5C: bcc _0806EB90 cmp r6, r7 bcs _0806EB80 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty _0806EB66: subs r2, r4 lsls r2, 2 @@ -5807,7 +5807,7 @@ _0806EB6E: b _0806EB90 .pool _0806EB80: - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty subs r2, r4 lsls r2, 2 ldr r1, =gBaseStats + 0xe @ item 2 offset @@ -5829,12 +5829,12 @@ sub_806EBA4: @ 806EBA4 adds r4, r0, 0 movs r1, 0x1 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r5, r0, 0 adds r0, r4, 0 movs r1, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 adds r0, r5, 0 bl sub_806EBD0 @@ -5871,7 +5871,7 @@ _0806EBEA: thumb_func_start sub_806EBF8 sub_806EBF8: @ 806EBF8 push {r4,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 15 @@ -5887,7 +5887,7 @@ sub_806EBF8: @ 806EBF8 b _0806EC64 .pool _0806EC28: - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 ldrh r1, [r2] adds r0, r4, 0 bl sub_8162E20 @@ -6000,7 +6000,7 @@ sub_806ECEC: @ 806ECEC ands r0, r1 cmp r0, 0 beq _0806ED30 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 @@ -6209,7 +6209,7 @@ sub_806EEB4: @ 806EEB4 ands r0, r1 cmp r0, 0 beq _0806EEE8 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 @@ -6423,7 +6423,7 @@ SetPokedexFlag: @ 806F01C lsrs r0, 16 cmp r0, 0xC9 bne _0806F05C - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] str r7, [r0, 0x1C] _0806F05C: @@ -6434,7 +6434,7 @@ _0806F05C: lsls r1, 17 cmp r0, r1 bne _0806F072 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] str r7, [r0, 0x20] _0806F072: @@ -6519,7 +6519,7 @@ _0806F0F8: thumb_func_start sub_806F104 sub_806F104: @ 806F104 push {lr} - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldr r1, =0x00000439 adds r0, r2, r1 ldrb r1, [r0] @@ -6527,7 +6527,7 @@ sub_806F104: @ 806F104 ands r0, r1 cmp r0, 0 beq _0806F122 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x003f0100 ands r0, r1 diff --git a/asm/porthole.s b/asm/porthole.s index bfca49844..a82ffc02f 100644 --- a/asm/porthole.s +++ b/asm/porthole.s @@ -60,7 +60,7 @@ sub_80FB5E8: @ 80FB5E8 ldr r0, =0x000040b4 bl GetVarPointer adds r7, r0, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r3, [r0] adds r6, r3, 0x4 movs r0, 0 @@ -92,7 +92,7 @@ _080FB62E: b _080FB6E2 .pool _080FB648: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] adds r0, r2, 0 ands r0, r1 @@ -262,7 +262,7 @@ sub_80FB7A4: @ 80FB7A4 movs r0, 0x80 lsls r0, 7 bl FlagSet - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x4 ldrsb r1, [r0, r1] diff --git a/asm/record_mixing.s b/asm/record_mixing.s index e8a9505c8..b5da0864f 100644 --- a/asm/record_mixing.s +++ b/asm/record_mixing.s @@ -19,7 +19,7 @@ sub_80E6BE8: @ 80E6BE8 sub_80E6BF8: @ 80E6BF8 push {r4,lr} ldr r2, =gUnknown_03001134 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r3, =0x00001a9c adds r0, r1, r3 @@ -44,7 +44,7 @@ sub_80E6BF8: @ 80E6BF8 ldr r0, =gUnknown_02039F9C str r0, [r2] ldr r2, =gUnknown_0300114C - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r4, =0x0000064c adds r3, r0, r4 @@ -621,7 +621,7 @@ _080E726C: bne _080E730A movs r0, 0x4 strh r0, [r5] - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _080E7296 @@ -664,7 +664,7 @@ _080E72C0: ldr r0, [r0] bl Free bl sub_808729C - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _080E72F8 @@ -855,7 +855,7 @@ _080E7464: bne _080E746E b _080E7566 _080E746E: - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 bl sub_80E7810 adds r1, r0, 0 lsls r1, 24 @@ -863,7 +863,7 @@ _080E746E: adds r0, r4, 0 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x5 b _080E7564 .pool @@ -1528,7 +1528,7 @@ _080E79CE: beq _080E79F2 adds r0, r4, 0 movs r1, 0x1 - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString _080E79F2: adds r6, 0x1 cmp r6, 0x3 @@ -1731,7 +1731,7 @@ sub_80E7B60: @ 80E7B60 lsls r2, 24 lsrs r2, 24 mov r9, r2 - bl GenerateRandomNumber2 + bl Random2 lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x38] @@ -1828,7 +1828,7 @@ _080E7C24: adds r4, r5, 0 adds r4, 0x24 adds r0, r4, 0 - bl GetStringLength + bl StringLength lsls r0, 16 lsrs r0, 16 cmp r0, 0x5 @@ -1838,7 +1838,7 @@ _080E7C24: .pool _080E7C54: adds r0, r4, 0 - bl StripExtendedControlCodes + bl StripExtCtrlCodes mov r4, r9 _080E7C5C: ldrh r1, [r5, 0x2C] @@ -1847,7 +1847,7 @@ _080E7C5C: bne _080E7C74 adds r0, r5, 0 adds r0, 0x2C - bl StripExtendedControlCodes + bl StripExtCtrlCodes movs r1, 0x1 b _080E7C76 .pool @@ -2094,7 +2094,7 @@ _080E7E30: cmp r1, 0 beq _080E7E48 _080E7E34: - bl GenerateRandomNumber2 + bl Random2 mov r1, r9 adds r2, r1, r5 lsls r0, 16 @@ -2215,7 +2215,7 @@ _080E7F1C: ldr r1, [sp, 0x2C] ldr r2, [sp, 0x44] adds r7, r1, r2 - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] movs r3, 0xC2 lsls r3, 6 @@ -2279,9 +2279,9 @@ sub_80E7F68: @ 80E7F68 ldr r0, =0x00004001 ldrh r1, [r4] bl VarSet - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_020229F0 - bl CopyString + bl StringCopy ldrh r1, [r4] ldr r0, =0x00000113 cmp r1, r0 @@ -2393,7 +2393,7 @@ _080E80C0: lsls r0, 24 cmp r0, 0 bne _080E810A - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _080E80E8 @@ -2458,7 +2458,7 @@ sub_80E8110: @ 80E8110 str r2, [sp, 0x4] mov r8, r2 movs r7, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr mov r9, r0 _080E8150: mov r1, r9 @@ -2538,12 +2538,12 @@ _080E81E0: add r1, r10 b _080E820E _080E81EC: - bl GenerateRandomNumber2 + bl Random2 lsls r0, 16 ldr r1, =0x33330000 cmp r0, r1 bls _080E8224 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB2 ldrb r0, [r0] @@ -2562,7 +2562,7 @@ _080E820E: b _080E824C .pool _080E8224: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB2 ldrb r0, [r0] @@ -2602,7 +2602,7 @@ sub_80E8260: @ 80E8260 sub sp, 0xC mov r8, r0 movs r6, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr mov r10, r0 _080E8274: movs r7, 0 @@ -2625,7 +2625,7 @@ _080E8286: mov r0, r10 ldr r1, [r0] adds r0, r6, 0 - bl CopyString + bl StringCopy adds r4, 0x10 adds r6, 0x10 adds r5, 0x10 @@ -2635,7 +2635,7 @@ _080E8286: mov r6, r9 cmp r6, 0x8 ble _080E8274 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr mov r10, r1 ldr r2, =0x00000ee1 str r2, [sp, 0x4] @@ -2672,13 +2672,13 @@ _080E82DA: mov r0, r10 ldr r1, [r0] mov r0, r9 - bl CopyString + bl StringCopy mov r2, r10 ldr r1, [r2] ldr r0, [sp, 0x4] adds r1, r0 adds r0, r4, 0 - bl CopyString + bl StringCopy ldr r1, [sp, 0x4] adds r1, 0x8 str r1, [sp, 0x4] @@ -2694,7 +2694,7 @@ _080E82DA: cmp r7, 0 bge _080E82DA movs r6, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] mov r4, r8 movs r1, 0xC4 @@ -2867,7 +2867,7 @@ _080E8496: ldrb r0, [r6] cmp r0, 0xFF beq _080E84B4 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r1, 0xDC adds r0, r4, 0 @@ -2891,7 +2891,7 @@ _080E84B4: b _080E8566 .pool _080E84CC: - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] adds r1, r0, 0 adds r1, 0xB2 @@ -2925,7 +2925,7 @@ _080E8508: _080E850C: movs r0, 0x1 eors r0, r5 - ldr r7, =gUnknown_03005D90 + ldr r7, =gSaveBlock2Ptr ldr r4, [r7] adds r1, r4, 0 adds r1, 0xB2 @@ -3035,7 +3035,7 @@ _080E85BE: _080E85DC: movs r6, 0 mov r8, r6 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r2, [sp, 0x10] lsls r0, r2, 5 @@ -3190,7 +3190,7 @@ _080E8702: ldr r5, [sp, 0x8] adds r5, 0x1 str r5, [sp, 0x2C] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] movs r0, 0x54 ldr r6, [sp, 0x8] @@ -3486,7 +3486,7 @@ sub_80E8924: @ 80E8924 push {r5-r7} mov r9, r0 movs r0, 0 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr mov r10, r1 _080E8936: lsls r1, r0, 1 @@ -3518,7 +3518,7 @@ _080E8950: cmp r0, 0x8 ble _080E8936 movs r5, 0 - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr _080E8972: movs r0, 0x54 adds r1, r5, 0 @@ -3588,7 +3588,7 @@ sub_80E89F8: @ 80E89F8 push {r4-r6,lr} adds r6, r0, 0 ldr r5, =gUnknown_02039F9C - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r1, [r4] movs r0, 0xC2 lsls r0, 6 @@ -3655,7 +3655,7 @@ _080E8A90: ldrb r1, [r7] lsrs r1, 4 adds r0, r4, 0 - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString _080E8A9A: adds r4, 0x38 movs r0, 0x38 @@ -3696,7 +3696,7 @@ _080E8AC6: beq _080E8ADC adds r0, r1, 0 adds r0, 0x20 - bl StripExtendedControlCodes + bl StripExtCtrlCodes _080E8ADC: adds r4, 0x1 cmp r4, 0x3 diff --git a/asm/region_map.s b/asm/region_map.s index 266daf1cb..52328cf8a 100644 --- a/asm/region_map.s +++ b/asm/region_map.s @@ -481,7 +481,7 @@ sub_81230C4: @ 81230C4 ldr r0, [r2] adds r0, 0x7C strb r4, [r0] - ldr r3, =gUnknown_030022C0 + ldr r3, =gMain ldrh r1, [r3, 0x2C] movs r0, 0x40 ands r0, r1 @@ -692,7 +692,7 @@ sub_8123254: @ 8123254 mov r5, r12 adds r5, 0x68 strh r4, [r5] - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2C] movs r0, 0x40 ands r0, r1 @@ -1522,7 +1522,7 @@ sub_81238AC: @ 81238AC mov r5, r8 push {r5-r7} sub sp, 0xC - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] movs r1, 0x4 ldrsb r1, [r2, r1] @@ -1581,7 +1581,7 @@ _08123928: ldrh r2, [r0] ldrh r0, [r0, 0x4] mov r9, r0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r6, [r0] ldrh r3, [r0, 0x2] @@ -1605,7 +1605,7 @@ _0812396C: ands r0, r1 cmp r0, 0 beq _081239C8 - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r1, [r4] adds r0, r1, 0 adds r0, 0x24 @@ -1653,7 +1653,7 @@ _081239C8: b _08123ABE .pool _081239E4: - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r1, [r4] movs r0, 0x14 ldrsb r0, [r1, r0] @@ -1690,7 +1690,7 @@ _08123A28: strh r1, [r0] cmp r1, 0x57 beq _08123A64 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] adds r7, r0, 0 adds r7, 0x24 @@ -1707,7 +1707,7 @@ _08123A28: b _08123A8A .pool _08123A64: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] adds r7, r0, 0 adds r7, 0x14 @@ -1831,7 +1831,7 @@ _08123B56: b _08123BC6 _08123B5E: movs r6, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] movs r2, 0 ldrsh r0, [r1, r2] @@ -2822,7 +2822,7 @@ sub_8124288: @ 8124288 b _081243A4 .pool _08124304: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0x1 @@ -3161,7 +3161,7 @@ _08124584: adds r1, r0 ldr r1, [r1] adds r0, r5, 0 - bl CopyString + bl StringCopy adds r1, r0, 0 b _081245B2 .pool @@ -3173,7 +3173,7 @@ _081245A6: adds r0, r5, 0 movs r1, 0 adds r2, r4, 0 - bl RepeatChar + bl StringFill b _081245D6 _081245B2: cmp r4, 0 @@ -3213,12 +3213,12 @@ sub_81245DC: @ 81245DC cmp r1, 0x57 bne _08124604 ldr r1, =gUnknown_085EC9D2 - bl CopyString + bl StringCopy b _0812460A .pool _081245F8: ldr r1, =gUnknown_085EC9D8 - bl CopyString + bl StringCopy b _0812460A .pool _08124604: @@ -3240,7 +3240,7 @@ sub_8124610: @ 8124610 b _08124626 _08124620: ldr r1, =gUnknown_085EC9E4 - bl CopyString + bl StringCopy _08124626: pop {r1} bx r1 @@ -3308,7 +3308,7 @@ _0812468C: sub_8124690: @ 8124690 push {r4,lr} sub sp, 0xC - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -3423,7 +3423,7 @@ _0812479C: adds r0, r1 movs r1, 0 movs r2, 0x10 - bl RepeatChar + bl StringFill ldr r1, =gUnknown_03001180 movs r0, 0x1 str r0, [r1] @@ -3498,7 +3498,7 @@ _0812486C: ldr r0, =sub_81248D4 bl SetMainCallback2 _0812489C: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -3589,7 +3589,7 @@ _08124926: lsls r0, 2 adds r0, r1 ldr r0, [r0] - bl GetStringLength + bl StringLength movs r7, 0x1 movs r0, 0 movs r1, 0 @@ -4207,7 +4207,7 @@ _08124E7C: bl sub_8084CCC b _08124EFA _08124E84: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] movs r1, 0xD diff --git a/asm/reset_rtc_screen.s b/asm/reset_rtc_screen.s index 83ad70e69..8edd73d7f 100644 --- a/asm/reset_rtc_screen.s +++ b/asm/reset_rtc_screen.s @@ -404,53 +404,53 @@ sub_809EBC4: @ 809EBC4 lsls r2, 24 lsrs r2, 24 mov r8, r2 - ldr r7, =gUnknown_02021FC4 - ldr r4, =gUnknown_02021CC4 + ldr r7, =gStringVar4 + ldr r4, =gStringVar1 adds r0, r4, 0 movs r2, 0x1 movs r3, 0x4 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r0, r7, 0 adds r1, r4, 0 - bl CopyString + bl StringCopy adds r7, r0, 0 ldr r1, =gUnknown_085EE68A - bl CopyString + bl StringCopy adds r7, r0, 0 adds r0, r4, 0 adds r1, r5, 0 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r0, r7, 0 adds r1, r4, 0 - bl CopyString + bl StringCopy adds r7, r0, 0 ldr r5, =gUnknown_085EE68E adds r1, r5, 0 - bl CopyString + bl StringCopy adds r7, r0, 0 adds r0, r4, 0 adds r1, r6, 0 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r0, r7, 0 adds r1, r4, 0 - bl CopyString + bl StringCopy adds r7, r0, 0 adds r1, r5, 0 - bl CopyString + bl StringCopy adds r7, r0, 0 adds r0, r4, 0 mov r1, r8 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r0, r7, 0 adds r1, r4, 0 - bl CopyString - ldr r2, =gUnknown_02021FC4 + bl StringCopy + ldr r2, =gStringVar4 mov r0, r9 str r0, [sp] movs r0, 0xFF @@ -657,7 +657,7 @@ sub_809EDE8: @ 809EDE8 lsls r0, 2 ldr r1, =gUnknown_0851041C adds r2, r0, r1 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldrh r3, [r1, 0x2E] movs r0, 0x2 ands r0, r3 @@ -1042,7 +1042,7 @@ _0809F11C: movs r1, 0x1 movs r3, 0 bl Print - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r0, r1, 0 adds r0, 0xA0 @@ -1073,7 +1073,7 @@ _0809F11C: adds r0, 0x1 strh r0, [r6] _0809F1B2: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -1081,7 +1081,7 @@ _0809F1B2: beq _0809F1E4 adds r0, r7, 0 bl DestroyTask - bl Reset + bl DoSoftReset b _0809F1F8 .pool _0809F1E4: @@ -1196,7 +1196,7 @@ _0809F2CA: ldr r0, =gUnknown_085ECA38 bl sub_809F0C0 ldr r2, =gUnknown_03005CF8 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xA0 ldr r1, [r0, 0x4] @@ -1250,7 +1250,7 @@ _0809F340: movs r3, 0x4 ldrsb r3, [r4, r3] bl GameFreakRTC_CalcRTCToLocalDelta - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] adds r2, 0xA0 ldr r0, [r4] @@ -1289,7 +1289,7 @@ _0809F3C4: movs r0, 0x5 strh r0, [r5] _0809F3C8: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -1315,7 +1315,7 @@ _0809F3EA: adds r0, r4, 0 bl DestroyTask bl FreeAllWindowBuffers - bl Reset + bl DoSoftReset _0809F404: add sp, 0x4 pop {r4,r5} diff --git a/asm/rng.s b/asm/rng.s deleted file mode 100644 index ff9f2657f..000000000 --- a/asm/rng.s +++ /dev/null @@ -1,65 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start GenerateRandomNumber -@ u16 GenerateRandomNumber() -GenerateRandomNumber: @ 806F5CC - ldr r2, =gUnknown_03005D80 - ldr r1, [r2] - ldr r0, =0x41c64e6d - muls r0, r1 - ldr r1, =0x00006073 - adds r0, r1 - str r0, [r2] - ldr r2, =gUnknown_020249C0 - ldr r1, [r2] - adds r1, 0x1 - str r1, [r2] - lsrs r0, 16 - bx lr - .pool - thumb_func_end GenerateRandomNumber - - thumb_func_start SeedRng -@ void SeedRng(u16 seed) -SeedRng: @ 806F5F8 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gUnknown_03005D80 - str r0, [r1] - ldr r1, =gUnknown_020249BC - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end SeedRng - - thumb_func_start SeedRng2 -SeedRng2: @ 806F610 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gUnknown_03005D84 - str r0, [r1] - bx lr - .pool - thumb_func_end SeedRng2 - - thumb_func_start GenerateRandomNumber2 -GenerateRandomNumber2: @ 806F620 - ldr r2, =gUnknown_03005D84 - ldr r1, [r2] - ldr r0, =0x41c64e6d - muls r0, r1 - ldr r1, =0x00006073 - adds r0, r1 - str r0, [r2] - lsrs r0, 16 - bx lr - .pool - thumb_func_end GenerateRandomNumber2 - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom3.s b/asm/rom3.s index 9596b9764..380f605a1 100644 --- a/asm/rom3.s +++ b/asm/rom3.s @@ -8,13 +8,13 @@ thumb_func_start battle_wireless_setup_if_required_maybe battle_wireless_setup_if_required_maybe: @ 8032654 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 cmp r0, 0 beq _08032686 - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _0803266E @@ -78,15 +78,15 @@ _080326B8: bl sub_80A3934 bl sub_806E414 movs r0, 0xF - bl sub_81308C8 - ldr r0, =gUnknown_02022FEC + bl BattleAI_HandleItemUseBeforeAISetup + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x10 ands r0, r1 cmp r0, 0 beq _08032728 bl zero_enemy_party_data - ldr r4, =gUnknown_02024744 + ldr r4, =gEnemyParty movs r1, 0x90 lsls r1, 1 str r5, [sp] @@ -117,7 +117,7 @@ _08032728: thumb_func_start sub_8032768 sub_8032768: @ 8032768 push {r4,r5,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -132,7 +132,7 @@ _08032784: movs r0, 0x2 bl sub_8184DA4 _0803278A: - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags ldr r0, [r4] movs r1, 0x80 lsls r1, 17 @@ -153,7 +153,7 @@ _080327B0: bl b_setup_bx _080327B4: bl sub_8033050 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -214,7 +214,7 @@ b_setup_bx: @ 8032824 mov r6, r9 mov r5, r8 push {r5-r7} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r3, [r0] movs r5, 0x80 lsls r5, 15 @@ -327,7 +327,7 @@ _08032934: ldr r2, =gUnknown_0202406C movs r7, 0x2 strb r7, [r2] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r3, [r0] movs r0, 0x80 lsls r0, 17 @@ -739,7 +739,7 @@ b_setup_bx_link: @ 8032CC0 mov r6, r9 mov r5, r8 push {r5-r7} - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags ldr r1, [r4] movs r5, 0x1 adds r3, r1, 0 @@ -1127,7 +1127,7 @@ sub_8033050: @ 8033050 mov r6, r9 mov r5, r8 push {r5-r7} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -1160,33 +1160,33 @@ _08033088: ands r0, r1 cmp r0, 0 bne _080330A8 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty b _080330AA .pool _080330A8: - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty _080330AA: adds r4, r7, r0 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08033170 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08033170 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData movs r1, 0xCE lsls r1, 1 cmp r0, r1 beq _08033170 adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _08033170 ldr r0, =gUnknown_0202406E @@ -1201,11 +1201,11 @@ _080330F0: ands r0, r1 cmp r0, 0 bne _08033118 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r7, r0 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08033170 adds r0, r4, 0 @@ -1213,29 +1213,29 @@ _080330F0: b _0803312C .pool _08033118: - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r7, r0 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08033170 adds r0, r4, 0 movs r1, 0x41 _0803312C: - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08033170 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData movs r1, 0xCE lsls r1, 1 cmp r0, r1 beq _08033170 adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _08033170 ldr r1, =gUnknown_0202406E @@ -1264,7 +1264,7 @@ _0803317A: bge _08033184 b _08033074 _08033184: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 8 @@ -1296,7 +1296,7 @@ dp01_prepare_buffer: @ 80331B8 adds r5, r3, 0 lsls r2, 16 lsrs r2, 16 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -1523,7 +1523,7 @@ _08033346: ldrsh r1, [r0, r7] ldr r0, [r4] adds r1, r0 - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] strb r0, [r1, 0x3] ldrb r1, [r3] @@ -1675,7 +1675,7 @@ _080334E0: adds r0, 0x1 b _0803363E _080334E6: - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _08033504 @@ -1690,7 +1690,7 @@ _080334F6: b _08033640 .pool _08033504: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 1 @@ -1861,7 +1861,7 @@ sub_8033648: @ 8033648 ldrb r0, [r0] cmp r0, 0 beq _08033738 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x20 ands r0, r1 @@ -1877,7 +1877,7 @@ _08033680: bl sub_800A550 lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r1, r4, 2 adds r1, r2 ldr r1, [r1] @@ -2041,7 +2041,7 @@ _080337CC: b _0803388A _080337D2: ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable lsls r0, r4, 2 adds r0, r1 ldr r1, [r2] @@ -2058,7 +2058,7 @@ _080337D2: bl memcpy adds r0, r4, 0 bl sub_803F850 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x4 ands r0, r1 @@ -2072,7 +2072,7 @@ _080337D2: adds r0, r1 ldrb r0, [r0, 0x2] strb r0, [r2] - ldr r2, =gUnknown_0202420C + ldr r2, =gEnemyMonIndex movs r4, 0x26 ldrsh r0, [r5, r4] adds r0, r1 @@ -2105,7 +2105,7 @@ _0803385C: _08033874: ldrb r2, [r3, 0x8] ldr r3, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable lsls r0, r4, 2 adds r0, r1 lsls r2, 2 @@ -2532,7 +2532,7 @@ dp01_build_cmdbuf_x0F_aa_b_cc_dddd_e_mlc_weather_00_x1Cbytes: @ 8033B0C lsls r0, 24 cmp r0, 0 bne _08033BAC - ldr r0, =gUnknown_020243CC + ldr r0, =gBattleWeather ldrh r0, [r0] strb r0, [r7, 0xC] ands r6, r0 @@ -2636,7 +2636,7 @@ dp01_build_cmdbuf_x10_TODO: @ 8033BE4 ldr r0, =gUnknown_02022F78 mov r8, r0 adds r2, 0x10 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r4, r0, 0 adds r4, 0x20 _08033C6A: @@ -2735,7 +2735,7 @@ dp01_build_cmdbuf_x11_TODO: @ 8033CFC mov r8, r7 mov r4, r9 adds r4, 0x10 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r2, r0, 0 adds r2, 0x20 _08033D5E: @@ -3745,7 +3745,7 @@ dp01_build_cmdbuf_x37_a: @ 80344C8 movs r0, 0x37 strb r0, [r4] strb r1, [r4, 0x1] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r0, =0x00000ca9 adds r1, r0 diff --git a/asm/rom4.s b/asm/rom4.s index ada072f4e..bd848781a 100644 --- a/asm/rom4.s +++ b/asm/rom4.s @@ -10,7 +10,7 @@ sub_8084620: @ 8084620 push {r4,lr} ldr r0, =gUnknown_08271857 bl script_env_2_execute_new_script - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r4, [r0] movs r0, 0x92 lsls r0, 3 @@ -191,13 +191,13 @@ sub_80847F8: @ 80847F8 lsrs r1, r0, 24 cmp r1, 0x33 bhi _08084828 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] lsls r0, r1, 2 ldr r1, =0x0000159c adds r2, r1 adds r2, r0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r1, 0xAC ldr r0, [r2] @@ -220,13 +220,13 @@ sav12_xor_set: @ 8084830 lsrs r2, r0, 24 cmp r2, 0x33 bhi _08084854 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] lsls r0, r2, 2 ldr r2, =0x0000159c adds r1, r2 adds r1, r0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xAC ldr r0, [r0] @@ -243,7 +243,7 @@ sub_8084864: @ 8084864 push {r4-r6,lr} adds r5, r0, 0 movs r4, 0 - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr _0808486C: lsls r1, r4, 2 ldr r0, =0x0000159c @@ -270,7 +270,7 @@ CopyFieldObjectTemplatesToSav1: @ 8084894 sub sp, 0x4 movs r0, 0 str r0, [sp] - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r1, [r5] movs r4, 0xC7 lsls r4, 4 @@ -304,7 +304,7 @@ CopyFieldObjectTemplateCoordsToSav1: @ 80848E0 push {lr} ldr r0, =gUnknown_02037318 ldr r1, [r0, 0x4] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, [r1, 0x4] movs r3, 0xC7 @@ -333,7 +333,7 @@ update_saveblock1_field_object_coords: @ 8084910 lsrs r4, r1, 16 lsls r2, 16 lsrs r2, 16 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0 movs r6, 0xC7 @@ -365,7 +365,7 @@ update_saveblock1_field_object_movement_behavior: @ 808494C lsrs r4, r0, 24 lsls r1, 24 lsrs r1, 24 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r3, 0 movs r5, 0xC7 @@ -410,7 +410,7 @@ mapdata_load_assets_to_gpu_and_full_redraw: @ 8084980 @ mapdata_header *get_mapdata_header() get_mapdata_header: @ 80849A8 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0, 0x32] cmp r1, 0 @@ -434,7 +434,7 @@ _080849C6: @ void warp_shift() warp_shift: @ 80849D0 ldr r3, =gUnknown_020322DC - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r0, [r2, 0x4] ldr r1, [r2, 0x8] @@ -574,7 +574,7 @@ set_current_map_header_from_sav1_save_old_name: @ 8084ACC ldr r4, =gUnknown_02037318 ldrb r0, [r4, 0x14] strh r0, [r1] - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r1, [r5] movs r0, 0x4 ldrsb r0, [r1, r0] @@ -608,7 +608,7 @@ set_current_map_header_from_sav1_save_old_name: @ 8084ACC set_current_map_header_from_sav1: @ 8084B1C push {r4,r5,lr} ldr r4, =gUnknown_02037318 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] movs r0, 0x4 ldrsb r0, [r1, r0] @@ -639,7 +639,7 @@ set_current_map_header_from_sav1: @ 8084B1C @ void update_camera_pos_from_warpid() update_camera_pos_from_warpid: @ 8084B5C push {r4,r5,lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] movs r1, 0x6 ldrsb r1, [r2, r1] @@ -768,7 +768,7 @@ warp1_set_2: @ 8084C28 saved_warp2_set: @ 8084C48 push {r4,r5,lr} sub sp, 0x8 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r5, [r0] adds r0, r5, 0 adds r0, 0x14 @@ -798,7 +798,7 @@ saved_warp2_set_2: @ 8084C7C sub sp, 0x8 ldr r4, [sp, 0x14] ldr r5, [sp, 0x18] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] adds r0, 0x14 lsls r1, 24 @@ -824,7 +824,7 @@ saved_warp2_set_2: @ 8084C7C thumb_func_start copy_saved_warp2_bank_and_enter_x_to_warp1 copy_saved_warp2_bank_and_enter_x_to_warp1: @ 8084CB4 ldr r2, =gUnknown_020322E4 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, [r0, 0x18] ldr r0, [r0, 0x14] @@ -869,7 +869,7 @@ _08084CFA: @ void copy_saved_warp3_bank_and_enter_x_to_warp1() copy_saved_warp3_bank_and_enter_x_to_warp1: @ 8084D04 ldr r2, =gUnknown_020322E4 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, [r0, 0x20] ldr r0, [r0, 0x1C] @@ -889,7 +889,7 @@ sub_8084D1C: @ 8084D1C adds r5, r0, 0 cmp r5, 0 beq _08084D50 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] adds r0, 0x1C movs r1, 0 @@ -945,7 +945,7 @@ sub_8084D5C: @ 8084D5C lsrs r0, 24 cmp r0, 0x1 beq _08084DC4 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] movs r0, 0x4 ldrsb r0, [r1, r0] @@ -978,7 +978,7 @@ sub_8084DD4: @ 8084DD4 adds r5, r1, 0 adds r6, r2, 0 ldr r1, [sp, 0x18] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] adds r0, 0x24 lsls r4, 24 @@ -1007,7 +1007,7 @@ sub_8084DD4: @ 8084DD4 thumb_func_start sub_8084E14 sub_8084E14: @ 8084E14 ldr r2, =gUnknown_020322E4 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, [r0, 0x28] ldr r0, [r0, 0x24] @@ -1137,7 +1137,7 @@ _08084F0A: thumb_func_start warp1_set_to_sav1w warp1_set_to_sav1w: @ 8084F14 ldr r2, =gUnknown_020322E4 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, [r0, 0x10] ldr r0, [r0, 0xC] @@ -1155,7 +1155,7 @@ sub_8084F2C: @ 8084F2C adds r5, r1, 0 adds r6, r2, 0 ldr r1, [sp, 0x18] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] adds r0, 0xC lsls r4, 24 @@ -1191,7 +1191,7 @@ sub_8084F6C: @ 8084F6C adds r5, r0, 0 cmp r5, 0 beq _08084FA0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] adds r0, 0xC movs r1, 0 @@ -1217,7 +1217,7 @@ _08084FA0: thumb_func_start sub_8084FAC sub_8084FAC: @ 8084FAC - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r0, [r2, 0x14] ldr r1, [r2, 0x18] @@ -1467,7 +1467,7 @@ _080851A2: bl sub_809D344 bl wild_pokemon_reroll bl prev_quest_postbuffer_cursor_backup_reset - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] movs r0, 0x4 ldrsb r0, [r1, r0] @@ -1783,7 +1783,7 @@ _08085448: thumb_func_start cur_mapdata_block_role_at_screen_center_acc_to_sav1 cur_mapdata_block_role_at_screen_center_acc_to_sav1: @ 8085450 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] movs r2, 0 ldrsh r0, [r1, r2] @@ -1825,7 +1825,7 @@ update_sav1_flash_used_on_map: @ 8085494 ldrb r1, [r0, 0x15] cmp r1, 0 bne _080854B0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] adds r0, 0x30 strb r1, [r0] @@ -1837,7 +1837,7 @@ _080854B0: lsls r0, 24 cmp r0, 0 beq _080854D0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] adds r0, 0x30 movs r1, 0x1 @@ -1845,7 +1845,7 @@ _080854B0: b _080854DE .pool _080854D0: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =gUnknown_0854FE78 ldr r0, [r0] @@ -1871,7 +1871,7 @@ sub_80854EC: @ 80854EC _080854FC: movs r1, 0 _080854FE: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] adds r0, 0x30 strb r1, [r0] @@ -1882,7 +1882,7 @@ _080854FE: thumb_func_start sav1_get_flash_used_on_map sav1_get_flash_used_on_map: @ 8085514 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] adds r0, 0x30 ldrb r0, [r0] @@ -1893,7 +1893,7 @@ sav1_get_flash_used_on_map: @ 8085514 thumb_func_start sub_8085524 sub_8085524: @ 8085524 push {lr} - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r1, [r1] strh r0, [r1, 0x32] bl get_mapdata_header @@ -2126,7 +2126,7 @@ _080856CE: thumb_func_start sav1_map_get_music sav1_map_get_music: @ 80856D4 push {r4,lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0, 0x4] movs r0, 0xD0 @@ -2142,7 +2142,7 @@ sav1_map_get_music: @ 80856D4 b _08085730 .pool _080856FC: - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] adds r0, 0x4 bl warp_target_get_music @@ -2186,7 +2186,7 @@ warp1_target_get_music: @ 8085738 b _08085774 .pool _08085758: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0, 0x4] movs r0, 0x80 @@ -2224,7 +2224,7 @@ sub_8085784: @ 8085784 ldr r0, =0x0000ffff cmp r4, r0 beq _080857D6 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldrh r0, [r1, 0x2C] cmp r0, 0 @@ -2265,7 +2265,7 @@ _080857E8: thumb_func_start sav1_set_battle_music_maybe sav1_set_battle_music_maybe: @ 80857F4 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r1, [r1] strh r0, [r1, 0x2C] bx lr @@ -2274,7 +2274,7 @@ sav1_set_battle_music_maybe: @ 80857F4 thumb_func_start sav1_reset_battle_music_maybe sav1_reset_battle_music_maybe: @ 8085800 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] movs r0, 0 strh r0, [r1, 0x2C] @@ -2433,7 +2433,7 @@ music_something: @ 8085910 lsrs r0, 16 cmp r0, 0x2 bne _08085972 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x0000ffff ldrh r2, [r0, 0x4] @@ -2507,7 +2507,7 @@ sub_80859BC: @ 80859BC cmp r0, 0 beq _08085A2C _080859F0: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x58 @@ -2516,7 +2516,7 @@ _080859F0: adds r4, 0xD4 lsls r4, 24 lsrs r4, 24 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x1E @@ -2577,7 +2577,7 @@ _08085A84: movs r0, 0x1 b _08085B1E _08085A88: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x96 @@ -2607,10 +2607,10 @@ _08085ABC: bcs _08085AE4 movs r0, 0x64 muls r0, r5 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 movs r1, 0x6 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _08085AB6 adds r0, r4, 0 @@ -2622,7 +2622,7 @@ _08085ABC: movs r1, 0x2 mov r9, r1 _08085AE4: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r4, 0x96 @@ -2661,7 +2661,7 @@ _08085B20: thumb_func_start sub_8085B2C sub_8085B2C: @ 8085B2C push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0, 0x4] movs r0, 0xB4 @@ -2724,7 +2724,7 @@ get_map_light_level_from_warp: @ 8085B8C thumb_func_start sav1_map_get_light_level sav1_map_get_light_level: @ 8085BA4 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] adds r0, 0x4 bl get_map_light_level_from_warp @@ -2817,7 +2817,7 @@ _08085C2A: thumb_func_start sav1_saved_warp2_map_get_name sav1_saved_warp2_map_get_name: @ 8085C30 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] movs r0, 0x14 ldrsb r0, [r1, r0] @@ -2838,7 +2838,7 @@ sav1_saved_warp2_map_get_name: @ 8085C30 thumb_func_start sav1_map_get_name sav1_map_get_name: @ 8085C58 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] movs r0, 0x4 ldrsb r0, [r1, r0] @@ -2859,7 +2859,7 @@ sav1_map_get_name: @ 8085C58 thumb_func_start sav1_map_get_battletype sav1_map_get_battletype: @ 8085C80 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] movs r0, 0x4 ldrsb r0, [r1, r0] @@ -2981,7 +2981,7 @@ ResetSafariZoneFlag_: @ 8085D80 @ _BOOL4 is_c1_link_related_active() is_c1_link_related_active: @ 8085D8C push {lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, [r0] ldr r0, =c1_link_related cmp r1, r0 @@ -3041,7 +3041,7 @@ _08085DFA: thumb_func_start c1_overworld c1_overworld: @ 8085E04 push {lr} - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldr r1, [r2, 0x4] ldr r0, =c2_overworld cmp r1, r0 @@ -3105,7 +3105,7 @@ _08085E7C: thumb_func_start set_callback1 set_callback1: @ 8085E88 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain str r0, [r1] bx lr .pool @@ -3196,7 +3196,7 @@ CB2_NewGame: @ 8085EF8 c2_whiteout: @ 8085F58 push {lr} sub sp, 0x4 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -3244,7 +3244,7 @@ c2_load_new_map: @ 8085FCC bl set_callback1 ldr r0, =c2_change_map bl SetMainCallback2 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =c2_load_new_map_2 str r0, [r1, 0x8] pop {r0} @@ -3270,7 +3270,7 @@ c2_load_new_map_2: @ 8085FFC thumb_func_start sub_8086024 sub_8086024: @ 8086024 push {r4,lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r4, r0, r1 @@ -3395,7 +3395,7 @@ c2_8056854: @ 8086140 ldr r0, =c1_link_related bl set_callback1 bl sub_8086C2C - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _08086174 @@ -3586,7 +3586,7 @@ sub_808631C: @ 808631C bne _0808632E bl sub_80097E8 _0808632E: - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _08086348 @@ -3768,7 +3768,7 @@ _080864DA: bl cur_mapheader_run_tileset_funcs_after_some_cpuset b _08086506 _080864E0: - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _08086506 @@ -4056,7 +4056,7 @@ _08086766: bl cur_mapheader_run_tileset_funcs_after_some_cpuset b _08086792 _0808676C: - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _08086792 @@ -4362,7 +4362,7 @@ mli4_mapscripts_and_other: @ 8086A04 movs r2, 0 ldrsh r1, [r4, r2] ldrb r2, [r5, 0x1] - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r3, [r3] ldrb r3, [r3, 0x8] bl InitPlayerAvatar @@ -4565,7 +4565,7 @@ _08086BCA: thumb_func_start c1_link_related c1_link_related: @ 8086BD8 push {r4,lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _08086BF2 @@ -4631,7 +4631,7 @@ c1_link_related_func_set: @ 8086C50 thumb_func_start sub_8086C64 sub_8086C64: @ 8086C64 push {lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _08086C82 @@ -5029,7 +5029,7 @@ _08086FC0: movs r0, 0x11 strh r0, [r1] _08086FC6: - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _08086FFC @@ -5064,7 +5064,7 @@ _08086FFC: thumb_func_start sub_808700C sub_808700C: @ 808700C push {lr} - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2C] movs r0, 0x40 ands r0, r1 @@ -5284,7 +5284,7 @@ sub_8087170: @ 8087170 ldrb r0, [r0] cmp r0, 0x82 bne _080871A0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -5926,7 +5926,7 @@ _08087666: thumb_func_start sub_808766C sub_808766C: @ 808766C push {lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _08087688 @@ -5946,7 +5946,7 @@ _0808768A: thumb_func_start sub_8087690 sub_8087690: @ 8087690 push {lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _080876B0 diff --git a/asm/rom5.s b/asm/rom5.s index 007494bab..5f2cb20e9 100644 --- a/asm/rom5.s +++ b/asm/rom5.s @@ -233,10 +233,10 @@ _080A94F8: ldrh r0, [r0] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_02024744 + ldr r5, =gEnemyParty adds r0, r5 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -257,7 +257,7 @@ _080A94F8: muls r0, r6 adds r0, r5 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -271,7 +271,7 @@ _080A955C: ldrb r0, [r0] movs r1, 0 bl sub_8059CB4 - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _080A95D2 @@ -364,7 +364,7 @@ sub_80A9614: @ 80A9614 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 adds r1, r4, 0 bl sub_805DC0C @@ -376,7 +376,7 @@ _080A966C: bl sub_805E7DC b _080A96F4 _080A9676: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r2, 0x80 ands r1, r2 @@ -384,7 +384,7 @@ _080A9676: beq _080A9698 cmp r4, 0 bne _080A9698 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] b _080A96AA @@ -420,7 +420,7 @@ _080A96B2: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 adds r1, r4, 0 bl sub_805DD7C @@ -497,11 +497,11 @@ _080A9762: mov r2, r10 muls r2, r0 adds r0, r2, 0 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty mov r9, r1 add r0, r9 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _080A9786 b _080A9AA0 @@ -512,7 +512,7 @@ _080A9786: adds r0, r2, 0 add r0, r9 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 @@ -575,7 +575,7 @@ _080A9786: adds r0, r1, 0 add r0, r9 movs r1, 0xB - bl pokemon_getattr + bl GetMonData ldrb r2, [r4] lsls r1, r2, 4 adds r1, r2 @@ -599,7 +599,7 @@ _080A9786: b _080A9A50 .pool _080A986C: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r2, 0x80 ands r1, r2 @@ -607,7 +607,7 @@ _080A986C: beq _080A98D0 cmp r7, 0 bne _080A98D0 - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r0, [r5] ldrb r4, [r0, 0x8] movs r0, 0 @@ -714,11 +714,11 @@ _080A9968: mov r1, r10 muls r1, r0 adds r0, r1, 0 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty mov r9, r2 add r0, r9 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _080A998C b _080A9AA0 @@ -729,7 +729,7 @@ _080A998C: adds r0, r1, 0 add r0, r9 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 @@ -792,7 +792,7 @@ _080A998C: adds r0, r2, 0 add r0, r9 movs r1, 0xB - bl pokemon_getattr + bl GetMonData ldrb r2, [r4] lsls r1, r2, 4 adds r1, r2 @@ -878,7 +878,7 @@ sub_80A9ADC: @ 80A9ADC bcc _080A9AEC b _080A9C5E _080A9AEC: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r2, 0x80 ands r1, r2 @@ -924,14 +924,14 @@ _080A9B24: ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe b _080A9BB8 .pool _080A9B6C: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 ands r0, r1 @@ -944,7 +944,7 @@ _080A9B6C: ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 movs r2, 0xA bl healthbar_draw_field_maybe @@ -958,7 +958,7 @@ _080A9BA0: ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @@ -1000,10 +1000,10 @@ _080A9BFC: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _080A9C5E adds r0, r6, 0 @@ -1011,7 +1011,7 @@ _080A9BFC: b _080A9C5E .pool _080A9C34: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 ands r0, r1 @@ -1022,10 +1022,10 @@ _080A9C34: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _080A9C5E adds r0, r6, 0 @@ -1299,12 +1299,12 @@ sub_80A9E78: @ 80A9E78 movs r1, 0x2E ldrsh r0, [r4, r1] movs r1, 0x20 - bl cosine + bl Cos strh r0, [r4, 0x24] movs r1, 0x2E ldrsh r0, [r4, r1] movs r1, 0x8 - bl sine + bl Sin strh r0, [r4, 0x26] movs r1, 0x2E ldrsh r0, [r4, r1] diff --git a/asm/rom6.s b/asm/rom6.s index 5f60e46a8..776979615 100644 --- a/asm/rom6.s +++ b/asm/rom6.s @@ -616,7 +616,7 @@ _08135972: sub_8135978: @ 8135978 push {r4,lr} sub sp, 0x4 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -658,7 +658,7 @@ _081359EC: b _08135B9E _081359F6: bl remove_some_task - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -674,7 +674,7 @@ _08135A0E: movs r1, 0x80 orrs r0, r1 strb r0, [r2, 0x8] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -713,7 +713,7 @@ _08135A70: bne _08135A7C b _08135BD0 _08135A7C: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -734,7 +734,7 @@ _08135A9A: ldr r2, =0x00000e74 adds r1, r2 strb r0, [r1] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -754,7 +754,7 @@ _08135ADC: ldrh r0, [r0, 0x4] ldr r1, =0x00001005 bl sub_8136110 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -765,7 +765,7 @@ _08135AFC: b _08135B9E _08135B02: bl sub_8135E2C - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -794,7 +794,7 @@ _08135B1A: lsls r0, 24 lsrs r0, 24 strh r0, [r1, 0x8] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -809,7 +809,7 @@ _08135B6A: movs r1, 0x10 movs r2, 0 bl BlendPalettes - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -829,7 +829,7 @@ _08135B84: ands r0, r1 strb r0, [r2, 0x8] _08135B9E: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -1149,7 +1149,7 @@ _08135E7C: ldr r0, [r5] adds r0, r4 ldr r1, =gUnknown_085E9344 - bl CopyString + bl StringCopy ldr r1, [r5] lsls r2, r6, 3 ldr r3, =0x0000080c @@ -1199,7 +1199,7 @@ _08135E7C: sub_8135F04: @ 8135F04 push {r4-r6,lr} lsls r1, 16 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr lsrs r1, 13 ldr r3, =0x00000848 adds r1, r3 @@ -1210,7 +1210,7 @@ sub_8135F04: @ 8135F04 lsls r1, 2 adds r1, r2 ldr r1, [r1] - bl CopyString + bl StringCopy adds r4, r0, 0 movs r0, 0xFC strb r0, [r4] @@ -1221,7 +1221,7 @@ sub_8135F04: @ 8135F04 movs r0, 0x57 strb r0, [r4] adds r4, 0x1 - ldr r6, =gUnknown_02021CC4 + ldr r6, =gStringVar1 adds r0, r5, 0 bl sub_8136EA4 adds r1, r0, 0 @@ -1230,10 +1230,10 @@ sub_8135F04: @ 8135F04 adds r0, r6, 0 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r1, =gUnknown_085E934F adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders pop {r4-r6} pop {r0} bx r0 @@ -1294,7 +1294,7 @@ sub_8135FCC: @ 8135FCC negs r0, r0 cmp r4, r0 beq _081360A0 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr lsls r0, r4, 3 ldr r2, =0x00000848 adds r0, r2 @@ -1362,7 +1362,7 @@ _08136032: lsrs r5, r0, 24 cmp r5, 0x4 bls _08136002 - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 mov r0, r8 bl sub_8136EDC adds r1, r0, 0 @@ -1371,7 +1371,7 @@ _08136032: adds r0, r4, 0 movs r2, 0x1 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x7 adds r1, r4, 0 movs r2, 0x4 @@ -1472,7 +1472,7 @@ _0813614A: mov r12, r1 cmp r6, 0x27 bhi _08136192 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr mov r9, r0 lsls r7, r2, 3 ldr r1, =0x00000848 @@ -1524,7 +1524,7 @@ sub_81361B0: @ 81361B0 push {r4-r7,lr} adds r4, r0, 0 adds r5, r1, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00000848 adds r6, r0, r1 @@ -1621,7 +1621,7 @@ sub_813625C: @ 813625C movs r1, 0 strb r1, [r0] movs r2, 0 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r4, =0x00000848 _08136274: ldr r0, [r5] @@ -2056,7 +2056,7 @@ _081365F4: bne _08136602 b _08136708 _08136602: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x4 ands r0, r1 @@ -2186,7 +2186,7 @@ sub_813671C: @ 813671C bne _08136742 b _08136848 _08136742: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x4 ands r0, r1 @@ -2275,7 +2275,7 @@ _081367CA: _08136810: movs r0, 0x5 bl audio_play - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -2540,7 +2540,7 @@ sub_8136A50: @ 8136A50 thumb_func_start sub_8136A74 sub_8136A74: @ 8136A74 push {lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_0203CE7C ldrh r1, [r0] lsls r1, 3 @@ -2582,9 +2582,9 @@ sub_8136AB4: @ 8136AB4 ldrb r0, [r0, 0x2] movs r1, 0 bl sub_8198070 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r3, =gUnknown_085B262C - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] ldr r1, =gUnknown_0203CE7C ldrh r1, [r1] @@ -2596,11 +2596,11 @@ sub_8136AB4: @ 8136AB4 lsls r1, 2 adds r1, r3 ldr r1, [r1] - bl CopyString - ldr r5, =gUnknown_02021FC4 + bl StringCopy + ldr r5, =gStringVar4 ldr r1, =gUnknown_085E9353 adds r0, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders bl sav2_get_text_speed lsls r0, 24 lsrs r0, 24 @@ -2653,10 +2653,10 @@ sub_8136B78: @ 8136B78 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r5, =gUnknown_02021FC4 + ldr r5, =gStringVar4 ldr r1, =gUnknown_085E9367 adds r0, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders bl sav2_get_text_speed lsls r0, 24 lsrs r0, 24 @@ -2683,7 +2683,7 @@ sub_8136BC0: @ 8136BC0 push {r4-r7,lr} lsls r0, 24 lsrs r7, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -2767,11 +2767,11 @@ sub_8136C8C: @ 8136C8C lsls r0, 24 lsrs r0, 24 mov r8, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty bl GetNature lsls r0, 24 lsrs r0, 24 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r7, =gUnknown_0203CE7C ldrh r2, [r7] lsls r2, 3 @@ -2794,7 +2794,7 @@ sub_8136C8C: @ 8136C8C lsls r1, 2 adds r1, r3 ldr r1, [r1] - bl CopyString + bl StringCopy ldrb r0, [r7] bl sub_8136F68 ldr r1, [r5] @@ -2839,9 +2839,9 @@ sub_8136D2C: @ 8136D2C ldr r5, =gUnknown_0203CE7C ldrb r0, [r5] bl sub_80FC3E8 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r3, =gUnknown_085B262C - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] ldrh r1, [r5] lsls r1, 3 @@ -2852,7 +2852,7 @@ sub_8136D2C: @ 8136D2C lsls r1, 2 adds r1, r3 ldr r1, [r1] - bl CopyString + bl StringCopy ldr r1, =gUnknown_020375F0 ldrh r0, [r5] strh r0, [r1] @@ -2876,7 +2876,7 @@ sub_8136D90: @ 8136D90 lsls r4, 24 lsrs r4, 24 ldr r6, =gUnknown_020375E0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r5, =gUnknown_0203CE7C ldrh r1, [r5] lsls r1, 3 @@ -2934,7 +2934,7 @@ sub_8136DE8: @ 8136DE8 sub_8136E20: @ 8136E20 push {r4,lr} lsls r0, 24 - ldr r3, =gUnknown_03005D8C + ldr r3, =gSaveBlock1Ptr ldr r1, [r3] lsrs r0, 21 adds r1, r0 @@ -3045,7 +3045,7 @@ _08136EEE: sub_8136EF4: @ 8136EF4 push {lr} movs r1, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r3, =0x00000848 _08136EFE: @@ -3083,7 +3083,7 @@ sub_8136F2C: @ 8136F2C negs r0, r0 cmp r1, r0 beq _08136F60 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] lsls r0, r1, 3 ldr r1, =0x00000848 @@ -3109,7 +3109,7 @@ sub_8136F68: @ 8136F68 push {lr} lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] lsls r1, r2, 3 adds r0, r1 @@ -3241,7 +3241,7 @@ sub_8137044: @ 8137044 adds r0, r1 ldr r1, [r0] adds r0, r4, 0 - bl CopyString + bl StringCopy pop {r4} pop {r0} bx r0 @@ -3270,7 +3270,7 @@ _08137074: adds r0, r7 ldr r1, [r0] adds r0, r6, 0 - bl CopyString + bl StringCopy movs r0, 0x1 b _081370AC .pool @@ -3521,7 +3521,7 @@ c2_change_map: @ 8137200 lsls r0, 24 cmp r0, 0 bne _081372D2 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r0, [r0, 0x8] bl SetMainCallback2 _081372D2: @@ -3851,7 +3851,7 @@ sub_8137574: @ 8137574 b _081375A0 .pool _08137598: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r0, [r0, 0x8] bl SetMainCallback2 _081375A0: @@ -4019,7 +4019,7 @@ _08137714: movs r1, 0 movs r2, 0x20 bl LoadPalette - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r0, [r0, 0x8] bl SetMainCallback2 _08137726: @@ -4058,7 +4058,7 @@ _0813776C: bl sub_80847F8 cmp r0, 0 bne _0813778E - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldrh r1, [r2, 0xE] lsls r1, 16 @@ -4071,7 +4071,7 @@ _0813776C: bl sav12_xor_set _0813778E: bl sub_8076D48 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 @@ -4093,24 +4093,24 @@ _081377BC: movs r0, 0x64 adds r1, r6, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 movs r0, 0 strb r6, [r5] strb r0, [r5, 0x1] adds r0, r4, 0 movs r1, 0x5 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0813780A adds r0, r4, 0 movs r1, 0x6 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0813780A adds r0, r4, 0 movs r1, 0x43 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0813780A movs r0, 0x1 @@ -4160,7 +4160,7 @@ _08137838: ldrb r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x43 bl sub_80EE4DC @@ -4230,9 +4230,9 @@ sub_81378BC: @ 81378BC thumb_func_start sub_81378E4 sub_81378E4: @ 81378E4 push {r4,lr} - bl GenerateRandomNumber + bl Random adds r4, r0, 0 - bl GenerateRandomNumber + bl Random lsls r4, 16 lsls r0, 16 lsrs r0, 16 @@ -4283,16 +4283,16 @@ _08137946: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08137978 adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData ldr r1, =0x0000ffff ands r1, r0 cmp r1, r6 @@ -4716,7 +4716,7 @@ sub_8137CB4: @ 8137CB4 thumb_func_start Special_ViewWallClock Special_ViewWallClock: @ 8137CC8 push {lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =c2_exit_to_overworld_2_switch str r1, [r0, 0x8] ldr r0, =Cb2_ViewWallClock @@ -4750,7 +4750,7 @@ sub_8137D0C: @ 8137D0C movs r0, 0 strb r0, [r1] ldr r1, =gUnknown_0203AB58 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r0, [r0, 0x20] str r0, [r1] bx lr @@ -4790,26 +4790,26 @@ sub_8137D5C: @ 8137D5C lsrs r6, r1, 24 cmp r6, 0x63 bhi _08137D88 - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 adds r0, r4, 0 adds r1, r6, 0 movs r2, 0 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r1, =gUnknown_085EB5EE adds r0, r4, 0 - bl AppendString + bl StringAppend b _08137D90 .pool _08137D88: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EB5CF - bl CopyString + bl StringCopy _08137D90: ldr r0, =0x00000e0f cmp r7, r0 bhi _08137DF0 - ldr r4, =gUnknown_02021DC4 + ldr r4, =gStringVar2 adds r0, r7, 0 movs r1, 0x3C bl __udivsi3 @@ -4817,7 +4817,7 @@ _08137D90: adds r0, r4, 0 movs r2, 0x1 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0xAD strb r0, [r4, 0x2] adds r5, r4, 0x3 @@ -4832,16 +4832,16 @@ _08137D90: adds r0, r5, 0 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r1, =gUnknown_085EB5E5 adds r0, r4, 0 - bl AppendString + bl StringAppend b _08137DF8 .pool _08137DF0: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085EB5DA - bl CopyString + bl StringCopy _08137DF8: movs r4, 0 cmp r6, 0 @@ -4910,7 +4910,7 @@ _08137E5C: thumb_func_start sub_8137E6C sub_8137E6C: @ 8137E6C push {r4,r5,lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =gUnknown_0203AB58 ldr r4, [r0, 0x20] ldr r0, [r1] @@ -5418,7 +5418,7 @@ _08138262: lsls r1, 2 ldr r2, =gUnknown_020229F0 adds r1, r2 - bl CopyString + bl StringCopy adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 @@ -5483,7 +5483,7 @@ _081382F4: b _08138350 _081382FE: movs r7, 0x2 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldrh r0, [r1] subs r0, 0x1 @@ -5491,7 +5491,7 @@ _081382FE: .pool _08138310: movs r7, 0x1 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0] mov r9, r1 @@ -5500,7 +5500,7 @@ _08138310: b _0813834A .pool _08138324: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldrh r0, [r1] adds r0, 0x1 @@ -5514,7 +5514,7 @@ _0813832C: .pool _0813833C: movs r7, 0x3 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r3, [r0] mov r9, r3 @@ -5663,7 +5663,7 @@ sub_813842C: @ 813842C cmp r4, 0x69 bne _081384E6 _08138454: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrb r1, [r0, 0x5] ldrb r2, [r0, 0x4] @@ -6377,7 +6377,7 @@ sub_8138AA4: @ 8138AA4 thumb_func_start sub_8138AC0 sub_8138AC0: @ 8138AC0 push {lr} - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 bl box_related_two__2 pop {r0} bx r0 @@ -6387,7 +6387,7 @@ sub_8138AC0: @ 8138AC0 thumb_func_start sub_8138AD0 sub_8138AD0: @ 8138AD0 ldr r1, =gUnknown_020375E0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldrh r0, [r2] strh r0, [r1] @@ -6401,7 +6401,7 @@ sub_8138AD0: @ 8138AD0 thumb_func_start sub_8138AF0 sub_8138AF0: @ 8138AF0 push {lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r1, [r0, 0xB] lsls r1, 8 @@ -6419,20 +6419,20 @@ sub_8138AF0: @ 8138AF0 thumb_func_start sub_8138B10 sub_8138B10: @ 8138B10 push {lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 bne _08138B34 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EB5F9 - bl CopyString + bl StringCopy b _08138B3C .pool _08138B34: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EB601 - bl CopyString + bl StringCopy _08138B3C: pop {r0} bx r0 @@ -6442,20 +6442,20 @@ _08138B3C: thumb_func_start sub_8138B48 sub_8138B48: @ 8138B48 push {lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 bne _08138B6C - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EB60E - bl CopyString + bl StringCopy b _08138B74 .pool _08138B6C: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EB60A - bl CopyString + bl StringCopy _08138B74: pop {r0} bx r0 @@ -6542,11 +6542,11 @@ sub_8138C04: @ 8138C04 lsrs r0, 24 movs r1, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x20 - bl pokemon_getattr + bl GetMonData cmp r0, 0xFF bne _08138C2C movs r0, 0x6 @@ -6555,7 +6555,7 @@ sub_8138C04: @ 8138C04 _08138C2C: adds r0, r4, 0 movs r1, 0x20 - bl pokemon_getattr + bl GetMonData cmp r0, 0xC7 bls _08138C3C movs r0, 0x5 @@ -6563,7 +6563,7 @@ _08138C2C: _08138C3C: adds r0, r4, 0 movs r1, 0x20 - bl pokemon_getattr + bl GetMonData cmp r0, 0x95 bls _08138C4C movs r0, 0x4 @@ -6571,7 +6571,7 @@ _08138C3C: _08138C4C: adds r0, r4, 0 movs r1, 0x20 - bl pokemon_getattr + bl GetMonData cmp r0, 0x63 bls _08138C5C movs r0, 0x3 @@ -6579,7 +6579,7 @@ _08138C4C: _08138C5C: adds r0, r4, 0 movs r1, 0x20 - bl pokemon_getattr + bl GetMonData cmp r0, 0x31 bls _08138C6C movs r0, 0x2 @@ -6587,7 +6587,7 @@ _08138C5C: _08138C6C: adds r0, r4, 0 movs r1, 0x20 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _08138C7C movs r0, 0 @@ -6791,7 +6791,7 @@ _08138DE0: bne _08138DE6 ldr r3, =0x0000027e _08138DE6: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] movs r5, 0 ldrsh r0, [r2, r5] @@ -6875,7 +6875,7 @@ _08138E7C: bne _08138E82 ldr r4, =0x00000259 _08138E82: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] movs r1, 0 ldrsh r0, [r2, r1] @@ -7065,10 +7065,10 @@ sub_8139004: @ 8139004 lsrs r0, 24 movs r1, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x16 - bl pokemon_getattr + bl GetMonData cmp r0, 0xC7 bls _08139028 movs r0, 0x1 @@ -7089,10 +7089,10 @@ sub_8139030: @ 8139030 lsrs r0, 24 movs r1, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x17 - bl pokemon_getattr + bl GetMonData cmp r0, 0xC7 bls _08139054 movs r0, 0x1 @@ -7113,10 +7113,10 @@ sub_813905C: @ 813905C lsrs r0, 24 movs r1, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x18 - bl pokemon_getattr + bl GetMonData cmp r0, 0xC7 bls _08139080 movs r0, 0x1 @@ -7137,10 +7137,10 @@ sub_8139088: @ 8139088 lsrs r0, 24 movs r1, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x21 - bl pokemon_getattr + bl GetMonData cmp r0, 0xC7 bls _081390AC movs r0, 0x1 @@ -7161,10 +7161,10 @@ sub_81390B4: @ 81390B4 lsrs r0, 24 movs r1, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2F - bl pokemon_getattr + bl GetMonData cmp r0, 0xC7 bls _081390D8 movs r0, 0x1 @@ -7186,21 +7186,21 @@ _081390E6: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x5 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0813913C adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0813913C adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 lsls r1, r0, 3 @@ -7238,7 +7238,7 @@ _0813914A: SpawnScriptFieldObject: @ 8139158 push {lr} sub sp, 0x8 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r3, [r0] adds r3, 0x7 @@ -7281,7 +7281,7 @@ RemoveScriptFieldObject: @ 81391AC lsls r0, 24 lsrs r0, 24 bl CameraObjectSetFollowedObjectId - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrb r1, [r0, 0x5] ldrb r2, [r0, 0x4] @@ -7300,12 +7300,12 @@ sub_81391D0: @ 81391D0 lsrs r0, 24 movs r1, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 bl GetNature lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl sub_8137068 lsls r0, 24 lsrs r0, 24 @@ -7317,7 +7317,7 @@ sub_81391D0: @ 81391D0 thumb_func_start sub_8139200 sub_8139200: @ 8139200 push {r4,lr} - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 ldr r0, =0x00004026 bl VarGet adds r1, r0, 0 @@ -7346,7 +7346,7 @@ sub_8139228: @ 8139228 thumb_func_start sub_8139238 sub_8139238: @ 8139238 push {lr} - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 bl sub_8165284 pop {r0} bx r0 @@ -7356,7 +7356,7 @@ sub_8139238: @ 8139238 thumb_func_start sub_8139248 sub_8139248: @ 8139248 push {r4,r5,lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r1, =0x00002e68 adds r0, r2, r1 @@ -7484,11 +7484,11 @@ sub_8139348: @ 8139348 lsrs r0, 24 movs r1, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x47 movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r0, 24 pop {r1} @@ -7512,7 +7512,7 @@ sub_8139370: @ 8139370 lsrs r0, 24 movs r1, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x47 @@ -7543,7 +7543,7 @@ sub_81393C8: @ 81393C8 lsrs r0, 24 movs r1, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 bl sub_806DC8C lsls r0, 16 @@ -7568,7 +7568,7 @@ sub_81393FC: @ 81393FC lsls r0, 24 cmp r0, 0 bne _08139454 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0, 0x4] movs r0, 0x83 @@ -7619,7 +7619,7 @@ sub_813945C: @ 813945C sub_813946C: @ 813946C push {r4,r5,lr} sub sp, 0x14 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty movs r1, 0x90 lsls r1, 1 movs r4, 0 @@ -7685,11 +7685,11 @@ sub_81394D8: @ 81394D8 _081394FA: movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x41 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, r6 bne _0813951C movs r0, 0x1 @@ -7722,7 +7722,7 @@ sub_8139530: @ 8139530 thumb_func_start sub_8139540 sub_8139540: @ 8139540 push {lr} - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty movs r1, 0x3F bl sub_806DD7C lsls r0, 24 @@ -7895,12 +7895,12 @@ _08139698: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x41 movs r2, 0 - bl pokemon_getattr + bl GetMonData movs r1, 0xCE lsls r1, 1 cmp r0, r1 @@ -7908,7 +7908,7 @@ _08139698: adds r0, r4, 0 movs r1, 0x41 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081396CC adds r0, r5, 0 @@ -7935,11 +7935,11 @@ sub_81396E0: @ 81396E0 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x41 movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 pop {r1} @@ -8010,23 +8010,23 @@ sub_8139770: @ 8139770 ldrh r0, [r6] movs r5, 0x64 muls r0, r5 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 movs r1, 0x3 - bl pokemon_getattr + bl GetMonData cmp r0, 0x2 bne _081397A6 ldrh r0, [r6] muls r0, r5 adds r0, r4 - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 movs r1, 0x7 adds r2, r4, 0 - bl pokemon_getattr - ldr r0, =gUnknown_03005D90 + bl GetMonData + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r1, r4, 0 - bl CompareString + bl StringCompare cmp r0, 0 beq _081397BC _081397A6: @@ -8057,7 +8057,7 @@ _081397E0: ldr r0, =0x000003e7 cmp r1, r0 bls _081397F8 - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 movs r0, 0xA1 strb r0, [r4] adds r4, 0x1 @@ -8066,7 +8066,7 @@ _081397E0: _081397F8: cmp r1, 0x63 bls _0813980C - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 movs r0, 0xA1 strb r0, [r4] strb r0, [r4, 0x1] @@ -8076,7 +8076,7 @@ _081397F8: _0813980C: cmp r1, 0x9 bls _0813983C - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 movs r0, 0xA1 strb r0, [r4] strb r0, [r4, 0x1] @@ -8092,11 +8092,11 @@ _0813981C: adds r0, r4, 0 adds r1, r5, 0 movs r2, 0 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN b _08139862 .pool _0813983C: - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 movs r0, 0xA1 strb r0, [r4] strb r0, [r4, 0x1] @@ -8112,7 +8112,7 @@ _0813983C: adds r0, r4, 0 adds r1, r5, 0 movs r2, 0 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN _08139862: pop {r4,r5} pop {r0} @@ -8182,7 +8182,7 @@ sub_81398C0: @ 81398C0 b _081398FC .pool _081398E0: - ldr r4, =gUnknown_02021DC4 + ldr r4, =gStringVar2 ldrh r0, [r1] bl ItemIdToBattleMoveId lsls r0, 16 @@ -8192,7 +8192,7 @@ _081398E0: ldr r0, =gMoveNames adds r1, r0 adds r0, r4, 0 - bl CopyString + bl StringCopy movs r0, 0x1 _081398FC: pop {r4} @@ -8213,10 +8213,10 @@ sub_813990C: @ 813990C _0813991C: movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x4 - bl pokemon_getattr + bl GetMonData cmp r0, 0x1 bne _08139938 movs r0, 0x1 @@ -8239,7 +8239,7 @@ _08139944: thumb_func_start in_multi_battle_room_with_var_condition in_multi_battle_room_with_var_condition: @ 813994C push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0, 0x4] ldr r0, =0x00000f1a @@ -8276,7 +8276,7 @@ sub_8139980: @ 8139980 thumb_func_start sub_8139994 sub_8139994: @ 8139994 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrb r0, [r0, 0x15] subs r0, 0x10 @@ -8331,7 +8331,7 @@ sub_81399F4: @ 81399F4 strh r0, [r2] ldr r1, =gUnknown_0203AB62 strh r0, [r1] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r3, [r0] movs r0, 0x14 ldrsb r0, [r3, r0] @@ -8773,40 +8773,40 @@ sub_8139D98: @ 8139D98 ldrh r0, [r6] movs r5, 0x64 muls r0, r5 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 movs r1, 0x27 - bl pokemon_getattr + bl GetMonData str r0, [sp] ldrh r0, [r6] muls r0, r5 adds r0, r4 movs r1, 0x28 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x4] ldrh r0, [r6] muls r0, r5 adds r0, r4 movs r1, 0x29 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x8] ldrh r0, [r6] muls r0, r5 adds r0, r4 movs r1, 0x2A - bl pokemon_getattr + bl GetMonData str r0, [sp, 0xC] ldrh r0, [r6] muls r0, r5 adds r0, r4 movs r1, 0x2B - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x10] ldrh r0, [r6] muls r0, r5 adds r0, r4 movs r1, 0x2C - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x14] ldr r1, =gUnknown_020375E2 movs r0, 0 @@ -8851,7 +8851,7 @@ _08139E28: _08139E54: cmp r1, r0 bne _08139E6E - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x1 @@ -8918,7 +8918,7 @@ _08139EC8: thumb_func_start sub_8139ED0 sub_8139ED0: @ 8139ED0 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0, 0x4] ldr r0, =0x00003c1a @@ -8988,7 +8988,7 @@ _08139F48: .4byte _08139FFC .4byte _0813A014 _08139F70: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r3, 0xCE lsls r3, 4 @@ -9004,7 +9004,7 @@ _08139F70: b _0813A038 .pool _08139F94: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r3, =0x00000d0c adds r2, r0, r3 @@ -9018,7 +9018,7 @@ _08139F9E: b _0813A038 .pool _08139FB4: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000de2 adds r2, r0, r1 @@ -9026,7 +9026,7 @@ _08139FB4: b _08139F9E .pool _08139FCC: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000dc8 adds r2, r0, r1 @@ -9034,7 +9034,7 @@ _08139FCC: b _08139F9E .pool _08139FE4: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000dda adds r2, r0, r1 @@ -9042,7 +9042,7 @@ _08139FE4: b _08139F9E .pool _08139FFC: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000e04 adds r2, r0, r1 @@ -9050,7 +9050,7 @@ _08139FFC: b _08139F9E .pool _0813A014: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000e1a adds r2, r0, r1 @@ -9108,7 +9108,7 @@ sub_813A080: @ 813A080 bl VarGet lsls r0, 16 lsrs r5, r0, 16 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 @@ -9143,7 +9143,7 @@ _0813A0D8: lsls r1, r4, 1 lsls r2, r5, 2 ldr r4, =gUnknown_085B2CDC - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r1, r2 movs r2, 0xCE @@ -9988,7 +9988,7 @@ _0813A7C6: ldrh r1, [r1] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 bl GetNature lsls r0, 24 @@ -10122,7 +10122,7 @@ _0813A8F0: sub_813A8FC: @ 813A8FC push {lr} sub sp, 0x2C - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000eb8 adds r0, r1 @@ -10130,9 +10130,9 @@ sub_813A8FC: @ 813A8FC add r0, sp, 0xC movs r2, 0x1 movs r3, 0x4 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r1, =gUnknown_085EB6AD - bl CopyString + bl StringCopy movs r0, 0x1 add r1, sp, 0xC movs r2, 0x30 @@ -10194,7 +10194,7 @@ sub_813A988: @ 813A988 thumb_func_start sub_813A9A4 sub_813A9A4: @ 813A9A4 push {lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000eb8 adds r1, r0, r2 @@ -10217,7 +10217,7 @@ _0813A9CA: thumb_func_start sub_813A9D0 sub_813A9D0: @ 813A9D0 push {lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000eb8 adds r2, r0, r1 @@ -10240,7 +10240,7 @@ _0813A9FE: thumb_func_start sub_813AA04 sub_813AA04: @ 813AA04 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000eb8 adds r0, r1 @@ -10537,7 +10537,7 @@ sub_813AC7C: @ 813AC7C ldrh r0, [r0] cmp r0, 0 beq _0813ACB8 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r2, =gUnknown_085B320C ldr r1, =gUnknown_020375E0 ldrh r1, [r1] @@ -10548,11 +10548,11 @@ sub_813AC7C: @ 813AC7C muls r1, r2 ldr r2, =gMoveNames adds r1, r2 - bl CopyString + bl StringCopy b _0813ACD2 .pool _0813ACB8: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r2, =gUnknown_085B31F8 ldr r1, =gUnknown_020375E0 ldrh r1, [r1] @@ -10563,7 +10563,7 @@ _0813ACB8: muls r1, r2 ldr r2, =gMoveNames adds r1, r2 - bl CopyString + bl StringCopy _0813ACD2: pop {r0} bx r0 @@ -11018,7 +11018,7 @@ sub_813B0B4: @ 813B0B4 lsls r1, 1 movs r2, 0x8 bl LoadPalette - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrb r1, [r0, 0x5] ldrb r2, [r0, 0x4] @@ -11109,7 +11109,7 @@ increment_var_x4026_on_birth_island_modulo_100: @ 813B184 bl VarGet lsls r0, 16 lsrs r2, r0, 16 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0, 0x4] ldr r0, =0x00003a1a @@ -11272,7 +11272,7 @@ _0813B2DC: thumb_func_start sub_813B2E4 sub_813B2E4: @ 813B2E4 push {r4,lr} - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r4, r0, 16 ldr r0, =0x00004038 @@ -11304,7 +11304,7 @@ _0813B330: ands r4, r0 cmp r4, 0 bne _0813B354 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r4, r0, 16 _0813B340: @@ -11316,7 +11316,7 @@ _0813B340: b _0813B36A .pool _0813B354: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r4, r0, 16 ldr r0, =0x00004037 @@ -11340,7 +11340,7 @@ sub_813B374: @ 813B374 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r2, =gUnknown_085B3400 subs r1, r4, 0x1 adds r1, r2 @@ -11383,7 +11383,7 @@ sub_813B3B0: @ 813B3B0 adds r0, r5, 0 movs r1, 0 bl VarSet - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] movs r0, 0x4 ldrsb r0, [r1, r0] @@ -11400,7 +11400,7 @@ sub_813B3B0: @ 813B3B0 b _0813B478 .pool _0813B414: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] movs r1, 0x4 ldrsb r1, [r2, r1] @@ -11470,7 +11470,7 @@ sub_813B484: @ 813B484 sub_813B490: @ 813B490 push {r4-r7,lr} movs r3, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r4, [r0] movs r6, 0x4 ldrsb r6, [r4, r6] @@ -11559,7 +11559,7 @@ _0813B52E: sub_813B534: @ 813B534 push {lr} ldr r2, =gUnknown_0203AB70 - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r0, [r1] str r0, [r2] movs r0, 0 @@ -11823,13 +11823,13 @@ _0813B790: b _0813B7C6 .pool _0813B7A8: - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _0813B7B4 bl sub_800AC34 _0813B7B4: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, =gUnknown_0203AB70 ldr r1, [r1] str r1, [r0] @@ -11986,7 +11986,7 @@ _0813B8EA: adds r7, r6, 0x1 mov r8, r7 _0813B8F4: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] movs r2, 0 ldrsh r0, [r1, r2] @@ -12067,7 +12067,7 @@ sub_813B968: @ 813B968 thumb_func_start sub_813B9A0 sub_813B9A0: @ 813B9A0 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0, 0x1C] movs r0, 0xB0 @@ -12085,7 +12085,7 @@ _0813B9B6: thumb_func_start sub_813B9C0 sub_813B9C0: @ 813B9C0 push {r4,lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x4 ldrsb r1, [r0, r1] @@ -12126,7 +12126,7 @@ _0813BA08: thumb_func_start sub_813BA10 sub_813BA10: @ 813BA10 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x0000141e adds r1, r0, r2 @@ -12148,9 +12148,9 @@ sub_813BA30: @ 813BA30 cmp r0, 0 beq _0813BA52 bl sub_813BCE8 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrh r0, [r0, 0xE] movs r2, 0xA1 @@ -12166,7 +12166,7 @@ _0813BA52: thumb_func_start sub_813BA60 sub_813BA60: @ 813BA60 push {r4,lr} - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] ldr r1, =0x0000141e adds r0, r1 @@ -12179,7 +12179,7 @@ sub_813BA60: @ 813BA60 bl sub_813BF60 bl sub_813BD84 ldr r1, [r4] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrh r0, [r0, 0xE] movs r2, 0xA1 @@ -12218,7 +12218,7 @@ sub_813BADC: @ 813BADC lsrs r0, 16 cmp r0, 0x2 bne _0813BB58 - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] ldr r5, =0x0000141e adds r3, r0, r5 @@ -12260,7 +12260,7 @@ _0813BB54: adds r0, r2, r0 strh r0, [r3] _0813BB58: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x0000141e adds r0, r1 @@ -12279,7 +12279,7 @@ sub_813BB74: @ 813BB74 sub sp, 0x8 movs r3, 0 movs r5, 0 - ldr r7, =gUnknown_03005D8C + ldr r7, =gSaveBlock1Ptr ldr r2, =0x0000141e movs r6, 0x1 _0813BB82: @@ -12296,7 +12296,7 @@ _0813BB82: adds r3, r5, 0 str r2, [sp] str r3, [sp, 0x4] - bl GenerateRandomNumber + bl Random adds r1, r6, 0 ands r1, r0 ldr r2, [sp] @@ -12318,7 +12318,7 @@ _0813BBC8: lsrs r5, r0, 24 cmp r5, 0x7 bls _0813BB82 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r0, =0x0000141e adds r2, r0 @@ -12366,7 +12366,7 @@ _0813BC1E: b _0813BC8C _0813BC2E: movs r5, 0 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr mov r8, r2 ldr r0, =0x0000141e mov r9, r0 @@ -12384,7 +12384,7 @@ _0813BC3A: cmp r1, 0 beq _0813BC5E mov r10, r5 - bl GenerateRandomNumber + bl Random adds r1, r4, 0 ands r1, r0 cmp r1, 0 @@ -12395,7 +12395,7 @@ _0813BC5E: lsrs r5, r0, 24 cmp r5, 0x7 bls _0813BC3A - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x0000141e adds r4, r0, r2 @@ -12431,7 +12431,7 @@ sub_813BCA8: @ 813BCA8 push {r4,r5,lr} movs r3, 0 movs r2, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x0000141e adds r0, r1 @@ -12465,7 +12465,7 @@ _0813BCCE: sub_813BCE8: @ 813BCE8 push {r4-r6,lr} movs r5, 0 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r0, [r2] ldrh r1, [r0, 0xE] ldr r0, =0x000003e6 @@ -12477,7 +12477,7 @@ sub_813BCE8: @ 813BCE8 _0813BD04: ldr r0, [r6] ldrh r1, [r0, 0xE] - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] movs r2, 0xA1 lsls r2, 5 @@ -12503,7 +12503,7 @@ _0813BD32: lsrs r0, 16 cmp r0, 0x4 bhi _0813BD54 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, [r6] ldrh r0, [r0, 0xE] @@ -12524,7 +12524,7 @@ _0813BD58: thumb_func_start sub_813BD60 sub_813BD60: @ 813BD60 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x0000141e adds r0, r1 @@ -12540,7 +12540,7 @@ sub_813BD60: @ 813BD60 thumb_func_start sub_813BD84 sub_813BD84: @ 813BD84 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r0, =0x0000141e adds r2, r0 @@ -12608,7 +12608,7 @@ _0813BE10: movs r3, 0x1 movs r2, 0x5 _0813BE14: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003150 adds r0, r1 @@ -12649,46 +12649,46 @@ _0813BE58: .4byte _0813BEAC .4byte _0813BEC0 _0813BE70: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EAD14 - bl CopyString + bl StringCopy b _0813BF04 .pool _0813BE84: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EAD1B - bl CopyString + bl StringCopy b _0813BF04 .pool _0813BE98: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EAD22 - bl CopyString + bl StringCopy b _0813BF04 .pool _0813BEAC: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EAD29 - bl CopyString + bl StringCopy b _0813BF04 .pool _0813BEC0: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EAD30 - bl CopyString + bl StringCopy b _0813BF04 .pool _0813BED4: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EAD0C - bl CopyString + bl StringCopy b _0813BF04 .pool _0813BEE8: - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 adds r0, r4, 0 movs r2, 0x7 - bl CopyString_LimitN + bl StringCopyN movs r0, 0xFF strb r0, [r4, 0x7] adds r0, r6, 0 @@ -12696,7 +12696,7 @@ _0813BEE8: adds r0, r5 ldrb r1, [r0] adds r0, r4, 0 - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString _0813BF04: pop {r4-r6} pop {r0} @@ -12730,7 +12730,7 @@ _0813BF40: thumb_func_start sub_813BF44 sub_813BF44: @ 813BF44 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x0000141e adds r0, r1 @@ -12744,7 +12744,7 @@ sub_813BF44: @ 813BF44 thumb_func_start sub_813BF60 sub_813BF60: @ 813BF60 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =0x0000141e adds r1, r0 diff --git a/asm/rom_8034C54.s b/asm/rom_8034C54.s index 191e4f90d..46baa8601 100644 --- a/asm/rom_8034C54.s +++ b/asm/rom_8034C54.s @@ -387,7 +387,7 @@ sub_8034EFC: @ 8034EFC mov r9, r2 _08034F46: lsls r0, r5, 3 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain adds r3, r0, r1 ldrh r1, [r4, 0xE] adds r0, r3, 0 @@ -456,7 +456,7 @@ _08034F46: bcc _08034F46 _08034FCE: subs r5, 0x1 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain lsls r3, r5, 3 adds r3, r0 movs r2, 0xC @@ -576,7 +576,7 @@ sub_80350B0: @ 80350B0 str r2, [sp] ldr r5, [r0, 0x14] ldrb r7, [r0, 0x1] - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain mov r10, r0 cmp r5, 0 beq _0803511A @@ -676,7 +676,7 @@ sub_8035164: @ 8035164 str r0, [r1] adds r7, r3, 0 mov r10, r1 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain mov r9, r0 cmp r5, 0 beq _0803524C @@ -840,7 +840,7 @@ _080352E0: lsls r0, r3, 3 adds r1, r0, 0 adds r1, 0x39 - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain adds r7, r1, r2 adds r0, 0x3C adds r6, r0, r2 @@ -903,7 +903,7 @@ _0803535A: ldrb r0, [r0, 0x3] cmp r9, r0 bge _0803538A - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r5, 0x4 negs r5, r5 movs r4, 0x2 @@ -929,7 +929,7 @@ _0803538A: cmp r1, 0 beq _080353B0 lsls r0, r3, 3 - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain adds r0, r2 adds r0, 0x39 ldrb r2, [r0] @@ -941,7 +941,7 @@ _0803538A: .pool _080353B0: lsls r2, r3, 3 - ldr r4, =gUnknown_030022C0 + ldr r4, =gMain adds r2, r4 adds r2, 0x39 ldrb r1, [r2] @@ -985,7 +985,7 @@ sub_80353DC: @ 80353DC ldrb r2, [r2, 0x1] cmp r0, 0 beq _08035426 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r7, 0x4 negs r7, r7 movs r6, 0x2 @@ -1071,7 +1071,7 @@ sub_803547C: @ 803547C beq _080354D8 cmp r1, 0 beq _0803550C - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r5, 0x4 negs r5, r5 movs r4, 0x2 @@ -1094,7 +1094,7 @@ _080354BC: _080354D8: cmp r1, 0 beq _080354FA - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r5, 0x4 negs r5, r5 adds r3, 0x1 @@ -1318,7 +1318,7 @@ trs_config: @ 8035658 movs r0, 0 movs r2, 0x4 bl InitBgsFromTemplates - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 11 @@ -1398,7 +1398,7 @@ sub_803570C: @ 803570C movs r1, 0x50 movs r2, 0x20 bl LoadCompressedPalette - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 11 @@ -1427,7 +1427,7 @@ _0803575A: thumb_func_start load_battle_oval_graphics load_battle_oval_graphics: @ 8035770 push {r4,r5,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x023f0902 ands r0, r1 @@ -1715,7 +1715,7 @@ sub_8035AE4: @ 8035AE4 lsrs r4, 24 mov r9, r4 movs r4, 0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -1892,7 +1892,7 @@ sub_8035C4C: @ 8035C4C b _08035D68 .pool _08035C68: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -2037,7 +2037,7 @@ _08035DA4: _08035DAA: b _08036138 _08035DAC: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -2238,7 +2238,7 @@ _08035F64: beq _08035FCC ldr r4, =gUnknown_02022E18 ldrh r0, [r5, 0xA] - bl sine2 + bl Sin2 lsls r0, 16 asrs r0, 16 cmp r0, 0 @@ -2253,7 +2253,7 @@ _08035F7E: strh r0, [r4] ldr r4, =gUnknown_02022E1C ldrh r0, [r5, 0xC] - bl sine2 + bl Sin2 lsls r0, 16 asrs r0, 16 cmp r0, 0 @@ -2277,7 +2277,7 @@ _08035F9C: _08035FCC: ldr r4, =gUnknown_02022E18 ldrh r0, [r5, 0xA] - bl sine2 + bl Sin2 lsls r0, 16 asrs r0, 16 cmp r0, 0 @@ -2292,7 +2292,7 @@ _08035FDE: strh r0, [r4] ldr r4, =gUnknown_02022E1A ldrh r0, [r5, 0xA] - bl cosine2 + bl Cos2 lsls r0, 16 asrs r0, 16 cmp r0, 0 @@ -2304,7 +2304,7 @@ _08035FFC: strh r0, [r4] ldr r4, =gUnknown_02022E1C ldrh r0, [r5, 0xC] - bl sine2 + bl Sin2 lsls r0, 16 asrs r0, 16 cmp r0, 0 @@ -2319,7 +2319,7 @@ _08036014: strh r0, [r4] ldr r4, =gUnknown_02022E1E ldrh r0, [r5, 0xC] - bl cosine2 + bl Cos2 lsls r0, 16 asrs r0, 16 cmp r0, 0 @@ -2460,7 +2460,7 @@ _08036138: thumb_func_start sub_8036154 sub_8036154: @ 8036154 push {r4,r5,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x2 ands r0, r1 @@ -2720,7 +2720,7 @@ _08036424: b _08036758 .pool _08036434: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x023f0902 ands r0, r1 @@ -2820,7 +2820,7 @@ _0803651A: b _08036758 .pool _0803652C: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x023f0902 ands r0, r1 @@ -2833,7 +2833,7 @@ _0803653A: ands r0, r1 cmp r0, 0 beq _08036568 - ldr r0, =gUnknown_82E9530 + ldr r0, =gGameVersion ldrb r0, [r0] cmp r0, 0x2 bne _08036560 @@ -2931,7 +2931,7 @@ _08036626: b _08036758 .pool _08036638: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x023f0902 ands r0, r1 @@ -2944,7 +2944,7 @@ _08036646: ands r0, r1 cmp r0, 0 beq _08036674 - ldr r0, =gUnknown_82E9530 + ldr r0, =gGameVersion ldrb r0, [r0] cmp r0, 0x2 bne _0803666C @@ -3070,7 +3070,7 @@ sub_8036760: @ 8036760 bl dp11_init bl init_uns_table_pokemon_copy bl sub_8185F84 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x40 ands r0, r1 @@ -3144,7 +3144,7 @@ sub_80367D4: @ 80367D4 ldr r0, =gUnknown_02022E24 movs r2, 0xF0 strh r2, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 15 @@ -3228,7 +3228,7 @@ _080368BE: bl sub_80B0BD0 ldr r2, =gUnknown_02022FF0 strb r0, [r2] - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags ldr r0, [r4] movs r1, 0x80 lsls r1, 17 @@ -3280,13 +3280,13 @@ _080369A8: ldr r0, =sub_8036FAC bl SetMainCallback2 _080369AE: - ldr r5, =gUnknown_02022FEC + ldr r5, =gBattleTypeFlags ldr r0, [r5] ldr r1, =0x01000002 ands r0, r1 cmp r0, 0 bne _080369E8 - ldr r4, =gUnknown_02024744 + ldr r4, =gEnemyParty ldr r0, =gUnknown_02038BCA ldrh r1, [r0] adds r0, r4, 0 @@ -3308,14 +3308,14 @@ _080369AE: _080369E4: bl sub_806EA68 _080369E8: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r2, =0x00000439 adds r1, r2 ldrb r0, [r1] movs r2, 0x2 orrs r0, r2 strb r0, [r1] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r5, =0x00000ca9 adds r1, r5 @@ -3324,7 +3324,7 @@ _080369E8: negs r0, r0 ands r0, r2 strb r0, [r1] - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty movs r0, 0xFA lsls r0, 1 adds r5, r4, r0 @@ -3362,21 +3362,21 @@ _08036A72: movs r0, 0x64 mov r4, r9 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r5, r0, 16 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r7, r0, 16 adds r0, r4, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 cmp r5, 0 beq _08036AEE @@ -3470,7 +3470,7 @@ sub_8036B44: @ 8036B44 cmp r0, 0x1 bne _08036BC0 movs r2, 0 - ldr r7, =gUnknown_03005D8C + ldr r7, =gSaveBlock1Ptr movs r1, 0xC6 lsls r1, 1 adds r5, r1 @@ -3491,7 +3491,7 @@ _08036B66: strb r0, [r1] movs r2, 0 adds r3, r5, 0 - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr ldr r5, =0x00003214 _08036B86: adds r0, r3, r2 @@ -3561,7 +3561,7 @@ berry_801017C: @ 8036C08 mov r6, r9 mov r5, r8 push {r5-r7} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x2 ands r0, r1 @@ -3574,7 +3574,7 @@ _08036C20: bne _08036CDC movs r5, 0 ldr r3, =gUnknown_02024404 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr mov r8, r0 adds r6, r3, 0 mov r4, r8 @@ -3609,7 +3609,7 @@ _08036C3A: movs r5, 0 adds r7, r3, 0 adds r7, 0x8 - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r2, =0x00003214 adds r6, r3, 0 adds r6, 0x40 @@ -3912,13 +3912,13 @@ sub_8036EB8: @ 8036EB8 bne _08036EFC cmp r3, 0 bne _08036EEC - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r2, 0xC b _08036EF2 .pool _08036EEC: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r2, 0x8 _08036EF2: @@ -3952,13 +3952,13 @@ _08036F20: bne _08036F48 cmp r3, 0 bne _08036F38 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r2, 0xC b _08036F3E .pool _08036F38: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r2, 0x8 _08036F3E: @@ -3971,7 +3971,7 @@ _08036F48: cmp r6, 0 bne _08036FA0 movs r2, 0 - ldr r5, =gUnknown_02022FEC + ldr r5, =gBattleTypeFlags cmp r2, r4 bge _08036F8A mov r0, r12 @@ -4091,7 +4091,7 @@ _0803703C: movs r0, 0x1 strb r0, [r1] _08037068: - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _08037072 @@ -4101,7 +4101,7 @@ _08037072: b _0803744C .pool _08037080: - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r1, [r2] movs r6, 0x2 adds r0, r1, 0 @@ -4154,7 +4154,7 @@ _080370D8: ldr r0, =gUnknown_02024332 strb r6, [r0] _080370EE: - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _080370F8 @@ -4249,7 +4249,7 @@ _080371E4: bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty movs r2, 0xC8 bl link_0800A448 ldr r1, =gUnknown_02024332 @@ -4264,7 +4264,7 @@ _08037200: b _0803744C _0803720E: bl sub_800A5B4 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty lsls r1, r5, 8 ldr r2, =gUnknown_020223C4 adds r1, r2 @@ -4366,7 +4366,7 @@ _08037318: movs r0, 0 strb r0, [r2, 0x1] strb r0, [r2, 0x2] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -4426,7 +4426,7 @@ _080373A0: cmp r1, 0x3 bne _0803744C bl sub_800A5B4 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x4 ands r0, r1 @@ -4450,14 +4450,14 @@ _080373E0: cmp r0, 0 beq _0803744C ldr r2, =gUnknown_03005D00 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, [r1] str r0, [r2] ldr r0, =sub_8039EF0 str r0, [r1] ldr r0, =sub_8038420 bl SetMainCallback2 - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r1, [r2] movs r0, 0x2 ands r0, r1 @@ -4559,13 +4559,13 @@ _080374E0: movs r0, 0x1 strb r0, [r1] _0803750C: - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _08037518 bl sub_800E0E8 _08037518: - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r1, [r2] movs r3, 0x2 adds r0, r1, 0 @@ -4644,7 +4644,7 @@ _08037530: movs r0, 0x2 strb r0, [r1] _080375C4: - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _080375CE @@ -4716,7 +4716,7 @@ _0803767C: bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty _08037686: movs r2, 0xC8 bl link_0800A448 @@ -4739,7 +4739,7 @@ _080376A2: ldrh r0, [r1, 0x18] cmp r0, 0 beq _080376E8 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty lsls r1, r7, 8 ldr r5, =gUnknown_020223C4 adds r1, r5 @@ -4757,7 +4757,7 @@ _080376A2: b _08037986 .pool _080376E8: - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty lsls r1, r6, 8 ldr r5, =gUnknown_020223C4 adds r1, r5 @@ -4849,7 +4849,7 @@ _080377BC: bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty b _08037686 .pool _080377CC: @@ -4867,7 +4867,7 @@ _080377DA: bne _080377EA b _08037986 _080377EA: - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty ldr r1, =gUnknown_020223C4 movs r2, 0xC8 b _08037982 @@ -4936,7 +4936,7 @@ _08037872: movs r2, 0xC8 bl memcpy _0803788A: - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4, 0 bl shedinja_something adds r0, r4, 0 @@ -4957,7 +4957,7 @@ _0803788A: lsls r1, 1 adds r0, r4, r1 bl shedinja_something - ldr r4, =gUnknown_02024744 + ldr r4, =gEnemyParty adds r0, r4, 0 bl shedinja_something adds r0, r4, 0 @@ -4987,7 +4987,7 @@ _08037908: movs r0, 0 strb r0, [r2, 0x1] strb r0, [r2, 0x2] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -5021,7 +5021,7 @@ _0803795C: cmp r1, 0x3 bne _080379D6 bl sub_800A5B4 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x4 ands r0, r1 @@ -5050,14 +5050,14 @@ _080379A0: beq _080379D6 bl sub_8166188 ldr r2, =gUnknown_03005D00 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, [r1] str r0, [r2] ldr r0, =sub_8039EF0 str r0, [r1] ldr r0, =sub_8038420 bl SetMainCallback2 - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r1, [r2] movs r0, 0x2 ands r0, r1 @@ -5095,17 +5095,17 @@ _08037A12: movs r0, 0x64 adds r4, r1, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData mov r1, r8 lsls r5, r1, 5 strh r0, [r6] adds r0, r4, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData strh r0, [r6, 0x2] movs r0, 0x4 add r0, r10 @@ -5114,38 +5114,38 @@ _08037A12: adds r0, r4, 0 movs r1, 0x2 adds r2, r7, 0 - bl pokemon_getattr + bl GetMonData adds r0, r4, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData strb r0, [r6, 0xF] adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData strh r0, [r6, 0x10] adds r0, r4, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData strh r0, [r6, 0x12] adds r0, r4, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData mov r1, r10 adds r1, 0x14 adds r5, r1 str r0, [r5] adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData str r0, [r6, 0x18] adds r0, r4, 0 bl pokemon_get_gender strb r0, [r6, 0x1C] adds r0, r7, 0 - bl StripExtendedControlCodes + bl StripExtCtrlCodes adds r0, r4, 0 movs r1, 0x3 - bl pokemon_getattr + bl GetMonData cmp r0, 0x1 beq _08037AA4 adds r0, r7, 0 @@ -5186,7 +5186,7 @@ sub_8037ADC: @ 8037ADC movs r0, 0x4 mov r9, r0 movs r4, 0xF - ldr r6, =gUnknown_02022FEC + ldr r6, =gBattleTypeFlags ldr r0, [r6] movs r1, 0x80 lsls r1, 1 @@ -5338,11 +5338,11 @@ _08037C2E: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, [r1, 0x8] ldr r2, [sp] str r0, [r2] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] mov r2, r10 str r0, [r2] @@ -5365,7 +5365,7 @@ _08037C64: ldrb r0, [r5] adds r0, 0x1 strb r0, [r5] - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _08037C98 @@ -5376,7 +5376,7 @@ _08037C98: bl sub_800AC34 b _08037D0A _08037C9E: - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _08037CE4 @@ -5387,7 +5387,7 @@ _08037C9E: mov r1, r10 ldr r0, [r1] str r0, [r6] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r2, [sp] ldr r0, [r2] str r0, [r1, 0x8] @@ -5408,7 +5408,7 @@ _08037CE4: mov r1, r10 ldr r0, [r1] str r0, [r6] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r2, [sp] ldr r0, [r2] str r0, [r1, 0x8] @@ -5463,11 +5463,11 @@ _08037D64: ldrb r0, [r5] adds r0, 0x1 strb r0, [r5] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, [r1, 0x8] mov r2, r8 str r0, [r2] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] str r0, [r7] ldr r0, =intro_end @@ -5486,10 +5486,10 @@ _08037DA4: bne _08037DD6 movs r0, 0x2 strb r0, [r5] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r0, [r7] str r0, [r1] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain mov r2, r8 ldr r0, [r2] str r0, [r1, 0x8] @@ -5566,7 +5566,7 @@ _08037E64: movs r0, 0x1 strb r0, [r1] _08037E90: - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _08037E9A @@ -5576,7 +5576,7 @@ _08037E9A: b _080383F8 .pool _08037EA8: - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r1, [r2] movs r0, 0x2 ands r0, r1 @@ -5618,7 +5618,7 @@ _08037EBE: adds r0, 0x1 strb r0, [r1] _08037F02: - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _08037F0C @@ -5757,7 +5757,7 @@ _08038032: bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty movs r2, 0xC8 bl link_0800A448 b _080383A6 @@ -5796,7 +5796,7 @@ _0803808C: cmp r0, 0x3 bne _0803812A _08038090: - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty b _08038110 .pool _08038098: @@ -5843,7 +5843,7 @@ _080380E4: cmp r0, 0x3 bne _0803812A _080380E8: - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty b _08038110 .pool _080380F0: @@ -5864,7 +5864,7 @@ _0803810A: cmp r0, 0x3 bne _0803812A _0803810E: - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty _08038110: adds r1, r4, 0 movs r2, 0xC8 @@ -6023,7 +6023,7 @@ _08038242: adds r6, 0x1 cmp r6, 0x3 ble _08038184 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4, 0 bl shedinja_something adds r0, r4, 0 @@ -6044,7 +6044,7 @@ _08038242: lsls r1, 1 adds r0, r4, r1 bl shedinja_something - ldr r4, =gUnknown_02024744 + ldr r4, =gEnemyParty adds r0, r4, 0 bl shedinja_something adds r0, r4, 0 @@ -6074,7 +6074,7 @@ _080382CC: movs r0, 0 strb r0, [r3, 0x1] strb r0, [r3, 0x2] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -6123,7 +6123,7 @@ _0803832C: movs r0, 0xC0 lsls r0, 1 adds r4, r0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] str r0, [r4] ldr r0, =gUnknown_0203BD2C @@ -6181,14 +6181,14 @@ _080383BC: cmp r0, 0 beq _080383F8 ldr r2, =gUnknown_03005D00 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, [r1] str r0, [r2] ldr r0, =sub_8039EF0 str r0, [r1] ldr r0, =sub_8038420 bl SetMainCallback2 - ldr r3, =gUnknown_02022FEC + ldr r3, =gBattleTypeFlags ldr r2, [r3] movs r0, 0x2 ands r0, r2 @@ -6221,13 +6221,13 @@ sub_8038420: @ 8038420 bl RunTextPrinters bl UpdatePaletteFade bl RunTasks - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2C] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq _08038482 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -6264,7 +6264,7 @@ _08038482: thumb_func_start sub_803849C sub_803849C: @ 803849C push {lr} - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =gUnknown_03005D00 ldr r0, [r0] str r0, [r1] @@ -6305,7 +6305,7 @@ sub_80384E4: @ 80384E4 bl m4aMPlayStop bl sub_803849C bl FreeAllWindowBuffers - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r0, [r0, 0x8] bl SetMainCallback2 _08038512: @@ -6439,7 +6439,7 @@ LoadTrainerParty: @ 80385E8 movs r0, 0 b _080389E2 _08038610: - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags ldr r0, [r4] ldr r1, =0x043f0908 ands r0, r1 @@ -6910,7 +6910,7 @@ _080389B4: bge _080389BC b _08038688 _080389BC: - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r1, =gTrainers ldr r3, [sp, 0x20] ldr r4, [sp, 0x14] @@ -6965,13 +6965,13 @@ _08038A1E: thumb_func_start vblank_cb_08078BB4 vblank_cb_08078BB4: @ 8038A28 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x013f0102 ands r0, r1 cmp r0, 0 bne _08038A3A - bl GenerateRandomNumber + bl Random _08038A3A: ldr r0, =gUnknown_02022E14 ldrh r1, [r0] @@ -7127,7 +7127,7 @@ sub_8038B94: @ 8038B94 ldr r0, =gUnknown_02024474 adds r0, 0x25 ldrb r2, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -7153,16 +7153,16 @@ _08038BE8: cmp r0, 0x3 bne _08038C0C _08038BF0: - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty str r0, [sp, 0x4] - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty str r1, [sp, 0x8] b _08038C0C .pool _08038C04: - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty str r2, [sp, 0x4] - ldr r3, =gUnknown_02024744 + ldr r3, =gEnemyParty str r3, [sp, 0x8] _08038C0C: movs r7, 0 @@ -7183,17 +7183,17 @@ _08038C20: adds r4, r3, r4 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r5, r0, 16 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r6, r0, 16 adds r0, r4, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 cmp r5, 0 beq _08038C90 @@ -7262,17 +7262,17 @@ _08038CBA: adds r4, r2, r4 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r5, r0, 16 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r6, r0, 16 adds r0, r4, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 cmp r5, 0 beq _08038D2A @@ -7345,7 +7345,7 @@ sub_8038D64: @ 8038D64 bl SetHBlankCallback movs r0, 0 bl SetVBlankCallback - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r2, 0x21 negs r2, r2 @@ -7355,7 +7355,7 @@ sub_8038D64: @ 8038D64 ands r0, r1 cmp r0, 0 beq _08038DAC - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r0, [r0, 0x8] bl SetMainCallback2 bl sub_8057028 @@ -7569,7 +7569,7 @@ _08038FC2: b _080391C6 _08038FD0: bl sub_8185FAC - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldr r1, =0x00000439 adds r2, r1 movs r1, 0x1 @@ -7581,7 +7581,7 @@ _08038FD0: ands r0, r3 orrs r0, r1 strb r0, [r2] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -7591,7 +7591,7 @@ _08038FD0: movs r3, 0x4 _08038FFC: movs r4, 0 - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr cmp r4, r3 bge _08039022 ldr r1, =gUnknown_020229E8 @@ -7632,7 +7632,7 @@ _08039022: b _080391C6 .pool _08039074: - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldr r1, =0x00000439 adds r0, r2, r1 ldrb r1, [r0] @@ -7654,7 +7654,7 @@ _08039090: b _08039172 .pool _080390AC: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r0, [r0, 0x8] _080390B0: bl SetMainCallback2 @@ -7734,7 +7734,7 @@ _0803914C: bne _080391C6 b _08039172 _08039166: - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _08039172 @@ -7748,7 +7748,7 @@ _08039174: b _080391C6 .pool _08039184: - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldr r1, =0x00000439 adds r0, r2, r1 ldrb r1, [r0] @@ -7757,7 +7757,7 @@ _08039184: adds r3, r2, 0 cmp r0, 0 beq _080391A6 - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _080391A6 @@ -8008,7 +8008,7 @@ _080393F4: b _0803975C .pool _08039414: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -8084,7 +8084,7 @@ _080394AC: b _080396EA .pool _080394D8: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 @@ -8175,7 +8175,7 @@ _0803958A: movs r2, 0x1D movs r3, 0xD bl sub_8056A3C - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -8202,7 +8202,7 @@ _080395CC: beq _080395DA b _0803975E _080395DA: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -8210,7 +8210,7 @@ _080395DA: ands r0, r1 cmp r0, 0 beq _080395F6 - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _080395F6 @@ -8222,7 +8222,7 @@ _080395F6: b _0803975C .pool _08039610: - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldr r1, =0x00000439 adds r0, r2, r1 ldrb r1, [r0] @@ -8231,7 +8231,7 @@ _08039610: adds r3, r2, 0 cmp r0, 0 beq _08039634 - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _08039634 @@ -8301,7 +8301,7 @@ _080396A8: lsls r0, 24 cmp r0, 0 bne _0803975E - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -8326,7 +8326,7 @@ _08039704: lsrs r4, r0, 16 cmp r4, 0 bne _0803975E - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -8379,23 +8379,23 @@ shedinja_something: @ 803976C strb r0, [r5] adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData ldr r1, =0x0000012f cmp r0, r1 bne _080397B4 adds r0, r4, 0 movs r1, 0x3 - bl pokemon_getattr + bl GetMonData ldrb r1, [r5] cmp r0, r1 beq _080397B4 adds r0, r4, 0 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData ldr r1, =gUnknown_0831ACA0 mov r0, sp - bl CompareStringWithoutExtendedControlCodes + bl StringCompareWithoutExtCtrlCodes cmp r0, 0 bne _080397B4 adds r0, r4, 0 @@ -8635,10 +8635,10 @@ _08039960: mov r1, r8 muls r1, r0 adds r0, r1, 0 - ldr r7, =gUnknown_02024744 + ldr r7, =gEnemyParty adds r0, r7 movs r1, 0 - bl pokemon_getattr + bl GetMonData cmp r4, 0xC9 bne _080399E4 ldrh r0, [r5] @@ -8647,7 +8647,7 @@ _08039960: adds r0, r1, 0 adds r0, r7 movs r1, 0 - bl pokemon_getattr + bl GetMonData adds r2, r0, 0 movs r0, 0xC0 lsls r0, 18 @@ -8893,7 +8893,7 @@ sub_8039B58: @ 8039B58 ands r0, r1 cmp r0, 0 beq _08039B80 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 @@ -9039,7 +9039,7 @@ _08039C76: cmp r0, 0 bne _08039D2C ldr r0, =objc_dp11b_pingpong - bl object_new_hidden_with_callback + bl CreateInvisibleSpriteWithCallback lsls r0, 24 lsrs r5, r0, 24 mov r0, r8 @@ -9235,7 +9235,7 @@ _08039E10: _08039E14: movs r2, 0x32 ldrsh r1, [r4, r2] - bl sine + bl Sin ldr r2, =gUnknown_02020630 lsls r1, r5, 4 adds r1, r5 @@ -9486,9 +9486,9 @@ _08039FDC: movs r1, 0 ldr r2, =gUnknown_0202420B strb r1, [r2] - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex strb r1, [r0] - ldr r2, =gUnknown_020243CC + ldr r2, =gBattleWeather strh r1, [r2] ldr r1, =gUnknown_020243D0 movs r2, 0 @@ -9502,7 +9502,7 @@ _0803A004: ldr r2, =gUnknown_02024280 movs r0, 0 str r0, [r2] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 17 @@ -9513,7 +9513,7 @@ _0803A004: ands r1, r0 cmp r1, 0 bne _0803A0AE - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r1, [r0, 0x15] movs r0, 0x4 @@ -9541,7 +9541,7 @@ _0803A0AC: str r0, [r2] _0803A0AE: ldr r3, =gUnknown_02024474 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x15] lsls r0, 30 @@ -9567,13 +9567,13 @@ _0803A0AE: adds r0, 0x20 strb r2, [r0] ldr r5, =gUnknown_0202432C - ldr r6, =gUnknown_020241F0 + ldr r6, =gBattleMoveDamage ldr r7, =gUnknown_020243FC ldr r0, =gUnknown_03005D54 mov r8, r0 ldr r1, =gUnknown_02024210 mov r9, r1 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty mov r10, r2 ldr r1, =gUnknown_02024332 movs r2, 0 @@ -9606,7 +9606,7 @@ _0803A0FA: strb r4, [r0] mov r0, r10 movs r1, 0xB - bl pokemon_getattr + bl GetMonData ldr r6, [r5] adds r6, 0x7C ldr r2, =gBaseStats @@ -9689,7 +9689,7 @@ _0803A1BA: ldr r0, [r6] adds r0, 0x92 strb r1, [r0] - bl GenerateRandomNumber + bl Random ldr r1, =gUnknown_02024330 strh r0, [r1] ldr r1, =gUnknown_03005D10 @@ -9701,7 +9701,7 @@ _0803A1E4: adds r2, 0x1 cmp r2, 0x43 bls _0803A1E4 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty bl sub_806EBA4 ldr r3, =gUnknown_03005D10 movs r1, 0x1 @@ -9773,7 +9773,7 @@ sub_803A284: @ 803A284 movs r5, 0 mov r6, r9 movs r4, 0x58 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons adds r2, 0x18 movs r1, 0x6 _0803A2D4: @@ -9855,7 +9855,7 @@ _0803A35C: movs r0, 0x58 adds r2, r1, 0 muls r2, r0 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r0, 0x50 adds r2, r0 ldr r0, [r2] @@ -9925,7 +9925,7 @@ _0803A414: ldrb r1, [r0] movs r0, 0x58 muls r0, r1 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons adds r1, 0x50 adds r0, r1 movs r1, 0 @@ -9946,7 +9946,7 @@ _0803A430: cmp r5, r7 bge _0803A490 ldr r3, =gUnknown_020240D4 - ldr r7, =gUnknown_0832A328 + ldr r7, =gBitTable ldr r6, =gUnknown_02024064 _0803A448: movs r0, 0x58 @@ -10079,7 +10079,7 @@ _0803A4B4: strb r1, [r0, 0x14] _0803A540: movs r0, 0 - ldr r6, =gUnknown_0202427C + ldr r6, =gBattleMoveFlags strb r0, [r6] mov r7, r9 ldrb r1, [r7] @@ -10203,7 +10203,7 @@ _0803A540: adds r1, 0x92 ldrb r0, [r7] lsls r0, 2 - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable adds r0, r6 ldr r2, [r0] ldrb r0, [r1] @@ -10321,7 +10321,7 @@ sub_803A75C: @ 803A75C push {r5-r7} sub sp, 0x4 movs r5, 0 - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldr r0, =gUnknown_020242AC mov r8, r0 ldr r1, =gUnknown_0202449C @@ -10366,7 +10366,7 @@ _0803A788: bge _0803A830 adds r3, r2, 0 movs r4, 0 - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable mov r8, r0 _0803A7C6: ldr r1, [r3] @@ -10727,7 +10727,7 @@ _0803A852: adds r1, 0x92 ldrb r0, [r6] lsls r0, 2 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable adds r0, r2 ldr r2, [r0] ldrb r0, [r1] @@ -10798,7 +10798,7 @@ _0803AB02: adds r1, r0 movs r0, 0 str r0, [r1] - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldrb r0, [r2] movs r3, 0x58 adds r2, r0, 0 @@ -10949,14 +10949,14 @@ _0803AC98: b _0803AF48 _0803ACA6: movs r7, 0x58 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons mov r8, r0 mov r9, r2 movs r1, 0x48 add r1, r8 mov r10, r1 _0803ACB4: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 ands r0, r1 @@ -11098,7 +11098,7 @@ _0803ADCA: ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution _0803ADE4: - ldr r5, =gUnknown_02022FEC + ldr r5, =gBattleTypeFlags ldr r0, [r5] movs r1, 0x8 ands r0, r1 @@ -11178,15 +11178,15 @@ _0803AE96: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r1, =gUnknown_03005D10 strh r0, [r1, 0x20] _0803AEC0: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -11211,7 +11211,7 @@ _0803AEEA: ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution _0803AEF6: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 8 @@ -11230,7 +11230,7 @@ _0803AEF6: ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution _0803AF20: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 11 @@ -11277,7 +11277,7 @@ bc_801333C: @ 803AF80 beq _0803AF92 b _0803B10C _0803AF92: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x8 ands r0, r1 @@ -11294,16 +11294,16 @@ _0803AFAA: movs r0, 0x64 adds r1, r7, 0 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0803AFD0 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData movs r1, 0xCE lsls r1, 1 cmp r0, r1 @@ -11317,11 +11317,11 @@ _0803AFD0: _0803AFE8: adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData strh r0, [r5] adds r0, r4, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData _0803AFFA: str r0, [r6] adds r6, 0x8 @@ -11346,16 +11346,16 @@ _0803B026: movs r0, 0x64 adds r1, r7, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0803B04C adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData movs r1, 0xCE lsls r1, 1 cmp r0, r1 @@ -11369,11 +11369,11 @@ _0803B04C: _0803B060: adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData strh r0, [r5] adds r0, r4, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData _0803B072: str r0, [r6] adds r6, 0x8 @@ -11403,16 +11403,16 @@ _0803B0B2: movs r0, 0x64 adds r1, r7, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0803B0D8 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData movs r1, 0xCE lsls r1, 1 cmp r0, r1 @@ -11426,11 +11426,11 @@ _0803B0D8: _0803B0E8: adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData strh r0, [r5] adds r0, r4, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData _0803B0FA: str r0, [r6] adds r6, 0x8 @@ -11501,7 +11501,7 @@ sub_803B180: @ 803B180 ldr r0, [r0] cmp r0, 0 bne _0803B1D0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r2, [r0] movs r0, 0x80 lsls r0, 17 @@ -11542,7 +11542,7 @@ _0803B1D0: thumb_func_start sub_803B1DC sub_803B1DC: @ 803B1DC push {r4,r5,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 17 @@ -11602,7 +11602,7 @@ _0803B23A: thumb_func_start sub_803B25C sub_803B25C: @ 803B25C push {r4-r6,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r2, [r0] movs r0, 0x80 lsls r0, 17 @@ -11653,7 +11653,7 @@ _0803B2B2: bl dp01_build_cmdbuf_x2F_2F_2F_2F ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x00008040 ands r0, r1 @@ -11696,7 +11696,7 @@ bc_801362C: @ 803B314 cmp r1, r0 bcs _0803B37E adds r4, r2, 0 - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons movs r5, 0x58 adds r7, r6, 0 adds r7, 0x48 @@ -11707,7 +11707,7 @@ _0803B334: lsrs r0, 24 cmp r0, 0x1 bne _0803B36C - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x063f0902 ands r0, r1 @@ -11770,7 +11770,7 @@ sub_803B3CC: @ 803B3CC ldr r0, [r0] cmp r0, 0 bne _0803B418 - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r2, [r1] movs r0, 0x80 lsls r0, 17 @@ -11813,7 +11813,7 @@ _0803B418: thumb_func_start sub_803B42C sub_803B42C: @ 803B42C push {r4,r5,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 17 @@ -11886,7 +11886,7 @@ _0803B48A: thumb_func_start sub_803B4C8 sub_803B4C8: @ 803B4C8 push {r4-r6,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 17 @@ -11934,7 +11934,7 @@ _0803B51A: bl dp01_build_cmdbuf_x2F_2F_2F_2F ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -12310,11 +12310,11 @@ _0803B834: ldr r3, =gUnknown_0202406C ldr r2, =gUnknown_0202449C ldr r6, =gUnknown_02024474 - ldr r7, =gUnknown_0202427C + ldr r7, =gBattleMoveFlags ldrb r0, [r3] cmp r5, r0 bge _0803B866 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons movs r4, 0x9 negs r4, r4 adds r1, r0, 0 @@ -12351,10 +12351,10 @@ _0803B866: ldr r0, [r2] strb r1, [r0, 0x3] strb r1, [r7] - bl GenerateRandomNumber + bl Random ldr r1, =gUnknown_02024330 strh r0, [r1] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 11 @@ -12399,7 +12399,7 @@ _0803B91C: ldrb r3, [r3] cmp r4, r3 bge _0803B96E - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons adds r6, r5, 0 adds r6, 0x4C _0803B932: @@ -12451,7 +12451,7 @@ _0803B96E: strb r1, [r0] ldr r0, [r2] strb r1, [r0, 0x3] - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags strb r1, [r0] _0803B994: pop {r4-r6} @@ -12519,9 +12519,9 @@ _0803BA0E: strb r4, [r0, 0x18] strb r4, [r0, 0x19] strb r4, [r0, 0x14] - ldr r0, =gUnknown_020241F0 + ldr r0, =gBattleMoveDamage str r4, [r0] - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags strb r4, [r0] ldr r1, =gUnknown_02024332 movs r2, 0 @@ -12606,10 +12606,10 @@ _0803BAE6: ldr r1, =gUnknown_03005D04 ldr r0, =sub_803BE74 str r0, [r1] - bl GenerateRandomNumber + bl Random ldr r1, =gUnknown_02024330 strh r0, [r1] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 10 @@ -12648,7 +12648,7 @@ _0803BB78: sub_803BB88: @ 803BB88 push {r4-r7,lr} sub sp, 0x4 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_02024064 ldrb r2, [r0] movs r0, 0x58 @@ -12679,7 +12679,7 @@ _0803BBC2: bne _0803BBD0 b _0803BD4C _0803BBD0: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -12687,7 +12687,7 @@ _0803BBD0: beq _0803BBDE b _0803BD4C _0803BBDE: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r3] movs r0, 0x58 muls r0, r2 @@ -12716,7 +12716,7 @@ _0803BC08: lsrs r0, 24 cmp r6, r0 beq _0803BC2C - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r5 adds r0, r1 @@ -12733,7 +12733,7 @@ _0803BC2C: lsrs r0, 24 cmp r6, r0 beq _0803BC76 - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r0, =gUnknown_02024064 ldrb r0, [r0] movs r2, 0x58 @@ -12785,7 +12785,7 @@ _0803BC86: lsrs r5, r0, 24 cmp r5, 0 beq _0803BCF8 - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldrb r0, [r4] movs r3, 0x58 muls r0, r3 @@ -12816,7 +12816,7 @@ _0803BCBE: b _0803BD90 .pool _0803BCF8: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_02024064 ldrb r2, [r0] movs r0, 0x58 @@ -12845,7 +12845,7 @@ _0803BD22: b _0803BD92 .pool _0803BD40: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x10 ands r0, r1 @@ -12934,7 +12934,7 @@ _0803BDBC: lsrs r1, 24 adds r0, r4, 0 bl sub_81B8FB0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -13056,7 +13056,7 @@ _0803BF0C: adds r1, 0x5C movs r0, 0x6 strb r0, [r1] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -13073,7 +13073,7 @@ _0803BF0C: ldr r1, [r4] adds r1, 0x91 ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, 24 lsrs r0, 22 adds r0, r2 @@ -13096,7 +13096,7 @@ _0803BF68: ldr r0, [r0] adds r0, 0x91 ldrb r3, [r0] - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r4, =gUnknown_02024064 ldrb r2, [r4] lsls r0, r2, 2 @@ -13109,7 +13109,7 @@ _0803BF68: adds r0, r2, r0 movs r1, 0xD strb r1, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -13131,7 +13131,7 @@ _0803BFBC: bl _0803CD04 .pool _0803BFD0: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r2 adds r1, 0x50 @@ -13169,7 +13169,7 @@ _0803C00C: .pool _0803C02C: ldr r3, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r6, =gUnknown_02024064 ldrb r5, [r6] lsls r0, r5, 2 @@ -13303,7 +13303,7 @@ _0803C134: .pool _0803C188: add r2, sp, 0x4 - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons movs r1, 0x58 adds r0, r4, 0 muls r0, r1 @@ -13372,7 +13372,7 @@ _0803C1CA: adds r4, 0x1 cmp r4, 0x3 ble _0803C1CA - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x1 ands r1, r0 @@ -13383,7 +13383,7 @@ _0803C1CA: b _0803C42E .pool _0803C230: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x021f0902 ands r0, r1 @@ -13414,7 +13414,7 @@ _0803C268: adds r0, r2 ldrh r0, [r0] strb r0, [r1] - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldrb r2, [r5] movs r6, 0x58 adds r0, r2, 0 @@ -13427,7 +13427,7 @@ _0803C268: ands r1, r0 cmp r1, 0 bne _0803C2B8 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 11 @@ -13509,7 +13509,7 @@ _0803C33C: lsrs r4, r0, 24 cmp r4, 0 beq _0803C3B0 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r5] movs r0, 0x58 muls r0, r1 @@ -13682,7 +13682,7 @@ _0803C4B4: lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons lsls r0, 24 lsrs r0, 24 movs r7, 0x58 @@ -13812,7 +13812,7 @@ _0803C616: b _0803C668 .pool _0803C628: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 10 @@ -13834,7 +13834,7 @@ _0803C628: ldrb r0, [r0] cmp r0, 0 bne _0803C690 - ldr r1, =gUnknown_03005D80 + ldr r1, =gRngValue ldr r0, =gUnknown_0203BD30 ldr r0, [r0] str r0, [r1] @@ -13873,7 +13873,7 @@ _0803C6AE: b _0803CD70 .pool _0803C6C4: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r2, [r1] movs r5, 0x8 adds r0, r2, 0 @@ -13979,7 +13979,7 @@ _0803C7C4: .pool _0803C7D8: ldr r4, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r3, =gUnknown_02024064 ldrb r5, [r3] lsls r0, r5, 2 @@ -14112,7 +14112,7 @@ _0803C8D0: b _0803CD70 .pool _0803C91C: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 10 @@ -14143,7 +14143,7 @@ _0803C942: ldrb r2, [r6] lsls r5, r2, 1 adds r5, r0 - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r4, [r4] adds r0, r2, r4 adds r0, 0x80 @@ -14287,7 +14287,7 @@ _0803CABC: .pool _0803CAD0: ldr r3, =gUnknown_02024068 - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable ldr r0, =gUnknown_02024064 ldrb r0, [r0] lsls r0, 2 @@ -14314,7 +14314,7 @@ _0803CAFA: negs r1, r0 orrs r1, r0 lsrs r4, r1, 31 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x41 ands r0, r1 @@ -14369,7 +14369,7 @@ _0803CB74: .pool _0803CB84: ldr r3, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r0, [r0] lsls r0, 2 @@ -14416,7 +14416,7 @@ _0803CBC8: .pool _0803CBF4: ldr r3, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r4, [r0] lsls r0, r4, 2 @@ -14504,7 +14504,7 @@ _0803CCB4: ldr r4, [r0] str r4, [r7] ldr r3, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r5] lsls r0, 2 adds r0, r1 @@ -14559,7 +14559,7 @@ _0803CD1E: ldr r1, =gUnknown_03005D04 ldr r0, =sub_803D2E8 str r0, [r1] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 15 @@ -14659,7 +14659,7 @@ sub_803CDF8: @ 803CDF8 adds r1, r2 ldrb r1, [r1] bl sub_8184FBC - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x42 ands r0, r1 @@ -14815,7 +14815,7 @@ b_first_side: @ 803CF10 lsls r0, 24 cmp r0, 0 bne _0803CFD8 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r2, r9 muls r2, r0 @@ -14825,7 +14825,7 @@ b_first_side: @ 803CF10 ldrb r3, [r0] cmp r3, 0x21 bne _0803CF7C - ldr r0, =gUnknown_020243CC + ldr r0, =gBattleWeather ldrh r1, [r0] movs r0, 0x7 ands r0, r1 @@ -14834,7 +14834,7 @@ b_first_side: @ 803CF10 _0803CF7C: cmp r3, 0x22 bne _0803CF98 - ldr r0, =gUnknown_020243CC + ldr r0, =gBattleWeather ldrh r1, [r0] movs r0, 0x60 ands r0, r1 @@ -14851,13 +14851,13 @@ _0803CF9A: mov r1, r10 muls r1, r0 adds r0, r1, 0 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons adds r0, r2 adds r0, 0x20 ldrb r2, [r0] cmp r2, 0x21 bne _0803CFBA - ldr r0, =gUnknown_020243CC + ldr r0, =gBattleWeather ldrh r1, [r0] movs r0, 0x7 ands r0, r1 @@ -14866,7 +14866,7 @@ _0803CF9A: _0803CFBA: cmp r2, 0x22 bne _0803CFDA - ldr r0, =gUnknown_020243CC + ldr r0, =gBattleWeather ldrh r1, [r0] movs r0, 0x60 ands r0, r1 @@ -14881,7 +14881,7 @@ _0803CFD8: _0803CFDA: movs r7, 0x1 _0803CFDC: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r2, r9 muls r2, r0 @@ -14924,7 +14924,7 @@ _0803D02C: lsls r0, 24 lsrs r5, r0, 24 _0803D040: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x023f0102 ands r0, r1 @@ -14954,7 +14954,7 @@ _0803D074: lsrs r2, 1 mov r8, r2 _0803D07E: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r3, r9 muls r3, r0 @@ -14984,7 +14984,7 @@ _0803D09C: negs r1, r1 mov r8, r1 _0803D0B8: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r2, r10 muls r2, r0 @@ -15028,7 +15028,7 @@ _0803D118: lsls r0, 24 lsrs r5, r0, 24 _0803D12C: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x023f0102 ands r0, r1 @@ -15054,7 +15054,7 @@ _0803D15C: bne _0803D162 lsrs r7, 1 _0803D162: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r0, 0x58 mov r1, r10 muls r1, r0 @@ -15118,7 +15118,7 @@ _0803D1E0: muls r3, r1 adds r1, r3, 0 adds r0, r1 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons adds r1, 0xC adds r0, r1 ldrh r3, [r0] @@ -15154,7 +15154,7 @@ _0803D22C: muls r2, r1 adds r1, r2, 0 adds r0, r1 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons adds r1, 0xC adds r0, r1 ldrh r2, [r0] @@ -15192,7 +15192,7 @@ _0803D27A: bne _0803D2AE cmp r8, r7 bne _0803D2A4 - bl GenerateRandomNumber + bl Random movs r1, 0x1 ands r1, r0 cmp r1, 0 @@ -15215,7 +15215,7 @@ _0803D2AE: _0803D2B8: cmp r8, r7 bne _0803D2CE - bl GenerateRandomNumber + bl Random movs r1, 0x1 ands r1, r0 cmp r1, 0 @@ -15249,7 +15249,7 @@ sub_803D2E8: @ 803D2E8 mov r5, r8 push {r5-r7} movs r3, 0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 ands r0, r1 @@ -15767,7 +15767,7 @@ _0803D71C: ldrh r0, [r0] cmp r0, r7 bne _0803D7A0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r3 adds r1, 0x4C @@ -15912,7 +15912,7 @@ sub_803D8C0: @ 803D8C0 ldr r1, =gUnknown_02024083 movs r0, 0 strb r0, [r1] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r2, [r1] ldr r0, =0x02000002 ands r0, r2 @@ -16084,7 +16084,7 @@ sub_803DAC0: @ 803DAC0 ldr r1, =gUnknown_02024083 movs r0, 0 strb r0, [r1] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x02000002 ands r0, r1 @@ -16106,7 +16106,7 @@ sub_803DAC0: @ 803DAC0 movs r0, 0x7F ands r0, r2 strb r0, [r3] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r0, =0x00000ca9 adds r1, r0 @@ -16163,7 +16163,7 @@ sub_803DBA0: @ 803DBA0 ldr r1, =gUnknown_02024083 movs r0, 0 strb r0, [r1] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r2, [r1] ldr r0, =0x003f0100 ands r0, r2 @@ -16179,7 +16179,7 @@ sub_803DBA0: @ 803DBA0 ldr r1, =gUnknown_0202433A movs r0, 0x9 strb r0, [r1] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r0, =0x00000ca9 adds r1, r0 @@ -16285,7 +16285,7 @@ sub_803DCD8: @ 803DCD8 bls _0803DCEE b _0803DE10 _0803DCEE: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x023f0b92 ands r1, r0 @@ -16301,7 +16301,7 @@ _0803DCEE: ldr r0, =gUnknown_0202406E mov r8, r0 movs r7, 0x64 - ldr r6, =gUnknown_020244EC + ldr r6, =gPlayerParty _0803DD10: ldrb r0, [r5] bl battle_side_get_owner @@ -16320,7 +16320,7 @@ _0803DD10: adds r0, r6 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r4, 0x6] ldrb r0, [r5] lsls r0, 1 @@ -16331,7 +16331,7 @@ _0803DD10: movs r1, 0x2 adds r2, r4, 0 adds r2, 0x8 - bl pokemon_getattr + bl GetMonData b _0803DDA0 .pool _0803DD74: @@ -16343,7 +16343,7 @@ _0803DD74: adds r0, r6 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r4, 0x26] ldrb r0, [r5] lsls r0, 1 @@ -16354,7 +16354,7 @@ _0803DD74: movs r1, 0x2 adds r2, r4, 0 adds r2, 0x14 - bl pokemon_getattr + bl GetMonData _0803DDA0: ldrb r0, [r5] adds r0, 0x1 @@ -16368,7 +16368,7 @@ _0803DDA0: _0803DDB2: bl sub_80EC728 _0803DDB6: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x023f0b9a ands r0, r1 @@ -16447,7 +16447,7 @@ _0803DE80: str r0, [r1] _0803DE86: bl FreeAllWindowBuffers - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -16474,7 +16474,7 @@ _0803DEC0: movs r6, 0 _0803DEC2: ldrb r2, [r3] - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable lsls r1, r6, 2 adds r1, r0 ldr r1, [r1] @@ -16487,7 +16487,7 @@ _0803DEC2: movs r0, 0x64 adds r1, r6, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r1, r0 adds r0, r5, 0 movs r1, 0 @@ -16530,7 +16530,7 @@ _0803DF34: thumb_func_start sub_803DF48 sub_803DF48: @ 803DF48 push {lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, [r0, 0x4] ldr r0, =sub_8038420 cmp r1, r0 @@ -16547,13 +16547,13 @@ _0803DF5A: thumb_func_start c4_overworld c4_overworld: @ 803DF70 push {r4-r6,lr} - ldr r6, =gUnknown_02022FEC + ldr r6, =gBattleTypeFlags ldr r0, [r6] movs r5, 0x2 ands r0, r5 cmp r0, 0 bne _0803DF8C - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4, 0 bl sub_806DCB4 adds r0, r4, 0 @@ -16573,7 +16573,7 @@ _0803DF9E: ldr r5, =gUnknown_0202433A ldrb r0, [r5] strh r0, [r1] - ldr r3, =gUnknown_030022C0 + ldr r3, =gMain ldr r0, =0x00000439 adds r2, r3, r0 ldrb r1, [r2] @@ -16589,7 +16589,7 @@ _0803DF9E: ands r4, r0 cmp r4, 0 beq _0803DFDE - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty bl sub_8161F18 ldrb r1, [r5] movs r0, 0x1 @@ -16603,7 +16603,7 @@ _0803DFDA: _0803DFDE: movs r0, 0x5A bl m4aSongNumStop - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r0, [r0, 0x8] bl SetMainCallback2 _0803DFEC: @@ -16708,7 +16708,7 @@ sub_803E0B8: @ 803E0B8 adds r0, r3, 0 adds r0, 0x91 ldrb r2, [r0] - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r6] lsls r0, 2 adds r0, r1 @@ -16721,7 +16721,7 @@ sub_803E0B8: @ 803E0B8 b _0803E83C .pool _0803E110: - ldr r1, =gUnknown_02024211 + ldr r1, =gCritMultiplier movs r0, 0x1 strb r0, [r1] ldr r1, =gUnknown_02024474 @@ -16730,7 +16730,7 @@ _0803E110: ldr r5, =0x000001a3 adds r0, r3, r5 strb r2, [r0] - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags strb r2, [r0] ldr r0, =gUnknown_02024212 strb r2, [r0] @@ -16781,7 +16781,7 @@ _0803E110: b _0803E316 .pool _0803E1BC: - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons mov r10, r5 movs r0, 0x58 adds r5, r4, 0 @@ -16906,7 +16906,7 @@ _0803E268: b _0803E316 .pool _0803E2DC: - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons mov r5, r8 ldrb r0, [r5] lsls r0, 1 @@ -16945,7 +16945,7 @@ _0803E334: strh r3, [r0] strh r3, [r1] _0803E33C: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r1, =gUnknown_0202420B ldrb r3, [r1] movs r0, 0x58 @@ -17007,7 +17007,7 @@ _0803E384: lsls r0, 24 cmp r4, r0 beq _0803E400 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r5, 0x9] movs r0, 0x58 muls r0, r2 @@ -17015,12 +17015,12 @@ _0803E384: ldrh r0, [r0, 0x28] cmp r0, 0 beq _0803E400 - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex strb r2, [r0] b _0803E76A .pool _0803E400: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -17055,7 +17055,7 @@ _0803E424: bne _0803E440 b _0803E630 _0803E440: - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r2, =gUnknown_0202420B ldrb r6, [r2] ldr r0, =gUnknown_0202449C @@ -17104,7 +17104,7 @@ _0803E480: ldrb r1, [r4] cmp r0, r1 beq _0803E4CE - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r4] movs r0, 0x58 muls r0, r2 @@ -17158,7 +17158,7 @@ _0803E4E8: lsls r0, 24 cmp r0, 0 bne _0803E548 - bl GenerateRandomNumber + bl Random movs r1, 0x1 ands r1, r0 cmp r1, 0 @@ -17170,7 +17170,7 @@ _0803E544: movs r0, 0x3 b _0803E55A _0803E548: - bl GenerateRandomNumber + bl Random movs r1, 0x1 ands r1, r0 cmp r1, 0 @@ -17181,12 +17181,12 @@ _0803E558: movs r0, 0x2 _0803E55A: bl battle_get_side_with_given_state - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex strb r0, [r1] b _0803E578 .pool _0803E568: - ldr r2, =gUnknown_0202420C + ldr r2, =gEnemyMonIndex ldr r0, =gUnknown_0202420B ldrb r0, [r0] ldr r1, =gUnknown_0202449C @@ -17197,9 +17197,9 @@ _0803E568: _0803E578: ldr r7, =gUnknown_02024210 ldrb r0, [r7] - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable mov r8, r1 - ldr r5, =gUnknown_0202420C + ldr r5, =gEnemyMonIndex ldrb r1, [r5] lsls r1, 2 add r1, r8 @@ -17244,7 +17244,7 @@ _0803E5E2: ldrb r0, [r0] strb r0, [r4] ldrb r0, [r4] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r1, 0x58 muls r1, r0 adds r1, r2 @@ -17261,13 +17261,13 @@ _0803E5E2: movs r2, 0x2 orrs r1, r2 strb r1, [r0] - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex ldrb r0, [r4] strb r0, [r1] b _0803E76A .pool _0803E630: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r4, 0x1 ands r0, r4 @@ -17291,7 +17291,7 @@ _0803E630: lsls r0, 24 cmp r0, 0 bne _0803E684 - bl GenerateRandomNumber + bl Random adds r1, r4, 0 ands r1, r0 cmp r1, 0 @@ -17303,7 +17303,7 @@ _0803E680: movs r0, 0x3 b _0803E696 _0803E684: - bl GenerateRandomNumber + bl Random adds r1, r4, 0 ands r1, r0 cmp r1, 0 @@ -17314,12 +17314,12 @@ _0803E694: movs r0, 0x2 _0803E696: bl battle_get_side_with_given_state - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex strb r0, [r1] ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldr r5, =gUnknown_0202420C + ldr r2, =gBitTable + ldr r5, =gEnemyMonIndex ldrb r0, [r5] lsls r0, 2 adds r0, r2 @@ -17341,7 +17341,7 @@ _0803E696: b _0803E758 .pool _0803E6E0: - ldr r5, =gUnknown_0202420C + ldr r5, =gEnemyMonIndex mov r2, r8 ldrb r0, [r2] ldr r1, =gUnknown_0202449C @@ -17351,7 +17351,7 @@ _0803E6E0: strb r0, [r5] ldr r6, =gUnknown_02024210 ldrb r1, [r6] - ldr r7, =gUnknown_0832A328 + ldr r7, =gBitTable ldrb r0, [r5] lsls r0, 2 adds r0, r7 @@ -17400,7 +17400,7 @@ _0803E758: bl battle_get_side_with_given_state strb r0, [r5] _0803E76A: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r2, 0x80 lsls r2, 10 @@ -17417,7 +17417,7 @@ _0803E76A: lsls r0, 27 cmp r0, 0 bge _0803E808 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r2 adds r0, r1 @@ -17569,7 +17569,7 @@ sub_803E90C: @ 803E90C mov r5, r8 push {r5-r7} ldr r4, =gUnknown_0202420B - ldr r2, =gUnknown_0202420C + ldr r2, =gEnemyMonIndex ldr r1, =gUnknown_0202407E ldr r0, =gUnknown_02024082 ldrb r0, [r0] @@ -17830,7 +17830,7 @@ _0803EB8C: b _0803EBDE .pool _0803EBB0: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x1 ands r1, r0 @@ -17889,7 +17889,7 @@ sub_803EC20: @ 803EC20 lsls r0, 24 lsrs r5, r0, 24 movs r7, 0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r5 adds r1, r0, r1 @@ -17915,7 +17915,7 @@ _0803EC5E: cmp r1, 0x25 bne _0803EC9C ldr r2, =gUnknown_02024208 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r5 adds r0, r1 @@ -17934,7 +17934,7 @@ _0803EC5E: b _0803ED70 .pool _0803EC9C: - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons mov r10, r0 movs r2, 0x58 mov r9, r2 @@ -17980,7 +17980,7 @@ _0803EC9C: adds r0, r1 lsls r0, 24 lsrs r4, r0, 24 - bl GenerateRandomNumber + bl Random movs r1, 0xFF ands r1, r0 cmp r4, r1 @@ -18017,7 +18017,7 @@ _0803ED38: b _0803ED70 .pool _0803ED5C: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r2, [r1] ldr r0, =0x043f0100 ands r0, r2 @@ -18046,7 +18046,7 @@ _0803ED80: bl sub_81A9E28 lsls r0, 24 lsrs r1, r0, 24 - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons movs r3, 0x58 adds r0, r5, 0 muls r0, r3 @@ -18061,7 +18061,7 @@ _0803ED80: b _0803EDDA .pool _0803EDBC: - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons movs r2, 0x58 adds r0, r5, 0 muls r0, r2 @@ -18089,7 +18089,7 @@ _0803EDDA: adds r0, r1 lsls r0, 24 lsrs r4, r0, 24 - bl GenerateRandomNumber + bl Random movs r1, 0xFF ands r1, r0 cmp r4, r1 @@ -18137,7 +18137,7 @@ sub_803EE48: @ 803EE48 adds r0, r1 ldrb r0, [r0] strb r0, [r4] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 @@ -18197,7 +18197,7 @@ _0803EEE0: movs r1, 0x80 orrs r0, r1 strb r0, [r2] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r0, =0x00000ca9 adds r1, r0 @@ -18230,7 +18230,7 @@ _0803EF0C: b _0803EF96 .pool _0803EF4C: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r4] movs r0, 0x58 muls r0, r2 @@ -18636,10 +18636,10 @@ bsC_8016D70: @ 803F300 ldr r0, =gUnknown_020241EA movs r1, 0 strh r1, [r0] - ldr r0, =gUnknown_020241F0 + ldr r0, =gBattleMoveDamage movs r4, 0 str r4, [r0] - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags strb r1, [r0] ldr r5, =gUnknown_02024474 strb r1, [r5, 0x18] @@ -18707,7 +18707,7 @@ _0803F3E8: .4byte _0803F46C .4byte _0803F470 _0803F424: - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] b _0803F47A .pool @@ -18764,7 +18764,7 @@ sub_803F480: @ 803F480 lsrs r5, r1, 24 lsls r2, 16 lsrs r2, 16 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r4, 0x58 muls r0, r4 adds r0, r1 @@ -18821,7 +18821,7 @@ _0803F4DE: adds r0, r1 ldrb r1, [r0, 0x18] lsrs r1, 4 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r3, 2 adds r0, r2 ldr r0, [r0] @@ -18875,7 +18875,7 @@ sub_803F548: @ 803F548 ldrb r0, [r0] cmp r4, r0 bge _0803F5F0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 adds r7, r5, 0 muls r7, r0 @@ -18890,7 +18890,7 @@ _0803F57E: adds r6, r4, 0x1 cmp r9, r0 beq _0803F5E6 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons movs r3, 0x58 adds r1, r4, 0 muls r1, r3 @@ -18945,7 +18945,7 @@ _0803F5F0: mov r1, r8 cmp r1, 0x4 beq _0803F658 - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons movs r3, 0x58 adds r0, r5, 0 muls r0, r3 @@ -18965,7 +18965,7 @@ _0803F5F0: adds r0, r1 ldrb r1, [r0, 0x18] lsrs r1, 4 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable mov r4, r8 lsls r0, r4, 2 adds r0, r2 @@ -19021,7 +19021,7 @@ sub_803F67C: @ 803F67C ldrb r0, [r0] cmp r1, r0 bge _0803F6FE - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons movs r2, 0x58 mov r12, r2 mov r5, r12 @@ -19078,7 +19078,7 @@ _0803F6F4: _0803F6FE: cmp r6, 0x4 beq _0803F762 - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons movs r5, 0x58 adds r0, r3, 0 muls r0, r5 @@ -19098,7 +19098,7 @@ _0803F6FE: adds r0, r1 ldrb r1, [r0, 0x18] lsrs r1, 4 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r6, 2 adds r0, r2 ldr r0, [r0] @@ -19139,7 +19139,7 @@ _0803F762: thumb_func_start sub_803F790 sub_803F790: @ 803F790 push {r4,r5,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -19151,7 +19151,7 @@ sub_803F790: @ 803F790 cmp r2, r0 bge _0803F7EE ldr r3, =gUnknown_02024068 - ldr r5, =gUnknown_0832A328 + ldr r5, =gBitTable _0803F7AC: ldm r5!, {r1} lsls r1, 28 @@ -19171,7 +19171,7 @@ _0803F7D0: cmp r2, r0 bge _0803F7EE ldr r3, =gUnknown_02024068 - ldr r5, =gUnknown_0832A328 + ldr r5, =gBitTable _0803F7DE: ldr r0, [r3] ldm r5!, {r1} @@ -19193,14 +19193,14 @@ dp01_battle_side_mark_buffer_for_execution: @ 803F800 push {lr} lsls r0, 24 lsrs r3, r0, 24 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 cmp r0, 0 beq _0803F834 ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable lsls r0, r3, 2 adds r0, r1 ldr r1, [r0] @@ -19212,7 +19212,7 @@ dp01_battle_side_mark_buffer_for_execution: @ 803F800 .pool _0803F834: ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable lsls r0, r3, 2 adds r0, r1 ldr r1, [r2] @@ -19232,7 +19232,7 @@ sub_803F850: @ 803F850 lsrs r7, r0, 24 movs r4, 0 ldr r5, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable lsls r0, r7, 2 adds r6, r0, r1 b _0803F87A @@ -19268,7 +19268,7 @@ _0803F87A: b_cancel_multi_turn_move_maybe: @ 803F8A0 lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r2, 0x58 adds r3, r0, 0 muls r3, r2 @@ -19388,7 +19388,7 @@ sub_803F988: @ 803F988 adds r6, r0, 0 cmp r1, r2 bge _0803F9B6 - ldr r5, =gUnknown_0832A328 + ldr r5, =gBitTable adds r4, r2, 0 ldr r2, =gUnknown_0202406E _0803F9A4: @@ -19456,7 +19456,7 @@ sub_803F9EC: @ 803F9EC bge _0803FA4A ldr r0, =gUnknown_02024210 ldrb r7, [r0] - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable adds r6, r2, 0 ldr r3, =gUnknown_0202406E adds r2, r1, 0 @@ -19512,7 +19512,7 @@ _0803FA8C: ldr r0, =gUnknown_020243FE mov r12, r0 movs r7, 0x2 - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable ldr r1, =gUnknown_0202406E lsls r0, r4, 1 adds r4, r0, r1 @@ -19606,7 +19606,7 @@ sub_803FB4C: @ 803FB4C mov r7, r8 push {r7} movs r6, 0 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r1, =gUnknown_02023864 ldr r3, =gUnknown_02024064 ldrb r4, [r3] @@ -19643,7 +19643,7 @@ sub_803FB4C: @ 803FB4C strb r4, [r0, 0x17] ldr r0, =gUnknown_020241EA strh r5, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 10 @@ -19684,7 +19684,7 @@ _0803FC06: bne _0803FC90 cmp r5, 0xA5 beq _0803FC90 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r2 adds r1, 0x50 @@ -19694,7 +19694,7 @@ _0803FC06: bge _0803FC90 adds r0, r2, 0 bl b_cancel_multi_turn_move_maybe - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 10 @@ -19749,7 +19749,7 @@ _0803FC90: bne _0803FD1A ldr r0, =gUnknown_020241EA strh r5, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 10 @@ -19792,7 +19792,7 @@ _0803FD1A: beq _0803FD8E ldr r0, =gUnknown_020241EA strh r5, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 10 @@ -19826,7 +19826,7 @@ _0803FD7C: lsls r0, 24 lsrs r6, r0, 24 _0803FD8E: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_02024064 ldrb r2, [r0] movs r0, 0x58 @@ -19853,7 +19853,7 @@ _0803FDCE: ldr r1, =gUnknown_02024064 ldrb r0, [r1] strb r0, [r2] - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons mov r12, r0 adds r7, r1, 0 cmp r4, 0x1D @@ -19877,7 +19877,7 @@ _0803FDCE: add r0, r12 ldrh r0, [r0, 0x2E] strh r0, [r2] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 10 @@ -19919,7 +19919,7 @@ _0803FE58: ldrb r0, [r0] cmp r0, 0 bne _0803FEB8 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 10 @@ -19974,7 +19974,7 @@ sub_803FECC: @ 803FECC ldr r1, [r1] adds r1, r0 str r1, [sp, 0x4] - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r7 adds r1, r0, r1 @@ -20008,7 +20008,7 @@ _0803FF2E: str r2, [sp, 0xC] ldr r5, =gUnknown_020242BC mov r12, r5 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons movs r2, 0x58 adds r6, r7, 0 muls r6, r2 @@ -20021,7 +20021,7 @@ _0803FF2E: subs r0, r1, r7 lsls r0, 2 mov r8, r0 - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable _0803FF5A: ldrh r0, [r5] cmp r0, 0 @@ -20348,14 +20348,14 @@ sub_80401D0: @ 80401D0 ldrb r4, [r0] adds r6, r1, 0 mov r10, r0 - ldr r7, =gUnknown_0202420C + ldr r7, =gEnemyMonIndex ldr r3, =gUnknown_0202449C mov r12, r3 cmp r9, r4 bcs _08040224 ldr r2, =gUnknown_02024210 ldrb r1, [r2] - ldr r5, =gUnknown_0832A328 + ldr r5, =gBitTable ldr r0, [r5] ands r1, r0 cmp r1, 0 @@ -20386,7 +20386,7 @@ _08040224: beq _0804025E ldr r2, =gUnknown_02024210 ldrb r1, [r2] - ldr r5, =gUnknown_0832A328 + ldr r5, =gBitTable ldr r0, [r5] ands r1, r0 cmp r1, 0 @@ -20886,7 +20886,7 @@ _0804067C: lsls r0, 24 cmp r0, 0 bne _080406C4 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r4] movs r0, 0x58 muls r0, r2 @@ -20894,7 +20894,7 @@ _0804067C: ldrh r0, [r0, 0x28] cmp r0, 0 beq _080406C4 - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex strb r2, [r0] ldr r0, =gUnknown_082DB0B7 bl b_call_bc_move_exec @@ -20937,7 +20937,7 @@ _080406F0: b _080408F6 .pool _0804071C: - ldr r3, =gUnknown_020243CC + ldr r3, =gBattleWeather ldrh r2, [r3] movs r0, 0x7 ands r0, r2 @@ -20996,7 +20996,7 @@ _08040794: b _080408BA .pool _080407A0: - ldr r3, =gUnknown_020243CC + ldr r3, =gBattleWeather ldrh r2, [r3] movs r0, 0x18 ands r0, r2 @@ -21038,7 +21038,7 @@ _080407EC: b _080408B8 .pool _08040810: - ldr r3, =gUnknown_020243CC + ldr r3, =gBattleWeather ldrh r2, [r3] movs r0, 0x60 ands r0, r2 @@ -21072,7 +21072,7 @@ _08040858: b _080408B8 .pool _08040868: - ldr r3, =gUnknown_020243CC + ldr r3, =gBattleWeather ldrh r2, [r3] movs r0, 0x80 ands r0, r2 @@ -21192,7 +21192,7 @@ _08040968: strb r0, [r3] ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r0, [r3] lsls r0, 2 adds r0, r2 @@ -21253,7 +21253,7 @@ _08040A18: bne _08040A30 bl _080412DE _08040A30: - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons movs r1, 0x58 muls r1, r3 adds r0, r1, r0 @@ -21267,7 +21267,7 @@ _08040A44: bne _08040A4C bl _080412DE _08040A4C: - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage ldrh r0, [r0, 0x2C] lsrs r0, 4 str r0, [r1] @@ -21330,7 +21330,7 @@ _08040AC6: bne _08040ADC bl _080412DE _08040ADC: - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons movs r5, 0x3 ands r5, r1 movs r1, 0x58 @@ -21350,9 +21350,9 @@ _08040AF4: bne _08040B04 bl _080412DE _08040B04: - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex strb r5, [r0] - ldr r2, =gUnknown_020241F0 + ldr r2, =gBattleMoveDamage ldrb r0, [r6] muls r0, r1 adds r0, r3 @@ -21372,7 +21372,7 @@ _08040B1E: b _080412D0 .pool _08040B44: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r6] movs r0, 0x58 adds r3, r1, 0 @@ -21393,7 +21393,7 @@ _08040B60: bne _08040B6A b _080412DE _08040B6A: - ldr r2, =gUnknown_020241F0 + ldr r2, =gBattleMoveDamage ldrh r0, [r1, 0x2C] lsrs r0, 3 str r0, [r2] @@ -21406,7 +21406,7 @@ _08040B7A: b _080412D0 .pool _08040B8C: - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldrb r0, [r6] movs r7, 0x58 mov r8, r7 @@ -21428,7 +21428,7 @@ _08040BAA: bne _08040BB4 b _080412DE _08040BB4: - ldr r5, =gUnknown_020241F0 + ldr r5, =gBattleMoveDamage ldrh r0, [r1, 0x2C] lsrs r0, 4 str r0, [r5] @@ -21469,7 +21469,7 @@ _08040BE4: b _080412D0 .pool _08040C0C: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r6] movs r0, 0x58 adds r3, r1, 0 @@ -21490,7 +21490,7 @@ _08040C28: bne _08040C32 b _080412DE _08040C32: - ldr r2, =gUnknown_020241F0 + ldr r2, =gBattleMoveDamage ldrh r0, [r1, 0x2C] lsrs r0, 3 str r0, [r2] @@ -21503,7 +21503,7 @@ _08040C42: b _080412D0 .pool _08040C54: - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldrb r1, [r6] movs r0, 0x58 muls r1, r0 @@ -21532,7 +21532,7 @@ _08040C7A: ands r0, r1 cmp r0, 0 beq _08040CAC - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage ldrh r0, [r3, 0x2C] lsrs r0, 2 str r0, [r1] @@ -21551,7 +21551,7 @@ _08040CAC: b _080412DE .pool _08040CB8: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r6] movs r0, 0x58 adds r3, r1, 0 @@ -21573,7 +21573,7 @@ _08040CD6: bne _08040CE0 b _080412DE _08040CE0: - ldr r2, =gUnknown_020241F0 + ldr r2, =gBattleMoveDamage ldrh r0, [r1, 0x2C] lsrs r0, 2 str r0, [r2] @@ -21586,7 +21586,7 @@ _08040CF0: b _080412D0 .pool _08040D00: - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons mov r8, r3 ldrb r0, [r6] movs r3, 0x58 @@ -21655,7 +21655,7 @@ _08040D30: ldr r1, =gUnknown_02024214 ldr r0, =gUnknown_082DB30E str r0, [r1] - ldr r2, =gUnknown_020241F0 + ldr r2, =gBattleMoveDamage ldrb r0, [r6] muls r0, r3 add r0, r8 @@ -21734,7 +21734,7 @@ _08040E00: b _08040EC8 .pool _08040E60: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r6] movs r0, 0x58 muls r0, r1 @@ -21803,7 +21803,7 @@ _08040EE8: ldr r5, =gUnknown_02024064 ldrb r0, [r5] strb r0, [r2] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r0, [r5] movs r7, 0x58 adds r1, r0, 0 @@ -21866,7 +21866,7 @@ _08040F72: b _080412DE .pool _08040F7C: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r0, [r6] movs r7, 0x58 muls r0, r7 @@ -21959,7 +21959,7 @@ _08041024: b _080412DE _0804103C: movs r4, 0 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r0, 0x58 adds r1, r3, 0 muls r1, r0 @@ -22056,7 +22056,7 @@ _080410E8: bne _080410FE b _080412DE _080410FE: - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons mov r8, r7 ldrb r0, [r2, 0xC] lsls r0, 1 @@ -22229,7 +22229,7 @@ _08041238: ands r0, r3 cmp r0, 0 bne _080412DE - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons movs r5, 0x58 adds r1, r2, 0 muls r1, r5 @@ -22253,7 +22253,7 @@ _08041238: bne _080412DE ldrb r0, [r6] bl b_cancel_multi_turn_move_maybe - bl GenerateRandomNumber + bl Random ldrb r1, [r6] adds r2, r1, 0 muls r2, r5 @@ -22405,7 +22405,7 @@ _080413CA: strb r0, [r4] ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r2 @@ -22437,7 +22437,7 @@ _08041422: lsrs r3, r0, 24 cmp r3, 0 bne _08041520 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r4] movs r0, 0x58 muls r0, r2 @@ -22477,7 +22477,7 @@ _08041462: strb r0, [r5, 0x3] movs r0, 0xFF strb r0, [r5, 0x4] - ldr r5, =gUnknown_0202420C + ldr r5, =gEnemyMonIndex ldrb r0, [r4] strb r0, [r5] ldr r1, =gUnknown_0202420B @@ -22486,7 +22486,7 @@ _08041462: adds r0, r2 ldrb r0, [r0] strb r0, [r1] - ldr r2, =gUnknown_020241F0 + ldr r2, =gBattleMoveDamage ldrb r0, [r4] lsls r0, 2 adds r1, r7, 0 @@ -22589,7 +22589,7 @@ _0804156A: strb r0, [r5] ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r0, [r5] lsls r0, 2 adds r0, r2 @@ -22649,8 +22649,8 @@ _080415BC: negs r1, r1 ands r0, r1 str r0, [r2] - ldr r3, =gUnknown_020241F0 - ldr r2, =gUnknown_02024084 + ldr r3, =gBattleMoveDamage + ldr r2, =gBattleMons ldrb r1, [r5] movs r0, 0x58 muls r0, r1 @@ -22706,7 +22706,7 @@ _08041684: movs r0, 0 strb r0, [r1] _0804169A: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 11 @@ -22718,7 +22718,7 @@ _0804169A: ldrb r0, [r0] cmp r0, 0x2 bne _08041708 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrh r0, [r1, 0x28] cmp r0, 0 beq _08041708 @@ -22773,7 +22773,7 @@ sub_8041728: @ 8041728 mov r7, r8 push {r7} sub sp, 0x4 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 ands r0, r1 @@ -22848,7 +22848,7 @@ _080417B4: ldr r6, =gUnknown_02024210 _080417D4: ldrb r0, [r6] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r1, r5, 2 adds r1, r2 ldr r4, [r1] @@ -22877,9 +22877,9 @@ _08041806: mov r8, r0 ldr r1, =gUnknown_0202420D mov r12, r1 - ldr r2, =gUnknown_0202420C + ldr r2, =gEnemyMonIndex mov r5, r8 - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldr r6, =gUnknown_0202406E _08041816: ldr r3, [r5] @@ -22899,7 +22899,7 @@ _08041816: adds r0, r3, 0 adds r0, 0xDF ldrb r1, [r0] - ldr r3, =gUnknown_0832A328 + ldr r3, =gBitTable lsls r0, r4, 1 adds r0, r6 ldrh r0, [r0] @@ -22979,10 +22979,10 @@ _080418E2: _080418F6: ldr r0, =gUnknown_0202420D mov r12, r0 - ldr r7, =gUnknown_0202420C + ldr r7, =gEnemyMonIndex ldr r5, =gUnknown_0202449C - ldr r2, =gUnknown_02024084 - ldr r6, =gUnknown_0832A328 + ldr r2, =gBattleMons + ldr r6, =gBitTable _08041902: ldr r0, [r5] adds r4, r0, 0 @@ -23214,7 +23214,7 @@ _08041AC0: .4byte _0804231C .4byte _08042376 _08041AFC: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r3, =gUnknown_0202420B ldrb r2, [r3] movs r0, 0x58 @@ -23240,7 +23240,7 @@ _08041AFC: bl _08042370 .pool _08041B48: - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldr r4, =gUnknown_0202420B ldrb r1, [r4] movs r5, 0x58 @@ -23320,7 +23320,7 @@ _08041BF4: subs r0, r1, r3 str r0, [r2] _08041BF8: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -23375,7 +23375,7 @@ _08041C6E: b _0804216A .pool _08041C90: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r7, =gUnknown_0202420B ldrb r0, [r7] movs r6, 0x58 @@ -23388,7 +23388,7 @@ _08041C90: ands r0, r1 cmp r0, 0 beq _08041D30 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x5 @@ -23449,7 +23449,7 @@ _08041D30: b _08042370 .pool _08041D50: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -23486,7 +23486,7 @@ _08041D7A: ldr r1, =gUnknown_02024214 ldr r0, =gUnknown_082DB6AD str r0, [r1] - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 @@ -23494,7 +23494,7 @@ _08041D7A: b _0804215E .pool _08041DC4: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r3, =gUnknown_0202420B ldrb r2, [r3] movs r0, 0x58 @@ -23539,7 +23539,7 @@ _08041E10: b _0804216A .pool _08041E40: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r3, =gUnknown_0202420B ldrb r2, [r3] movs r0, 0x58 @@ -23715,7 +23715,7 @@ _08041FFE: b _0804216A .pool _08042028: - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldr r5, =gUnknown_0202420B ldrb r0, [r5] movs r6, 0x58 @@ -23738,7 +23738,7 @@ _08042028: ands r0, r3 cmp r0, 0 beq _080420E8 - bl GenerateRandomNumber + bl Random movs r1, 0x1 movs r2, 0x1 ands r2, r0 @@ -23754,7 +23754,7 @@ _0804207C: ldr r0, =gUnknown_02024332 movs r4, 0x1 strb r1, [r0, 0x5] - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex ldrb r0, [r5] strb r0, [r1] ldrb r0, [r5] @@ -23772,7 +23772,7 @@ _0804207C: movs r2, 0x1 movs r3, 0 bl sub_806957C - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage str r0, [r1] ldr r0, =gUnknown_0202433C ldrb r1, [r5] @@ -23810,7 +23810,7 @@ _080420FA: b _08042370 .pool _08042114: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r4, =gUnknown_0202420B ldrb r2, [r4] movs r0, 0x58 @@ -23822,7 +23822,7 @@ _08042114: ands r0, r1 cmp r0, 0 beq _08042162 - bl GenerateRandomNumber + bl Random lsls r0, 16 movs r1, 0xC0 lsls r1, 10 @@ -23862,7 +23862,7 @@ _0804216A: b _08042376 .pool _08042194: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r4, =gUnknown_0202420B ldrb r2, [r4] movs r0, 0x58 @@ -23876,10 +23876,10 @@ _08042194: cmp r1, 0 beq _0804220E lsrs r0, r1, 16 - bl sub_806F8A8 + bl CountTrailingZeroBits ldr r1, =gUnknown_02024474 strb r0, [r1, 0x17] - bl GenerateRandomNumber + bl Random movs r1, 0x1 ands r1, r0 cmp r1, 0 @@ -23922,7 +23922,7 @@ _0804220E: b _08042370 .pool _08042234: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r6, =gUnknown_0202420B ldrb r0, [r6] movs r5, 0x58 @@ -23968,7 +23968,7 @@ _08042280: lsls r0, 1 mov r1, r10 str r0, [r1] - ldr r4, =gUnknown_0202420C + ldr r4, =gEnemyMonIndex ldr r1, =gUnknown_02024288 ldrb r0, [r6] adds r0, r1 @@ -23976,7 +23976,7 @@ _08042280: strb r0, [r4] ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r2 @@ -24012,7 +24012,7 @@ _08042306: b _08042370 .pool _0804231C: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -24117,7 +24117,7 @@ sub_80423F4: @ 80423F4 lsls r2, 24 lsrs r2, 24 mov r9, r2 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x1 ands r0, r1 @@ -24135,11 +24135,11 @@ _08042424: adds r0, r4, 0 bl battle_side_get_owner lsls r0, 24 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty mov r8, r1 cmp r0, 0 bne _08042442 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty mov r8, r2 _08042442: movs r0, 0x2 @@ -24159,17 +24159,17 @@ _08042456: adds r5, r1, r0 adds r0, r5, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08042486 adds r0, r5, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08042486 adds r0, r5, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData movs r1, 0xCE lsls r1, 1 cmp r0, r1 @@ -24199,7 +24199,7 @@ _0804249C: lsls r0, 24 cmp r0, 0 bne _080424D0 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty mov r8, r2 adds r0, r4, 0 bl sub_806D864 @@ -24208,7 +24208,7 @@ _0804249C: b _08042502 .pool _080424D0: - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty mov r8, r0 movs r1, 0x1 eors r1, r4 @@ -24225,11 +24225,11 @@ _080424E4: adds r0, r4, 0 bl battle_side_get_owner lsls r0, 24 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty mov r8, r1 cmp r0, 0 bne _08042502 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty mov r8, r2 _08042502: adds r0, r7, 0 @@ -24251,17 +24251,17 @@ _0804251A: adds r5, r1, r0 adds r0, r5, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0804254A adds r0, r5, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0804254A adds r0, r5, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData movs r1, 0xCE lsls r1, 1 cmp r0, r1 @@ -24295,7 +24295,7 @@ _0804256C: lsrs r0, 24 cmp r0, 0x1 bne _080425DA - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty mov r8, r0 movs r6, 0x3 cmp r4, 0x1 @@ -24317,17 +24317,17 @@ _0804259E: adds r5, r1, r0 adds r0, r5, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0804259C adds r0, r5, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0804259C adds r0, r5, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData movs r1, 0xCE lsls r1, 1 cmp r0, r1 @@ -24352,7 +24352,7 @@ _080425DA: bl battle_get_side_with_given_state lsls r0, 24 lsrs r6, r0, 24 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty mov r8, r2 b _08042620 .pool @@ -24365,7 +24365,7 @@ _08042608: bl battle_get_side_with_given_state lsls r0, 24 lsrs r6, r0, 24 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty mov r8, r0 _08042620: mov r1, r10 @@ -24394,17 +24394,17 @@ _08042642: adds r5, r1, r0 adds r0, r5, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08042692 adds r0, r5, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08042692 adds r0, r5, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData movs r1, 0xCE lsls r1, 1 cmp r0, r1 @@ -24453,7 +24453,7 @@ castform_switch: @ 80426BC lsls r0, 24 lsrs r6, r0, 24 movs r5, 0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r6 adds r4, r0, r1 @@ -24528,14 +24528,14 @@ _08042760: movs r0, 0 b _08042818 _08042764: - ldr r1, =gUnknown_020243CC + ldr r1, =gBattleWeather ldrh r0, [r1] movs r2, 0xE7 ands r2, r0 adds r4, r1, 0 cmp r2, 0 bne _08042792 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r6 adds r1, r0, r1 @@ -24557,7 +24557,7 @@ _08042792: ands r0, r1 cmp r0, 0 beq _080427BE - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r6 adds r1, r0, r1 @@ -24580,7 +24580,7 @@ _080427BE: ands r0, r1 cmp r0, 0 beq _080427EA - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r6 adds r1, r0, r1 @@ -24603,7 +24603,7 @@ _080427EA: ands r0, r1 cmp r0, 0 beq _08042816 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r6 adds r1, r0, r1 @@ -24675,7 +24675,7 @@ _08042864: ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty b _080428A4 .pool _08042894: @@ -24686,10 +24686,10 @@ _08042894: ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty _080428A4: adds r7, r1, r0 - ldr r5, =gUnknown_0202420C + ldr r5, =gEnemyMonIndex ldr r1, =gUnknown_0202406C ldrb r0, [r5] ldrb r1, [r1] @@ -24710,7 +24710,7 @@ _080428B6: ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty b _080428F8 .pool _080428E8: @@ -24721,30 +24721,30 @@ _080428E8: ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty _080428F8: adds r5, r1, r0 adds r0, r7, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x8] adds r0, r7, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x10] adds r0, r5, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 str r0, [sp, 0xC] adds r0, r5, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x14] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 ands r0, r1 @@ -24762,7 +24762,7 @@ _0804293A: .pool _08042958: ldr r2, =gUnknown_0202420A - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r5, r10 muls r5, r0 @@ -24894,7 +24894,7 @@ _08042A7E: beq _08042A86 bl _0804441E _08042A86: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -24927,7 +24927,7 @@ _08042AB4: .4byte _08042B28 .4byte _08042AE0 _08042AE0: - ldr r2, =gUnknown_020243CC + ldr r2, =gBattleWeather ldrh r1, [r2] movs r0, 0x7 ands r0, r1 @@ -24943,7 +24943,7 @@ _08042AE0: b _08042B42 .pool _08042B04: - ldr r3, =gUnknown_020243CC + ldr r3, =gBattleWeather ldrh r1, [r3] movs r2, 0x18 adds r0, r2, 0 @@ -24959,7 +24959,7 @@ _08042B04: b _08042B42 .pool _08042B28: - ldr r3, =gUnknown_020243CC + ldr r3, =gBattleWeather ldrh r1, [r3] movs r2, 0x60 adds r0, r2, 0 @@ -24992,7 +24992,7 @@ _08042B56: bl _0804441E .pool _08042B78: - ldr r2, =gUnknown_020243CC + ldr r2, =gBattleWeather ldrh r1, [r2] movs r0, 0x4 ands r0, r1 @@ -25010,7 +25010,7 @@ _08042B88: bl _080443D0 .pool _08042BA8: - ldr r2, =gUnknown_020243CC + ldr r2, =gBattleWeather ldrh r1, [r2] movs r0, 0x10 ands r0, r1 @@ -25028,7 +25028,7 @@ _08042BB8: bl _080443D0 .pool _08042BD8: - ldr r2, =gUnknown_020243CC + ldr r2, =gBattleWeather ldrh r1, [r2] movs r0, 0x40 ands r0, r1 @@ -25139,7 +25139,7 @@ _08042CC4: bl _0804441E .pool _08042CDC: - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons mov r8, r5 movs r0, 0x58 mov r6, r10 @@ -25197,7 +25197,7 @@ _08042D3E: beq _08042D56 bl _0804441E _08042D56: - ldr r0, =gUnknown_020243CC + ldr r0, =gBattleWeather ldrh r1, [r0] movs r0, 0x7 ands r0, r1 @@ -25214,7 +25214,7 @@ _08042D72: strb r5, [r7] ldr r0, =gUnknown_082DB45C bl b_push_move_exec - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage ldrh r0, [r4, 0x2C] lsrs r0, 4 str r0, [r1] @@ -25237,7 +25237,7 @@ _08042DA0: bne _08042DB0 bl _0804441E _08042DB0: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -25255,7 +25255,7 @@ _08042DCA: beq _08042DDC ldr r0, =gUnknown_02022F58 ldr r1, =gUnknown_0831BC70 - bl CopyString + bl StringCopy _08042DDC: ldr r0, [r5] movs r1, 0x7 @@ -25264,7 +25264,7 @@ _08042DDC: beq _08042DEE ldr r0, =gUnknown_02022F58 ldr r1, =gUnknown_0831BC78 - bl CopyString + bl StringCopy _08042DEE: ldr r0, [r5] movs r1, 0x40 @@ -25273,7 +25273,7 @@ _08042DEE: beq _08042E00 ldr r0, =gUnknown_02022F58 ldr r1, =gUnknown_0831BC80 - bl CopyString + bl StringCopy _08042E00: ldr r0, [r5] movs r1, 0x10 @@ -25282,7 +25282,7 @@ _08042E00: beq _08042E12 ldr r0, =gUnknown_02022F58 ldr r1, =gUnknown_0831BC88 - bl CopyString + bl StringCopy _08042E12: ldr r0, [r5] movs r1, 0x20 @@ -25291,7 +25291,7 @@ _08042E12: beq _08042E24 ldr r0, =gUnknown_02022F58 ldr r1, =gUnknown_0831BC90 - bl CopyString + bl StringCopy _08042E24: str r4, [r5] mov r1, r8 @@ -25405,7 +25405,7 @@ _08042F2C: bne _08042F3C bl _0804441E _08042F3C: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -25525,7 +25525,7 @@ _0804304C: _0804305C: cmp r3, 0xA bne _08043126 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r3, r10 muls r3, r0 @@ -25610,7 +25610,7 @@ _08043126: beq _08043130 bl _0804441E _08043130: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r3, r10 muls r3, r0 @@ -25641,7 +25641,7 @@ _08043178: bl _0804441E .pool _0804318C: - ldr r2, =gUnknown_020241F0 + ldr r2, =gBattleMoveDamage ldrh r0, [r1, 0x2C] lsrs r0, 2 str r0, [r2] @@ -25719,7 +25719,7 @@ _080431C8: .4byte _0804441E .4byte _0804379C _08043288: - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x29 ands r0, r1 @@ -25742,7 +25742,7 @@ _080432A0: bl _0804441E _080432B4: ldr r2, =gUnknown_0202437C - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 @@ -25761,7 +25761,7 @@ _080432B4: bne _080432DC bl _0804441E _080432DC: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r2, r10 muls r2, r0 @@ -25803,7 +25803,7 @@ _0804330E: bl _080443D0 .pool _08043350: - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x29 ands r0, r1 @@ -25811,7 +25811,7 @@ _08043350: beq _08043360 bl _0804441E _08043360: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -25832,7 +25832,7 @@ _08043376: bl _0804441E _08043388: ldr r2, =gUnknown_0202437C - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 @@ -25864,7 +25864,7 @@ _080433B0: bne _080433CA bl _0804441E _080433CA: - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage ldrh r0, [r3, 0x2C] lsrs r0, 4 str r0, [r1] @@ -25879,7 +25879,7 @@ _080433D8: bl _080443D0 .pool _08043410: - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x29 ands r0, r1 @@ -25887,7 +25887,7 @@ _08043410: beq _08043420 bl _0804441E _08043420: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -25908,7 +25908,7 @@ _08043436: bl _0804441E _08043448: ldr r2, =gUnknown_0202437C - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 @@ -25939,7 +25939,7 @@ _08043470: bne _08043488 bl _0804441E _08043488: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xA @@ -25952,7 +25952,7 @@ _080434A0: ldr r5, =gUnknown_02024332 movs r4, 0x3 _080434A4: - bl GenerateRandomNumber + bl Random ands r0, r4 strb r0, [r5, 0x3] cmp r0, 0 @@ -25980,7 +25980,7 @@ _080434BC: bl _080443D0 .pool _08043508: - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x29 ands r0, r1 @@ -25988,7 +25988,7 @@ _08043508: beq _08043518 bl _0804441E _08043518: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -26009,7 +26009,7 @@ _0804352E: bl _0804441E _08043540: ldr r2, =gUnknown_0202437C - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 @@ -26040,7 +26040,7 @@ _08043568: bne _08043580 bl _0804441E _08043580: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -26066,7 +26066,7 @@ _08043598: bl _080443D0 .pool _080435E4: - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x29 ands r0, r1 @@ -26074,7 +26074,7 @@ _080435E4: beq _080435F4 bl _0804441E _080435F4: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -26095,7 +26095,7 @@ _0804360A: bl _0804441E _0804361C: ldr r2, =gUnknown_0202437C - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 @@ -26126,7 +26126,7 @@ _08043644: bne _0804365C bl _0804441E _0804365C: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -26152,7 +26152,7 @@ _08043674: bl _080443D0 .pool _080436C0: - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x29 ands r0, r1 @@ -26160,7 +26160,7 @@ _080436C0: beq _080436D0 bl _0804441E _080436D0: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -26193,7 +26193,7 @@ _080436F8: bl _0804441E _08043710: ldr r2, =gUnknown_0202437C - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 @@ -26212,7 +26212,7 @@ _08043710: bne _08043738 bl _0804441E _08043738: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -26238,7 +26238,7 @@ _08043750: bl _080443D0 .pool _0804379C: - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x29 ands r0, r1 @@ -26246,7 +26246,7 @@ _0804379C: beq _080437AC bl _0804441E _080437AC: - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldr r3, =gUnknown_0202420B mov r8, r3 ldrb r1, [r3] @@ -26281,7 +26281,7 @@ _080437D8: bl _0804441E _080437F0: ldr r3, =gUnknown_0202437C - ldr r5, =gUnknown_0202420C + ldr r5, =gEnemyMonIndex ldrb r1, [r5] lsls r0, r1, 2 adds r0, r1 @@ -26308,7 +26308,7 @@ _08043818: bne _08043828 bl _0804441E _08043828: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -26378,7 +26378,7 @@ _080438B6: adds r2, r0, 0 muls r2, r7 adds r2, r4 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r5] lsls r0, 2 adds r0, r1 @@ -26402,7 +26402,7 @@ _08043908: bcc _08043918 bl _0804441E _08043918: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r2, r10 muls r2, r0 @@ -26526,7 +26526,7 @@ _08043A7C: _08043A96: ldr r0, =gUnknown_02022F58 ldr r1, =gUnknown_0831BC98 - bl CopyString + bl StringCopy movs r2, 0x2 mov r9, r2 b _08043B9C @@ -26568,7 +26568,7 @@ _08043AD4: str r0, [r2] ldr r0, =gUnknown_02022F58 ldr r1, =gUnknown_0831BC78 - bl CopyString + bl StringCopy movs r0, 0x1 mov r9, r0 b _08043B9C @@ -26588,7 +26588,7 @@ _08043B10: beq _08043B96 ldr r0, =gUnknown_02022F58 ldr r1, =gUnknown_0831BC88 - bl CopyString + bl StringCopy movs r2, 0x1 mov r9, r2 b _08043B9C @@ -26609,7 +26609,7 @@ _08043B40: ldr r0, =gUnknown_02022F58 ldr r1, =gUnknown_0831BC90 _08043B5C: - bl CopyString + bl StringCopy movs r5, 0x1 mov r9, r5 b _08043B9C @@ -26630,7 +26630,7 @@ _08043B70: beq _08043B96 ldr r0, =gUnknown_02022F58 ldr r1, =gUnknown_0831BCA0 - bl CopyString + bl StringCopy movs r2, 0x3 mov r9, r2 _08043B96: @@ -26653,7 +26653,7 @@ _08043BB4: beq _08043BE8 b _08043BFC _08043BBC: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r2, r10 muls r2, r0 @@ -26663,7 +26663,7 @@ _08043BBC: b _08043BFA .pool _08043BD0: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r2, r10 muls r2, r0 @@ -26675,7 +26675,7 @@ _08043BD0: b _08043BF8 .pool _08043BE8: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r2, r10 muls r2, r0 @@ -26735,7 +26735,7 @@ _08043C6C: bcc _08043C7A b _0804441E _08043C7A: - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons _08043C7C: movs r0, 0x58 mov r3, r10 @@ -26808,7 +26808,7 @@ _08043CF8: adds r0, 0x40 strb r0, [r1, 0x3] ldr r1, =gUnknown_02024474 - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] strb r0, [r1, 0x17] bl b_movescr_stack_push_cursor @@ -26885,7 +26885,7 @@ _08043DC4: blt _08043DD0 b _0804441E _08043DD0: - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r5, r1, 0 ldr r2, =gUnknown_020242AC adds r3, r0, 0 @@ -26919,7 +26919,7 @@ _08043E08: _08043E14: ldr r5, =gUnknown_02024064 mov r8, r5 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r0, 0x20 str r0, [sp, 0x1C] movs r1, 0 @@ -26958,7 +26958,7 @@ _08043E42: bl battle_get_side_with_given_state lsls r0, 24 lsrs r7, r0, 24 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r2, 0x1 ands r0, r2 @@ -26969,7 +26969,7 @@ _08043E74: movs r1, 0x58 adds r0, r6, 0 muls r0, r1 - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons adds r1, r0, r3 adds r0, r1, 0 adds r0, 0x20 @@ -26992,7 +26992,7 @@ _08043E74: cmp r0, 0 beq _08043EFC str r2, [sp, 0x24] - bl GenerateRandomNumber + bl Random ldr r2, [sp, 0x24] adds r1, r2, 0 ands r1, r0 @@ -27005,7 +27005,7 @@ _08043E74: ldrb r0, [r2] movs r3, 0x58 muls r0, r3 - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons adds r0, r5 adds r0, 0x20 ldrb r0, [r0] @@ -27021,7 +27021,7 @@ _08043E74: b _08043FAC .pool _08043EFC: - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons movs r2, 0x58 adds r0, r6, 0 muls r0, r2 @@ -27054,7 +27054,7 @@ _08043EFC: b _08043FA8 .pool _08043F40: - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons movs r2, 0x58 adds r0, r7, 0 muls r0, r2 @@ -27092,7 +27092,7 @@ _08043F84: movs r3, 0x58 adds r0, r6, 0 muls r0, r3 - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons adds r0, r5 adds r2, r0, 0 adds r2, 0x20 @@ -27143,7 +27143,7 @@ _08043FE4: blt _08043FF0 b _0804441E _08043FF0: - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r5, r1, 0 ldr r2, =gUnknown_020242AC adds r3, r0, 0 @@ -27179,7 +27179,7 @@ _08044028: blt _0804403E b _0804441E _0804403E: - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons _08044040: lsls r0, r4, 24 lsrs r0, 24 @@ -27221,7 +27221,7 @@ _08044084: blt _0804409A b _0804441E _0804409A: - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons _0804409C: lsls r0, r4, 24 lsrs r0, 24 @@ -27265,7 +27265,7 @@ _080440E0: blt _080440F8 b _0804441E _080440F8: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons b _08044174 .pool _08044104: @@ -27353,7 +27353,7 @@ _08044196: blt _080441A2 b _0804441E _080441A2: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons mov r8, r2 adds r2, r0, 0 movs r5, 0x58 @@ -27389,7 +27389,7 @@ _080441DC: blt _080441E8 b _0804441E _080441E8: - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons adds r1, r0, 0 movs r5, 0x58 ldr r2, =gUnknown_0202420A @@ -27426,7 +27426,7 @@ _08044220: blt _08044236 b _0804441E _08044236: - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons _08044238: lsls r0, r4, 24 lsrs r0, 24 @@ -27469,7 +27469,7 @@ _0804427C: blt _08044292 b _0804441E _08044292: - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons _08044294: lsls r0, r4, 24 lsrs r0, 24 @@ -27607,7 +27607,7 @@ _080443EC: ldrb r1, [r0] cmp r4, r1 bge _0804441E - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r2, r1, 0 adds r1, r0, 0 adds r1, 0x20 @@ -27735,7 +27735,7 @@ berry_effects_maybe: @ 80444DC add r0, sp, 0x4 strb r1, [r0] ldr r4, =gUnknown_02024208 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r7 adds r0, r1 @@ -27765,7 +27765,7 @@ _08044534: lsrs r0, 24 _08044548: mov r9, r0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -27797,8 +27797,8 @@ _0804457C: lsrs r0, 24 _08044592: str r0, [sp, 0x10] - ldr r2, =gUnknown_02024084 - ldr r0, =gUnknown_0202420C + ldr r2, =gBattleMons + ldr r0, =gEnemyMonIndex ldrb r1, [r0] movs r0, 0x58 muls r0, r1 @@ -27851,7 +27851,7 @@ _08044604: bl _0804582A .pool _08044618: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons mov r8, r1 movs r0, 0x58 adds r1, r7, 0 @@ -27896,7 +27896,7 @@ _08044654: bl _0804582A .pool _08044688: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r7 adds r0, r1 @@ -27978,7 +27978,7 @@ _0804477A: beq _08044782 bl _080451D6 _08044782: - ldr r4, =gUnknown_020241F0 + ldr r4, =gBattleMoveDamage mov r3, r9 str r3, [r4] ldrh r3, [r2, 0x28] @@ -28013,7 +28013,7 @@ _080447B8: ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty b _080447EA .pool _080447DC: @@ -28023,7 +28023,7 @@ _080447DC: ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty _080447EA: adds r4, r1, r0 movs r1, 0 @@ -28033,17 +28033,17 @@ _080447F2: mov r1, r10 adds r1, 0xD adds r0, r4, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r6, r0, 16 mov r1, r10 adds r1, 0x11 adds r0, r4, 0 - bl pokemon_getattr + bl GetMonData strb r0, [r5] adds r0, r4, 0 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r1, r0, 24 cmp r6, 0 @@ -28113,7 +28113,7 @@ _08044864: bl _080451DE .pool _080448B0: - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons movs r1, 0x58 muls r1, r7 adds r0, 0x18 @@ -28171,7 +28171,7 @@ _08044930: beq _08044938 bl _080451D6 _08044938: - ldr r3, =gUnknown_020241F0 + ldr r3, =gBattleMoveDamage ldrh r0, [r1, 0x2C] lsrs r0, 4 str r0, [r3] @@ -28227,7 +28227,7 @@ _0804499E: strb r6, [r1, 0x2] movs r0, 0xFF strb r0, [r1, 0x3] - ldr r5, =gUnknown_020241F0 + ldr r5, =gBattleMoveDamage ldrh r0, [r4, 0x2C] mov r1, r9 bl __divsi3 @@ -28289,7 +28289,7 @@ _08044A1C: strb r6, [r1, 0x2] movs r0, 0xFF strb r0, [r1, 0x3] - ldr r4, =gUnknown_020241F0 + ldr r4, =gBattleMoveDamage ldrh r0, [r5, 0x2C] mov r1, r9 bl __divsi3 @@ -28351,7 +28351,7 @@ _08044A96: strb r0, [r1, 0x2] movs r0, 0xFF strb r0, [r1, 0x3] - ldr r4, =gUnknown_020241F0 + ldr r4, =gBattleMoveDamage ldrh r0, [r5, 0x2C] mov r1, r9 bl __divsi3 @@ -28422,7 +28422,7 @@ _08044B2A: strb r0, [r1, 0x2] movs r0, 0xFF strb r0, [r1, 0x3] - ldr r4, =gUnknown_020241F0 + ldr r4, =gBattleMoveDamage ldrh r0, [r5, 0x2C] mov r1, r9 bl __divsi3 @@ -28493,7 +28493,7 @@ _08044BBC: strb r0, [r1, 0x2] movs r0, 0xFF strb r0, [r1, 0x3] - ldr r4, =gUnknown_020241F0 + ldr r4, =gBattleMoveDamage ldrh r0, [r5, 0x2C] mov r1, r9 bl __divsi3 @@ -28851,7 +28851,7 @@ _08044EB4: adds r4, r0, 0x1 ldr r5, =gUnknown_0202409C _08044EBC: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x5 @@ -29080,7 +29080,7 @@ _0804509A: beq _080450B2 ldr r0, =gUnknown_02022F58 ldr r1, =gUnknown_0831BC70 - bl CopyString + bl StringCopy movs r0, 0x1 mov r10, r0 _080450B2: @@ -29099,7 +29099,7 @@ _080450B2: str r0, [r2] ldr r0, =gUnknown_02022F58 ldr r1, =gUnknown_0831BC78 - bl CopyString + bl StringCopy movs r2, 0x1 add r10, r2 _080450D8: @@ -29110,7 +29110,7 @@ _080450D8: beq _080450EE ldr r0, =gUnknown_02022F58 ldr r1, =gUnknown_0831BC80 - bl CopyString + bl StringCopy movs r3, 0x1 add r10, r3 _080450EE: @@ -29121,7 +29121,7 @@ _080450EE: beq _08045104 ldr r0, =gUnknown_02022F58 ldr r1, =gUnknown_0831BC88 - bl CopyString + bl StringCopy movs r0, 0x1 add r10, r0 _08045104: @@ -29132,7 +29132,7 @@ _08045104: beq _0804511A ldr r0, =gUnknown_02022F58 ldr r1, =gUnknown_0831BC90 - bl CopyString + bl StringCopy movs r1, 0x1 add r10, r1 _0804511A: @@ -29144,7 +29144,7 @@ _0804511A: beq _08045132 ldr r0, =gUnknown_02022F58 ldr r1, =gUnknown_0831BC98 - bl CopyString + bl StringCopy movs r3, 0x1 add r10, r3 _08045132: @@ -29160,7 +29160,7 @@ _08045164: movs r0, 0x1 _08045168: strb r0, [r1, 0x5] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r0, 0x58 adds r3, r7, 0 muls r3, r0 @@ -29200,7 +29200,7 @@ _080451A0: str r2, [r1] ldr r0, =gUnknown_02022F58 ldr r1, =gUnknown_0831BCA0 - bl CopyString + bl StringCopy ldr r0, =gUnknown_082DB794 bl b_call_bc_move_exec ldr r1, =gUnknown_02024332 @@ -29234,7 +29234,7 @@ _08045220: muls r0, r7 b _0804568C _08045226: - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons movs r0, 0x58 adds r3, r7, 0 muls r3, r0 @@ -29256,7 +29256,7 @@ _08045242: adds r0, r1 ldrb r1, [r0, 0x18] lsrs r1, 4 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable mov r5, r10 lsls r0, r5, 2 adds r0, r2 @@ -29284,7 +29284,7 @@ _08045280: b _0804582A _0804528C: ldr r4, =gUnknown_02024208 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r7 adds r0, r1 @@ -29351,7 +29351,7 @@ _080452E8: .4byte _08045674 .4byte _080454C8 _08045354: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r7 adds r1, 0x4C @@ -29376,7 +29376,7 @@ _0804536A: b _0804567A .pool _08045390: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r7 adds r1, 0x4C @@ -29400,7 +29400,7 @@ _080453A6: b _0804567A .pool _080453CC: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r7 adds r1, 0x4C @@ -29425,7 +29425,7 @@ _080453E2: b _0804567A .pool _08045408: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r7 adds r1, 0x4C @@ -29450,7 +29450,7 @@ _0804541E: b _0804567A .pool _08045444: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r0, 0x58 adds r4, r7, 0 muls r4, r0 @@ -29480,7 +29480,7 @@ _0804545E: b _080455DC .pool _0804548C: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r7 adds r1, 0x50 @@ -29505,7 +29505,7 @@ _080454A2: b _0804567A .pool _080454C8: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r7 adds r1, 0x50 @@ -29523,7 +29523,7 @@ _080454E0: str r1, [r2] ldr r0, =gUnknown_02022F58 ldr r1, =gUnknown_0831BCA0 - bl CopyString + bl StringCopy bl b_movescr_stack_push_cursor ldr r1, =gUnknown_02024332 movs r0, 0 @@ -29536,7 +29536,7 @@ _080454E0: b _0804567A .pool _08045520: - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons movs r0, 0x58 adds r5, r7, 0 muls r5, r0 @@ -29563,7 +29563,7 @@ _08045548: beq _08045558 ldr r0, =gUnknown_02022F58 ldr r1, =gUnknown_0831BC70 - bl CopyString + bl StringCopy _08045558: ldr r0, [r6] movs r2, 0x7 @@ -29579,7 +29579,7 @@ _08045558: str r0, [r2] ldr r0, =gUnknown_02022F58 ldr r1, =gUnknown_0831BC78 - bl CopyString + bl StringCopy _08045578: ldr r0, [r6] movs r1, 0x40 @@ -29588,7 +29588,7 @@ _08045578: beq _0804558A ldr r0, =gUnknown_02022F58 ldr r1, =gUnknown_0831BC80 - bl CopyString + bl StringCopy _0804558A: ldr r0, [r6] movs r1, 0x10 @@ -29597,7 +29597,7 @@ _0804558A: beq _0804559C ldr r0, =gUnknown_02022F58 ldr r1, =gUnknown_0831BC88 - bl CopyString + bl StringCopy _0804559C: ldr r0, [r6] movs r1, 0x20 @@ -29606,7 +29606,7 @@ _0804559C: beq _080455AE ldr r0, =gUnknown_02022F58 ldr r1, =gUnknown_0831BC90 - bl CopyString + bl StringCopy _080455AE: adds r5, r4 ldr r0, [r5] @@ -29616,7 +29616,7 @@ _080455AE: beq _080455C2 ldr r0, =gUnknown_02022F58 ldr r1, =gUnknown_0831BC98 - bl CopyString + bl StringCopy _080455C2: movs r4, 0 str r4, [r6] @@ -29637,7 +29637,7 @@ _080455DC: b _0804567A .pool _08045614: - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons mov r8, r0 movs r0, 0x58 adds r1, r7, 0 @@ -29717,7 +29717,7 @@ _080456C8: b _0804582A .pool _080456D0: - ldr r7, =gUnknown_020241F0 + ldr r7, =gBattleMoveDamage ldr r0, [r7] cmp r0, 0 bne _080456DA @@ -29731,7 +29731,7 @@ _080456DA: b _0804582A .pool _080456EC: - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x29 ands r0, r1 @@ -29740,7 +29740,7 @@ _080456EC: b _0804582A _080456FA: ldr r2, =gUnknown_0202437C - ldr r4, =gUnknown_0202420C + ldr r4, =gEnemyMonIndex ldrb r1, [r4] lsls r0, r1, 2 adds r0, r1 @@ -29759,7 +29759,7 @@ _080456FA: bne _08045720 b _0804582A _08045720: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -29781,7 +29781,7 @@ _08045720: ands r0, r1 cmp r0, 0 beq _0804582A - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r4] movs r0, 0x58 muls r0, r1 @@ -29800,14 +29800,14 @@ _08045720: b _0804582A .pool _08045794: - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r0, [r0] movs r5, 0x29 ands r5, r0 cmp r5, 0 bne _0804582A ldr r1, =gUnknown_0202437C - ldr r4, =gUnknown_0202420C + ldr r4, =gEnemyMonIndex ldrb r2, [r4] lsls r0, r2, 2 adds r0, r2 @@ -29824,7 +29824,7 @@ _08045794: ldrb r3, [r0] cmp r3, r2 beq _0804582A - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r0] movs r0, 0x58 muls r0, r1 @@ -29898,7 +29898,7 @@ sub_8045868: @ 8045868 adds r1, r2 movs r2, 0 strb r2, [r1, 0x10] - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r2, 0x58 adds r3, r0, 0 muls r3, r2 @@ -30058,7 +30058,7 @@ _08045A28: ldrb r0, [r2, 0x8] cmp r0, 0 beq _08045A5A - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r4, [r2, 0x9] movs r0, 0x58 muls r0, r4 @@ -30076,7 +30076,7 @@ _08045A5A: lsls r0, r7, 1 mov r8, r0 _08045A6A: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 ldr r1, =gUnknown_0202406C @@ -30096,7 +30096,7 @@ _08045A6A: beq _08045A6A ldr r0, =gUnknown_02024210 ldrb r2, [r0] - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable lsls r0, r5, 2 adds r0, r1 ldr r0, [r0] @@ -30124,7 +30124,7 @@ _08045AB8: bne _08045ACE b _08045C20 _08045ACE: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r1, 0x58 adds r0, r5, 0 muls r0, r1 @@ -30181,7 +30181,7 @@ _08045B40: ldrb r0, [r2, 0x8] cmp r0, 0 beq _08045B80 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r4, [r2, 0x9] movs r0, 0x58 muls r0, r4 @@ -30194,7 +30194,7 @@ _08045B70: b _08045C20 .pool _08045B80: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r4, 0x1 ands r0, r4 @@ -30210,7 +30210,7 @@ _08045B80: lsls r0, 24 cmp r0, 0 bne _08045BC0 - bl GenerateRandomNumber + bl Random adds r1, r4, 0 ands r1, r0 cmp r1, 0 @@ -30222,7 +30222,7 @@ _08045BBC: movs r0, 0x3 b _08045BD2 _08045BC0: - bl GenerateRandomNumber + bl Random adds r1, r4, 0 ands r1, r0 cmp r1, 0 @@ -30237,7 +30237,7 @@ _08045BD2: lsrs r5, r0, 24 ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] @@ -30299,11 +30299,11 @@ sub_8045C44: @ 8045C44 ldrh r0, [r5] movs r7, 0x64 muls r0, r7 - ldr r6, =gUnknown_020244EC + ldr r6, =gPlayerParty adds r0, r6 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData movs r1, 0xCD lsls r1, 1 cmp r0, r1 @@ -30313,7 +30313,7 @@ sub_8045C44: @ 8045C44 adds r0, r6 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0x97 beq _08045C98 _08045C8A: @@ -30326,11 +30326,11 @@ _08045C98: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x50 movs r2, 0 - bl pokemon_getattr + bl GetMonData _08045CAE: pop {r4-r7} pop {r1} @@ -30346,7 +30346,7 @@ sub_8045CBC: @ 8045CBC push {r6,r7} sub sp, 0x10 movs r6, 0 - ldr r5, =gUnknown_02022FEC + ldr r5, =gBattleTypeFlags ldr r0, [r5] ldr r1, =0x02000002 ands r0, r1 @@ -30376,7 +30376,7 @@ sub_8045CBC: @ 8045CBC cmp r0, 0x2 beq _08045DAC _08045D08: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x003f0100 ands r0, r1 @@ -30387,7 +30387,7 @@ _08045D08: ands r1, r0 cmp r1, 0 bne _08045DAC - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -30429,7 +30429,7 @@ _08045D68: beq _08045D76 movs r6, 0x46 _08045D76: - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons ldr r0, =gUnknown_0202420B mov r8, r0 ldrb r0, [r0] @@ -30440,7 +30440,7 @@ _08045D76: ldrb r0, [r0] cmp r0, r6 bls _08045DAC - bl GenerateRandomNumber + bl Random movs r1, 0xFF ands r1, r0 mov r2, r8 @@ -30494,11 +30494,11 @@ _08045E0A: b _08045F7A .pool _08045E20: - bl GenerateRandomNumber + bl Random movs r5, 0xFF adds r1, r5, 0 ands r1, r0 - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldr r2, =gUnknown_0202420B mov r9, r2 ldrb r3, [r2] @@ -30514,7 +30514,7 @@ _08045E20: asrs r4, r0, 8 cmp r4, r6 bge _08045EE8 - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable ldr r5, =gUnknown_020241E8 ldrb r0, [r5] lsls r0, 2 @@ -30533,7 +30533,7 @@ _08045E68: mov r8, r1 movs r7, 0x3 _08045E6E: - bl GenerateRandomNumber + bl Random ands r0, r7 mov r2, r8 strb r0, [r2] @@ -30546,7 +30546,7 @@ _08045E6E: cmp r0, 0 bne _08045E6E ldr r4, =gUnknown_020241EE - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r0, =gUnknown_020241E8 ldrb r0, [r0] lsls r0, 1 @@ -30565,7 +30565,7 @@ _08045E6E: ldrh r0, [r4] movs r1, 0 bl sub_80458E0 - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex strb r0, [r1] ldr r2, =gUnknown_02024280 ldr r0, [r2] @@ -30577,7 +30577,7 @@ _08045EE8: subs r0, r2, r6 lsls r0, 24 lsrs r6, r0, 24 - bl GenerateRandomNumber + bl Random adds r4, r5, 0 ands r4, r0 cmp r4, r6 @@ -30637,7 +30637,7 @@ _08045F64: cmp r4, r6 blt _08045F8C _08045F6A: - bl GenerateRandomNumber + bl Random ldr r2, =gUnknown_02024332 movs r1, 0x3 ands r1, r0 @@ -30654,7 +30654,7 @@ _08045F8C: ldrb r1, [r4] movs r0, 0x58 muls r1, r0 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r1, r0 movs r0, 0x28 str r0, [sp] @@ -30668,9 +30668,9 @@ _08045F8C: movs r2, 0x1 movs r3, 0 bl sub_806957C - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage str r0, [r1] - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex ldrb r0, [r4] strb r0, [r1] ldr r1, =gUnknown_02024214 @@ -30712,7 +30712,7 @@ atk00_attackcanceler: @ 8045FFC b _08046398 .pool _08046020: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -30744,7 +30744,7 @@ _08046064: beq _08046072 b _08046398 _08046072: - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r1, [r0] str r2, [sp] movs r0, 0x2 @@ -30756,7 +30756,7 @@ _08046072: beq _0804608A b _08046398 _0804608A: - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldr r0, =gUnknown_020241E8 ldrb r1, [r0] ldr r3, =gUnknown_0202420B @@ -30792,7 +30792,7 @@ _0804608A: ldr r1, =gUnknown_02024214 ldr r0, =gUnknown_082DB07A str r0, [r1] - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 @@ -30834,7 +30834,7 @@ _08046108: b _08046398 .pool _08046150: - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 @@ -30849,7 +30849,7 @@ _08046160: orrs r0, r1 str r0, [r2] ldr r2, =gUnknown_0202433C - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex ldrb r3, [r1] lsls r0, r3, 4 adds r0, r2 @@ -30979,7 +30979,7 @@ _08046296: beq _08046390 cmp r3, 0xAE bne _080462D4 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -31001,7 +31001,7 @@ _080462D4: lsls r0, 24 cmp r0, 0 beq _080462FA - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -31018,13 +31018,13 @@ _080462FA: ldr r0, =gUnknown_0202420B ldrb r0, [r0] bl b_cancel_multi_turn_move_maybe - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] ldr r1, =gUnknown_02024250 - ldr r3, =gUnknown_0202420C + ldr r3, =gEnemyMonIndex ldrb r0, [r3] lsls r0, 1 adds r0, r1 @@ -31090,14 +31090,14 @@ mcmd_jump_if_move_not_executed: @ 80463AC ldr r1, =gUnknown_02024214 ldr r5, [r1] adds r4, r5, r0 - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x29 ands r0, r1 cmp r0, 0 beq _0804640C ldr r1, =gUnknown_02024250 - ldr r3, =gUnknown_0202420C + ldr r3, =gEnemyMonIndex ldrb r0, [r3] lsls r0, 1 adds r0, r1 @@ -31122,7 +31122,7 @@ mcmd_jump_if_move_not_executed: @ 80463AC .pool _0804640C: bl b_feature_update_destiny_bond - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r1, [r0] str r6, [sp] movs r0, 0x3 @@ -31147,7 +31147,7 @@ _0804642A: atk40_801DBA0: @ 804643C push {lr} ldr r1, =gUnknown_0202433C - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] lsls r0, 4 adds r0, r1 @@ -31167,7 +31167,7 @@ atk40_801DBA0: @ 804643C ands r0, r1 cmp r0, 0 beq _0804649C - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 @@ -31198,7 +31198,7 @@ sub_80464AC: @ 80464AC lsrs r3, r0, 16 movs r4, 0 ldr r1, =gUnknown_0202433C - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] lsls r0, 4 adds r0, r1 @@ -31218,7 +31218,7 @@ sub_80464AC: @ 80464AC ands r0, r1 cmp r0, 0 beq _080464F8 - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 @@ -31245,7 +31245,7 @@ sub_8046518: @ 8046518 lsls r0, 16 lsrs r5, r0, 16 ldr r2, =gUnknown_020242AC - ldr r3, =gUnknown_0202420C + ldr r3, =gEnemyMonIndex ldrb r4, [r3] lsls r0, r4, 2 adds r0, r2 @@ -31283,7 +31283,7 @@ _0804654A: cmp r0, 0 beq _08046590 _0804656A: - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 @@ -31351,7 +31351,7 @@ _080465D2: lsls r0, 24 cmp r0, 0 bne _08046622 - ldr r0, =gUnknown_020243CC + ldr r0, =gBattleWeather ldrh r1, [r0] movs r0, 0x7 ands r0, r1 @@ -31411,7 +31411,7 @@ atk01_accuracycheck: @ 8046660 cmp r1, 0x1 bhi _0804671C ldr r2, =gUnknown_020242AC - ldr r3, =gUnknown_0202420C + ldr r3, =gEnemyMonIndex ldrb r4, [r3] lsls r0, r4, 2 adds r0, r2 @@ -31515,8 +31515,8 @@ _08046760: beq _0804676E b _080469D2 _0804676E: - ldr r3, =gUnknown_02024084 - ldr r0, =gUnknown_0202420C + ldr r3, =gBattleMons + ldr r0, =gEnemyMonIndex ldrb r0, [r0] movs r2, 0x58 adds r4, r0, 0 @@ -31589,7 +31589,7 @@ _080467D0: lsls r0, 24 cmp r0, 0 bne _08046822 - ldr r0, =gUnknown_020243CC + ldr r0, =gBattleWeather ldrh r1, [r0] movs r0, 0x60 ands r0, r1 @@ -31613,7 +31613,7 @@ _08046822: bl __divsi3 lsls r0, 16 lsrs r4, r0, 16 - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r0, [r0] movs r5, 0x58 @@ -31651,7 +31651,7 @@ _08046860: lsls r0, 24 cmp r0, 0 bne _080468B8 - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] muls r0, r5 adds r0, r7 @@ -31659,7 +31659,7 @@ _08046860: ldrb r0, [r0] cmp r0, 0x8 bne _080468B8 - ldr r0, =gUnknown_020243CC + ldr r0, =gBattleWeather ldrh r1, [r0] movs r0, 0x18 ands r0, r1 @@ -31673,7 +31673,7 @@ _08046860: lsls r0, 16 lsrs r4, r0, 16 _080468B8: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -31695,7 +31695,7 @@ _080468B8: lsls r0, 16 lsrs r4, r0, 16 _080468E4: - ldr r2, =gUnknown_0202420C + ldr r2, =gEnemyMonIndex mov r8, r2 ldrb r2, [r2] movs r7, 0x58 @@ -31730,7 +31730,7 @@ _08046928: lsrs r2, r0, 24 _08046944: ldr r0, =gUnknown_0202420F - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex ldrb r1, [r1] strb r1, [r0] cmp r5, 0x16 @@ -31743,7 +31743,7 @@ _08046944: lsls r0, 16 lsrs r4, r0, 16 _08046960: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -31753,12 +31753,12 @@ _08046960: adds r0, 0x1 cmp r0, r4 ble _080469CA - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -31911,13 +31911,13 @@ _08046ABC: adds r6, r0 b _08046AF6 _08046AD6: - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex mov r2, r9 ldrb r0, [r2] ldrb r7, [r1] cmp r0, r7 beq _08046AF6 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r1] movs r0, 0x58 muls r0, r1 @@ -31935,7 +31935,7 @@ _08046AF6: ands r4, r0 cmp r4, 0 bne _08046BDC - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r3, =gUnknown_020241E8 ldr r1, =gUnknown_0202420B ldrb r5, [r1] @@ -32002,7 +32002,7 @@ _08046B72: adds r0, r1 ldrb r1, [r0, 0x18] lsrs r1, 4 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r0, [r7] lsls r0, 2 adds r0, r2 @@ -32057,7 +32057,7 @@ _08046BEE: thumb_func_start atk04_critcalc atk04_critcalc: @ 8046C18 push {r4-r7,lr} - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -32083,7 +32083,7 @@ _08046C50: ldr r3, =gUnknown_0202420B ldrb r0, [r3] strb r0, [r1] - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldrb r1, [r3] movs r0, 0x58 adds r7, r1, 0 @@ -32167,7 +32167,7 @@ _08046CF2: bls _08046D00 movs r5, 0x4 _08046D00: - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r1, [r0] movs r0, 0x58 muls r0, r1 @@ -32189,14 +32189,14 @@ _08046D00: ands r0, r1 cmp r0, 0 bne _08046D70 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x84 lsls r1, 2 ands r0, r1 cmp r0, 0 bne _08046D70 - bl GenerateRandomNumber + bl Random ldr r2, =gUnknown_0831C128 lsls r1, r5, 1 adds r1, r2 @@ -32207,12 +32207,12 @@ _08046D00: lsls r0, 16 cmp r0, 0 bne _08046D70 - ldr r1, =gUnknown_02024211 + ldr r1, =gCritMultiplier movs r0, 0x2 b _08046D74 .pool _08046D70: - ldr r1, =gUnknown_02024211 + ldr r1, =gCritMultiplier movs r0, 0x1 _08046D74: strb r0, [r1] @@ -32231,7 +32231,7 @@ atk05_cmd5: @ 8046D8C push {r4-r7,lr} sub sp, 0x10 ldr r4, =gUnknown_0202428E - ldr r5, =gUnknown_0202420C + ldr r5, =gEnemyMonIndex ldrb r0, [r5] bl battle_get_per_side_status movs r1, 0x1 @@ -32243,7 +32243,7 @@ atk05_cmd5: @ 8046D8C ldrb r0, [r6] movs r4, 0x58 muls r0, r4 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons adds r0, r2 ldrb r1, [r5] muls r1, r4 @@ -32262,8 +32262,8 @@ atk05_cmd5: @ 8046D8C ldrb r4, [r5] str r4, [sp, 0xC] bl sub_806957C - ldr r4, =gUnknown_020241F0 - ldr r1, =gUnknown_02024211 + ldr r4, =gBattleMoveDamage + ldr r1, =gCritMultiplier ldrb r1, [r1] muls r1, r0 ldr r0, =gUnknown_02024474 @@ -32302,7 +32302,7 @@ _08046E10: lsls r0, 28 cmp r0, 0 bge _08046E32 - ldr r4, =gUnknown_020241F0 + ldr r4, =gBattleMoveDamage ldr r1, [r4] lsls r0, r1, 4 subs r0, r1 @@ -32343,7 +32343,7 @@ sub_8046E7C: @ 8046E7C movs r1, 0x58 adds r0, r7, 0 muls r0, r1 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons adds r0, r2 muls r1, r5 adds r1, r2 @@ -32360,10 +32360,10 @@ sub_8046E7C: @ 8046E7C str r7, [sp, 0x8] str r5, [sp, 0xC] bl sub_806957C - ldr r4, =gUnknown_020241F0 + ldr r4, =gBattleMoveDamage movs r1, 0 strh r1, [r6] - ldr r1, =gUnknown_02024211 + ldr r1, =gCritMultiplier ldrb r1, [r1] muls r1, r0 ldr r0, =gUnknown_02024474 @@ -32400,7 +32400,7 @@ _08046F0A: lsls r0, 28 cmp r0, 0 bge _08046F28 - ldr r4, =gUnknown_020241F0 + ldr r4, =gBattleMoveDamage ldr r1, [r4] lsls r0, r1, 4 subs r0, r1 @@ -32422,7 +32422,7 @@ battle_attack_damage_modulate_by_effectivity: @ 8046F60 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r5, =gUnknown_020241F0 + ldr r5, =gBattleMoveDamage ldr r0, [r5] muls r0, r4 movs r1, 0xA @@ -32448,7 +32448,7 @@ _08046F94: beq _08046FF0 b _08047032 _08046F9A: - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x8 orrs r0, r1 @@ -32469,7 +32469,7 @@ _08046FB0: ldrb r0, [r0, 0x1] cmp r0, 0 beq _08047032 - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r1, [r2] movs r0, 0x29 ands r0, r1 @@ -32497,7 +32497,7 @@ _08046FF0: ldrb r0, [r0, 0x1] cmp r0, 0 beq _08047032 - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r1, [r2] movs r0, 0x29 ands r0, r1 @@ -32557,7 +32557,7 @@ _08047068: ldrb r0, [r0, 0x2] mov r8, r0 _08047078: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -32575,7 +32575,7 @@ _08047078: cmp r0, r8 bne _080470B0 _0804709A: - ldr r4, =gUnknown_020241F0 + ldr r4, =gBattleMoveDamage ldr r1, [r4] lsls r0, r1, 4 subs r0, r1 @@ -32586,7 +32586,7 @@ _0804709A: str r0, [r4] ldr r3, [sp, 0x4] _080470B0: - ldr r2, =gUnknown_0202420C + ldr r2, =gEnemyMonIndex ldrb r1, [r2] movs r0, 0x58 muls r0, r1 @@ -32601,7 +32601,7 @@ _080470B0: bne _08047128 ldr r3, =gUnknown_0202420A strb r0, [r3] - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x9 orrs r0, r1 @@ -32643,8 +32643,8 @@ _0804713C: bne _08047198 adds r1, r3, 0x1 adds r1, r5 - ldr r2, =gUnknown_02024084 - ldr r7, =gUnknown_0202420C + ldr r2, =gBattleMons + ldr r7, =gEnemyMonIndex ldrb r0, [r7] movs r6, 0x58 muls r0, r6 @@ -32683,8 +32683,8 @@ _08047172: ldr r3, [sp, 0x4] _08047198: adds r3, 0x3 - ldr r5, =gUnknown_02024084 - ldr r4, =gUnknown_0202420C + ldr r5, =gBattleMons + ldr r4, =gEnemyMonIndex ldr r2, =gUnknown_0831ACE8 _080471A0: adds r0, r3, r2 @@ -32707,8 +32707,8 @@ _080471A4: cmp r0, 0 beq _08047138 _080471C4: - ldr r2, =gUnknown_02024084 - ldr r5, =gUnknown_0202420C + ldr r2, =gBattleMons + ldr r5, =gEnemyMonIndex ldrb r1, [r5] movs r0, 0x58 muls r0, r1 @@ -32726,7 +32726,7 @@ _080471C4: lsrs r0, 24 cmp r0, 0x2 bne _08047242 - ldr r1, =gUnknown_0202427C + ldr r1, =gBattleMoveFlags mov r8, r1 ldrb r4, [r1] ands r0, r4 @@ -32770,7 +32770,7 @@ _08047200: ldrb r1, [r3] bl b_history__record_ability_usage_of_player _08047242: - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x8 ands r0, r1 @@ -32840,8 +32840,8 @@ _080472F4: ldrb r1, [r1, 0x2] mov r12, r1 _080472F8: - ldr r2, =gUnknown_02024084 - ldr r3, =gUnknown_0202420C + ldr r2, =gBattleMons + ldr r3, =gEnemyMonIndex ldrb r1, [r3] movs r0, 0x58 muls r0, r1 @@ -32897,7 +32897,7 @@ _08047356: ldrb r0, [r0] cmp r0, 0 bne _08047396 - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x8 orrs r0, r1 @@ -32933,7 +32933,7 @@ _08047396: ldrb r0, [r0] cmp r0, 0 bne _080473DC - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x8 orrs r0, r1 @@ -33121,7 +33121,7 @@ b_attack_effectivity_adapt: @ 804752C lsrs r4, r0, 24 lsls r1, 16 lsrs r5, r1, 16 - ldr r7, =gUnknown_020241F0 + ldr r7, =gBattleMoveDamage ldr r0, [r7] muls r0, r4 movs r1, 0xA @@ -33250,7 +33250,7 @@ _08047616: adds r0, r1 ldrb r0, [r0, 0x2] str r0, [sp, 0x8] - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 ldr r3, [sp, 0x4] muls r0, r3 @@ -33269,7 +33269,7 @@ _08047616: cmp r0, r1 bne _0804765C _0804764A: - ldr r4, =gUnknown_020241F0 + ldr r4, =gBattleMoveDamage ldr r1, [r4] lsls r0, r1, 4 subs r0, r1 @@ -33328,7 +33328,7 @@ _080476B6: bne _08047710 adds r1, 0x1 adds r1, r7 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r0, 0x58 mov r3, r9 muls r3, r0 @@ -33366,7 +33366,7 @@ _080476F0: _08047710: movs r1, 0x3 add r8, r1 - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons ldr r2, =gUnknown_0831ACE8 _08047718: mov r3, r8 @@ -33584,7 +33584,7 @@ _080478A0: thumb_func_start sub_80478B8 sub_80478B8: @ 80478B8 push {r4,lr} - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xF @@ -33593,7 +33593,7 @@ sub_80478B8: @ 80478B8 subs r1, r0 lsls r1, 16 lsrs r1, 16 - ldr r4, =gUnknown_020241F0 + ldr r4, =gBattleMoveDamage ldr r0, [r4] cmp r0, 0 beq _080478EA @@ -33616,7 +33616,7 @@ _080478EA: thumb_func_start atk07_cmd7 atk07_cmd7: @ 80478F4 push {r4-r7,lr} - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xF @@ -33625,7 +33625,7 @@ atk07_cmd7: @ 80478F4 subs r1, r0 lsls r1, 16 lsrs r1, 16 - ldr r4, =gUnknown_020241F0 + ldr r4, =gBattleMoveDamage ldr r0, [r4] cmp r0, 0 beq _08047926 @@ -33639,8 +33639,8 @@ atk07_cmd7: @ 80478F4 movs r0, 0x1 str r0, [r4] _08047926: - ldr r7, =gUnknown_02024084 - ldr r6, =gUnknown_0202420C + ldr r7, =gBattleMons + ldr r6, =gEnemyMonIndex ldrb r2, [r6] movs r5, 0x58 adds r0, r2, 0 @@ -33672,12 +33672,12 @@ _0804795C: lsrs r6, r0, 24 _08047976: ldr r1, =gUnknown_0202420F - ldr r5, =gUnknown_0202420C + ldr r5, =gEnemyMonIndex ldrb r0, [r5] strb r0, [r1] cmp r4, 0x27 bne _080479B4 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -33700,8 +33700,8 @@ _08047976: orrs r1, r2 strb r1, [r0] _080479B4: - ldr r2, =gUnknown_02024084 - ldr r3, =gUnknown_0202420C + ldr r2, =gBattleMons + ldr r3, =gEnemyMonIndex ldrb r4, [r3] movs r0, 0x58 muls r0, r4 @@ -33747,7 +33747,7 @@ _08047A06: muls r0, r4 adds r0, r5 ldrh r1, [r0, 0x28] - ldr r2, =gUnknown_020241F0 + ldr r2, =gBattleMoveDamage ldr r0, [r2] cmp r1, r0 bgt _08047A84 @@ -33761,7 +33761,7 @@ _08047A06: lsls r0, 30 cmp r0, 0 bge _08047A5C - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r2, 0x40 orrs r1, r2 @@ -33778,7 +33778,7 @@ _08047A5C: lsrs r0, 7 cmp r0, 0 beq _08047A84 - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x80 orrs r0, r1 @@ -33803,7 +33803,7 @@ _08047A84: thumb_func_start atk08_cmd8 atk08_cmd8: @ 8047AA4 push {r4-r7,lr} - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xF @@ -33812,7 +33812,7 @@ atk08_cmd8: @ 8047AA4 subs r1, r0 lsls r1, 16 lsrs r1, 16 - ldr r4, =gUnknown_020241F0 + ldr r4, =gBattleMoveDamage ldr r0, [r4] cmp r0, 0 beq _08047AD6 @@ -33826,8 +33826,8 @@ atk08_cmd8: @ 8047AA4 movs r0, 0x1 str r0, [r4] _08047AD6: - ldr r7, =gUnknown_02024084 - ldr r6, =gUnknown_0202420C + ldr r7, =gBattleMons + ldr r6, =gEnemyMonIndex ldrb r2, [r6] movs r5, 0x58 adds r0, r2, 0 @@ -33859,12 +33859,12 @@ _08047B0C: lsrs r6, r0, 24 _08047B26: ldr r1, =gUnknown_0202420F - ldr r5, =gUnknown_0202420C + ldr r5, =gEnemyMonIndex ldrb r0, [r5] strb r0, [r1] cmp r4, 0x27 bne _08047B64 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -33887,8 +33887,8 @@ _08047B26: orrs r1, r2 strb r1, [r0] _08047B64: - ldr r4, =gUnknown_02024084 - ldr r6, =gUnknown_0202420C + ldr r4, =gBattleMons + ldr r6, =gEnemyMonIndex ldrb r2, [r6] movs r7, 0x58 adds r3, r2, 0 @@ -33921,7 +33921,7 @@ _08047B64: _08047BA2: adds r0, r3, r4 ldrh r1, [r0, 0x28] - ldr r2, =gUnknown_020241F0 + ldr r2, =gBattleMoveDamage ldr r0, [r2] cmp r1, r0 bgt _08047C10 @@ -33934,7 +33934,7 @@ _08047BA2: lsls r0, 30 cmp r0, 0 bge _08047BE8 - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r2, 0x40 orrs r1, r2 @@ -33951,7 +33951,7 @@ _08047BE8: lsrs r0, 7 cmp r0, 0 beq _08047C10 - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x80 orrs r0, r1 @@ -34036,7 +34036,7 @@ _08047CB2: cmp r0, 0 bne _08047D88 _08047CBA: - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x29 ands r0, r1 @@ -34046,8 +34046,8 @@ _08047CBA: ldr r3, =gUnknown_0202420B ldrb r0, [r3] strb r0, [r1] - ldr r2, =gUnknown_02024084 - ldr r0, =gUnknown_0202420C + ldr r2, =gBattleMons + ldr r0, =gEnemyMonIndex ldrb r1, [r0] movs r0, 0x58 adds r4, r1, 0 @@ -34075,7 +34075,7 @@ _08047D18: mov r1, r12 adds r0, r4, r1 ldrh r2, [r0, 0x28] - ldr r0, =gUnknown_020241F0 + ldr r0, =gBattleMoveDamage ldr r1, [r0] movs r6, 0x1 adds r4, r0, 0 @@ -34087,7 +34087,7 @@ _08047D18: _08047D40: ldrb r6, [r3] _08047D42: - ldr r4, =gUnknown_020241F0 + ldr r4, =gBattleMoveDamage _08047D44: ldrh r1, [r5] ldr r5, =gUnknown_02024474 @@ -34167,7 +34167,7 @@ atk0B_graphicalhpupdate: @ 8047DE8 ldr r0, [r0] cmp r0, 0 bne _08047EAA - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x29 ands r0, r1 @@ -34179,7 +34179,7 @@ atk0B_graphicalhpupdate: @ 8047DE8 bl get_battle_side_of_something ldr r2, =gUnknown_02024064 strb r0, [r2] - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r2] movs r0, 0x58 muls r0, r2 @@ -34212,7 +34212,7 @@ atk0B_graphicalhpupdate: @ 8047DE8 b _08047EA2 .pool _08047E68: - ldr r0, =gUnknown_020241F0 + ldr r0, =gBattleMoveDamage ldr r0, [r0] ldr r1, =0x00002710 cmp r0, r1 @@ -34230,7 +34230,7 @@ _08047E76: lsls r0, 24 cmp r0, 0 bne _08047EA2 - ldr r0, =gUnknown_020241F0 + ldr r0, =gBattleMoveDamage ldr r0, [r0] cmp r0, 0 ble _08047EA2 @@ -34284,7 +34284,7 @@ _08047EF4: adds r0, r2 ldrb r6, [r0, 0x2] _08047F04: - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x29 ands r0, r1 @@ -34298,7 +34298,7 @@ _08047F12: bl get_battle_side_of_something ldr r7, =gUnknown_02024064 strb r0, [r7] - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r7] movs r0, 0x58 muls r0, r2 @@ -34327,7 +34327,7 @@ _08047F12: cmp r3, 0 bne _08048028 adds r5, r1, 0 - ldr r6, =gUnknown_020241F0 + ldr r6, =gBattleMoveDamage ldr r4, [r6] cmp r5, r4 blt _08047FBC @@ -34409,13 +34409,13 @@ _08048028: ldr r1, =0xfffffeff ands r2, r1 str r2, [r0] - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage ldr r5, [r1] mov r12, r0 adds r7, r1, 0 cmp r5, 0 bge _0804807C - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldr r2, =gUnknown_02024064 ldrb r0, [r2] movs r3, 0x58 @@ -34476,12 +34476,12 @@ _080480D4: ldr r1, =gUnknown_02024288 ldrb r0, [r5] adds r0, r1 - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex _080480DC: ldrb r1, [r1] strb r1, [r0] _080480E0: - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldrb r0, [r5] movs r3, 0x58 muls r0, r3 @@ -34571,7 +34571,7 @@ _080481AC: ldrb r0, [r5] lsls r0, 4 adds r0, r3 - ldr r2, =gUnknown_0202420C + ldr r2, =gEnemyMonIndex _080481B4: ldrb r1, [r2] strb r1, [r0, 0xC] @@ -34626,7 +34626,7 @@ _08048220: ldrb r0, [r5] lsls r0, 4 adds r0, r3 - ldr r2, =gUnknown_0202420C + ldr r2, =gEnemyMonIndex _08048228: ldrb r1, [r2] strb r1, [r0, 0xD] @@ -34698,11 +34698,11 @@ atk0D_critmessage: @ 80482BC ldr r0, [r0] cmp r0, 0 bne _080482F2 - ldr r0, =gUnknown_02024211 + ldr r0, =gCritMultiplier ldrb r0, [r0] cmp r0, 0x2 bne _080482EA - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x29 ands r0, r1 @@ -34734,10 +34734,10 @@ atk0E_missmessage: @ 8048310 cmp r0, 0 bne _080483D0 ldr r4, =gUnknown_02024064 - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] strb r0, [r4] - ldr r1, =gUnknown_0202427C + ldr r1, =gBattleMoveFlags ldrb r2, [r1] movs r0, 0x1 ands r0, r2 @@ -34837,7 +34837,7 @@ atk0F_resultmessage: @ 80483E0 beq _080483EE b _08048580 _080483EE: - ldr r1, =gUnknown_0202427C + ldr r1, =gBattleMoveFlags ldrb r2, [r1] movs r4, 0x1 adds r0, r4, 0 @@ -34911,8 +34911,8 @@ _08048474: b _0804856E _08048478: ldr r4, =gUnknown_02024208 - ldr r2, =gUnknown_02024084 - ldr r3, =gUnknown_0202420C + ldr r2, =gBattleMons + ldr r3, =gEnemyMonIndex ldrb r1, [r3] movs r0, 0x58 muls r0, r1 @@ -34976,8 +34976,8 @@ _08048510: cmp r0, 0 beq _08048558 ldr r4, =gUnknown_02024208 - ldr r2, =gUnknown_02024084 - ldr r3, =gUnknown_0202420C + ldr r2, =gBattleMons + ldr r3, =gEnemyMonIndex ldrb r1, [r3] movs r0, 0x58 muls r0, r1 @@ -35277,12 +35277,12 @@ sub_8048760: @ 8048760 strb r0, [r3, 0x3] movs r7, 0x40 ldr r1, =gUnknown_02024474 - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex b _080487C4 .pool _080487B8: ldr r2, =gUnknown_0202420E - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] strb r0, [r2] ldr r1, =gUnknown_02024474 @@ -35291,7 +35291,7 @@ _080487C4: ldrb r0, [r0] strb r0, [r1, 0x17] mov r9, r2 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons mov r4, r9 ldrb r1, [r4] movs r0, 0x58 @@ -35358,7 +35358,7 @@ _08048828: bl _080499B8 .pool _08048880: - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r2, =gUnknown_0202420E ldrb r1, [r2] movs r0, 0x58 @@ -35802,7 +35802,7 @@ _08048BEA: lsls r0, 24 cmp r0, 0 bne _08048C26 - ldr r0, =gUnknown_020243CC + ldr r0, =gBattleWeather ldrh r1, [r0] movs r0, 0x60 ands r0, r1 @@ -35811,7 +35811,7 @@ _08048BEA: movs r2, 0 str r2, [sp, 0x4] _08048C26: - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldr r0, =gUnknown_0202420E ldrb r3, [r0] movs r0, 0x58 @@ -36024,7 +36024,7 @@ _08048DE4: mov r10, r0 b _08048DF4 _08048DEA: - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r2, 0x8 orrs r1, r2 @@ -36047,8 +36047,8 @@ _08048DFC: ldr r3, [r0] cmp r3, 0x7 bne _08048E50 - bl GenerateRandomNumber - ldr r2, =gUnknown_02024084 + bl Random + ldr r2, =gBattleMons ldr r1, =gUnknown_0202420E ldrb r3, [r1] movs r1, 0x58 @@ -36064,7 +36064,7 @@ _08048DFC: b _08048E64 .pool _08048E50: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420E ldrb r1, [r0] movs r0, 0x58 @@ -36267,7 +36267,7 @@ _08049076: beq _0804908A bl _08049994 _0804908A: - bl GenerateRandomNumber + bl Random mov r3, r9 ldrb r1, [r3] adds r2, r1, 0 @@ -36377,7 +36377,7 @@ _08049178: ldr r1, =gUnknown_020241EA ldrh r1, [r1] strh r1, [r0] - bl GenerateRandomNumber + bl Random mov r2, r9 ldrb r1, [r2] adds r2, r1, 0 @@ -36412,7 +36412,7 @@ _080491D8: bne _08049210 ldr r4, =gUnknown_0202432E ldrh r3, [r4] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r5] movs r0, 0x58 muls r0, r1 @@ -36456,7 +36456,7 @@ _08049244: beq _0804925A b _08049994 _0804925A: - bl GenerateRandomNumber + bl Random ldr r4, =gUnknown_02024332 lsls r0, 16 lsrs r0, 16 @@ -36517,7 +36517,7 @@ _080492C4: beq _080492E0 b _08049994 _080492E0: - bl GenerateRandomNumber + bl Random mov r2, r9 ldrb r1, [r2] adds r2, r1, 0 @@ -36593,7 +36593,7 @@ _08049362: b _080499B2 .pool _08049390: - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage ldr r0, =gUnknown_020241F4 ldr r0, [r0] cmp r0, 0 @@ -36787,7 +36787,7 @@ _0804955A: b _08049994 .pool _08049564: - ldr r5, =gUnknown_02022FEC + ldr r5, =gBattleTypeFlags ldr r0, [r5] movs r1, 0x80 lsls r1, 19 @@ -36824,7 +36824,7 @@ _080495A8: adds r0, 0x29 adds r0, r4, r0 ldrb r1, [r0] - ldr r3, =gUnknown_0832A328 + ldr r3, =gBitTable ldr r2, =gUnknown_0202406E ldrb r0, [r6] lsls r0, 1 @@ -36838,8 +36838,8 @@ _080495A8: beq _080495D4 b _08049994 _080495D4: - ldr r2, =gUnknown_02024084 - ldr r1, =gUnknown_0202420C + ldr r2, =gBattleMons + ldr r1, =gEnemyMonIndex ldrb r0, [r1] movs r5, 0x58 muls r0, r5 @@ -36973,7 +36973,7 @@ _0804967C: b _080499B2 .pool _08049720: - ldr r3, =gUnknown_0202420C + ldr r3, =gEnemyMonIndex ldrb r1, [r3] movs r0, 0x58 adds r2, r1, 0 @@ -36998,7 +36998,7 @@ _08049720: b _08049994 .pool _0804975C: - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r1, [r0] movs r0, 0x58 adds r2, r1, 0 @@ -37028,7 +37028,7 @@ _08049790: b _080499B0 .pool _080497A8: - ldr r6, =gUnknown_0202420C + ldr r6, =gEnemyMonIndex ldrb r0, [r6] movs r2, 0x58 muls r0, r2 @@ -37076,7 +37076,7 @@ _08049808: b _080499B0 .pool _08049820: - ldr r4, =gUnknown_020241F0 + ldr r4, =gBattleMoveDamage ldr r0, =gUnknown_020241F4 ldr r0, [r0] movs r1, 0x3 @@ -37127,7 +37127,7 @@ _08049880: ldr r1, =gUnknown_020241EA ldrh r1, [r1] strh r1, [r0] - bl GenerateRandomNumber + bl Random mov r3, r9 ldrb r1, [r3] adds r2, r1, 0 @@ -37192,7 +37192,7 @@ _08049900: ldr r2, =gUnknown_020243D0 adds r2, 0x29 adds r2, r4, r2 - ldr r3, =gUnknown_0832A328 + ldr r3, =gBitTable ldr r1, =gUnknown_0202406E mov r4, r9 ldrb r0, [r4] @@ -37262,7 +37262,7 @@ _080499B8: thumb_func_start atk15_seteffectwithchancetarget atk15_seteffectwithchancetarget: @ 80499D4 push {r4,lr} - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -37299,7 +37299,7 @@ _08049A20: ands r0, r2 cmp r0, 0 beq _08049A50 - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x29 ands r0, r1 @@ -37311,7 +37311,7 @@ _08049A20: b _08049A7E .pool _08049A50: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -37324,7 +37324,7 @@ _08049A50: ldrb r0, [r0, 0x3] cmp r0, 0 beq _08049A9A - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x29 ands r0, r1 @@ -37393,7 +37393,7 @@ sub_8049AE0: @ 8049AE0 ldrb r0, [r3, 0x3] cmp r0, 0x6 bhi _08049B14 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r2] movs r0, 0x58 muls r2, r0 @@ -37401,7 +37401,7 @@ sub_8049AE0: @ 8049AE0 b _08049B1E .pool _08049B14: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r2] movs r0, 0x58 muls r2, r0 @@ -37448,7 +37448,7 @@ atk19_faintpokemon: @ 8049B5C ldr r5, =gUnknown_02024064 strb r0, [r5] ldr r2, =gUnknown_02024280 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r5] lsls r0, 2 adds r0, r1 @@ -37493,7 +37493,7 @@ _08049BE0: ldr r0, =gUnknown_0202420B ldrb r0, [r0] strb r0, [r1] - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] mov r9, r0 ldr r4, =gUnknown_082DA7AA @@ -37501,7 +37501,7 @@ _08049BE0: .pool _08049C08: ldr r1, =gUnknown_02024064 - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] strb r0, [r1] ldr r0, =gUnknown_0202420B @@ -37512,7 +37512,7 @@ _08049C18: mov r8, r1 ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable mov r7, r8 ldrb r3, [r7] lsls r0, r3, 2 @@ -37523,7 +37523,7 @@ _08049C18: beq _08049C32 b _08049E2C _08049C32: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r3 adds r0, r1 @@ -37578,11 +37578,11 @@ _08049CB0: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r4, 0x20] _08049CCE: ldr r2, =gUnknown_02024280 @@ -37591,7 +37591,7 @@ _08049CCE: ands r0, r1 cmp r0, 0 beq _08049D0C - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r0, [r0] movs r5, 0x58 @@ -37607,7 +37607,7 @@ _08049CCE: ldr r4, =gUnknown_02024214 ldr r0, [r4] bl b_movescr_stack_push - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage mov r0, r9 muls r0, r5 adds r0, r6 @@ -37617,7 +37617,7 @@ _08049CCE: str r0, [r4] _08049D0C: ldr r1, =gUnknown_020242AC - ldr r6, =gUnknown_0202420C + ldr r6, =gEnemyMonIndex ldrb r0, [r6] lsls r0, 2 adds r0, r1 @@ -37649,7 +37649,7 @@ _08049D34: lsls r0, 24 cmp r4, r0 beq _08049E32 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons mov r9, r0 mov r2, r8 ldrb r1, [r2] @@ -37780,14 +37780,14 @@ sub_8049E7C: @ 8049E7C bl get_battle_side_of_something ldr r4, =gUnknown_02024064 strb r0, [r4] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 11 ands r0, r1 cmp r0, 0 beq _08049EB4 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r4] movs r0, 0x58 muls r0, r1 @@ -37796,7 +37796,7 @@ sub_8049E7C: @ 8049E7C cmp r0, 0 bne _08049EDC _08049EB4: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r0, [r4] movs r2, 0x58 muls r0, r2 @@ -37858,7 +37858,7 @@ atk1C_jumpifstatus: @ 8049F04 ldrb r1, [r2, 0x9] lsls r1, 24 adds r3, r1 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r1, 0x58 muls r1, r0 adds r0, r2, 0 @@ -37917,7 +37917,7 @@ atk1D_jumpifsecondarystatus: @ 8049F7C ldrb r1, [r2, 0x9] lsls r1, 24 adds r3, r1 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r1, 0x58 muls r1, r0 adds r0, r2, 0 @@ -38019,7 +38019,7 @@ _0804A08C: bl get_battle_side_of_something lsls r0, 24 lsrs r4, r0, 24 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r4 adds r0, r1 @@ -38065,7 +38065,7 @@ sub_804A0DC: @ 804A0DC b _0804A106 .pool _0804A0FC: - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] bl battle_get_per_side_status movs r4, 0x1 @@ -38117,7 +38117,7 @@ sub_804A154: @ 804A154 bl get_battle_side_of_something lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r3, [r4] movs r1, 0x58 muls r0, r1 @@ -38312,7 +38312,7 @@ sub_804A2D0: @ 804A2D0 ldrb r1, [r3, 0x6] lsls r1, 24 adds r6, r2, r1 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r1, 0x58 muls r0, r1 adds r1, r0, r2 @@ -38395,7 +38395,7 @@ _0804A3A8: beq _0804A3BC bl _0804AC7C _0804A3BC: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x063f0982 ands r0, r1 @@ -38410,7 +38410,7 @@ _0804A3CC: ldr r0, =gUnknown_0202449C ldr r2, [r0] adds r2, 0xDF - ldr r3, =gUnknown_0832A328 + ldr r3, =gBitTable ldr r1, =gUnknown_0202406E ldrb r0, [r4] lsls r0, 1 @@ -38431,19 +38431,19 @@ _0804A418: movs r0, 0x64 adds r1, r7, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0804A486 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0804A486 - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable lsls r1, r7, 2 adds r1, r0 ldr r0, [r1] @@ -38455,12 +38455,12 @@ _0804A418: _0804A44C: adds r0, r4, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 cmp r0, 0xAF bne _0804A478 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00003226 adds r0, r2 @@ -38480,7 +38480,7 @@ _0804A486: cmp r7, 0x5 ble _0804A418 ldr r3, =gBaseStats - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420D ldrb r1, [r0] movs r0, 0x58 @@ -38564,15 +38564,15 @@ _0804A538: ldrb r1, [r0, 0x10] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xC - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 cmp r0, 0xAF bne _0804A57C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003226 adds r0, r1 @@ -38605,10 +38605,10 @@ _0804A5AC: ldrb r1, [r0, 0x10] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData cmp r0, 0x64 bne _0804A5E8 ldr r1, [r5] @@ -38621,18 +38621,18 @@ _0804A5AC: _0804A5D0: movs r0, 0x5 strb r0, [r1, 0x1C] - ldr r0, =gUnknown_020241F0 + ldr r0, =gBattleMoveDamage str r2, [r0] b _0804ACB2 .pool _0804A5E8: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x8 ands r0, r1 cmp r0, 0 bne _0804A616 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons ldrh r0, [r0, 0x28] cmp r0, 0 beq _0804A616 @@ -38653,10 +38653,10 @@ _0804A616: ldrb r1, [r0, 0x10] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0804A630 b _0804A824 @@ -38668,7 +38668,7 @@ _0804A630: ands r3, r0 cmp r3, 0 beq _0804A664 - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage mov r2, r9 ldrh r0, [r2] str r0, [r1] @@ -38676,7 +38676,7 @@ _0804A630: b _0804A66A .pool _0804A664: - ldr r0, =gUnknown_020241F0 + ldr r0, =gBattleMoveDamage str r3, [r0] mov r9, r0 _0804A66A: @@ -38699,13 +38699,13 @@ _0804A67A: bl __divsi3 str r0, [r4] _0804A68E: - ldr r5, =gUnknown_02022FEC + ldr r5, =gBattleTypeFlags ldr r0, [r5] movs r1, 0x8 ands r0, r1 cmp r0, 0 beq _0804A6AA - ldr r4, =gUnknown_020241F0 + ldr r4, =gBattleMoveDamage ldr r1, [r4] movs r0, 0x96 muls r0, r1 @@ -38718,7 +38718,7 @@ _0804A6AA: ldrb r1, [r0, 0x10] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 bl sub_806E8A8 lsls r0, 24 @@ -38735,12 +38735,12 @@ _0804A6AA: cmp r0, 0x2 bls _0804A6F8 ldr r7, =0x00000149 - ldr r0, =gUnknown_020241F0 + ldr r0, =gBattleMoveDamage mov r9, r0 b _0804A71A .pool _0804A6F8: - ldr r4, =gUnknown_020241F0 + ldr r4, =gBattleMoveDamage ldr r1, [r4] movs r0, 0x96 muls r0, r1 @@ -38754,10 +38754,10 @@ _0804A6F8: .pool _0804A714: ldr r7, =0x00000149 - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage mov r9, r1 _0804A71A: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x1 ands r1, r0 @@ -38768,7 +38768,7 @@ _0804A71A: ldr r4, [r1] ldrh r0, [r0, 0x4] adds r5, r1, 0 - ldr r3, =gUnknown_0832A328 + ldr r3, =gBitTable ldr r2, =gUnknown_02024210 ldrb r1, [r4, 0x10] cmp r0, r1 @@ -38869,9 +38869,9 @@ _0804A78E: ldrb r1, [r0, 0x10] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r1, =gUnknown_0202420D ldrb r2, [r1] movs r1, 0x58 @@ -38907,10 +38907,10 @@ _0804A85A: ldrb r0, [r0, 0x10] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0804A92A ldr r0, [r7] @@ -38918,7 +38918,7 @@ _0804A85A: muls r0, r6 adds r0, r5 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData cmp r0, 0x64 beq _0804A92A ldr r0, [r7] @@ -38926,7 +38926,7 @@ _0804A85A: muls r0, r6 adds r0, r5 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData ldr r4, =gUnknown_020244A8 ldr r1, [r4] ldr r1, [r1, 0x10] @@ -38936,7 +38936,7 @@ _0804A85A: muls r0, r6 adds r0, r5 movs r1, 0x3B - bl pokemon_getattr + bl GetMonData ldr r1, [r4] ldr r1, [r1, 0x10] strh r0, [r1, 0x2] @@ -38945,7 +38945,7 @@ _0804A85A: muls r0, r6 adds r0, r5 movs r1, 0x3C - bl pokemon_getattr + bl GetMonData ldr r1, [r4] ldr r1, [r1, 0x10] strh r0, [r1, 0x4] @@ -38954,7 +38954,7 @@ _0804A85A: muls r0, r6 adds r0, r5 movs r1, 0x3D - bl pokemon_getattr + bl GetMonData ldr r1, [r4] ldr r1, [r1, 0x10] strh r0, [r1, 0x6] @@ -38963,7 +38963,7 @@ _0804A85A: muls r0, r6 adds r0, r5 movs r1, 0x3E - bl pokemon_getattr + bl GetMonData ldr r1, [r4] ldr r1, [r1, 0x10] strh r0, [r1, 0x8] @@ -38972,7 +38972,7 @@ _0804A85A: muls r0, r6 adds r0, r5 movs r1, 0x3F - bl pokemon_getattr + bl GetMonData ldr r1, [r4] ldr r1, [r1, 0x10] strh r0, [r1, 0xA] @@ -38983,7 +38983,7 @@ _0804A85A: ldrb r0, [r0] strb r0, [r4] ldrb r1, [r1, 0x10] - ldr r0, =gUnknown_020241F0 + ldr r0, =gBattleMoveDamage ldrh r2, [r0] movs r0, 0 bl dp01_build_cmdbuf_x19_a_bb @@ -39026,7 +39026,7 @@ _0804A97C: beq _0804A988 b _0804AC28 _0804A988: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x8 ands r0, r1 @@ -39042,7 +39042,7 @@ _0804A988: adds r1, r0, 0 movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 adds r1, r2, 0 bl sub_805E990 @@ -39075,17 +39075,17 @@ _0804A9B2: mov r2, r8 muls r2, r0 adds r0, r2, 0 - ldr r7, =gUnknown_020244EC + ldr r7, =gPlayerParty adds r0, r7 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData strb r0, [r4, 0x4] movs r0, 0x1 negs r0, r0 strb r0, [r4, 0x5] bl b_movescr_stack_push_cursor ldr r2, =gUnknown_03005D54 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable mov r4, r9 ldr r5, [r4] ldrb r0, [r5, 0x10] @@ -39098,7 +39098,7 @@ _0804A9B2: ldr r1, =gUnknown_02024214 ldr r0, =gUnknown_082DABBD str r0, [r1] - ldr r4, =gUnknown_020241F0 + ldr r4, =gBattleMoveDamage ldr r2, =gUnknown_02023864 ldrb r1, [r6] lsls r1, 9 @@ -39125,7 +39125,7 @@ _0804A9B2: ldrh r0, [r1] cmp r0, r2 bne _0804AB1E - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldrh r0, [r4, 0x28] cmp r0, 0 beq _0804AB1E @@ -39133,7 +39133,7 @@ _0804A9B2: muls r0, r2 adds r0, r7 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData adds r1, r4, 0 adds r1, 0x2A strb r0, [r1] @@ -39145,7 +39145,7 @@ _0804A9B2: adds r0, r2, 0 adds r0, r7 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData strh r0, [r4, 0x28] mov r1, r9 ldr r0, [r1] @@ -39155,7 +39155,7 @@ _0804A9B2: adds r0, r2, 0 adds r0, r7 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData strh r0, [r4, 0x2C] mov r1, r9 ldr r0, [r1] @@ -39165,7 +39165,7 @@ _0804A9B2: adds r0, r2, 0 adds r0, r7 movs r1, 0x3B - bl pokemon_getattr + bl GetMonData strh r0, [r4, 0x2] mov r1, r9 ldr r0, [r1] @@ -39175,7 +39175,7 @@ _0804A9B2: adds r0, r2, 0 adds r0, r7 movs r1, 0x3C - bl pokemon_getattr + bl GetMonData strh r0, [r4, 0x4] mov r1, r9 ldr r0, [r1] @@ -39185,7 +39185,7 @@ _0804A9B2: adds r0, r2, 0 adds r0, r7 movs r1, 0x3D - bl pokemon_getattr + bl GetMonData strh r0, [r4, 0x6] mov r1, r9 ldr r0, [r1] @@ -39195,7 +39195,7 @@ _0804A9B2: adds r0, r2, 0 adds r0, r7 movs r1, 0x3D - bl pokemon_getattr + bl GetMonData strh r0, [r4, 0x6] mov r1, r9 ldr r0, [r1] @@ -39205,7 +39205,7 @@ _0804A9B2: adds r0, r2, 0 adds r0, r7 movs r1, 0x3E - bl pokemon_getattr + bl GetMonData strh r0, [r4, 0x8] mov r1, r9 ldr r0, [r1] @@ -39215,7 +39215,7 @@ _0804A9B2: adds r0, r2, 0 adds r0, r7 movs r1, 0x3F - bl pokemon_getattr + bl GetMonData strh r0, [r4, 0xA] _0804AB1E: ldr r0, =gUnknown_0202406E @@ -39227,14 +39227,14 @@ _0804AB1E: beq _0804AB2E b _0804AC2E _0804AB2E: - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons movs r4, 0xD8 adds r4, r6 mov r8, r4 ldrh r0, [r4] cmp r0, 0 beq _0804AC2E - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -39243,10 +39243,10 @@ _0804AB2E: movs r5, 0x64 adds r0, r2, 0 muls r0, r5 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData adds r1, r6, 0 adds r1, 0xDA strb r0, [r1] @@ -39255,7 +39255,7 @@ _0804AB2E: muls r0, r5 adds r0, r4 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData mov r1, r8 strh r0, [r1] ldr r0, [r7] @@ -39263,7 +39263,7 @@ _0804AB2E: muls r0, r5 adds r0, r4 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData adds r1, r6, 0 adds r1, 0xDC strh r0, [r1] @@ -39272,7 +39272,7 @@ _0804AB2E: muls r0, r5 adds r0, r4 movs r1, 0x3B - bl pokemon_getattr + bl GetMonData adds r1, r6, 0 adds r1, 0xB2 strh r0, [r1] @@ -39281,7 +39281,7 @@ _0804AB2E: muls r0, r5 adds r0, r4 movs r1, 0x3C - bl pokemon_getattr + bl GetMonData adds r1, r6, 0 adds r1, 0xB4 strh r0, [r1] @@ -39290,7 +39290,7 @@ _0804AB2E: muls r0, r5 adds r0, r4 movs r1, 0x3D - bl pokemon_getattr + bl GetMonData movs r2, 0xB6 adds r2, r6 mov r8, r2 @@ -39300,7 +39300,7 @@ _0804AB2E: muls r0, r5 adds r0, r4 movs r1, 0x3D - bl pokemon_getattr + bl GetMonData mov r1, r8 strh r0, [r1] ldr r0, [r7] @@ -39308,14 +39308,14 @@ _0804AB2E: muls r0, r5 adds r0, r4 movs r1, 0x3E - bl pokemon_getattr + bl GetMonData adds r1, r6, 0 adds r1, 0xB8 strh r0, [r1] b _0804AC2E .pool _0804AC28: - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage movs r0, 0 str r0, [r1] _0804AC2E: @@ -39325,7 +39325,7 @@ _0804AC2E: b _0804ACB2 .pool _0804AC40: - ldr r0, =gUnknown_020241F0 + ldr r0, =gBattleMoveDamage ldr r0, [r0] cmp r0, 0 beq _0804AC58 @@ -39360,7 +39360,7 @@ _0804AC88: ldr r5, [r0] cmp r5, 0 bne _0804ACB2 - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldr r2, =gUnknown_0202420D ldrb r0, [r2] movs r1, 0x58 @@ -39399,7 +39399,7 @@ sub_804ACD0: @ 804ACD0 beq _0804ACE2 b _0804AF22 _0804ACE2: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 15 @@ -39416,21 +39416,21 @@ _0804ACFC: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0804AD2C adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0804AD2C adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r0, r6, r0 lsls r0, 16 lsrs r6, r0, 16 @@ -39446,19 +39446,19 @@ _0804AD4A: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0804ADA2 adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0804ADA2 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 11 @@ -39471,7 +39471,7 @@ _0804AD4A: lsls r1, 2 adds r0, r1 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] @@ -39481,7 +39481,7 @@ _0804AD4A: _0804AD94: adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r0, r6, r0 lsls r0, 16 lsrs r6, r0, 16 @@ -39504,19 +39504,19 @@ _0804ADBA: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0804AE10 adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0804AE10 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 11 @@ -39528,7 +39528,7 @@ _0804ADBA: ldr r1, =0x000002a1 adds r0, r1 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] @@ -39538,7 +39538,7 @@ _0804ADBA: _0804AE02: adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r0, r6, r0 lsls r0, 16 lsrs r6, r0, 16 @@ -39557,7 +39557,7 @@ _0804AE24: ldrb r0, [r2] cmp r0, 0 bne _0804AF1A - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r2, =0x02000002 ands r1, r2 @@ -39678,14 +39678,14 @@ _0804AF22: thumb_func_start sub_804AF30 sub_804AF30: @ 804AF30 - ldr r1, =gUnknown_0202427C + ldr r1, =gBattleMoveFlags movs r0, 0 strb r0, [r1] ldr r0, =gUnknown_02024474 movs r2, 0 movs r1, 0x1 strb r1, [r0, 0xE] - ldr r0, =gUnknown_02024211 + ldr r0, =gCritMultiplier strb r1, [r0] ldr r0, =gUnknown_02024332 strb r2, [r0, 0x3] @@ -40615,7 +40615,7 @@ atk3B_8022C68: @ 804B600 cmp r0, 0 bne _0804B620 ldr r0, =gUnknown_02024064 - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex b _0804B624 .pool _0804B620: @@ -40624,7 +40624,7 @@ _0804B620: _0804B624: ldrb r1, [r1] strb r1, [r0] - ldr r0, =gUnknown_020241F0 + ldr r0, =gBattleMoveDamage ldrh r1, [r0] movs r0, 0 bl dp01_build_cmdbuf_x18_0_aa_health_bar_update @@ -40651,7 +40651,7 @@ atk3C_return: @ 804B658 thumb_func_start sub_804B664 sub_804B664: @ 804B664 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 11 @@ -40662,7 +40662,7 @@ sub_804B664: @ 804B664 ldrb r0, [r0] bl sub_81A5718 _0804B67C: - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags movs r1, 0 strb r1, [r0] ldr r0, =gUnknown_02024064 @@ -40752,7 +40752,7 @@ atk42_jumpiftype2: @ 804B728 lsls r0, 24 lsrs r0, 24 ldr r3, [r4] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r1, 0x58 muls r0, r1 adds r0, r2 @@ -41163,7 +41163,7 @@ _0804BA58: ldr r3, [sp] cmp r0, 0 bne _0804BAB2 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons ldrb r2, [r6] movs r1, 0x58 muls r2, r1 @@ -41362,7 +41362,7 @@ _0804BBEE: str r4, [sp, 0x10] ldrb r0, [r0, 0x2] str r0, [sp, 0x14] - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -41507,8 +41507,8 @@ _0804BD38: .4byte _0804C4E4 .4byte _0804C570 _0804BD80: - ldr r6, =gUnknown_02024084 - ldr r5, =gUnknown_0202420C + ldr r6, =gBattleMons + ldr r5, =gEnemyMonIndex ldrb r3, [r5] movs r7, 0x58 adds r2, r3, 0 @@ -41547,7 +41547,7 @@ _0804BDB4: bne _0804BDCC b _0804C184 _0804BDCC: - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x29 ands r0, r1 @@ -41605,8 +41605,8 @@ _0804BE26: b _0804C0B8 .pool _0804BE5C: - ldr r4, =gUnknown_02024084 - ldr r6, =gUnknown_0202420C + ldr r4, =gBattleMons + ldr r6, =gEnemyMonIndex ldrb r2, [r6] movs r5, 0x58 mov r12, r5 @@ -41645,7 +41645,7 @@ _0804BE90: bne _0804BEA4 b _0804C184 _0804BEA4: - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x29 ands r0, r1 @@ -41687,7 +41687,7 @@ _0804BEBA: b _0804C184 .pool _0804BF18: - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r1, [r0] movs r0, 0 str r0, [sp] @@ -41705,7 +41705,7 @@ _0804BF32: b _0804C184 .pool _0804BF3C: - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r1, [r0] movs r0, 0 str r0, [sp] @@ -41778,7 +41778,7 @@ _0804BFA0: _0804BFCC: cmp r2, 0xE2 bne _0804BFDE - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x20 ands r0, r1 @@ -41791,7 +41791,7 @@ _0804BFDE: strh r0, [r1] _0804BFE4: movs r4, 0 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r3, =gUnknown_0202420B ldrb r1, [r3] movs r0, 0x58 @@ -41844,7 +41844,7 @@ _0804C054: movs r6, 0 movs r3, 0xD0 adds r5, r0, 0 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons _0804C05E: ldr r0, [r7] adds r0, r3 @@ -41913,7 +41913,7 @@ _0804C0E2: b _0804C4B6 .pool _0804C0F4: - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x29 ands r0, r1 @@ -41979,7 +41979,7 @@ _0804C184: .pool _0804C194: ldr r0, =gUnknown_0202437C - ldr r6, =gUnknown_0202420C + ldr r6, =gEnemyMonIndex ldrb r2, [r6] lsls r3, r2, 2 adds r1, r3, r2 @@ -42049,7 +42049,7 @@ _0804C21C: ldr r0, =gUnknown_02024064 ldrb r2, [r2] strb r2, [r0] - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex ldrb r0, [r1] mov r4, r9 strb r0, [r4] @@ -42075,7 +42075,7 @@ _0804C246: _0804C262: ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable mov r3, r9 ldrb r4, [r3] lsls r0, r4, 2 @@ -42146,7 +42146,7 @@ _0804C308: negs r1, r1 strh r1, [r0] _0804C322: - ldr r2, =gUnknown_0202420C + ldr r2, =gEnemyMonIndex ldrb r3, [r2] lsls r0, r3, 2 adds r0, r6 @@ -42168,7 +42168,7 @@ _0804C340: ands r0, r1 cmp r0, 0 beq _0804C3DC - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x29 ands r0, r1 @@ -42238,7 +42238,7 @@ _0804C3E8: _0804C3FC: ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r7, =gUnknown_0832A328 + ldr r7, =gBitTable ldr r2, =gUnknown_0202420B ldrb r3, [r2] lsls r0, r3, 2 @@ -42274,7 +42274,7 @@ _0804C3FC: ands r0, r1 cmp r0, 0 beq _0804C4B6 - ldr r4, =gUnknown_0202420C + ldr r4, =gEnemyMonIndex ldrb r0, [r4] cmp r3, r0 beq _0804C4B6 @@ -42286,7 +42286,7 @@ _0804C3FC: ands r1, r0 cmp r1, 0 bne _0804C4B6 - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x29 ands r0, r1 @@ -42344,7 +42344,7 @@ _0804C4E4: ands r0, r2 cmp r0, 0 bne _0804C568 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -42377,7 +42377,7 @@ _0804C4E4: ands r4, r2 cmp r4, 0 bne _0804C568 - ldr r7, =gUnknown_0202420C + ldr r7, =gEnemyMonIndex ldrb r0, [r7] bl battle_get_per_side_status movs r1, 0x2 @@ -42387,7 +42387,7 @@ _0804C4E4: bl battle_get_side_with_given_state lsls r0, 24 lsrs r2, r0, 24 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r2 adds r0, r1 @@ -42475,8 +42475,8 @@ atk4A_damagecalc2: @ 804C5F4 adds r0, r2 ldrb r0, [r0, 0x2] mov r8, r0 - ldr r2, =gUnknown_02024084 - ldr r3, =gUnknown_0202420C + ldr r2, =gBattleMons + ldr r3, =gEnemyMonIndex ldrb r1, [r3] movs r0, 0x58 muls r0, r1 @@ -42492,7 +42492,7 @@ atk4A_damagecalc2: @ 804C5F4 bne _0804C688 ldr r3, =gUnknown_0202420A strb r0, [r3] - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x9 orrs r0, r1 @@ -42511,7 +42511,7 @@ atk4A_damagecalc2: @ 804C5F4 b _0804C76A .pool _0804C678: - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r2, 0x8 orrs r1, r2 @@ -42638,8 +42638,8 @@ _0804C74A: cmp r0, 0 beq _0804C744 _0804C76A: - ldr r2, =gUnknown_02024084 - ldr r0, =gUnknown_0202420C + ldr r2, =gBattleMons + ldr r0, =gEnemyMonIndex mov r8, r0 ldrb r1, [r0] movs r0, 0x58 @@ -42682,7 +42682,7 @@ _0804C7AC: beq _0804C7E6 ldr r3, =gUnknown_0202420A strb r6, [r3] - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 @@ -42700,7 +42700,7 @@ _0804C7AC: ldrb r1, [r3] bl b_history__record_ability_usage_of_player _0804C7E6: - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x8 ands r0, r1 @@ -42736,7 +42736,7 @@ atk4B_cmd4b: @ 804C844 ldrb r0, [r0] strb r0, [r4] ldr r2, =gUnknown_02024280 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r1 @@ -42785,7 +42785,7 @@ atk4C_switch1: @ 804C894 adds r0, 0x5C ldrb r0, [r0] strh r0, [r2] - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r4] lsls r0, 1 adds r0, r3 @@ -42824,7 +42824,7 @@ _0804C912: bl get_battle_side_of_something ldr r4, =gUnknown_02024064 strb r0, [r4] - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldrb r0, [r4] movs r5, 0x58 adds r1, r0, 0 @@ -42850,7 +42850,7 @@ _0804C93E: adds r2, 0x1 cmp r2, 0x57 bls _0804C93E - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldr r6, =gUnknown_02024064 ldrb r0, [r6] movs r7, 0x58 @@ -42899,7 +42899,7 @@ _0804C93E: adds r0, 0x29 adds r0, r2, r0 ldrb r1, [r0] - ldr r3, =gUnknown_0832A328 + ldr r3, =gBitTable ldr r2, =gUnknown_0202406E ldrb r5, [r6] lsls r0, r5, 1 @@ -42957,14 +42957,14 @@ _0804C9FE: str r1, [r0] _0804CA26: bl sub_803A284 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 10 ands r0, r1 cmp r0, 0 beq _0804CA78 - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldr r0, =gUnknown_02024064 ldrb r3, [r0] movs r0, 0x58 @@ -42989,7 +42989,7 @@ _0804CA26: ldr r0, =gUnknown_0202449C ldr r2, [r0] adds r2, 0x92 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable lsls r0, r3, 2 adds r0, r1 ldr r0, [r0] @@ -43046,13 +43046,13 @@ atk4E_switch3: @ 804CAE8 lsrs r0, 24 cmp r0, 0x1 bne _0804CB3E - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x063f0902 ands r0, r1 cmp r0, 0 bne _0804CB3E - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldrb r0, [r6] movs r5, 0x58 muls r0, r5 @@ -43070,7 +43070,7 @@ atk4E_switch3: @ 804CAE8 bl SetPokedexFlag _0804CB3E: ldr r2, =gUnknown_02024210 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r5, =gUnknown_02024064 ldrb r0, [r5] lsls r0, 2 @@ -43094,7 +43094,7 @@ _0804CB3E: ldr r0, [r4] adds r0, 0x3 str r0, [r4] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 11 @@ -43128,7 +43128,7 @@ atk4F_jumpifcannotswitch: @ 804CBB0 ands r0, r1 cmp r0, 0 bne _0804CC28 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r3, [r3] movs r0, 0x58 muls r0, r3 @@ -43163,7 +43163,7 @@ _0804CBFC: b _0804CF00 .pool _0804CC28: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 15 @@ -43175,11 +43175,11 @@ _0804CC28: bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty mov r8, r1 cmp r0, 0x1 bne _0804CC4E - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty mov r8, r0 _0804CC4E: movs r4, 0 @@ -43201,17 +43201,17 @@ _0804CC64: adds r5, r1, r0 adds r0, r5, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0804CC9E adds r0, r5, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0804CC9E adds r0, r5, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0804CC9E ldr r0, =gUnknown_02024064 @@ -43248,11 +43248,11 @@ _0804CCC0: lsls r0, 24 cmp r0, 0 bne _0804CCEC - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty b _0804CD16 .pool _0804CCEC: - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty mov r8, r1 ldrb r0, [r5] movs r4, 0x3 @@ -43267,11 +43267,11 @@ _0804CD00: bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty mov r8, r1 cmp r0, 0x1 bne _0804CD18 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty _0804CD16: mov r8, r0 _0804CD18: @@ -43298,17 +43298,17 @@ _0804CD3A: adds r5, r1, r0 adds r0, r5, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0804CD74 adds r0, r5, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0804CD74 adds r0, r5, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0804CD74 ldr r0, =gUnknown_02024064 @@ -43337,7 +43337,7 @@ _0804CD8C: lsrs r0, 24 cmp r0, 0x1 bne _0804CE10 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty mov r8, r0 movs r4, 0 ldrb r0, [r5] @@ -43358,17 +43358,17 @@ _0804CDBE: adds r5, r1, r0 adds r0, r5, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0804CDFA adds r0, r5, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0804CDFA adds r0, r5, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0804CDFA ldr r0, =gUnknown_02024064 @@ -43397,7 +43397,7 @@ _0804CE10: bl battle_get_side_with_given_state lsls r0, 24 lsrs r7, r0, 24 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ands r0, r4 cmp r0, 0 @@ -43411,7 +43411,7 @@ _0804CE10: _0804CE48: adds r6, r7, 0 _0804CE4A: - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty mov r8, r0 b _0804CE82 .pool @@ -43420,7 +43420,7 @@ _0804CE54: bl battle_get_side_with_given_state lsls r0, 24 lsrs r7, r0, 24 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -43435,7 +43435,7 @@ _0804CE54: _0804CE7C: adds r6, r7, 0 _0804CE7E: - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty mov r8, r1 _0804CE82: movs r4, 0 @@ -43446,17 +43446,17 @@ _0804CE84: adds r5, r1, r0 adds r0, r5, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0804CEC6 adds r0, r5, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0804CEC6 adds r0, r5, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0804CEC6 ldr r1, =gUnknown_0202406E @@ -43533,7 +43533,7 @@ sub_804CF10: @ 804CF10 strb r1, [r0] ldr r1, [r4] adds r1, 0x93 - ldr r3, =gUnknown_0832A328 + ldr r3, =gBitTable ldrb r0, [r5] lsls r0, 2 adds r0, r3 @@ -43591,7 +43591,7 @@ atk50_openpartyscreen: @ 804CF88 beq _0804CFBE b _0804D464 _0804CFBE: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x41 ands r1, r0 @@ -43606,7 +43606,7 @@ _0804CFBE: b _0804D450 _0804CFD8: ldr r7, =gUnknown_02024280 - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable adds r4, r1, 0 ldr r2, =gUnknown_02024210 mov r8, r2 @@ -43704,7 +43704,7 @@ _0804D0B8: mov r8, r0 ldr r0, [r0] lsrs r5, r0, 28 - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable ldr r0, [r6] ands r0, r5 cmp r0, 0 @@ -43778,7 +43778,7 @@ _0804D15C: movs r0, 0x1 mov r9, r0 _0804D170: - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable ldr r0, [r6, 0x8] ands r0, r5 cmp r0, 0 @@ -43860,7 +43860,7 @@ _0804D214: ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution _0804D22E: - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable ldr r0, [r6, 0x4] ands r0, r5 cmp r0, 0 @@ -43937,7 +43937,7 @@ _0804D2CC: orrs r2, r0 mov r9, r2 _0804D2E4: - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable ldr r0, [r6, 0xC] ands r0, r5 cmp r0, 0 @@ -44034,7 +44034,7 @@ _0804D3A2: beq _0804D3FA ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable ldr r0, [r0] ands r1, r0 cmp r1, 0 @@ -44071,7 +44071,7 @@ _0804D3FA: beq _0804D450 ldr r0, =gUnknown_02024210 ldrb r0, [r0] - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r1, [r1, 0x4] ands r0, r1 cmp r0, 0 @@ -44104,7 +44104,7 @@ _0804D464: beq _0804D46A b _0804D658 _0804D46A: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x40 ands r0, r1 @@ -44121,7 +44121,7 @@ _0804D482: ldr r7, =gUnknown_02024280 ldr r0, [r7] lsrs r5, r0, 28 - ldr r4, =gUnknown_0832A328 + ldr r4, =gBitTable ldr r0, [r4, 0x8] ands r0, r5 cmp r0, 0 @@ -44189,7 +44189,7 @@ _0804D4F8: orrs r1, r2 strb r1, [r0] _0804D52A: - ldr r4, =gUnknown_0832A328 + ldr r4, =gBitTable ldr r0, [r4, 0xC] ands r0, r5 cmp r0, 0 @@ -44277,7 +44277,7 @@ _0804D5F8: ldr r1, =gUnknown_0202420D movs r0, 0 strb r0, [r1] - ldr r4, =gUnknown_0832A328 + ldr r4, =gBitTable ldr r2, [r4] ands r2, r5 ldr r6, =gUnknown_0202406C @@ -44352,7 +44352,7 @@ _0804D690: ldr r2, =gUnknown_02024064 strb r7, [r2] ldr r3, =gUnknown_02024210 - ldr r4, =gUnknown_0832A328 + ldr r4, =gBitTable ldrb r0, [r2] lsls r0, 2 adds r0, r4 @@ -44394,7 +44394,7 @@ _0804D6E0: strb r1, [r0] ldr r1, [r3] adds r1, 0x93 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r2 @@ -44436,7 +44436,7 @@ _0804D6E0: adds r0, 0x1 strb r0, [r1, 0x2] _0804D760: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -44484,7 +44484,7 @@ _0804D7C4: strb r0, [r4] ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r3, [r4] lsls r0, r3, 2 adds r0, r2 @@ -44566,7 +44566,7 @@ _0804D870: ldr r0, [r5] adds r0, 0x93 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r6, 2 adds r0, r2 ldr r4, [r0] @@ -44594,7 +44594,7 @@ _0804D8AA: b _0804DA82 .pool _0804D8CC: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -44611,7 +44611,7 @@ _0804D8E8: ldr r0, [r4] adds r0, 0x93 ldrb r1, [r0] - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable ldrb r2, [r5] lsls r0, r2, 2 adds r0, r6 @@ -44655,7 +44655,7 @@ _0804D922: adds r0, r2 ldrb r0, [r0] strb r0, [r1] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x42 ands r0, r1 @@ -44768,7 +44768,7 @@ _0804DA36: strb r5, [r1] movs r0, 0x6 strb r0, [r1, 0x1] - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldr r3, =gUnknown_0202420B ldrb r0, [r3] movs r2, 0x58 @@ -44832,7 +44832,7 @@ atk52_cmd52: @ 804DAAC bl sub_803FA70 ldr r1, =gUnknown_02024280 mov r8, r1 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r1 @@ -44881,7 +44881,7 @@ _0804DB1C: bne _0804DB34 b _0804DC30 _0804DB34: - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldrb r2, [r4] movs r6, 0x58 adds r0, r2, 0 @@ -44941,7 +44941,7 @@ _0804DB34: subs r1, r0 lsls r1, 25 lsrs r1, 24 - ldr r5, =gUnknown_020241F0 + ldr r5, =gBattleMoveDamage ldrb r0, [r4] muls r0, r6 adds r0, r7 @@ -44981,7 +44981,7 @@ _0804DC24: b _0804DD8E .pool _0804DC30: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r1, =gUnknown_02024064 ldrb r3, [r1] movs r0, 0x58 @@ -45073,7 +45073,7 @@ _0804DCD8: cmp r4, r0 bge _0804DD0C ldr r6, =gUnknown_0202449C - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons _0804DCE6: lsls r0, r4, 24 lsrs r0, 24 @@ -45107,7 +45107,7 @@ _0804DD0C: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable b _0804DD6E .pool _0804DD60: @@ -45321,7 +45321,7 @@ atk59_8025230: @ 804DEEC ldrb r1, [r0, 0x10] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldrb r1, [r2, 0x9] bl sub_8069318 @@ -45337,7 +45337,7 @@ _0804DF3A: ldrb r1, [r0, 0x10] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0 bl sub_8069318 @@ -45377,7 +45377,7 @@ _0804DF88: ldrb r1, [r1, 0x10] cmp r0, r1 bne _0804DFC8 - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons movs r0, 0x58 adds r2, r3, 0 muls r2, r0 @@ -45394,7 +45394,7 @@ _0804DF88: adds r1, r5, 0 bl sub_80691B0 _0804DFC8: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -45414,7 +45414,7 @@ _0804DFC8: ldrb r1, [r1, 0x10] cmp r0, r1 bne _0804E014 - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons movs r0, 0x58 adds r2, r3, 0 muls r2, r0 @@ -45493,7 +45493,7 @@ _0804E084: b _0804E3B8 .pool _0804E0BC: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 @@ -45511,7 +45511,7 @@ _0804E0BC: strb r0, [r4, 0x1] bl sub_8056B74 _0804E0E4: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x80 ands r0, r1 @@ -45529,7 +45529,7 @@ _0804E0E4: strb r0, [r4, 0x1] bl sub_8056B74 _0804E10C: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r5, 0x1 adds r0, r5, 0 @@ -45577,7 +45577,7 @@ _0804E162: b _0804E3B8 _0804E170: bl FreeAllWindowBuffers - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty ldr r1, =gUnknown_0202449C ldr r1, [r1] ldrb r1, [r1, 0x10] @@ -45607,7 +45607,7 @@ _0804E1B8: beq _0804E1C6 b _0804E3B8 _0804E1C6: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, [r0, 0x4] ldr r0, =sub_8038420 cmp r1, r0 @@ -45627,7 +45627,7 @@ _0804E1E4: beq _0804E1F2 b _0804E3B8 _0804E1F2: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, [r0, 0x4] ldr r0, =sub_8038420 cmp r1, r0 @@ -45654,11 +45654,11 @@ _0804E224: mov r1, r8 muls r1, r0 adds r0, r1, 0 - ldr r7, =gUnknown_020244EC + ldr r7, =gPlayerParty adds r0, r7 adds r1, r5, 0 adds r1, 0xD - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 adds r0, r4, 0 @@ -45722,7 +45722,7 @@ _0804E274: ldrb r1, [r1, 0x10] cmp r0, r1 bne _0804E30A - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldr r0, [r4, 0x50] movs r1, 0x80 lsls r1, 14 @@ -45732,7 +45732,7 @@ _0804E274: ldr r0, =gUnknown_020242BC ldrb r1, [r0, 0x18] lsrs r1, 4 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] @@ -45747,7 +45747,7 @@ _0804E274: adds r2, r5, 0 bl sub_8069234 _0804E30A: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -45760,7 +45760,7 @@ _0804E30A: ldrb r1, [r1, 0x10] cmp r0, r1 bne _0804E3B8 - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons movs r1, 0x80 lsls r1, 1 adds r0, r4, r1 @@ -45774,7 +45774,7 @@ _0804E30A: adds r0, 0x50 ldrb r1, [r0] lsrs r1, 4 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] @@ -45856,7 +45856,7 @@ _0804E3E0: b _0804E4FA .pool _0804E410: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 @@ -45874,7 +45874,7 @@ _0804E410: strb r0, [r4, 0x1] bl sub_8056B74 _0804E438: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x80 ands r0, r1 @@ -45892,7 +45892,7 @@ _0804E438: strb r0, [r4, 0x1] bl sub_8056B74 _0804E460: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r4, 0x1 adds r0, r4, 0 @@ -45978,7 +45978,7 @@ atk5C_cmd5c: @ 804E508 bl get_battle_side_of_something ldr r2, =gUnknown_02024064 strb r0, [r2] - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x29 ands r0, r1 @@ -45991,7 +45991,7 @@ atk5C_cmd5c: @ 804E508 ands r0, r1 cmp r0, 0 beq _0804E55A - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r2] movs r0, 0x58 muls r0, r2 @@ -46130,7 +46130,7 @@ _0804E644: ldr r0, =gUnknown_0202449C mov r8, r0 mov r9, r1 - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags mov r10, r1 cmp r3, 0xFF beq _0804E67A @@ -46206,7 +46206,7 @@ sub_804E6D8: @ 804E6D8 ldrh r0, [r0] bl sub_804E598 adds r4, r0, 0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 8 @@ -46218,7 +46218,7 @@ sub_804E6D8: @ 804E6D8 bl sub_804E598 adds r4, r0 _0804E6FC: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x92 lsls r1, 3 @@ -46350,7 +46350,7 @@ atk5F_8025B24: @ 804E818 ldr r2, =gUnknown_0202420B ldrb r3, [r2] strb r3, [r0] - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex ldrb r0, [r1] strb r0, [r2] strb r3, [r1] @@ -46421,11 +46421,11 @@ atk61_8025BA4: @ 804E898 ldrb r0, [r1] bl battle_side_get_owner lsls r0, 24 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty mov r8, r1 cmp r0, 0 bne _0804E8CA - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty mov r8, r0 _0804E8CA: movs r7, 0 @@ -46438,12 +46438,12 @@ _0804E8D0: adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0804E8F4 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData movs r1, 0xCE lsls r1, 1 cmp r0, r1 @@ -46457,11 +46457,11 @@ _0804E8F4: _0804E914: adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData strh r0, [r5] adds r0, r4, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData _0804E926: str r0, [r6] adds r6, 0x8 @@ -46590,7 +46590,7 @@ atk64_statusanimation: @ 804E9F4 ands r0, r1 cmp r0, 0 bne _0804EA54 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r2 adds r1, 0x4C @@ -46660,7 +46660,7 @@ atk65_8025D90: @ 804EA84 ands r0, r1 cmp r0, 0 bne _0804EAFC - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r2 adds r1, 0x50 @@ -46779,7 +46779,7 @@ _0804EBD8: b _0804EC96 .pool _0804EC04: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 @@ -46796,7 +46796,7 @@ _0804EC04: strb r0, [r5, 0x1] bl sub_8056B74 _0804EC2A: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x80 ands r0, r1 @@ -46814,7 +46814,7 @@ _0804EC2A: strb r0, [r4, 0x1] bl sub_8056B74 _0804EC52: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -46883,8 +46883,8 @@ _0804ECC2: thumb_func_start atk69_8025FE0 atk69_8025FE0: @ 804ECDC push {r4-r7,lr} - ldr r7, =gUnknown_02024084 - ldr r6, =gUnknown_0202420C + ldr r7, =gBattleMons + ldr r6, =gEnemyMonIndex ldrb r2, [r6] movs r5, 0x58 adds r0, r2, 0 @@ -46916,12 +46916,12 @@ _0804ED10: lsrs r6, r0, 24 _0804ED2A: ldr r1, =gUnknown_0202420F - ldr r5, =gUnknown_0202420C + ldr r5, =gEnemyMonIndex ldrb r0, [r5] strb r0, [r1] cmp r4, 0x27 bne _0804ED68 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -46944,8 +46944,8 @@ _0804ED2A: orrs r1, r2 strb r1, [r0] _0804ED68: - ldr r2, =gUnknown_02024084 - ldr r3, =gUnknown_0202420C + ldr r2, =gBattleMons + ldr r3, =gEnemyMonIndex ldrb r4, [r3] movs r0, 0x58 muls r0, r4 @@ -46991,7 +46991,7 @@ _0804EDBA: muls r0, r4 adds r0, r5 ldrh r1, [r0, 0x28] - ldr r2, =gUnknown_020241F0 + ldr r2, =gBattleMoveDamage ldr r0, [r2] cmp r1, r0 bgt _0804EE38 @@ -47005,7 +47005,7 @@ _0804EDBA: lsls r0, 30 cmp r0, 0 bge _0804EE10 - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r2, 0x40 orrs r1, r2 @@ -47022,7 +47022,7 @@ _0804EE10: lsrs r0, 7 cmp r0, 0 beq _0804EE38 - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x80 orrs r0, r1 @@ -47060,7 +47060,7 @@ atk6A_stash_item_for_side: @ 804EE58 adds r0, 0xB8 ldr r1, [r1] adds r1, r0 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r3, 0x58 adds r0, r4, 0 muls r0, r3 @@ -47244,7 +47244,7 @@ _0804F014: b _0804F06A .pool _0804F02C: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r0, [r0, 0x2E] cmp r0, 0 beq _0804F0F2 @@ -47257,7 +47257,7 @@ _0804F02C: b _0804F06A .pool _0804F04C: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r0, [r0, 0x2E] cmp r0, 0 beq _0804F0F2 @@ -47341,7 +47341,7 @@ sub_804F100: @ 804F100 ldrb r1, [r0, 0x10] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 add r1, sp, 0x8 bl sub_81D388C @@ -47371,7 +47371,7 @@ sub_804F144: @ 804F144 ldrb r1, [r0, 0x10] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 add r1, sp, 0x4 bl sub_81D388C @@ -47477,10 +47477,10 @@ sub_804F220: @ 804F220 ldrb r0, [r0, 0x10] movs r5, 0x64 muls r0, r5 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData mov r8, r0 lsls r0, 16 lsrs r0, 16 @@ -47496,7 +47496,7 @@ sub_804F220: @ 804F220 ldrb r0, [r0, 0x10] muls r0, r5 adds r0, r4 - ldr r5, =gUnknown_02021FC4 + ldr r5, =gStringVar4 adds r1, r5, 0 bl GetMonNickname str r5, [sp] @@ -47541,7 +47541,7 @@ sub_804F220: @ 804F220 mov r1, r8 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r5, r0, 0 subs r4, r5, r4 movs r2, 0x4 @@ -47549,7 +47549,7 @@ sub_804F220: @ 804F220 lsls r2, 16 lsrs r2, 16 movs r1, 0x77 - bl RepeatChar + bl StringFill adds r5, r0, 0 cmp r7, 0xFF beq _0804F320 @@ -47651,10 +47651,10 @@ sub_804F384: @ 804F384 ldrb r0, [r0, 0x10] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 @@ -47664,7 +47664,7 @@ sub_804F384: @ 804F384 muls r0, r6 adds r0, r5 movs r1, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 adds r0, r4, 0 movs r2, 0x1 @@ -47766,7 +47766,7 @@ sub_804F498: @ 804F498 ldrb r2, [r0, 0x10] cmp r1, r2 beq _0804F4BA - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -47932,7 +47932,7 @@ _0804F5F0: thumb_func_start atk73_cmd73 atk73_cmd73: @ 804F5F8 push {r4-r6,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r4, [r0] movs r6, 0x1 ands r4, r6 @@ -47948,7 +47948,7 @@ atk73_cmd73: @ 804F5F8 eors r0, r1 lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r1, 0x58 muls r1, r0 adds r1, r2 @@ -48013,7 +48013,7 @@ atk74_hp_tresholds_2: @ 804F6A4 push {r4-r7,lr} mov r7, r8 push {r7} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r7, [r0] movs r0, 0x1 mov r8, r0 @@ -48040,7 +48040,7 @@ atk74_hp_tresholds_2: @ 804F6A4 adds r0, r6 adds r0, 0xA8 ldrb r5, [r0] - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r4 adds r0, r1 @@ -48107,7 +48107,7 @@ atk75_8026A58: @ 804F754 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldr r1, =gUnknown_02024208 ldrh r1, [r1] @@ -48187,7 +48187,7 @@ _0804F84C: .pool _0804F85C: ldr r1, =gUnknown_0202420B - ldr r4, =gUnknown_0202420C + ldr r4, =gEnemyMonIndex ldrb r0, [r4] strb r0, [r1] ldrb r0, [r1] @@ -48204,7 +48204,7 @@ _0804F85C: ldrb r0, [r2, 0x8] cmp r0, 0 beq _0804F8A8 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r2, 0x9] movs r0, 0x58 muls r0, r2 @@ -48216,7 +48216,7 @@ _0804F85C: b _0804FD70 .pool _0804F8A8: - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldr r1, =gUnknown_02024064 ldrb r1, [r1] strb r1, [r0] @@ -48233,13 +48233,13 @@ _0804F8CC: ldrh r0, [r0] movs r1, 0 bl sub_80458E0 - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex strb r0, [r1] b _0804FD70 .pool _0804F8E4: ldr r2, =gUnknown_02024280 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r0, [r0] lsls r0, 2 @@ -48318,7 +48318,7 @@ _0804F98C: ldr r1, [r6] adds r4, r1, r0 movs r3, 0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r2 adds r1, 0xC @@ -48353,7 +48353,7 @@ _0804F9D2: b _0804FD70 .pool _0804F9E0: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0xB ands r0, r1 @@ -48361,7 +48361,7 @@ _0804F9E0: beq _0804F9EE b _0804FD70 _0804F9EE: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrh r0, [r1, 0x28] cmp r0, 0 bne _0804F9F8 @@ -48396,7 +48396,7 @@ _0804FA20: adds r7, r0, 0 adds r7, 0x92 ldrb r3, [r7] - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r2, [r6] lsls r0, r2, 2 adds r0, r1 @@ -48407,7 +48407,7 @@ _0804FA20: beq _0804FA50 b _0804FD70 _0804FA50: - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons movs r0, 0x58 mov r12, r0 mov r1, r12 @@ -48472,12 +48472,12 @@ _0804FADE: b _0804FD70 .pool _0804FAE8: - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r0, 0x80 movs r1, 0 strh r1, [r0] ldr r2, =gUnknown_02024280 - ldr r3, =gUnknown_0832A328 + ldr r3, =gBitTable ldr r1, [r3, 0x4] lsls r1, 28 ldr r0, [r2] @@ -48502,11 +48502,11 @@ _0804FAE8: b _0804FBF4 .pool _0804FB3C: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0 strh r0, [r1, 0x28] ldr r2, =gUnknown_02024280 - ldr r3, =gUnknown_0832A328 + ldr r3, =gBitTable ldr r1, [r3] lsls r1, 28 ldr r0, [r2] @@ -48536,13 +48536,13 @@ _0804FB3C: b _0804FD70 .pool _0804FB94: - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons movs r1, 0 strh r1, [r0, 0x28] adds r0, 0x80 strh r1, [r0] ldr r2, =gUnknown_02024280 - ldr r3, =gUnknown_0832A328 + ldr r3, =gBitTable ldr r0, [r3] lsls r0, 28 ldr r1, [r2] @@ -48634,7 +48634,7 @@ _0804FC78: ldr r4, =gUnknown_02024064 movs r0, 0x1 strb r0, [r4] - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r0, 0x58 b _0804FCA2 .pool @@ -48646,7 +48646,7 @@ _0804FC8C: ldr r4, =gUnknown_02024064 movs r0, 0x3 strb r0, [r4] - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons movs r2, 0x84 lsls r2, 1 adds r0, r2 @@ -48681,7 +48681,7 @@ _0804FCF0: ldr r2, [r0] ldr r0, =0x000002a2 adds r2, r0 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r0, [r0] lsls r0, 2 @@ -48788,7 +48788,7 @@ _0804FDCC: ldrb r4, [r0, 0x8] lsls r4, 1 adds r4, r2 - bl GenerateRandomNumber + bl Random ldrh r1, [r4] lsls r0, 16 lsrs r0, 16 @@ -48862,7 +48862,7 @@ _0804FE80: ldr r1, =gUnknown_02024332 movs r0, 0x2 strb r0, [r1, 0x5] - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 @@ -48889,13 +48889,13 @@ atk78_faintifabilitynotdamp: @ 804FEC8 ldr r2, [r0] cmp r2, 0 bne _0804FFCC - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex strb r2, [r1] ldr r0, =gUnknown_0202406C ldrb r3, [r0] adds r5, r1, 0 mov r8, r0 - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons cmp r2, r3 bcs _0804FF14 adds r0, r6, 0 @@ -48931,7 +48931,7 @@ _0804FF14: ldr r7, =gUnknown_0202420B ldrb r0, [r7] strb r0, [r4] - ldr r2, =gUnknown_020241F0 + ldr r2, =gBattleMoveDamage ldrb r1, [r4] movs r0, 0x58 muls r0, r1 @@ -48955,7 +48955,7 @@ _0804FF14: beq _0804FFCC adds r3, r5, 0 ldrb r5, [r7] - ldr r7, =gUnknown_0832A328 + ldr r7, =gBitTable adds r4, r0, 0 ldr r6, =gUnknown_02024210 _0804FF60: @@ -49014,7 +49014,7 @@ atk79_setuserhptozero: @ 804FFE4 ldr r0, =gUnknown_0202420B ldrb r0, [r0] strb r0, [r4] - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r0, [r4] movs r2, 0x58 muls r0, r2 @@ -49059,14 +49059,14 @@ sub_8050044: @ 8050044 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r4, r0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 adds r7, r3, 0 cmp r0, 0 beq _080500DC - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r1, [r0] adds r1, 0x1 strb r1, [r0] @@ -49075,7 +49075,7 @@ sub_8050044: @ 8050044 lsrs r1, 24 adds r3, r0, 0 ldr r6, =gUnknown_02024210 - ldr r5, =gUnknown_0832A328 + ldr r5, =gBitTable ldr r0, =gUnknown_0202406C mov r12, r0 ldrb r0, [r2] @@ -49137,15 +49137,15 @@ sub_80500E8: @ 80500E8 lsls r0, 24 orrs r2, r0 ldrb r0, [r1, 0x5] - ldr r3, =gUnknown_0202420C + ldr r3, =gEnemyMonIndex cmp r0, 0x1 bne _08050110 ldr r0, =gUnknown_0202420B ldrb r0, [r0] strb r0, [r3] _08050110: - ldr r1, =gUnknown_020241F0 - ldr r6, =gUnknown_02024084 + ldr r1, =gBattleMoveDamage + ldr r6, =gBattleMons ldrb r0, [r3] movs r5, 0x58 muls r0, r5 @@ -49277,7 +49277,7 @@ _08050220: ldr r1, =0xfffffbff ands r0, r1 str r0, [r2] - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 mov r1, r8 @@ -49292,7 +49292,7 @@ _0805024A: ldrh r0, [r4] movs r1, 0 bl sub_80458E0 - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex strb r0, [r1] ldr r5, =gUnknown_02024214 ldr r3, =gUnknown_082D86A8 @@ -49340,13 +49340,13 @@ _080502AE: thumb_func_start sub_80502C8 sub_80502C8: @ 80502C8 push {lr} - ldr r2, =gUnknown_020243CC + ldr r2, =gBattleWeather ldrh r0, [r2] movs r1, 0x7 ands r1, r0 cmp r1, 0 beq _080502F4 - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 @@ -49392,7 +49392,7 @@ atk7E_setreflect: @ 805031C ands r0, r1 cmp r0, 0 beq _0805035C - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 @@ -49433,7 +49433,7 @@ _0805035C: adds r0, r4 ldrb r1, [r6] strb r1, [r0, 0x1] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ands r0, r5 cmp r0, 0 @@ -49470,7 +49470,7 @@ sub_80503E8: @ 80503E8 mov r7, r9 mov r6, r8 push {r6,r7} - ldr r7, =gUnknown_0202427C + ldr r7, =gBattleMoveFlags ldrb r5, [r7] movs r0, 0x29 ands r0, r5 @@ -49478,7 +49478,7 @@ sub_80503E8: @ 80503E8 bne _0805041A ldr r0, =gUnknown_020242AC mov r9, r0 - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex mov r8, r1 ldrb r4, [r1] lsls r0, r4, 2 @@ -49501,7 +49501,7 @@ _0805041A: b _08050488 .pool _08050438: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r4 adds r1, r0, r1 @@ -49573,13 +49573,13 @@ _080504C4: beq _08050510 b _08050518 _080504CA: - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage ldr r0, [r1] negs r0, r0 b _08050516 .pool _080504D8: - ldr r3, =gUnknown_020241F0 + ldr r3, =gBattleMoveDamage ldr r0, [r3] lsrs r1, r0, 31 adds r0, r1 @@ -49589,8 +49589,8 @@ _080504D8: bne _080504EA str r2, [r3] _080504EA: - ldr r2, =gUnknown_02024084 - ldr r0, =gUnknown_0202420C + ldr r2, =gBattleMons + ldr r0, =gEnemyMonIndex ldrb r1, [r0] movs r0, 0x58 muls r0, r1 @@ -49604,7 +49604,7 @@ _080504EA: b _08050518 .pool _08050510: - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage ldr r0, [r1] lsls r0, 1 _08050516: @@ -49637,13 +49637,13 @@ atk81_setrest: @ 8050528 lsls r0, 24 orrs r6, r0 ldr r5, =gUnknown_02024064 - ldr r2, =gUnknown_0202420C + ldr r2, =gEnemyMonIndex ldr r0, =gUnknown_0202420B ldrb r0, [r0] strb r0, [r2] strb r0, [r5] - ldr r4, =gUnknown_020241F0 - ldr r1, =gUnknown_02024084 + ldr r4, =gBattleMoveDamage + ldr r1, =gBattleMons ldrb r0, [r2] movs r3, 0x58 muls r0, r3 @@ -49774,7 +49774,7 @@ sub_8050650: @ 8050650 mov r8, r0 cmp r2, r1 bge _080506C4 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons mov r12, r0 movs r0, 0x58 muls r0, r3 @@ -49799,7 +49799,7 @@ _0805067C: beq _080506BC movs r3, 0 strb r2, [r6, 0x17] - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex ldrb r0, [r1] cmp r0, 0xFF beq _080506DC @@ -49854,7 +49854,7 @@ sub_80506EC: @ 80506EC ldrb r0, [r1, 0x4] lsls r0, 24 orrs r4, r0 - ldr r6, =gUnknown_0202420C + ldr r6, =gEnemyMonIndex ldrb r0, [r6] bl sub_8050650 lsls r0, 24 @@ -49864,7 +49864,7 @@ sub_80506EC: @ 80506EC b _08050762 .pool _08050720: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r3, [r6] movs r0, 0x58 muls r0, r3 @@ -49911,7 +49911,7 @@ sub_8050768: @ 8050768 ldrb r0, [r1, 0x9] cmp r0, 0x3 bne _080507A0 - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 @@ -49990,10 +49990,10 @@ _08050828: ldrb r0, [r0, 0x6] cmp r0, 0x1 beq _080508B0 - ldr r0, =gUnknown_020241F0 + ldr r0, =gBattleMoveDamage mov r8, r0 ldr r4, =gUnknown_0202428E - ldr r5, =gUnknown_0202420C + ldr r5, =gEnemyMonIndex ldrb r0, [r5] bl battle_get_per_side_status movs r1, 0x1 @@ -50004,7 +50004,7 @@ _08050828: ldrb r0, [r6] movs r4, 0x58 muls r0, r4 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons adds r0, r2 ldrb r1, [r5] muls r1, r4 @@ -50110,7 +50110,7 @@ atk87_stockpiletohprecovery: @ 8050904 b _080509D0 .pool _08050954: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r3 adds r1, r0, r1 @@ -50121,7 +50121,7 @@ _08050954: movs r0, 0 strb r0, [r4, 0x9] str r2, [r7] - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex ldrb r0, [r6] strb r0, [r1] ldr r1, =gUnknown_02024332 @@ -50130,7 +50130,7 @@ _08050954: b _080509D0 .pool _08050984: - ldr r5, =gUnknown_020241F0 + ldr r5, =gBattleMoveDamage ldrh r0, [r1, 0x2C] ldrb r1, [r4, 0x9] movs r2, 0x3 @@ -50165,7 +50165,7 @@ _080509A0: ldr r0, [r7] adds r0, 0x5 str r0, [r7] - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex ldrb r0, [r6] strb r0, [r1] _080509D0: @@ -50180,7 +50180,7 @@ _080509D0: thumb_func_start atk88_negativedamage atk88_negativedamage: @ 80509E8 push {lr} - ldr r2, =gUnknown_020241F0 + ldr r2, =gBattleMoveDamage ldr r0, =gUnknown_020241F4 ldr r0, [r0] lsrs r1, r0, 31 @@ -50230,7 +50230,7 @@ sub_8050A1C: @ 8050A1C .pool _08050A50: ldr r0, =gUnknown_02024064 - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex _08050A54: ldrb r1, [r1] strb r1, [r0] @@ -50357,7 +50357,7 @@ _08050B68: b _08050E80 .pool _08050B78: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r1, =gUnknown_02024064 ldrb r3, [r1] movs r4, 0x58 @@ -50569,7 +50569,7 @@ _08050D32: cmp r0, 0 beq _08050DE2 movs r1, 0 - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] ldr r3, =gUnknown_02024332 mov r8, r3 @@ -50611,7 +50611,7 @@ _08050DA6: mov r2, r12 orrs r0, r2 strb r0, [r1] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r4, =gUnknown_02024064 ldrb r3, [r4] movs r0, 0x58 @@ -50635,7 +50635,7 @@ _08050DE2: .pool _08050DFC: movs r1, 0 - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] ldr r2, =gUnknown_02024332 mov r8, r2 @@ -50691,7 +50691,7 @@ _08050E56: ands r3, r5 cmp r3, 0 beq _08050E70 - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 @@ -50765,7 +50765,7 @@ atk8A_normalisebuffs: @ 8050EEC mov r12, r0 cmp r2, r1 bge _08050F24 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons movs r4, 0x6 adds r5, r1, 0 movs r7, 0x58 @@ -50801,7 +50801,7 @@ _08050F24: thumb_func_start atk8B_setbide atk8B_setbide: @ 8050F40 push {r4,r5,lr} - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldr r3, =gUnknown_0202420B ldrb r0, [r3] movs r5, 0x58 @@ -50849,7 +50849,7 @@ atk8B_setbide: @ 8050F40 thumb_func_start atk8C_confuseifrepeatingattackends atk8C_confuseifrepeatingattackends: @ 8050FB0 push {lr} - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -50889,13 +50889,13 @@ atk8D_setloopcounter: @ 8050FF0 .pool _0805100C: ldr r4, =gUnknown_02024212 - bl GenerateRandomNumber + bl Random movs r5, 0x3 ands r0, r5 strb r0, [r4] cmp r0, 0x1 bls _08051022 - bl GenerateRandomNumber + bl Random ands r0, r5 _08051022: adds r0, 0x2 @@ -50935,7 +50935,7 @@ atk8E_cmd8e: @ 805103C thumb_func_start sub_8051064 sub_8051064: @ 8051064 push {r4-r7,lr} - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldr r7, =gUnknown_0202420B ldrb r0, [r7] movs r5, 0x58 @@ -50943,7 +50943,7 @@ sub_8051064: @ 8051064 muls r1, r5 adds r1, r6 adds r1, 0x2A - ldr r4, =gUnknown_0202420C + ldr r4, =gEnemyMonIndex ldrb r3, [r4] adds r0, r3, 0 muls r0, r5 @@ -50962,7 +50962,7 @@ sub_8051064: @ 8051064 b _08051108 .pool _080510AC: - bl GenerateRandomNumber + bl Random movs r3, 0xFF ands r3, r0 ldrb r0, [r7] @@ -51032,7 +51032,7 @@ sub_805112C: @ 805112C sub sp, 0xC movs r0, 0 str r0, [sp, 0x4] - ldr r5, =gUnknown_02022FEC + ldr r5, =gBattleTypeFlags ldr r0, [r5] movs r1, 0x8 ands r0, r1 @@ -51040,15 +51040,15 @@ sub_805112C: @ 805112C bne _0805114A b _08051410 _0805114A: - ldr r4, =gUnknown_0202420C + ldr r4, =gEnemyMonIndex ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty str r1, [sp] cmp r0, 0 bne _08051160 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty str r0, [sp] _08051160: ldr r2, [r5] @@ -51069,7 +51069,7 @@ _08051160: cmp r0, 0 beq _080511C8 _08051182: - ldr r2, =gUnknown_0202420C + ldr r2, =gEnemyMonIndex ldrb r1, [r2] movs r0, 0x2 ands r0, r1 @@ -51131,7 +51131,7 @@ _08051202: movs r0, 0x1 str r0, [sp, 0x8] ldr r2, =gUnknown_0202406E - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r1, [r0] b _0805128E .pool @@ -51175,7 +51175,7 @@ _08051258: _08051260: str r1, [sp, 0x8] ldr r2, =gUnknown_0202406E - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r1, [r0] b _0805128E .pool @@ -51229,17 +51229,17 @@ _080512C4: adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _080512F6 adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _080512F6 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _080512F6 ldr r0, [sp, 0x4] @@ -51275,7 +51275,7 @@ _08051328: cmp r0, 0 beq _08051378 _08051332: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 mov r1, r10 @@ -51292,21 +51292,21 @@ _08051332: adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08051332 adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0x1 beq _08051332 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08051332 _08051378: - ldr r4, =gUnknown_0202420C + ldr r4, =gEnemyMonIndex ldrb r0, [r4] ldr r1, =gUnknown_0202449C ldr r1, [r1] @@ -51320,7 +51320,7 @@ _08051378: ldrb r0, [r4] bl sub_803BDA0 _08051396: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r2, [r0] movs r1, 0x81 lsls r1, 1 @@ -51342,7 +51342,7 @@ _08051396: cmp r2, r0 bne _080513DE _080513C0: - ldr r5, =gUnknown_0202420C + ldr r5, =gEnemyMonIndex ldrb r0, [r5] lsls r4, r6, 24 lsrs r4, 24 @@ -51356,14 +51356,14 @@ _080513C0: movs r2, 0x1 bl sub_81B8E80 _080513DE: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 15 ands r0, r1 cmp r0, 0 beq _08051414 - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] lsls r1, r6, 24 lsrs r1, 24 @@ -51391,7 +51391,7 @@ sub_8051424: @ 8051424 mov r5, r8 push {r5-r7} movs r6, 0 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r3, =gUnknown_0202420B ldrb r1, [r3] movs r0, 0x58 @@ -51425,7 +51425,7 @@ _08051466: bcs _080514E8 ldr r0, =gBattleMoves mov r10, r0 - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons mov r12, r5 ldr r7, =gUnknown_0202420B ldrb r0, [r7] @@ -51507,12 +51507,12 @@ _0805150C: ldr r5, =gBattleMoves mov r9, r5 _08051512: - bl GenerateRandomNumber + bl Random adds r3, r0, 0 ands r3, r7 cmp r3, r6 bcs _08051512 - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons lsls r1, r3, 1 ldr r3, =gUnknown_0202420B ldrb r2, [r3] @@ -51597,7 +51597,7 @@ _080515B0: thumb_func_start atk91_givemoney atk91_givemoney: @ 80515C8 push {r4,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 @@ -51614,7 +51614,7 @@ atk91_givemoney: @ 80515C8 ldrb r0, [r0] adds r4, r1, 0 muls r4, r0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x92 lsls r1, 3 @@ -51675,7 +51675,7 @@ atk92_setlightscreen: @ 8051664 ands r0, r1 cmp r0, 0 beq _080516A4 - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 @@ -51716,7 +51716,7 @@ _080516A4: adds r0, r4 ldrb r1, [r5] strb r1, [r0, 0x3] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ands r0, r6 cmp r0, 0 @@ -51752,8 +51752,8 @@ atk93_ko_move: @ 8051730 mov r7, r9 mov r6, r8 push {r6,r7} - ldr r7, =gUnknown_02024084 - ldr r6, =gUnknown_0202420C + ldr r7, =gBattleMons + ldr r6, =gEnemyMonIndex ldrb r2, [r6] movs r5, 0x58 adds r0, r2, 0 @@ -51785,12 +51785,12 @@ _08051768: lsrs r6, r0, 24 _08051782: ldr r1, =gUnknown_0202420F - ldr r5, =gUnknown_0202420C + ldr r5, =gEnemyMonIndex ldrb r0, [r5] strb r0, [r1] cmp r4, 0x27 bne _080517C0 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -51813,8 +51813,8 @@ _08051782: orrs r1, r2 strb r1, [r0] _080517C0: - ldr r1, =gUnknown_02024084 - ldr r2, =gUnknown_0202420C + ldr r1, =gBattleMons + ldr r2, =gEnemyMonIndex ldrb r3, [r2] movs r6, 0x58 adds r0, r3, 0 @@ -51827,7 +51827,7 @@ _080517C0: mov r9, r2 cmp r4, 0x5 bne _0805181C - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 @@ -51873,7 +51873,7 @@ _0805181C: adds r0, r2 lsls r0, 16 lsrs r4, r0, 16 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -51932,14 +51932,14 @@ _080518CA: adds r2, r0 lsls r2, 2 adds r2, r1 - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldrb r0, [r7] movs r5, 0x58 muls r0, r5 adds r0, r6 adds r0, 0x2A ldrb r1, [r0] - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex mov r8, r0 ldrb r0, [r0] muls r0, r5 @@ -51951,7 +51951,7 @@ _080518CA: adds r1, r2 lsls r1, 16 lsrs r4, r1, 16 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -51979,9 +51979,9 @@ _080518CA: _08051934: movs r4, 0 _08051936: - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons mov r8, r3 - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex mov r9, r0 cmp r4, 0 beq _08051A08 @@ -51995,14 +51995,14 @@ _08051942: lsls r0, 30 cmp r0, 0 bge _08051990 - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage movs r0, 0x58 muls r0, r2 add r0, r8 ldrh r0, [r0, 0x28] subs r0, 0x1 str r0, [r1] - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x40 b _080519EE @@ -52017,7 +52017,7 @@ _08051990: lsrs r0, 7 cmp r0, 0 beq _080519DC - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage movs r3, 0x58 adds r0, r2, 0 muls r0, r3 @@ -52025,7 +52025,7 @@ _08051990: ldrh r0, [r0, 0x28] subs r0, 0x1 str r0, [r1] - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x80 orrs r0, r1 @@ -52040,13 +52040,13 @@ _08051990: b _080519F2 .pool _080519DC: - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage movs r0, 0x58 muls r0, r2 add r0, r8 ldrh r0, [r0, 0x28] str r0, [r1] - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x10 _080519EE: @@ -52060,12 +52060,12 @@ _080519F2: b _08051A70 .pool _08051A08: - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r0, [r0] movs r2, 0x58 @@ -52073,7 +52073,7 @@ _08051A08: muls r1, r2 adds r1, r3 adds r1, 0x2A - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] muls r0, r2 adds r0, r3 @@ -52117,9 +52117,9 @@ _08051A70: thumb_func_start atk94_gethalfcurrentenemyhp atk94_gethalfcurrentenemyhp: @ 8051A84 push {lr} - ldr r3, =gUnknown_020241F0 - ldr r2, =gUnknown_02024084 - ldr r0, =gUnknown_0202420C + ldr r3, =gBattleMoveDamage + ldr r2, =gBattleMons + ldr r0, =gEnemyMonIndex ldrb r1, [r0] movs r0, 0x58 muls r0, r1 @@ -52144,13 +52144,13 @@ _08051AA2: thumb_func_start sub_8051AC0 sub_8051AC0: @ 8051AC0 push {lr} - ldr r2, =gUnknown_020243CC + ldr r2, =gBattleWeather ldrh r1, [r2] movs r0, 0x18 ands r0, r1 cmp r0, 0 beq _08051AEC - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 @@ -52208,7 +52208,7 @@ _08051B36: beq _08051B4C b _08051C48 _08051B4C: - ldr r2, =gUnknown_020243CC + ldr r2, =gBattleWeather ldrh r1, [r2] movs r0, 0x18 ands r0, r1 @@ -52216,7 +52216,7 @@ _08051B4C: ldr r5, =gUnknown_0202420B cmp r0, 0 beq _08051BDA - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons ldrb r2, [r5] movs r1, 0x58 muls r1, r2 @@ -52257,7 +52257,7 @@ _08051B4C: ands r1, r0 cmp r1, 0 bne _08051BD4 - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage ldrh r0, [r3, 0x2C] lsrs r0, 4 str r0, [r1] @@ -52267,7 +52267,7 @@ _08051B4C: b _08051BD8 .pool _08051BD4: - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage movs r0, 0 _08051BD8: str r0, [r1] @@ -52278,7 +52278,7 @@ _08051BDA: ands r0, r1 cmp r0, 0 beq _08051C50 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r3, [r5] movs r0, 0x58 muls r0, r3 @@ -52306,7 +52306,7 @@ _08051BDA: ands r1, r0 cmp r1, 0 bne _08051C3C - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage ldrh r0, [r2, 0x2C] lsrs r0, 4 str r0, [r1] @@ -52317,20 +52317,20 @@ _08051BDA: b _08051C50 .pool _08051C3C: - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage movs r0, 0 str r0, [r1] b _08051C50 .pool _08051C48: - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage movs r0, 0 str r0, [r1] ldr r5, =gUnknown_0202420B _08051C50: ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r0, [r5] lsls r0, 2 adds r0, r2 @@ -52338,7 +52338,7 @@ _08051C50: ands r1, r0 cmp r1, 0 beq _08051C6A - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage movs r0, 0 str r0, [r1] _08051C6A: @@ -52373,7 +52373,7 @@ atk97_tryinfatuatetarget: @ 8051C90 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty b _08051CD8 .pool _08051CC8: @@ -52384,10 +52384,10 @@ _08051CC8: ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty _08051CD8: adds r5, r1, r0 - ldr r4, =gUnknown_0202420C + ldr r4, =gEnemyMonIndex ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 @@ -52400,7 +52400,7 @@ _08051CD8: ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty b _08051D1C .pool _08051D0C: @@ -52411,34 +52411,34 @@ _08051D0C: ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty _08051D1C: adds r4, r1, r0 adds r0, r5, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 mov r10, r0 adds r0, r5, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData mov r9, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 mov r8, r0 adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData adds r7, r0, 0 - ldr r5, =gUnknown_0202420C + ldr r5, =gEnemyMonIndex ldrb r0, [r5] movs r6, 0x58 muls r0, r6 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons adds r0, r1 adds r0, 0x20 ldrb r2, [r0] @@ -52468,7 +52468,7 @@ _08051D94: beq _08051DE4 ldrb r0, [r5] muls r0, r6 - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons adds r4, 0x50 adds r0, r4 ldr r0, [r0] @@ -52512,7 +52512,7 @@ _08051E08: adds r2, r0, 0 muls r2, r6 adds r2, r4 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_0202420B ldrb r0, [r0] lsls r0, 2 @@ -52552,7 +52552,7 @@ sub_8051E48: @ 8051E48 bl get_battle_side_of_something ldr r4, =gUnknown_02024064 strb r0, [r4] - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldrb r1, [r4] movs r0, 0x58 adds r2, r1, 0 @@ -52580,7 +52580,7 @@ _08051EA0: strb r0, [r4] ldr r6, =gUnknown_02024210 ldrb r1, [r6] - ldr r7, =gUnknown_0832A328 + ldr r7, =gBitTable ldrb r2, [r4] lsls r0, r2, 2 adds r0, r7 @@ -52588,7 +52588,7 @@ _08051EA0: ands r1, r0 cmp r1, 0 bne _08051EDC - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons movs r0, 0x58 muls r2, r0 adds r0, r3, 0 @@ -52603,7 +52603,7 @@ _08051EA0: ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution _08051EDC: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -52625,7 +52625,7 @@ _08051EDC: ands r1, r0 cmp r1, 0 bne _08051F2C - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons movs r0, 0x58 muls r2, r0 adds r0, r3, 0 @@ -52668,7 +52668,7 @@ atk99_setmisteffect: @ 8051F58 ldrb r0, [r0, 0x4] cmp r0, 0 beq _08051F98 - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x20 orrs r0, r1 @@ -52728,7 +52728,7 @@ _08051FE6: thumb_func_start atk9A_setincreasedcriticalchance atk9A_setincreasedcriticalchance: @ 8052000 push {lr} - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -52742,7 +52742,7 @@ atk9A_setincreasedcriticalchance: @ 8052000 ands r2, r3 cmp r2, 0 beq _08052040 - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x20 orrs r0, r1 @@ -52780,8 +52780,8 @@ atk9B_transformdataexecution: @ 805205C ldr r0, [r1] adds r0, 0x1 str r0, [r1] - ldr r7, =gUnknown_02024084 - ldr r0, =gUnknown_0202420C + ldr r7, =gBattleMons + ldr r0, =gEnemyMonIndex mov r12, r0 ldrb r1, [r0] movs r6, 0x58 @@ -52805,7 +52805,7 @@ atk9B_transformdataexecution: @ 805205C cmp r2, 0 beq _080520D8 _080520A2: - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x20 orrs r0, r1 @@ -52956,7 +52956,7 @@ _080521EC: thumb_func_start sub_80521FC sub_80521FC: @ 80521FC push {r4-r7,lr} - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldr r6, =gUnknown_0202420B ldrb r0, [r6] movs r5, 0x58 @@ -52972,7 +52972,7 @@ _08052216: ldrh r0, [r3, 0x28] cmp r0, r2 bhi _0805223C - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage movs r0, 0 str r0, [r1] ldr r1, =gUnknown_02024332 @@ -52981,7 +52981,7 @@ _08052216: b _08052290 .pool _0805223C: - ldr r4, =gUnknown_020241F0 + ldr r4, =gBattleMoveDamage str r1, [r4] cmp r1, 0 bne _08052248 @@ -53085,7 +53085,7 @@ atk9D_copyattack: @ 8052300 adds r7, r1, 0 strh r7, [r0] ldr r5, =gUnknown_02024248 - ldr r6, =gUnknown_0202420C + ldr r6, =gEnemyMonIndex ldrb r0, [r6] lsls r0, 1 adds r0, r5 @@ -53094,7 +53094,7 @@ atk9D_copyattack: @ 8052300 lsls r0, 24 cmp r0, 0 bne _0805235A - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r2, =gUnknown_0202420B ldrb r1, [r2] movs r0, 0x58 @@ -53181,7 +53181,7 @@ _080523CE: adds r0, 0xC adds r1, r0 ldr r2, =gUnknown_02024248 - ldr r3, =gUnknown_0202420C + ldr r3, =gEnemyMonIndex ldrb r0, [r3] lsls r0, 1 adds r0, r2 @@ -53249,7 +53249,7 @@ _0805244C: adds r2, r1 ldrb r4, [r2, 0x18] lsrs r3, r4, 4 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r5] lsls r0, 2 adds r0, r1 @@ -53303,7 +53303,7 @@ sub_80524DC: @ 80524DC ldr r0, =gUnknown_02024214 mov r8, r0 _080524EE: - bl GenerateRandomNumber + bl Random ldr r2, =0x000001ff adds r1, r2, 0 ands r0, r1 @@ -53352,7 +53352,7 @@ _0805251C: ldrh r0, [r4] movs r1, 0 bl sub_80458E0 - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex strb r0, [r1] pop {r3} mov r8, r3 @@ -53364,8 +53364,8 @@ _0805251C: thumb_func_start atk9F_nightshadedamageeffect atk9F_nightshadedamageeffect: @ 8052584 - ldr r3, =gUnknown_020241F0 - ldr r2, =gUnknown_02024084 + ldr r3, =gBattleMoveDamage + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -53387,7 +53387,7 @@ atkA0_psywavedamageeffect: @ 80525B4 push {r4,lr} movs r4, 0xF _080525B8: - bl GenerateRandomNumber + bl Random adds r3, r4, 0 ands r3, r0 cmp r3, 0xA @@ -53395,8 +53395,8 @@ _080525B8: lsls r0, r3, 2 adds r0, r3 lsls r3, r0, 1 - ldr r4, =gUnknown_020241F0 - ldr r2, =gUnknown_02024084 + ldr r4, =gBattleMoveDamage + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -53445,7 +53445,7 @@ atkA1_counterdamagecalculator: @ 8052608 beq _080526BC cmp r6, r2 beq _080526BC - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons adds r0, r1, r5 ldrb r0, [r0, 0xC] movs r4, 0x58 @@ -53454,7 +53454,7 @@ atkA1_counterdamagecalculator: @ 8052608 ldrh r0, [r0, 0x28] cmp r0, 0 beq _080526BC - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage lsls r0, r3, 1 str r0, [r1] ldr r1, =gUnknown_02024294 @@ -53472,12 +53472,12 @@ atkA1_counterdamagecalculator: @ 8052608 ldrh r0, [r0, 0x28] cmp r0, 0 beq _08052690 - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex strb r1, [r0] b _080526A0 .pool _08052690: - ldr r2, =gUnknown_0202420C + ldr r2, =gEnemyMonIndex ldr r1, =gUnknown_0202433C ldr r0, =gUnknown_0202420B ldrb r0, [r0] @@ -53550,7 +53550,7 @@ atkA2_mirrorcoatdamagecalculator: @ 8052700 beq _080527B4 cmp r6, r2 beq _080527B4 - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons adds r0, r1, r5 ldrb r0, [r0, 0xD] movs r4, 0x58 @@ -53559,7 +53559,7 @@ atkA2_mirrorcoatdamagecalculator: @ 8052700 ldrh r0, [r0, 0x28] cmp r0, 0 beq _080527B4 - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage lsls r0, r3, 1 str r0, [r1] ldr r1, =gUnknown_02024294 @@ -53577,12 +53577,12 @@ atkA2_mirrorcoatdamagecalculator: @ 8052700 ldrh r0, [r0, 0x28] cmp r0, 0 beq _08052788 - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex strb r1, [r0] b _08052798 .pool _08052788: - ldr r2, =gUnknown_0202420C + ldr r2, =gEnemyMonIndex ldr r1, =gUnknown_0202433C ldr r0, =gUnknown_0202420B ldrb r0, [r0] @@ -53636,8 +53636,8 @@ atkA3_disablelastusedattack: @ 80527F8 mov r6, r8 push {r6,r7} movs r4, 0 - ldr r2, =gUnknown_02024084 - ldr r3, =gUnknown_0202420C + ldr r2, =gBattleMons + ldr r3, =gEnemyMonIndex ldrb r1, [r3] movs r0, 0x58 muls r0, r1 @@ -53728,7 +53728,7 @@ _0805284C: adds r2, r3 ldrh r1, [r2] strh r1, [r0, 0x4] - bl GenerateRandomNumber + bl Random ldrb r2, [r6] lsls r1, r2, 3 subs r1, r2 @@ -53793,8 +53793,8 @@ atkA4_setencore: @ 805293C mov r5, r8 push {r5-r7} movs r5, 0 - ldr r3, =gUnknown_02024084 - ldr r4, =gUnknown_0202420C + ldr r3, =gBattleMons + ldr r4, =gEnemyMonIndex ldrb r1, [r4] movs r0, 0x58 muls r0, r1 @@ -53880,7 +53880,7 @@ _080529AC: lsls r0, 2 add r0, r9 strb r5, [r0, 0xC] - bl GenerateRandomNumber + bl Random ldrb r2, [r4] lsls r1, r2, 3 subs r1, r2 @@ -53941,8 +53941,8 @@ _08052A5E: thumb_func_start sub_8052A70 sub_8052A70: @ 8052A70 push {r4-r7,lr} - ldr r6, =gUnknown_02024084 - ldr r0, =gUnknown_0202420C + ldr r6, =gBattleMons + ldr r0, =gEnemyMonIndex mov r12, r0 ldrb r0, [r0] movs r7, 0x58 @@ -53966,7 +53966,7 @@ sub_8052A70: @ 8052A70 ldrh r1, [r0, 0x28] adds r3, r1 asrs r3, 1 - ldr r4, =gUnknown_020241F0 + ldr r4, =gBattleMoveDamage subs r1, r3 str r1, [r4] ldr r2, =gUnknown_02024474 @@ -54049,7 +54049,7 @@ atkA6_settypetorandomresistance: @ 8052B34 lsls r0, 24 cmp r0, 0 beq _08052C1C - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r2, =gUnknown_02024270 ldrb r0, [r4] adds r0, r2 @@ -54109,7 +54109,7 @@ _08052BE0: mov r4, r10 ldrb r0, [r4] muls r0, r6 - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons adds r0, r7 adds r0, 0x22 strb r2, [r0] @@ -54134,7 +54134,7 @@ _08052C1C: movs r7, 0x7F mov r9, r7 _08052C24: - bl GenerateRandomNumber + bl Random mov r4, r9 ands r4, r0 cmp r4, 0x70 @@ -54158,7 +54158,7 @@ _08052C24: ldrb r0, [r0] cmp r0, 0x5 bhi _08052C80 - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons movs r2, 0x58 adds r0, r5, 0 muls r0, r2 @@ -54215,7 +54215,7 @@ _08052CA6: movs r6, 0x58 adds r0, r2, 0 muls r0, r6 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons adds r2, r0, r1 adds r4, r2, 0 adds r4, 0x21 @@ -54266,7 +54266,7 @@ _08052D08: atkA7_setalwayshitflag: @ 8052D34 push {r4,lr} ldr r4, =gUnknown_020242AC - ldr r3, =gUnknown_0202420C + ldr r3, =gEnemyMonIndex ldrb r1, [r3] lsls r1, 2 adds r1, r4 @@ -54313,7 +54313,7 @@ atkA8_copymovepermanently: @ 8052D8C ldr r1, =0x0000ffff adds r5, r1, 0 strh r5, [r0] - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r2, =gUnknown_0202420B ldrb r1, [r2] movs r0, 0x58 @@ -54333,7 +54333,7 @@ atkA8_copymovepermanently: @ 8052D8C b _08052F18 _08052DC4: ldr r0, =gUnknown_02024240 - ldr r2, =gUnknown_0202420C + ldr r2, =gEnemyMonIndex ldrb r1, [r2] lsls r1, 1 adds r1, r0 @@ -54468,7 +54468,7 @@ _08052E7A: movs r0, 0x2 strb r0, [r1, 0x1] ldr r3, =gUnknown_02024240 - ldr r2, =gUnknown_0202420C + ldr r2, =gEnemyMonIndex ldrb r0, [r2] lsls r0, 1 adds r0, r3 @@ -54589,7 +54589,7 @@ move_weather_interaction: @ 8052FAC adds r3, r1, 0 cmp r0, 0x97 bne _08052FD0 - ldr r0, =gUnknown_020243CC + ldr r0, =gBattleWeather ldrh r1, [r0] movs r0, 0x60 ands r0, r1 @@ -54680,7 +54680,7 @@ _08053036: cmp r0, 0 beq _08053084 _08053076: - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable lsls r0, r5, 2 adds r0, r1 ldr r0, [r0] @@ -54708,9 +54708,9 @@ _08053084: .pool _080530B8: movs r7, 0x3 - ldr r4, =gUnknown_0832A328 + ldr r4, =gBitTable _080530BC: - bl GenerateRandomNumber + bl Random adds r5, r7, 0 ands r5, r0 lsls r0, r5, 2 @@ -54720,7 +54720,7 @@ _080530BC: cmp r0, 0 bne _080530BC ldr r4, =gUnknown_020241EE - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons lsls r1, r5, 1 ldr r0, =gUnknown_0202420B ldrb r3, [r0] @@ -54741,7 +54741,7 @@ _080530BC: ldrh r0, [r4] movs r1, 0 bl sub_80458E0 - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex strb r0, [r1] ldr r3, =gUnknown_02024214 ldr r2, [r3] @@ -54769,7 +54769,7 @@ _0805311C: thumb_func_start atkAA_destinybondeffect atkAA_destinybondeffect: @ 8053150 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -54797,12 +54797,12 @@ b_feature_update_destiny_bond: @ 8053180 bl battle_side_get_owner lsls r0, 24 lsrs r5, r0, 24 - ldr r4, =gUnknown_0202420C + ldr r4, =gEnemyMonIndex ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 lsrs r3, r0, 24 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r4] movs r0, 0x58 muls r0, r2 @@ -54849,7 +54849,7 @@ atkAB_802A458: @ 80531E0 thumb_func_start atkAC_remaininghptopower atkAC_remaininghptopower: @ 80531F8 push {lr} - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -54902,7 +54902,7 @@ atkAD_reducepprandom: @ 8053260 push {r5-r7} sub sp, 0x4 ldr r4, =gUnknown_02024248 - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex ldrb r3, [r1] lsls r0, r3, 1 adds r0, r4 @@ -54918,7 +54918,7 @@ _08053280: b _08053408 _08053288: movs r7, 0 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons movs r1, 0x58 muls r1, r3 adds r3, r0, 0 @@ -54959,7 +54959,7 @@ _080532C6: muls r3, r0 adds r0, r3, 0 adds r0, r7, r0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons adds r1, 0x24 mov r10, r1 add r0, r10 @@ -54968,7 +54968,7 @@ _080532C6: bhi _080532E6 b _08053408 _080532E6: - bl GenerateRandomNumber + bl Random movs r1, 0x3 ands r1, r0 adds r6, r1, 0x2 @@ -55008,7 +55008,7 @@ _08053304: adds r1, r6, 0 movs r2, 0 movs r3, 0x1 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN strb r5, [r4] movs r0, 0x1 strb r0, [r4, 0x1] @@ -55038,7 +55038,7 @@ _08053304: adds r0, r1 ldrb r1, [r0, 0x18] lsrs r1, 4 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r7, 2 adds r0, r2 ldr r0, [r0] @@ -55047,7 +55047,7 @@ _08053304: bne _080533B8 mov r2, r9 muls r2, r3 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r0, 0x50 adds r0, r2, r0 ldr r0, [r0] @@ -55075,8 +55075,8 @@ _080533B8: ldr r0, [r1] adds r0, 0x5 str r0, [r1] - ldr r1, =gUnknown_02024084 - ldr r0, =gUnknown_0202420C + ldr r1, =gBattleMons + ldr r0, =gEnemyMonIndex ldrb r2, [r0] movs r0, 0x58 muls r0, r2 @@ -55140,14 +55140,14 @@ _08053454: ldrb r0, [r5] bl battle_side_get_owner lsls r0, 24 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty mov r10, r1 cmp r0, 0 bne _08053470 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty mov r10, r2 _08053470: - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldrb r3, [r5] movs r7, 0x58 adds r2, r3, 0 @@ -55198,7 +55198,7 @@ _080534D4: ldr r1, =gUnknown_02024474 strb r0, [r1, 0x17] strb r0, [r7] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -55206,7 +55206,7 @@ _080534D4: beq _0805357A ldr r0, =gUnknown_02024210 ldrb r2, [r0] - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r3, [r7] lsls r0, r3, 2 adds r0, r1 @@ -55214,7 +55214,7 @@ _080534D4: ands r2, r0 cmp r2, 0 bne _0805357A - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons movs r6, 0x58 adds r4, r3, 0 muls r4, r6 @@ -55251,7 +55251,7 @@ _08053568: strb r0, [r1, 0x5] _0805357A: movs r6, 0 - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons _0805357E: movs r0, 0x64 adds r4, r6, 0 @@ -55259,12 +55259,12 @@ _0805357E: add r4, r10 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r5, r0, 16 adds r0, r4, 0 movs r1, 0x2E - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r4, r0, 24 cmp r5, 0 @@ -55286,7 +55286,7 @@ _0805357E: b _08053600 .pool _080535D0: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -55301,7 +55301,7 @@ _080535D0: bne _08053618 ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r3, 2 adds r0, r2 ldr r0, [r0] @@ -55343,7 +55343,7 @@ _0805363E: strb r0, [r1, 0x5] movs r2, 0x3F mov r8, r2 - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r2, =gUnknown_0202420B ldrb r0, [r2] movs r5, 0x58 @@ -55372,7 +55372,7 @@ _0805363E: bl battle_get_side_with_given_state ldr r4, =gUnknown_02024064 strb r0, [r4] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -55380,7 +55380,7 @@ _0805363E: beq _080536BC ldr r0, =gUnknown_02024210 ldrb r2, [r0] - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r3, [r4] lsls r0, r3, 2 adds r0, r1 @@ -55434,8 +55434,8 @@ _080536DE: thumb_func_start atkAF_cursetarget atkAF_cursetarget: @ 805371C push {r4,r5,lr} - ldr r5, =gUnknown_02024084 - ldr r0, =gUnknown_0202420C + ldr r5, =gBattleMons + ldr r0, =gEnemyMonIndex ldrb r0, [r0] movs r4, 0x58 adds r1, r0, 0 @@ -55468,7 +55468,7 @@ atkAF_cursetarget: @ 805371C _08053768: orrs r2, r3 str r2, [r1] - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage ldr r0, =gUnknown_0202420B ldrb r0, [r0] muls r0, r4 @@ -55558,8 +55558,8 @@ _0805381E: thumb_func_start atkB1_setforesight atkB1_setforesight: @ 805382C - ldr r1, =gUnknown_02024084 - ldr r0, =gUnknown_0202420C + ldr r1, =gBattleMons + ldr r0, =gEnemyMonIndex ldrb r2, [r0] movs r0, 0x58 muls r2, r0 @@ -55594,7 +55594,7 @@ atkB2_setperishsong: @ 805385C cmp r6, r1 bge _080538C8 movs r5, 0x20 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons mov r12, r0 ldr r0, =gUnknown_020242BC adds r4, r0, 0 @@ -55673,7 +55673,7 @@ atkB3_rolloutdamagecalculation: @ 8053914 mov r7, r9 mov r6, r8 push {r6,r7} - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x29 ands r0, r1 @@ -55688,7 +55688,7 @@ atkB3_rolloutdamagecalculation: @ 8053914 b _08053A60 .pool _08053948: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r1, =gUnknown_0202420B ldrb r3, [r1] movs r5, 0x58 @@ -55846,8 +55846,8 @@ _08053A60: thumb_func_start atkB4_jumpifconfusedandattackmaxed atkB4_jumpifconfusedandattackmaxed: @ 8053A90 push {r4,r5,lr} - ldr r5, =gUnknown_02024084 - ldr r0, =gUnknown_0202420C + ldr r5, =gBattleMons + ldr r0, =gEnemyMonIndex ldrb r1, [r0] movs r0, 0x58 adds r3, r1, 0 @@ -55898,7 +55898,7 @@ _08053AF2: thumb_func_start sub_8053AF8 sub_8053AF8: @ 8053AF8 push {r4,r5,lr} - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x29 ands r0, r1 @@ -55987,7 +55987,7 @@ atkB6_happinesstodamagecalculation: @ 8053BAC cmp r0, 0x79 bne _08053BEC ldr r4, =gUnknown_02024400 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -55999,7 +55999,7 @@ atkB6_happinesstodamagecalculation: @ 8053BAC .pool _08053BEC: ldr r4, =gUnknown_02024400 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -56029,7 +56029,7 @@ _08053C02: thumb_func_start atkB7_presentdamagecalculation atkB7_presentdamagecalculation: @ 8053C30 push {r4,lr} - bl GenerateRandomNumber + bl Random movs r4, 0xFF ands r4, r0 cmp r4, 0x65 @@ -56056,9 +56056,9 @@ _08053C5C: b _08053C8E .pool _08053C6C: - ldr r3, =gUnknown_020241F0 - ldr r2, =gUnknown_02024084 - ldr r0, =gUnknown_0202420C + ldr r3, =gBattleMoveDamage + ldr r2, =gBattleMons + ldr r0, =gEnemyMonIndex ldrb r1, [r0] movs r0, 0x58 muls r0, r1 @@ -56082,8 +56082,8 @@ _08053C8E: b _08053CE6 .pool _08053CAC: - ldr r2, =gUnknown_02024084 - ldr r0, =gUnknown_0202420C + ldr r2, =gBattleMons + ldr r0, =gEnemyMonIndex ldrb r1, [r0] movs r0, 0x58 muls r0, r1 @@ -56097,7 +56097,7 @@ _08053CAC: b _08053CE6 .pool _08053CD8: - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r1, [r2] movs r0, 0xF7 ands r0, r1 @@ -56129,7 +56129,7 @@ atkB8_setsafeguard: @ 8053CFC ands r0, r1 cmp r0, 0 beq _08053D40 - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 @@ -56189,7 +56189,7 @@ atkB9_magnitudedamagecalculation: @ 8053DA4 push {r4-r7,lr} mov r7, r8 push {r7} - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -56267,7 +56267,7 @@ _08053E3C: strb r3, [r1, 0x4] movs r0, 0xFF strb r0, [r1, 0x5] - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex strb r2, [r1] ldr r0, =gUnknown_0202406C ldrb r3, [r0] @@ -56279,7 +56279,7 @@ _08053E3C: adds r4, r6, 0 ldr r0, =gUnknown_0202420B ldrb r5, [r0] - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable mov r12, r1 ldr r7, =gUnknown_02024210 _08053E72: @@ -56351,10 +56351,10 @@ _08053F10: movs r0, 0x2 _08053F12: bl battle_get_side_with_given_state - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex strb r0, [r1] ldr r0, =gUnknown_0202421C - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex ldrb r3, [r1] adds r0, r3, r0 ldrb r0, [r0] @@ -56370,7 +56370,7 @@ _08053F2A: ldrb r1, [r1, 0xC] cmp r2, r1 bne _08054030 - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons movs r2, 0x58 adds r0, r3, 0 muls r0, r2 @@ -56417,7 +56417,7 @@ _08053F2A: cmp r1, r2 bge _08053FB6 ldr r6, =gUnknown_0202407E - ldr r5, =gUnknown_0202420C + ldr r5, =gEnemyMonIndex ldr r4, =gUnknown_0202407A movs r3, 0xB adds r2, r0, 0 @@ -56438,7 +56438,7 @@ _08053FB6: movs r0, 0xE4 mov r1, r8 strh r0, [r1] - ldr r2, =gUnknown_0202420C + ldr r2, =gEnemyMonIndex ldrb r0, [r2] ldr r7, =gUnknown_0202449C ldr r1, [r7] @@ -56491,13 +56491,13 @@ _0805404A: thumb_func_start sub_805405C sub_805405C: @ 805405C push {lr} - ldr r2, =gUnknown_020243CC + ldr r2, =gBattleWeather ldrh r1, [r2] movs r0, 0x60 ands r0, r1 cmp r0, 0 beq _08054088 - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 @@ -56530,7 +56530,7 @@ _0805409A: thumb_func_start atkBC_maxattackhalvehp atkBC_maxattackhalvehp: @ 80540B4 push {r4,r5,lr} - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons ldr r4, =gUnknown_0202420B ldrb r0, [r4] movs r3, 0x58 @@ -56551,7 +56551,7 @@ _080540CC: bls _08054110 movs r0, 0xC strb r0, [r2, 0x19] - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage ldrb r0, [r4] muls r0, r3 adds r0, r5 @@ -56598,7 +56598,7 @@ atkBD_copyfoestats: @ 8054134 ldr r6, =gUnknown_0202420B movs r4, 0x58 ldr r3, =gUnknown_0202409C - ldr r5, =gUnknown_0202420C + ldr r5, =gEnemyMonIndex _08054142: ldrb r0, [r6] adds r1, r0, 0 @@ -56626,7 +56626,7 @@ _08054142: thumb_func_start atkBE_breakfree atkBE_breakfree: @ 805417C push {r4-r6,lr} - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r5, =gUnknown_0202420B ldrb r2, [r5] movs r6, 0x58 @@ -56642,7 +56642,7 @@ atkBE_breakfree: @ 805417C cmp r0, 0 beq _08054210 ldr r1, =gUnknown_02024474 - ldr r3, =gUnknown_0202420C + ldr r3, =gEnemyMonIndex ldrb r0, [r3] strb r0, [r1, 0x17] ldrb r0, [r5] @@ -56758,7 +56758,7 @@ _080542BA: thumb_func_start atkBF_setcurled atkBF_setcurled: @ 80542C8 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -56782,11 +56782,11 @@ atkBF_setcurled: @ 80542C8 atkC0_recoverbasedonsunlight: @ 80542F8 push {r4-r7,lr} sub sp, 0x4 - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex ldr r5, =gUnknown_0202420B ldrb r0, [r5] strb r0, [r1] - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldrb r0, [r5] movs r6, 0x58 muls r0, r6 @@ -56795,7 +56795,7 @@ atkC0_recoverbasedonsunlight: @ 80542F8 ldrh r0, [r0, 0x2C] cmp r1, r0 beq _080543D8 - ldr r4, =gUnknown_020243CC + ldr r4, =gBattleWeather ldrh r0, [r4] cmp r0, 0 beq _0805434A @@ -56820,8 +56820,8 @@ atkC0_recoverbasedonsunlight: @ 80542F8 cmp r0, 0 beq _08054378 _0805434A: - ldr r3, =gUnknown_020241F0 - ldr r2, =gUnknown_02024084 + ldr r3, =gBattleMoveDamage + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -56839,7 +56839,7 @@ _08054378: ands r0, r1 cmp r0, 0 beq _080543A4 - ldr r4, =gUnknown_020241F0 + ldr r4, =gBattleMoveDamage ldrb r0, [r5] muls r0, r6 adds r0, r7 @@ -56854,7 +56854,7 @@ _08054378: b _080543B2 .pool _080543A4: - ldr r1, =gUnknown_020241F0 + ldr r1, =gBattleMoveDamage ldrb r0, [r5] muls r0, r6 adds r0, r7 @@ -56907,7 +56907,7 @@ sub_8054400: @ 8054400 mov r6, r9 mov r5, r8 push {r5-r7} - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -57045,7 +57045,7 @@ atkC2_selectnexttarget: @ 8054524 push {r4-r7,lr} mov r7, r8 push {r7} - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex movs r1, 0 strb r1, [r0] ldr r1, =gUnknown_0202406C @@ -57058,7 +57058,7 @@ atkC2_selectnexttarget: @ 8054524 adds r3, r6, 0 ldr r0, =gUnknown_0202420B ldrb r5, [r0] - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable mov r12, r0 adds r4, r1, 0 ldr r7, =gUnknown_02024210 @@ -57104,7 +57104,7 @@ atkC3_setfutureattack: @ 8054598 sub sp, 0x14 ldr r0, =gUnknown_020243D0 mov r8, r0 - ldr r6, =gUnknown_0202420C + ldr r6, =gEnemyMonIndex ldrb r1, [r6] adds r0, r1, r0 ldrb r7, [r0] @@ -57173,7 +57173,7 @@ _080545DC: ldrb r0, [r5] movs r4, 0x58 muls r0, r4 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons adds r0, r2 ldrb r1, [r6] muls r1, r4 @@ -57253,13 +57253,13 @@ atkC4_802B910: @ 80546E4 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 - ldr r7, =gUnknown_02024744 + ldr r7, =gEnemyParty cmp r0, 0 bne _080546FE - ldr r7, =gUnknown_020244EC + ldr r7, =gPlayerParty _080546FE: - ldr r2, =gUnknown_02024084 - ldr r0, =gUnknown_0202420C + ldr r2, =gBattleMons + ldr r0, =gEnemyMonIndex ldrb r1, [r0] movs r0, 0x58 muls r0, r1 @@ -57294,21 +57294,21 @@ _08054750: muls r0, r5 adds r0, r7, r0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08054794 ldrb r0, [r6] muls r0, r5 adds r0, r7, r0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08054794 ldrb r0, [r4] muls r0, r5 adds r0, r7, r0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData movs r1, 0xCE lsls r1, 1 cmp r0, r1 @@ -57317,7 +57317,7 @@ _08054750: muls r0, r5 adds r0, r7, r0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _080547A4 _08054794: @@ -57350,7 +57350,7 @@ _080547A4: ldr r0, [r1] adds r0, 0x9 str r0, [r1] - ldr r2, =gUnknown_020241F0 + ldr r2, =gBattleMoveDamage mov r8, r2 ldr r5, =gBaseStats mov r1, r9 @@ -57359,7 +57359,7 @@ _080547A4: muls r0, r4 adds r0, r7, r0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r1, r0, 3 subs r1, r0 lsls r1, 2 @@ -57383,7 +57383,7 @@ _080547A4: muls r0, r4 adds r0, r7, r0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData lsls r0, 1 movs r1, 0x5 bl __udivsi3 @@ -57392,8 +57392,8 @@ _080547A4: ldr r1, [r2] muls r0, r1 str r0, [r2] - ldr r3, =gUnknown_02024084 - ldr r1, =gUnknown_0202420C + ldr r3, =gBattleMons + ldr r1, =gEnemyMonIndex ldrb r2, [r1] movs r1, 0x58 muls r1, r2 @@ -57632,14 +57632,14 @@ _08054A2C: thumb_func_start sub_8054A48 sub_8054A48: @ 8054A48 push {lr} - ldr r3, =gUnknown_020243CC + ldr r3, =gBattleWeather ldrh r1, [r3] movs r2, 0x80 adds r0, r2, 0 ands r0, r1 cmp r0, 0 beq _08054A78 - ldr r2, =gUnknown_0202427C + ldr r2, =gBattleMoveFlags ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 @@ -57670,8 +57670,8 @@ _08054A86: thumb_func_start atkC9_jumpifattackandspecialattackcannotfall atkC9_jumpifattackandspecialattackcannotfall: @ 8054AA0 push {r4,lr} - ldr r2, =gUnknown_02024084 - ldr r0, =gUnknown_0202420C + ldr r2, =gBattleMons + ldr r0, =gEnemyMonIndex ldrb r1, [r0] movs r0, 0x58 muls r0, r1 @@ -57709,7 +57709,7 @@ _08054AF4: ldr r0, =gUnknown_0202420B ldrb r0, [r0] strb r0, [r4] - ldr r2, =gUnknown_020241F0 + ldr r2, =gBattleMoveDamage ldrb r1, [r4] movs r0, 0x58 muls r0, r1 @@ -57833,7 +57833,7 @@ atkCC_callterrainattack: @ 8054BEC ldrh r0, [r4] movs r1, 0 bl sub_80458E0 - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex strb r0, [r1] ldr r3, =gUnknown_082D86A8 ldr r2, =gBattleMoves @@ -57861,7 +57861,7 @@ atkCC_callterrainattack: @ 8054BEC atkCD_cureifburnedparalysedorpoisoned: @ 8054C60 push {r4-r6,lr} sub sp, 0x4 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r3, =gUnknown_0202420B ldrb r0, [r3] movs r6, 0x58 @@ -57921,8 +57921,8 @@ _08054CD6: thumb_func_start atkCE_settorment atkCE_settorment: @ 8054CE4 push {lr} - ldr r1, =gUnknown_02024084 - ldr r0, =gUnknown_0202420C + ldr r1, =gBattleMons + ldr r0, =gEnemyMonIndex ldrb r2, [r0] movs r0, 0x58 muls r0, r2 @@ -58010,7 +58010,7 @@ _08054D8E: atkD0_settaunt: @ 8054D98 push {r4,lr} ldr r4, =gUnknown_020242BC - ldr r3, =gUnknown_0202420C + ldr r3, =gEnemyMonIndex ldrb r0, [r3] lsls r1, r0, 3 subs r1, r0 @@ -58075,9 +58075,9 @@ atkD1_sethelpinghand: @ 8054E0C lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state - ldr r3, =gUnknown_0202420C + ldr r3, =gEnemyMonIndex strb r0, [r3] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -58085,7 +58085,7 @@ atkD1_sethelpinghand: @ 8054E0C beq _08054E90 ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r3, [r3] lsls r0, r3, 2 adds r0, r2 @@ -58145,7 +58145,7 @@ sub_8054EB4: @ 8054EB4 mov r5, r8 push {r5-r7} sub sp, 0x4 - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags ldr r0, [r4] movs r1, 0x80 lsls r1, 19 @@ -58170,12 +58170,12 @@ _08054EE8: bl battle_side_get_owner lsls r0, 24 lsrs r4, r0, 24 - ldr r7, =gUnknown_0202420C + ldr r7, =gEnemyMonIndex ldrb r0, [r7] bl battle_side_get_owner lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x0a3f0902 ands r0, r1 @@ -58186,7 +58186,7 @@ _08054EE8: adds r2, 0x29 adds r0, r4, r2 ldrb r1, [r0] - ldr r4, =gUnknown_0832A328 + ldr r4, =gBitTable ldr r3, =gUnknown_0202406E ldrb r0, [r6] lsls r0, 1 @@ -58211,7 +58211,7 @@ _08054EE8: cmp r1, 0 bne _08054F9A _08054F46: - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons mov r8, r0 ldr r1, =gUnknown_0202420B ldrb r4, [r1] @@ -58224,7 +58224,7 @@ _08054F46: adds r1, r3, 0 cmp r1, 0 bne _08054F6E - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] muls r0, r5 add r0, r8 @@ -58234,7 +58234,7 @@ _08054F46: _08054F6E: cmp r1, 0xAF beq _08054F9A - ldr r7, =gUnknown_0202420C + ldr r7, =gEnemyMonIndex ldrb r0, [r7] muls r0, r5 mov r2, r8 @@ -58436,8 +58436,8 @@ _08055132: thumb_func_start sub_8055148 sub_8055148: @ 8055148 push {r4,lr} - ldr r3, =gUnknown_02024084 - ldr r4, =gUnknown_0202420C + ldr r3, =gBattleMons + ldr r4, =gEnemyMonIndex ldrb r0, [r4] movs r2, 0x58 muls r0, r2 @@ -58531,7 +58531,7 @@ _08055210: strb r0, [r1] movs r0, 0x4 strb r0, [r1, 0x1] - ldr r4, =gUnknown_0202420C + ldr r4, =gEnemyMonIndex ldrb r0, [r4] strb r0, [r1, 0x2] ldr r0, =gUnknown_020243D0 @@ -58542,8 +58542,8 @@ _08055210: strb r0, [r1, 0x3] movs r0, 0xFF strb r0, [r1, 0x4] - ldr r1, =gUnknown_020241F0 - ldr r6, =gUnknown_02024084 + ldr r1, =gBattleMoveDamage + ldr r6, =gBattleMons ldrb r0, [r4] movs r5, 0x58 muls r0, r5 @@ -58645,7 +58645,7 @@ atkD6_doubledamagedealtifdamaged: @ 80552EC cmp r0, 0 beq _0805530C adds r0, r2, r3 - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex ldrb r0, [r0, 0xC] ldrb r1, [r1] cmp r0, r1 @@ -58658,7 +58658,7 @@ _0805530C: cmp r0, 0 beq _0805532A adds r0, r2, r3 - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex ldrb r0, [r0, 0xD] ldrb r1, [r1] cmp r0, r1 @@ -58681,7 +58681,7 @@ _0805532A: sub_805534C: @ 805534C push {r4,lr} ldr r1, =gUnknown_020242AC - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r3, [r0] lsls r0, r3, 2 adds r4, r0, r1 @@ -58691,7 +58691,7 @@ sub_805534C: @ 805534C ands r0, r2 cmp r0, 0 bne _08055374 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r3 adds r1, 0x4C @@ -58734,8 +58734,8 @@ _080553B0: thumb_func_start atkD8_setdamagetohealthdifference atkD8_setdamagetohealthdifference: @ 80553BC push {lr} - ldr r2, =gUnknown_02024084 - ldr r0, =gUnknown_0202420C + ldr r2, =gBattleMons + ldr r0, =gEnemyMonIndex ldrb r0, [r0] movs r1, 0x58 muls r0, r1 @@ -58764,7 +58764,7 @@ atkD8_setdamagetohealthdifference: @ 80553BC b _0805541A .pool _08055408: - ldr r2, =gUnknown_020241F0 + ldr r2, =gBattleMoveDamage ldrh r0, [r3, 0x28] ldrh r1, [r1, 0x28] subs r0, r1 @@ -58794,7 +58794,7 @@ atkD9_scaledamagebyhealthratio: @ 8055428 lsls r0, 2 adds r0, r2 ldrb r3, [r0, 0x1] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -58824,7 +58824,7 @@ _08055464: thumb_func_start atkDA_abilityswap atkDA_abilityswap: @ 805548C push {r4-r6,lr} - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r0, [r0] movs r4, 0x58 @@ -58835,7 +58835,7 @@ atkDA_abilityswap: @ 805548C ldrb r1, [r2] cmp r1, 0 bne _080554B4 - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] muls r0, r4 adds r0, r5 @@ -58846,7 +58846,7 @@ atkDA_abilityswap: @ 805548C _080554B4: cmp r1, 0x19 beq _080554D4 - ldr r6, =gUnknown_0202420C + ldr r6, =gEnemyMonIndex ldrb r0, [r6] muls r0, r4 adds r0, r5 @@ -58854,7 +58854,7 @@ _080554B4: ldrb r3, [r0] cmp r3, 0x19 beq _080554D4 - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x29 ands r0, r1 @@ -58951,7 +58951,7 @@ _0805558A: movs r4, 0 ldr r7, =gUnknown_0202420B mov r9, r7 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons mov r12, r0 mov r1, r9 ldrb r0, [r1] @@ -59082,12 +59082,12 @@ atkDD_weightdamagecalculation: @ 8055684 cmp r0, r1 beq _080556FC adds r6, r2, 0 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons mov r8, r0 adds r7, r1, 0 adds r4, r6, 0 _080556A0: - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r1, [r0] movs r0, 0x58 muls r0, r1 @@ -59159,11 +59159,11 @@ atkDE_asistattackselect: @ 805571C bl battle_get_per_side_status movs r1, 0x1 ands r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty str r0, [sp] cmp r1, 0 beq _0805574C - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty str r1, [sp] _0805574C: movs r2, 0 @@ -59185,12 +59185,12 @@ _0805574E: adds r4, r0, r6 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _080557F4 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData movs r1, 0xCE lsls r1, 1 cmp r0, r1 @@ -59209,7 +59209,7 @@ _08055798: adds r1, 0xD ldr r0, [sp] add r0, r9 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 adds r0, r4, 0 @@ -59265,7 +59265,7 @@ _080557F4: ands r0, r1 str r0, [r2] ldr r4, =gUnknown_020241EE - bl GenerateRandomNumber + bl Random movs r1, 0xFF ands r1, r0 mov r0, r10 @@ -59279,7 +59279,7 @@ _080557F4: ldrh r0, [r4] movs r1, 0 bl sub_80458E0 - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex strb r0, [r1] ldr r1, =gUnknown_02024214 ldr r0, [r1] @@ -59316,7 +59316,7 @@ _08055886: thumb_func_start atkDF_setmagiccoat atkDF_setmagiccoat: @ 805589C push {lr} - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex ldr r3, =gUnknown_0202420B ldrb r0, [r3] strb r0, [r1] @@ -59443,7 +59443,7 @@ atkE1_802CBE4: @ 805599C strb r0, [r2] movs r0, 0x9 strb r0, [r2, 0x1] - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldrb r1, [r4, 0x17] movs r0, 0x58 muls r0, r1 @@ -59453,14 +59453,14 @@ atkE1_802CBE4: @ 805599C strb r0, [r2, 0x2] movs r0, 0xFF strb r0, [r2, 0x3] - ldr r2, =gUnknown_0202420C + ldr r2, =gEnemyMonIndex ldr r1, =gUnknown_0202406C ldrb r0, [r2] ldrb r1, [r1] cmp r0, r1 bcs _08055A22 adds r4, r2, 0 - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable _080559E2: ldrb r0, [r4] bl battle_side_get_owner @@ -59490,7 +59490,7 @@ _08055A04: cmp r0, r1 bcc _080559E2 _08055A18: - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] ldrb r2, [r2] cmp r0, r2 @@ -59533,7 +59533,7 @@ atkE2_cmde2: @ 8055A78 bl get_battle_side_of_something ldr r4, =gUnknown_02024064 strb r0, [r4] - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldrb r0, [r4] movs r6, 0x58 adds r1, r0, 0 @@ -59547,7 +59547,7 @@ atkE2_cmde2: @ 8055A78 adds r1, r3 movs r0, 0 str r0, [r1] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r1, [r4] ldr r0, =gUnknown_0202449C ldr r0, [r0] @@ -59587,7 +59587,7 @@ atkE3_jumpiffainted: @ 8055AF4 bl get_battle_side_of_something ldr r1, =gUnknown_02024064 strb r0, [r1] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r1] movs r0, 0x58 muls r0, r1 @@ -59722,20 +59722,20 @@ _08055C2A: movs r0, 0x64 adds r4, r6, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r5, r0, 16 adds r0, r4, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData strh r0, [r7] adds r0, r4, 0 movs r1, 0x2E - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08055C6C lsls r0, r5, 3 @@ -59763,7 +59763,7 @@ _08055C76: ldrh r0, [r7] cmp r0, 0 bne _08055CB6 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xA @@ -59775,7 +59775,7 @@ _08055C76: strh r0, [r7] movs r0, 0x64 muls r0, r6 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xC mov r2, sp @@ -59790,7 +59790,7 @@ _08055CC4: movs r6, 0 movs r1, 0x64 mov r8, r1 - ldr r7, =gUnknown_020244EC + ldr r7, =gPlayerParty mov r10, sp _08055CCE: mov r4, r8 @@ -59798,17 +59798,17 @@ _08055CCE: adds r4, r7 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r5, r0, 16 adds r0, r4, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData mov r1, r10 strh r0, [r1] adds r0, r4, 0 movs r1, 0x2E - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08055D30 lsls r0, r5, 3 @@ -59855,7 +59855,7 @@ _08055D3C: ldrh r0, [r1] cmp r0, 0 bne _08055DD0 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xA @@ -59863,7 +59863,7 @@ _08055D3C: lsls r0, 16 cmp r0, 0 bne _08055DD0 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -59874,7 +59874,7 @@ _08055D3C: muls r0, r6 adds r0, r7 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData subs r0, 0x1 movs r1, 0xA bl __udivsi3 @@ -59938,7 +59938,7 @@ atkE6_castform_transform: @ 8055DFC ldr r0, =gUnknown_02024474 ldrb r0, [r0, 0x17] strb r0, [r4] - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r4] movs r0, 0x58 muls r0, r2 @@ -60110,7 +60110,7 @@ atkE9_seteffectbyweather: @ 8055F5C lsls r0, 24 cmp r0, 0 bne _08055FFC - ldr r2, =gUnknown_020243CC + ldr r2, =gBattleWeather ldrb r0, [r2] cmp r0, 0 beq _08055F9A @@ -60192,7 +60192,7 @@ atkEA_recycleitem: @ 8056014 ldrh r5, [r6] cmp r5, 0 beq _08056094 - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons movs r3, 0x58 adds r0, r2, 0 muls r0, r3 @@ -60254,7 +60254,7 @@ atkEB_settypetoterrain: @ 80560BC push {r4-r7,lr} mov r7, r8 push {r7} - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons mov r8, r0 ldr r7, =gUnknown_0202420B ldrb r0, [r7] @@ -60344,7 +60344,7 @@ atkEC_802D2A0: @ 805616C bl battle_get_side_with_given_state ldr r4, =gUnknown_02024064 strb r0, [r4] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r6, 0x1 ands r0, r6 @@ -60352,7 +60352,7 @@ atkEC_802D2A0: @ 805616C beq _0805620C ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r3, [r4] lsls r0, r3, 2 adds r0, r2 @@ -60418,7 +60418,7 @@ atkED_802D364: @ 8056230 ldr r3, =gUnknown_0202420B ldrb r0, [r3] strb r0, [r1] - ldr r2, =gUnknown_0202420C + ldr r2, =gEnemyMonIndex lsls r0, 24 lsrs r0, 24 adds r4, r1, 0 @@ -60516,11 +60516,11 @@ _0805630E: ldr r0, =gUnknown_0202420B ldrb r0, [r0] strb r0, [r5] - ldr r6, =gUnknown_0202420C + ldr r6, =gEnemyMonIndex movs r1, 0x1 eors r0, r1 strb r0, [r6] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x8 ands r0, r1 @@ -60571,7 +60571,7 @@ _08056384: .pool _080563B0: ldr r3, =gBaseStats - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r6] movs r0, 0x58 muls r0, r1 @@ -60610,8 +60610,8 @@ _080563F4: .4byte _08056472 .4byte _08056472 _08056410: - ldr r2, =gUnknown_02024084 - ldr r0, =gUnknown_0202420C + ldr r2, =gBattleMons + ldr r0, =gEnemyMonIndex ldrb r1, [r0] movs r0, 0x58 muls r0, r1 @@ -60641,8 +60641,8 @@ _08056440: movs r4, 0x23 b _080564D2 _08056452: - ldr r2, =gUnknown_02024084 - ldr r0, =gUnknown_0202420C + ldr r2, =gBattleMons + ldr r0, =gEnemyMonIndex ldrb r1, [r0] movs r0, 0x58 muls r0, r1 @@ -60662,8 +60662,8 @@ _08056472: b _080564D2 .pool _08056480: - ldr r2, =gUnknown_02024084 - ldr r0, =gUnknown_0202420C + ldr r2, =gBattleMons + ldr r0, =gEnemyMonIndex ldrb r1, [r0] movs r0, 0x58 muls r0, r1 @@ -60704,8 +60704,8 @@ _080564D2: muls r0, r4 movs r1, 0xA bl __divsi3 - ldr r5, =gUnknown_02024084 - ldr r1, =gUnknown_0202420C + ldr r5, =gBattleMons + ldr r1, =gEnemyMonIndex ldrb r2, [r1] movs r1, 0x58 adds r4, r2, 0 @@ -60776,14 +60776,14 @@ _08056564: ldr r0, =gUnknown_082DBD84 str r0, [r1] ldr r1, =gUnknown_0202406E - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldr r2, =gUnknown_02024208 movs r1, 0x26 @@ -60820,7 +60820,7 @@ _080565F4: _080565FA: cmp r4, 0x3 bhi _0805660A - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 cmp r0, r6 @@ -60844,14 +60844,14 @@ _08056614: ldr r0, =gUnknown_082DBD84 str r0, [r1] ldr r1, =gUnknown_0202406E - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x26 adds r2, r5, 0 @@ -60905,7 +60905,7 @@ atkF0_catch_pokemon: @ 80566A8 ldrh r0, [r0] movs r7, 0x64 muls r0, r7 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty mov r8, r1 add r0, r8 bl pokemon_catch @@ -60919,7 +60919,7 @@ atkF0_catch_pokemon: @ 80566A8 bne _08056734 ldr r0, =gUnknown_02024332 strb r1, [r0, 0x5] - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 ldr r0, =0x00004036 bl VarGet lsls r0, 24 @@ -60927,7 +60927,7 @@ atkF0_catch_pokemon: @ 80566A8 bl sav3_get_box_name adds r1, r0, 0 adds r0, r4, 0 - bl CopyString + bl StringCopy ldrb r0, [r5] eors r0, r6 lsls r0, 1 @@ -60935,13 +60935,13 @@ atkF0_catch_pokemon: @ 80566A8 ldrh r0, [r0] muls r0, r7 add r0, r8 - ldr r2, =gUnknown_02021DC4 + ldr r2, =gStringVar2 movs r1, 0x2 - bl pokemon_getattr + bl GetMonData b _0805677E .pool _08056734: - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 ldr r0, =0x00004036 bl VarGet lsls r0, 24 @@ -60949,7 +60949,7 @@ _08056734: bl sav3_get_box_name adds r1, r0, 0 adds r0, r4, 0 - bl CopyString + bl StringCopy ldrb r0, [r5] eors r0, r6 lsls r0, 1 @@ -60957,17 +60957,17 @@ _08056734: ldrh r0, [r0] muls r0, r7 add r0, r8 - ldr r2, =gUnknown_02021DC4 + ldr r2, =gStringVar2 movs r1, 0x2 - bl pokemon_getattr - ldr r4, =gUnknown_02021EC4 + bl GetMonData + ldr r4, =gStringVar3 bl get_unknown_box_id lsls r0, 24 lsrs r0, 24 bl sav3_get_box_name adds r1, r0, 0 adds r0, r4, 0 - bl CopyString + bl StringCopy ldr r1, =gUnknown_02024332 movs r0, 0x2 strb r0, [r1, 0x5] @@ -60997,11 +60997,11 @@ _08056792: mov r1, r8 muls r1, r0 adds r0, r1, 0 - ldr r6, =gUnknown_02024744 + ldr r6, =gEnemyParty adds r0, r6 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r5, =gUnknown_03005D10 strh r0, [r5, 0x28] mov r1, r9 @@ -61017,7 +61017,7 @@ _08056792: adds r2, r5, 0 adds r2, 0x2A movs r1, 0x2 - bl pokemon_getattr + bl GetMonData mov r1, r9 ldrb r0, [r1] eors r4, r0 @@ -61030,7 +61030,7 @@ _08056792: adds r0, r6 movs r1, 0x26 movs r2, 0 - bl pokemon_getattr + bl GetMonData movs r1, 0xF ands r0, r1 lsls r0, 2 @@ -61057,17 +61057,17 @@ _08056792: thumb_func_start atkF1_802D95C atkF1_802D95C: @ 8056850 push {r4,r5,lr} - ldr r4, =gUnknown_02024744 + ldr r4, =gEnemyParty adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r5, r0, 16 adds r0, r4, 0 movs r1, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 adds r0, r5, 0 bl SpeciesToNationalPokedexNum @@ -61116,10 +61116,10 @@ _080568C2: sub_80568CC: @ 80568CC push {r4,lr} sub sp, 0x4 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 ldr r0, =gUnknown_02024332 @@ -61165,8 +61165,8 @@ _08056938: bl SpeciesToNationalPokedexNum lsls r0, 16 lsrs r0, 16 - ldr r3, =gUnknown_02024084 - ldr r1, =gUnknown_0202420C + ldr r3, =gBattleMons + ldr r1, =gEnemyMonIndex ldrb r2, [r1] movs r1, 0x58 muls r2, r1 @@ -61189,7 +61189,7 @@ _08056978: ands r0, r1 cmp r0, 0 bne _08056A2C - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, [r0, 0x4] ldr r0, =sub_8038420 cmp r1, r0 @@ -61533,7 +61533,7 @@ _08056C2C: b _08056E62 .pool _08056C60: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 @@ -61550,7 +61550,7 @@ _08056C60: strb r0, [r4, 0x1] bl sub_8056B74 _08056C86: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x80 ands r0, r1 @@ -61568,7 +61568,7 @@ _08056C86: strb r0, [r4, 0x1] bl sub_8056B74 _08056CAE: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -61625,14 +61625,14 @@ _08056D0A: mov r2, r9 muls r2, r0 adds r0, r2, 0 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty mov r8, r1 add r0, r8 ldr r1, =gUnknown_0202449C ldr r2, [r1] adds r2, 0x6D movs r1, 0x2 - bl pokemon_getattr + bl GetMonData bl FreeAllWindowBuffers mov r2, r10 ldrb r0, [r2] @@ -61645,7 +61645,7 @@ _08056D0A: adds r0, r1, 0 add r0, r8 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r6, r0, 0 lsls r6, 16 lsrs r6, 16 @@ -61675,7 +61675,7 @@ _08056D0A: add r0, r8 movs r1, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r2, =gUnknown_0202449C ldr r1, [r2] adds r1, 0x6D @@ -61693,7 +61693,7 @@ _08056D0A: b _08056E62 .pool _08056DD4: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, [r0, 0x4] ldr r0, =sub_8038420 cmp r1, r0 @@ -61714,7 +61714,7 @@ _08056DD4: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldr r1, =gUnknown_0202449C ldr r2, [r1] @@ -61763,13 +61763,13 @@ _08056E62: thumb_func_start sub_8056E78 sub_8056E78: @ 8056E78 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 muls r1, r0 adds r1, r2 - ldr r0, =gUnknown_020241F0 + ldr r0, =gBattleMoveDamage ldr r2, [r0] ldrh r0, [r1, 0x28] subs r0, r2 @@ -61784,7 +61784,7 @@ sub_8056E78: @ 8056E78 thumb_func_start atkF5_reset_attacker_bd_x4C atkF5_reset_attacker_bd_x4C: @ 8056EA8 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -61849,7 +61849,7 @@ sub_8056EF8: @ 8056EF8 sub_8056F28: @ 8056F28 push {r4-r6,lr} ldr r5, =gUnknown_020244A8 - ldr r6, =gUnknown_02022FEC + ldr r6, =gBattleTypeFlags ldr r0, [r6] movs r1, 0x80 lsls r1, 19 @@ -61927,7 +61927,7 @@ _08056F3E: bl VarGet lsls r0, 16 lsrs r0, 16 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr lsls r1, r0, 2 adds r1, r0 lsls r1, 5 @@ -61946,7 +61946,7 @@ _08056FFA: thumb_func_start sub_8057028 sub_8057028: @ 8057028 push {r4-r6,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 19 @@ -62027,7 +62027,7 @@ sub_80570F4: @ 80570F4 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -62041,7 +62041,7 @@ sub_80570F4: @ 80570F4 bl battle_get_side_with_given_state lsls r0, 24 lsrs r3, r0, 24 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r0, 0x58 adds r1, r3, 0 muls r1, r0 @@ -62063,7 +62063,7 @@ _08057140: lsls r0, 24 lsrs r4, r0, 24 _0805714A: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r1, 0x58 adds r0, r4, 0 muls r0, r1 @@ -62089,7 +62089,7 @@ _0805714A: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x8 bl happiness_algorithm @@ -62102,7 +62102,7 @@ _08057198: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x6 bl happiness_algorithm @@ -62115,7 +62115,7 @@ _080571B8: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x6 bl happiness_algorithm @@ -62224,7 +62224,7 @@ _08057294: beq _0805729A b _080573FC _0805729A: - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons movs r0, 0x58 mov r5, r9 muls r5, r0 @@ -62287,7 +62287,7 @@ _0805731E: subs r0, r1, r2 str r0, [r4] _08057322: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r0, 0x58 mov r1, r9 muls r1, r0 @@ -62330,7 +62330,7 @@ _08057372: b _080573FC .pool _08057390: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r2, r9 muls r2, r0 @@ -62342,7 +62342,7 @@ _08057390: ands r0, r1 cmp r0, 0 beq _080573F4 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x5 @@ -62451,7 +62451,7 @@ dp01_tbl1_exec_completed: @ 805748C adds r0, r1 ldr r1, =bx_exec_buffer_A_ch0_tbl1 str r1, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -62474,7 +62474,7 @@ dp01_tbl1_exec_completed: @ 805748C .pool _080574E0: ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r1 @@ -62494,7 +62494,7 @@ _080574F2: bx_exec_buffer_A_ch0_tbl1: @ 8057504 push {lr} ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r3, [r0] lsls r0, r3, 2 @@ -62573,13 +62573,13 @@ sub_8057588: @ 8057588 movs r2, 0x7 movs r3, 0x1 bl dp11b_obj_instanciate - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x30] movs r0, 0xF0 ands r0, r1 cmp r0, 0 beq _080575EC - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0x2 @@ -62594,7 +62594,7 @@ _080575EC: movs r0, 0 _080575F0: strb r0, [r1] - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r2, [r0, 0x2E] movs r3, 0x1 adds r0, r3, 0 @@ -62757,7 +62757,7 @@ _0805774C: cmp r0, 0x3B bls _080577DC _0805775A: - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags ldr r0, [r4] ands r0, r3 cmp r0, 0 @@ -62773,7 +62773,7 @@ _0805775A: bl battle_get_side_with_given_state ldr r1, =gUnknown_02024210 ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, 24 lsrs r0, 22 adds r0, r2 @@ -62879,13 +62879,13 @@ _0805785C: cmp r4, r0 blt _0805784A _08057866: - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2C] movs r0, 0xF0 ands r0, r1 cmp r0, 0 beq _0805789C - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0x2 @@ -63074,13 +63074,13 @@ _08057A32: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_020244B0 adds r2, r1 ldrb r1, [r2] adds r1, 0xD - bl pokemon_getattr + bl GetMonData ldr r2, =gBattleMoves lsls r1, r0, 1 adds r1, r0 @@ -63096,7 +63096,7 @@ _08057A6E: _08057A70: ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r0, [r5] lsls r0, 2 adds r0, r2 @@ -63202,13 +63202,13 @@ _08057B56: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_020244B0 adds r2, r1 ldrb r1, [r2] adds r1, 0xD - bl pokemon_getattr + bl GetMonData ldr r2, =gBattleMoves lsls r1, r0, 1 adds r1, r0 @@ -63224,7 +63224,7 @@ _08057B92: _08057B94: ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r0, [r5] lsls r0, 2 adds r0, r2 @@ -63270,14 +63270,14 @@ sub_8057BFC: @ 8057BFC lsls r0, 9 ldr r1, =gUnknown_02023068 adds r6, r0, r1 - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2C] movs r0, 0xF0 ands r0, r1 adds r7, r3, 0 cmp r0, 0 beq _08057C44 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0x2 @@ -63450,7 +63450,7 @@ _08057DA8: bl battle_get_side_with_given_state ldr r1, =gUnknown_02024210 ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, 24 lsrs r0, 22 adds r0, r2 @@ -63628,7 +63628,7 @@ _08057F30: ldrb r0, [r0] cmp r0, 0x1 bls _08057F9E - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r5, [r0] ands r5, r6 cmp r5, 0 @@ -63681,7 +63681,7 @@ _08057F9E: sub_8057FBC: @ 8057FBC push {r4-r7,lr} movs r7, 0 - ldr r4, =gUnknown_030022C0 + ldr r4, =gMain ldrh r1, [r4, 0x2E] movs r6, 0x1 adds r0, r6, 0 @@ -63739,7 +63739,7 @@ _08057FF8: movs r1, 0 bl battle_menu_cursor_related_2 _08058038: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x10 ands r0, r1 @@ -63776,7 +63776,7 @@ _08058038: movs r1, 0 bl battle_menu_cursor_related_2 _08058086: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 @@ -63807,7 +63807,7 @@ _08058086: movs r1, 0 bl battle_menu_cursor_related_2 _080580C8: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x80 ands r0, r1 @@ -63859,7 +63859,7 @@ sub_8058138: @ 8058138 mov r5, r8 push {r5-r7} sub sp, 0x24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x5 ands r0, r1 @@ -63939,7 +63939,7 @@ _08058170: ldrb r4, [r6, 0x18] lsls r3, r4, 24 lsrs r2, r3, 28 - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable mov r12, r0 add r1, r10 ldrb r0, [r1] @@ -63982,7 +63982,7 @@ _0805822A: mov r5, sp adds r5, 0x18 str r5, [sp, 0x1C] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons mov r0, r8 ldrb r1, [r0] movs r0, 0x58 @@ -64109,7 +64109,7 @@ _0805831A: mov r9, r5 mov r8, r2 movs r7, 0x64 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r4, r1, 0 _08058332: mov r1, r8 @@ -64121,7 +64121,7 @@ _08058332: adds r0, r5 adds r1, r6, 0 adds r1, 0xD - bl pokemon_getattr + bl GetMonData strh r0, [r4] mov r2, r8 ldrb r0, [r2] @@ -64132,7 +64132,7 @@ _08058332: adds r0, r5 adds r1, r6, 0 adds r1, 0x11 - bl pokemon_getattr + bl GetMonData mov r3, r10 adds r1, r3, r6 strb r0, [r1] @@ -64148,10 +64148,10 @@ _08058332: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData ldr r5, [sp, 0x1C] strb r0, [r5] movs r6, 0 @@ -64247,7 +64247,7 @@ _0805841E: mov r9, r0 movs r1, 0x64 mov r8, r1 - ldr r7, =gUnknown_020244EC + ldr r7, =gPlayerParty ldr r5, [sp, 0x20] adds r5, 0x8 ldr r4, [sp, 0x20] @@ -64291,7 +64291,7 @@ _0805844A: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x15 ldr r2, [sp, 0x1C] @@ -64531,7 +64531,7 @@ _080586E8: thumb_func_start sub_80586F8 sub_80586F8: @ 80586F8 push {lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _0805875C @@ -64541,7 +64541,7 @@ sub_80586F8: @ 80586F8 bne _08058798 movs r0, 0x5A bl m4aSongNumStop - ldr r3, =gUnknown_030022C0 + ldr r3, =gMain ldr r0, =0x00000439 adds r2, r3, r0 ldrb r1, [r2] @@ -64570,7 +64570,7 @@ _0805875C: beq _08058798 movs r0, 0x5A bl m4aSongNumStop - ldr r3, =gUnknown_030022C0 + ldr r3, =gMain ldr r0, =0x00000439 adds r2, r3, r0 ldrb r1, [r2] @@ -64605,7 +64605,7 @@ sub_80587B0: @ 80587B0 ands r0, r1 cmp r0, 0 bne _08058832 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -64615,7 +64615,7 @@ sub_80587B0: @ 80587B0 lsls r0, 24 cmp r0, 0 beq _08058832 - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _080587F0 @@ -64637,7 +64637,7 @@ _080587F4: _08058810: movs r0, 0x5A bl m4aSongNumStop - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldr r0, =0x00000439 adds r3, r2, r0 ldrb r1, [r3] @@ -64725,7 +64725,7 @@ bx_802F7A0: @ 80588B4 ldr r0, =DummyObjectCallback cmp r1, r0 bne _08058908 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] bl nullsub_25 @@ -64805,7 +64805,7 @@ sub_805896C: @ 805896C lsls r0, 24 cmp r0, 0 beq _080589D0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -64950,7 +64950,7 @@ _08058A0E: ldrh r0, [r0] movs r5, 0x64 muls r0, r5 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 bl sub_805E990 bl battle_type_is_double @@ -65025,7 +65025,7 @@ sub_8058B40: @ 8058B40 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @@ -65050,7 +65050,7 @@ _08058B80: ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @@ -65088,7 +65088,7 @@ _08058BB2: lsls r0, 24 cmp r0, 0 beq _08058C38 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -65106,7 +65106,7 @@ _08058BB2: ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @@ -65130,7 +65130,7 @@ _08058C38: ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @@ -65196,7 +65196,7 @@ _08058C82: ands r0, r1 cmp r0, 0 bne _08058D14 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x42 ands r0, r1 @@ -65237,7 +65237,7 @@ _08058D32: lsls r0, 24 cmp r0, 0 beq _08058DAC - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -65331,7 +65331,7 @@ _08058E0A: lsls r0, 24 cmp r0, 0 beq _08058E48 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -65540,7 +65540,7 @@ sub_8058FC0: @ 8058FC0 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 bl sub_805E990 bl dp01_tbl1_exec_completed @@ -65573,7 +65573,7 @@ sub_805902C: @ 805902C ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @@ -65616,7 +65616,7 @@ _0805905E: ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @@ -65701,7 +65701,7 @@ _08059178: ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 bl sub_805E990 bl dp01_tbl1_exec_completed @@ -65766,23 +65766,23 @@ _080591FE: movs r0, 0x64 mov r1, r10 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r6, r1, r0 adds r0, r6, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 adds r0, r6, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r6, 0 movs r1, 0x19 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x4] ldr r3, =gExperienceTables adds r4, 0x1 @@ -65923,23 +65923,23 @@ sub_8059330: @ 8059330 movs r0, 0x64 adds r6, r1, 0 muls r6, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r6, r0 adds r0, r6, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r6, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 adds r0, r6, 0 movs r1, 0x19 - bl pokemon_getattr + bl GetMonData adds r3, r0, 0 ldr r6, =gExperienceTables lsls r1, r4, 2 @@ -66040,21 +66040,21 @@ _08059430: movs r0, 0x64 mov r1, r9 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r1, r0 adds r0, r5, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 movs r1, 0x19 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x4] adds r0, r5, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 ldr r3, =gExperienceTables @@ -66202,11 +66202,11 @@ sub_80595A4: @ 80595A4 movs r0, 0x64 adds r1, r4, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r7, r1, r0 adds r0, r7, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData bl battle_type_is_double lsls r0, 24 lsrs r0, 24 @@ -66235,7 +66235,7 @@ _08059624: ldrb r0, [r0] movs r1, 0x64 muls r1, r4 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @@ -66268,10 +66268,10 @@ sub_805965C: @ 805965C ldrb r1, [r4, 0x8] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData ldrb r0, [r4, 0xC] ldr r1, =gUnknown_03005D60 lsls r0, 2 @@ -66312,10 +66312,10 @@ sub_80596A8: @ 80596A8 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 bl nullsub_24 @@ -66452,7 +66452,7 @@ _0805980A: thumb_func_start sub_8059828 sub_8059828: @ 8059828 push {lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, [r0, 0x4] ldr r0, =sub_8038420 cmp r1, r0 @@ -66528,7 +66528,7 @@ _080598CC: thumb_func_start sub_80598E0 sub_80598E0: @ 80598E0 push {lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, [r0, 0x4] ldr r0, =sub_8038420 cmp r1, r0 @@ -66643,7 +66643,7 @@ _080599CE: sub_80599D4: @ 80599D4 push {r4,lr} sub sp, 0x4 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 @@ -66662,7 +66662,7 @@ sub_80599D4: @ 80599D4 movs r0, 0 bl sub_8056B74 _08059A02: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x80 ands r0, r1 @@ -66681,7 +66681,7 @@ _08059A02: movs r0, 0x1 bl sub_8056B74 _08059A2C: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r2, 0x1 adds r0, r2, 0 @@ -66714,7 +66714,7 @@ _08059A6C: _08059A76: bl dp01_tbl1_exec_completed _08059A7A: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -66762,7 +66762,7 @@ _08059AC4: ldr r0, =gMoveNames adds r1, r0 adds r0, r7, 0 - bl CopyString + bl StringCopy adds r1, r5, 0x3 lsls r1, 24 lsrs r1, 24 @@ -66791,7 +66791,7 @@ sub_8059B18: @ 8059B18 ldr r4, =gUnknown_02022E2C ldr r1, =gUnknown_085CCA6F adds r0, r4, 0 - bl CopyString + bl StringCopy adds r0, r4, 0 movs r1, 0x7 bl battle_show_message_maybe @@ -66829,7 +66829,7 @@ sub_8059B3C: @ 8059B3C adds r0, r6, 0 movs r2, 0x1 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r1, 0xBA strb r1, [r0] adds r0, 0x1 @@ -66841,7 +66841,7 @@ sub_8059B3C: @ 8059B3C ldrb r1, [r4] movs r2, 0x1 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r0, r6, 0 movs r1, 0x9 bl battle_show_message_maybe @@ -66863,7 +66863,7 @@ sub_8059BB0: @ 8059BB0 ldr r6, =gUnknown_02022E2C ldr r1, =gUnknown_085CCA73 adds r0, r6, 0 - bl CopyString + bl StringCopy movs r1, 0xFC strb r1, [r0] adds r0, 0x1 @@ -66890,7 +66890,7 @@ sub_8059BB0: @ 8059BB0 subs r1, r2 ldr r2, =gTypeNames adds r1, r2 - bl CopyString + bl StringCopy adds r0, r6, 0 movs r1, 0xA bl battle_show_message_maybe @@ -67117,7 +67117,7 @@ _08059DB2: thumb_func_start b_link_standby_message b_link_standby_message: @ 8059DC0 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -67287,16 +67287,16 @@ _08059F98: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1] adds r0, r4, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x2E] movs r6, 0 @@ -67324,12 +67324,12 @@ _08059FE4: adds r1, r6, 0 adds r1, 0xD mov r0, r8 - bl pokemon_getattr + bl GetMonData strh r0, [r4] adds r1, r6, 0 adds r1, 0x11 mov r0, r8 - bl pokemon_getattr + bl GetMonData mov r2, r9 adds r1, r2, r6 strb r0, [r1] @@ -67340,25 +67340,25 @@ _08059FE4: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData mov r1, r10 strb r0, [r1] adds r0, r4, 0 movs r1, 0x20 - bl pokemon_getattr + bl GetMonData ldr r2, [sp, 0x80] strb r0, [r2] adds r0, r4, 0 movs r1, 0x19 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x44] adds r0, r4, 0 movs r1, 0x27 - bl pokemon_getattr + bl GetMonData mov r3, sp movs r5, 0x1F ands r0, r5 @@ -67370,7 +67370,7 @@ _08059FE4: strb r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x28 - bl pokemon_getattr + bl GetMonData mov r3, sp movs r6, 0x1F ands r0, r6 @@ -67382,7 +67382,7 @@ _08059FE4: strh r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x29 - bl pokemon_getattr + bl GetMonData mov r3, sp ands r0, r5 lsls r0, 2 @@ -67394,7 +67394,7 @@ _08059FE4: strb r1, [r3, 0x15] adds r0, r4, 0 movs r1, 0x2A - bl pokemon_getattr + bl GetMonData movs r1, 0x1F ands r1, r0 lsls r1, 15 @@ -67405,7 +67405,7 @@ _08059FE4: str r0, [sp, 0x14] adds r0, r4, 0 movs r1, 0x2B - bl pokemon_getattr + bl GetMonData mov r3, sp ands r0, r6 lsls r0, 4 @@ -67416,7 +67416,7 @@ _08059FE4: strh r1, [r3, 0x16] adds r0, r4, 0 movs r1, 0x2C - bl pokemon_getattr + bl GetMonData mov r3, sp ands r0, r5 lsls r0, 1 @@ -67428,55 +67428,55 @@ _08059FE4: strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x48] adds r0, r4, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x4C] adds r0, r4, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData ldr r1, [sp, 0x7C] strb r0, [r1] adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x28] adds r0, r4, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x2C] adds r0, r4, 0 movs r1, 0x3B - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x2] adds r0, r4, 0 movs r1, 0x3C - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x4] adds r0, r4, 0 movs r1, 0x3D - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x6] adds r0, r4, 0 movs r1, 0x3E - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x8] adds r0, r4, 0 movs r1, 0x3F - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0xA] adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData mov r3, sp movs r1, 0x1 ands r0, r1 @@ -67489,7 +67489,7 @@ _08059FE4: strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x2E - bl pokemon_getattr + bl GetMonData mov r3, sp lsls r0, 7 ldrb r2, [r3, 0x17] @@ -67499,19 +67499,19 @@ _08059FE4: strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x54] adds r0, r4, 0 movs r1, 0x2 ldr r2, [sp, 0x8C] - bl pokemon_getattr + bl GetMonData ldr r0, [sp, 0x84] ldr r1, [sp, 0x8C] - bl CopyString_Limit10 + bl StringCopy10 adds r0, r4, 0 movs r1, 0x7 ldr r2, [sp, 0x88] - bl pokemon_getattr + bl GetMonData mov r2, sp movs r6, 0 _0805A19C: @@ -67527,7 +67527,7 @@ _0805A19C: _0805A1BC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB b _0805A536 @@ -67535,7 +67535,7 @@ _0805A1BC: _0805A1CC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xC b _0805A536 @@ -67549,20 +67549,20 @@ _0805A1DC: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 mov r8, r9 _0805A1F2: adds r1, r6, 0 adds r1, 0xD adds r0, r4, 0 - bl pokemon_getattr + bl GetMonData mov r1, r8 strh r0, [r1] adds r1, r6, 0 adds r1, 0x11 adds r0, r4, 0 - bl pokemon_getattr + bl GetMonData mov r2, r10 adds r1, r2, r6 strb r0, [r1] @@ -67573,10 +67573,10 @@ _0805A1F2: ble _0805A1F2 movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData mov r1, r9 strb r0, [r1, 0xC] mov r2, r9 @@ -67594,7 +67594,7 @@ _0805A230: _0805A244: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldrb r1, [r3] lsls r1, 9 @@ -67609,14 +67609,14 @@ _0805A260: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty mov r8, r2 _0805A26C: adds r1, r6, 0 adds r1, 0x11 mov r2, r8 adds r0, r4, r2 - bl pokemon_getattr + bl GetMonData adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 @@ -67624,10 +67624,10 @@ _0805A26C: ble _0805A26C movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 @@ -67636,7 +67636,7 @@ _0805A26C: _0805A29C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldrb r1, [r3] lsls r1, 9 @@ -67649,7 +67649,7 @@ _0805A29C: _0805A2B8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1 b _0805A2D2 @@ -67657,11 +67657,11 @@ _0805A2B8: _0805A2C8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x19 _0805A2D2: - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 strb r1, [r7] movs r0, 0xFF @@ -67680,7 +67680,7 @@ _0805A2D2: _0805A2F8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1A b _0805A5F6 @@ -67688,7 +67688,7 @@ _0805A2F8: _0805A308: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1B b _0805A5F6 @@ -67696,7 +67696,7 @@ _0805A308: _0805A318: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1C b _0805A5F6 @@ -67704,7 +67704,7 @@ _0805A318: _0805A328: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1D b _0805A5F6 @@ -67712,7 +67712,7 @@ _0805A328: _0805A338: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1E b _0805A5F6 @@ -67720,7 +67720,7 @@ _0805A338: _0805A348: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1F b _0805A5F6 @@ -67728,7 +67728,7 @@ _0805A348: _0805A358: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x20 b _0805A5F6 @@ -67736,7 +67736,7 @@ _0805A358: _0805A368: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x22 b _0805A5F6 @@ -67744,7 +67744,7 @@ _0805A368: _0805A378: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x23 b _0805A5F6 @@ -67752,7 +67752,7 @@ _0805A378: _0805A388: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x24 b _0805A5F6 @@ -67760,7 +67760,7 @@ _0805A388: _0805A398: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x25 b _0805A5F6 @@ -67768,7 +67768,7 @@ _0805A398: _0805A3A8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x26 b _0805A5F6 @@ -67777,31 +67777,31 @@ _0805A3B8: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x27 - bl pokemon_getattr + bl GetMonData strb r0, [r7] adds r0, r4, 0 movs r1, 0x28 - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x1] adds r0, r4, 0 movs r1, 0x29 - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x2] adds r0, r4, 0 movs r1, 0x2A - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x3] adds r0, r4, 0 movs r1, 0x2B - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x4] adds r0, r4, 0 movs r1, 0x2C - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x5] movs r6, 0x6 b _0805A5FE @@ -67809,7 +67809,7 @@ _0805A3B8: _0805A408: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x27 b _0805A5F6 @@ -67817,7 +67817,7 @@ _0805A408: _0805A418: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x28 b _0805A5F6 @@ -67825,7 +67825,7 @@ _0805A418: _0805A428: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x29 b _0805A5F6 @@ -67833,7 +67833,7 @@ _0805A428: _0805A438: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2A b _0805A5F6 @@ -67841,7 +67841,7 @@ _0805A438: _0805A448: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2B b _0805A5F6 @@ -67849,7 +67849,7 @@ _0805A448: _0805A458: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2C b _0805A5F6 @@ -67857,7 +67857,7 @@ _0805A458: _0805A468: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0 b _0805A492 @@ -67865,7 +67865,7 @@ _0805A468: _0805A478: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x9 b _0805A536 @@ -67873,11 +67873,11 @@ _0805A478: _0805A488: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x37 _0805A492: - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 strb r1, [r7] movs r0, 0xFF @@ -67898,7 +67898,7 @@ _0805A492: _0805A4BC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x38 b _0805A5F6 @@ -67906,7 +67906,7 @@ _0805A4BC: _0805A4CC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x39 b _0805A536 @@ -67914,7 +67914,7 @@ _0805A4CC: _0805A4DC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3A b _0805A536 @@ -67922,7 +67922,7 @@ _0805A4DC: _0805A4EC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3B b _0805A536 @@ -67930,7 +67930,7 @@ _0805A4EC: _0805A4FC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3C b _0805A536 @@ -67938,7 +67938,7 @@ _0805A4FC: _0805A50C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3D b _0805A536 @@ -67946,7 +67946,7 @@ _0805A50C: _0805A51C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3E b _0805A536 @@ -67954,11 +67954,11 @@ _0805A51C: _0805A52C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3F _0805A536: - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 strb r0, [r7] @@ -67970,7 +67970,7 @@ _0805A536: _0805A54C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x16 b _0805A5F6 @@ -67978,7 +67978,7 @@ _0805A54C: _0805A55C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x17 b _0805A5F6 @@ -67986,7 +67986,7 @@ _0805A55C: _0805A56C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x18 b _0805A5F6 @@ -67994,7 +67994,7 @@ _0805A56C: _0805A57C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x21 b _0805A5F6 @@ -68002,7 +68002,7 @@ _0805A57C: _0805A58C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2F b _0805A5F6 @@ -68010,7 +68010,7 @@ _0805A58C: _0805A59C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x30 b _0805A5F6 @@ -68018,7 +68018,7 @@ _0805A59C: _0805A5AC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x32 b _0805A5F6 @@ -68026,7 +68026,7 @@ _0805A5AC: _0805A5BC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x33 b _0805A5F6 @@ -68034,7 +68034,7 @@ _0805A5BC: _0805A5CC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x34 b _0805A5F6 @@ -68042,7 +68042,7 @@ _0805A5CC: _0805A5DC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x35 b _0805A5F6 @@ -68050,11 +68050,11 @@ _0805A5DC: _0805A5EC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x36 _0805A5F6: - bl pokemon_getattr + bl GetMonData strb r0, [r7] movs r6, 0x1 _0805A5FE: @@ -68088,7 +68088,7 @@ sub_805A614: @ 805A614 adds r0, r3, 0x1 adds r0, r1, r0 ldrb r2, [r0] - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r0, r2, r0 adds r6, r4, r0 mov r0, sp @@ -68273,7 +68273,7 @@ _0805A828: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0xB @@ -68340,7 +68340,7 @@ _0805A88E: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x15 @@ -68453,7 +68453,7 @@ _0805A88E: _0805A9C0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68466,7 +68466,7 @@ _0805A9C0: _0805A9E0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68485,7 +68485,7 @@ _0805AA00: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r7, r1, r0 adds r6, r3, 0 adds r6, 0x8 @@ -68510,7 +68510,7 @@ _0805AA1A: ble _0805AA1A movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x15 mov r2, r9 @@ -68520,7 +68520,7 @@ _0805AA1A: _0805AA58: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r3, =gUnknown_02023064 ldr r1, =gUnknown_02024064 @@ -68536,7 +68536,7 @@ _0805AA80: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 ldr r5, =gUnknown_02024064 ldrb r2, [r5] @@ -68578,7 +68578,7 @@ _0805AA80: _0805AAE4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r3, =gUnknown_02023064 ldr r1, =gUnknown_02024064 @@ -68597,7 +68597,7 @@ _0805AAFC: _0805AB14: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68610,7 +68610,7 @@ _0805AB14: _0805AB34: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68623,7 +68623,7 @@ _0805AB34: _0805AB54: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68636,7 +68636,7 @@ _0805AB54: _0805AB74: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68649,7 +68649,7 @@ _0805AB74: _0805AB94: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68662,7 +68662,7 @@ _0805AB94: _0805ABB4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68675,7 +68675,7 @@ _0805ABB4: _0805ABD4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68688,7 +68688,7 @@ _0805ABD4: _0805ABF4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68701,7 +68701,7 @@ _0805ABF4: _0805AC14: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68714,7 +68714,7 @@ _0805AC14: _0805AC34: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68727,7 +68727,7 @@ _0805AC34: _0805AC54: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68740,7 +68740,7 @@ _0805AC54: _0805AC74: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68753,7 +68753,7 @@ _0805AC74: _0805AC94: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68766,7 +68766,7 @@ _0805AC94: _0805ACB4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68780,7 +68780,7 @@ _0805ACD4: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 ldr r5, =gUnknown_02024064 ldrb r2, [r5] @@ -68827,7 +68827,7 @@ _0805ACD4: _0805AD44: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68840,7 +68840,7 @@ _0805AD44: _0805AD64: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68853,7 +68853,7 @@ _0805AD64: _0805AD84: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68866,7 +68866,7 @@ _0805AD84: _0805ADA4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68879,7 +68879,7 @@ _0805ADA4: _0805ADC4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68892,7 +68892,7 @@ _0805ADC4: _0805ADE4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68906,7 +68906,7 @@ _0805ADF4: _0805AE04: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68919,7 +68919,7 @@ _0805AE04: _0805AE24: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68932,7 +68932,7 @@ _0805AE24: _0805AE44: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68945,7 +68945,7 @@ _0805AE44: _0805AE64: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68958,7 +68958,7 @@ _0805AE64: _0805AE84: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68971,7 +68971,7 @@ _0805AE84: _0805AEA4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68984,7 +68984,7 @@ _0805AEA4: _0805AEC4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -68997,7 +68997,7 @@ _0805AEC4: _0805AEE4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -69010,7 +69010,7 @@ _0805AEE4: _0805AF04: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -69023,7 +69023,7 @@ _0805AF04: _0805AF24: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -69036,7 +69036,7 @@ _0805AF24: _0805AF44: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -69049,7 +69049,7 @@ _0805AF44: _0805AF64: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -69062,7 +69062,7 @@ _0805AF64: _0805AF84: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -69075,7 +69075,7 @@ _0805AF84: _0805AFA4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -69088,7 +69088,7 @@ _0805AFA4: _0805AFC4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -69101,7 +69101,7 @@ _0805AFC4: _0805AFE4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -69114,7 +69114,7 @@ _0805AFE4: _0805B004: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -69127,7 +69127,7 @@ _0805B004: _0805B024: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -69140,7 +69140,7 @@ _0805B024: _0805B044: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -69153,7 +69153,7 @@ _0805B044: _0805B064: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -69166,7 +69166,7 @@ _0805B064: _0805B084: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -69179,7 +69179,7 @@ _0805B084: _0805B0A4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -69196,7 +69196,7 @@ _0805B0BA: ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 bl sub_805E990 add sp, 0x34 @@ -69227,7 +69227,7 @@ sub_805B0F0: @ 805B0F0 adds r0, r4, 0x1 adds r0, r2, r0 ldrb r0, [r0] - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 adds r5, r3, r0 movs r3, 0 @@ -69276,7 +69276,7 @@ sub_805B164: @ 805B164 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 bl sub_805DD7C ldr r2, =gUnknown_02020630 @@ -69333,7 +69333,7 @@ sub_805B1CC: @ 805B1CC ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 bl sub_805DD7C ldr r1, =gUnknown_020244AC @@ -69387,16 +69387,16 @@ sub_805B258: @ 805B258 ldrh r1, [r2] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData mov r8, r0 lsls r0, 16 lsrs r0, 16 mov r8, r0 ldr r0, =sub_805D714 - bl object_new_hidden_with_callback + bl CreateInvisibleSpriteWithCallback ldr r1, =gUnknown_03005D7C mov r9, r1 add r9, r6 @@ -69659,7 +69659,7 @@ sub_805B4F0: @ 805B4F0 mov r7, r9 mov r6, r8 push {r6,r7} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -69747,11 +69747,11 @@ _0805B5A0: ldrb r4, [r1, 0x13] b _0805B5BA _0805B5B4: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r4, [r0, 0x8] _0805B5BA: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r2, 0x40 ands r1, r2 @@ -69798,7 +69798,7 @@ _0805B618: lsls r1, 15 adds r0, r1 lsrs r7, r0, 16 - ldr r5, =gUnknown_02022FEC + ldr r5, =gBattleTypeFlags b _0805B656 .pool _0805B63C: @@ -69832,7 +69832,7 @@ _0805B664: bne _0805B670 b _0805B794 _0805B670: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] bl sub_806F000 @@ -70041,7 +70041,7 @@ _0805B82A: thumb_func_start dp01t_08_1_8032428 dp01t_08_1_8032428: @ 805B864 push {r4-r6,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -70129,7 +70129,7 @@ _0805B90C: ldrb r4, [r1, 0x13] b _0805B926 _0805B920: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r4, [r0, 0x8] _0805B926: @@ -70355,7 +70355,7 @@ _0805BB0C: ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 bl sub_805E990 movs r1, 0x40 @@ -71061,7 +71061,7 @@ sub_805C158: @ 805C158 cmp r0, 0 bne _0805C194 ldr r1, =gUnknown_0203BD30 - ldr r0, =gUnknown_03005D80 + ldr r0, =gRngValue ldr r0, [r0] str r0, [r1] bl sub_805D19C @@ -71081,7 +71081,7 @@ _0805C194: thumb_func_start dp01t_14_5_move_menu_pokedude dp01t_14_5_move_menu_pokedude: @ 805C1A8 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 10 @@ -71197,7 +71197,7 @@ sub_805C2AC: @ 805C2AC ldr r1, =gUnknown_02023064 mov r8, r1 ldr r2, =gUnknown_02024064 - ldr r7, =gUnknown_02022FEC + ldr r7, =gBattleTypeFlags mov r6, r12 mov r5, r8 adds r4, r2, 0 @@ -71382,10 +71382,10 @@ _0805C44A: ldrh r0, [r0] movs r5, 0x64 muls r0, r5 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData mov r8, r0 mov r2, r9 ldrb r0, [r2] @@ -71395,7 +71395,7 @@ _0805C44A: muls r0, r5 adds r0, r4 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r3, r0, 0 mov r1, r9 ldrb r0, [r1] @@ -71416,10 +71416,10 @@ _0805C4B4: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData adds r2, r0, 0 mov r1, r9 ldrb r0, [r1] @@ -71467,11 +71467,11 @@ sub_805C528: @ 805C528 movs r0, 0x64 adds r1, r7, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData cmp r0, 0x63 bls _0805C560 bl dp01_tbl1_exec_completed @@ -71482,7 +71482,7 @@ _0805C560: bl load_gfxc_health_bar adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData ldrb r1, [r6] lsls r1, 9 adds r0, r5, 0x2 @@ -71539,7 +71539,7 @@ sub_805C5C4: @ 805C5C4 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 movs r2, 0x9 bl healthbar_draw_field_maybe @@ -71631,10 +71631,10 @@ sub_805C6A4: @ 805C6A4 ldrh r0, [r0] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData ldr r2, =gUnknown_02023064 ldrb r1, [r4] lsls r1, 9 @@ -72049,10 +72049,10 @@ sub_805CA0C: @ 805CA0C ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 movs r1, 0x19 @@ -72170,7 +72170,7 @@ dp01t_2F_1_pokemon_enter: @ 805CA80 adds r4, r0, 0 lsls r4, 24 ldr r1, =gTrainerBackPicPaletteTable - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] lsls r0, 3 @@ -72269,7 +72269,7 @@ sub_805CC00: @ 805CC00 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 adds r1, r4, 0 bl sub_805DD7C @@ -72322,7 +72322,7 @@ _0805CC94: lsls r0, 24 cmp r0, 0 beq _0805CCB4 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -72375,7 +72375,7 @@ _0805CCE4: ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 bl sub_805DD7C ldrb r0, [r7] @@ -72788,7 +72788,7 @@ sub_805D094: @ 805D094 adds r0, r1 ldrb r0, [r0] strb r0, [r2] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] ldrb r0, [r5] lsls r0, 9 @@ -72912,7 +72912,7 @@ sub_805D19C: @ 805D19C lsls r0, 24 lsrs r0, 24 mov r8, r0 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -72923,7 +72923,7 @@ sub_805D19C: @ 805D19C ldr r0, [r0] adds r0, 0x92 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r2 @@ -72985,7 +72985,7 @@ _0805D24A: ldrb r0, [r0] cmp r0, 0 beq _0805D26E - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable lsls r1, r4, 2 adds r1, r0 ldr r0, [r1] @@ -73016,7 +73016,7 @@ _0805D27C: strb r0, [r1] lsls r0, r6, 24 lsrs r0, 24 - bl sub_8130950 + bl BattleAI_SetupAIData bl sub_8130BA4 lsls r0, 24 lsrs r0, 24 @@ -73035,7 +73035,7 @@ _0805D2B6: _0805D2BE: movs r5, 0 movs r6, 0 - ldr r7, =gUnknown_0832A328 + ldr r7, =gBitTable mov r4, r10 _0805D2C6: ldrh r0, [r4] @@ -73080,7 +73080,7 @@ _0805D2F8: _0805D316: adds r7, 0x4 adds r4, 0x2 - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable adds r0, 0xC cmp r7, r0 ble _0805D2C6 @@ -73106,9 +73106,9 @@ _0805D33E: cmp r6, 0 bne _0805D388 _0805D346: - ldr r5, =gUnknown_0832A328 + ldr r5, =gBitTable _0805D348: - bl GenerateRandomNumber + bl Random lsls r0, 16 movs r1, 0xC0 lsls r1, 10 @@ -73142,13 +73142,13 @@ _0805D394: ble _0805D39A movs r6, 0x2 _0805D39A: - bl GenerateRandomNumber + bl Random lsls r0, 16 movs r1, 0xC0 lsls r1, 10 ands r1, r0 lsrs r4, r1, 16 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable lsls r0, r4, 2 adds r0, r1 ldr r0, [r0] @@ -73171,7 +73171,7 @@ _0805D3CC: cmp r9, r0 beq _0805D39A _0805D3D4: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -73389,7 +73389,7 @@ sub_805D5F4: @ 805D5F4 mov r7, r9 mov r6, r8 push {r6,r7} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -73420,7 +73420,7 @@ _0805D63E: bl battle_get_side_with_given_state lsls r0, 24 lsrs r7, r0, 24 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r2, 0x58 mov r0, r8 muls r0, r2 @@ -73432,7 +73432,7 @@ _0805D63E: ldrh r3, [r6, 0x28] cmp r0, r3 bne _0805D680 - bl GenerateRandomNumber + bl Random adds r3, r0, 0 ldr r0, =gUnknown_02024064 ldrb r1, [r0] @@ -73494,7 +73494,7 @@ _0805D6DA: lsls r0, r7, 8 b _0805D704 _0805D6DE: - bl GenerateRandomNumber + bl Random adds r3, r0, 0 mov r0, r9 ldrb r1, [r0] @@ -74159,7 +74159,7 @@ sub_805DC0C: @ 805DC0C lsrs r1, 24 mov r8, r1 movs r1, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp] ldr r0, =gUnknown_020244D0 ldr r0, [r0] @@ -74172,7 +74172,7 @@ sub_805DC0C: @ 805DC0C bne _0805DC50 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r5, r0, 16 ldr r6, [sp] @@ -74186,7 +74186,7 @@ _0805DC50: _0805DC58: adds r0, r4, 0 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData mov r10, r0 mov r0, r8 bl battle_get_per_side_status @@ -74312,7 +74312,7 @@ sub_805DD7C: @ 805DD7C lsrs r1, 24 mov r8, r1 movs r1, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp] ldr r0, =gUnknown_020244D0 ldr r0, [r0] @@ -74325,7 +74325,7 @@ sub_805DD7C: @ 805DD7C bne _0805DDC0 adds r0, r6, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r5, r0, 16 ldr r4, [sp] @@ -74339,7 +74339,7 @@ _0805DDC0: _0805DDC8: adds r0, r6, 0 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x4] mov r0, r8 bl battle_get_per_side_status @@ -74672,7 +74672,7 @@ _0805E0B8: bne _0805E120 cmp r4, 0x2 bne _0805E0F0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 ands r0, r1 @@ -74836,7 +74836,7 @@ _0805E228: strb r0, [r4] b _0805E346 _0805E230: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 ands r0, r1 @@ -74888,7 +74888,7 @@ _0805E29C: lsls r0, 24 cmp r0, 0 bne _0805E2E4 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 ands r0, r1 @@ -74904,7 +74904,7 @@ _0805E29C: ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @@ -74921,7 +74921,7 @@ _0805E2E4: ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @@ -75212,7 +75212,7 @@ _0805E558: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty b _0805E59C .pool _0805E58C: @@ -75223,11 +75223,11 @@ _0805E58C: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty _0805E59C: adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 mov r8, r0 @@ -75242,16 +75242,16 @@ _0805E59C: ldrh r0, [r4] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5 movs r1, 0 - bl pokemon_getattr + bl GetMonData mov r9, r0 ldrh r0, [r4] muls r0, r6 adds r0, r5 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 mov r1, r8 lsls r0, r1, 3 @@ -75280,16 +75280,16 @@ _0805E618: ldrh r0, [r4] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_02024744 + ldr r5, =gEnemyParty adds r0, r5 movs r1, 0 - bl pokemon_getattr + bl GetMonData mov r9, r0 ldrh r0, [r4] muls r0, r6 adds r0, r5 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 mov r1, r8 lsls r0, r1, 3 @@ -75552,7 +75552,7 @@ _0805E898: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 adds r1, r4, 0 bl sub_805DC0C @@ -75565,7 +75565,7 @@ _0805E8D0: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 adds r1, r5, 0 bl sub_805DD7C @@ -75667,13 +75667,13 @@ sub_805E990: @ 805E990 lsrs r6, r1, 24 adds r7, r6, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r4, 16 asrs r4, 16 @@ -75807,13 +75807,13 @@ sub_805EAB4: @ 805EAB4 push {r4,r5,lr} adds r5, r0, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r4, 16 asrs r4, 16 @@ -75834,7 +75834,7 @@ sub_805EAE8: @ 805EAE8 mov r7, r9 mov r6, r8 push {r6,r7} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -75871,11 +75871,11 @@ sub_805EAE8: @ 805EAE8 movs r7, 0x64 adds r0, r4, 0 muls r0, r7 - ldr r6, =gUnknown_020244EC + ldr r6, =gPlayerParty adds r4, r0, r6 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0805EB5A adds r0, r4, 0 @@ -75891,7 +75891,7 @@ _0805EB5A: adds r4, r0, r6 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0805EB7E adds r0, r4, 0 @@ -76599,20 +76599,20 @@ sub_805F110: @ 805F110 push {r4,r5,lr} adds r5, r0, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData ldr r1, =0x00000fff ands r1, r0 cmp r1, 0 bne _0805F158 adds r0, r5, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r4, 16 asrs r4, 16 @@ -76657,7 +76657,7 @@ sub_805F164: @ 805F164 bx_exec_buffer_A_ch0_tbl7: @ 805F180 push {lr} ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r3, [r0] lsls r0, r3, 2 @@ -76837,14 +76837,14 @@ sub_805F2F0: @ 805F2F0 lsls r0, 24 cmp r0, 0 beq _0805F31E - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 bne _0805F32C _0805F31E: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 8 @@ -77138,12 +77138,12 @@ sub_805F560: @ 805F560 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 _0805F5A6: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x00008040 ands r0, r1 @@ -77173,7 +77173,7 @@ _0805F5A6: ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r1, r0 adds r0, r3, 0 bl sub_8172EF0 @@ -77216,7 +77216,7 @@ _0805F5EE: lsls r0, 24 cmp r0, 0 beq _0805F684 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -77235,7 +77235,7 @@ _0805F5EE: ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @@ -77261,7 +77261,7 @@ _0805F684: ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @@ -77329,7 +77329,7 @@ _0805F6D0: ands r0, r1 cmp r0, 0 bne _0805F774 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x42 ands r0, r1 @@ -77376,7 +77376,7 @@ _0805F792: lsls r0, 24 cmp r0, 0 beq _0805F810 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -77471,7 +77471,7 @@ _0805F86E: lsls r0, 24 cmp r0, 0 beq _0805F8D2 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -77498,10 +77498,10 @@ _0805F86E: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -77526,10 +77526,10 @@ _0805F8D2: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -77619,7 +77619,7 @@ sub_805F994: @ 805F994 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r1, r0 adds r0, r3, 0 bl sub_8172EF0 @@ -78041,7 +78041,7 @@ sub_805FD00: @ 805FD00 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @@ -78088,7 +78088,7 @@ sub_805FDF0: @ 805FDF0 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @@ -78128,10 +78128,10 @@ _0805FE22: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -78209,7 +78209,7 @@ dp01_tbl7_exec_completed: @ 805FF18 adds r0, r1 ldr r1, =bx_exec_buffer_A_ch0_tbl7 str r1, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -78232,7 +78232,7 @@ dp01_tbl7_exec_completed: @ 805FF18 .pool _0805FF6C: ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r1 @@ -78398,16 +78398,16 @@ _08060134: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1] adds r0, r4, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x2E] movs r6, 0 @@ -78435,12 +78435,12 @@ _08060180: adds r1, r6, 0 adds r1, 0xD mov r0, r8 - bl pokemon_getattr + bl GetMonData strh r0, [r4] adds r1, r6, 0 adds r1, 0x11 mov r0, r8 - bl pokemon_getattr + bl GetMonData mov r2, r9 adds r1, r2, r6 strb r0, [r1] @@ -78451,25 +78451,25 @@ _08060180: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 adds r0, r4, 0 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData mov r1, r10 strb r0, [r1] adds r0, r4, 0 movs r1, 0x20 - bl pokemon_getattr + bl GetMonData ldr r2, [sp, 0x80] strb r0, [r2] adds r0, r4, 0 movs r1, 0x19 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x44] adds r0, r4, 0 movs r1, 0x27 - bl pokemon_getattr + bl GetMonData mov r3, sp movs r5, 0x1F ands r0, r5 @@ -78481,7 +78481,7 @@ _08060180: strb r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x28 - bl pokemon_getattr + bl GetMonData mov r3, sp movs r6, 0x1F ands r0, r6 @@ -78493,7 +78493,7 @@ _08060180: strh r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x29 - bl pokemon_getattr + bl GetMonData mov r3, sp ands r0, r5 lsls r0, 2 @@ -78505,7 +78505,7 @@ _08060180: strb r1, [r3, 0x15] adds r0, r4, 0 movs r1, 0x2A - bl pokemon_getattr + bl GetMonData movs r1, 0x1F ands r1, r0 lsls r1, 15 @@ -78516,7 +78516,7 @@ _08060180: str r0, [sp, 0x14] adds r0, r4, 0 movs r1, 0x2B - bl pokemon_getattr + bl GetMonData mov r3, sp ands r0, r6 lsls r0, 4 @@ -78527,7 +78527,7 @@ _08060180: strh r1, [r3, 0x16] adds r0, r4, 0 movs r1, 0x2C - bl pokemon_getattr + bl GetMonData mov r3, sp ands r0, r5 lsls r0, 1 @@ -78539,55 +78539,55 @@ _08060180: strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x48] adds r0, r4, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x4C] adds r0, r4, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData ldr r1, [sp, 0x7C] strb r0, [r1] adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x28] adds r0, r4, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x2C] adds r0, r4, 0 movs r1, 0x3B - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x2] adds r0, r4, 0 movs r1, 0x3C - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x4] adds r0, r4, 0 movs r1, 0x3D - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x6] adds r0, r4, 0 movs r1, 0x3E - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x8] adds r0, r4, 0 movs r1, 0x3F - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0xA] adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData mov r3, sp movs r1, 0x1 ands r0, r1 @@ -78600,7 +78600,7 @@ _08060180: strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x2E - bl pokemon_getattr + bl GetMonData mov r3, sp lsls r0, 7 ldrb r2, [r3, 0x17] @@ -78610,19 +78610,19 @@ _08060180: strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x54] adds r0, r4, 0 movs r1, 0x2 ldr r2, [sp, 0x8C] - bl pokemon_getattr + bl GetMonData ldr r0, [sp, 0x84] ldr r1, [sp, 0x8C] - bl CopyString_Limit10 + bl StringCopy10 adds r0, r4, 0 movs r1, 0x7 ldr r2, [sp, 0x88] - bl pokemon_getattr + bl GetMonData mov r2, sp movs r6, 0 _08060338: @@ -78638,7 +78638,7 @@ _08060338: _08060358: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xB b _080606D2 @@ -78646,7 +78646,7 @@ _08060358: _08060368: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xC b _080606D2 @@ -78660,20 +78660,20 @@ _08060378: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r1, r0 mov r8, r9 _0806038E: adds r1, r6, 0 adds r1, 0xD adds r0, r4, 0 - bl pokemon_getattr + bl GetMonData mov r1, r8 strh r0, [r1] adds r1, r6, 0 adds r1, 0x11 adds r0, r4, 0 - bl pokemon_getattr + bl GetMonData mov r2, r10 adds r1, r2, r6 strb r0, [r1] @@ -78684,10 +78684,10 @@ _0806038E: ble _0806038E movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData mov r1, r9 strb r0, [r1, 0xC] mov r2, r9 @@ -78705,7 +78705,7 @@ _080603CC: _080603E0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r1, [r3] lsls r1, 9 @@ -78720,14 +78720,14 @@ _080603FC: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty mov r8, r2 _08060408: adds r1, r6, 0 adds r1, 0x11 mov r2, r8 adds r0, r4, r2 - bl pokemon_getattr + bl GetMonData adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 @@ -78735,10 +78735,10 @@ _08060408: ble _08060408 movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 @@ -78747,7 +78747,7 @@ _08060408: _08060438: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r1, [r3] lsls r1, 9 @@ -78760,7 +78760,7 @@ _08060438: _08060454: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x1 b _0806046E @@ -78768,11 +78768,11 @@ _08060454: _08060464: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x19 _0806046E: - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 strb r1, [r7] movs r0, 0xFF @@ -78791,7 +78791,7 @@ _0806046E: _08060494: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x1A b _08060792 @@ -78799,7 +78799,7 @@ _08060494: _080604A4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x1B b _08060792 @@ -78807,7 +78807,7 @@ _080604A4: _080604B4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x1C b _08060792 @@ -78815,7 +78815,7 @@ _080604B4: _080604C4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x1D b _08060792 @@ -78823,7 +78823,7 @@ _080604C4: _080604D4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x1E b _08060792 @@ -78831,7 +78831,7 @@ _080604D4: _080604E4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x1F b _08060792 @@ -78839,7 +78839,7 @@ _080604E4: _080604F4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x20 b _08060792 @@ -78847,7 +78847,7 @@ _080604F4: _08060504: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x22 b _08060792 @@ -78855,7 +78855,7 @@ _08060504: _08060514: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x23 b _08060792 @@ -78863,7 +78863,7 @@ _08060514: _08060524: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x24 b _08060792 @@ -78871,7 +78871,7 @@ _08060524: _08060534: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x25 b _08060792 @@ -78879,7 +78879,7 @@ _08060534: _08060544: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x26 b _08060792 @@ -78888,31 +78888,31 @@ _08060554: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 adds r0, r4, 0 movs r1, 0x27 - bl pokemon_getattr + bl GetMonData strb r0, [r7] adds r0, r4, 0 movs r1, 0x28 - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x1] adds r0, r4, 0 movs r1, 0x29 - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x2] adds r0, r4, 0 movs r1, 0x2A - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x3] adds r0, r4, 0 movs r1, 0x2B - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x4] adds r0, r4, 0 movs r1, 0x2C - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x5] movs r6, 0x6 b _0806079A @@ -78920,7 +78920,7 @@ _08060554: _080605A4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x27 b _08060792 @@ -78928,7 +78928,7 @@ _080605A4: _080605B4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x28 b _08060792 @@ -78936,7 +78936,7 @@ _080605B4: _080605C4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x29 b _08060792 @@ -78944,7 +78944,7 @@ _080605C4: _080605D4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x2A b _08060792 @@ -78952,7 +78952,7 @@ _080605D4: _080605E4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x2B b _08060792 @@ -78960,7 +78960,7 @@ _080605E4: _080605F4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x2C b _08060792 @@ -78968,7 +78968,7 @@ _080605F4: _08060604: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0 b _0806062E @@ -78976,7 +78976,7 @@ _08060604: _08060614: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x9 b _080606D2 @@ -78984,11 +78984,11 @@ _08060614: _08060624: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x37 _0806062E: - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 strb r1, [r7] movs r0, 0xFF @@ -79009,7 +79009,7 @@ _0806062E: _08060658: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x38 b _08060792 @@ -79017,7 +79017,7 @@ _08060658: _08060668: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x39 b _080606D2 @@ -79025,7 +79025,7 @@ _08060668: _08060678: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x3A b _080606D2 @@ -79033,7 +79033,7 @@ _08060678: _08060688: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x3B b _080606D2 @@ -79041,7 +79041,7 @@ _08060688: _08060698: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x3C b _080606D2 @@ -79049,7 +79049,7 @@ _08060698: _080606A8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x3D b _080606D2 @@ -79057,7 +79057,7 @@ _080606A8: _080606B8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x3E b _080606D2 @@ -79065,11 +79065,11 @@ _080606B8: _080606C8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x3F _080606D2: - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 strb r0, [r7] @@ -79081,7 +79081,7 @@ _080606D2: _080606E8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x16 b _08060792 @@ -79089,7 +79089,7 @@ _080606E8: _080606F8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x17 b _08060792 @@ -79097,7 +79097,7 @@ _080606F8: _08060708: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x18 b _08060792 @@ -79105,7 +79105,7 @@ _08060708: _08060718: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x21 b _08060792 @@ -79113,7 +79113,7 @@ _08060718: _08060728: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x2F b _08060792 @@ -79121,7 +79121,7 @@ _08060728: _08060738: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x30 b _08060792 @@ -79129,7 +79129,7 @@ _08060738: _08060748: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x32 b _08060792 @@ -79137,7 +79137,7 @@ _08060748: _08060758: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x33 b _08060792 @@ -79145,7 +79145,7 @@ _08060758: _08060768: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x34 b _08060792 @@ -79153,7 +79153,7 @@ _08060768: _08060778: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x35 b _08060792 @@ -79161,11 +79161,11 @@ _08060778: _08060788: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x36 _08060792: - bl pokemon_getattr + bl GetMonData strb r0, [r7] movs r6, 0x1 _0806079A: @@ -79199,7 +79199,7 @@ dp01t_01_2_read_pokmon_data_slice: @ 80607B0 adds r0, r3, 0x1 adds r0, r1, r0 ldrb r2, [r0] - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r0, r2, r0 adds r6, r4, r0 mov r0, sp @@ -79385,7 +79385,7 @@ _080609C4: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 adds r0, r4, 0 movs r1, 0xB @@ -79452,7 +79452,7 @@ _08060A2A: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 adds r0, r4, 0 movs r1, 0x15 @@ -79565,7 +79565,7 @@ _08060A2A: _08060B5C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -79577,7 +79577,7 @@ _08060B5C: _08060B78: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -79595,7 +79595,7 @@ _08060B94: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r7, r1, r0 adds r6, r4, 0 adds r6, 0x8 @@ -79619,7 +79619,7 @@ _08060BAC: ble _08060BAC movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x15 mov r2, r9 @@ -79629,7 +79629,7 @@ _08060BAC: _08060BE8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldr r3, =gUnknown_02023064 ldrb r2, [r6] @@ -79644,7 +79644,7 @@ _08060C08: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 ldrb r2, [r6] lsls r2, 9 @@ -79690,7 +79690,7 @@ _08060C08: _08060C70: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldr r3, =gUnknown_02023064 ldrb r2, [r6] @@ -79708,7 +79708,7 @@ _08060C86: _08060C98: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -79720,7 +79720,7 @@ _08060C98: _08060CB4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -79732,7 +79732,7 @@ _08060CB4: _08060CD0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -79744,7 +79744,7 @@ _08060CD0: _08060CEC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -79756,7 +79756,7 @@ _08060CEC: _08060D08: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -79768,7 +79768,7 @@ _08060D08: _08060D24: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -79780,7 +79780,7 @@ _08060D24: _08060D40: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -79792,7 +79792,7 @@ _08060D40: _08060D5C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -79804,7 +79804,7 @@ _08060D5C: _08060D78: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -79816,7 +79816,7 @@ _08060D78: _08060D94: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -79828,7 +79828,7 @@ _08060D94: _08060DB0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -79840,7 +79840,7 @@ _08060DB0: _08060DCC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -79852,7 +79852,7 @@ _08060DCC: _08060DE8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -79864,7 +79864,7 @@ _08060DE8: _08060E04: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -79877,7 +79877,7 @@ _08060E20: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 ldrb r2, [r6] lsls r2, 9 @@ -79929,7 +79929,7 @@ _08060E20: _08060E94: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -79941,7 +79941,7 @@ _08060E94: _08060EB0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -79953,7 +79953,7 @@ _08060EB0: _08060ECC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -79965,7 +79965,7 @@ _08060ECC: _08060EE8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -79977,7 +79977,7 @@ _08060EE8: _08060F04: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -79989,7 +79989,7 @@ _08060F04: _08060F20: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -80002,7 +80002,7 @@ _08060F2E: _08060F3C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -80014,7 +80014,7 @@ _08060F3C: _08060F58: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -80026,7 +80026,7 @@ _08060F58: _08060F74: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -80038,7 +80038,7 @@ _08060F74: _08060F90: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -80050,7 +80050,7 @@ _08060F90: _08060FAC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -80062,7 +80062,7 @@ _08060FAC: _08060FC8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -80074,7 +80074,7 @@ _08060FC8: _08060FE4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -80086,7 +80086,7 @@ _08060FE4: _08061000: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -80098,7 +80098,7 @@ _08061000: _0806101C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -80110,7 +80110,7 @@ _0806101C: _08061038: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -80122,7 +80122,7 @@ _08061038: _08061054: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -80134,7 +80134,7 @@ _08061054: _08061070: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -80146,7 +80146,7 @@ _08061070: _0806108C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -80158,7 +80158,7 @@ _0806108C: _080610A8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -80170,7 +80170,7 @@ _080610A8: _080610C4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -80182,7 +80182,7 @@ _080610C4: _080610E0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -80194,7 +80194,7 @@ _080610E0: _080610FC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -80206,7 +80206,7 @@ _080610FC: _08061118: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -80218,7 +80218,7 @@ _08061118: _08061134: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -80230,7 +80230,7 @@ _08061134: _08061150: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -80242,7 +80242,7 @@ _08061150: _0806116C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -80254,7 +80254,7 @@ _0806116C: _08061188: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -80290,7 +80290,7 @@ sub_80611B0: @ 80611B0 adds r0, r4, 0x1 adds r0, r2, r0 ldrb r0, [r0] - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 adds r5, r3, r0 movs r3, 0 @@ -80343,11 +80343,11 @@ sub_8061224: @ 8061224 ldrh r0, [r0] movs r7, 0x64 muls r0, r7 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty mov r10, r2 add r0, r10 movs r1, 0xB - bl pokemon_getattr + bl GetMonData mov r8, r0 lsls r0, 16 lsrs r0, 16 @@ -80452,7 +80452,7 @@ sub_8061224: @ 8061224 muls r0, r7 add r0, r10 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -80542,16 +80542,16 @@ sub_80613DC: @ 80613DC mov r1, r9 muls r1, r0 adds r0, r1, 0 - ldr r5, =gUnknown_02024744 + ldr r5, =gEnemyParty adds r0, r5 movs r1, 0xB - bl pokemon_getattr + bl GetMonData mov r8, r0 lsls r0, 16 lsrs r0, 16 mov r8, r0 ldr r0, =sub_805D714 - bl object_new_hidden_with_callback + bl CreateInvisibleSpriteWithCallback ldr r1, =gUnknown_03005D7C mov r10, r1 add r10, r6 @@ -80823,7 +80823,7 @@ sub_8061690: @ 8061690 mov r7, r9 mov r6, r8 push {r6,r7} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r2, [r0] movs r0, 0x80 lsls r0, 20 @@ -80934,7 +80934,7 @@ _0806178C: adds r0, r2 ldrb r4, [r0, 0x3] _08061796: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x00008040 ands r0, r1 @@ -81070,7 +81070,7 @@ sub_80618D8: @ 80618D8 push {r4-r6,lr} mov r6, r8 push {r6} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r2, [r0] movs r0, 0x80 lsls r0, 20 @@ -81858,7 +81858,7 @@ sub_8061FAC: @ 8061FAC thumb_func_start sub_8061FB8 sub_8061FB8: @ 8061FB8 push {r4-r6,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r2, [r0] movs r0, 0x80 lsls r0, 10 @@ -81889,7 +81889,7 @@ _08061FE4: cmp r2, 0 beq _080620C4 movs r0, 0xF - bl sub_8130950 + bl BattleAI_SetupAIData bl sub_8130BA4 lsls r0, 24 lsrs r4, r0, 24 @@ -81916,7 +81916,7 @@ _0806202C: movs r2, 0 b _08061FD6 _08062030: - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r2, [r0] movs r0, 0x1 movs r1, 0xF @@ -81936,7 +81936,7 @@ _08062040: ands r0, r1 cmp r0, 0 beq _08062062 - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldr r1, =gUnknown_02024064 ldrb r1, [r1] strb r1, [r0] @@ -81953,11 +81953,11 @@ _08062062: beq _0806209C movs r0, 0 bl battle_get_side_with_given_state - ldr r5, =gUnknown_0202420C + ldr r5, =gEnemyMonIndex strb r0, [r5] ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r0, [r5] lsls r0, 2 adds r0, r2 @@ -81969,7 +81969,7 @@ _08062062: bl battle_get_side_with_given_state strb r0, [r5] _0806209C: - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] lsls r0, 8 orrs r4, r0 @@ -81982,7 +81982,7 @@ _0806209C: _080620C4: movs r6, 0x3 _080620C6: - bl GenerateRandomNumber + bl Random adds r4, r0, 0 ands r4, r6 lsls r0, r4, 1 @@ -82011,13 +82011,13 @@ _080620C6: b _08062152 .pool _08062108: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq _0806213C - bl GenerateRandomNumber + bl Random movs r1, 0x2 ands r1, r0 lsls r1, 24 @@ -82090,7 +82090,7 @@ sub_8062188: @ 8062188 lsrs r4, r0, 24 cmp r4, 0x6 bne _0806225A - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -82113,7 +82113,7 @@ _080621D4: lsls r0, 24 lsrs r5, r0, 24 _080621E8: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x00808000 ands r0, r1 @@ -82144,10 +82144,10 @@ _0806221E: bge _0806225A movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0806221C ldr r1, =gUnknown_0202406E @@ -82228,10 +82228,10 @@ sub_8062294: @ 8062294 ldrh r0, [r0] movs r5, 0x64 muls r0, r5 - ldr r4, =gUnknown_02024744 + ldr r4, =gEnemyParty adds r0, r4 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData mov r8, r0 mov r1, r9 ldrb r0, [r1] @@ -82241,7 +82241,7 @@ sub_8062294: @ 8062294 muls r0, r5 adds r0, r4 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r3, r0, 0 mov r1, r9 ldrb r0, [r1] @@ -82260,10 +82260,10 @@ _08062324: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData adds r2, r0, 0 mov r1, r9 ldrb r0, [r1] @@ -82318,7 +82318,7 @@ sub_8062390: @ 8062390 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty adds r1, r2 movs r2, 0x9 bl healthbar_draw_field_maybe @@ -82686,10 +82686,10 @@ sub_806268C: @ 806268C ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 movs r1, 0x19 @@ -82877,7 +82877,7 @@ sub_8062828: @ 8062828 lsls r0, 24 cmp r0, 0 beq _0806286C - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x40 ands r0, r1 @@ -83270,13 +83270,13 @@ sub_8062BA4: @ 8062BA4 thumb_func_start sub_8062BB0 sub_8062BB0: @ 8062BB0 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x6 ands r0, r1 cmp r0, 0x2 bne _08062BDA - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldr r0, =0x00000439 adds r3, r2, r0 ldrb r1, [r3] @@ -83353,7 +83353,7 @@ sub_8062C58: @ 8062C58 mov r5, r8 push {r5-r7} sub sp, 0x4 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -83369,7 +83369,7 @@ _08062C72: lsls r0, 24 lsrs r0, 24 mov r10, r0 - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 @@ -83422,7 +83422,7 @@ _08062CE8: adds r6, 0x1 cmp r6, 0x3 ble _08062CBA - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x00808000 ands r0, r1 @@ -83470,11 +83470,11 @@ _08062D58: ldrb r0, [r1] bl battle_side_get_owner lsls r0, 24 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty mov r9, r1 cmp r0, 0 bne _08062D6C - ldr r3, =gUnknown_020244EC + ldr r3, =gPlayerParty mov r9, r3 _08062D6C: adds r6, r4, 0 @@ -83489,17 +83489,17 @@ _08062D74: adds r4, r1, r5 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08062E24 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08062E24 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData movs r1, 0xCE lsls r1, 1 cmp r0, r1 @@ -83514,17 +83514,17 @@ _08062D74: beq _08062E24 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r0, r4, 0 movs r1, 0x2E - bl pokemon_getattr + bl GetMonData mov r0, r10 bl battle_get_side_with_given_state lsls r0, 24 lsrs r2, r0, 24 movs r4, 0 mov r8, r5 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r2 adds r5, r0, r1 @@ -83535,7 +83535,7 @@ _08062DE0: adds r1, 0xD mov r0, r9 add r0, r8 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 cmp r0, 0 @@ -83549,7 +83549,7 @@ _08062DE0: ands r1, r0 cmp r1, 0 beq _08062E1E - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -83594,7 +83594,7 @@ sub_8062E54: @ 8062E54 lsls r0, 24 cmp r0, 0 beq _08062E82 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -83630,7 +83630,7 @@ _08062E9C: bne _08062EB0 b _080630AC _08062EB0: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -83646,7 +83646,7 @@ _08062EB0: bl battle_get_side_with_given_state ldr r1, =gUnknown_02024210 ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, 24 lsrs r0, 22 adds r0, r2 @@ -83703,7 +83703,7 @@ _08062F5C: _08062F5E: str r0, [sp] _08062F60: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r3, [r2] movs r0, 0x58 muls r0, r3 @@ -83715,7 +83715,7 @@ _08062F60: bne _08062F76 b _080630AC _08062F76: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x00808000 ands r0, r1 @@ -83760,11 +83760,11 @@ _08062FD2: ldrb r0, [r2] bl battle_side_get_owner lsls r0, 24 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty str r1, [sp, 0x4] cmp r0, 0 bne _08062FE6 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty str r2, [sp, 0x4] _08062FE6: adds r5, r4, 0 @@ -83779,17 +83779,17 @@ _08062FF0: adds r6, r1, r0 adds r0, r6, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _080630A6 adds r0, r6, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _080630A6 adds r0, r6, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData movs r1, 0xCE lsls r1, 1 cmp r0, r1 @@ -83820,12 +83820,12 @@ _08062FF0: beq _080630A6 adds r0, r6, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 adds r0, r6, 0 movs r1, 0x2E - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08063088 lsls r0, r4, 3 @@ -83845,7 +83845,7 @@ _08063092: ldr r1, [sp] cmp r1, r0 bne _080630A6 - bl GenerateRandomNumber + bl Random movs r1, 0x1 ands r1, r0 cmp r1, 0 @@ -83871,7 +83871,7 @@ _080630AE: thumb_func_start ai_switchout_natural_cure ai_switchout_natural_cure: @ 80630C0 push {r4,r5,lr} - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r5, =gUnknown_02024064 ldrb r4, [r5] movs r0, 0x58 @@ -83906,7 +83906,7 @@ ai_switchout_natural_cure: @ 80630C0 cmp r1, r0 bne _08063128 _08063106: - bl GenerateRandomNumber + bl Random movs r1, 0x1 ands r1, r0 cmp r1, 0 @@ -83929,7 +83929,7 @@ _08063128: ldrb r0, [r0, 0x1] cmp r0, 0 bne _08063160 - bl GenerateRandomNumber + bl Random movs r1, 0x1 ands r1, r0 cmp r1, 0 @@ -83950,7 +83950,7 @@ _08063160: lsls r0, 24 cmp r0, 0 bne _080631AA - bl GenerateRandomNumber + bl Random movs r1, 0x1 ands r1, r0 cmp r1, 0 @@ -84006,7 +84006,7 @@ ai_has_super_effective_move_on_field: @ 80631BC lsrs r3, r0, 24 ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r3, 2 adds r0, r2 ldr r0, [r0] @@ -84014,7 +84014,7 @@ ai_has_super_effective_move_on_field: @ 80631BC cmp r1, 0 bne _08063256 movs r4, 0 - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons movs r7, 0x58 adds r0, r3, 0 muls r0, r7 @@ -84047,7 +84047,7 @@ _0806320A: mov r0, r9 cmp r0, 0 bne _08063278 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xA @@ -84060,7 +84060,7 @@ _08063250: cmp r4, 0x3 ble _0806320A _08063256: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -84080,7 +84080,7 @@ _0806327C: lsrs r3, r0, 24 ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r3, 2 adds r0, r2 ldr r0, [r0] @@ -84088,7 +84088,7 @@ _0806327C: cmp r1, 0 bne _080632FA movs r4, 0 - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons movs r7, 0x58 adds r0, r3, 0 muls r0, r7 @@ -84121,7 +84121,7 @@ _080632AE: mov r0, r9 cmp r0, 0 bne _08063278 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xA @@ -84150,7 +84150,7 @@ _080632FC: ai_is_too_invested_in_stat_buffs: @ 806331C push {r4,lr} movs r4, 0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_02024064 ldrb r2, [r0] movs r0, 0x58 @@ -84234,7 +84234,7 @@ _080633A4: bne _080633B8 b _080635EE _080633B8: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -84250,7 +84250,7 @@ _080633B8: bl battle_get_side_with_given_state ldr r1, =gUnknown_02024210 ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, 24 lsrs r0, 22 adds r0, r2 @@ -84277,7 +84277,7 @@ _0806342C: mov r9, r3 mov r10, r9 _08063430: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x00808000 ands r0, r1 @@ -84326,11 +84326,11 @@ _08063498: ldrb r0, [r5] bl battle_side_get_owner lsls r0, 24 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty str r1, [sp, 0xC] cmp r0, 0 bne _080634AC - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty str r2, [sp, 0xC] _080634AC: adds r6, r4, 0 @@ -84343,21 +84343,21 @@ _080634BC: adds r5, r1, r0 adds r0, r5, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _080634D2 b _080635E4 _080634D2: adds r0, r5, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _080634E0 b _080635E4 _080634E0: adds r0, r5, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData movs r1, 0xCE lsls r1, 1 cmp r0, r1 @@ -84391,12 +84391,12 @@ _080634E0: beq _080635E4 adds r0, r5, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 adds r0, r5, 0 movs r1, 0x2E - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08063558 lsls r0, r4, 3 @@ -84437,7 +84437,7 @@ _08063564: adds r1, r6, 0 muls r1, r0 mov r8, r1 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r2, r9 muls r2, r0 @@ -84450,7 +84450,7 @@ _080635A2: adds r1, 0xD ldr r0, [sp, 0xC] add r0, r8 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 cmp r0, 0 @@ -84464,7 +84464,7 @@ _080635A2: ands r1, r0 cmp r1, 0 beq _080635DE - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 ldr r1, [sp, 0x4] @@ -84505,7 +84505,7 @@ sub_8063614: @ 8063614 mov r5, r8 push {r5-r7} sub sp, 0x4 - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldr r4, =gUnknown_02024064 ldrb r2, [r4] movs r5, 0x58 @@ -84582,7 +84582,7 @@ _080636A8: bne _080636B4 b _0806386C _080636B4: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 11 @@ -84607,7 +84607,7 @@ _080636C4: bl battle_get_side_with_given_state ldr r1, =gUnknown_02024210 ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, 24 lsrs r0, 22 adds r0, r2 @@ -84632,7 +84632,7 @@ _0806372E: ldrb r6, [r4] adds r7, r6, 0 _08063732: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x00808000 ands r0, r1 @@ -84663,11 +84663,11 @@ _08063770: ldrb r0, [r2] bl battle_side_get_owner lsls r0, 24 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty mov r9, r1 cmp r0, 0 bne _08063784 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty mov r9, r0 _08063784: adds r5, r4, 0 @@ -84680,17 +84680,17 @@ _0806378A: adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _080637EC adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _080637EC adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData movs r1, 0xCE lsls r1, 1 cmp r0, r1 @@ -84796,14 +84796,14 @@ sub_8063880: @ 8063880 ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty mov r8, r1 cmp r0, 0 bne _080638A8 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty mov r8, r2 _080638A8: - ldr r7, =gUnknown_02022FEC + ldr r7, =gBattleTypeFlags ldr r0, [r7] movs r1, 0x8 ands r0, r1 @@ -84856,7 +84856,7 @@ _08063910: lsls r0, 24 lsrs r5, r0, 24 _08063928: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x00808000 ands r0, r1 @@ -84888,7 +84888,7 @@ _08063962: muls r0, r4 add r0, r8 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _080639A0 ldr r1, =gUnknown_0202406E @@ -85057,7 +85057,7 @@ sub_8063A90: @ 8063A90 beq _08063AB2 b _08063E50 _08063AB2: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 11 @@ -85088,7 +85088,7 @@ _08063AE0: bl battle_get_side_with_given_state ldr r1, =gUnknown_02024210 ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, 24 lsrs r0, 22 adds r0, r2 @@ -85111,7 +85111,7 @@ _08063B20: lsrs r0, 24 str r0, [sp, 0x14] _08063B36: - bl GenerateRandomNumber + bl Random movs r3, 0x2 ands r0, r3 lsls r0, 24 @@ -85119,7 +85119,7 @@ _08063B36: str r0, [sp, 0x4] ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldr r4, [sp, 0x4] lsls r0, r4, 2 adds r0, r2 @@ -85148,7 +85148,7 @@ _08063B6C: str r4, [sp, 0x14] str r4, [sp, 0x10] _08063B8A: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x00808000 ands r0, r1 @@ -85182,11 +85182,11 @@ _08063BCC: ldrb r0, [r2] bl battle_side_get_owner lsls r0, 24 - ldr r4, =gUnknown_02024744 + ldr r4, =gEnemyParty str r4, [sp, 0x20] cmp r0, 0 bne _08063BE0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty str r0, [sp, 0x20] _08063BE0: movs r1, 0 @@ -85203,7 +85203,7 @@ _08063BE4: b _08063CF2 _08063BF6: lsls r0, r7, 2 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable adds r0, r1 mov r8, r0 mov r10, sp @@ -85214,14 +85214,14 @@ _08063C00: adds r4, r2, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r5, r0, 16 cmp r5, 0 beq _08063CD8 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08063CD8 mov r4, r8 @@ -85269,7 +85269,7 @@ _08063C00: ldr r2, [sp, 0x4] adds r4, r2, 0 muls r4, r0 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r4, r0 adds r0, r4, 0 adds r0, 0x21 @@ -85326,7 +85326,7 @@ _08063D02: adds r1, 0xD ldr r2, [sp, 0x20] adds r0, r2, r5 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 cmp r4, 0 @@ -85351,7 +85351,7 @@ _08063D30: _08063D36: ldr r4, [sp, 0xC] lsls r0, r4, 2 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable adds r0, r1 ldr r0, [r0] mov r2, r9 @@ -85379,9 +85379,9 @@ _08063D60: ldr r0, =gUnknown_02024474 movs r2, 0x1 strb r2, [r0, 0xE] - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags strb r1, [r0] - ldr r0, =gUnknown_02024211 + ldr r0, =gCritMultiplier strb r2, [r0] movs r1, 0 str r1, [sp, 0x8] @@ -85399,7 +85399,7 @@ _08063D8A: adds r4, r0, r6 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 adds r1, r7, 0x1 mov r10, r1 @@ -85407,7 +85407,7 @@ _08063D8A: beq _08063E46 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08063E46 ldr r1, =gUnknown_0202406E @@ -85437,7 +85437,7 @@ _08063D8A: beq _08063E46 movs r5, 0 mov r9, r6 - ldr r0, =gUnknown_020241F0 + ldr r0, =gBattleMoveDamage mov r8, r0 ldr r6, =gUnknown_02024064 _08063DEE: @@ -85445,7 +85445,7 @@ _08063DEE: adds r1, 0xD ldr r0, [sp, 0x20] add r0, r9 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 movs r0, 0 @@ -85571,7 +85571,7 @@ sub_8063EE0: @ 8063EE0 movs r0, 0 mov r10, r0 movs r7, 0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 15 @@ -85591,10 +85591,10 @@ _08063F12: ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 - ldr r5, =gUnknown_02024744 + ldr r5, =gEnemyParty cmp r0, 0 bne _08063F24 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty _08063F24: movs r1, 0 mov r8, r1 @@ -85606,17 +85606,17 @@ _08063F28: adds r4, r5, r0 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08063F64 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08063F64 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData movs r1, 0xCE lsls r1, 1 cmp r0, r1 @@ -85675,7 +85675,7 @@ _08063FB6: mov r0, r9 cmp r0, 0xAF bne _08063FE8 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003214 adds r5, r0, r1 @@ -85723,7 +85723,7 @@ _08064030: .4byte _080642F4 .4byte _0806437C _08064048: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_02024064 ldrb r1, [r0] movs r0, 0x58 @@ -85754,7 +85754,7 @@ _08064074: bne _08064088 b _08064324 _08064088: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_02024064 ldrb r1, [r0] movs r0, 0x58 @@ -85795,7 +85795,7 @@ _080640BC: ands r0, r1 cmp r0, 0 beq _08064100 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r4, [r3] movs r0, 0x58 muls r0, r4 @@ -85821,7 +85821,7 @@ _08064100: ands r0, r1 cmp r0, 0 beq _0806413A - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r4, [r3] movs r0, 0x58 muls r0, r4 @@ -85852,7 +85852,7 @@ _0806413A: ands r0, r1 cmp r0, 0 beq _0806416C - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r4, [r3] movs r0, 0x58 muls r0, r4 @@ -85878,7 +85878,7 @@ _0806416C: ands r0, r1 cmp r0, 0 beq _0806419E - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r4, [r3] movs r0, 0x58 muls r0, r4 @@ -85904,7 +85904,7 @@ _0806419E: ands r0, r1 cmp r0, 0 beq _080641D0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r4, [r3] movs r0, 0x58 muls r0, r4 @@ -85932,7 +85932,7 @@ _080641D0: bne _080641DE b _08064324 _080641DE: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r3, [r3] movs r0, 0x58 muls r0, r3 @@ -86162,7 +86162,7 @@ sub_8064394: @ 8064394 sub_80643B0: @ 80643B0 push {lr} ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r3, [r0] lsls r0, r3, 2 @@ -86341,7 +86341,7 @@ sub_8064520: @ 8064520 lsls r0, 24 cmp r0, 0 beq _08064584 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -86595,12 +86595,12 @@ sub_8064734: @ 8064734 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 _08064776: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -86626,7 +86626,7 @@ _08064776: ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r1, r0 adds r0, r3, 0 bl sub_8172EF0 @@ -86669,7 +86669,7 @@ _080647B4: lsls r0, 24 cmp r0, 0 beq _0806484A - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -86688,7 +86688,7 @@ _080647B4: ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @@ -86714,7 +86714,7 @@ _0806484A: ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @@ -86784,7 +86784,7 @@ _08064898: ands r0, r1 cmp r0, 0 bne _0806493C - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x42 ands r0, r1 @@ -86857,7 +86857,7 @@ _08064982: beq _08064998 b _08064AC0 _08064998: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -86898,7 +86898,7 @@ _080649E2: lsls r0, 24 cmp r0, 0 beq _08064A3A - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -86925,10 +86925,10 @@ _080649E2: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -86953,10 +86953,10 @@ _08064A3A: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -87051,7 +87051,7 @@ sub_8064B04: @ 8064B04 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r1, r0 adds r0, r3, 0 bl sub_8172EF0 @@ -87452,7 +87452,7 @@ sub_8064E50: @ 8064E50 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @@ -87499,7 +87499,7 @@ sub_8064F40: @ 8064F40 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @@ -87539,10 +87539,10 @@ _08064F72: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -87620,7 +87620,7 @@ sub_8065068: @ 8065068 adds r0, r1 ldr r1, =sub_80643B0 str r1, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -87643,7 +87643,7 @@ sub_8065068: @ 8065068 .pool _080650BC: ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r1 @@ -87809,16 +87809,16 @@ _08065284: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1] adds r0, r4, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x2E] movs r6, 0 @@ -87846,12 +87846,12 @@ _080652D0: adds r1, r6, 0 adds r1, 0xD mov r0, r8 - bl pokemon_getattr + bl GetMonData strh r0, [r4] adds r1, r6, 0 adds r1, 0x11 mov r0, r8 - bl pokemon_getattr + bl GetMonData mov r2, r9 adds r1, r2, r6 strb r0, [r1] @@ -87862,25 +87862,25 @@ _080652D0: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 adds r0, r4, 0 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData mov r1, r10 strb r0, [r1] adds r0, r4, 0 movs r1, 0x20 - bl pokemon_getattr + bl GetMonData ldr r2, [sp, 0x80] strb r0, [r2] adds r0, r4, 0 movs r1, 0x19 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x44] adds r0, r4, 0 movs r1, 0x27 - bl pokemon_getattr + bl GetMonData mov r3, sp movs r5, 0x1F ands r0, r5 @@ -87892,7 +87892,7 @@ _080652D0: strb r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x28 - bl pokemon_getattr + bl GetMonData mov r3, sp movs r6, 0x1F ands r0, r6 @@ -87904,7 +87904,7 @@ _080652D0: strh r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x29 - bl pokemon_getattr + bl GetMonData mov r3, sp ands r0, r5 lsls r0, 2 @@ -87916,7 +87916,7 @@ _080652D0: strb r1, [r3, 0x15] adds r0, r4, 0 movs r1, 0x2A - bl pokemon_getattr + bl GetMonData movs r1, 0x1F ands r1, r0 lsls r1, 15 @@ -87927,7 +87927,7 @@ _080652D0: str r0, [sp, 0x14] adds r0, r4, 0 movs r1, 0x2B - bl pokemon_getattr + bl GetMonData mov r3, sp ands r0, r6 lsls r0, 4 @@ -87938,7 +87938,7 @@ _080652D0: strh r1, [r3, 0x16] adds r0, r4, 0 movs r1, 0x2C - bl pokemon_getattr + bl GetMonData mov r3, sp ands r0, r5 lsls r0, 1 @@ -87950,55 +87950,55 @@ _080652D0: strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x48] adds r0, r4, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x4C] adds r0, r4, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData ldr r1, [sp, 0x7C] strb r0, [r1] adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x28] adds r0, r4, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x2C] adds r0, r4, 0 movs r1, 0x3B - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x2] adds r0, r4, 0 movs r1, 0x3C - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x4] adds r0, r4, 0 movs r1, 0x3D - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x6] adds r0, r4, 0 movs r1, 0x3E - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x8] adds r0, r4, 0 movs r1, 0x3F - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0xA] adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData mov r3, sp movs r1, 0x1 ands r0, r1 @@ -88011,7 +88011,7 @@ _080652D0: strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x2E - bl pokemon_getattr + bl GetMonData mov r3, sp lsls r0, 7 ldrb r2, [r3, 0x17] @@ -88021,19 +88021,19 @@ _080652D0: strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x54] adds r0, r4, 0 movs r1, 0x2 ldr r2, [sp, 0x8C] - bl pokemon_getattr + bl GetMonData ldr r0, [sp, 0x84] ldr r1, [sp, 0x8C] - bl CopyString_Limit10 + bl StringCopy10 adds r0, r4, 0 movs r1, 0x7 ldr r2, [sp, 0x88] - bl pokemon_getattr + bl GetMonData mov r2, sp movs r6, 0 _08065488: @@ -88049,7 +88049,7 @@ _08065488: _080654A8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xB b _08065822 @@ -88057,7 +88057,7 @@ _080654A8: _080654B8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xC b _08065822 @@ -88071,20 +88071,20 @@ _080654C8: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r1, r0 mov r8, r9 _080654DE: adds r1, r6, 0 adds r1, 0xD adds r0, r4, 0 - bl pokemon_getattr + bl GetMonData mov r1, r8 strh r0, [r1] adds r1, r6, 0 adds r1, 0x11 adds r0, r4, 0 - bl pokemon_getattr + bl GetMonData mov r2, r10 adds r1, r2, r6 strb r0, [r1] @@ -88095,10 +88095,10 @@ _080654DE: ble _080654DE movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData mov r1, r9 strb r0, [r1, 0xC] mov r2, r9 @@ -88116,7 +88116,7 @@ _0806551C: _08065530: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r1, [r3] lsls r1, 9 @@ -88131,14 +88131,14 @@ _0806554C: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty mov r8, r2 _08065558: adds r1, r6, 0 adds r1, 0x11 mov r2, r8 adds r0, r4, r2 - bl pokemon_getattr + bl GetMonData adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 @@ -88146,10 +88146,10 @@ _08065558: ble _08065558 movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 @@ -88158,7 +88158,7 @@ _08065558: _08065588: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r1, [r3] lsls r1, 9 @@ -88171,7 +88171,7 @@ _08065588: _080655A4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x1 b _080655BE @@ -88179,11 +88179,11 @@ _080655A4: _080655B4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x19 _080655BE: - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 strb r1, [r7] movs r0, 0xFF @@ -88202,7 +88202,7 @@ _080655BE: _080655E4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x1A b _080658E2 @@ -88210,7 +88210,7 @@ _080655E4: _080655F4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x1B b _080658E2 @@ -88218,7 +88218,7 @@ _080655F4: _08065604: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x1C b _080658E2 @@ -88226,7 +88226,7 @@ _08065604: _08065614: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x1D b _080658E2 @@ -88234,7 +88234,7 @@ _08065614: _08065624: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x1E b _080658E2 @@ -88242,7 +88242,7 @@ _08065624: _08065634: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x1F b _080658E2 @@ -88250,7 +88250,7 @@ _08065634: _08065644: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x20 b _080658E2 @@ -88258,7 +88258,7 @@ _08065644: _08065654: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x22 b _080658E2 @@ -88266,7 +88266,7 @@ _08065654: _08065664: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x23 b _080658E2 @@ -88274,7 +88274,7 @@ _08065664: _08065674: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x24 b _080658E2 @@ -88282,7 +88282,7 @@ _08065674: _08065684: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x25 b _080658E2 @@ -88290,7 +88290,7 @@ _08065684: _08065694: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x26 b _080658E2 @@ -88299,31 +88299,31 @@ _080656A4: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 adds r0, r4, 0 movs r1, 0x27 - bl pokemon_getattr + bl GetMonData strb r0, [r7] adds r0, r4, 0 movs r1, 0x28 - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x1] adds r0, r4, 0 movs r1, 0x29 - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x2] adds r0, r4, 0 movs r1, 0x2A - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x3] adds r0, r4, 0 movs r1, 0x2B - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x4] adds r0, r4, 0 movs r1, 0x2C - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x5] movs r6, 0x6 b _080658EA @@ -88331,7 +88331,7 @@ _080656A4: _080656F4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x27 b _080658E2 @@ -88339,7 +88339,7 @@ _080656F4: _08065704: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x28 b _080658E2 @@ -88347,7 +88347,7 @@ _08065704: _08065714: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x29 b _080658E2 @@ -88355,7 +88355,7 @@ _08065714: _08065724: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x2A b _080658E2 @@ -88363,7 +88363,7 @@ _08065724: _08065734: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x2B b _080658E2 @@ -88371,7 +88371,7 @@ _08065734: _08065744: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x2C b _080658E2 @@ -88379,7 +88379,7 @@ _08065744: _08065754: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0 b _0806577E @@ -88387,7 +88387,7 @@ _08065754: _08065764: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x9 b _08065822 @@ -88395,11 +88395,11 @@ _08065764: _08065774: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x37 _0806577E: - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 strb r1, [r7] movs r0, 0xFF @@ -88420,7 +88420,7 @@ _0806577E: _080657A8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x38 b _080658E2 @@ -88428,7 +88428,7 @@ _080657A8: _080657B8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x39 b _08065822 @@ -88436,7 +88436,7 @@ _080657B8: _080657C8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x3A b _08065822 @@ -88444,7 +88444,7 @@ _080657C8: _080657D8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x3B b _08065822 @@ -88452,7 +88452,7 @@ _080657D8: _080657E8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x3C b _08065822 @@ -88460,7 +88460,7 @@ _080657E8: _080657F8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x3D b _08065822 @@ -88468,7 +88468,7 @@ _080657F8: _08065808: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x3E b _08065822 @@ -88476,11 +88476,11 @@ _08065808: _08065818: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x3F _08065822: - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 strb r0, [r7] @@ -88492,7 +88492,7 @@ _08065822: _08065838: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x16 b _080658E2 @@ -88500,7 +88500,7 @@ _08065838: _08065848: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x17 b _080658E2 @@ -88508,7 +88508,7 @@ _08065848: _08065858: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x18 b _080658E2 @@ -88516,7 +88516,7 @@ _08065858: _08065868: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x21 b _080658E2 @@ -88524,7 +88524,7 @@ _08065868: _08065878: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x2F b _080658E2 @@ -88532,7 +88532,7 @@ _08065878: _08065888: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x30 b _080658E2 @@ -88540,7 +88540,7 @@ _08065888: _08065898: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x32 b _080658E2 @@ -88548,7 +88548,7 @@ _08065898: _080658A8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x33 b _080658E2 @@ -88556,7 +88556,7 @@ _080658A8: _080658B8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x34 b _080658E2 @@ -88564,7 +88564,7 @@ _080658B8: _080658C8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x35 b _080658E2 @@ -88572,11 +88572,11 @@ _080658C8: _080658D8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x36 _080658E2: - bl pokemon_getattr + bl GetMonData strb r0, [r7] movs r6, 0x1 _080658EA: @@ -88740,7 +88740,7 @@ _08065A98: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 adds r0, r4, 0 movs r1, 0xB @@ -88807,7 +88807,7 @@ _08065AFE: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 adds r0, r4, 0 movs r1, 0x15 @@ -88920,7 +88920,7 @@ _08065AFE: _08065C30: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -88932,7 +88932,7 @@ _08065C30: _08065C4C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -88950,7 +88950,7 @@ _08065C68: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r7, r1, r0 adds r6, r4, 0 adds r6, 0x8 @@ -88974,7 +88974,7 @@ _08065C80: ble _08065C80 movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x15 mov r2, r9 @@ -88984,7 +88984,7 @@ _08065C80: _08065CBC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldr r3, =gUnknown_02023064 ldrb r2, [r6] @@ -88999,7 +88999,7 @@ _08065CDC: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 ldrb r2, [r6] lsls r2, 9 @@ -89045,7 +89045,7 @@ _08065CDC: _08065D44: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldr r3, =gUnknown_02023064 ldrb r2, [r6] @@ -89063,7 +89063,7 @@ _08065D5A: _08065D6C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89075,7 +89075,7 @@ _08065D6C: _08065D88: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89087,7 +89087,7 @@ _08065D88: _08065DA4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89099,7 +89099,7 @@ _08065DA4: _08065DC0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89111,7 +89111,7 @@ _08065DC0: _08065DDC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89123,7 +89123,7 @@ _08065DDC: _08065DF8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89135,7 +89135,7 @@ _08065DF8: _08065E14: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89147,7 +89147,7 @@ _08065E14: _08065E30: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89159,7 +89159,7 @@ _08065E30: _08065E4C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89171,7 +89171,7 @@ _08065E4C: _08065E68: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89183,7 +89183,7 @@ _08065E68: _08065E84: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89195,7 +89195,7 @@ _08065E84: _08065EA0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89207,7 +89207,7 @@ _08065EA0: _08065EBC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89219,7 +89219,7 @@ _08065EBC: _08065ED8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89232,7 +89232,7 @@ _08065EF4: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 ldrb r2, [r6] lsls r2, 9 @@ -89284,7 +89284,7 @@ _08065EF4: _08065F68: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89296,7 +89296,7 @@ _08065F68: _08065F84: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89308,7 +89308,7 @@ _08065F84: _08065FA0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89320,7 +89320,7 @@ _08065FA0: _08065FBC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89332,7 +89332,7 @@ _08065FBC: _08065FD8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89344,7 +89344,7 @@ _08065FD8: _08065FF4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89357,7 +89357,7 @@ _08066002: _08066010: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89369,7 +89369,7 @@ _08066010: _0806602C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89381,7 +89381,7 @@ _0806602C: _08066048: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89393,7 +89393,7 @@ _08066048: _08066064: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89405,7 +89405,7 @@ _08066064: _08066080: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89417,7 +89417,7 @@ _08066080: _0806609C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89429,7 +89429,7 @@ _0806609C: _080660B8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89441,7 +89441,7 @@ _080660B8: _080660D4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89453,7 +89453,7 @@ _080660D4: _080660F0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89465,7 +89465,7 @@ _080660F0: _0806610C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89477,7 +89477,7 @@ _0806610C: _08066128: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89489,7 +89489,7 @@ _08066128: _08066144: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89501,7 +89501,7 @@ _08066144: _08066160: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89513,7 +89513,7 @@ _08066160: _0806617C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89525,7 +89525,7 @@ _0806617C: _08066198: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89537,7 +89537,7 @@ _08066198: _080661B4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89549,7 +89549,7 @@ _080661B4: _080661D0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89561,7 +89561,7 @@ _080661D0: _080661EC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89573,7 +89573,7 @@ _080661EC: _08066208: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89585,7 +89585,7 @@ _08066208: _08066224: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89597,7 +89597,7 @@ _08066224: _08066240: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89609,7 +89609,7 @@ _08066240: _0806625C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -89645,7 +89645,7 @@ sub_8066284: @ 8066284 adds r0, r4, 0x1 adds r0, r2, r0 ldrb r0, [r0] - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 adds r5, r3, r0 movs r3, 0 @@ -89701,11 +89701,11 @@ sub_80662F8: @ 80662F8 mov r2, r10 muls r2, r0 adds r0, r2, 0 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty mov r9, r1 add r0, r9 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 @@ -89802,7 +89802,7 @@ sub_80662F8: @ 80662F8 adds r0, r1, 0 add r0, r9 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -89885,16 +89885,16 @@ sub_8066494: @ 8066494 mov r1, r9 muls r1, r0 adds r0, r1, 0 - ldr r5, =gUnknown_02024744 + ldr r5, =gEnemyParty adds r0, r5 movs r1, 0xB - bl pokemon_getattr + bl GetMonData mov r8, r0 lsls r0, 16 lsrs r0, 16 mov r8, r0 ldr r0, =sub_805D714 - bl object_new_hidden_with_callback + bl CreateInvisibleSpriteWithCallback ldr r1, =gUnknown_03005D7C mov r10, r1 add r10, r6 @@ -90166,7 +90166,7 @@ sub_8066748: @ 8066748 mov r7, r9 mov r6, r8 push {r6,r7} - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags ldr r0, [r4] movs r1, 0x40 ands r0, r1 @@ -91283,10 +91283,10 @@ sub_80670A0: @ 80670A0 ldrh r0, [r0] movs r5, 0x64 muls r0, r5 - ldr r4, =gUnknown_02024744 + ldr r4, =gEnemyParty adds r0, r4 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData mov r8, r0 mov r1, r9 ldrb r0, [r1] @@ -91296,7 +91296,7 @@ sub_80670A0: @ 80670A0 muls r0, r5 adds r0, r4 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r3, r0, 0 mov r1, r9 ldrb r0, [r1] @@ -91315,10 +91315,10 @@ _08067130: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData adds r2, r0, 0 mov r1, r9 ldrb r0, [r1] @@ -91373,7 +91373,7 @@ sub_806719C: @ 806719C ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty adds r1, r2 movs r2, 0x9 bl healthbar_draw_field_maybe @@ -91741,10 +91741,10 @@ sub_8067498: @ 8067498 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 movs r1, 0x19 @@ -91917,7 +91917,7 @@ c3_08038DC4: @ 8067618 lsls r0, 24 cmp r0, 0 beq _08067652 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -92354,7 +92354,7 @@ _08067A00: eors r1, r2 strb r1, [r0] _08067A08: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] ldr r1, =gUnknown_02023064 ldr r4, =gUnknown_02024064 diff --git a/asm/rom_8072304.s b/asm/rom_8072304.s index e9a56069d..4f55c9577 100644 --- a/asm/rom_8072304.s +++ b/asm/rom_8072304.s @@ -1101,7 +1101,7 @@ healthbar_draw_level: @ 8072B94 adds r0, 0x6 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r1, r0, 0 subs r1, 0x2 add r0, sp, 0x4 @@ -1203,7 +1203,7 @@ heathbar_draw_hp: @ 8072C38 add r0, sp, 0x4 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN add r0, sp, 0x24 str r0, [sp] add r0, sp, 0x4 @@ -1224,7 +1224,7 @@ _08072CB8: add r0, sp, 0x4 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN add r1, sp, 0x4 movs r0, 0xBA strb r0, [r1, 0x3] @@ -1316,7 +1316,7 @@ _08072D86: asrs r1, 16 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, =gUnknown_020244D4 ldr r0, [r0] movs r1, 0xBA @@ -1431,7 +1431,7 @@ _08072E5E: add r0, sp, 0x4 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN add r0, sp, 0x28 str r0, [sp] add r0, sp, 0x4 @@ -1464,7 +1464,7 @@ _08072EDC: add r0, sp, 0x4 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN add r1, sp, 0x4 movs r0, 0xBA strb r0, [r1, 0x3] @@ -1529,12 +1529,12 @@ _08072F52: asrs r1, 16 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN mov r3, r8 cmp r3, 0 bne _08072F82 ldr r1, =gUnknown_085E8D3E - bl CopyString + bl StringCopy _08072F82: ldr r0, =gUnknown_020244D4 ldr r0, [r0] @@ -1729,7 +1729,7 @@ sub_80730D4: @ 80730D4 adds r0, r1 ldr r1, [r0] adds r0, r4, 0 - bl CopyString + bl StringCopy adds r0, r6, 0 movs r1, 0x9 mov r2, sp @@ -1864,14 +1864,14 @@ _08073236: adds r0, 0x6 movs r2, 0x1 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, [r5] adds r0, 0x7B ldrb r1, [r0] ldr r0, [sp, 0x1C] movs r2, 0x1 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN mov r1, sp movs r0, 0 strb r0, [r1, 0x5] @@ -2042,7 +2042,7 @@ _08073382: bne _080733D0 b _080735A8 _080733D0: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r2, [r0] movs r0, 0x80 ands r2, r0 @@ -2078,10 +2078,10 @@ _080733DE: ldrh r0, [r1] movs r2, 0x64 muls r0, r2 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 16 asrs r1, 16 @@ -2093,7 +2093,7 @@ _080733DE: ldrh r0, [r2] movs r1, 0x64 muls r0, r1 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty b _08073536 .pool _08073468: @@ -2104,7 +2104,7 @@ _08073468: ldrh r1, [r2] movs r2, 0x64 muls r1, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 movs r2, 0x5 bl healthbar_draw_field_maybe @@ -2127,7 +2127,7 @@ _08073468: _080734B0: cmp r4, 0x1 bne _0807355C - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r2, [r0] movs r0, 0x80 ands r2, r0 @@ -2138,7 +2138,7 @@ _080734B0: ldrh r1, [r2] movs r2, 0x64 muls r1, r2 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty adds r1, r2 bl sub_80730D4 b _08073592 @@ -2170,10 +2170,10 @@ _080734DC: ldrh r0, [r1] movs r2, 0x64 muls r0, r2 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 16 asrs r1, 16 @@ -2185,11 +2185,11 @@ _080734DC: ldrh r0, [r2] movs r1, 0x64 muls r0, r1 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty _08073536: adds r0, r2 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 16 asrs r1, 16 @@ -2206,11 +2206,11 @@ _0807355C: ldrh r1, [r2] movs r5, 0x64 muls r1, r5 - ldr r4, =gUnknown_02024744 + ldr r4, =gEnemyParty adds r1, r4 movs r2, 0x5 bl healthbar_draw_field_maybe - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 ands r0, r1 @@ -2538,7 +2538,7 @@ _0807382C: beq _0807383A b _080739E8 _0807383A: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r2, 0x40 ands r1, r2 @@ -2683,7 +2683,7 @@ _08073958: adds r1, 0x3 b _080739D0 _08073970: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r0, [r1] movs r1, 0x80 lsls r1, 11 @@ -2696,7 +2696,7 @@ _08073970: lsls r2, 2 adds r0, r2 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r7, 2 adds r0, r2 ldr r0, [r0] @@ -2743,7 +2743,7 @@ _080739DE: ble _0807390A b _08073B9A _080739E8: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r2, =0x00008040 ands r1, r2 @@ -2889,7 +2889,7 @@ _08073B08: adds r1, 0x3 b _08073B84 _08073B20: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r0, [r1] movs r1, 0x80 lsls r1, 11 @@ -2902,7 +2902,7 @@ _08073B20: adds r0, r3 ldrb r1, [r0] lsls r0, r7, 2 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable adds r0, r2 ldr r0, [r0] ands r1, r0 @@ -3762,16 +3762,16 @@ sub_80741E8: @ 80741E8 ldr r5, =gUnknown_02022E2C ldr r1, =gUnknown_085ED228 adds r0, r5, 0 - bl CopyString + bl StringCopy adds r0, r4, 0 movs r1, 0x2 add r2, sp, 0x4 - bl pokemon_getattr + bl GetMonData add r0, sp, 0x4 - bl GetStringEnd_Limit7 + bl StringGetEnd10 adds r0, r5, 0 add r1, sp, 0x4 - bl AppendString + bl StringAppend adds r5, r0, 0 adds r0, r4, 0 bl pokemon_get_gender @@ -3779,7 +3779,7 @@ sub_80741E8: @ 80741E8 lsrs r6, r0, 24 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 adds r1, r0, 0 @@ -3793,7 +3793,7 @@ _08074236: ldr r0, =gSpeciesNames adds r1, r0 add r0, sp, 0x4 - bl CompareString + bl StringCompare cmp r0, 0 bne _0807424A movs r6, 0x64 @@ -3813,7 +3813,7 @@ _08074270: ldr r1, =gUnknown_085ED233 _08074272: adds r0, r5, 0 - bl CopyString + bl StringCopy ldr r0, =gUnknown_02022E2C add r1, sp, 0x10 str r1, [sp] @@ -3882,7 +3882,7 @@ sub_8074310: @ 8074310 lsrs r2, r0, 24 lsls r1, 24 lsrs r7, r1, 24 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 2 @@ -3912,10 +3912,10 @@ sub_8074310: @ 8074310 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 bl SpeciesToNationalPokedexNum @@ -4008,10 +4008,10 @@ draw_status_ailment_maybe: @ 80743F8 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 bl battle_type_is_double lsls r0, 24 @@ -4030,10 +4030,10 @@ _08074468: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 movs r1, 0x11 mov r8, r1 @@ -4421,12 +4421,12 @@ sub_80747D8: @ 80747D8 lsrs r4, 24 ldr r1, =gUnknown_085CCB3C add r0, sp, 0x4 - bl CopyString + bl StringCopy ldr r1, =gUnknown_0203A04C ldrb r1, [r1] movs r2, 0 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0 add r1, sp, 0x4 movs r2, 0x2F @@ -4520,7 +4520,7 @@ _080748B8: _080748C0: mov r0, r8 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -4531,7 +4531,7 @@ _080748D4: bhi _080748EE mov r0, r8 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 16 asrs r1, 16 @@ -4546,7 +4546,7 @@ _080748EE: _080748F6: mov r0, r8 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 16 asrs r1, 16 @@ -4563,11 +4563,11 @@ _08074914: bl load_gfxc_health_bar mov r0, r8 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 mov r0, r8 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r3, r0, 0 movs r0, 0 str r0, [sp] @@ -4596,19 +4596,19 @@ _0807495E: bl load_gfxc_health_bar mov r0, r8 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 mov r0, r8 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 mov r0, r8 movs r1, 0x19 - bl pokemon_getattr + bl GetMonData adds r3, r0, 0 ldr r0, =gExperienceTables mov r12, r0 @@ -4683,7 +4683,7 @@ _08074A18: _08074A20: mov r0, r8 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -4699,11 +4699,11 @@ _08074A3C: bl load_gfxc_health_bar mov r0, r8 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 mov r0, r8 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r3, r0, 0 movs r0, 0 str r0, [sp] @@ -5017,10 +5017,10 @@ _08074CA0: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r0, 24 adds r7, r5, 0 @@ -5757,7 +5757,7 @@ sub_807521C: @ 807521C bl LoadCompressedObjectPaletteUsingHeap _0807524E: ldr r0, =sub_8075370 - bl object_new_hidden_with_callback + bl CreateInvisibleSpriteWithCallback mov r8, r0 mov r0, r8 lsls r0, 24 @@ -6026,7 +6026,7 @@ _08075488: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty b _080754C2 .pool _080754B4: @@ -6036,11 +6036,11 @@ _080754B4: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty _080754C2: adds r0, r1 movs r1, 0x26 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 bl ball_number_to_ball_processing_index @@ -6077,7 +6077,7 @@ _080754C2: beq _08075548 cmp r2, 0xFF bne _08075584 - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex strb r5, [r0] movs r0, 0x18 strh r0, [r4, 0x20] @@ -6104,7 +6104,7 @@ _08075548: lsrs r0, 24 adds r0, 0x18 strh r0, [r4, 0x22] - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex strb r5, [r0] movs r3, 0 strh r3, [r4, 0x2E] @@ -6118,7 +6118,7 @@ _08075548: _08075584: movs r0, 0x1 bl battle_get_side_with_given_state - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex strb r0, [r1] movs r0, 0x1 str r0, [sp] @@ -6128,7 +6128,7 @@ _08075592: adds r1, r7 lsls r1, 2 adds r4, r1, r0 - ldr r5, =gUnknown_0202420C + ldr r5, =gEnemyMonIndex ldrb r0, [r5] strh r0, [r4, 0x3A] ldr r2, [sp] @@ -6428,14 +6428,14 @@ sub_80757E4: @ 80757E4 strh r1, [r4, 0x38] movs r0, 0 movs r1, 0x20 - bl cosine + bl Cos ldrh r1, [r4, 0x22] adds r0, r1 strh r0, [r4, 0x22] movs r0, 0x36 ldrsh r1, [r4, r0] movs r0, 0 - bl cosine + bl Cos negs r0, r0 strh r0, [r4, 0x26] ldr r0, =sub_8075838 @@ -6465,7 +6465,7 @@ _0807584E: ldrsh r0, [r4, r1] movs r2, 0x36 ldrsh r1, [r4, r2] - bl cosine + bl Cos negs r0, r0 strh r0, [r4, 0x26] ldrh r1, [r4, 0x38] @@ -6524,7 +6524,7 @@ _080758C2: ldrsh r0, [r4, r2] movs r2, 0x36 ldrsh r1, [r4, r2] - bl cosine + bl Cos negs r0, r0 strh r0, [r4, 0x26] ldrh r1, [r4, 0x38] @@ -6548,7 +6548,7 @@ _080758EE: strh r5, [r4, 0x34] movs r0, 0x40 movs r1, 0x20 - bl cosine + bl Cos ldrh r1, [r4, 0x22] adds r0, r1 strh r0, [r4, 0x22] @@ -7084,7 +7084,7 @@ sub_8075D14: @ 8075D14 strh r0, [r6, 0x2E] ldr r0, =sub_8075FD4 str r0, [r6, 0x1C] - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -7105,7 +7105,7 @@ _08075D88: ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r7, r1, r0 movs r4, 0x19 mov r10, r4 @@ -7118,7 +7118,7 @@ _08075DC0: ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r7, r1, r0 movs r0, 0xE7 mov r10, r0 @@ -7126,7 +7126,7 @@ _08075DD4: mov r8, r2 adds r0, r7, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 mov r9, r0 @@ -7155,7 +7155,7 @@ _08075E00: ands r0, r1 cmp r0, 0 beq _08075E56 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x42 ands r0, r1 @@ -7543,7 +7543,7 @@ _08076130: bl RemoveObjectAndFreeTiles adds r0, r6, 0 bl RemoveObjectAndFreeResources - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -7673,7 +7673,7 @@ _08076266: ands r0, r2 movs r2, 0x38 ldrsh r1, [r5, r2] - bl sine + bl Sin ldrh r1, [r5, 0x26] adds r0, r1 strh r0, [r5, 0x26] @@ -8625,7 +8625,7 @@ sub_80769F4: @ 80769F4 lsrs r4, 24 ldr r5, =oamc_804BEB4 adds r0, r5, 0 - bl object_new_hidden_with_callback + bl CreateInvisibleSpriteWithCallback lsls r0, 24 lsrs r0, 24 ldr r2, =gUnknown_02020630 @@ -8767,7 +8767,7 @@ sub_8076B14: @ 8076B14 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty b _08076B4E .pool _08076B40: @@ -8777,11 +8777,11 @@ _08076B40: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty _08076B4E: adds r0, r1 movs r1, 0x26 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 pop {r4} diff --git a/asm/rom_80A3934.s b/asm/rom_80A5C6C.s similarity index 60% rename from asm/rom_80A3934.s rename to asm/rom_80A5C6C.s index d01c01f97..c6abfe2c4 100644 --- a/asm/rom_80A3934.s +++ b/asm/rom_80A5C6C.s @@ -5,4203 +5,6 @@ .text - thumb_func_start sub_80A3934 -sub_80A3934: @ 80A3934 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =gUnknown_020383FC - movs r1, 0 - strb r1, [r0] - ldr r0, =gUnknown_020383FD - strb r1, [r0] - ldr r0, =gUnknown_020383FE - strb r1, [r0] - ldr r0, =gUnknown_020383FF - strb r1, [r0] - ldr r0, =gUnknown_02038400 - movs r1, 0 - str r1, [r0] - ldr r0, =gUnknown_02038404 - str r1, [r0] - ldr r0, =gUnknown_02038408 - movs r2, 0 - strh r1, [r0] - ldr r0, =gUnknown_0203841A - strb r2, [r0] - ldr r4, =gUnknown_02038430 - ldr r5, =gUnknown_02038432 - ldr r6, =gUnknown_02038433 - ldr r7, =gUnknown_02038434 - ldr r0, =gUnknown_02038436 - mov r12, r0 - ldr r1, =gUnknown_02038437 - mov r8, r1 - ldr r0, =gUnknown_02038440 - mov r9, r0 - ldr r1, =0x0000ffff - adds r3, r1, 0 - ldr r1, =gUnknown_0203840A - movs r2, 0x7 -_080A397E: - ldrh r0, [r1] - orrs r0, r3 - strh r0, [r1] - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _080A397E - ldr r1, =gUnknown_0203841E - movs r2, 0 - adds r0, r1, 0 - adds r0, 0xE -_080A3994: - strh r2, [r0] - subs r0, 0x2 - cmp r0, r1 - bge _080A3994 - movs r1, 0 - movs r0, 0xFF - strb r0, [r4] - movs r0, 0x1 - negs r0, r0 - strb r0, [r4, 0x1] - strb r1, [r5] - strb r1, [r6] - movs r0, 0 - strh r1, [r7] - mov r1, r12 - strb r0, [r1] - mov r1, r8 - strb r0, [r1] - mov r1, r9 - strb r0, [r1] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3934 - - thumb_func_start move_anim_start_t1 -move_anim_start_t1: @ 80A3A10 - push {lr} - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r2, =gUnknown_02038436 - ldr r0, =gUnknown_0202420B - ldrb r0, [r0] - strb r0, [r2] - ldr r2, =gUnknown_02038437 - ldr r0, =gUnknown_0202420C - ldrb r0, [r0] - strb r0, [r2] - ldr r0, =gUnknown_082C8D6C - movs r2, 0x1 - bl move_something - pop {r0} - bx r0 - .pool - thumb_func_end move_anim_start_t1 - - thumb_func_start move_something -move_something: @ 80A3A48 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - str r0, [sp] - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A3AE8 - bl sub_80A8278 - movs r0, 0 - bl sub_8072A88 - movs r4, 0 - mov r0, r8 - lsls r0, 2 - mov r10, r0 - ldr r6, =gUnknown_0202406E - movs r7, 0x64 - ldr r5, =gUnknown_02038438 -_080A3A84: - lsls r0, r4, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080A3AA8 - ldrh r0, [r6] - muls r0, r7 - ldr r1, =gUnknown_02024744 - b _080A3AAE - .pool -_080A3AA8: - ldrh r0, [r6] - muls r0, r7 - ldr r1, =gUnknown_020244EC -_080A3AAE: - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - strh r0, [r5] - adds r6, 0x2 - adds r5, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _080A3A84 - ldr r3, =gUnknown_02038434 - ldr r5, =gUnknown_02038430 - ldr r1, =gUnknown_020383FD - mov r12, r1 - ldr r7, =gUnknown_020383F8 - ldr r6, =move_anim_execute - b _080A3B10 - .pool -_080A3AE8: - ldr r3, =gUnknown_02038434 - ldr r5, =gUnknown_02038430 - mov r0, r8 - lsls r0, 2 - mov r10, r0 - ldr r1, =gUnknown_020383FD - mov r12, r1 - ldr r7, =gUnknown_020383F8 - ldr r6, =move_anim_execute - ldr r2, =gUnknown_02039F34 - ldr r1, =gUnknown_02038438 - movs r4, 0x3 -_080A3B00: - ldr r0, [r2] - ldr r0, [r0, 0x18] - ldrh r0, [r0] - strh r0, [r1] - adds r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _080A3B00 -_080A3B10: - mov r0, r9 - cmp r0, 0 - bne _080A3B38 - strh r0, [r3] - b _080A3B3C - .pool -_080A3B38: - mov r1, r8 - strh r1, [r3] -_080A3B3C: - ldr r1, =gUnknown_0203841E - movs r2, 0 - adds r0, r1, 0 - adds r0, 0xE -_080A3B44: - strh r2, [r0] - subs r0, 0x2 - cmp r0, r1 - bge _080A3B44 - movs r0, 0xFF - strb r0, [r5] - movs r0, 0x1 - negs r0, r0 - strb r0, [r5, 0x1] - ldr r0, [sp] - add r0, r10 - ldr r0, [r0] - ldr r1, =gUnknown_020383F0 - str r0, [r1] - movs r0, 0x1 - mov r1, r12 - strb r0, [r1] - movs r0, 0 - ldr r1, =gUnknown_020383FC - strb r0, [r1] - str r6, [r7] - ldr r0, =0x0000ffff - adds r2, r0, 0 - ldr r1, =gUnknown_0203840A - movs r4, 0x7 -_080A3B76: - ldrh r0, [r1] - orrs r0, r2 - strh r0, [r1] - adds r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _080A3B76 - mov r1, r9 - cmp r1, 0 - beq _080A3BC2 - movs r4, 0 - ldr r2, =gUnknown_082C8D64 - b _080A3BAA - .pool -_080A3BA8: - adds r4, 0x1 -_080A3BAA: - lsls r0, r4, 1 - adds r0, r2 - ldrh r0, [r0] - ldr r1, =0x0000ffff - cmp r0, r1 - beq _080A3BC2 - cmp r8, r0 - bne _080A3BA8 - ldr r0, =gMPlay_BGM - movs r2, 0x80 - bl m4aMPlayVolumeControl -_080A3BC2: - ldr r0, =gUnknown_02022E24 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E26 - strh r1, [r0] - ldr r0, =gUnknown_02022E28 - strh r1, [r0] - ldr r0, =gUnknown_02022E2A - strh r1, [r0] - 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 move_something - - thumb_func_start move_anim_8072740 -move_anim_8072740: @ 80A3BFC - push {r4,lr} - adds r4, r0, 0 - bl obj_free_rotscale_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - ldr r1, =gUnknown_020383FE - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end move_anim_8072740 - - thumb_func_start move_anim_task_del -move_anim_task_del: @ 80A3C1C - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - ldr r1, =gUnknown_020383FE - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end move_anim_task_del - - thumb_func_start move_anim_related_task_del -move_anim_related_task_del: @ 80A3C38 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - ldr r1, =gUnknown_020383FF - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end move_anim_related_task_del - - thumb_func_start sub_80A3C54 -sub_80A3C54: @ 80A3C54 - push {r4,lr} - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - ldr r4, =0x0000ffff - ldr r1, =gUnknown_0203840A -_080A3C60: - ldrh r0, [r1] - cmp r0, r4 - bne _080A3C74 - strh r3, [r1] - b _080A3C7C - .pool -_080A3C74: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, 0x7 - ble _080A3C60 -_080A3C7C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A3C54 - - thumb_func_start sub_80A3C84 -sub_80A3C84: @ 80A3C84 - push {r4,lr} - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - ldr r0, =0x0000ffff - adds r4, r0, 0 - ldr r1, =gUnknown_0203840A -_080A3C92: - ldrh r0, [r1] - cmp r0, r3 - bne _080A3CA8 - orrs r0, r4 - strh r0, [r1] - b _080A3CB0 - .pool -_080A3CA8: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, 0x7 - ble _080A3C92 -_080A3CB0: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A3C84 - - thumb_func_start move_anim_waiter -move_anim_waiter: @ 80A3CB8 - push {lr} - ldr r2, =gUnknown_020383FC - ldrb r1, [r2] - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r0, 0 - bgt _080A3CDC - ldr r0, =gUnknown_020383F8 - ldr r1, =move_anim_execute - str r1, [r0] - movs r0, 0 - b _080A3CDE - .pool -_080A3CDC: - subs r0, r1, 0x1 -_080A3CDE: - strb r0, [r2] - pop {r0} - bx r0 - thumb_func_end move_anim_waiter - - thumb_func_start move_anim_execute -move_anim_execute: @ 80A3CE4 - push {r4,lr} - ldr r4, =gUnknown_08525E98 -_080A3CE8: - ldr r0, =gUnknown_020383F0 - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =gUnknown_020383FC - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - bne _080A3D0C - ldr r0, =gUnknown_020383FD - ldrb r0, [r0] - cmp r0, 0 - bne _080A3CE8 -_080A3D0C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end move_anim_execute - - thumb_func_start ma00_load_graphics -ma00_load_graphics: @ 80A3D24 - push {r4-r6,lr} - ldr r6, =gUnknown_020383F0 - ldr r0, [r6] - adds r1, r0, 0x1 - str r1, [r6] - ldrb r4, [r0, 0x1] - ldrb r0, [r1, 0x1] - lsls r0, 8 - orrs r4, r0 - lsls r5, r4, 3 - ldr r0, =gUnknown_085112C4 - adds r0, r5, r0 - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_08511BCC - adds r5, r0 - adds r0, r5, 0 - bl LoadCompressedObjectPaletteUsingHeap - ldr r0, [r6] - adds r0, 0x2 - str r0, [r6] - ldr r0, =0xffffd8f0 - adds r4, r0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r4, 0 - bl sub_80A3C54 - ldr r1, =gUnknown_020383FC - movs r0, 0x1 - strb r0, [r1] - ldr r1, =gUnknown_020383F8 - ldr r0, =move_anim_waiter - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ma00_load_graphics - - thumb_func_start ma01_080728D0 -@ void ma01_080728D0() -ma01_080728D0: @ 80A3D8C - push {r4-r6,lr} - ldr r6, =gUnknown_020383F0 - ldr r0, [r6] - adds r1, r0, 0x1 - str r1, [r6] - ldrb r4, [r0, 0x1] - ldrb r0, [r1, 0x1] - lsls r0, 8 - orrs r4, r0 - ldr r1, =gUnknown_08524B44 - ldr r0, =0xffffd8f0 - adds r4, r0 - lsls r0, r4, 3 - adds r0, r1 - ldrh r5, [r0, 0x6] - adds r0, r5, 0 - bl FreeObjectTilesByTag - adds r0, r5, 0 - bl FreeObjectPaletteByTag - ldr r0, [r6] - adds r0, 0x2 - str r0, [r6] - lsls r4, 16 - lsrs r4, 16 - adds r0, r4, 0 - bl sub_80A3C84 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ma01_080728D0 - - thumb_func_start ma02_instanciate_template -ma02_instanciate_template: @ 80A3DD8 - push {r4-r7,lr} - ldr r5, =gUnknown_020383F0 - ldr r1, [r5] - adds r3, r1, 0x1 - str r3, [r5] - ldrb r2, [r1, 0x1] - ldrb r0, [r3, 0x1] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r3, 0x2] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r3, 0x3] - lsls r0, 24 - adds r7, r2, r0 - adds r0, r1, 0x5 - str r0, [r5] - ldrb r4, [r1, 0x5] - adds r0, r1, 0x6 - str r0, [r5] - ldrb r0, [r1, 0x6] - adds r1, 0x7 - str r1, [r5] - cmp r0, 0 - beq _080A3E28 - adds r6, r5, 0 - ldr r5, =gUnknown_0203841E - adds r3, r0, 0 -_080A3E10: - ldr r2, [r6] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - strh r1, [r5] - adds r2, 0x2 - str r2, [r6] - adds r5, 0x2 - subs r3, 0x1 - cmp r3, 0 - bne _080A3E10 -_080A3E28: - movs r0, 0x80 - ands r0, r4 - cmp r0, 0 - beq _080A3E58 - movs r0, 0x80 - eors r4, r0 - cmp r4, 0x3F - bls _080A3E48 - adds r0, r4, 0 - subs r0, 0x40 - b _080A3E4A - .pool -_080A3E48: - negs r0, r4 -_080A3E4A: - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_02038437 - b _080A3E6A - .pool -_080A3E58: - cmp r4, 0x3F - bls _080A3E62 - adds r0, r4, 0 - subs r0, 0x40 - b _080A3E64 -_080A3E62: - negs r0, r4 -_080A3E64: - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_02038436 -_080A3E6A: - ldrb r0, [r0] - bl sub_80A82E4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r4, 24 - asrs r1, 24 - adds r0, r1 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r0, r6, 16 - asrs r0, 16 - cmp r0, 0x2 - bgt _080A3E88 - movs r6, 0x3 -_080A3E88: - ldr r5, =gUnknown_02038437 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - lsls r3, r6, 24 - lsrs r3, 24 - adds r0, r7, 0 - adds r1, r4, 0 - bl AddObjectAndAnimateForOneFrame - ldr r1, =gUnknown_020383FE - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ma02_instanciate_template - - thumb_func_start sub_80A3ECC -sub_80A3ECC: @ 80A3ECC - push {r4-r7,lr} - ldr r4, =gUnknown_020383F0 - ldr r1, [r4] - adds r3, r1, 0x1 - str r3, [r4] - ldrb r2, [r1, 0x1] - ldrb r0, [r3, 0x1] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r3, 0x2] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r3, 0x3] - lsls r0, 24 - adds r6, r2, r0 - adds r0, r1, 0x5 - str r0, [r4] - ldrb r7, [r1, 0x5] - adds r0, r1, 0x6 - str r0, [r4] - ldrb r0, [r1, 0x6] - adds r1, 0x7 - str r1, [r4] - cmp r0, 0 - beq _080A3F1C - adds r5, r4, 0 - ldr r4, =gUnknown_0203841E - adds r3, r0, 0 -_080A3F04: - ldr r2, [r5] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - strh r1, [r4] - adds r2, 0x2 - str r2, [r5] - adds r4, 0x2 - subs r3, 0x1 - cmp r3, 0 - bne _080A3F04 -_080A3F1C: - adds r0, r6, 0 - adds r1, r7, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r6 - ldr r1, =gUnknown_020383FE - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3ECC - - thumb_func_start ma04_wait_countdown -ma04_wait_countdown: @ 80A3F48 - push {r4,lr} - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - adds r2, r0, 0x1 - str r2, [r1] - ldr r3, =gUnknown_020383FC - ldrb r0, [r0, 0x1] - strb r0, [r3] - lsls r0, 24 - cmp r0, 0 - bne _080A3F66 - movs r4, 0x1 - negs r4, r4 - adds r0, r4, 0 - strb r0, [r3] -_080A3F66: - adds r0, r2, 0x1 - str r0, [r1] - ldr r1, =gUnknown_020383F8 - ldr r0, =move_anim_waiter - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ma04_wait_countdown - - thumb_func_start sub_80A3F88 -sub_80A3F88: @ 80A3F88 - push {lr} - ldr r0, =gUnknown_020383FE - ldrb r2, [r0] - cmp r2, 0 - bne _080A3FAC - ldr r0, =gUnknown_020383F0 - ldr r1, [r0] - adds r1, 0x1 - str r1, [r0] - ldr r0, =gUnknown_020383FC - strb r2, [r0] - b _080A3FB2 - .pool -_080A3FAC: - ldr r1, =gUnknown_020383FC - movs r0, 0x1 - strb r0, [r1] -_080A3FB2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3F88 - - thumb_func_start nullsub_6 -nullsub_6: @ 80A3FBC - bx lr - thumb_func_end nullsub_6 - - thumb_func_start nullsub_7 -nullsub_7: @ 80A3FC0 - bx lr - thumb_func_end nullsub_7 - - thumb_func_start sub_80A3FC4 -sub_80A3FC4: @ 80A3FC4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r0, 0 - mov r8, r0 - ldr r0, =gUnknown_020383FE - ldrb r0, [r0] - cmp r0, 0 - bne _080A3FEC - ldr r0, =gUnknown_020383FF - ldrb r0, [r0] - cmp r0, 0 - bne _080A3FEC - ldr r1, =gUnknown_02038430 - ldrb r0, [r1] - cmp r0, 0xFF - bne _080A3FEC - ldrb r0, [r1, 0x1] - cmp r0, 0xFF - beq _080A4004 -_080A3FEC: - ldr r1, =gUnknown_0203842E - movs r0, 0 - strh r0, [r1] - b _080A401E - .pool -_080A4004: - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - beq _080A403C - ldr r1, =gUnknown_0203842E - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x5A - bhi _080A4030 -_080A401E: - ldr r1, =gUnknown_020383FC - movs r0, 0x1 - strb r0, [r1] - b _080A40A2 - .pool -_080A4030: - ldr r0, =gMPlay_SE1 - bl m4aMPlayStop - ldr r0, =gMPlay_SE2 - bl m4aMPlayStop -_080A403C: - ldr r1, =gUnknown_0203842E - movs r0, 0 - strh r0, [r1] - movs r5, 0 - ldr r7, =0x0000ffff - ldr r6, =gUnknown_08524B44 - ldr r4, =gUnknown_0203840A -_080A404A: - ldrh r0, [r4] - cmp r0, r7 - beq _080A406E - lsls r0, 3 - adds r0, r6 - ldrh r0, [r0, 0x6] - bl FreeObjectTilesByTag - ldrh r0, [r4] - lsls r0, 3 - adds r0, r6 - ldrh r0, [r0, 0x6] - bl FreeObjectPaletteByTag - ldrh r1, [r4] - adds r0, r7, 0 - orrs r0, r1 - strh r0, [r4] -_080A406E: - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x7 - ble _080A404A - mov r1, r8 - cmp r1, 0 - bne _080A40A2 - ldr r0, =gMPlay_BGM - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl m4aMPlayVolumeControl - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A409C - bl sub_80A8278 - movs r0, 0x1 - bl sub_8072A88 -_080A409C: - ldr r0, =gUnknown_020383FD - mov r1, r8 - strb r1, [r0] -_080A40A2: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3FC4 - - thumb_func_start ma09_play_sound -ma09_play_sound: @ 80A40CC - push {r4,lr} - ldr r4, =gUnknown_020383F0 - ldr r0, [r4] - adds r1, r0, 0x1 - str r1, [r4] - ldrb r0, [r0, 0x1] - ldrb r1, [r1, 0x1] - lsls r1, 8 - orrs r0, r1 - bl audio_play - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ma09_play_sound - - thumb_func_start sub_80A40F4 -sub_80A40F4: @ 80A40F4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - mov r8, r1 - adds r6, r0, r1 - ldr r1, =gUnknown_020241E4 - movs r2, 0 - ldrsh r0, [r6, r2] - adds r0, r1 - ldrb r5, [r0] - ldr r1, =gUnknown_02020630 - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r4, r0, r1 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - movs r3, 0x4 - ldrsh r0, [r6, r3] - cmp r0, 0 - bne _080A4148 - adds r0, r7, 0 - bl move_anim_task_del - b _080A41BE - .pool -_080A4148: - ldr r0, =task_pA_ma0A_obj_to_bg_pal - movs r1, 0xA - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - mov r1, r8 - subs r1, 0x8 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0, r1 - strh r5, [r1, 0x8] - ldrh r0, [r4, 0x24] - ldrh r3, [r4, 0x20] - adds r0, r3 - strh r0, [r1, 0xA] - ldrh r0, [r4, 0x26] - ldrh r4, [r4, 0x22] - adds r0, r4 - strh r0, [r1, 0xC] - movs r3, 0x2 - ldrsh r0, [r6, r3] - cmp r0, 0 - bne _080A4190 - ldr r0, =gUnknown_02022E18 - ldrh r0, [r0] - strh r0, [r1, 0xE] - ldr r0, =gUnknown_02022E1A - b _080A4198 - .pool -_080A4190: - ldr r0, =gUnknown_02022E1C - ldrh r0, [r0] - strh r0, [r1, 0xE] - ldr r0, =gUnknown_02022E1E -_080A4198: - ldrh r0, [r0] - strh r0, [r1, 0x10] - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r6, 0x2] - strh r1, [r0, 0x12] - ldrh r1, [r6] - strh r1, [r0, 0x14] - ldr r1, =gUnknown_02038430 - movs r3, 0x6 - ldrsh r0, [r6, r3] - adds r0, r1 - strb r2, [r0] - adds r0, r7, 0 - bl move_anim_task_del -_080A41BE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A40F4 - - thumb_func_start sub_80A41D8 -sub_80A41D8: @ 80A41D8 - push {r4,r5,lr} - ldr r1, =gUnknown_020383F0 - ldr r2, [r1] - adds r0, r2, 0x1 - str r0, [r1] - ldrb r0, [r2, 0x1] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080A41F8 - ldr r0, =gUnknown_02038437 - b _080A41FA - .pool -_080A41F8: - ldr r0, =gUnknown_02038436 -_080A41FA: - ldrb r4, [r0] - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A4266 - adds r0, r4, 0 - bl battle_get_per_side_status - lsls r0, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _080A4226 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A4230 -_080A4226: - movs r5, 0 - b _080A4232 - .pool -_080A4230: - movs r5, 0x1 -_080A4232: - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0 - bl sub_80A438C - ldr r0, =sub_80A40F4 - movs r1, 0xA - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gUnknown_020383FE - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - movs r2, 0 - strh r4, [r0, 0x8] - strh r5, [r0, 0xA] - movs r1, 0x1 - strh r1, [r0, 0xC] - strh r2, [r0, 0xE] -_080A4266: - movs r0, 0x2 - eors r4, r0 - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A42D8 - adds r0, r4, 0 - bl battle_get_per_side_status - lsls r0, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _080A4294 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A42A4 -_080A4294: - movs r5, 0 - b _080A42A6 - .pool -_080A42A4: - movs r5, 0x1 -_080A42A6: - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0 - bl sub_80A438C - ldr r0, =sub_80A40F4 - movs r1, 0xA - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gUnknown_020383FE - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - strh r4, [r0, 0x8] - strh r5, [r0, 0xA] - movs r1, 0x1 - strh r1, [r0, 0xC] - strh r1, [r0, 0xE] -_080A42D8: - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r1, =gUnknown_020383FC - movs r0, 0x1 - strb r0, [r1] - ldr r1, =gUnknown_020383F8 - ldr r0, =move_anim_waiter - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A41D8 - - thumb_func_start b_side_obj__get_some_boolean -b_side_obj__get_some_boolean: @ 80A4310 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A4330 - ldr r0, =gUnknown_02038436 - ldrb r0, [r0] - cmp r4, r0 - beq _080A4374 - b _080A4384 - .pool -_080A4330: - adds r0, r4, 0 - bl sub_80A6A90 - lsls r0, 24 - cmp r0, 0 - beq _080A4384 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A4374 - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r5, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080A4374 - ldr r2, =gUnknown_02020630 - ldr r0, =gUnknown_020241E4 - adds r0, r5, r0 - 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 _080A4384 -_080A4374: - movs r0, 0x1 - b _080A4386 - .pool -_080A4384: - movs r0, 0 -_080A4386: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end b_side_obj__get_some_boolean - - thumb_func_start sub_80A438C -sub_80A438C: @ 80A438C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x28 - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - lsls r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - cmp r1, 0 - beq _080A43AA - b _080A455E -_080A43AA: - bl sub_80A4DF0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080A43DC - ldr r1, =0x06008000 - movs r2, 0x80 - lsls r2, 6 - movs r0, 0 - movs r3, 0x1 - bl RequestDma3Fill - ldr r1, =0x0600f000 - movs r2, 0x80 - lsls r2, 5 - movs r0, 0xFF - movs r3, 0 - bl RequestDma3Fill - b _080A43F8 - .pool -_080A43DC: - ldr r1, =0x06004000 - movs r2, 0x80 - lsls r2, 6 - movs r0, 0 - movs r3, 0x1 - bl RequestDma3Fill - ldr r1, =0x0600e000 - movs r2, 0x80 - lsls r2, 5 - movs r0, 0xFF - movs r3, 0 - bl RequestDma3Fill -_080A43F8: - add r0, sp, 0x10 - bl sub_80A6B30 - add r0, sp, 0x20 - movs r1, 0 - strh r1, [r0] - ldr r1, [sp, 0x10] - ldr r2, =0x01000800 - bl CpuSet - mov r0, sp - adds r0, 0x22 - movs r1, 0xFF - strh r1, [r0] - ldr r1, [sp, 0x14] - ldr r2, =0x01000400 - bl CpuSet - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x2 - bl lcd_bg_operations - movs r0, 0x1 - movs r1, 0 - movs r2, 0x1 - bl lcd_bg_operations - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - bl lcd_bg_operations - ldr r0, =gUnknown_020241E4 - adds r0, r6, r0 - ldrb r4, [r0] - ldr r5, =gUnknown_02022E18 - ldr r0, =gUnknown_02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x24] - ldrh r1, [r1, 0x20] - adds r0, r1 - negs r0, r0 - adds r0, 0x20 - strh r0, [r5] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A447A - ldr r0, =gUnknown_02039F34 - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldrh r0, [r0] - bl sub_80DB2A8 - lsls r0, 24 - cmp r0, 0 - beq _080A447A - ldrh r0, [r5] - subs r0, 0x1 - strh r0, [r5] -_080A447A: - ldr r5, =gUnknown_02022E1A - ldr r2, =gUnknown_02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x26] - ldrh r1, [r1, 0x22] - adds r0, r1 - negs r0, r0 - adds r0, 0x20 - strh r0, [r5] - mov r0, r9 - cmp r0, 0 - beq _080A44B0 - ldr r0, =gUnknown_020241E4 - adds r0, r6, r0 - 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] -_080A44B0: - ldr r0, =gUnknown_02022E18 - ldrh r1, [r0] - movs r0, 0x14 - bl SetGpuReg - ldrh r1, [r5] - movs r0, 0x16 - bl SetGpuReg - lsls r4, r6, 5 - ldr r0, =gPlttBufferUnfaded + 0x200 - adds r4, r0 - add r0, sp, 0x10 - ldrb r1, [r0, 0x8] - lsls r1, 4 - adds r0, r4, 0 - movs r2, 0x20 - bl LoadPalette - add r0, sp, 0x10 - ldrb r1, [r0, 0x8] - lsls r1, 5 - movs r0, 0xA0 - lsls r0, 19 - adds r1, r0 - ldr r2, =0x04000008 - adds r0, r4, 0 - bl CpuSet - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A4524 - movs r3, 0 - b _080A452E - .pool -_080A4524: - adds r0, r6, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r3, r0, 24 -_080A452E: - add r0, sp, 0x10 - ldrb r0, [r0, 0x8] - str r0, [sp] - ldr r0, [sp, 0x10] - str r0, [sp, 0x4] - ldr r0, [sp, 0x14] - str r0, [sp, 0x8] - add r0, sp, 0x10 - ldrh r0, [r0, 0xA] - str r0, [sp, 0xC] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl sub_8118FBC - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A4558 - b _080A4666 -_080A4558: - bl sub_80A46A0 - b _080A4666 -_080A455E: - ldr r1, =0x06006000 - movs r2, 0x80 - lsls r2, 6 - movs r0, 0 - movs r3, 0x1 - bl RequestDma3Fill - ldr r1, =0x0600f000 - movs r7, 0x80 - lsls r7, 5 - movs r0, 0 - adds r2, r7, 0 - movs r3, 0x1 - bl RequestDma3Fill - add r0, sp, 0x10 - movs r1, 0x2 - bl sub_80A6B90 - add r0, sp, 0x24 - movs r4, 0 - strh r4, [r0] - ldr r1, [sp, 0x10] - adds r1, r7 - ldr r2, =0x01000800 - bl CpuSet - mov r0, sp - adds r0, 0x26 - strh r4, [r0] - ldr r1, [sp, 0x14] - movs r2, 0x80 - lsls r2, 4 - mov r8, r2 - add r1, r8 - ldr r2, =0x01000400 - bl CpuSet - movs r0, 0x2 - movs r1, 0x4 - movs r2, 0x2 - bl lcd_bg_operations - movs r0, 0x2 - movs r1, 0 - movs r2, 0x1 - bl lcd_bg_operations - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0 - bl lcd_bg_operations - ldr r0, =gUnknown_020241E4 - adds r2, r5, r0 - ldrb r4, [r2] - ldr r5, =gUnknown_02022E1C - ldr r3, =gUnknown_02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r1, 0x24] - ldrh r4, [r1, 0x20] - adds r0, r4 - negs r0, r0 - adds r0, 0x20 - strh r0, [r5] - ldr r4, =gUnknown_02022E1E - ldrh r0, [r1, 0x26] - ldrh r1, [r1, 0x22] - adds r0, r1 - negs r0, r0 - adds r0, 0x20 - strh r0, [r4] - mov r0, r9 - cmp r0, 0 - beq _080A460E - 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] -_080A460E: - ldrh r1, [r5] - movs r0, 0x18 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x1A - bl SetGpuReg - lsls r4, r6, 5 - ldr r0, =gPlttBufferUnfaded + 0x200 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x90 - movs r2, 0x20 - bl LoadPalette - ldr r1, =0x05000120 - ldr r2, =0x04000008 - adds r0, r4, 0 - bl CpuSet - adds r0, r6, 0 - bl battle_get_per_side_status - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - add r0, sp, 0x10 - ldrb r0, [r0, 0x8] - str r0, [sp] - ldr r0, [sp, 0x10] - adds r0, r7 - str r0, [sp, 0x4] - ldr r0, [sp, 0x14] - add r0, r8 - str r0, [sp, 0x8] - add r0, sp, 0x10 - ldrh r0, [r0, 0xA] - str r0, [sp, 0xC] - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl sub_8118FBC -_080A4666: - add sp, 0x28 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A438C - - thumb_func_start sub_80A46A0 -sub_80A46A0: @ 80A46A0 - push {r4-r7,lr} - sub sp, 0x10 - ldr r0, =gUnknown_02039F34 - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldrh r0, [r0] - bl sub_80DB2A8 - lsls r0, 24 - cmp r0, 0 - beq _080A4712 - mov r0, sp - bl sub_80A6B30 - ldr r6, [sp, 0x4] - movs r5, 0 - movs r0, 0x7 - mov r12, r0 - movs r7, 0 -_080A46C6: - movs r4, 0 - adds r3, r7, r6 - mov r1, r12 - lsls r0, r1, 1 - adds r2, r0, r6 -_080A46D0: - ldrh r1, [r3] - ldrh r0, [r2] - strh r0, [r3] - strh r1, [r2] - adds r3, 0x2 - subs r2, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _080A46D0 - movs r0, 0x20 - add r12, r0 - adds r7, 0x40 - adds r5, 0x1 - cmp r5, 0x7 - ble _080A46C6 - movs r5, 0 - movs r1, 0x80 - lsls r1, 3 - adds r3, r1, 0 -_080A46F6: - adds r2, r5, 0x1 - lsls r0, r5, 6 - adds r1, r0, r6 - movs r4, 0x7 -_080A46FE: - ldrh r0, [r1] - eors r0, r3 - strh r0, [r1] - adds r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _080A46FE - adds r5, r2, 0 - cmp r5, 0x7 - ble _080A46F6 -_080A4712: - add sp, 0x10 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A46A0 - - thumb_func_start sub_80A4720 -sub_80A4720: @ 80A4720 - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r1 - adds r6, r2, 0 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r3, 24 - movs r0, 0x40 - mov r12, r0 - cmp r3, 0 - bne _080A473C - movs r1, 0x20 - mov r12, r1 -_080A473C: - lsls r0, r5, 28 - lsrs r5, r0, 16 - movs r0, 0 - cmp r0, r12 - bge _080A476C - ldr r7, =0x00000fff -_080A4748: - adds r4, r0, 0x1 - lsls r0, 6 - mov r1, r8 - adds r3, r0, r1 - movs r2, 0x1F -_080A4752: - ldrh r1, [r3] - adds r0, r7, 0 - ands r0, r1 - orrs r0, r5 - adds r0, r6 - strh r0, [r3] - adds r3, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _080A4752 - adds r0, r4, 0 - cmp r0, r12 - blt _080A4748 -_080A476C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A4720 - - thumb_func_start sub_80A477C -sub_80A477C: @ 80A477C - push {r4,lr} - sub sp, 0x10 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - mov r0, sp - bl sub_80A6B30 - cmp r4, 0 - beq _080A479C - bl sub_80A4DF0 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _080A47B8 -_080A479C: - movs r0, 0x1 - bl sub_80A6C68 - ldr r0, =gUnknown_02022E18 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E1A - strh r1, [r0] - b _080A47C6 - .pool -_080A47B8: - movs r0, 0x2 - bl sub_80A6C68 - ldr r0, =gUnknown_02022E1C - strh r4, [r0] - ldr r0, =gUnknown_02022E1E - strh r4, [r0] -_080A47C6: - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A477C - - thumb_func_start task_pA_ma0A_obj_to_bg_pal -@ void task_pA_ma0A_obj_to_bg_pal(int task_id) -task_pA_ma0A_obj_to_bg_pal: @ 80A47D8 - push {r4-r6,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r5, r1, r2 - ldrb r4, [r5, 0x8] - ldrb r6, [r5, 0x14] - mov r0, sp - bl sub_80A6B30 - ldr r0, =gUnknown_02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - ldrh r2, [r1, 0x24] - ldrh r0, [r1, 0x20] - adds r2, r0 - ldrh r0, [r5, 0xA] - subs r0, r2 - lsls r0, 16 - lsrs r3, r0, 16 - ldrh r2, [r1, 0x26] - ldrh r1, [r1, 0x22] - adds r2, r1 - ldrh r0, [r5, 0xC] - subs r0, r2 - lsls r0, 16 - lsrs r2, r0, 16 - movs r1, 0x12 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _080A4870 - ldr r1, =gUnknown_02022E18 - lsls r0, r3, 16 - asrs r0, 16 - ldrh r3, [r5, 0xE] - adds r0, r3 - strh r0, [r1] - ldr r1, =gUnknown_02022E1A - lsls r0, r2, 16 - asrs r0, 16 - ldrh r5, [r5, 0x10] - adds r0, r5 - strh r0, [r1] - lsls r0, r6, 5 - ldr r2, =gPlttBufferFaded + 0x200 - adds r0, r2 - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 5 - ldr r3, =0xfffffe00 - adds r2, r3 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - b _080A4896 - .pool -_080A4870: - ldr r1, =gUnknown_02022E1C - lsls r0, r3, 16 - asrs r0, 16 - ldrh r3, [r5, 0xE] - adds r0, r3 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - lsls r0, r2, 16 - asrs r0, 16 - ldrh r5, [r5, 0x10] - adds r0, r5 - strh r0, [r1] - lsls r0, r6, 5 - ldr r1, =gPlttBufferFaded + 0x200 - adds r0, r1 - subs r1, 0xE0 - ldr r2, =0x04000008 - bl CpuSet -_080A4896: - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end task_pA_ma0A_obj_to_bg_pal - - thumb_func_start ma0B_0807324C -ma0B_0807324C: @ 80A48B0 - push {r4,r5,lr} - ldr r0, =gUnknown_020383F0 - ldr r2, [r0] - adds r1, r2, 0x1 - str r1, [r0] - ldrb r4, [r2, 0x1] - cmp r4, 0 - bne _080A48C8 - movs r4, 0x2 - b _080A48D2 - .pool -_080A48C8: - cmp r4, 0x1 - bne _080A48CE - movs r4, 0x3 -_080A48CE: - cmp r4, 0 - beq _080A48D6 -_080A48D2: - cmp r4, 0x2 - bne _080A48E0 -_080A48D6: - ldr r0, =gUnknown_02038436 - b _080A48E2 - .pool -_080A48E0: - ldr r0, =gUnknown_02038437 -_080A48E2: - ldrb r5, [r0] - ldr r3, =gUnknown_02038430 - ldrb r0, [r3] - cmp r0, 0xFF - beq _080A4908 - ldr r2, =gUnknown_02020630 - ldr r0, =gUnknown_020241E4 - adds r0, r5, r0 - ldrb r1, [r0] - 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] -_080A4908: - cmp r4, 0x1 - bls _080A4948 - ldrb r0, [r3, 0x1] - cmp r0, 0xFF - beq _080A4948 - ldr r3, =gUnknown_02020630 - ldr r2, =gUnknown_020241E4 - movs r1, 0x2 - adds r0, r5, 0 - eors r0, r1 - adds r0, r2 - ldrb r1, [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] - b _080A494A - .pool -_080A4948: - movs r4, 0 -_080A494A: - ldr r0, =sub_80A4980 - 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, 0x8] - strh r5, [r1, 0xC] - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ma0B_0807324C - - thumb_func_start sub_80A4980 -sub_80A4980: @ 80A4980 - 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 r1, r0, r1 - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - beq _080A4A0A - ldrb r0, [r1, 0xC] - bl battle_get_per_side_status - lsls r0, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _080A49BC - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A49C4 -_080A49BC: - movs r4, 0 - b _080A49C6 - .pool -_080A49C4: - movs r4, 0x1 -_080A49C6: - ldr r6, =gUnknown_02038430 - ldrb r0, [r6] - cmp r0, 0xFF - beq _080A49DE - adds r0, r4, 0 - bl sub_80A477C - ldrb r0, [r6] - bl DestroyTask - movs r0, 0xFF - strb r0, [r6] -_080A49DE: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0x1 - ble _080A4A04 - movs r0, 0x1 - eors r4, r0 - adds r0, r4, 0 - bl sub_80A477C - ldrb r0, [r6, 0x1] - bl DestroyTask - movs r0, 0xFF - strb r0, [r6, 0x1] -_080A4A04: - adds r0, r5, 0 - bl DestroyTask -_080A4A0A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A4980 - - thumb_func_start sub_80A4A18 -sub_80A4A18: @ 80A4A18 - push {r4,r5,lr} - ldr r0, =gUnknown_020383F0 - ldr r2, [r0] - adds r1, r2, 0x1 - str r1, [r0] - ldrb r5, [r2, 0x1] - cmp r5, 0 - bne _080A4A30 - movs r5, 0x2 - b _080A4A3A - .pool -_080A4A30: - cmp r5, 0x1 - bne _080A4A36 - movs r5, 0x3 -_080A4A36: - cmp r5, 0 - beq _080A4A3E -_080A4A3A: - cmp r5, 0x2 - bne _080A4A48 -_080A4A3E: - ldr r0, =gUnknown_02038436 - b _080A4A4A - .pool -_080A4A48: - ldr r0, =gUnknown_02038437 -_080A4A4A: - ldrb r4, [r0] - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A4A8A - adds r0, r4, 0 - bl battle_get_per_side_status - lsls r0, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _080A4A76 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A4A80 -_080A4A76: - movs r1, 0 - b _080A4A82 - .pool -_080A4A80: - movs r1, 0x1 -_080A4A82: - adds r0, r4, 0 - movs r2, 0 - bl sub_80A438C -_080A4A8A: - movs r0, 0x2 - eors r4, r0 - cmp r5, 0x1 - bls _080A4ACA - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A4ACA - adds r0, r4, 0 - bl battle_get_per_side_status - lsls r0, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _080A4ABC - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A4AC0 -_080A4ABC: - movs r1, 0 - b _080A4AC2 -_080A4AC0: - movs r1, 0x1 -_080A4AC2: - adds r0, r4, 0 - movs r2, 0 - bl sub_80A438C -_080A4ACA: - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A4A18 - - thumb_func_start ma23_8073484 -ma23_8073484: @ 80A4ADC - push {r4-r6,lr} - ldr r0, =gUnknown_020383F0 - ldr r2, [r0] - adds r1, r2, 0x1 - str r1, [r0] - ldrb r5, [r2, 0x1] - cmp r5, 0 - bne _080A4AF4 - movs r5, 0x2 - b _080A4AFE - .pool -_080A4AF4: - cmp r5, 0x1 - bne _080A4AFA - movs r5, 0x3 -_080A4AFA: - cmp r5, 0 - beq _080A4B02 -_080A4AFE: - cmp r5, 0x2 - bne _080A4B0C -_080A4B02: - ldr r0, =gUnknown_02038436 - b _080A4B0E - .pool -_080A4B0C: - ldr r0, =gUnknown_02038437 -_080A4B0E: - ldrb r6, [r0] - adds r0, r6, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A4B38 - ldr r2, =gUnknown_02020630 - ldr r0, =gUnknown_020241E4 - adds r0, r6, r0 - ldrb r1, [r0] - 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] -_080A4B38: - cmp r5, 0x1 - bls _080A4B78 - movs r0, 0x2 - adds r4, r6, 0 - eors r4, r0 - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A4B78 - ldr r2, =gUnknown_02020630 - ldr r0, =gUnknown_020241E4 - adds r0, r4, r0 - ldrb r1, [r0] - 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] - b _080A4B7A - .pool -_080A4B78: - movs r5, 0 -_080A4B7A: - ldr r0, =sub_80A4BB0 - 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 r5, [r1, 0x8] - strh r6, [r1, 0xC] - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ma23_8073484 - - thumb_func_start sub_80A4BB0 -sub_80A4BB0: @ 80A4BB0 - 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 r1, r0, r1 - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - beq _080A4C3E - ldrb r4, [r1, 0xC] - adds r0, r4, 0 - bl battle_get_per_side_status - lsls r0, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _080A4BEE - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A4BF8 -_080A4BEE: - movs r5, 0 - b _080A4BFA - .pool -_080A4BF8: - movs r5, 0x1 -_080A4BFA: - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A4C0C - adds r0, r5, 0 - bl sub_80A477C -_080A4C0C: - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0x1 - ble _080A4C38 - movs r0, 0x2 - eors r4, r0 - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A4C38 - movs r0, 0x1 - eors r5, r0 - adds r0, r5, 0 - bl sub_80A477C -_080A4C38: - adds r0, r6, 0 - bl DestroyTask -_080A4C3E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A4BB0 - - thumb_func_start ma0C_set_BLDCNT_to_x3F40_and_BLDALPHA_to_argument -ma0C_set_BLDCNT_to_x3F40_and_BLDALPHA_to_argument: @ 80A4C48 - push {r4,r5,lr} - ldr r2, =gUnknown_020383F0 - ldr r0, [r2] - adds r1, r0, 0x1 - str r1, [r2] - ldrb r5, [r0, 0x1] - adds r0, r1, 0x1 - str r0, [r2] - ldrb r4, [r1, 0x1] - lsls r4, 8 - adds r0, 0x1 - str r0, [r2] - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - orrs r5, r4 - movs r0, 0x52 - adds r1, r5, 0 - bl SetGpuReg - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ma0C_set_BLDCNT_to_x3F40_and_BLDALPHA_to_argument - - thumb_func_start ma1E_set_BLDCNT -ma1E_set_BLDCNT: @ 80A4C80 - push {lr} - ldr r3, =gUnknown_020383F0 - ldr r0, [r3] - adds r2, r0, 0x1 - str r2, [r3] - ldrb r1, [r0, 0x1] - adds r0, r2, 0x1 - str r0, [r3] - ldrb r2, [r2, 0x1] - lsls r2, 8 - adds r0, 0x1 - str r0, [r3] - orrs r1, r2 - movs r0, 0x50 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end ma1E_set_BLDCNT - - thumb_func_start ma0D_reset_BLDCNT_and_BLDALPHA -ma0D_reset_BLDCNT_and_BLDALPHA: @ 80A4CA8 - push {lr} - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end ma0D_reset_BLDCNT_and_BLDALPHA - - thumb_func_start ma0E_call -ma0E_call: @ 80A4CCC - push {r4,lr} - ldr r4, =gUnknown_020383F0 - ldr r1, [r4] - adds r3, r1, 0x1 - str r3, [r4] - ldr r2, =gUnknown_020383F4 - adds r0, r1, 0x5 - str r0, [r2] - ldrb r1, [r1, 0x1] - ldrb r0, [r3, 0x1] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r3, 0x2] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r3, 0x3] - lsls r0, 24 - adds r1, r0 - str r1, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ma0E_call - - thumb_func_start sub_80A4D00 -sub_80A4D00: @ 80A4D00 - ldr r0, =gUnknown_020383F0 - ldr r1, =gUnknown_020383F4 - ldr r1, [r1] - str r1, [r0] - bx lr - .pool - thumb_func_end sub_80A4D00 - - thumb_func_start ma10_080736AC -ma10_080736AC: @ 80A4D14 - push {r4,r5,lr} - ldr r5, =gUnknown_020383F0 - ldr r1, [r5] - adds r0, r1, 0x1 - str r0, [r5] - ldrb r2, [r1, 0x1] - adds r3, r0, 0x1 - str r3, [r5] - ldrb r4, [r0, 0x1] - ldrb r0, [r3, 0x1] - lsls r0, 8 - orrs r4, r0 - adds r1, 0x4 - str r1, [r5] - ldr r0, =gUnknown_0203841E - lsls r2, 1 - adds r2, r0 - strh r4, [r2] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ma10_080736AC - - thumb_func_start ma11_if_else -ma11_if_else: @ 80A4D48 - push {lr} - ldr r3, =gUnknown_020383F0 - ldr r2, [r3] - adds r0, r2, 0x1 - str r0, [r3] - ldr r0, =gUnknown_02038432 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080A4D62 - adds r0, r2, 0x5 - str r0, [r3] -_080A4D62: - ldr r2, [r3] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - adds r1, r0 - str r1, [r3] - pop {r0} - bx r0 - .pool - thumb_func_end ma11_if_else - - thumb_func_start ma12_cond_if -ma12_cond_if: @ 80A4D88 - push {r4,r5,lr} - ldr r5, =gUnknown_020383F0 - ldr r4, [r5] - adds r2, r4, 0x1 - str r2, [r5] - ldrb r1, [r4, 0x1] - adds r3, r2, 0x1 - str r3, [r5] - ldr r0, =gUnknown_02038432 - ldrb r0, [r0] - cmp r1, r0 - bne _080A4DC0 - ldrb r1, [r2, 0x1] - ldrb r0, [r3, 0x1] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r3, 0x2] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r3, 0x3] - lsls r0, 24 - adds r1, r0 - str r1, [r5] - b _080A4DC4 - .pool -_080A4DC0: - adds r0, r4, 0x6 - str r0, [r5] -_080A4DC4: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end ma12_cond_if - - thumb_func_start ma13_goto -ma13_goto: @ 80A4DCC - ldr r3, =gUnknown_020383F0 - ldr r0, [r3] - adds r2, r0, 0x1 - str r2, [r3] - ldrb r1, [r0, 0x1] - ldrb r0, [r2, 0x1] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - adds r1, r0 - str r1, [r3] - bx lr - .pool - thumb_func_end ma13_goto - - thumb_func_start sub_80A4DF0 -sub_80A4DF0: @ 80A4DF0 - push {lr} - ldr r0, =gUnknown_030022C0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080A4E10 - movs r0, 0 - b _080A4E12 - .pool -_080A4E10: - movs r0, 0x1 -_080A4E12: - pop {r1} - bx r1 - thumb_func_end sub_80A4DF0 - - thumb_func_start ma14_load_background -ma14_load_background: @ 80A4E18 - push {r4,lr} - ldr r1, =gUnknown_020383F0 - ldr r2, [r1] - adds r0, r2, 0x1 - str r0, [r1] - ldrb r4, [r2, 0x1] - adds r0, 0x1 - str r0, [r1] - ldr r0, =task_p5_load_battle_screen_elements - 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, 0x8] - ldr r1, =gUnknown_02038433 - movs r0, 0x1 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ma14_load_background - - thumb_func_start sub_80A4E5C -sub_80A4E5C: @ 80A4E5C - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r2, =gUnknown_020383F0 - ldr r1, [r2] - adds r0, r1, 0x1 - str r0, [r2] - ldrb r3, [r1, 0x1] - mov r8, r3 - ldrb r7, [r0, 0x1] - ldrb r6, [r0, 0x2] - adds r1, 0x4 - str r1, [r2] - ldr r0, =task_p5_load_battle_screen_elements - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A4EA8 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - strh r6, [r0, 0x8] - b _080A4EDA - .pool -_080A4EA8: - ldr r0, =gUnknown_02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080A4ECC - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - strh r7, [r0, 0x8] - b _080A4EDA - .pool -_080A4ECC: - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - mov r1, r8 - strh r1, [r0, 0x8] -_080A4EDA: - ldr r1, =gUnknown_02038433 - movs r0, 0x1 - strb r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A4E5C - - thumb_func_start task_p5_load_battle_screen_elements -task_p5_load_battle_screen_elements: @ 80A4EF4 - 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 r4, r0, r1 - ldrh r6, [r4, 0x1C] - movs r0, 0x1C - ldrsh r3, [r4, r0] - adds r7, r1, 0 - cmp r3, 0 - bne _080A4F2C - str r3, [sp] - movs r0, 0xE8 - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginHardwarePaletteFade - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - strh r0, [r4, 0x1C] - b _080A4FBC - .pool -_080A4F2C: - ldr r2, =gPaletteFade - ldrb r1, [r2, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080A4FBC - cmp r3, 0x1 - bne _080A4F50 - adds r0, r6, 0x1 - strh r0, [r4, 0x1C] - ldr r1, =gUnknown_02038433 - movs r0, 0x2 - strb r0, [r1] - b _080A4F94 - .pool -_080A4F50: - cmp r3, 0x2 - bne _080A4F94 - ldrh r0, [r4, 0x8] - lsls r2, r0, 16 - asrs r1, r2, 16 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _080A4F68 - bl dp01t_11_3_message_for_player_only - b _080A4F6E -_080A4F68: - lsrs r0, r2, 16 - bl sub_80A4FC8 -_080A4F6E: - movs r0, 0x1 - str r0, [sp] - movs r0, 0xE8 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginHardwarePaletteFade - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x1C] - adds r1, 0x1 - strh r1, [r0, 0x1C] - b _080A4FBC - .pool -_080A4F94: - ldrb r1, [r2, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _080A4FBC - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r7 - movs r1, 0x1C - ldrsh r0, [r0, r1] - cmp r0, 0x3 - bne _080A4FBC - adds r0, r5, 0 - bl DestroyTask - ldr r0, =gUnknown_02038433 - strb r4, [r0] -_080A4FBC: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end task_p5_load_battle_screen_elements - - thumb_func_start sub_80A4FC8 -sub_80A4FC8: @ 80A4FC8 - push {r4-r7,lr} - lsls r0, 16 - lsrs r7, r0, 16 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A5050 - ldr r6, =gUnknown_08525D54 - lsls r4, r7, 1 - adds r4, r7 - lsls r4, 2 - adds r0, r6, 0 - adds r0, 0x8 - adds r0, r4, r0 - ldr r0, [r0] - ldr r5, =0x0201c000 - adds r1, r5, 0 - bl LZDecompressWram - bl sub_80A6D94 - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 1 - adds r1, r5, 0 - movs r3, 0 - bl sub_80A4720 - ldr r1, =0x0600d000 - ldr r0, =0x040000d4 - str r5, [r0] - str r1, [r0, 0x4] - ldr r1, =0x84000200 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] - adds r0, r4, r6 - ldr r0, [r0] - ldr r1, =0x06002000 - bl LZDecompressVram - adds r6, 0x4 - adds r4, r6 - ldr r4, [r4] - bl sub_80A6D94 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 20 - adds r0, r4, 0 - movs r2, 0x20 - bl LoadCompressedPalette - b _080A507E - .pool -_080A5050: - ldr r5, =gUnknown_08525D54 - lsls r4, r7, 1 - adds r4, r7 - lsls r4, 2 - adds r0, r5, 0 - adds r0, 0x8 - adds r0, r4, r0 - ldr r0, [r0] - ldr r1, =0x0600d000 - bl LZDecompressVram - adds r0, r4, r5 - ldr r0, [r0] - ldr r1, =0x06008000 - bl LZDecompressVram - adds r5, 0x4 - adds r4, r5 - ldr r0, [r4] - movs r1, 0x20 - movs r2, 0x20 - bl LoadCompressedPalette -_080A507E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A4FC8 - - thumb_func_start dp01t_11_3_message_for_player_only -dp01t_11_3_message_for_player_only: @ 80A5090 - push {lr} - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A50A2 - bl sub_80D7724 - b _080A50A6 -_080A50A2: - bl load_battle_oval_graphics -_080A50A6: - pop {r0} - bx r0 - thumb_func_end dp01t_11_3_message_for_player_only - - thumb_func_start ma15_load_battle_screen_elements -ma15_load_battle_screen_elements: @ 80A50AC - push {lr} - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r0, =task_p5_load_battle_screen_elements - 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 - ldr r0, =0x0000ffff - strh r0, [r1, 0x8] - ldr r1, =gUnknown_02038433 - movs r0, 0x1 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end ma15_load_battle_screen_elements - - thumb_func_start ma16_wait_for_battle_screen_elements_s2 -ma16_wait_for_battle_screen_elements_s2: @ 80A50F0 - push {lr} - ldr r0, =gUnknown_02038433 - ldrb r0, [r0] - cmp r0, 0x2 - bne _080A5114 - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r1, =gUnknown_020383FC - movs r0, 0 - b _080A5118 - .pool -_080A5114: - ldr r1, =gUnknown_020383FC - movs r0, 0x1 -_080A5118: - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end ma16_wait_for_battle_screen_elements_s2 - - thumb_func_start sub_80A5124 -sub_80A5124: @ 80A5124 - push {lr} - ldr r0, =gUnknown_02038433 - ldrb r2, [r0] - cmp r2, 0 - bne _080A5148 - ldr r0, =gUnknown_020383F0 - ldr r1, [r0] - adds r1, 0x1 - str r1, [r0] - ldr r0, =gUnknown_020383FC - strb r2, [r0] - b _080A514E - .pool -_080A5148: - ldr r1, =gUnknown_020383FC - movs r0, 0x1 - strb r0, [r1] -_080A514E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A5124 - - thumb_func_start ma18_load_background_probably -ma18_load_background_probably: @ 80A5158 - push {r4,lr} - ldr r4, =gUnknown_020383F0 - ldr r1, [r4] - adds r0, r1, 0x1 - str r0, [r4] - ldrb r0, [r1, 0x1] - bl sub_80A4FC8 - ldr r0, [r4] - adds r0, 0x1 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ma18_load_background_probably - - thumb_func_start sub_80A5178 -sub_80A5178: @ 80A5178 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A51C0 - ldr r0, =gUnknown_020244D0 - ldr r1, [r0] - ldr r0, =gUnknown_02038436 - ldrb r2, [r0] - ldr r1, [r1, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080A51C0 - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - movs r4, 0xC0 - cmp r0, 0 - beq _080A5252 - movs r4, 0x3F - b _080A5252 - .pool -_080A51C0: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A51E8 - ldr r0, =gUnknown_02038436 - ldr r1, =gUnknown_02038437 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bne _080A524C - cmp r0, 0x2 - bne _080A524C - cmp r4, 0x3F - beq _080A525E - b _080A524C - .pool -_080A51E8: - ldr r0, =gUnknown_02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080A5226 - ldr r0, =gUnknown_02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080A5252 - lsls r0, r4, 24 - asrs r1, r0, 24 - cmp r1, 0x3F - bne _080A5218 - movs r4, 0xC0 - b _080A5252 - .pool -_080A5218: - movs r0, 0x40 - negs r0, r0 - cmp r1, r0 - beq _080A5252 - negs r0, r1 - lsls r0, 24 - b _080A5250 -_080A5226: - ldr r0, =gUnknown_02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080A524C - lsls r0, r4, 24 - asrs r0, 24 - movs r1, 0x40 - negs r1, r1 - cmp r0, r1 - bne _080A5252 - movs r4, 0x3F - b _080A5252 - .pool -_080A524C: - lsls r0, r4, 24 - negs r0, r0 -_080A5250: - lsrs r4, r0, 24 -_080A5252: - lsls r0, r4, 24 - asrs r0, 24 - cmp r0, 0x3F - ble _080A525E - movs r4, 0x3F - b _080A526C -_080A525E: - lsls r0, r4, 24 - asrs r0, 24 - movs r1, 0x40 - negs r1, r1 - cmp r0, r1 - bge _080A526C - movs r4, 0xC0 -_080A526C: - lsls r0, r4, 24 - asrs r0, 24 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80A5178 - - thumb_func_start sub_80A5278 -sub_80A5278: @ 80A5278 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A52C0 - ldr r0, =gUnknown_020244D0 - ldr r1, [r0] - ldr r0, =gUnknown_02038436 - ldrb r2, [r0] - ldr r1, [r1, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080A52C0 - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - movs r4, 0xC0 - cmp r0, 0 - beq _080A52DE - movs r4, 0x3F - b _080A52DE - .pool -_080A52C0: - ldr r0, =gUnknown_02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080A52D8 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A52DE -_080A52D8: - lsls r0, r4, 24 - negs r0, r0 - lsrs r4, r0, 24 -_080A52DE: - lsls r0, r4, 24 - asrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A5278 - - thumb_func_start sub_80A52EC -sub_80A52EC: @ 80A52EC - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - asrs r2, r0, 16 - cmp r2, 0x3F - ble _080A52FC - movs r1, 0x3F - b _080A5306 -_080A52FC: - movs r0, 0x40 - negs r0, r0 - cmp r2, r0 - bge _080A5306 - ldr r1, =0x0000ffc0 -_080A5306: - lsls r0, r1, 16 - asrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A52EC - - thumb_func_start sub_80A5314 -sub_80A5314: @ 80A5314 - push {lr} - lsls r2, 16 - lsrs r2, 16 - adds r3, r2, 0 - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - cmp r0, r1 - bge _080A5332 - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, 0 - bge _080A5342 - b _080A5340 -_080A5332: - cmp r0, r1 - ble _080A5348 - lsls r0, r3, 16 - asrs r0, 16 - cmp r0, 0 - bge _080A5340 - negs r0, r0 -_080A5340: - negs r0, r0 -_080A5342: - lsls r0, 16 - lsrs r0, 16 - b _080A534A -_080A5348: - movs r0, 0 -_080A534A: - lsls r0, 16 - asrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_80A5314 - - thumb_func_start ma19_08073BC8 -ma19_08073BC8: @ 80A5354 - push {r4,r5,lr} - ldr r5, =gUnknown_020383F0 - ldr r0, [r5] - adds r1, r0, 0x1 - str r1, [r5] - ldrb r4, [r0, 0x1] - ldrb r0, [r1, 0x1] - lsls r0, 8 - orrs r4, r0 - movs r0, 0x2 - ldrsb r0, [r1, r0] - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - adds r0, r4, 0 - bl audio_play_and_stuff - ldr r0, [r5] - adds r0, 0x3 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ma19_08073BC8 - - thumb_func_start ma1A_8073C00 -ma1A_8073C00: @ 80A538C - push {r4,lr} - ldr r4, =gUnknown_020383F0 - ldr r1, [r4] - adds r0, r1, 0x1 - str r0, [r4] - movs r0, 0x1 - ldrsb r0, [r1, r0] - bl sub_80A5178 - lsls r0, 24 - asrs r0, 24 - bl sub_80A3870 - ldr r0, [r4] - adds r0, 0x1 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ma1A_8073C00 - - thumb_func_start ma1B_8073C2C -ma1B_8073C2C: @ 80A53B8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =gUnknown_020383F0 - mov r10, r0 - ldr r0, [r0] - adds r1, r0, 0x1 - mov r2, r10 - str r1, [r2] - ldrb r0, [r0, 0x1] - mov r9, r0 - ldrb r0, [r1, 0x1] - lsls r0, 8 - mov r2, r9 - orrs r2, r0 - mov r9, r2 - ldrb r4, [r1, 0x3] - ldrb r6, [r1, 0x4] - ldrb r7, [r1, 0x5] - movs r0, 0x2 - ldrsb r0, [r1, r0] - bl sub_80A5178 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, 24 - asrs r4, 24 - adds r0, r4, 0 - bl sub_80A5178 - mov r8, r0 - lsls r5, 24 - asrs r5, 24 - mov r0, r8 - lsls r0, 24 - asrs r0, 24 - mov r8, r0 - lsls r6, 24 - asrs r6, 24 - adds r0, r5, 0 - mov r1, r8 - adds r2, r6, 0 - bl sub_80A5314 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =c3_08073CEC - 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, 0x8] - mov r2, r8 - strh r2, [r1, 0xA] - lsls r4, 24 - asrs r4, 24 - strh r4, [r1, 0xC] - strh r7, [r1, 0xE] - strh r5, [r1, 0x10] - mov r0, r9 - adds r1, r5, 0 - bl audio_play_and_stuff - ldr r1, =gUnknown_020383FF - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r1, r10 - ldr r0, [r1] - adds r0, 0x6 - str r0, [r1] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ma1B_8073C2C - - thumb_func_start c3_08073CEC -c3_08073CEC: @ 80A5478 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r7, 0 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r2, r0, r1 - ldrh r0, [r2, 0x18] - adds r1, r0, 0x1 - strh r1, [r2, 0x18] - lsls r0, 16 - asrs r0, 16 - movs r3, 0xE - ldrsh r1, [r2, r3] - cmp r0, r1 - blt _080A54FC - strh r7, [r2, 0x18] - ldrh r6, [r2, 0x8] - ldrh r3, [r2, 0xA] - movs r4, 0x10 - ldrsh r0, [r2, r4] - movs r4, 0xC - ldrsh r1, [r2, r4] - adds r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 - strh r4, [r2, 0x10] - cmp r1, 0 - bne _080A54C0 - lsls r2, r3, 16 - b _080A54E4 - .pool -_080A54C0: - lsls r1, r6, 16 - lsls r0, r3, 16 - asrs r3, r0, 16 - adds r2, r0, 0 - cmp r1, r2 - bge _080A54D6 - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, r3 - blt _080A54E0 - b _080A54E4 -_080A54D6: - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, r3 - bgt _080A54E0 - movs r7, 0x1 -_080A54E0: - cmp r7, 0 - beq _080A54F4 -_080A54E4: - lsrs r4, r2, 16 - adds r0, r5, 0 - bl DestroyTask - ldr r1, =gUnknown_020383FF - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] -_080A54F4: - lsls r0, r4, 24 - asrs r0, 24 - bl sub_80A3870 -_080A54FC: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end c3_08073CEC - - thumb_func_start sub_80A5508 -sub_80A5508: @ 80A5508 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - ldr r0, =gUnknown_020383F0 - mov r9, r0 - ldr r0, [r0] - adds r1, r0, 0x1 - mov r2, r9 - str r1, [r2] - ldrb r0, [r0, 0x1] - mov r8, r0 - ldrb r0, [r1, 0x1] - lsls r0, 8 - mov r2, r8 - orrs r2, r0 - mov r8, r2 - ldrb r4, [r1, 0x2] - ldrb r5, [r1, 0x3] - ldrb r6, [r1, 0x4] - ldrb r1, [r1, 0x5] - mov r10, r1 - ldr r0, =c3_08073CEC - 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 - lsls r4, 24 - asrs r4, 24 - strh r4, [r1, 0x8] - lsls r5, 24 - asrs r5, 24 - strh r5, [r1, 0xA] - lsls r6, 24 - asrs r6, 24 - strh r6, [r1, 0xC] - mov r0, r10 - strh r0, [r1, 0xE] - strh r4, [r1, 0x10] - mov r0, r8 - adds r1, r4, 0 - bl audio_play_and_stuff - ldr r1, =gUnknown_020383FF - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r1, r9 - ldr r0, [r1] - adds r0, 0x6 - str r0, [r1] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A5508 - - thumb_func_start sub_80A559C -sub_80A559C: @ 80A559C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =gUnknown_020383F0 - mov r10, r0 - ldr r0, [r0] - adds r1, r0, 0x1 - mov r2, r10 - str r1, [r2] - ldrb r0, [r0, 0x1] - mov r9, r0 - ldrb r0, [r1, 0x1] - lsls r0, 8 - mov r2, r9 - orrs r2, r0 - mov r9, r2 - ldrb r4, [r1, 0x3] - ldrb r0, [r1, 0x4] - mov r8, r0 - ldrb r7, [r1, 0x5] - movs r0, 0x2 - ldrsb r0, [r1, r0] - bl sub_80A5278 - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r4, 24 - asrs r4, 24 - adds r0, r4, 0 - bl sub_80A5278 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - mov r0, r8 - bl sub_80A5278 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =c3_08073CEC - 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 - lsls r6, 24 - asrs r6, 24 - strh r6, [r1, 0x8] - lsls r5, 24 - asrs r5, 24 - strh r5, [r1, 0xA] - lsls r4, 24 - asrs r4, 24 - strh r4, [r1, 0xC] - strh r7, [r1, 0xE] - strh r6, [r1, 0x10] - mov r0, r9 - adds r1, r6, 0 - bl audio_play_and_stuff - ldr r1, =gUnknown_020383FF - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r2, r10 - ldr r0, [r2] - adds r0, 0x6 - str r0, [r2] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A559C - - thumb_func_start ma1C_8073ED0 -ma1C_8073ED0: @ 80A565C - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - ldr r6, =gUnknown_020383F0 - ldr r0, [r6] - adds r1, r0, 0x1 - str r1, [r6] - ldrb r5, [r0, 0x1] - ldrb r0, [r1, 0x1] - lsls r0, 8 - orrs r5, r0 - ldrb r0, [r1, 0x3] - mov r8, r0 - ldrb r2, [r1, 0x4] - mov r9, r2 - movs r0, 0x2 - ldrsb r0, [r1, r0] - bl sub_80A5178 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =sub_80A56E4 - 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, 0x8] - lsls r4, 24 - asrs r4, 24 - strh r4, [r1, 0xA] - mov r2, r8 - strh r2, [r1, 0xC] - mov r2, r9 - strh r2, [r1, 0xE] - mov r2, r8 - strh r2, [r1, 0x18] - ldr r1, [r1] - bl _call_via_r1 - ldr r1, =gUnknown_020383FF - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r6] - adds r0, 0x5 - str r0, [r6] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ma1C_8073ED0 - - thumb_func_start sub_80A56E4 -sub_80A56E4: @ 80A56E4 - 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 r2, r0, r1 - ldrh r0, [r2, 0x18] - adds r1, r0, 0x1 - strh r1, [r2, 0x18] - lsls r0, 16 - asrs r0, 16 - movs r3, 0xC - ldrsh r1, [r2, r3] - cmp r0, r1 - blt _080A5732 - movs r0, 0 - strh r0, [r2, 0x18] - ldrh r0, [r2, 0x8] - ldrb r1, [r2, 0xA] - ldrh r4, [r2, 0xE] - subs r4, 0x1 - strh r4, [r2, 0xE] - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - asrs r1, 24 - bl audio_play_and_stuff - cmp r4, 0 - bne _080A5732 - adds r0, r5, 0 - bl DestroyTask - ldr r1, =gUnknown_020383FF - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] -_080A5732: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A56E4 - - thumb_func_start ma1D_08073FB4 -ma1D_08073FB4: @ 80A5740 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r6, =gUnknown_020383F0 - ldr r0, [r6] - adds r1, r0, 0x1 - str r1, [r6] - ldrb r5, [r0, 0x1] - ldrb r0, [r1, 0x1] - lsls r0, 8 - orrs r5, r0 - ldrb r0, [r1, 0x3] - mov r8, r0 - movs r0, 0x2 - ldrsb r0, [r1, r0] - bl sub_80A5178 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =sub_80A57B4 - 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, 0x8] - lsls r4, 24 - asrs r4, 24 - strh r4, [r1, 0xA] - mov r0, r8 - strh r0, [r1, 0xC] - ldr r1, =gUnknown_020383FF - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r6] - adds r0, 0x4 - str r0, [r6] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ma1D_08073FB4 - - thumb_func_start sub_80A57B4 -sub_80A57B4: @ 80A57B4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r1 - ldrh r0, [r2, 0xC] - subs r1, r0, 0x1 - strh r1, [r2, 0xC] - lsls r0, 16 - cmp r0, 0 - bgt _080A57E8 - ldrh r0, [r2, 0x8] - movs r1, 0xA - ldrsb r1, [r2, r1] - bl audio_play_and_stuff - adds r0, r4, 0 - bl DestroyTask - ldr r1, =gUnknown_020383FF - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] -_080A57E8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A57B4 - - thumb_func_start sub_80A57F8 -sub_80A57F8: @ 80A57F8 - push {r4-r6,lr} - ldr r4, =gUnknown_020383F0 - ldr r1, [r4] - adds r3, r1, 0x1 - str r3, [r4] - ldrb r2, [r1, 0x1] - ldrb r0, [r3, 0x1] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r3, 0x2] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r3, 0x3] - lsls r0, 24 - adds r6, r2, r0 - adds r0, r1, 0x5 - str r0, [r4] - ldrb r0, [r1, 0x5] - adds r1, 0x6 - str r1, [r4] - cmp r0, 0 - beq _080A5842 - adds r5, r4, 0 - ldr r4, =gUnknown_0203841E - adds r3, r0, 0 -_080A582A: - ldr r2, [r5] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - strh r1, [r4] - adds r2, 0x2 - str r2, [r5] - adds r4, 0x2 - subs r3, 0x1 - cmp r3, 0 - bne _080A582A -_080A5842: - adds r0, r6, 0 - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r6 - ldr r1, =gUnknown_020383FF - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A57F8 - - thumb_func_start ma20_wait_for_something -ma20_wait_for_something: @ 80A586C - push {r4,r5,lr} - ldr r0, =gUnknown_020383FF - ldrb r5, [r0] - cmp r5, 0 - bne _080A58B4 - bl mplay_has_finished_maybe - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _080A58CC - ldr r4, =gUnknown_0203842E - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x5A - bls _080A58BA - ldr r0, =gMPlay_SE1 - bl m4aMPlayStop - ldr r0, =gMPlay_SE2 - bl m4aMPlayStop - strh r5, [r4] - b _080A58DE - .pool -_080A58B4: - ldr r1, =gUnknown_0203842E - movs r0, 0 - strh r0, [r1] -_080A58BA: - ldr r1, =gUnknown_020383FC - movs r0, 0x1 - strb r0, [r1] - b _080A58DE - .pool -_080A58CC: - ldr r0, =gUnknown_0203842E - movs r2, 0 - strh r1, [r0] - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r0, =gUnknown_020383FC - strb r2, [r0] -_080A58DE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ma20_wait_for_something - - thumb_func_start ma21_08074164 -ma21_08074164: @ 80A58F0 - push {r4-r6,lr} - ldr r5, =gUnknown_020383F0 - ldr r4, [r5] - adds r3, r4, 0x1 - str r3, [r5] - ldrb r2, [r4, 0x1] - ldrb r1, [r3, 0x1] - ldrb r0, [r3, 0x2] - lsls r0, 8 - orrs r1, r0 - ldr r0, =gUnknown_0203841E - lsls r2, 1 - adds r2, r0 - lsls r1, 16 - asrs r1, 16 - movs r6, 0 - ldrsh r0, [r2, r6] - cmp r1, r0 - bne _080A5938 - ldrb r1, [r3, 0x3] - ldrb r0, [r3, 0x4] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r3, 0x6] - lsls r0, 24 - adds r1, r0 - str r1, [r5] - b _080A593E - .pool -_080A5938: - adds r0, r4, 0 - adds r0, 0x8 - str r0, [r5] -_080A593E: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end ma21_08074164 - - thumb_func_start sub_80A5944 -sub_80A5944: @ 80A5944 - push {r4,lr} - ldr r4, =gUnknown_020383F0 - ldr r0, [r4] - adds r0, 0x1 - str r0, [r4] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A5978 - ldr r2, [r4] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - adds r1, r0 - str r1, [r4] - b _080A597E - .pool -_080A5978: - ldr r0, [r4] - adds r0, 0x4 - str r0, [r4] -_080A597E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A5944 - - thumb_func_start sub_80A5984 -sub_80A5984: @ 80A5984 - push {r4,lr} - ldr r0, =gUnknown_020383F0 - ldr r1, [r0] - ldrb r2, [r1, 0x1] - adds r1, 0x2 - str r1, [r0] - cmp r2, 0 - beq _080A59A0 - ldr r0, =gUnknown_02038437 - b _080A59A2 - .pool -_080A59A0: - ldr r0, =gUnknown_02038436 -_080A59A2: - ldrb r0, [r0] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A59D2 - cmp r4, 0 - beq _080A59BE - cmp r4, 0x3 - bne _080A59D2 -_080A59BE: - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - movs r0, 0x2 - movs r1, 0x4 - movs r2, 0x2 - bl lcd_bg_operations -_080A59D2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A5984 - - thumb_func_start sub_80A59DC -sub_80A59DC: @ 80A59DC - push {lr} - ldr r0, =gUnknown_020383F0 - ldr r1, [r0] - adds r1, 0x1 - str r1, [r0] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A5A04 - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - movs r0, 0x2 - movs r1, 0x4 - movs r2, 0x2 - bl lcd_bg_operations -_080A5A04: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A59DC - - thumb_func_start sub_80A5A0C -sub_80A5A0C: @ 80A5A0C - push {r4-r7,lr} - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - ldrb r6, [r0, 0x1] - adds r0, 0x2 - str r0, [r1] - ldr r7, =gUnknown_02038436 - ldrb r0, [r7] - bl battle_side_get_owner - adds r4, r0, 0 - ldr r5, =gUnknown_02038437 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _080A5A78 - cmp r6, 0 - beq _080A5A48 - ldrb r0, [r5] - b _080A5A4A - .pool -_080A5A48: - ldrb r0, [r7] -_080A5A4A: - bl battle_get_per_side_status - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A5A78 - cmp r4, 0 - beq _080A5A64 - cmp r4, 0x3 - bne _080A5A78 -_080A5A64: - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - movs r0, 0x2 - movs r1, 0x4 - movs r2, 0x2 - bl lcd_bg_operations -_080A5A78: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80A5A0C - - thumb_func_start ma2B_make_side_invisible -ma2B_make_side_invisible: @ 80A5A80 - push {r4,lr} - ldr r4, =gUnknown_020383F0 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _080A5AA8 - ldr r1, =gUnknown_02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_080A5AA8: - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ma2B_make_side_invisible - - thumb_func_start ma2C_make_side_visible -ma2C_make_side_visible: @ 80A5ABC - push {r4,lr} - ldr r4, =gUnknown_020383F0 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _080A5AE6 - ldr r1, =gUnknown_02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] -_080A5AE6: - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ma2C_make_side_visible - - thumb_func_start sub_80A5AFC -sub_80A5AFC: @ 80A5AFC - push {r4-r7,lr} - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - ldrb r7, [r0, 0x1] - adds r0, 0x2 - str r0, [r1] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A5BA6 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _080A5BA6 - ldr r6, =gUnknown_02038436 - ldrb r0, [r6] - bl battle_side_get_owner - adds r4, r0, 0 - ldr r5, =gUnknown_02038437 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bne _080A5BA6 - cmp r7, 0 - bne _080A5B54 - ldrb r0, [r6] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0 - b _080A5B60 - .pool -_080A5B54: - ldrb r0, [r5] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x1 -_080A5B60: - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _080A5BA6 - ldr r1, =gUnknown_02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r2, r0, r1 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] - cmp r4, 0x2 - bne _080A5B90 - ldrb r0, [r2, 0x5] - movs r1, 0xC - orrs r0, r1 - strb r0, [r2, 0x5] -_080A5B90: - cmp r4, 0x1 - bne _080A5BA0 - movs r0, 0 - bl sub_80A477C - b _080A5BA6 - .pool -_080A5BA0: - movs r0, 0x1 - bl sub_80A477C -_080A5BA6: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80A5AFC - - thumb_func_start sub_80A5BAC -sub_80A5BAC: @ 80A5BAC - push {r4-r7,lr} - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - ldrb r7, [r0, 0x1] - adds r0, 0x2 - str r0, [r1] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A5C38 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _080A5C38 - ldr r6, =gUnknown_02038436 - ldrb r0, [r6] - bl battle_side_get_owner - adds r4, r0, 0 - ldr r5, =gUnknown_02038437 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bne _080A5C38 - cmp r7, 0 - bne _080A5C04 - ldrb r0, [r6] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0 - b _080A5C10 - .pool -_080A5C04: - ldrb r0, [r5] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x1 -_080A5C10: - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _080A5C38 - cmp r4, 0x2 - bne _080A5C38 - ldr r1, =gUnknown_02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0, 0x5] -_080A5C38: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A5BAC - - thumb_func_start ma2F_stop_music -ma2F_stop_music: @ 80A5C44 - push {lr} - ldr r0, =gMPlay_SE1 - bl m4aMPlayStop - ldr r0, =gMPlay_SE2 - bl m4aMPlayStop - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end ma2F_stop_music - thumb_func_start sub_80A5C6C sub_80A5C6C: @ 80A5C6C push {r4,r5,lr} @@ -4240,7 +43,7 @@ _080A5CB0: bl battle_get_per_side_status lsls r0, 24 lsrs r0, 22 - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r1, [r1] movs r2, 0x1 ands r1, r2 @@ -4256,7 +59,7 @@ _080A5CD8: bl battle_get_per_side_status lsls r0, 24 lsrs r0, 22 - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r1, [r1] movs r2, 0x1 ands r1, r2 @@ -4305,7 +108,7 @@ _080A5D28: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty b _080A5D7E .pool _080A5D60: @@ -4323,11 +126,11 @@ _080A5D60: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty _080A5D7E: adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r1, r0, 16 b _080A5D9A @@ -4406,10 +209,10 @@ _080A5E04: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0 - bl pokemon_getattr + bl GetMonData adds r2, r0, 0 b _080A5E42 .pool @@ -4496,10 +299,10 @@ _080A5EC8: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0 - bl pokemon_getattr + bl GetMonData adds r2, r0, 0 b _080A5F0A .pool @@ -4677,7 +480,7 @@ _080A605C: ldr r3, =gUnknown_08525F58 lsls r0, 24 lsrs r0, 22 - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r1, [r1] movs r2, 0x1 ands r1, r2 @@ -4865,7 +668,7 @@ sub_80A6190: @ 80A6190 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty b _080A6202 .pool _080A61E4: @@ -4883,11 +686,11 @@ _080A61E4: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty _080A6202: adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 b _080A621E @@ -5015,13 +818,13 @@ sub_80A62EC: @ 80A62EC ldrsh r0, [r4, r2] movs r2, 0x30 ldrsh r1, [r4, r2] - bl sine + bl Sin strh r0, [r4, 0x24] movs r1, 0x2E ldrsh r0, [r4, r1] movs r2, 0x30 ldrsh r1, [r4, r2] - bl cosine + bl Cos strh r0, [r4, 0x26] ldrh r0, [r4, 0x32] ldrh r2, [r4, 0x2E] @@ -5073,7 +876,7 @@ sub_80A634C: @ 80A634C adds r1, r2 lsls r1, 16 asrs r1, 16 - bl sine + bl Sin strh r0, [r4, 0x24] movs r1, 0x2E ldrsh r0, [r4, r1] @@ -5084,7 +887,7 @@ sub_80A634C: @ 80A634C adds r1, r2 lsls r1, 16 asrs r1, 16 - bl cosine + bl Cos strh r0, [r4, 0x26] ldrh r0, [r4, 0x32] ldrh r2, [r4, 0x2E] @@ -5135,13 +938,13 @@ sub_80A63C8: @ 80A63C8 ldrsh r0, [r4, r2] movs r2, 0x30 ldrsh r1, [r4, r2] - bl sine + bl Sin strh r0, [r4, 0x24] movs r1, 0x36 ldrsh r0, [r4, r1] movs r2, 0x30 ldrsh r1, [r4, r2] - bl cosine + bl Cos strh r0, [r4, 0x26] ldrh r0, [r4, 0x32] ldrh r2, [r4, 0x2E] @@ -5209,13 +1012,13 @@ sub_80A6450: @ 80A6450 ldrsh r0, [r4, r2] movs r2, 0x30 ldrsh r1, [r4, r2] - bl sine + bl Sin strh r0, [r4, 0x24] movs r1, 0x2E ldrsh r0, [r4, r1] movs r2, 0x36 ldrsh r1, [r4, r2] - bl cosine + bl Cos strh r0, [r4, 0x26] ldrh r0, [r4, 0x32] ldrh r2, [r4, 0x2E] @@ -5859,7 +1662,7 @@ sub_80A6900: @ 80A6900 lsrs r0, 24 movs r2, 0x38 ldrsh r1, [r4, r2] - bl sine + bl Sin ldrh r1, [r4, 0x26] adds r0, r1 strh r0, [r4, 0x26] @@ -5889,7 +1692,7 @@ sub_80A6934: @ 80A6934 lsrs r0, 24 movs r2, 0x38 ldrsh r1, [r4, r2] - bl sine + bl Sin ldrh r1, [r4, 0x24] adds r0, r1 strh r0, [r4, 0x24] @@ -6096,7 +1899,7 @@ _080A6ABC: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty b _080A6AFE .pool _080A6AF0: @@ -6106,11 +1909,11 @@ _080A6AF0: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty _080A6AFE: adds r0, r1 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _080A6B18 _080A6B0A: @@ -6127,7 +1930,7 @@ _080A6B1A: thumb_func_start battle_type_is_double battle_type_is_double: @ 80A6B20 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -8782,10 +4585,10 @@ _080A7F78: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r2, r0, 16 b _080A7FC2 @@ -8817,10 +4620,10 @@ _080A7FD8: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r2, r0, 16 b _080A8012 @@ -9703,17 +5506,17 @@ _080A86C4: ldrh r0, [r4] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r7, r0, 16 ldrh r0, [r4] muls r0, r6 adds r0, r5 movs r1, 0 - bl pokemon_getattr + bl GetMonData adds r2, r0, 0 b _080A8724 .pool @@ -9793,17 +5596,17 @@ _080A8790: ldrh r0, [r4] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_02024744 + ldr r5, =gEnemyParty adds r0, r5 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r7, r0, 16 ldrh r0, [r4] muls r0, r6 adds r0, r5 movs r1, 0 - bl pokemon_getattr + bl GetMonData adds r2, r0, 0 b _080A87E4 .pool @@ -10067,7 +5870,7 @@ sub_80A89C8: @ 80A89C8 lsrs r6, 24 ldr r0, =DummyObjectCallback mov r10, r0 - bl object_new_hidden_with_callback + bl CreateInvisibleSpriteWithCallback mov r8, r0 mov r0, r8 lsls r0, 24 diff --git a/asm/rom_80AEFFC.s b/asm/rom_80AEFFC.s index 134c63248..8e7538a91 100644 --- a/asm/rom_80AEFFC.s +++ b/asm/rom_80AEFFC.s @@ -2130,7 +2130,7 @@ _080B0116: door_upload_tiles: @ 80B0124 push {r4,lr} ldr r4, =gUnknown_02038C28 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000e68 adds r0, r1 diff --git a/asm/rom_80B5E6C.s b/asm/rom_80B5E6C.s deleted file mode 100644 index 9b62a18f7..000000000 --- a/asm/rom_80B5E6C.s +++ /dev/null @@ -1,8625 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_80B5E6C -sub_80B5E6C: @ 80B5E6C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - mov r9, r3 - ldr r7, [sp, 0x34] - lsls r4, 24 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 16 - lsrs r6, 16 - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsrs r4, 21 - ldr r3, =gTrainerFrontPicPaletteTable - mov r8, r3 - add r8, r4 - mov r0, r8 - adds r1, r7, 0 - bl LoadCompressedObjectPaletteOverrideBuffer - ldr r0, =gTrainerFrontPicTable - adds r4, r0 - adds r0, r4, 0 - adds r1, r7, 0 - bl LoadCompressedObjectPicOverrideBuffer - mov r1, sp - ldrh r0, [r4, 0x6] - movs r2, 0 - strh r0, [r1] - mov r3, r8 - ldrh r0, [r3, 0x4] - strh r0, [r1, 0x2] - ldr r0, =gNewGameBirchOamAttributes - str r0, [sp, 0x4] - ldr r0, =gDummyObjectImageAnimTable - str r0, [sp, 0x8] - str r2, [sp, 0xC] - ldr r0, =gDummyObjectRotScalAnimTable - str r0, [sp, 0x10] - ldr r0, =DummyObjectCallback - str r0, [sp, 0x14] - lsls r5, 16 - asrs r5, 16 - lsls r6, 16 - asrs r6, 16 - mov r0, sp - adds r1, r5, 0 - adds r2, r6, 0 - mov r3, r9 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B5E6C - - thumb_func_start sub_80B5F0C -sub_80B5F0C: @ 80B5F0C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r1, r2, 0 - lsls r4, 24 - lsls r5, 16 - lsrs r5, 16 - ldr r0, =gTrainerFrontPicTable - lsrs r4, 21 - adds r0, r4, r0 - ldr r0, [r0] - bl LZDecompressVram - ldr r0, =gTrainerFrontPicPaletteTable - adds r4, r0 - ldr r0, [r4] - adds r1, r5, 0 - movs r2, 0x20 - bl LoadCompressedPalette - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B5F0C - - thumb_func_start AddNewGameBirchObject -AddNewGameBirchObject: @ 80B5F44 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =gNewGameBirchObjectPaletteInfo - bl LoadTaggedObjectPalette - ldr r0, =gNewGameBirchObjectTemplate - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - adds r1, r4, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end AddNewGameBirchObject - - thumb_func_start sub_80B5F84 -sub_80B5F84: @ 80B5F84 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 16 - lsrs r0, 16 - movs r3, 0x80 - lsls r3, 8 - lsls r1, 16 - asrs r1, 16 - str r1, [sp] - lsls r2, 16 - asrs r2, 16 - str r2, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - ldr r1, =gMonPaletteTable - lsls r4, r0, 3 - adds r4, r1 - ldrh r1, [r4, 0x4] - str r1, [sp, 0xC] - movs r1, 0 - adds r2, r3, 0 - movs r3, 0x1 - bl sub_818D7D8 - lsls r0, 16 - lsrs r5, r0, 16 - ldrh r0, [r4, 0x4] - bl IndexOfObjectPaletteTag - adds r0, 0x10 - lsls r0, 24 - lsrs r0, 24 - bl sub_80AC3F8 - ldr r0, =0x0000ffff - cmp r5, r0 - beq _080B5FDC - lsls r0, r5, 24 - lsrs r0, 24 - b _080B5FDE - .pool -_080B5FDC: - movs r0, 0x40 -_080B5FDE: - add sp, 0x10 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80B5F84 - - thumb_func_start sub_80B5FE8 -sub_80B5FE8: @ 80B5FE8 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0x10 - adds r6, r0, 0 - mov r9, r1 - mov r10, r2 - adds r4, r3, 0 - ldr r5, [sp, 0x2C] - lsls r6, 16 - lsrs r6, 16 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - adds r0, r6, 0 - bl sub_806E7CC - mov r8, r0 - lsls r4, 16 - asrs r4, 16 - str r4, [sp] - lsls r5, 16 - asrs r5, 16 - str r5, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - mov r1, r8 - ldrh r0, [r1, 0x4] - str r0, [sp, 0xC] - adds r0, r6, 0 - mov r1, r9 - mov r2, r10 - movs r3, 0x1 - bl sub_818D7D8 - lsls r0, 16 - lsrs r4, r0, 16 - mov r1, r8 - ldrh r0, [r1, 0x4] - bl IndexOfObjectPaletteTag - adds r0, 0x10 - lsls r0, 24 - lsrs r0, 24 - bl sub_80AC3F8 - ldr r0, =0x0000ffff - cmp r4, r0 - beq _080B605C - lsls r0, r4, 24 - lsrs r0, 24 - b _080B605E - .pool -_080B605C: - movs r0, 0x40 -_080B605E: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80B5FE8 - - thumb_func_start sub_80B6070 -sub_80B6070: @ 80B6070 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - bl sub_80AC428 - ldrb r0, [r4, 0x1] - lsls r0, 30 - cmp r0, 0 - beq _080B608E - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry -_080B608E: - adds r0, r5, 0 - bl sub_818D820 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80B6070 - - thumb_func_start sub_80B609C -sub_80B609C: @ 80B609C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 16 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - ldr r4, =gPlttBufferUnfaded - lsrs r0, 15 - adds r4, r0, r4 - ldrh r4, [r4] - movs r5, 0x1F - mov r9, r5 - mov r8, r4 - mov r6, r8 - ands r6, r5 - mov r8, r6 - movs r6, 0xF8 - lsls r6, 2 - ands r6, r4 - lsrs r6, 5 - movs r5, 0xF8 - lsls r5, 7 - ands r4, r5 - lsrs r4, 10 - mov r7, r9 - mov r5, r8 - subs r7, r5 - mov r12, r7 - mov r7, r12 - muls r7, r1 - adds r1, r7, 0 - asrs r1, 4 - add r8, r1 - mov r5, r9 - subs r1, r5, r6 - muls r1, r2 - asrs r1, 4 - adds r6, r1 - subs r5, r4 - mov r9, r5 - mov r1, r9 - muls r1, r3 - asrs r1, 4 - adds r4, r1 - mov r7, r8 - lsls r7, 16 - lsls r6, 21 - orrs r6, r7 - lsls r4, 26 - orrs r4, r6 - lsrs r4, 16 - ldr r1, =gPlttBufferFaded - adds r0, r1 - strh r4, [r0] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B609C - - thumb_func_start sub_80B6128 -sub_80B6128: @ 80B6128 - push {r4-r6,lr} - mov r6, r8 - push {r6} - lsls r0, 16 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - ldr r4, =gPlttBufferUnfaded - lsrs r0, 15 - adds r4, r0, r4 - ldrh r4, [r4] - movs r5, 0x1F - mov r8, r5 - mov r6, r8 - ands r6, r4 - mov r8, r6 - movs r5, 0xF8 - lsls r5, 2 - ands r5, r4 - lsrs r5, 5 - movs r6, 0xF8 - lsls r6, 7 - ands r4, r6 - lsrs r4, 10 - mov r6, r8 - muls r6, r1 - adds r1, r6, 0 - asrs r1, 4 - mov r6, r8 - subs r6, r1 - adds r1, r5, 0 - muls r1, r2 - asrs r1, 4 - subs r5, r1 - adds r1, r4, 0 - muls r1, r3 - asrs r1, 4 - subs r4, r1 - lsls r6, 16 - lsls r5, 21 - orrs r5, r6 - lsls r4, 26 - orrs r4, r5 - lsrs r4, 16 - ldr r1, =gPlttBufferFaded - adds r0, r1 - strh r4, [r0] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B6128 - - thumb_func_start sub_80B61A0 -sub_80B61A0: @ 80B61A0 - push {r4,lr} - bl calc_player_party_count - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =sub_80B61E4 - movs r1, 0xFF - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks - adds r1, r0 - strh r4, [r1, 0xA] - movs r0, 0x5D - strh r0, [r1, 0xC] - movs r0, 0x24 - strh r0, [r1, 0xE] - movs r0, 0x7C - strh r0, [r1, 0x10] - movs r0, 0x18 - strh r0, [r1, 0x12] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B61A0 - - thumb_func_start sub_80B61E4 -sub_80B61E4: @ 80B61E4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks - adds r1, r0 - ldr r2, =gUnknown_0855C364 - movs r3, 0x8 - ldrsh r0, [r1, r3] - lsls r0, 2 - adds r0, r2 - ldr r2, [r0] - adds r0, r1, 0 - bl _call_via_r2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B61E4 - - thumb_func_start sub_80B6214 -sub_80B6214: @ 80B6214 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r1, 0xA - ldrsh r0, [r4, r1] - movs r2, 0xC - ldrsh r1, [r4, r2] - movs r3, 0xE - ldrsh r2, [r4, r3] - movs r3, 0x1 - bl sub_80B646C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x14] - movs r1, 0x10 - ldrsh r0, [r4, r1] - movs r2, 0x12 - ldrsh r1, [r4, r2] - bl sub_80B6850 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x16] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80B6214 - - thumb_func_start sub_80B6250 -sub_80B6250: @ 80B6250 - push {r4,lr} - adds r2, r0, 0 - ldr r3, =gUnknown_02020630 - movs r1, 0x14 - ldrsh r0, [r2, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - movs r4, 0x2E - ldrsh r0, [r1, r4] - cmp r0, 0x1 - ble _080B6282 - movs r0, 0x16 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x2E] - adds r1, 0x1 - strh r1, [r0, 0x2E] - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] -_080B6282: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B6250 - - thumb_func_start sub_80B628C -sub_80B628C: @ 80B628C - push {lr} - adds r3, r0, 0 - ldr r2, =gUnknown_02020630 - movs r0, 0x14 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x2E - ldrsh r0, [r0, r1] - cmp r0, 0x4 - ble _080B62AC - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] -_080B62AC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B628C - - thumb_func_start sub_80B62B4 -sub_80B62B4: @ 80B62B4 - push {lr} - ldr r2, =gUnknown_02020630 - movs r3, 0x14 - ldrsh r1, [r0, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0x6 - ble _080B62E6 - adds r0, r1, 0 - bl RemoveObjectAndFreeTiles - movs r0, 0x19 - bl FieldEffectActiveListRemove - ldr r0, =sub_80B61E4 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080B62E6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B62B4 - - thumb_func_start sub_80B62F4 -sub_80B62F4: @ 80B62F4 - push {r4,lr} - bl calc_player_party_count - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =sub_80B6330 - movs r1, 0xFF - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks - adds r1, r0 - strh r4, [r1, 0xA] - movs r0, 0x75 - strh r0, [r1, 0xC] - movs r0, 0x34 - strh r0, [r1, 0xE] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B62F4 - - thumb_func_start sub_80B6330 -sub_80B6330: @ 80B6330 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks - adds r1, r0 - ldr r2, =gUnknown_0855C374 - movs r3, 0x8 - ldrsh r0, [r1, r3] - lsls r0, 2 - adds r0, r2 - ldr r2, [r0] - adds r0, r1, 0 - bl _call_via_r2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B6330 - - thumb_func_start sub_80B6360 -sub_80B6360: @ 80B6360 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r1, 0xA - ldrsh r0, [r4, r1] - movs r2, 0xC - ldrsh r1, [r4, r2] - movs r3, 0xE - ldrsh r2, [r4, r3] - movs r3, 0 - bl sub_80B646C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x14] - ldr r0, =sub_80B6330 - bl FindTaskIdByFunc - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0x78 - movs r2, 0x18 - movs r3, 0 - bl sub_80B68EC - adds r0, r4, 0 - movs r1, 0x28 - movs r2, 0x8 - movs r3, 0x1 - bl sub_80B68EC - adds r0, r4, 0 - movs r1, 0x48 - movs r2, 0x8 - movs r3, 0x1 - bl sub_80B68EC - adds r0, r4, 0 - movs r1, 0xA8 - movs r2, 0x8 - movs r3, 0x1 - bl sub_80B68EC - adds r0, r4, 0 - movs r1, 0xC8 - movs r2, 0x8 - movs r3, 0x1 - bl sub_80B68EC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B6360 - - thumb_func_start sub_80B63D4 -sub_80B63D4: @ 80B63D4 - push {lr} - adds r3, r0, 0 - ldr r2, =gUnknown_02020630 - movs r0, 0x14 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x2E - ldrsh r0, [r0, r1] - cmp r0, 0x1 - ble _080B63FA - ldrh r0, [r3, 0x26] - adds r0, 0x1 - strh r0, [r3, 0x26] - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] -_080B63FA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B63D4 - - thumb_func_start sub_80B6404 -sub_80B6404: @ 80B6404 - push {lr} - adds r3, r0, 0 - ldr r2, =gUnknown_02020630 - movs r0, 0x14 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x2E - ldrsh r0, [r0, r1] - cmp r0, 0x4 - ble _080B6424 - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] -_080B6424: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B6404 - - thumb_func_start sub_80B642C -sub_80B642C: @ 80B642C - push {lr} - ldr r2, =gUnknown_02020630 - movs r3, 0x14 - ldrsh r1, [r0, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0x6 - ble _080B645E - adds r0, r1, 0 - bl RemoveObjectAndFreeTiles - movs r0, 0x3E - bl FieldEffectActiveListRemove - ldr r0, =sub_80B6330 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080B645E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B642C - - thumb_func_start sub_80B646C -sub_80B646C: @ 80B646C - 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, 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 - ldr r0, =sub_80B64C0 - bl obj_add_empty_with_callback - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r2, =gUnknown_02020630 - adds r1, r2 - strh r4, [r1, 0x24] - strh r5, [r1, 0x26] - strh r6, [r1, 0x38] - mov r2, r8 - strh r2, [r1, 0x3A] - strh r0, [r1, 0x3C] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B646C - - thumb_func_start sub_80B64C0 -sub_80B64C0: @ 80B64C0 - push {lr} - ldr r2, =gUnknown_0855C384 - movs r3, 0x2E - ldrsh r1, [r0, r3] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B64C0 - - thumb_func_start sub_80B64DC -sub_80B64DC: @ 80B64DC - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x30] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _080B64F4 - subs r0, r1, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - cmp r0, 0 - bne _080B6550 -_080B64F4: - movs r0, 0x19 - strh r0, [r4, 0x30] - ldr r0, =gUnknown_0855C304 - ldr r1, =gUnknown_0855C3A4 - movs r2, 0x32 - ldrsh r3, [r4, r2] - lsls r3, 2 - adds r3, r1 - ldrh r1, [r4, 0x24] - ldrh r2, [r3] - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - ldrh r2, [r4, 0x26] - ldrh r3, [r3, 0x2] - adds r2, r3 - lsls r2, 16 - asrs r2, 16 - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_02020630 - 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 - movs r2, 0x8 - orrs r0, r2 - strb r0, [r1, 0x5] - ldrh r0, [r4, 0x3C] - strh r0, [r1, 0x2E] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x3A] - subs r0, 0x1 - strh r0, [r4, 0x3A] - movs r0, 0x17 - bl audio_play -_080B6550: - movs r1, 0x3A - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B6562 - movs r0, 0x20 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_080B6562: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B64DC - - thumb_func_start sub_80B6574 -sub_80B6574: @ 80B6574 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x30] - subs r0, 0x1 - strh r0, [r1, 0x30] - lsls r0, 16 - asrs r2, r0, 16 - cmp r2, 0 - bne _080B65A4 - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - movs r0, 0x8 - strh r0, [r1, 0x30] - strh r2, [r1, 0x32] - strh r2, [r1, 0x34] - movs r2, 0x38 - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _080B65A4 - movs r0, 0xB8 - lsls r0, 1 - bl fanfare_play -_080B65A4: - pop {r0} - bx r0 - thumb_func_end sub_80B6574 - - thumb_func_start sub_80B65A8 -sub_80B65A8: @ 80B65A8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r7, r0, 0 - ldrh r0, [r7, 0x30] - subs r0, 0x1 - strh r0, [r7, 0x30] - lsls r0, 16 - cmp r0, 0 - bne _080B65D8 - movs r0, 0x8 - strh r0, [r7, 0x30] - ldrh r0, [r7, 0x32] - adds r0, 0x1 - movs r1, 0x3 - ands r0, r1 - strh r0, [r7, 0x32] - cmp r0, 0 - bne _080B65D8 - ldrh r0, [r7, 0x34] - adds r0, 0x1 - strh r0, [r7, 0x34] -_080B65D8: - ldrh r4, [r7, 0x32] - adds r4, 0x3 - movs r0, 0x3 - mov r8, r0 - mov r1, r8 - ands r4, r1 - ldr r3, =0x00001007 - mov r10, r3 - mov r0, r10 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 4 - movs r1, 0x84 - lsls r1, 17 - adds r0, r1 - lsrs r0, 16 - ldr r6, =gUnknown_0855C3BC - adds r1, r4, r6 - ldrb r1, [r1] - ldr r5, =gUnknown_0855C3C0 - adds r2, r4, r5 - ldrb r2, [r2] - ldr r3, =gUnknown_0855C3C4 - mov r9, r3 - add r4, r9 - ldrb r3, [r4] - bl sub_80B609C - ldrh r4, [r7, 0x32] - adds r4, 0x2 - mov r0, r8 - ands r4, r0 - mov r0, r10 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 4 - movs r1, 0x83 - lsls r1, 17 - adds r0, r1 - lsrs r0, 16 - adds r1, r4, r6 - ldrb r1, [r1] - adds r2, r4, r5 - ldrb r2, [r2] - add r4, r9 - ldrb r3, [r4] - bl sub_80B609C - ldrh r4, [r7, 0x32] - adds r4, 0x1 - mov r3, r8 - ands r4, r3 - mov r0, r10 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 4 - movs r1, 0x81 - lsls r1, 17 - adds r0, r1 - lsrs r0, 16 - adds r1, r4, r6 - ldrb r1, [r1] - adds r2, r4, r5 - ldrb r2, [r2] - add r4, r9 - ldrb r3, [r4] - bl sub_80B609C - ldrh r4, [r7, 0x32] - lsls r4, 24 - lsrs r4, 24 - mov r0, r10 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 4 - ldr r3, =0x01050000 - adds r0, r3 - lsrs r0, 16 - adds r6, r4, r6 - ldrb r6, [r6] - adds r5, r4, r5 - ldrb r5, [r5] - add r4, r9 - ldrb r4, [r4] - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_80B609C - mov r0, r10 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 4 - ldr r1, =0x01030000 - adds r0, r1 - lsrs r0, 16 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_80B609C - movs r3, 0x34 - ldrsh r0, [r7, r3] - cmp r0, 0x2 - ble _080B66C2 - ldrh r0, [r7, 0x2E] - adds r0, 0x1 - movs r1, 0 - strh r0, [r7, 0x2E] - movs r0, 0x8 - strh r0, [r7, 0x30] - strh r1, [r7, 0x32] -_080B66C2: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B65A8 - - thumb_func_start sub_80B66E8 -sub_80B66E8: @ 80B66E8 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r2, r0, 0 - ldrh r0, [r2, 0x30] - subs r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - cmp r0, 0 - bne _080B6718 - movs r0, 0x8 - strh r0, [r2, 0x30] - ldrh r0, [r2, 0x32] - adds r0, 0x1 - movs r1, 0x3 - ands r0, r1 - strh r0, [r2, 0x32] - cmp r0, 0x3 - bne _080B6718 - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - movs r0, 0x1E - strh r0, [r2, 0x30] -_080B6718: - ldrh r4, [r2, 0x32] - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x00001007 - mov r8, r0 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 4 - movs r1, 0x84 - lsls r1, 17 - adds r0, r1 - lsrs r0, 16 - ldr r1, =gUnknown_0855C3BC - adds r1, r4, r1 - ldrb r6, [r1] - ldr r1, =gUnknown_0855C3C0 - adds r1, r4, r1 - ldrb r5, [r1] - ldr r1, =gUnknown_0855C3C4 - adds r4, r1 - ldrb r4, [r4] - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_80B609C - mov r0, r8 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 4 - movs r1, 0x83 - lsls r1, 17 - adds r0, r1 - lsrs r0, 16 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_80B609C - mov r0, r8 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 4 - movs r1, 0x81 - lsls r1, 17 - adds r0, r1 - lsrs r0, 16 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_80B609C - mov r0, r8 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 4 - ldr r1, =0x01050000 - adds r0, r1 - lsrs r0, 16 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_80B609C - mov r0, r8 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 4 - ldr r1, =0x01030000 - adds r0, r1 - lsrs r0, 16 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_80B609C - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B66E8 - - thumb_func_start sub_80B67DC -sub_80B67DC: @ 80B67DC - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x30] - subs r0, 0x1 - strh r0, [r1, 0x30] - lsls r0, 16 - cmp r0, 0 - bne _080B67F2 - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] -_080B67F2: - pop {r0} - bx r0 - thumb_func_end sub_80B67DC - - thumb_func_start sub_80B67F8 -sub_80B67F8: @ 80B67F8 - ldrh r1, [r0, 0x2E] - adds r1, 0x1 - strh r1, [r0, 0x2E] - bx lr - thumb_func_end sub_80B67F8 - - thumb_func_start sub_80B6800 -sub_80B6800: @ 80B6800 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x38 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080B6816 - bl task_is_not_running_overworld_fanfare - lsls r0, 24 - cmp r0, 0 - beq _080B681C -_080B6816: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_080B681C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80B6800 - - thumb_func_start nullsub_97 -nullsub_97: @ 80B6824 - bx lr - thumb_func_end nullsub_97 - - thumb_func_start sub_80B6828 -sub_80B6828: @ 80B6828 - push {lr} - adds r3, r0, 0 - ldr r2, =gUnknown_02020630 - movs r0, 0x2E - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x2E - ldrsh r0, [r0, r1] - cmp r0, 0x4 - ble _080B6848 - adds r0, r3, 0 - bl FieldEffectFreeGraphicsResources -_080B6848: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B6828 - - thumb_func_start sub_80B6850 -sub_80B6850: @ 80B6850 - push {r4,lr} - adds r3, r0, 0 - adds r2, r1, 0 - ldr r0, =gUnknown_0855C31C - lsls r3, 16 - asrs r3, 16 - lsls r2, 16 - asrs r2, 16 - adds r1, r3, 0 - movs r3, 0 - bl AddObjectToBack - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =gUnknown_02020630 - adds r0, r1 - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0, 0x5] - adds r3, r0, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r3] - ldr r1, =gUnknown_0855C2AC - bl SetSpriteOamTables_NoPriorityFromTable - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B6850 - - thumb_func_start sub_80B68AC -sub_80B68AC: @ 80B68AC - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080B68D0 - movs r0, 0 - strh r0, [r4, 0x2E] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - subs r0, 0x5 - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectImageAnim -_080B68D0: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080B68E4 - adds r0, r4, 0 - bl FieldEffectFreeGraphicsResources -_080B68E4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80B68AC - - thumb_func_start sub_80B68EC -sub_80B68EC: @ 80B68EC - push {r4,r5,lr} - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - lsls r3, 24 - cmp r3, 0 - bne _080B6934 - ldr r0, =gUnknown_0855C334 - lsls r1, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =gUnknown_02020630 - adds r0, r1 - ldr r1, =gUnknown_0855C2C4 - bl SetSpriteOamTables_NoPriorityFromTable - b _080B6948 - .pool -_080B6934: - ldr r0, =gUnknown_0855C34C - lsls r1, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r4, r0, 24 -_080B6948: - ldr r1, =gUnknown_02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - adds r3, r0, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r3] - strh r5, [r0, 0x2E] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B68EC - - thumb_func_start sub_80B6970 -sub_80B6970: @ 80B6970 - push {lr} - adds r3, r0, 0 - ldr r2, =gTasks - movs r0, 0x2E - ldrsh r1, [r3, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x26 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _080B69C6 - ldrh r1, [r3, 0x30] - movs r2, 0x30 - ldrsh r0, [r3, r2] - cmp r0, 0 - beq _080B699E - subs r0, r1, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - cmp r0, 0 - bne _080B69C0 -_080B699E: - movs r0, 0x10 - strh r0, [r3, 0x30] - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] -_080B69C0: - ldrh r0, [r3, 0x32] - adds r0, 0x1 - strh r0, [r3, 0x32] -_080B69C6: - movs r2, 0x32 - ldrsh r0, [r3, r2] - cmp r0, 0x7F - ble _080B69D4 - adds r0, r3, 0 - bl FieldEffectFreeGraphicsResources -_080B69D4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B6970 - - thumb_func_start sub_80B69DC -sub_80B69DC: @ 80B69DC - push {lr} - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - ldr r1, =gUnknown_03005DAC - ldr r0, =mapldr_080842E8 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B69DC - - thumb_func_start mapldr_080842E8 -mapldr_080842E8: @ 80B69FC - push {lr} - bl pal_fill_black - ldr r0, =task00_8084310 - movs r1, 0 - bl CreateTask - bl script_env_2_enable - bl player_bitmagic - ldr r1, =gUnknown_03005DAC - movs r0, 0 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end mapldr_080842E8 - - thumb_func_start task00_8084310 -task00_8084310: @ 80B6A24 - push {r4-r6,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 r0, 0x8 - ldrsh r6, [r4, r0] - cmp r6, 0 - bne _080B6A64 - bl sub_80ABDFC - lsls r0, 24 - cmp r0, 0 - beq _080B6A8A - bl brm_get_pokemon_selection - ldr r1, =gUnknown_02038C08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - cmp r0, 0x5 - ble _080B6A58 - str r6, [r1] -_080B6A58: - movs r0, 0x1F - bl FieldEffectStart - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B6A64: - movs r0, 0x1F - bl FieldEffectActiveListContains - lsls r0, 24 - cmp r0, 0 - bne _080B6A8A - bl flag_var_implications_of_teleport_ - bl warp_in - ldr r0, =c2_load_new_map - bl SetMainCallback2 - ldr r1, =gUnknown_03005DAC - ldr r0, =mapldr_08084390 - str r0, [r1] - adds r0, r5, 0 - bl DestroyTask -_080B6A8A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end task00_8084310 - - thumb_func_start mapldr_08084390 -mapldr_08084390: @ 80B6AA4 - push {r4,lr} - bl sub_8085784 - bl pal_fill_black - ldr r0, =c3_080843F8 - movs r1, 0 - bl CreateTask - ldr r4, =gUnknown_02037350 - ldr r3, =gUnknown_02037590 - ldrb r1, [r3, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x1] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0, 0x1] - ldrb r1, [r3] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _080B6AE6 - ldrb r1, [r3, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x3 - bl FieldObjectTurn -_080B6AE6: - bl script_env_2_enable - bl player_bitmagic - ldr r1, =gUnknown_03005DAC - movs r0, 0 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end mapldr_08084390 - - thumb_func_start c3_080843F8 -c3_080843F8: @ 80B6B0C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - 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 - bne _080B6B3E - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080B6B58 - movs r0, 0x20 - bl FieldEffectStart - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B6B3E: - movs r0, 0x20 - bl FieldEffectActiveListContains - lsls r0, 24 - cmp r0, 0 - bne _080B6B58 - bl script_env_2_disable - bl sub_809757C - adds r0, r5, 0 - bl DestroyTask -_080B6B58: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end c3_080843F8 - - thumb_func_start sub_80B6B68 -sub_80B6B68: @ 80B6B68 - push {lr} - bl sub_8085784 - bl pal_fill_for_maplights - bl script_env_2_enable - bl player_bitmagic - ldr r0, =sub_80B6B94 - movs r1, 0 - bl CreateTask - ldr r1, =gUnknown_03005DAC - movs r0, 0 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B6B68 - - thumb_func_start sub_80B6B94 -sub_80B6B94: @ 80B6B94 - push {r4,r5,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 r5, =gUnknown_0855C3C8 -_080B6BA6: - 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 _080B6BA6 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B6B94 - - thumb_func_start sub_80B6BCC -sub_80B6BCC: @ 80B6BCC - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - mov r9, r0 - ldr r6, =gUnknown_02037590 - ldrb r0, [r6, 0x5] - lsls r5, r0, 3 - adds r5, r0 - lsls r5, 2 - ldr r0, =gUnknown_02037350 - mov r8, r0 - add r5, r8 - ldrb r0, [r6, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_02020630 - adds r4, r0 - bl CameraObjectReset2 - ldrb r1, [r6, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldrb r1, [r0, 0x1] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0, 0x1] - movs r0, 0x1 - strb r0, [r6, 0x6] - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - bl GetFaceDirectionAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl FieldObjectSetSpecialAnim - adds r3, r4, 0 - adds r3, 0x42 - ldrb r0, [r3] - lsrs r0, 6 - mov r1, r9 - strh r0, [r1, 0x10] - ldrb r0, [r5, 0x3] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r5, 0x3] - ldrb r1, [r4, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - orrs r0, r2 - strb r0, [r4, 0x5] - ldrb r1, [r3] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x80 - orrs r0, r1 - strb r0, [r3] - mov r1, r9 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - movs r0, 0x1 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B6BCC - - thumb_func_start sub_80B6C74 -sub_80B6C74: @ 80B6C74 - push {r4,lr} - adds r4, r0, 0 - bl sub_80ABDFC - lsls r0, 24 - cmp r0, 0 - beq _080B6C88 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B6C88: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B6C74 - - thumb_func_start sub_80B6C90 -sub_80B6C90: @ 80B6C90 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =gUnknown_02037590 - ldrb r0, [r6, 0x4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =gUnknown_02020630 - adds r2, r0 - adds r0, r2, 0 - adds r0, 0x29 - movs r4, 0 - ldrsb r4, [r0, r4] - lsls r0, r4, 17 - negs r0, r0 - ldrh r1, [r2, 0x22] - ldr r3, =gUnknown_02021BBE - adds r1, r4 - ldrh r3, [r3] - adds r1, r3 - asrs r0, 16 - adds r0, r1 - negs r0, r0 - movs r1, 0 - strh r0, [r2, 0x26] - movs r0, 0x1 - strh r0, [r5, 0xA] - strh r1, [r5, 0xC] - ldr r2, =gUnknown_02037350 - ldrb r0, [r6, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - movs r0, 0x2B - bl audio_play - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B6C90 - - thumb_func_start sub_80B6D04 -sub_80B6D04: @ 80B6D04 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r2, =gUnknown_02037590 - ldrb r1, [r2, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r6, r0, r1 - ldrb r1, [r2, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02020630 - adds r5, r0, r1 - ldrh r0, [r4, 0xA] - ldrh r1, [r5, 0x26] - adds r0, r1 - strh r0, [r5, 0x26] - ldrh r2, [r4, 0xA] - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x7 - bgt _080B6D46 - ldrh r1, [r4, 0xC] - adds r0, r2, r1 - strh r0, [r4, 0xC] - movs r1, 0xF - ands r0, r1 - cmp r0, 0 - beq _080B6D46 - lsls r0, r2, 1 - strh r0, [r4, 0xA] -_080B6D46: - ldrh r2, [r4, 0xE] - movs r1, 0xE - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B6D84 - movs r0, 0x26 - ldrsh r1, [r5, r0] - movs r0, 0x10 - negs r0, r0 - cmp r1, r0 - blt _080B6D84 - adds r0, r2, 0x1 - strh r0, [r4, 0xE] - ldrb r1, [r6, 0x3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r6, 0x3] - ldrb r1, [r4, 0x10] - adds r3, r5, 0 - adds r3, 0x42 - lsls r1, 6 - ldrb r2, [r3] - movs r0, 0x3F - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - ldrb r0, [r6] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r6] -_080B6D84: - movs r1, 0x26 - ldrsh r0, [r5, r1] - cmp r0, 0 - blt _080B6DA8 - movs r0, 0xD6 - bl audio_play - ldrb r0, [r6] - movs r1, 0x8 - orrs r0, r1 - movs r1, 0x20 - orrs r0, r1 - strb r0, [r6] - movs r0, 0 - strh r0, [r5, 0x26] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B6DA8: - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B6D04 - - thumb_func_start sub_80B6DBC -sub_80B6DBC: @ 80B6DBC - push {lr} - ldrh r1, [r0, 0x8] - adds r1, 0x1 - movs r2, 0 - strh r1, [r0, 0x8] - movs r1, 0x4 - strh r1, [r0, 0xA] - strh r2, [r0, 0xC] - movs r0, 0 - bl SetCameraPanningCallback - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_80B6DBC - - thumb_func_start sub_80B6DD8 -sub_80B6DD8: @ 80B6DD8 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0xA - ldrsh r1, [r4, r0] - movs r0, 0 - bl SetCameraPanning - ldrh r0, [r4, 0xA] - negs r2, r0 - strh r2, [r4, 0xA] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _080B6E00 - lsls r0, r2, 16 - asrs r0, 17 - strh r0, [r4, 0xA] -_080B6E00: - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B6E0E - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B6E0E: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B6DD8 - - thumb_func_start sub_80B6E18 -sub_80B6E18: @ 80B6E18 - push {lr} - ldr r1, =gUnknown_02037590 - movs r0, 0 - strb r0, [r1, 0x6] - bl script_env_2_disable - bl CameraObjectReset1 - bl sub_809757C - bl InstallCameraPanAheadCallback - ldr r0, =sub_80B6B94 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B6E18 - - thumb_func_start sub_80B6E4C -sub_80B6E4C: @ 80B6E4C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =sub_80B6E88 - 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 r0, [r1, 0xA] - cmp r4, 0x6A - bne _080B6E78 - movs r0, 0x1 - strh r0, [r1, 0xA] -_080B6E78: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B6E4C - - thumb_func_start sub_80B6E88 -sub_80B6E88: @ 80B6E88 - push {r4,r5,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 r5, =gUnknown_0855C3E4 -_080B6E9A: - 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 _080B6E9A - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B6E88 - - thumb_func_start sub_80B6EC0 -sub_80B6EC0: @ 80B6EC0 - push {r4,lr} - adds r4, r0, 0 - bl player_bitmagic - bl CameraObjectReset2 - ldrb r0, [r4, 0xA] - bl sub_80E1558 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B6EC0 - - thumb_func_start sub_80B6EE0 -sub_80B6EE0: @ 80B6EE0 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r4, r0, r1 - adds r0, r4, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - beq _080B6F0A - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B6F3E -_080B6F0A: - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - bl GetFaceDirectionAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - ldrh r0, [r5, 0x8] - adds r0, 0x1 - movs r1, 0 - strh r0, [r5, 0x8] - strh r1, [r5, 0xC] - strh r1, [r5, 0xE] - ldrb r0, [r5, 0xA] - cmp r0, 0 - bne _080B6F38 - movs r0, 0x4 - strh r0, [r5, 0x8] -_080B6F38: - movs r0, 0x50 - bl audio_play -_080B6F3E: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B6EE0 - - thumb_func_start sub_80B6F50 -sub_80B6F50: @ 80B6F50 - push {r4,lr} - adds r4, r0, 0 - bl sub_80B6FB8 - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0x3 - ble _080B6F6A - bl sub_80B7050 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B6F6A: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B6F50 - - thumb_func_start sub_80B6F74 -sub_80B6F74: @ 80B6F74 - push {lr} - bl sub_80B6FB8 - bl sub_80B7060 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_80B6F74 - - thumb_func_start sub_80B6F84 -sub_80B6F84: @ 80B6F84 - push {r4,lr} - adds r4, r0, 0 - bl sub_80B7004 - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0x3 - ble _080B6F9E - bl sub_80B7050 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B6F9E: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B6F84 - - thumb_func_start sub_80B6FA8 -sub_80B6FA8: @ 80B6FA8 - push {lr} - bl sub_80B7004 - bl sub_80B7060 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_80B6FA8 - - thumb_func_start sub_80B6FB8 -sub_80B6FB8: @ 80B6FB8 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =gUnknown_02037590 - ldrb r0, [r0, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_02020630 - adds r4, r0 - movs r0, 0xC - ldrsh r1, [r5, r0] - movs r0, 0x84 - bl cosine - strh r0, [r4, 0x24] - movs r0, 0xC - ldrsh r1, [r5, r0] - movs r0, 0x94 - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r5, 0xE] - adds r0, 0x1 - strh r0, [r5, 0xE] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080B6FF6 - ldrh r0, [r5, 0xC] - adds r0, 0x1 - strh r0, [r5, 0xC] -_080B6FF6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B6FB8 - - thumb_func_start sub_80B7004 -sub_80B7004: @ 80B7004 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =gUnknown_02037590 - ldrb r0, [r0, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_02020630 - adds r4, r0 - movs r0, 0xC - ldrsh r1, [r5, r0] - movs r0, 0x7C - bl cosine - strh r0, [r4, 0x24] - movs r0, 0xC - ldrsh r1, [r5, r0] - movs r0, 0x76 - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r5, 0xE] - adds r0, 0x1 - strh r0, [r5, 0xE] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080B7042 - ldrh r0, [r5, 0xC] - adds r0, 0x1 - strh r0, [r5, 0xC] -_080B7042: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B7004 - - thumb_func_start sub_80B7050 -sub_80B7050: @ 80B7050 - push {lr} - bl music_something - bl sub_80AF0B4 - pop {r0} - bx r0 - thumb_func_end sub_80B7050 - - thumb_func_start sub_80B7060 -sub_80B7060: @ 80B7060 - push {lr} - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080B709C - bl sub_80859A0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B709C - bl sub_80E1570 - bl warp_in - ldr r1, =gUnknown_03005DAC - ldr r0, =sub_80B70B4 - str r0, [r1] - ldr r0, =c2_load_new_map - bl SetMainCallback2 - ldr r0, =sub_80B6E88 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080B709C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B7060 - - thumb_func_start sub_80B70B4 -sub_80B70B4: @ 80B70B4 - push {lr} - bl sub_8085784 - bl pal_fill_for_maplights - bl script_env_2_enable - ldr r0, =sub_80B70DC - movs r1, 0 - bl CreateTask - ldr r1, =gUnknown_03005DAC - movs r0, 0 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B70B4 - - thumb_func_start sub_80B70DC -sub_80B70DC: @ 80B70DC - push {r4,r5,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 r5, =gUnknown_0855C3FC -_080B70EE: - 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 _080B70EE - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B70DC - - thumb_func_start sub_80B7114 -sub_80B7114: @ 80B7114 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - bl CameraObjectReset2 - ldr r0, =gUnknown_02037590 - ldrb r0, [r0, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_02037350 - adds r4, r0 - movs r0, 0x4 - bl GetFaceDirectionAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - 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 r1, r0, 24 - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0x10 - strh r0, [r5, 0xA] - cmp r1, 0x6B - bne _080B717C - movs r1, 0x1 - movs r0, 0x3 - strh r0, [r5, 0x8] - b _080B717E - .pool -_080B717C: - movs r1, 0 -_080B717E: - adds r0, r1, 0 - bl sub_80E1558 - movs r0, 0x1 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80B7114 - - thumb_func_start sub_80B7190 -sub_80B7190: @ 80B7190 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =gUnknown_02037590 - ldrb r0, [r0, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_02020630 - adds r4, r0 - movs r0, 0xA - ldrsh r1, [r5, r0] - movs r0, 0x84 - bl cosine - strh r0, [r4, 0x24] - movs r0, 0xA - ldrsh r1, [r5, r0] - movs r0, 0x94 - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B7190 - - thumb_func_start sub_80B71D0 -sub_80B71D0: @ 80B71D0 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_02037590 - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02020630 - adds r5, r0, r1 - movs r0, 0xA - ldrsh r1, [r4, r0] - movs r0, 0x84 - bl cosine - strh r0, [r5, 0x24] - movs r0, 0xA - ldrsh r1, [r4, r0] - movs r0, 0x94 - bl sine - strh r0, [r5, 0x26] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080B720E - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] -_080B720E: - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B721E - strh r0, [r5, 0x24] - strh r0, [r5, 0x26] - movs r0, 0x5 - strh r0, [r4, 0x8] -_080B721E: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B71D0 - - thumb_func_start sub_80B7230 -sub_80B7230: @ 80B7230 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =gUnknown_02037590 - ldrb r0, [r0, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_02020630 - adds r4, r0 - movs r0, 0xA - ldrsh r1, [r5, r0] - movs r0, 0x7C - bl cosine - strh r0, [r4, 0x24] - movs r0, 0xA - ldrsh r1, [r5, r0] - movs r0, 0x76 - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B7230 - - thumb_func_start sub_80B7270 -sub_80B7270: @ 80B7270 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_02037590 - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02020630 - adds r5, r0, r1 - movs r0, 0xA - ldrsh r1, [r4, r0] - movs r0, 0x7C - bl cosine - strh r0, [r5, 0x24] - movs r0, 0xA - ldrsh r1, [r4, r0] - movs r0, 0x76 - bl sine - strh r0, [r5, 0x26] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080B72AE - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] -_080B72AE: - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B72C0 - strh r0, [r5, 0x24] - strh r0, [r5, 0x26] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B72C0: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B7270 - - thumb_func_start sub_80B72D0 -sub_80B72D0: @ 80B72D0 - push {r4,lr} - adds r4, r0, 0 - bl sub_80E1584 - lsls r0, 24 - cmp r0, 0 - bne _080B72EC - bl sub_80E1570 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x1 - b _080B72EE -_080B72EC: - movs r0, 0 -_080B72EE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B72D0 - - thumb_func_start sub_80B72F4 -sub_80B72F4: @ 80B72F4 - push {r4,lr} - ldr r0, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r4, r0, r1 - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B7338 - bl CameraObjectReset1 - bl script_env_2_disable - movs r0, 0x4 - bl GetGoSpeed0AnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - ldr r0, =sub_80B70DC - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080B7338: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B72F4 - - thumb_func_start oei_waterfall -oei_waterfall: @ 80B734C - push {r4,lr} - ldr r4, =sub_80B7384 - adds r0, r4, 0 - movs r1, 0xFF - 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 r2, =gUnknown_02038C08 - ldr r2, [r2] - strh r2, [r1, 0xA] - bl _call_via_r4 - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end oei_waterfall - - thumb_func_start sub_80B7384 -sub_80B7384: @ 80B7384 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_0855C418 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_080B7396: - movs r0, 0x8 - ldrsh r2, [r4, r0] - lsls r2, 2 - adds r2, r5 - ldr r0, =gUnknown_02037590 - ldrb r0, [r0, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =gUnknown_02037350 - adds r1, r0 - ldr r2, [r2] - adds r0, r4, 0 - bl _call_via_r2 - lsls r0, 24 - cmp r0, 0 - bne _080B7396 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B7384 - - thumb_func_start sub_80B73D0 -sub_80B73D0: @ 80B73D0 - push {r4,lr} - adds r4, r0, 0 - bl script_env_2_enable - ldr r1, =gUnknown_02037590 - movs r0, 0x1 - strb r0, [r1, 0x6] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B73D0 - - thumb_func_start waterfall_1_do_anim_probably -waterfall_1_do_anim_probably: @ 80B73F0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl script_env_2_enable - adds r0, r5, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - bne _080B7420 - adds r0, r5, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - ldr r1, =gUnknown_02038C08 - movs r2, 0xA - ldrsh r0, [r4, r2] - str r0, [r1] - movs r0, 0x3B - bl FieldEffectStart - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B7420: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end waterfall_1_do_anim_probably - - thumb_func_start waterfall_2_wait_anim_finish_probably -waterfall_2_wait_anim_finish_probably: @ 80B742C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x6 - bl FieldEffectActiveListContains - lsls r0, 24 - cmp r0, 0 - bne _080B7446 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x1 - b _080B7448 -_080B7446: - movs r0, 0 -_080B7448: - pop {r4} - pop {r1} - bx r1 - thumb_func_end waterfall_2_wait_anim_finish_probably - - thumb_func_start sub_80B7450 -sub_80B7450: @ 80B7450 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r0, 0x2 - bl GetSimpleGoAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80B7450 - - thumb_func_start sub_80B7478 -sub_80B7478: @ 80B7478 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - bne _080B748E - movs r0, 0 - b _080B74CA -_080B748E: - ldrb r0, [r4, 0x1E] - bl MetatileBehavior_IsWaterfall - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _080B74C4 - bl script_env_2_disable - ldr r0, =gUnknown_02037590 - strb r4, [r0, 0x6] - ldr r0, =sub_80B7384 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0x2B - bl FieldEffectActiveListRemove - movs r0, 0 - b _080B74CA - .pool -_080B74C4: - movs r0, 0x3 - strh r0, [r5, 0x8] - movs r0, 0x1 -_080B74CA: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80B7478 - - thumb_func_start sub_80B74D0 -sub_80B74D0: @ 80B74D0 - push {r4,lr} - ldr r4, =sub_80B750C - adds r0, r4, 0 - movs r1, 0xFF - 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 r3, =gUnknown_02038C08 - ldr r2, [r3] - strh r2, [r1, 0x26] - ldr r2, [r3, 0x4] - strh r2, [r1, 0x24] - bl _call_via_r4 - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B74D0 - - thumb_func_start sub_80B750C -sub_80B750C: @ 80B750C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_0855C42C - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_080B751E: - 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 _080B751E - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B750C - - thumb_func_start dive_1_lock -dive_1_lock: @ 80B7544 - ldr r2, =gUnknown_02037590 - movs r1, 0x1 - strb r1, [r2, 0x6] - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - movs r0, 0 - bx lr - .pool - thumb_func_end dive_1_lock - - thumb_func_start dive_2_unknown -dive_2_unknown: @ 80B7558 - push {r4,lr} - adds r4, r0, 0 - bl script_env_2_enable - ldr r1, =gUnknown_02038C08 - movs r2, 0x26 - ldrsh r0, [r4, r2] - str r0, [r1] - movs r0, 0x3B - bl FieldEffectStart - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end dive_2_unknown - - thumb_func_start dive_3_unknown -dive_3_unknown: @ 80B7580 - push {lr} - sub sp, 0x8 - mov r1, sp - adds r1, 0x2 - mov r0, sp - bl PlayerGetDestCoords - movs r0, 0x6 - bl FieldEffectActiveListContains - lsls r0, 24 - cmp r0, 0 - bne _080B75C4 - ldr r2, =gUnknown_02037350 - ldr r0, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1E] - mov r0, sp - bl dive_warp - ldr r0, =sub_80B750C - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0x2C - bl FieldEffectActiveListRemove -_080B75C4: - movs r0, 0 - add sp, 0x8 - pop {r1} - bx r1 - .pool - thumb_func_end dive_3_unknown - - thumb_func_start sub_80B75D8 -sub_80B75D8: @ 80B75D8 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =sub_80B75F0 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B75D8 - - thumb_func_start sub_80B75F0 -sub_80B75F0: @ 80B75F0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r6, =gUnknown_0855C438 - ldr r2, =gTasks - ldr r5, =gUnknown_02037590 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_080B7604: - movs r0, 0x8 - ldrsh r3, [r4, r0] - lsls r3, 2 - adds r3, r6 - ldrb r0, [r5, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =gUnknown_02037350 - adds r1, r0 - ldrb r0, [r5, 0x4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =gUnknown_02020630 - adds r2, r0 - ldr r3, [r3] - adds r0, r4, 0 - bl _call_via_r3 - lsls r0, 24 - cmp r0, 0 - bne _080B7604 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B75F0 - - thumb_func_start sub_80B764C -sub_80B764C: @ 80B764C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl player_bitmagic - bl CameraObjectReset2 - movs r0, 0 - bl SetCameraPanningCallback - ldr r0, =gUnknown_02037590 - movs r2, 0x1 - strb r2, [r0, 0x6] - ldrb r0, [r5, 0x3] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r5, 0x3] - strh r2, [r4, 0xA] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B764C - - thumb_func_start sub_80B7684 -sub_80B7684: @ 80B7684 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0xA - ldrsh r1, [r4, r0] - movs r0, 0 - bl SetCameraPanning - ldrh r0, [r4, 0xA] - negs r0, r0 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _080B76B0 - movs r0, 0 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B76B0: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B7684 - - thumb_func_start sub_80B76B8 -sub_80B76B8: @ 80B76B8 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0 - strh r0, [r2, 0x26] - movs r0, 0x1 - strh r0, [r4, 0xE] - ldr r3, =gUnknown_02038C08 - movs r5, 0x10 - ldrsh r0, [r1, r5] - str r0, [r3] - movs r5, 0x12 - ldrsh r0, [r1, r5] - str r0, [r3, 0x4] - adds r0, r2, 0 - adds r0, 0x43 - ldrb r0, [r0] - subs r0, 0x1 - str r0, [r3, 0x8] - ldrb r0, [r2, 0x5] - lsls r0, 28 - lsrs r0, 30 - str r0, [r3, 0xC] - movs r0, 0x32 - bl FieldEffectStart - movs r0, 0xB2 - bl audio_play - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B76B8 - - thumb_func_start sub_80B7704 -sub_80B7704: @ 80B7704 - push {r4-r7,lr} - adds r4, r0, 0 - adds r6, r1, 0 - adds r5, r2, 0 - movs r0, 0xA - ldrsh r1, [r4, r0] - movs r0, 0 - bl SetCameraPanning - ldrh r0, [r4, 0xA] - negs r2, r0 - strh r2, [r4, 0xA] - ldrh r0, [r4, 0xC] - adds r1, r0, 0x1 - strh r1, [r4, 0xC] - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x11 - bgt _080B773E - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - bne _080B7750 - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, 0x3 - bgt _080B7750 - lsls r0, r2, 1 - b _080B774E -_080B773E: - movs r0, 0x4 - ands r1, r0 - cmp r1, 0 - bne _080B7750 - lsls r0, r2, 16 - cmp r0, 0 - ble _080B7750 - asrs r0, 17 -_080B774E: - strh r0, [r4, 0xA] -_080B7750: - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0x6 - ble _080B779C - adds r0, r5, 0 - adds r0, 0x29 - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r2, r1, 17 - negs r2, r2 - movs r7, 0x26 - ldrsh r3, [r5, r7] - movs r7, 0x22 - ldrsh r0, [r5, r7] - adds r0, r1 - ldr r1, =gUnknown_02021BBE - movs r7, 0 - ldrsh r1, [r1, r7] - adds r0, r1 - asrs r2, 16 - adds r0, r2 - cmn r3, r0 - ble _080B7798 - ldrh r0, [r5, 0x26] - ldrh r1, [r4, 0xE] - subs r0, r1 - strh r0, [r5, 0x26] - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x7 - bgt _080B779C - adds r0, r1, 0x1 - strh r0, [r4, 0xE] - b _080B779C - .pool -_080B7798: - movs r0, 0x1 - strh r0, [r4, 0x10] -_080B779C: - ldrh r2, [r4, 0x12] - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B77DA - movs r7, 0x26 - ldrsh r1, [r5, r7] - movs r0, 0x10 - negs r0, r0 - cmp r1, r0 - bge _080B77DA - adds r0, r2, 0x1 - strh r0, [r4, 0x12] - ldrb r0, [r6, 0x3] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r6, 0x3] - ldrb r1, [r5, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - orrs r0, r2 - strb r0, [r5, 0x5] - adds r2, r5, 0 - adds r2, 0x42 - ldrb r1, [r2] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] -_080B77DA: - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B77F0 - movs r7, 0x10 - ldrsh r0, [r4, r7] - cmp r0, 0 - beq _080B77F0 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B77F0: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80B7704 - - thumb_func_start sub_80B77F8 -sub_80B77F8: @ 80B77F8 - push {r4,lr} - adds r4, r0, 0 - bl music_something - bl sub_80AF0B4 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B77F8 - - thumb_func_start sub_80B7814 -sub_80B7814: @ 80B7814 - push {lr} - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080B784C - bl sub_80859A0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B784C - bl warp_in - ldr r1, =gUnknown_03005DAC - ldr r0, =mapldr_080851BC - str r0, [r1] - ldr r0, =c2_load_new_map - bl SetMainCallback2 - ldr r0, =sub_80B75F0 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080B784C: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B7814 - - thumb_func_start mapldr_080851BC -mapldr_080851BC: @ 80B7868 - push {lr} - bl sub_8085784 - bl pal_fill_for_maplights - bl script_env_2_enable - ldr r0, =gUnknown_03005DAC - movs r1, 0 - str r1, [r0] - ldr r0, =sub_80B7890 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end mapldr_080851BC - - thumb_func_start sub_80B7890 -sub_80B7890: @ 80B7890 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r6, =gUnknown_0855C450 - ldr r2, =gTasks - ldr r5, =gUnknown_02037590 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_080B78A4: - movs r0, 0x8 - ldrsh r3, [r4, r0] - lsls r3, 2 - adds r3, r6 - ldrb r0, [r5, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =gUnknown_02037350 - adds r1, r0 - ldrb r0, [r5, 0x4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =gUnknown_02020630 - adds r2, r0 - ldr r3, [r3] - adds r0, r4, 0 - bl _call_via_r3 - lsls r0, 24 - cmp r0, 0 - bne _080B78A4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B7890 - - thumb_func_start sub_80B78EC -sub_80B78EC: @ 80B78EC - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - bl CameraObjectReset2 - bl player_bitmagic - ldr r1, =gUnknown_02037590 - movs r0, 0x1 - strb r0, [r1, 0x6] - ldrb r0, [r4, 0x1] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B78EC - - thumb_func_start sub_80B791C -sub_80B791C: @ 80B791C - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - bl sub_80ABDFC - lsls r0, 24 - cmp r0, 0 - beq _080B795C - ldr r1, =gUnknown_02038C08 - movs r2, 0x10 - ldrsh r0, [r5, r2] - str r0, [r1] - movs r2, 0x12 - ldrsh r0, [r5, r2] - str r0, [r1, 0x4] - adds r0, r6, 0 - adds r0, 0x43 - ldrb r0, [r0] - subs r0, 0x1 - str r0, [r1, 0x8] - ldrb r0, [r6, 0x5] - lsls r0, 28 - lsrs r0, 30 - str r0, [r1, 0xC] - movs r0, 0x31 - bl FieldEffectStart - strh r0, [r4, 0xA] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B795C: - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B791C - - thumb_func_start sub_80B7968 -sub_80B7968: @ 80B7968 - push {r4,lr} - adds r2, r0, 0 - adds r4, r1, 0 - movs r0, 0xA - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02020630 - adds r0, r1 - adds r0, 0x2B - ldrb r0, [r0] - cmp r0, 0x1 - bls _080B79B0 - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] - ldrb r1, [r4, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x1] - bl CameraObjectReset1 - movs r0, 0xAF - bl audio_play - movs r0, 0x4 - bl sub_8093514 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim -_080B79B0: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B7968 - - thumb_func_start sub_80B79BC -sub_80B79BC: @ 80B79BC - push {lr} - adds r0, r1, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B79E6 - ldr r1, =gUnknown_02037590 - movs r0, 0 - strb r0, [r1, 0x6] - bl script_env_2_disable - bl sub_809757C - ldr r0, =sub_80B7890 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080B79E6: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B79BC - - thumb_func_start sub_80B79F4 -sub_80B79F4: @ 80B79F4 - push {r4,lr} - ldr r4, =gUnknown_02038C08 - adds r1, r4, 0x4 - adds r0, r4, 0 - movs r2, 0x8 - movs r3, 0x8 - bl sub_80930E0 - ldr r0, =gFieldEffectObjectTemplatePointers - adds r0, 0x84 - ldr r0, [r0] - movs r2, 0 - ldrsh r1, [r4, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - ldrb r3, [r4, 0x8] - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_02020630 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r1 - movs r1, 0x3 - ldrb r3, [r4, 0xC] - ands r3, r1 - lsls r3, 2 - ldrb r4, [r2, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r4 - orrs r1, r3 - strb r1, [r2, 0x5] - adds r2, 0x3E - ldrb r1, [r2] - movs r3, 0x2 - orrs r1, r3 - strb r1, [r2] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B79F4 - - thumb_func_start sub_80B7A58 -sub_80B7A58: @ 80B7A58 - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080B7A70 - adds r0, r2, 0 - movs r1, 0x32 - bl FieldEffectStop -_080B7A70: - pop {r0} - bx r0 - thumb_func_end sub_80B7A58 - - thumb_func_start sub_80B7A74 -sub_80B7A74: @ 80B7A74 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =sub_80B7A8C - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B7A74 - - thumb_func_start sub_80B7A8C -sub_80B7A8C: @ 80B7A8C - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r6, =gUnknown_0855C460 - ldr r2, =gTasks - ldr r5, =gUnknown_02037590 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_080B7AA0: - movs r0, 0x8 - ldrsh r3, [r4, r0] - lsls r3, 2 - adds r3, r6 - ldrb r0, [r5, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =gUnknown_02037350 - adds r1, r0 - ldrb r0, [r5, 0x4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =gUnknown_02020630 - adds r2, r0 - ldr r3, [r3] - adds r0, r4, 0 - bl _call_via_r3 - lsls r0, 24 - cmp r0, 0 - bne _080B7AA0 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B7A8C - - thumb_func_start sub_80B7AE8 -sub_80B7AE8: @ 80B7AE8 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - bl player_bitmagic - bl CameraObjectReset2 - ldr r1, =gUnknown_02037590 - movs r0, 0x1 - strb r0, [r1, 0x6] - ldrb r0, [r4, 0x3] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4, 0x3] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B7AE8 - - thumb_func_start sub_80B7B18 -sub_80B7B18: @ 80B7B18 - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r1, 0 - adds r6, r2, 0 - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B7B8C - ldrh r1, [r5, 0xA] - movs r2, 0xA - ldrsh r0, [r5, r2] - cmp r0, 0x3 - ble _080B7B6C - ldr r1, =gUnknown_02038C08 - movs r2, 0x10 - ldrsh r0, [r4, r2] - str r0, [r1] - movs r2, 0x12 - ldrsh r0, [r4, r2] - str r0, [r1, 0x4] - adds r0, r6, 0 - adds r0, 0x43 - ldrb r0, [r0] - subs r0, 0x1 - str r0, [r1, 0x8] - ldrb r0, [r6, 0x5] - lsls r0, 28 - lsrs r0, 30 - str r0, [r1, 0xC] - movs r0, 0x31 - bl FieldEffectStart - strh r0, [r5, 0xA] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - b _080B7B8C - .pool -_080B7B6C: - adds r0, r1, 0x1 - strh r0, [r5, 0xA] - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetStepInPlaceDelay4AnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - movs r0, 0x27 - bl audio_play -_080B7B8C: - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80B7B18 - - thumb_func_start sub_80B7B94 -sub_80B7B94: @ 80B7B94 - push {r4,lr} - adds r3, r0, 0 - adds r4, r1, 0 - ldr r2, =gUnknown_02020630 - movs r0, 0xA - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x2B - ldrb r0, [r0] - cmp r0, 0x2 - bne _080B7BBE - ldrb r0, [r4, 0x1] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] -_080B7BBE: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B7B94 - - thumb_func_start sub_80B7BCC -sub_80B7BCC: @ 80B7BCC - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x31 - bl FieldEffectActiveListContains - lsls r0, 24 - cmp r0, 0 - bne _080B7BEA - bl music_something - bl sub_80AF0B4 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B7BEA: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B7BCC - - thumb_func_start sub_80B7BF4 -sub_80B7BF4: @ 80B7BF4 - push {lr} - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080B7C2C - bl sub_80859A0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B7C2C - bl warp_in - ldr r1, =gUnknown_03005DAC - ldr r0, =sub_80B6B68 - str r0, [r1] - ldr r0, =c2_load_new_map - bl SetMainCallback2 - ldr r0, =sub_80B7A8C - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080B7C2C: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B7BF4 - - thumb_func_start sub_80B7C48 -sub_80B7C48: @ 80B7C48 - push {r4,lr} - ldr r4, =gUnknown_02038C08 - adds r1, r4, 0x4 - adds r0, r4, 0 - movs r2, 0x8 - movs r3, 0x8 - bl sub_80930E0 - ldr r0, =gFieldEffectObjectTemplatePointers - adds r0, 0x80 - ldr r0, [r0] - movs r2, 0 - ldrsh r1, [r4, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - ldrb r3, [r4, 0x8] - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_02020630 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r1 - movs r1, 0x3 - ldrb r3, [r4, 0xC] - ands r3, r1 - lsls r3, 2 - ldrb r4, [r2, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r4 - orrs r1, r3 - strb r1, [r2, 0x5] - adds r2, 0x3E - ldrb r1, [r2] - movs r3, 0x2 - orrs r1, r3 - strb r1, [r2] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B7C48 - - thumb_func_start sub_80B7CAC -sub_80B7CAC: @ 80B7CAC - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080B7CC4 - adds r0, r2, 0 - movs r1, 0x31 - bl FieldEffectStop -_080B7CC4: - pop {r0} - bx r0 - thumb_func_end sub_80B7CAC - - thumb_func_start sub_80B7CC8 -sub_80B7CC8: @ 80B7CC8 - push {lr} - bl script_env_2_enable - bl player_bitmagic - ldr r0, =sub_80B7CE4 - movs r1, 0x50 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B7CC8 - - thumb_func_start sub_80B7CE4 -sub_80B7CE4: @ 80B7CE4 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_0855C474 - ldr r2, =gTasks - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B7CE4 - - thumb_func_start sub_80B7D14 -sub_80B7D14: @ 80B7D14 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x40 - strh r0, [r4, 0x24] - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80B7D14 - - thumb_func_start sub_80B7D34 -sub_80B7D34: @ 80B7D34 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r1, =gUnknown_0855C47C - mov r0, sp - movs r2, 0x5 - bl memcpy - ldrh r1, [r4, 0x24] - movs r2, 0x24 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _080B7D60 - subs r0, r1, 0x1 - strh r0, [r4, 0x24] - lsls r0, 16 - cmp r0, 0 - bne _080B7D60 - bl music_something - bl sub_80AF0B4 -_080B7D60: - ldr r0, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r5, r0, r1 - adds r0, r5, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - beq _080B7D86 - adds r0, r5, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B7E40 -_080B7D86: - movs r1, 0x24 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B7DF8 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080B7DF8 - bl sub_80859A0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B7DF8 - ldrh r1, [r4, 0x26] - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl FieldObjectSetDirection - bl sub_8084E14 - bl warp_in - ldr r1, =gUnknown_03005DAC - ldr r0, =mapldr_080859D4 - str r0, [r1] - ldr r0, =c2_load_new_map - bl SetMainCallback2 - ldr r0, =sub_80B7CE4 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - b _080B7E40 - .pool -_080B7DF8: - ldrh r1, [r4, 0xA] - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _080B7E0C - subs r0, r1, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - cmp r0, 0 - bne _080B7E40 -_080B7E0C: - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 - add r0, sp - ldrb r0, [r0] - bl GetFaceDirectionAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl FieldObjectSetSpecialAnim - ldrh r1, [r4, 0xC] - movs r2, 0xC - ldrsh r0, [r4, r2] - cmp r0, 0xB - bgt _080B7E34 - adds r0, r1, 0x1 - strh r0, [r4, 0xC] -_080B7E34: - ldrh r1, [r4, 0xC] - lsls r1, 16 - asrs r1, 18 - movs r0, 0x8 - asrs r0, r1 - strh r0, [r4, 0xA] -_080B7E40: - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80B7D34 - - thumb_func_start mapldr_080859D4 -mapldr_080859D4: @ 80B7E48 - push {lr} - bl sub_8085784 - bl pal_fill_for_maplights - bl script_env_2_enable - bl player_bitmagic - ldr r1, =gUnknown_03005DAC - movs r0, 0 - str r0, [r1] - ldr r2, =gUnknown_02037350 - ldr r0, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0, 0x1] - ldr r0, =sub_80B7E94 - movs r1, 0 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end mapldr_080859D4 - - thumb_func_start sub_80B7E94 -sub_80B7E94: @ 80B7E94 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_0855C484 - ldr r2, =gTasks - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B7E94 - - thumb_func_start sub_80B7EC4 -sub_80B7EC4: @ 80B7EC4 - push {r4,lr} - adds r4, r0, 0 - bl sub_80ABDFC - lsls r0, 24 - cmp r0, 0 - beq _080B7EE2 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] -_080B7EE2: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80B7EC4 - - thumb_func_start sub_80B7EE8 -sub_80B7EE8: @ 80B7EE8 - push {r4-r6,lr} - sub sp, 0x8 - adds r5, r0, 0 - ldr r1, =gUnknown_0855C47C - mov r0, sp - movs r2, 0x5 - bl memcpy - ldr r0, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r6, r0, r1 - ldrh r1, [r5, 0xA] - movs r2, 0xA - ldrsh r0, [r5, r2] - cmp r0, 0 - beq _080B7F1A - subs r0, r1, 0x1 - strh r0, [r5, 0xA] - lsls r0, 16 - cmp r0, 0 - bne _080B7FAC -_080B7F1A: - adds r0, r6, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - beq _080B7F32 - adds r0, r6, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B7FC0 -_080B7F32: - movs r1, 0xC - ldrsh r0, [r5, r1] - cmp r0, 0x1F - ble _080B7F7C - movs r2, 0x26 - ldrsh r4, [r5, r2] - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _080B7F7C - ldrb r1, [r6, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r1 - strb r0, [r6, 0x1] - bl script_env_2_disable - bl sub_809757C - ldr r0, =sub_80B7E94 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - b _080B7FC0 - .pool -_080B7F7C: - ldrb r0, [r6, 0x18] - lsls r0, 28 - lsrs r0, 28 - add r0, sp - ldrb r0, [r0] - bl GetFaceDirectionAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl FieldObjectSetSpecialAnim - ldrh r1, [r5, 0xC] - movs r2, 0xC - ldrsh r0, [r5, r2] - cmp r0, 0x1F - bgt _080B7FA4 - adds r0, r1, 0x1 - strh r0, [r5, 0xC] -_080B7FA4: - ldrh r0, [r5, 0xC] - lsls r0, 16 - asrs r0, 18 - strh r0, [r5, 0xA] -_080B7FAC: - ldrb r2, [r6, 0x1] - lsls r1, r2, 26 - lsrs r1, 31 - movs r0, 0x1 - eors r1, r0 - lsls r1, 5 - subs r0, 0x22 - ands r0, r2 - orrs r0, r1 - strb r0, [r6, 0x1] -_080B7FC0: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80B7EE8 - - thumb_func_start sub_80B7FC8 -sub_80B7FC8: @ 80B7FC8 - push {lr} - ldr r0, =sub_80B7FDC - movs r1, 0 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B7FC8 - - thumb_func_start sub_80B7FDC -sub_80B7FDC: @ 80B7FDC - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_0855C48C - ldr r2, =gTasks - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B7FDC - - thumb_func_start sub_80B800C -sub_80B800C: @ 80B800C - push {r4,lr} - adds r4, r0, 0 - bl script_env_2_enable - bl player_bitmagic - bl CameraObjectReset2 - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80B800C - - thumb_func_start sub_80B8034 -sub_80B8034: @ 80B8034 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r1, =gUnknown_0855C47C - mov r0, sp - movs r2, 0x5 - bl memcpy - ldr r0, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r5, r0, r1 - ldrh r1, [r4, 0xA] - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _080B8066 - subs r0, r1, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - cmp r0, 0 - bne _080B8080 -_080B8066: - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 - add r0, sp - ldrb r1, [r0] - adds r0, r5, 0 - bl FieldObjectTurn - movs r0, 0x8 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] -_080B8080: - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0x7 - ble _080B80AE - movs r2, 0x26 - ldrsh r1, [r4, r2] - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 - cmp r1, r0 - bne _080B80AE - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x4 - strh r0, [r4, 0xA] - movs r0, 0x8 - strh r0, [r4, 0xC] - movs r0, 0x1 - strh r0, [r4, 0xE] - movs r0, 0x2D - bl audio_play -_080B80AE: - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8034 - - thumb_func_start sub_80B80C4 -sub_80B80C4: @ 80B80C4 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r1, =gUnknown_0855C47C - mov r0, sp - movs r2, 0x5 - bl memcpy - ldr r2, =gUnknown_02037590 - ldrb r1, [r2, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r3, r0, r1 - ldrb r1, [r2, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02020630 - adds r5, r0, r1 - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - cmp r0, 0 - bgt _080B810E - movs r0, 0x4 - strh r0, [r4, 0xA] - ldrb r0, [r3, 0x18] - lsls r0, 28 - lsrs r0, 28 - add r0, sp - ldrb r1, [r0] - adds r0, r3, 0 - bl FieldObjectTurn -_080B810E: - ldrh r0, [r5, 0x22] - ldrh r1, [r4, 0xE] - subs r0, r1 - strh r0, [r5, 0x22] - ldrh r1, [r4, 0xE] - ldrh r2, [r4, 0x10] - adds r0, r1, r2 - strh r0, [r4, 0x10] - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - cmp r0, 0 - bgt _080B813A - movs r0, 0x4 - strh r0, [r4, 0xC] - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x7 - bgt _080B813A - lsls r0, r1, 1 - strh r0, [r4, 0xE] -_080B813A: - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r0, 0x8 - ble _080B8168 - ldrb r1, [r5, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r5, 0x5] - adds r2, r5, 0 - adds r2, 0x42 - ldrb r1, [r2] - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0 - beq _080B8168 - movs r0, 0x3F - ands r0, r1 - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] -_080B8168: - movs r2, 0x10 - ldrsh r0, [r4, r2] - cmp r0, 0xA7 - ble _080B817E - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - bl music_something - bl sub_80AF0B4 -_080B817E: - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B80C4 - - thumb_func_start sub_80B8198 -sub_80B8198: @ 80B8198 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080B81E6 - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B81B8 - bl sub_81BE72C - movs r0, 0x1 - strh r0, [r4, 0x12] -_080B81B8: - bl sub_80859A0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B81E6 - bl copy_saved_warp3_bank_and_enter_x_to_warp1 - bl warp_in - ldr r0, =c2_load_new_map - bl SetMainCallback2 - ldr r1, =gUnknown_03005DAC - ldr r0, =mapldr_08085D88 - str r0, [r1] - ldr r0, =sub_80B7FDC - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080B81E6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8198 - - thumb_func_start mapldr_08085D88 -mapldr_08085D88: @ 80B8200 - push {lr} - bl sub_8085784 - bl pal_fill_for_maplights - bl script_env_2_enable - bl player_bitmagic - ldr r1, =gUnknown_03005DAC - movs r0, 0 - str r0, [r1] - ldr r2, =gUnknown_02037350 - ldr r0, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0, 0x1] - bl CameraObjectReset2 - ldr r0, =sub_80B8250 - movs r1, 0 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end mapldr_08085D88 - - thumb_func_start sub_80B8250 -sub_80B8250: @ 80B8250 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_0855C49C - ldr r2, =gTasks - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8250 - - thumb_func_start sub_80B8280 -sub_80B8280: @ 80B8280 - push {r4-r6,lr} - adds r6, r0, 0 - bl sub_80ABDFC - lsls r0, 24 - cmp r0, 0 - beq _080B82F6 - ldr r5, =gUnknown_02037590 - ldrb r0, [r5, 0x4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =gUnknown_02020630 - adds r2, r0 - adds r0, r2, 0 - adds r0, 0x29 - movs r4, 0 - ldrsb r4, [r0, r4] - lsls r0, r4, 17 - negs r0, r0 - ldrh r1, [r2, 0x22] - ldr r3, =gUnknown_02021BBE - adds r1, r4 - ldrh r3, [r3] - adds r1, r3 - asrs r0, 16 - adds r0, r1 - negs r0, r0 - strh r0, [r2, 0x26] - ldr r3, =gUnknown_02037350 - ldrb r0, [r5, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r3, [r1, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r3 - strb r0, [r1, 0x1] - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - movs r0, 0x8 - strh r0, [r6, 0xA] - movs r0, 0x1 - strh r0, [r6, 0xC] - adds r2, 0x42 - ldrb r0, [r2] - lsrs r0, 6 - strh r0, [r6, 0x24] - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x26] - movs r0, 0x2D - bl audio_play -_080B82F6: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8280 - - thumb_func_start sub_80B830C -sub_80B830C: @ 80B830C - push {r4-r7,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r1, =gUnknown_0855C47C - mov r0, sp - movs r2, 0x5 - bl memcpy - ldr r2, =gUnknown_02037590 - ldrb r1, [r2, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r6, r0, r1 - ldrb r1, [r2, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02020630 - adds r5, r0, r1 - ldrh r0, [r4, 0xA] - ldrh r1, [r5, 0x26] - adds r0, r1 - strh r0, [r5, 0x26] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x8 - negs r1, r1 - cmp r0, r1 - blt _080B8384 - ldrh r1, [r4, 0x22] - movs r2, 0x22 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _080B83AA - adds r0, r1, 0x1 - strh r0, [r4, 0x22] - ldrb r0, [r6] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r6] - ldrh r1, [r4, 0x24] - adds r3, r5, 0 - adds r3, 0x42 - lsls r1, 6 - ldrb r2, [r3] - movs r0, 0x3F - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - b _080B83AA - .pool -_080B8384: - ldrb r1, [r5, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r5, 0x5] - adds r2, r5, 0 - adds r2, 0x42 - ldrb r1, [r2] - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0 - beq _080B83AA - movs r0, 0x3F - ands r0, r1 - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] -_080B83AA: - ldrh r2, [r5, 0x26] - movs r3, 0x26 - ldrsh r1, [r5, r3] - movs r0, 0x30 - negs r0, r0 - cmp r1, r0 - blt _080B83CE - ldrh r1, [r4, 0xA] - movs r3, 0xA - ldrsh r0, [r4, r3] - cmp r0, 0x1 - ble _080B83CE - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - bne _080B83CE - subs r0, r1, 0x1 - strh r0, [r4, 0xA] -_080B83CE: - ldrh r0, [r4, 0xC] - subs r0, 0x1 - movs r7, 0 - strh r0, [r4, 0xC] - lsls r0, 16 - cmp r0, 0 - bne _080B83F0 - movs r0, 0x4 - strh r0, [r4, 0xC] - ldrb r0, [r6, 0x18] - lsls r0, 28 - lsrs r0, 28 - add r0, sp - ldrb r1, [r0] - adds r0, r6, 0 - bl FieldObjectTurn -_080B83F0: - movs r1, 0x26 - ldrsh r0, [r5, r1] - cmp r0, 0 - blt _080B8406 - strh r7, [r5, 0x26] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x1 - strh r0, [r4, 0xA] - strh r7, [r4, 0xC] -_080B8406: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80B830C - - thumb_func_start sub_80B8410 -sub_80B8410: @ 80B8410 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r1, =gUnknown_0855C47C - mov r0, sp - movs r2, 0x5 - bl memcpy - ldr r0, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r5, r0, r1 - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - cmp r0, 0 - bne _080B8484 - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 - add r0, sp - ldrb r1, [r0] - adds r0, r5, 0 - bl FieldObjectTurn - movs r0, 0x8 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _080B8484 - movs r0, 0x24 - ldrsh r1, [r4, r0] - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 - cmp r1, r0 - bne _080B8484 - bl script_env_2_disable - bl CameraObjectReset1 - bl sub_809757C - ldr r0, =sub_80B8250 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080B8484: - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8410 - - thumb_func_start sub_80B849C -sub_80B849C: @ 80B849C - push {r4,lr} - bl sav1_map_get_light_level - lsls r0, 24 - lsrs r0, 24 - bl is_light_level_1_2_3_5_or_6 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B84BC - ldr r0, =sub_80B8554 - b _080B84BE - .pool -_080B84BC: - ldr r0, =sub_80B88B4 -_080B84BE: - movs r1, 0xFF - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - ldr r2, =gUnknown_02038C08 - ldr r0, [r2] - ldr r1, [r2, 0x4] - ldr r2, [r2, 0x8] - bl sub_80B8C60 - ldr r2, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r2 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0x26] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B849C - - thumb_func_start sub_80B84F8 -sub_80B84F8: @ 80B84F8 - push {r4-r6,lr} - ldr r5, =gUnknown_02038C08 - ldr r0, [r5] - movs r6, 0x80 - lsls r6, 24 - ands r6, r0 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - adds r4, r0, 0 - muls r4, r1 - ldr r0, =gUnknown_020244EC - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - str r0, [r5] - adds r0, r4, 0 - movs r1, 0x1 - bl pokemon_getattr - str r0, [r5, 0x4] - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - str r0, [r5, 0x8] - ldr r0, [r5] - orrs r0, r6 - str r0, [r5] - movs r0, 0x6 - bl FieldEffectStart - movs r0, 0x3B - bl FieldEffectActiveListRemove - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B84F8 - - thumb_func_start sub_80B8554 -sub_80B8554: @ 80B8554 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_0855C4A8 - ldr r2, =gTasks - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8554 - - thumb_func_start sub_80B8584 -sub_80B8584: @ 80B8584 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x04000048 - ldrh r0, [r0] - strh r0, [r4, 0x1E] - ldr r0, =0x0400004a - ldrh r0, [r0] - strh r0, [r4, 0x20] - adds r0, r4, 0 - adds r0, 0x22 - ldr r1, =gUnknown_030022C0 - ldr r1, [r1, 0xC] - bl sub_806F67C - ldr r1, =0x0000f0f1 - strh r1, [r4, 0xA] - ldr r0, =0x00005051 - strh r0, [r4, 0xC] - movs r0, 0x3F - strh r0, [r4, 0xE] - movs r0, 0x3E - strh r0, [r4, 0x10] - movs r0, 0x40 - bl SetGpuReg - ldrh r1, [r4, 0xC] - movs r0, 0x44 - bl SetGpuReg - ldrh r1, [r4, 0xE] - movs r0, 0x48 - bl SetGpuReg - ldrh r1, [r4, 0x10] - movs r0, 0x4A - bl SetGpuReg - ldr r0, =sub_80B880C - bl SetVBlankCallback - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8584 - - thumb_func_start sub_80B85F8 -sub_80B85F8: @ 80B85F8 - push {r4-r6,lr} - sub sp, 0x4 - adds r6, r0, 0 - ldr r0, =0x04000008 - ldrh r1, [r0] - lsrs r1, 2 - lsls r1, 30 - lsrs r1, 16 - ldrh r4, [r0] - lsrs r4, 8 - lsls r4, 27 - lsrs r4, 16 - ldr r0, =gUnknown_0855AE50 - movs r5, 0xC0 - lsls r5, 19 - adds r1, r5 - movs r2, 0x80 - lsls r2, 1 - bl CpuSet - movs r0, 0 - str r0, [sp] - adds r5, r4, r5 - ldr r2, =0x05000200 - mov r0, sp - adds r1, r5, 0 - bl CpuSet - ldr r0, =gUnknown_0855B050 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - adds r0, r4, 0 - bl sub_80B8874 - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B85F8 - - thumb_func_start sub_80B8660 -sub_80B8660: @ 80B8660 - push {r4-r7,lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x12] - subs r0, 0x10 - strh r0, [r3, 0x12] - ldrh r6, [r3, 0xA] - ldrh r2, [r3, 0xC] - movs r7, 0xFF - lsrs r1, r6, 8 - subs r1, 0x10 - lsls r1, 16 - lsrs r0, r2, 8 - subs r0, 0x2 - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r7, 0 - ands r0, r2 - adds r5, r0, 0x2 - lsrs r2, r1, 16 - cmp r1, 0 - bge _080B868C - movs r2, 0 -_080B868C: - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, 0x27 - bgt _080B8696 - movs r4, 0x28 -_080B8696: - cmp r5, 0x78 - ble _080B869C - movs r5, 0x78 -_080B869C: - lsls r2, 16 - asrs r2, 16 - lsls r1, r2, 8 - adds r0, r7, 0 - ands r0, r6 - orrs r1, r0 - strh r1, [r3, 0xA] - lsls r0, r4, 16 - asrs r4, r0, 16 - lsls r0, r4, 8 - adds r1, r5, 0 - orrs r0, r1 - strh r0, [r3, 0xC] - cmp r2, 0 - bne _080B86DC - cmp r4, 0x28 - bne _080B86DC - cmp r1, 0x78 - bne _080B86DC - ldr r2, =gUnknown_02020630 - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_80B8CC0 - str r1, [r0] - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] -_080B86DC: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8660 - - thumb_func_start sub_80B86EC -sub_80B86EC: @ 80B86EC - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x12] - subs r0, 0x10 - strh r0, [r3, 0x12] - ldr r2, =gUnknown_02020630 - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x3C - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _080B8712 - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] -_080B8712: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B86EC - - thumb_func_start sub_80B871C -sub_80B871C: @ 80B871C - push {r4,lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x12] - subs r0, 0x10 - strh r0, [r3, 0x12] - ldrh r2, [r3, 0xC] - lsls r1, r2, 16 - movs r0, 0xFF - asrs r1, 24 - adds r1, 0x6 - lsls r1, 16 - ands r0, r2 - subs r0, 0x6 - lsls r0, 16 - lsrs r2, r0, 16 - lsrs r4, r1, 16 - asrs r1, 16 - cmp r1, 0x50 - ble _080B8744 - movs r4, 0x50 -_080B8744: - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, 0x50 - bgt _080B874E - movs r2, 0x51 -_080B874E: - lsls r0, r4, 16 - asrs r0, 16 - lsls r1, r0, 8 - lsls r2, 16 - asrs r2, 16 - orrs r1, r2 - strh r1, [r3, 0xC] - cmp r0, 0x50 - bne _080B876A - cmp r2, 0x51 - bne _080B876A - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] -_080B876A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80B871C - - thumb_func_start sub_80B8770 -sub_80B8770: @ 80B8770 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldr r0, =0x04000008 - ldrh r1, [r0] - lsrs r1, 8 - lsls r1, 27 - lsrs r1, 16 - movs r0, 0 - str r0, [sp] - movs r0, 0xC0 - lsls r0, 19 - adds r1, r0 - ldr r2, =0x05000200 - mov r0, sp - bl CpuSet - movs r0, 0xF1 - strh r0, [r4, 0xA] - movs r0, 0xA1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x1E] - strh r0, [r4, 0xE] - ldrh r0, [r4, 0x20] - strh r0, [r4, 0x10] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8770 - - thumb_func_start overworld_bg_setup_2 -overworld_bg_setup_2: @ 80B87B8 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r0, 0x22 - mov r1, sp - bl sub_806F684 - ldr r0, [sp] - bl SetVBlankCallback - bl sub_8197200 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02020630 - adds r0, r1 - ldrh r1, [r4, 0x26] - lsls r1, 24 - lsrs r1, 24 - bl sub_80B6070 - movs r0, 0x6 - bl FieldEffectActiveListRemove - ldr r0, =sub_80B8554 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end overworld_bg_setup_2 - - thumb_func_start sub_80B880C -sub_80B880C: @ 80B880C - push {r4,lr} - sub sp, 0x4 - ldr r0, =sub_80B8554 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks - adds r4, r0 - adds r0, r4, 0 - adds r0, 0x22 - mov r1, sp - bl sub_806F684 - ldr r0, [sp] - bl _call_via_r0 - ldrh r1, [r4, 0xA] - movs r0, 0x40 - bl SetGpuReg - ldrh r1, [r4, 0xC] - movs r0, 0x44 - bl SetGpuReg - ldrh r1, [r4, 0xE] - movs r0, 0x48 - bl SetGpuReg - ldrh r1, [r4, 0x10] - movs r0, 0x4A - bl SetGpuReg - ldrh r1, [r4, 0x12] - movs r0, 0x10 - bl SetGpuReg - ldrh r1, [r4, 0x14] - movs r0, 0x12 - bl SetGpuReg - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B880C - - thumb_func_start sub_80B8874 -sub_80B8874: @ 80B8874 - push {r4,r5,lr} - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x06000140 - adds r2, r0, r1 - movs r1, 0 - ldr r5, =gUnknown_0855B070 - movs r0, 0xF0 - lsls r0, 8 - adds r4, r0, 0 - ldr r3, =0x0000013f -_080B888A: - lsls r0, r1, 1 - adds r0, r5 - ldrh r0, [r0] - orrs r0, r4 - strh r0, [r2] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - adds r2, 0x2 - cmp r1, r3 - bls _080B888A - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8874 - - thumb_func_start sub_80B88B4 -sub_80B88B4: @ 80B88B4 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_0855C4C4 - ldr r2, =gTasks - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B88B4 - - thumb_func_start sub_80B88E4 -sub_80B88E4: @ 80B88E4 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0xA] - movs r0, 0x10 - bl SetGpuReg - ldrh r1, [r4, 0xC] - movs r0, 0x12 - bl SetGpuReg - adds r0, r4, 0 - adds r0, 0x22 - ldr r1, =gUnknown_030022C0 - ldr r1, [r1, 0xC] - bl sub_806F67C - ldr r0, =sub_80B8AE0 - bl SetVBlankCallback - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B88E4 - - thumb_func_start sub_80B8920 -sub_80B8920: @ 80B8920 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - adds r6, r0, 0 - ldr r0, =0x04000008 - ldrh r1, [r0] - lsrs r1, 2 - lsls r1, 30 - lsrs r1, 16 - ldrh r4, [r0] - lsrs r4, 8 - lsls r4, 27 - lsrs r4, 16 - movs r0, 0 - mov r8, r0 - strh r4, [r6, 0x20] - ldr r0, =gUnknown_0855B2F0 - movs r5, 0xC0 - lsls r5, 19 - adds r1, r5 - movs r2, 0x40 - bl CpuSet - mov r0, r8 - str r0, [sp] - adds r4, r5 - ldr r2, =0x05000200 - mov r0, sp - adds r1, r4, 0 - bl CpuSet - ldr r0, =gUnknown_0855B370 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8920 - - thumb_func_start sub_80B898C -sub_80B898C: @ 80B898C - push {r4,lr} - adds r4, r0, 0 - bl sub_80B8B38 - lsls r0, 24 - cmp r0, 0 - beq _080B89C4 - movs r0, 0x42 - movs r1, 0xF0 - bl SetGpuReg - ldr r1, =0x00002878 - movs r0, 0x46 - bl SetGpuReg - ldr r2, =gUnknown_02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_80B8CC0 - str r1, [r0] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B89C4: - adds r0, r4, 0 - bl sub_80B8B28 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B898C - - thumb_func_start sub_80B89DC -sub_80B89DC: @ 80B89DC - push {r4,lr} - adds r4, r0, 0 - bl sub_80B8B28 - ldr r2, =gUnknown_02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x3C - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _080B8A00 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B8A00: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B89DC - - thumb_func_start sub_80B8A0C -sub_80B8A0C: @ 80B8A0C - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_80B8B28 - ldrh r1, [r4, 0xA] - movs r0, 0x7 - ands r0, r1 - movs r1, 0 - strh r0, [r4, 0xE] - strh r1, [r4, 0x10] - ldr r5, =0x0000ffff - movs r0, 0x42 - adds r1, r5, 0 - bl SetGpuReg - movs r0, 0x46 - adds r1, r5, 0 - bl SetGpuReg - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8A0C - - thumb_func_start sub_80B8A44 -sub_80B8A44: @ 80B8A44 - push {r4,lr} - adds r4, r0, 0 - bl sub_80B8B28 - adds r0, r4, 0 - bl sub_80B8BF0 - lsls r0, 24 - cmp r0, 0 - beq _080B8A5E - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B8A5E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80B8A44 - - thumb_func_start sub_80B8A64 -sub_80B8A64: @ 80B8A64 - push {r4,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r0, =0x04000008 - ldrh r1, [r0] - lsrs r1, 8 - lsls r1, 27 - lsrs r1, 16 - movs r0, 0 - str r0, [sp] - movs r0, 0xC0 - lsls r0, 19 - adds r1, r0 - ldr r2, =0x05000200 - mov r0, sp - bl CpuSet - adds r0, r4, 0 - adds r0, 0x22 - add r1, sp, 0x4 - bl sub_806F684 - ldr r0, [sp, 0x4] - bl SetVBlankCallback - bl sub_8197200 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02020630 - adds r0, r1 - ldrh r1, [r4, 0x26] - lsls r1, 24 - lsrs r1, 24 - bl sub_80B6070 - movs r0, 0x6 - bl FieldEffectActiveListRemove - ldr r0, =sub_80B88B4 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8A64 - - thumb_func_start sub_80B8AE0 -sub_80B8AE0: @ 80B8AE0 - push {r4,lr} - sub sp, 0x4 - ldr r0, =sub_80B88B4 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks - adds r4, r0 - adds r0, r4, 0 - adds r0, 0x22 - mov r1, sp - bl sub_806F684 - ldr r0, [sp] - bl _call_via_r0 - ldrh r1, [r4, 0xA] - movs r0, 0x10 - bl SetGpuReg - ldrh r1, [r4, 0xC] - movs r0, 0x12 - bl SetGpuReg - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8AE0 - - thumb_func_start sub_80B8B28 -sub_80B8B28: @ 80B8B28 - ldrh r1, [r0, 0xA] - subs r1, 0x10 - strh r1, [r0, 0xA] - ldrh r1, [r0, 0xE] - adds r1, 0x10 - strh r1, [r0, 0xE] - bx lr - thumb_func_end sub_80B8B28 - - thumb_func_start sub_80B8B38 -sub_80B8B38: @ 80B8B38 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r5, r0, 0 - ldrh r2, [r5, 0x10] - movs r1, 0x10 - ldrsh r0, [r5, r1] - cmp r0, 0x1F - ble _080B8B54 - movs r0, 0x1 - b _080B8BD8 -_080B8B54: - ldrh r0, [r5, 0xE] - lsls r0, 16 - asrs r3, r0, 19 - movs r1, 0x1F - ands r3, r1 - movs r4, 0x10 - ldrsh r0, [r5, r4] - cmp r3, r0 - blt _080B8BD6 - movs r0, 0x20 - subs r3, r0, r3 - ands r3, r1 - subs r0, r2 - mov r12, r0 - mov r7, r12 - ands r7, r1 - mov r12, r7 - ldrh r0, [r5, 0x20] - ldr r1, =0x06000140 - adds r1, r0 - mov r8, r1 - movs r4, 0 - ldr r7, =gUnknown_0855B390 - mov r10, r7 - movs r0, 0xF0 - lsls r0, 8 - mov r9, r0 - adds r1, r3, 0x1 - movs r0, 0x1F - ands r1, r0 - str r1, [sp] - mov r6, r12 - adds r6, 0x1 - ands r6, r0 -_080B8B98: - lsls r1, r4, 5 - adds r2, r1, r3 - lsls r2, 1 - add r2, r8 - mov r7, r12 - adds r0, r7, r1 - lsls r0, 1 - add r0, r10 - ldrh r0, [r0] - mov r7, r9 - orrs r0, r7 - strh r0, [r2] - ldr r0, [sp] - adds r2, r1, r0 - lsls r2, 1 - add r2, r8 - adds r1, r6, r1 - lsls r1, 1 - add r1, r10 - ldrh r0, [r1] - mov r1, r9 - orrs r0, r1 - strh r0, [r2] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x9 - bls _080B8B98 - ldrh r0, [r5, 0x10] - adds r0, 0x2 - strh r0, [r5, 0x10] -_080B8BD6: - movs r0, 0 -_080B8BD8: - 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_80B8B38 - - thumb_func_start sub_80B8BF0 -sub_80B8BF0: @ 80B8BF0 - push {r4-r7,lr} - adds r5, r0, 0 - movs r1, 0x10 - ldrsh r0, [r5, r1] - cmp r0, 0x1F - ble _080B8C00 - movs r0, 0x1 - b _080B8C54 -_080B8C00: - ldrh r0, [r5, 0xE] - lsls r0, 16 - asrs r0, 19 - lsls r0, 16 - lsrs r2, r0, 16 - movs r1, 0x10 - ldrsh r0, [r5, r1] - cmp r2, r0 - blt _080B8C52 - ldrh r0, [r5, 0xA] - lsls r0, 16 - asrs r2, r0, 19 - movs r0, 0x1F - ands r2, r0 - ldrh r0, [r5, 0x20] - ldr r1, =0x06000140 - adds r6, r0, r1 - movs r3, 0 - movs r0, 0xF0 - lsls r0, 8 - adds r7, r0, 0 - adds r4, r2, 0x1 - movs r0, 0x1F - ands r4, r0 -_080B8C30: - lsls r0, r3, 5 - adds r1, r0, r2 - lsls r1, 1 - adds r1, r6 - strh r7, [r1] - adds r0, r4 - lsls r0, 1 - adds r0, r6 - strh r7, [r0] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x9 - bls _080B8C30 - ldrh r0, [r5, 0x10] - adds r0, 0x2 - strh r0, [r5, 0x10] -_080B8C52: - movs r0, 0 -_080B8C54: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B8BF0 - - thumb_func_start sub_80B8C60 -sub_80B8C60: @ 80B8C60 - push {r4-r6,lr} - sub sp, 0x8 - adds r6, r0, 0 - movs r5, 0x80 - lsls r5, 24 - ands r5, r6 - lsrs r5, 16 - lsls r5, 16 - lsrs r5, 16 - ldr r0, =0x7fffffff - ands r6, r0 - lsls r0, r6, 16 - lsrs r0, 16 - movs r3, 0xA0 - lsls r3, 1 - movs r4, 0x50 - str r4, [sp] - movs r4, 0 - str r4, [sp, 0x4] - bl sub_80B5FE8 - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r1, =gUnknown_02020630 - adds r2, r1 - ldr r1, =DummyObjectCallback - str r1, [r2, 0x1C] - ldrb r3, [r2, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r3 - strb r1, [r2, 0x5] - strh r6, [r2, 0x2E] - strh r5, [r2, 0x3A] - add sp, 0x8 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B8C60 - - thumb_func_start sub_80B8CC0 -sub_80B8CC0: @ 80B8CC0 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x20] - subs r0, 0x14 - strh r0, [r1, 0x20] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x78 - bgt _080B8D00 - movs r0, 0x78 - strh r0, [r1, 0x20] - movs r0, 0x1E - strh r0, [r1, 0x30] - ldr r0, =sub_80B8D04 - str r0, [r1, 0x1C] - movs r2, 0x3A - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _080B8CF8 - ldrh r0, [r1, 0x2E] - movs r1, 0 - movs r2, 0x7D - movs r3, 0xA - bl sub_80A32C0 - b _080B8D00 - .pool -_080B8CF8: - ldrh r0, [r1, 0x2E] - movs r1, 0 - bl cry_related -_080B8D00: - pop {r0} - bx r0 - thumb_func_end sub_80B8CC0 - - thumb_func_start sub_80B8D04 -sub_80B8D04: @ 80B8D04 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x30] - subs r0, 0x1 - strh r0, [r1, 0x30] - lsls r0, 16 - cmp r0, 0 - bne _080B8D18 - ldr r0, =sub_80B8D20 - str r0, [r1, 0x1C] -_080B8D18: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8D04 - - thumb_func_start sub_80B8D20 -sub_80B8D20: @ 80B8D20 - push {lr} - adds r2, r0, 0 - ldrh r3, [r2, 0x20] - movs r0, 0x20 - ldrsh r1, [r2, r0] - movs r0, 0x40 - negs r0, r0 - cmp r1, r0 - bge _080B8D38 - movs r0, 0x1 - strh r0, [r2, 0x3C] - b _080B8D3E -_080B8D38: - adds r0, r3, 0 - subs r0, 0x14 - strh r0, [r2, 0x20] -_080B8D3E: - pop {r0} - bx r0 - thumb_func_end sub_80B8D20 - - thumb_func_start sub_80B8D44 -sub_80B8D44: @ 80B8D44 - push {lr} - ldr r0, =sub_80B8D84 - movs r1, 0xFF - 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 r0, =gUnknown_02038C08 - ldr r0, [r0] - strh r0, [r1, 0x26] - bl sav1_reset_battle_music_maybe - ldr r0, =0x0000016d - bl sub_80858C4 - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B8D44 - - thumb_func_start sub_80B8D84 -sub_80B8D84: @ 80B8D84 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_0855C4E0 - ldr r2, =gTasks - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8D84 - - thumb_func_start sub_80B8DB4 -sub_80B8DB4: @ 80B8DB4 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r4, r0, 0 - bl script_env_2_enable - bl player_bitmagic - ldr r5, =gUnknown_02037590 - movs r0, 0x1 - strb r0, [r5, 0x6] - movs r0, 0x8 - bl SetPlayerAvatarStateMask - adds r6, r4, 0 - adds r6, 0xA - movs r0, 0xC - adds r0, r4 - mov r8, r0 - adds r0, r6, 0 - mov r1, r8 - bl PlayerGetDestCoords - ldr r2, =gUnknown_02037350 - ldrb r1, [r5, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x18] - lsrs r0, 4 - adds r1, r6, 0 - mov r2, r8 - bl MoveCoords - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8DB4 - - thumb_func_start sub_80B8E14 -sub_80B8E14: @ 80B8E14 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r4, r0, r1 - adds r0, r4, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - beq _080B8E3E - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B8E50 -_080B8E3E: - bl sub_808C114 - adds r0, r4, 0 - movs r1, 0x39 - bl FieldObjectSetSpecialAnim - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] -_080B8E50: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8E14 - - thumb_func_start sub_80B8E60 -sub_80B8E60: @ 80B8E60 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r0, r1 - bl FieldObjectCheckIfSpecialAnimFinishedOrInactive - lsls r0, 24 - cmp r0, 0 - beq _080B8E96 - ldr r2, =gUnknown_02038C08 - movs r1, 0x26 - ldrsh r0, [r4, r1] - movs r1, 0x80 - lsls r1, 24 - orrs r0, r1 - str r0, [r2] - movs r0, 0x3B - bl FieldEffectStart - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B8E96: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8E60 - - thumb_func_start sub_80B8EA8 -sub_80B8EA8: @ 80B8EA8 - push {r4-r6,lr} - adds r6, r0, 0 - movs r0, 0x6 - bl FieldEffectActiveListContains - lsls r0, 24 - cmp r0, 0 - bne _080B8F12 - ldr r5, =gUnknown_02037590 - ldrb r0, [r5, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_02037350 - adds r4, r0 - movs r0, 0x3 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl sub_8093540 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - ldr r1, =gUnknown_02038C08 - movs r2, 0xA - ldrsh r0, [r6, r2] - str r0, [r1] - movs r2, 0xC - ldrsh r0, [r6, r2] - str r0, [r1, 0x4] - ldrb r0, [r5, 0x5] - str r0, [r1, 0x8] - movs r0, 0x8 - bl FieldEffectStart - strb r0, [r4, 0x1A] - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] -_080B8F12: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8EA8 - - thumb_func_start sub_80B8F24 -sub_80B8F24: @ 80B8F24 - push {r4,r5,lr} - ldr r5, =gUnknown_02037590 - ldrb r1, [r5, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r4, r0, r1 - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B8F84 - movs r0, 0 - strb r0, [r5, 0x6] - ldrb r1, [r5] - movs r0, 0xDF - ands r0, r1 - strb r0, [r5] - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl GetFaceDirectionAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - ldrb r0, [r4, 0x1A] - movs r1, 0x1 - bl sub_81555AC - bl sub_809757C - bl script_env_2_disable - movs r0, 0x9 - bl FieldEffectActiveListRemove - ldr r0, =sub_80B8D84 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080B8F84: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8F24 - - thumb_func_start sub_80B8F98 -sub_80B8F98: @ 80B8F98 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =gFieldEffectObjectTemplatePointers - adds r0, 0x90 - ldr r0, [r0] - movs r2, 0x18 - negs r2, r2 - movs r1, 0x78 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, r0, 4 - add r1, r8 - lsls r1, 2 - ldr r0, =gUnknown_02020630 - adds r1, r0 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - movs r2, 0x4 - orrs r0, r2 - movs r2, 0xF - ands r0, r2 - movs r2, 0x40 - orrs r0, r2 - strb r0, [r1, 0x5] - movs r2, 0 - strh r2, [r1, 0x2E] - strh r2, [r1, 0x30] - strh r2, [r1, 0x32] - ldr r0, =0x0000ffff - strh r0, [r1, 0x34] - ldrh r0, [r1, 0x22] - strh r0, [r1, 0x36] - strh r2, [r1, 0x38] - ldr r1, =0x00003e41 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x00000e0e - movs r0, 0x52 - bl SetGpuReg - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - ldr r0, =gUnknown_0855B610 - movs r1, 0xC0 - movs r2, 0x20 - bl LoadPalette - movs r0, 0x12 - movs r1, 0x78 - bl SetGpuReg - movs r4, 0x3 - ldr r7, =0x0600f800 - ldr r0, =0x0000bff4 - adds r6, r0, 0 -_080B901A: - movs r2, 0xC - lsls r0, r4, 1 - lsls r5, r4, 5 - adds r0, r4 - lsls r3, r0, 1 -_080B9024: - adds r0, r5, r2 - lsls r0, 1 - adds r0, r7 - adds r1, r2, r6 - adds r1, r3, r1 - adds r1, 0x1 - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x11 - bls _080B9024 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xE - bls _080B901A - movs r0, 0 - ldr r5, =gUnknown_0855B630 -_080B904A: - movs r4, 0 - adds r7, r0, 0x1 - lsls r6, r0, 5 -_080B9050: - lsls r1, r4, 2 - adds r1, r6, r1 - ldr r0, =0x06008020 - adds r3, r1, r0 - adds r0, r1, 0x1 - adds r0, r5 - ldrb r2, [r0] - lsls r2, 8 - adds r0, r1, r5 - ldrb r0, [r0] - adds r0, r2 - strh r0, [r3] - ldr r0, =0x06008022 - adds r3, r1, r0 - adds r0, r1, 0x3 - adds r0, r5 - ldrb r2, [r0] - lsls r2, 8 - adds r1, 0x2 - adds r1, r5 - ldrb r0, [r1] - adds r0, r2 - strh r0, [r3] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _080B9050 - lsls r0, r7, 24 - lsrs r0, 24 - cmp r0, 0x59 - bls _080B904A - mov r0, r8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B8F98 - - thumb_func_start sub_80B90CC -sub_80B90CC: @ 80B90CC - push {r4,lr} - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x68] - movs r1, 0x78 - movs r2, 0 - movs r3, 0x1 - bl AddObjectToFront - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r2, r4, 4 - adds r2, r4 - lsls r2, 2 - ldr r0, =gUnknown_02020630 - adds r2, r0 - ldrb r1, [r2, 0x5] - movs r0, 0xF - ands r0, r1 - movs r1, 0xD - negs r1, r1 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2, 0x5] - ldr r0, =sub_80B9128 - str r0, [r2, 0x1C] - ldr r0, =gUnknown_02038C08 - ldr r0, [r0] - strh r0, [r2, 0x30] - movs r0, 0x9E - bl audio_play - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B90CC - - thumb_func_start sub_80B9128 -sub_80B9128: @ 80B9128 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r1, 0x8C - bl cosine - movs r5, 0 - strh r0, [r4, 0x24] - movs r2, 0x32 - ldrsh r0, [r4, r2] - movs r1, 0x48 - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x4 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x32] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080B918A - movs r2, 0x30 - ldrsh r0, [r4, r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =gUnknown_02020630 - adds r1, r0 - adds r3, r1, 0 - adds r3, 0x3E - ldrb r2, [r3] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r3] - ldrh r0, [r4, 0x24] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r1, 0x20] - ldrh r0, [r4, 0x26] - ldrh r2, [r4, 0x22] - adds r0, r2 - subs r0, 0x8 - strh r0, [r1, 0x22] - strh r5, [r1, 0x24] - strh r5, [r1, 0x26] -_080B918A: - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x7F - ble _080B919A - adds r0, r4, 0 - movs r1, 0x1E - bl FieldEffectStop -_080B919A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9128 - - thumb_func_start sub_80B91A4 -sub_80B91A4: @ 80B91A4 - push {lr} - ldr r0, =sub_80B91D4 - movs r1, 0xFE - 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 r0, =gUnknown_02038C08 - ldr r0, [r0] - strh r0, [r1, 0xA] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B91A4 - - thumb_func_start sub_80B91D4 -sub_80B91D4: @ 80B91D4 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_0855C4F4 - ldr r2, =gTasks - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B91D4 - - thumb_func_start sub_80B9204 -sub_80B9204: @ 80B9204 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =gUnknown_02037590 - ldrb r1, [r6, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r4, r0, r1 - adds r0, r4, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - beq _080B922E - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B924C -_080B922E: - ldrb r0, [r6] - strh r0, [r5, 0x26] - movs r0, 0x1 - strb r0, [r6, 0x6] - bl SetPlayerAvatarStateMask - bl sub_808C114 - adds r0, r4, 0 - movs r1, 0x39 - bl FieldObjectSetSpecialAnim - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] -_080B924C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9204 - - thumb_func_start sub_80B925C -sub_80B925C: @ 80B925C - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r0, r1 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B928C - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - ldr r1, =gUnknown_02038C08 - movs r2, 0xA - ldrsh r0, [r4, r2] - str r0, [r1] - movs r0, 0x3B - bl FieldEffectStart -_080B928C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B925C - - thumb_func_start sub_80B92A0 -sub_80B92A0: @ 80B92A0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x6 - bl FieldEffectActiveListContains - lsls r0, 24 - cmp r0, 0 - bne _080B92E8 - ldr r0, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r5, r0, r1 - ldrh r1, [r4, 0x26] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _080B92D8 - ldrb r0, [r5, 0x1A] - movs r1, 0x2 - bl sub_81555AC - ldrb r0, [r5, 0x1A] - movs r1, 0 - bl sub_81555D8 -_080B92D8: - bl sub_80B94C4 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B92E8: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B92A0 - - thumb_func_start sub_80B92F8 -sub_80B92F8: @ 80B92F8 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0xA] - bl sub_80B9508 - lsls r0, 24 - cmp r0, 0 - beq _080B932C - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x10 - strh r0, [r4, 0xC] - movs r0, 0x1 - bl SetPlayerAvatarTransitionFlags - ldr r0, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r0, r1 - movs r1, 0x2 - bl FieldObjectSetSpecialAnim -_080B932C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B92F8 - - thumb_func_start sub_80B933C -sub_80B933C: @ 80B933C - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r2, r0, r1 - ldrh r1, [r4, 0xC] - movs r3, 0xC - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _080B9362 - subs r0, r1, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - cmp r0, 0 - bne _080B9380 -_080B9362: - adds r0, r2, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B9380 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x9E - bl audio_play - ldrb r0, [r4, 0xA] - bl sub_80B9524 -_080B9380: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B933C - - thumb_func_start sub_80B9390 -sub_80B9390: @ 80B9390 - push {r4-r6,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0xC] - adds r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _080B9406 - ldr r0, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r4, r0, r1 - movs r0, 0x3 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r6, =gUnknown_02020630 - adds r0, r6 - movs r1, 0x16 - bl StartObjectImageAnim - ldrb r0, [r4, 0x1] - movs r1, 0x10 - orrs r0, r1 - strb r0, [r4, 0x1] - adds r0, r4, 0 - movs r1, 0x48 - bl FieldObjectSetSpecialAnim - ldrh r1, [r5, 0x26] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _080B93FC - ldrb r1, [r4, 0x1A] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl RemoveObjectAndFreeTiles -_080B93FC: - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0 - strh r0, [r5, 0xC] -_080B9406: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9390 - - thumb_func_start sub_80B9418 -sub_80B9418: @ 80B9418 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0xC] - adds r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - ble _080B9464 - ldr r0, =gUnknown_02037590 - ldrb r0, [r0, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_02037350 - adds r4, r0 - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimActive - ldrb r1, [r4, 0x1] - movs r0, 0x11 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x1] - ldrb r1, [r4, 0x2] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x2] - ldrb r0, [r5, 0xA] - ldrb r1, [r4, 0x4] - bl sub_80B9560 - bl CameraObjectReset2 - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] -_080B9464: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9418 - - thumb_func_start sub_80B9474 -sub_80B9474: @ 80B9474 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0xA] - bl sub_80B9508 - lsls r0, 24 - cmp r0, 0 - beq _080B948E - bl sub_80AF0B4 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B948E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80B9474 - - thumb_func_start sub_80B9494 -sub_80B9494: @ 80B9494 - push {lr} - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080B94B6 - movs r0, 0x1F - bl FieldEffectActiveListRemove - ldr r0, =sub_80B91D4 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080B94B6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9494 - - thumb_func_start sub_80B94C4 -sub_80B94C4: @ 80B94C4 - push {lr} - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x68] - movs r1, 0xFF - movs r2, 0xB4 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r1, =gUnknown_02020630 - adds r2, r1 - ldrb r3, [r2, 0x5] - movs r1, 0xF - ands r1, r3 - movs r3, 0xD - negs r3, r3 - ands r1, r3 - movs r3, 0x4 - orrs r1, r3 - strb r1, [r2, 0x5] - ldr r1, =sub_80B957C - str r1, [r2, 0x1C] - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B94C4 - - thumb_func_start sub_80B9508 -sub_80B9508: @ 80B9508 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x3C] - lsls r0, 24 - lsrs r0, 24 - bx lr - .pool - thumb_func_end sub_80B9508 - - thumb_func_start sub_80B9524 -sub_80B9524: @ 80B9524 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_02020630 - adds r4, r0 - ldr r0, =sub_80B963C - str r0, [r4, 0x1C] - movs r1, 0 - movs r0, 0x78 - strh r0, [r4, 0x20] - strh r1, [r4, 0x22] - strh r1, [r4, 0x24] - strh r1, [r4, 0x26] - adds r0, r4, 0 - adds r0, 0x2E - movs r2, 0x10 - bl memset - movs r0, 0x40 - strh r0, [r4, 0x3A] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9524 - - thumb_func_start sub_80B9560 -sub_80B9560: @ 80B9560 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_02020630 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - strh r1, [r2, 0x3A] - bx lr - .pool - thumb_func_end sub_80B9560 - - thumb_func_start sub_80B957C -sub_80B957C: @ 80B957C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B9628 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B95C0 - ldrb r0, [r4, 0x1] - movs r1, 0x3 - orrs r0, r1 - strb r0, [r4, 0x1] - ldr r0, =gUnknown_0855C548 - str r0, [r4, 0x10] - adds r0, r4, 0 - bl obj_alloc_rotscale_entry - adds r0, r4, 0 - movs r1, 0 - bl StartObjectRotScalAnim - movs r0, 0x76 - strh r0, [r4, 0x20] - ldr r0, =0x0000ffd0 - strh r0, [r4, 0x22] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r0, 0x40 - strh r0, [r4, 0x30] - adds r0, 0xC0 - strh r0, [r4, 0x32] -_080B95C0: - ldrh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r4, 0x30] - adds r0, r1 - strh r0, [r4, 0x30] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x78 - bl cosine - strh r0, [r4, 0x24] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x78 - bl sine - strh r0, [r4, 0x26] - ldrh r2, [r4, 0x32] - movs r0, 0x32 - ldrsh r1, [r4, r0] - ldr r0, =0x000007ff - cmp r1, r0 - bgt _080B95F6 - adds r0, r2, 0 - adds r0, 0x60 - strh r0, [r4, 0x32] -_080B95F6: - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0x81 - ble _080B9628 - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] - ldrb r1, [r4, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x1] - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - ldrb r1, [r4, 0x1] - lsrs r1, 6 - ldrb r2, [r4, 0x3] - lsrs r2, 6 - adds r0, r4, 0 - movs r3, 0 - bl CalcVecFromObjectCenterToObjectUpperLeft -_080B9628: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B957C - - thumb_func_start sub_80B963C -sub_80B963C: @ 80B963C - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r1, 0x8C - bl cosine - movs r5, 0 - strh r0, [r4, 0x24] - movs r2, 0x32 - ldrsh r0, [r4, r2] - movs r1, 0x48 - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x4 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x32] - movs r1, 0x3A - ldrsh r0, [r4, r1] - cmp r0, 0x40 - beq _080B969A - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =gUnknown_02020630 - adds r1, r0 - adds r3, r1, 0 - adds r3, 0x3E - ldrb r2, [r3] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r3] - ldrh r0, [r4, 0x24] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r1, 0x20] - ldrh r0, [r4, 0x26] - ldrh r2, [r4, 0x22] - adds r0, r2 - subs r0, 0x8 - strh r0, [r1, 0x22] - strh r5, [r1, 0x24] - strh r5, [r1, 0x26] -_080B969A: - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x7F - ble _080B96A6 - movs r0, 0x1 - strh r0, [r4, 0x3C] -_080B96A6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B963C - - thumb_func_start sub_80B96B0 -sub_80B96B0: @ 80B96B0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B9784 - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _080B96FA - ldrb r0, [r4, 0x1] - movs r1, 0x3 - orrs r0, r1 - strb r0, [r4, 0x1] - ldr r0, =gUnknown_0855C548 - str r0, [r4, 0x10] - adds r0, r4, 0 - bl obj_alloc_rotscale_entry - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - movs r0, 0x5E - strh r0, [r4, 0x20] - ldr r0, =0x0000ffe0 - strh r0, [r4, 0x22] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r0, 0xF0 - strh r0, [r4, 0x30] - movs r0, 0x80 - lsls r0, 4 - strh r0, [r4, 0x32] - movs r0, 0x80 - strh r0, [r4, 0x36] -_080B96FA: - ldrh r1, [r4, 0x32] - lsls r1, 16 - asrs r1, 24 - ldrh r2, [r4, 0x30] - adds r2, r1 - ldrh r0, [r4, 0x34] - adds r0, r1 - strh r0, [r4, 0x34] - movs r0, 0xFF - ands r2, r0 - strh r2, [r4, 0x30] - movs r3, 0x30 - ldrsh r0, [r4, r3] - movs r1, 0x20 - bl cosine - strh r0, [r4, 0x24] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x78 - bl sine - strh r0, [r4, 0x26] - ldrh r1, [r4, 0x32] - movs r2, 0x32 - ldrsh r0, [r4, r2] - movs r2, 0x80 - lsls r2, 1 - cmp r0, r2 - ble _080B973C - ldrh r0, [r4, 0x36] - subs r0, r1, r0 - strh r0, [r4, 0x32] -_080B973C: - ldrh r1, [r4, 0x36] - movs r3, 0x36 - ldrsh r0, [r4, r3] - cmp r0, 0xFF - bgt _080B974C - adds r0, r1, 0 - adds r0, 0x18 - strh r0, [r4, 0x36] -_080B974C: - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0xFF - bgt _080B9756 - strh r2, [r4, 0x32] -_080B9756: - movs r2, 0x34 - ldrsh r0, [r4, r2] - cmp r0, 0x3B - ble _080B9784 - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] - ldrb r1, [r4, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x1] - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_080B9784: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B96B0 - - thumb_func_start sub_80B9794 -sub_80B9794: @ 80B9794 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_80B9524 - ldr r1, =gUnknown_02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_80B96B0 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9794 - - thumb_func_start sub_80B97C0 -sub_80B97C0: @ 80B97C0 - push {lr} - ldr r0, =sub_80B97D4 - movs r1, 0xFE - bl CreateTask - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B97C0 - - thumb_func_start sub_80B97D4 -sub_80B97D4: @ 80B97D4 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_0855C550 - ldr r2, =gTasks - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B97D4 - - thumb_func_start sub_80B9804 -sub_80B9804: @ 80B9804 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =gUnknown_02037590 - ldrb r1, [r6, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r4, r0, r1 - adds r0, r4, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - beq _080B982E - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B98A6 -_080B982E: - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0x11 - strh r0, [r5, 0xC] - ldrb r0, [r6] - strh r0, [r5, 0x26] - movs r0, 0x1 - strb r0, [r6, 0x6] - bl SetPlayerAvatarStateMask - ldrh r1, [r5, 0x26] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _080B9856 - ldrb r0, [r4, 0x1A] - movs r1, 0 - bl sub_81555AC -_080B9856: - movs r0, 0x3 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - bl CameraObjectReset2 - adds r0, r4, 0 - movs r1, 0x3 - bl FieldObjectTurn - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02020630 - adds r0, r1 - movs r1, 0x16 - bl StartObjectImageAnim - ldrb r1, [r4, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x1] - bl sub_80B94C4 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0xA] - bl sub_80B9524 - ldrb r0, [r5, 0xA] - ldrb r1, [r4, 0x4] - bl sub_80B9560 -_080B98A6: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9804 - - thumb_func_start sub_80B98B8 -sub_80B98B8: @ 80B98B8 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r1, [r5, 0xC] - movs r2, 0xC - ldrsh r0, [r5, r2] - cmp r0, 0 - beq _080B98D0 - subs r0, r1, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - cmp r0, 0 - bne _080B9910 -_080B98D0: - ldr r0, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r0, r1 - ldrb r0, [r0, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_02020630 - adds r4, r0 - ldrb r0, [r5, 0xA] - movs r1, 0x40 - bl sub_80B9560 - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - movs r1, 0 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - strh r1, [r4, 0x24] - strh r1, [r4, 0x26] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - strh r1, [r5, 0xC] -_080B9910: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B98B8 - - thumb_func_start sub_80B9924 -sub_80B9924: @ 80B9924 - push {r4,lr} - sub sp, 0x24 - adds r4, r0, 0 - ldr r1, =gUnknown_0855C56C - mov r0, sp - movs r2, 0x24 - bl memcpy - ldr r0, =gUnknown_02037590 - ldrb r0, [r0, 0x4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =gUnknown_02020630 - adds r1, r0 - movs r2, 0xC - ldrsh r0, [r4, r2] - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - strh r0, [r1, 0x26] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x11 - ble _080B9962 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B9962: - add sp, 0x24 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9924 - - thumb_func_start sub_80B9978 -sub_80B9978: @ 80B9978 - push {r4-r6,lr} - adds r6, r0, 0 - ldrb r0, [r6, 0xA] - bl sub_80B9508 - lsls r0, 24 - cmp r0, 0 - beq _080B99DC - ldr r0, =gUnknown_02037590 - ldrb r0, [r0, 0x5] - lsls r5, r0, 3 - adds r5, r0 - lsls r5, 2 - ldr r0, =gUnknown_02037350 - adds r5, r0 - ldrb r0, [r5, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_02020630 - adds r4, r0 - ldrb r1, [r5, 0x1] - movs r0, 0x11 - negs r0, r0 - ands r0, r1 - strb r0, [r5, 0x1] - movs r0, 0x10 - ldrsh r1, [r5, r0] - movs r0, 0x12 - ldrsh r2, [r5, r0] - adds r0, r5, 0 - bl sub_808EB08 - movs r0, 0 - strh r0, [r4, 0x24] - strh r0, [r4, 0x26] - adds r4, 0x3E - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - bl sub_808C114 - adds r0, r5, 0 - movs r1, 0x39 - bl FieldObjectSetSpecialAnim - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] -_080B99DC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9978 - - thumb_func_start sub_80B99F0 -sub_80B99F0: @ 80B99F0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r0, r1 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B9A18 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - ldrb r0, [r4, 0xA] - bl sub_80B9794 -_080B9A18: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B99F0 - - thumb_func_start sub_80B9A28 -sub_80B9A28: @ 80B9A28 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0xA] - bl sub_80B9508 - lsls r0, 24 - cmp r0, 0 - beq _080B9A54 - movs r0, 0xA - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x10 - strh r0, [r4, 0xA] -_080B9A54: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9A28 - - thumb_func_start sub_80B9A60 -sub_80B9A60: @ 80B9A60 - push {r4-r7,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0xA] - subs r0, 0x1 - strh r0, [r5, 0xA] - lsls r0, 16 - cmp r0, 0 - bne _080B9ACA - ldr r6, =gUnknown_02037590 - ldrb r1, [r6, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r4, r0, r1 - movs r7, 0 - ldrh r1, [r5, 0x26] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _080B9A94 - movs r7, 0x3 - ldrb r0, [r4, 0x1A] - movs r1, 0x1 - bl sub_81555AC -_080B9A94: - adds r0, r7, 0 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - adds r0, r4, 0 - movs r1, 0x1 - bl FieldObjectTurn - ldrh r0, [r5, 0x26] - strb r0, [r6] - movs r0, 0 - strb r0, [r6, 0x6] - movs r0, 0x20 - bl FieldEffectActiveListRemove - ldr r0, =sub_80B97D4 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080B9ACA: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9A60 - - thumb_func_start sub_80B9ADC -sub_80B9ADC: @ 80B9ADC - push {r4,lr} - sub sp, 0x4 - ldr r4, =gUnknown_02038C08 - ldrb r0, [r4] - ldrb r1, [r4, 0x4] - ldrb r2, [r4, 0x8] - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _080B9B2C - ldr r0, =sub_80B9BE8 - movs r1, 0x50 - 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, sp - ldrb r0, [r0] - strh r0, [r1, 0xC] - ldr r0, [r4] - strh r0, [r1, 0x14] - ldr r0, [r4, 0x4] - strh r0, [r1, 0x16] - ldr r0, [r4, 0x8] - strh r0, [r1, 0x18] - b _080B9B32 - .pool -_080B9B2C: - movs r0, 0x41 - bl FieldEffectActiveListRemove -_080B9B32: - movs r0, 0 - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B9ADC - - thumb_func_start sub_80B9B3C -sub_80B9B3C: @ 80B9B3C - 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, 0xE - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080B9B78 - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _080B9B7C - movs r0, 0 - strh r0, [r4, 0xC] - ldrh r1, [r4, 0xA] - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _080B9B7C - subs r0, r1, 0x1 - b _080B9B7A - .pool -_080B9B78: - movs r0, 0x4 -_080B9B7A: - strh r0, [r4, 0xA] -_080B9B7C: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _080B9BB6 - movs r0, 0 - strh r0, [r4] - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080B9BAC - ldrh r1, [r4, 0xA] - negs r1, r1 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl SetCameraPanning - b _080B9BB6 -_080B9BAC: - movs r0, 0xA - ldrsh r1, [r4, r0] - movs r0, 0 - bl SetCameraPanning -_080B9BB6: - bl UpdateCameraPanning - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B9BC8 - adds r0, r5, 0 - bl DestroyTask -_080B9BC8: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80B9B3C - - thumb_func_start sub_80B9BD0 -sub_80B9BD0: @ 80B9BD0 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0x1 - strh r0, [r1, 0x16] - bx lr - .pool - thumb_func_end sub_80B9BD0 - - thumb_func_start sub_80B9BE8 -sub_80B9BE8: @ 80B9BE8 - 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 InstallCameraPanAheadCallback - movs r0, 0 - bl SetCameraPanningCallback - ldr r1, =gUnknown_0855C590 - movs r2, 0x2 - ldrsh r0, [r4, r2] - lsls r0, 2 - adds r0, r1 - ldr r2, [r0] - adds r0, r4, 0 - adds r1, r5, 0 - bl _call_via_r2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9BE8 - - thumb_func_start sub_80B9C28 -sub_80B9C28: @ 80B9C28 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =sub_80B9B3C - movs r1, 0x5A - bl CreateTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x58 - bl audio_play - strh r4, [r5, 0xA] - ldrh r0, [r5, 0x2] - adds r0, 0x1 - strh r0, [r5, 0x2] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9C28 - - thumb_func_start sub_80B9C54 -sub_80B9C54: @ 80B9C54 - push {r4-r7,lr} - sub sp, 0x4 - adds r7, r0, 0 - ldrh r0, [r7, 0x6] - adds r0, 0x1 - strh r0, [r7, 0x6] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x78 - ble _080B9CC2 - ldr r2, =gUnknown_02037350 - movs r1, 0x4 - ldrsh r0, [r7, r1] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_02020630 - adds r4, r0 - ldrb r0, [r1, 0x1] - movs r2, 0x20 - orrs r0, r2 - strb r0, [r1, 0x1] - ldr r6, =0x0000ffff - ldr r5, =0x00007fff - adds r0, r6, 0 - movs r1, 0x10 - adds r2, r5, 0 - bl BlendPalettes - str r5, [sp] - adds r0, r6, 0 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - adds r0, r4, 0 - bl sub_80B9D24 - movs r0, 0x57 - bl audio_play - ldrb r0, [r7, 0xA] - bl sub_80B9BD0 - movs r0, 0 - strh r0, [r7, 0x6] - ldrh r0, [r7, 0x2] - adds r0, 0x1 - strh r0, [r7, 0x2] -_080B9CC2: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9C54 - - thumb_func_start sub_80B9CDC -sub_80B9CDC: @ 80B9CDC - push {r4,r5,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080B9D16 - ldr r0, =sub_80B9B3C - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _080B9D16 - bl InstallCameraPanAheadCallback - ldrb r0, [r4, 0xC] - ldrb r1, [r4, 0xE] - ldrb r2, [r4, 0x10] - bl RemoveFieldObjectByLocalIdAndMap - movs r0, 0x41 - bl FieldEffectActiveListRemove - adds r0, r5, 0 - bl DestroyTask -_080B9D16: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9CDC - - thumb_func_start sub_80B9D24 -sub_80B9D24: @ 80B9D24 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - ldr r0, =gUnknown_03005DEC - movs r1, 0 - ldrsh r2, [r0, r1] - movs r3, 0x20 - ldrsh r0, [r6, r3] - adds r2, r0 - movs r1, 0x24 - ldrsh r0, [r6, r1] - adds r2, r0 - ldr r0, =gUnknown_03005DE8 - movs r3, 0 - ldrsh r0, [r0, r3] - movs r3, 0x22 - ldrsh r1, [r6, r3] - adds r0, r1 - movs r3, 0x26 - ldrsh r1, [r6, r3] - adds r0, r1 - subs r0, 0x4 - movs r5, 0 - lsls r2, 16 - mov r8, r2 - lsls r7, r0, 16 -_080B9D5A: - ldr r0, =gUnknown_0855C5EC - mov r2, r8 - asrs r1, r2, 16 - asrs r2, r7, 16 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _080B9D96 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_02020630 - adds r4, r0 - lsls r1, r5, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - strh r5, [r4, 0x2E] - ldrb r1, [r6, 0x5] - lsrs r1, 4 - lsls r1, 4 - ldrb r2, [r4, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x5] -_080B9D96: - adds r5, 0x1 - cmp r5, 0x3 - ble _080B9D5A - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9D24 - - thumb_func_start sub_80B9DB8 -sub_80B9DB8: @ 80B9DB8 - push {lr} - adds r1, r0, 0 - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0x1 - beq _080B9DE4 - cmp r0, 0x1 - bgt _080B9DCE - cmp r0, 0 - beq _080B9DD8 - b _080B9E02 -_080B9DCE: - cmp r0, 0x2 - beq _080B9DF0 - cmp r0, 0x3 - beq _080B9DF6 - b _080B9E02 -_080B9DD8: - ldrh r0, [r1, 0x20] - subs r0, 0x10 - strh r0, [r1, 0x20] - ldrh r0, [r1, 0x22] - subs r0, 0xC - b _080B9E00 -_080B9DE4: - ldrh r0, [r1, 0x20] - adds r0, 0x10 - strh r0, [r1, 0x20] - ldrh r0, [r1, 0x22] - subs r0, 0xC - b _080B9E00 -_080B9DF0: - ldrh r0, [r1, 0x20] - subs r0, 0x10 - b _080B9DFA -_080B9DF6: - ldrh r0, [r1, 0x20] - adds r0, 0x10 -_080B9DFA: - strh r0, [r1, 0x20] - ldrh r0, [r1, 0x22] - adds r0, 0xC -_080B9E00: - strh r0, [r1, 0x22] -_080B9E02: - ldrh r0, [r1, 0x20] - adds r0, 0x4 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xF8 - bhi _080B9E1E - movs r0, 0x22 - ldrsh r2, [r1, r0] - movs r0, 0x4 - negs r0, r0 - cmp r2, r0 - blt _080B9E1E - cmp r2, 0xA4 - ble _080B9E24 -_080B9E1E: - adds r0, r1, 0 - bl RemoveObjectAndFreeTiles -_080B9E24: - pop {r0} - bx r0 - thumb_func_end sub_80B9DB8 - - thumb_func_start sub_80B9E28 -sub_80B9E28: @ 80B9E28 - push {r4-r7,lr} - sub sp, 0x4 - ldr r7, =gUnknown_02038C08 - ldrb r0, [r7] - ldrb r1, [r7, 0x4] - ldrb r2, [r7, 0x8] - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _080B9EBE - mov r0, sp - ldrb r0, [r0] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_02037350 - adds r4, r0 - movs r0, 0x10 - ldrsh r5, [r4, r0] - subs r5, 0x7 - movs r0, 0x12 - ldrsh r6, [r4, r0] - subs r6, 0x7 - ldr r1, [r7, 0xC] - subs r5, r1, r5 - lsls r5, 4 - ldr r2, [r7, 0x10] - subs r6, r2, r6 - lsls r6, 4 - adds r1, 0x7 - lsls r1, 16 - asrs r1, 16 - adds r2, 0x7 - lsls r2, 16 - asrs r2, 16 - adds r0, r4, 0 - bl npc_coords_shift - ldr r0, =sub_80B9EDC - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gTasks - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - adds r2, r1 - ldrb r0, [r4, 0x4] - strh r0, [r2, 0xA] - ldr r3, =gUnknown_02020630 - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0, 0x20] - adds r0, r5 - strh r0, [r2, 0xC] - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0, 0x22] - adds r0, r6 - strh r0, [r2, 0xE] - ldr r0, [r7, 0x14] - strh r0, [r2, 0x18] - mov r0, sp - ldrb r0, [r0] - strh r0, [r2, 0x1A] -_080B9EBE: - movs r0, 0 - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B9E28 - - thumb_func_start sub_80B9EDC -sub_80B9EDC: @ 80B9EDC - 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 r5, r0, r1 - movs r0, 0x2 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02020630 - adds r6, r0, r1 - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _080B9F10 - cmp r0, 0x1 - beq _080B9F4E - b _080B9FAC - .pool -_080B9F10: - ldrh r0, [r6, 0x20] - lsls r0, 4 - strh r0, [r5, 0x8] - ldrh r0, [r6, 0x22] - lsls r0, 4 - strh r0, [r5, 0xA] - movs r2, 0x4 - ldrsh r0, [r5, r2] - lsls r0, 4 - movs r2, 0x8 - ldrsh r1, [r5, r2] - subs r0, r1 - movs r2, 0x10 - ldrsh r1, [r5, r2] - bl __divsi3 - strh r0, [r5, 0xC] - movs r1, 0x6 - ldrsh r0, [r5, r1] - lsls r0, 4 - movs r2, 0xA - ldrsh r1, [r5, r2] - subs r0, r1 - movs r2, 0x10 - ldrsh r1, [r5, r2] - bl __divsi3 - strh r0, [r5, 0xE] - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] -_080B9F4E: - ldrh r1, [r5, 0x10] - movs r2, 0x10 - ldrsh r0, [r5, r2] - cmp r0, 0 - beq _080B9F7C - subs r0, r1, 0x1 - strh r0, [r5, 0x10] - ldrh r1, [r5, 0xC] - ldrh r0, [r5, 0x8] - adds r1, r0 - strh r1, [r5, 0x8] - ldrh r0, [r5, 0xE] - ldrh r2, [r5, 0xA] - adds r0, r2 - strh r0, [r5, 0xA] - lsls r1, 16 - asrs r1, 20 - strh r1, [r6, 0x20] - ldrh r0, [r5, 0xA] - lsls r0, 16 - asrs r0, 20 - strh r0, [r6, 0x22] - b _080B9FAC -_080B9F7C: - movs r1, 0x12 - ldrsh r0, [r5, r1] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_02037350 - adds r4, r0 - ldrh r0, [r5, 0x4] - strh r0, [r6, 0x20] - ldrh r0, [r5, 0x6] - strh r0, [r6, 0x22] - adds r0, r4, 0 - bl npc_coords_shift_still - ldrb r0, [r4] - movs r1, 0x8 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x42 - bl FieldEffectActiveListRemove - adds r0, r7, 0 - bl DestroyTask -_080B9FAC: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9EDC - - thumb_func_start remove_some_task -remove_some_task: @ 80B9FB8 - push {r4,lr} - ldr r4, =gUnknown_02039B28 - movs r0, 0 - strb r0, [r4, 0x15] - ldr r1, =0x040000b0 - ldrh r2, [r1, 0xA] - ldr r0, =0x0000c5ff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r2, [r1, 0xA] - ldr r0, =0x00007fff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r0, [r1, 0xA] - ldrb r0, [r4, 0x18] - cmp r0, 0xFF - beq _080B9FE2 - bl DestroyTask - movs r0, 0xFF - strb r0, [r4, 0x18] -_080B9FE2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end remove_some_task - - thumb_func_start dp12_8087EA4 -dp12_8087EA4: @ 80B9FF8 - push {r4,lr} - sub sp, 0x4 - mov r0, sp - movs r4, 0 - strh r4, [r0] - ldr r1, =gUnknown_02038C28 - ldr r2, =0x01000780 - bl CpuSet - ldr r0, =gUnknown_02039B28 - movs r1, 0 - str r1, [r0] - str r1, [r0, 0x4] - str r1, [r0, 0x8] - str r1, [r0, 0xC] - strb r4, [r0, 0x14] - strb r4, [r0, 0x15] - strb r4, [r0, 0x16] - strb r4, [r0, 0x17] - movs r1, 0xFF - strb r1, [r0, 0x18] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp12_8087EA4 - - thumb_func_start sub_80BA038 -sub_80BA038: @ 80BA038 - push {lr} - sub sp, 0xC - str r0, [sp] - str r1, [sp, 0x4] - str r2, [sp, 0x8] - ldr r0, =0xa2600001 - cmp r1, r0 - bne _080BA06C - ldr r0, =gUnknown_02039B28 - ldr r1, =gUnknown_02038C2A - str r1, [r0] - movs r2, 0xF0 - lsls r2, 3 - adds r1, r2 - str r1, [r0, 0x4] - ldr r1, =sub_80BA134 - b _080BA07C - .pool -_080BA06C: - ldr r0, =gUnknown_02039B28 - ldr r1, =gUnknown_02038C2C - str r1, [r0] - movs r2, 0xF0 - lsls r2, 3 - adds r1, r2 - str r1, [r0, 0x4] - ldr r1, =sub_80BA154 -_080BA07C: - str r1, [r0, 0x10] - adds r1, r0, 0 - ldr r0, [sp, 0x4] - str r0, [r1, 0xC] - ldr r0, [sp] - str r0, [r1, 0x8] - mov r0, sp - ldrb r0, [r0, 0x8] - strb r0, [r1, 0x15] - mov r0, sp - ldrb r0, [r0, 0x9] - strb r0, [r1, 0x16] - strb r0, [r1, 0x17] - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BA038 - - thumb_func_start sub_80BA0A8 -sub_80BA0A8: @ 80BA0A8 - push {r4,lr} - ldr r4, =gUnknown_02039B28 - ldrb r0, [r4, 0x15] - cmp r0, 0 - beq _080BA122 - cmp r0, 0x3 - bne _080BA0EC - movs r0, 0 - strb r0, [r4, 0x15] - ldr r1, =0x040000b0 - ldrh r2, [r1, 0xA] - ldr r0, =0x0000c5ff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r2, [r1, 0xA] - ldr r0, =0x00007fff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r0, [r1, 0xA] - ldr r1, =gUnknown_02039B44 - movs r0, 0x1 - strb r0, [r1] - b _080BA122 - .pool -_080BA0EC: - ldr r1, =0x040000b0 - ldrh r2, [r1, 0xA] - ldr r0, =0x0000c5ff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r2, [r1, 0xA] - ldr r0, =0x00007fff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r0, [r1, 0xA] - ldrb r0, [r4, 0x14] - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - str r0, [r1] - ldr r0, [r4, 0x8] - str r0, [r1, 0x4] - ldr r0, [r4, 0xC] - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - ldr r0, [r4, 0x10] - bl _call_via_r0 - ldrb r0, [r4, 0x14] - movs r1, 0x1 - eors r0, r1 - strb r0, [r4, 0x14] -_080BA122: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BA0A8 - - thumb_func_start sub_80BA134 -sub_80BA134: @ 80BA134 - ldr r0, =gUnknown_02039B28 - ldr r2, [r0, 0x8] - ldrb r1, [r0, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - ldr r1, =gUnknown_02038C28 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2] - bx lr - .pool - thumb_func_end sub_80BA134 - - thumb_func_start sub_80BA154 -sub_80BA154: @ 80BA154 - ldr r0, =gUnknown_02039B28 - ldr r2, [r0, 0x8] - ldrb r1, [r0, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - ldr r1, =gUnknown_02038C28 - adds r0, r1 - ldr r0, [r0] - str r0, [r2] - bx lr - .pool - thumb_func_end sub_80BA154 - - thumb_func_start task00_for_dp12 -task00_for_dp12: @ 80BA174 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r12, r0 - movs r6, 0 - ldr r0, =gUnknown_02039B44 - ldrb r0, [r0] - cmp r0, 0 - beq _080BA1A4 - mov r0, r12 - bl DestroyTask - ldr r1, =gUnknown_02039B28 - movs r0, 0xFF - strb r0, [r1, 0x18] - b _080BA324 - .pool -_080BA1A4: - ldr r1, =gTasks - mov r0, r12 - lsls r2, r0, 2 - adds r0, r2, r0 - lsls r0, 3 - adds r3, r0, r1 - movs r4, 0x16 - ldrsh r0, [r3, r4] - mov r10, r1 - mov r9, r2 - cmp r0, 0 - beq _080BA250 - movs r1, 0x14 - ldrsh r0, [r3, r1] - cmp r0, 0xE - bhi _080BA250 - lsls r0, 2 - ldr r1, =_080BA1D8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080BA1D8: - .4byte _080BA214 - .4byte _080BA250 - .4byte _080BA21C - .4byte _080BA250 - .4byte _080BA224 - .4byte _080BA250 - .4byte _080BA22C - .4byte _080BA250 - .4byte _080BA234 - .4byte _080BA250 - .4byte _080BA23C - .4byte _080BA250 - .4byte _080BA244 - .4byte _080BA250 - .4byte _080BA24C -_080BA214: - ldr r0, =gUnknown_02022E14 - b _080BA24E - .pool -_080BA21C: - ldr r0, =gUnknown_02022E16 - b _080BA24E - .pool -_080BA224: - ldr r0, =gUnknown_02022E18 - b _080BA24E - .pool -_080BA22C: - ldr r0, =gUnknown_02022E1A - b _080BA24E - .pool -_080BA234: - ldr r0, =gUnknown_02022E1C - b _080BA24E - .pool -_080BA23C: - ldr r0, =gUnknown_02022E1E - b _080BA24E - .pool -_080BA244: - ldr r0, =gUnknown_02022E20 - b _080BA24E - .pool -_080BA24C: - ldr r0, =gUnknown_02022E22 -_080BA24E: - ldrh r6, [r0] -_080BA250: - mov r0, r9 - add r0, r12 - lsls r0, 3 - mov r2, r10 - adds r1, r0, r2 - ldrh r2, [r1, 0x10] - movs r3, 0x10 - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _080BA2BC - subs r0, r2, 0x1 - strh r0, [r1, 0x10] - movs r4, 0xE - ldrsh r0, [r1, r4] - movs r3, 0xA0 - lsls r3, 1 - adds r2, r0, r3 - movs r4, 0x8 - ldrsh r3, [r1, r4] - movs r4, 0xA - ldrsh r0, [r1, r4] - cmp r3, r0 - bge _080BA324 - ldr r5, =gUnknown_02038C28 - ldr r0, =gUnknown_02039B28 - mov r8, r0 - adds r7, r1, 0 - lsls r0, r2, 1 - adds r4, r0, r5 -_080BA28A: - lsls r2, r3, 1 - mov r0, r8 - ldrb r1, [r0, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r2, r0 - adds r2, r5 - ldrh r0, [r4] - adds r0, r6 - strh r0, [r2] - adds r4, 0x2 - adds r3, 0x1 - movs r1, 0xA - ldrsh r0, [r7, r1] - cmp r3, r0 - blt _080BA28A - b _080BA324 - .pool -_080BA2BC: - ldrh r0, [r1, 0x12] - strh r0, [r1, 0x10] - movs r2, 0xE - ldrsh r0, [r1, r2] - movs r3, 0xA0 - lsls r3, 1 - adds r2, r0, r3 - movs r4, 0x8 - ldrsh r3, [r1, r4] - movs r4, 0xA - ldrsh r0, [r1, r4] - cmp r3, r0 - bge _080BA304 - ldr r5, =gUnknown_02038C28 - adds r7, r1, 0 - lsls r0, r2, 1 - adds r4, r0, r5 - ldr r0, =gUnknown_02039B28 - mov r8, r0 -_080BA2E2: - lsls r2, r3, 1 - mov r0, r8 - ldrb r1, [r0, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r2, r0 - adds r2, r5 - ldrh r0, [r4] - adds r0, r6 - strh r0, [r2] - adds r4, 0x2 - adds r3, 0x1 - movs r1, 0xA - ldrsh r0, [r7, r1] - cmp r3, r0 - blt _080BA2E2 -_080BA304: - mov r0, r9 - add r0, r12 - lsls r0, 3 - mov r3, r10 - adds r2, r0, r3 - ldrh r0, [r2, 0xE] - adds r0, 0x1 - strh r0, [r2, 0xE] - lsls r0, 16 - asrs r0, 16 - movs r4, 0xC - ldrsh r1, [r2, r4] - cmp r0, r1 - bne _080BA324 - movs r0, 0 - strh r0, [r2, 0xE] -_080BA324: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end task00_for_dp12 - - thumb_func_start sub_80BA33C -sub_80BA33C: @ 80BA33C - push {r4-r7,lr} - adds r6, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r4, r2, 24 - movs r1, 0 - movs r2, 0 - ldr r0, =gUnknown_08329F40 - mov r12, r0 -_080BA350: - lsls r0, r1, 1 - adds r3, r0, r6 - lsls r0, r2, 1 - add r0, r12 - movs r7, 0 - ldrsh r0, [r0, r7] - muls r0, r4 - cmp r0, 0 - bge _080BA364 - adds r0, 0xFF -_080BA364: - asrs r0, 8 - strh r0, [r3] - adds r0, r2, r5 - lsls r0, 24 - lsrs r2, r0, 24 - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0xFF - bls _080BA350 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BA33C - - thumb_func_start sub_80BA384 -sub_80BA384: @ 80BA384 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - adds r5, r0, 0 - str r1, [sp, 0x10] - ldr r0, [sp, 0x40] - mov r8, r0 - ldr r1, [sp, 0x44] - mov r9, r1 - ldr r0, [sp, 0x48] - mov r10, r0 - lsls r5, 24 - lsrs r5, 24 - ldr r1, [sp, 0x10] - lsls r1, 24 - str r1, [sp, 0x14] - lsrs r0, r1, 24 - str r0, [sp, 0xC] - lsls r1, r2, 24 - lsrs r1, 24 - str r1, [sp, 0x18] - lsls r2, r3, 24 - lsrs r2, 24 - str r2, [sp, 0x1C] - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - mov r3, r9 - lsls r3, 24 - lsrs r3, 24 - mov r9, r3 - mov r0, r10 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - bl dp12_8087EA4 - ldr r0, =0x04000010 - add r0, r9 - str r0, [sp] - ldr r0, =0xa2600001 - str r0, [sp, 0x4] - mov r1, sp - movs r0, 0x1 - strb r0, [r1, 0x8] - mov r0, sp - movs r1, 0 - strb r1, [r0, 0x9] - ldr r0, [sp] - ldr r1, [sp, 0x4] - ldr r2, [sp, 0x8] - bl sub_80BA038 - ldr r0, =task00_for_dp12 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gTasks - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 3 - adds r4, r0 - strh r5, [r4, 0x8] - mov r3, sp - ldrh r3, [r3, 0xC] - strh r3, [r4, 0xA] - movs r0, 0x80 - lsls r0, 1 - ldr r1, [sp, 0x18] - bl __divsi3 - strh r0, [r4, 0xC] - movs r0, 0 - strh r0, [r4, 0xE] - mov r1, r8 - strh r1, [r4, 0x10] - strh r1, [r4, 0x12] - mov r3, r9 - strh r3, [r4, 0x14] - mov r0, r10 - strh r0, [r4, 0x16] - ldr r0, =gUnknown_02039B28 - strb r7, [r0, 0x18] - ldr r0, =gUnknown_02039B44 - movs r1, 0 - strb r1, [r0] - ldr r4, =gUnknown_02038EA8 - ldr r3, [sp, 0xC] - subs r6, r3, r5 - lsls r3, r6, 24 - lsrs r3, 24 - adds r0, r4, 0 - ldr r1, [sp, 0x18] - ldr r2, [sp, 0x1C] - bl sub_80BA33C - ldr r0, [sp, 0xC] - cmp r5, r0 - bge _080BA47E - ldr r1, =0xfffffd80 - adds r2, r4, r1 - lsls r1, r5, 1 - movs r3, 0xF0 - lsls r3, 3 - adds r0, r1, r3 - adds r3, r0, r2 - adds r1, r2 - adds r2, r4, 0 - adds r5, r6, 0 -_080BA46A: - ldrh r0, [r2] - strh r0, [r1] - ldrh r0, [r2] - strh r0, [r3] - adds r2, 0x2 - adds r3, 0x2 - adds r1, 0x2 - subs r5, 0x1 - cmp r5, 0 - bne _080BA46A -_080BA47E: - adds r0, r7, 0 - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80BA384 - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_80C6FA0.s b/asm/rom_80C6FA0.s index 01cd80664..519a8ddcf 100644 --- a/asm/rom_80C6FA0.s +++ b/asm/rom_80C6FA0.s @@ -76,16 +76,16 @@ _080C700E: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _080C7036 adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _080C7036 adds r0, r6, 0x1 @@ -118,21 +118,21 @@ _080C705A: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _080C7092 adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _080C7092 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _080C7092 adds r0, r6, 0x1 @@ -173,10 +173,10 @@ sub_80C70C4: @ 80C70C4 _080C70CA: movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _080C70E2 adds r0, r5, 0x1 @@ -202,7 +202,7 @@ sub_80C70FC: @ 80C70FC adds r5, r0, 0 lsls r4, r2, 16 lsrs r4, 16 - bl CopyString + bl StringCopy adds r1, r0, 0 adds r5, r4 cmp r1, r5 @@ -495,7 +495,7 @@ _080C7342: _080C7348: ldrh r3, [r5, 0xA] strh r3, [r5, 0xE] - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r0, 0x40 ands r0, r1 @@ -627,7 +627,7 @@ _080C745C: strh r0, [r5, 0x8] b _080C756A _080C746A: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r7, 0x3 adds r4, r7, 0 @@ -778,7 +778,7 @@ sub_80C7578: @ 80C7578 thumb_func_start mapldr_0808C6D8 mapldr_0808C6D8: @ 80C75A8 push {r4,r5,lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r5, [r0, 0xC] movs r0, 0 bl SetVBlankCallback @@ -1021,12 +1021,12 @@ _080C779E: lsrs r0, 24 bl sav3_get_box_name ldr r1, =gUnknown_085EBCC1 - bl CopyString + bl StringCopy adds r4, r5, 0x1 adds r1, r4, 0 movs r2, 0 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN lsls r4, 16 lsrs r5, r4, 16 cmp r5, 0xD @@ -1183,7 +1183,7 @@ sub_80C78E4: @ 80C78E4 thumb_func_start sub_80C78F0 sub_80C78F0: @ 80C78F0 push {lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -1615,10 +1615,10 @@ sub_80C7BE4: @ 80C7BE4 adds r1, r5, 0 movs r2, 0x1 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r1, =gUnknown_08571737 add r0, sp, 0xC - bl AppendString + bl StringAppend movs r0, 0x1 add r1, sp, 0xC movs r2, 0x40 @@ -1866,7 +1866,7 @@ sub_80C7E98: @ 80C7E98 adds r1, 0x10 movs r2, 0x8 bl sub_80D2A90 - ldr r1, =gUnknown_030022B0 + ldr r1, =gKeyRepeatStartDelay movs r0, 0x14 strh r0, [r1] bl clear_scheduled_bg_copies_to_vram @@ -2270,7 +2270,7 @@ _080C8268: lsls r0, 24 cmp r0, 0 bne _080C82A0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -2713,7 +2713,7 @@ _080C8690: b _080C879E .pool _080C86B4: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 @@ -2745,7 +2745,7 @@ _080C86EA: b _080C879E .pool _080C86FC: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 @@ -3221,7 +3221,7 @@ _080C8B58: b _080C8B82 .pool _080C8B6C: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 @@ -3405,7 +3405,7 @@ _080C8CE8: b _080C8D6E .pool _080C8D00: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 @@ -3561,7 +3561,7 @@ _080C8E7A: b _080C8EA2 .pool _080C8E88: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 @@ -3676,7 +3676,7 @@ _080C8F80: movs r0, 0xA b _080C9058 _080C8F8C: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 @@ -3688,7 +3688,7 @@ _080C8F9A: b _080C9058 .pool _080C8FA4: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 @@ -3728,7 +3728,7 @@ _080C9004: movs r0, 0xA b _080C9058 _080C9008: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 @@ -3738,7 +3738,7 @@ _080C9008: b _080C9058 .pool _080C901C: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 @@ -3757,7 +3757,7 @@ _080C9038: movs r0, 0x13 b _080C9058 _080C904A: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 @@ -3782,7 +3782,7 @@ _080C9070: b _080C9096 .pool _080C9080: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 @@ -3985,7 +3985,7 @@ _080C9238: bl sub_80CAC58 b _080C9268 _080C9258: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 @@ -4091,7 +4091,7 @@ _080C9328: b _080C93A2 .pool _080C9348: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 @@ -4116,7 +4116,7 @@ _080C9374: b _080C93A2 .pool _080C938C: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 @@ -4201,7 +4201,7 @@ _080C9438: bl sub_80CAC58 b _080C9468 _080C9458: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 @@ -4274,7 +4274,7 @@ _080C94FA: bl IsDma3ManagerBusyWithBgCopy b _080C951C _080C9500: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 @@ -4393,7 +4393,7 @@ _080C95F4: strb r0, [r1] b _080C9664 _080C9602: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 @@ -4506,7 +4506,7 @@ _080C96E6: bne _080C9720 b _080C9702 _080C96F2: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 @@ -5134,7 +5134,7 @@ _080C9C58: b _080C9D08 .pool _080C9C78: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 @@ -5265,7 +5265,7 @@ _080C9D8C: b _080C9E3C .pool _080C9DAC: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 @@ -5473,7 +5473,7 @@ sub_80C9F6C: @ 80C9F6C beq _080C9FAC movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xC mov r2, sp @@ -6714,10 +6714,10 @@ sub_80CAA74: @ 80CAA74 _080CAA78: movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData negs r1, r0 orrs r1, r0 lsrs r1, 31 @@ -7015,7 +7015,7 @@ _080CACF4: ldr r2, =0x00000d65 adds r1, r2 _080CAD00: - bl CopyString + bl StringCopy adds r2, r0, 0 b _080CAD16 .pool @@ -7351,12 +7351,12 @@ sub_80CAFC4: @ 80CAFC4 ldr r4, =0x000020a4 adds r0, r4 movs r1, 0 - bl pokemon_getattr + bl GetMonData adds r6, r0, 0 ldr r0, [r5] adds r0, r4 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 @@ -8346,15 +8346,15 @@ sub_80CB7E8: @ 80CB7E8 lsls r0, 24 lsrs r0, 24 mov r8, r0 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r5, r0, 16 adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 movs r0, 0x1 str r0, [sp] @@ -8376,18 +8376,18 @@ _080CB830: movs r0, 0x64 adds r1, r6, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r5, r0, 16 cmp r5, 0 beq _080CB894 adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 subs r0, r6, 0x1 lsls r3, r0, 1 @@ -8482,10 +8482,10 @@ _080CB8FA: beq _080CB932 movs r0, 0x64 muls r0, r6 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xC - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _080CB932 ldr r0, [r7] @@ -10836,7 +10836,7 @@ sub_80CCB50: @ 80CCB50 adds r0, r4, 0 movs r2, 0 movs r3, 0x8 - bl CopyStringPadded + bl StringCopyPadded mov r4, r10 ldr r1, [r4] adds r5, r1, r5 @@ -11002,7 +11002,7 @@ _080CCDB0: adds r0, r4, 0 movs r2, 0 movs r3, 0x8 - bl CopyStringPadded + bl StringCopyPadded mov r7, r8 ldr r1, [r7] adds r5, r1, r5 @@ -11910,10 +11910,10 @@ sub_80CD504: @ 80CD504 ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData b _080CD542 .pool _080CD538: @@ -13225,7 +13225,7 @@ sub_80CE018: @ 80CE018 ldr r0, [r0] ldr r1, =0x000020a4 adds r0, r1 - ldr r3, =gUnknown_020244EC + ldr r3, =gPlayerParty ldr r1, =gUnknown_02039D79 movs r2, 0 ldrsb r2, [r1, r2] @@ -13267,7 +13267,7 @@ diegohint2: @ 80CE08C lsrs r7, r1, 24 cmp r6, 0xE bne _080CE0C0 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty movs r0, 0x64 muls r0, r7 adds r0, r1 @@ -13308,7 +13308,7 @@ sub_80CE0E8: @ 80CE0E8 bne _080CE108 movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 bl zero_pokemon_struct b _080CE10C @@ -13333,7 +13333,7 @@ diegohint1: @ 80CE110 ldr r0, [r0] ldr r1, =0x00002108 adds r0, r1 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty movs r1, 0x64 muls r1, r7 adds r1, r2 @@ -13486,7 +13486,7 @@ _080CE274: adds r0, r1, r2 ldr r2, =0x00000cee adds r1, r2 - bl CopyString + bl StringCopy pop {r0} bx r0 .pool @@ -13585,7 +13585,7 @@ _080CE358: ldrsb r1, [r4, r1] cmp r1, 0x22 beq _080CE378 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] movs r0, 0x4 ldrsb r0, [r2, r0] @@ -13670,7 +13670,7 @@ _080CE418: ldr r0, [r4] ldr r2, =0x00002108 adds r0, r2 - ldr r3, =gUnknown_020244EC + ldr r3, =gPlayerParty ldr r1, =gUnknown_02039D79 movs r2, 0 ldrsb r2, [r1, r2] @@ -13721,7 +13721,7 @@ _080CE494: adds r0, r2, r1 adds r2, r4 movs r1, 0x51 - bl pokemon_getattr + bl GetMonData ldr r2, [r5] ldr r3, =0x00002174 adds r1, r2, r3 @@ -13770,10 +13770,10 @@ sub_80CE51C: @ 80CE51C _080CE52A: movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x5 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _080CE53E adds r5, 0x1 @@ -13865,12 +13865,12 @@ _080CE5C6: _080CE5E4: movs r0, 0x64 muls r0, r6 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =0x00002176 adds r2, r1 movs r1, 0x51 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 ldr r1, [r5] @@ -14120,7 +14120,7 @@ _080CE838: ldr r1, [r4] ldr r0, =0x0000218c adds r2, r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty str r0, [r2] ldr r0, =gUnknown_02039D79 ldrb r0, [r0] @@ -14205,7 +14205,7 @@ party_compaction: @ 80CE90C movs r5, 0 movs r0, 0x64 mov r9, r0 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty mov r8, r1 subs r0, 0x65 mov r10, r0 @@ -14216,7 +14216,7 @@ _080CE928: adds r4, r0, r1 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 cmp r0, 0 beq _080CE960 @@ -14250,7 +14250,7 @@ _080CE96A: cmp r5, 0x5 bhi _080CE992 movs r6, 0x64 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty _080CE97E: adds r0, r5, 0 muls r0, r6 @@ -14309,7 +14309,7 @@ _080CE9E8: ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x8 mov r2, sp @@ -14390,7 +14390,7 @@ sub_80CEA6C: @ 80CEA6C ldr r2, =0x000020a4 adds r0, r1, r2 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _080CEAC8 _080CEAAC: @@ -14515,7 +14515,7 @@ _080CEB8A: adds r1, r0, 0 movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0 bl sub_80CEC00 @@ -14586,7 +14586,7 @@ sub_80CEC00: @ 80CEC00 adds r6, r4, 0 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData mov r2, r8 ldr r1, [r2] ldr r3, =0x00000ce4 @@ -14599,7 +14599,7 @@ sub_80CEC00: @ 80CEC00 _080CEC44: adds r0, r4, 0 movs r1, 0x4 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r0, 24 mov r10, r0 @@ -14616,7 +14616,7 @@ _080CEC44: _080CEC74: adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData mov r3, r8 ldr r1, [r3] ldr r2, =0x00000ced @@ -14629,27 +14629,27 @@ _080CEC86: adds r2, r5 adds r0, r6, 0 movs r1, 0x2 - bl pokemon_getattr + bl GetMonData ldr r0, [r4] adds r0, r5 - bl GetStringEnd_Limit7 + bl StringGetEnd10 adds r0, r6, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData ldr r1, [r4] ldr r3, =0x00000cec adds r1, r3 strb r0, [r1] adds r0, r6, 0 movs r1, 0x8 - bl pokemon_getattr + bl GetMonData ldr r1, [r4] ldr r2, =0x00000ceb adds r1, r2 strb r0, [r1] adds r0, r6, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData ldr r1, [r4] movs r3, 0xCE lsls r3, 4 @@ -14668,7 +14668,7 @@ _080CEC86: mov r9, r0 adds r0, r6, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData ldr r1, [r4] ldr r3, =0x00000ce6 adds r1, r3 @@ -14732,7 +14732,7 @@ _080CED7E: bl pokemon_getattr_encrypted ldr r0, [r5] adds r0, r4 - bl GetStringEnd_Limit7 + bl StringGetEnd10 adds r0, r7, 0 bl sub_80690C0 ldr r1, [r5] @@ -14802,25 +14802,25 @@ _080CEE34: adds r0, r3 movs r1, 0 movs r2, 0x5 - bl RepeatChar + bl StringFill ldr r0, [r4] ldr r1, =0x00000cf9 adds r0, r1 movs r1, 0 movs r2, 0x8 - bl RepeatChar + bl StringFill ldr r0, [r4] ldr r2, =0x00000d1d adds r0, r2 movs r1, 0 movs r2, 0x8 - bl RepeatChar + bl StringFill ldr r0, [r4] ldr r3, =0x00000d41 adds r0, r3 movs r1, 0 movs r2, 0x8 - bl RepeatChar + bl StringFill ldr r0, [r4] ldr r1, =0x00000d65 adds r0, r1 @@ -14841,7 +14841,7 @@ _080CEE94: adds r1, r3 movs r2, 0 movs r3, 0x5 - bl CopyStringPadded + bl StringCopyPadded b _080CEECE .pool _080CEEC0: @@ -14850,7 +14850,7 @@ _080CEEC0: ldr r1, =gUnknown_085E8264 movs r2, 0 movs r3, 0x8 - bl CopyStringPadded + bl StringCopyPadded _080CEECE: ldr r4, =gUnknown_02039D08 ldr r0, [r4] @@ -14858,20 +14858,20 @@ _080CEECE: adds r0, r3 movs r1, 0 movs r2, 0x8 - bl RepeatChar + bl StringFill ldr r0, [r4] ldr r1, =0x00000d41 adds r0, r1 movs r1, 0 movs r2, 0x8 - bl RepeatChar + bl StringFill ldr r0, [r4] ldr r2, =0x00000d65 adds r0, r2 _080CEEF2: movs r1, 0 movs r2, 0x8 - bl RepeatChar + bl StringFill b _080CF0B8 .pool _080CEF14: @@ -14891,7 +14891,7 @@ _080CEF20: adds r1, r3 movs r2, 0 movs r3, 0x5 - bl CopyStringPadded + bl StringCopyPadded ldr r1, [r4] ldr r0, =0x00000d1d adds r2, r1, r0 @@ -14910,7 +14910,7 @@ _080CEF20: adds r0, r2, 0 movs r2, 0 movs r3, 0x5 - bl CopyStringPadded + bl StringCopyPadded ldr r4, [r4] ldr r3, =0x00000d41 adds r2, r4, r3 @@ -15013,7 +15013,7 @@ _080CF020: adds r0, r2, 0 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r2, r0, 0 strb r5, [r2] movs r0, 0xFF @@ -15031,7 +15031,7 @@ _080CF020: adds r0, r4, 0 movs r2, 0 movs r3, 0x8 - bl CopyStringPadded + bl StringCopyPadded b _080CF0B8 .pool _080CF0AC: @@ -15039,7 +15039,7 @@ _080CF0AC: adds r0, r4, r1 movs r1, 0 movs r2, 0x8 - bl RepeatChar + bl StringFill _080CF0B8: pop {r3-r5} mov r8, r3 @@ -15109,7 +15109,7 @@ sub_80CF108: @ 80CF108 mov r9, r3 add r0, r9 strb r1, [r0] - ldr r6, =gUnknown_030022C0 + ldr r6, =gMain ldrh r1, [r6, 0x30] movs r0, 0x40 ands r0, r1 @@ -15302,7 +15302,7 @@ _080CF2D4: b _080CF366 .pool _080CF2E4: - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r0, 0x2 ands r0, r1 @@ -15312,7 +15312,7 @@ _080CF2E4: b _080CF366 .pool _080CF2F8: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0x1 @@ -15384,7 +15384,7 @@ _080CF366: thumb_func_start sub_80CF374 sub_80CF374: @ 80CF374 push {r4,lr} - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldrh r0, [r1, 0x2C] movs r4, 0x1 ands r4, r0 @@ -15524,7 +15524,7 @@ _080CF49C: thumb_func_start sub_80CF4B0 sub_80CF4B0: @ 80CF4B0 push {r4,lr} - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x30] movs r0, 0x40 ands r0, r1 @@ -15622,7 +15622,7 @@ _080CF588: movs r0, 0x18 b _080CF5BC _080CF58C: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0x1 @@ -15681,7 +15681,7 @@ sub_80CF5C4: @ 80CF5C4 strb r1, [r0] mov r8, r1 movs r7, 0 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldrh r3, [r1, 0x30] movs r0, 0x40 ands r0, r3 @@ -15847,7 +15847,7 @@ _080CF758: movs r0, 0x12 b _080CF7D8 _080CF75C: - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r0, 0x2 ands r0, r1 @@ -15938,7 +15938,7 @@ sub_80CF7E4: @ 80CF7E4 ldr r5, =0x00000cd7 adds r0, r5 strb r1, [r0] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldrh r2, [r1, 0x30] movs r0, 0x40 ands r0, r2 @@ -15963,7 +15963,7 @@ _080CF834: ands r0, r2 cmp r0, 0 bne _080CF86E - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0x1 @@ -16068,7 +16068,7 @@ sub_80CF8D8: @ 80CF8D8 ldr r5, =0x00000cd7 adds r0, r5 strb r1, [r0] - ldr r7, =gUnknown_030022C0 + ldr r7, =gMain ldrh r1, [r7, 0x30] movs r0, 0x40 ands r0, r1 @@ -16833,7 +16833,7 @@ sub_80CFF34: @ 80CFF34 ldr r0, [r0] str r0, [r1] str r3, [r1, 0x4] - bl GetStringLength + bl StringLength lsls r0, 24 lsrs r1, r0, 24 ldr r0, [r4] @@ -16985,7 +16985,7 @@ sub_80D00AC: @ 80D00AC push {r4,r5,lr} movs r5, 0x2 negs r5, r5 - ldr r4, =gUnknown_030022C0 + ldr r4, =gMain ldrh r1, [r4, 0x2E] movs r0, 0x1 ands r0, r1 @@ -18687,16 +18687,16 @@ _080D0DDA: movs r0, 0x64 adds r1, r7, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x5 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _080D0E42 adds r0, r4, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData _080D0DFC: lsls r0, 16 lsrs r4, r0, 16 @@ -18817,7 +18817,7 @@ sub_80D0E90: @ 80D0E90 _080D0EF8: movs r0, 0x64 muls r0, r7 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xC mov r2, sp @@ -18946,11 +18946,11 @@ _080D101C: movs r0, 0x64 adds r4, r7, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r6, r0, 16 mov r0, r8 @@ -19035,7 +19035,7 @@ _080D10E0: mov r1, r8 muls r1, r0 adds r0, r1, 0 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r2, [r6] ldr r1, =0x00002234 @@ -19099,7 +19099,7 @@ sub_80D1114: @ 80D1114 _080D1170: movs r0, 0x64 muls r0, r7 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xC mov r2, sp @@ -21546,7 +21546,7 @@ _080D241E: thumb_func_start sub_80D242C sub_80D242C: @ 80D242C - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, [r2] ldr r1, =0x00003d84 adds r0, r1 @@ -21579,7 +21579,7 @@ sub_80D242C: @ 80D242C thumb_func_start sub_80D2480 sub_80D2480: @ 80D2480 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r1, [r1] ldr r2, =0x00003d86 adds r1, r2 @@ -21590,7 +21590,7 @@ sub_80D2480: @ 80D2480 thumb_func_start sub_80D2494 sub_80D2494: @ 80D2494 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003d86 adds r0, r1 @@ -21601,7 +21601,7 @@ sub_80D2494: @ 80D2494 thumb_func_start sub_80D24A8 sub_80D24A8: @ 80D24A8 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003d85 adds r0, r1 @@ -21617,7 +21617,7 @@ sub_80D24BC: @ 80D24BC lsrs r1, r0, 24 cmp r1, 0xF bhi _080D24D0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00003d85 adds r0, r2 @@ -21630,7 +21630,7 @@ _080D24D0: thumb_func_start sub_80D24DC sub_80D24DC: @ 80D24DC - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003d84 adds r0, r1 @@ -21646,7 +21646,7 @@ sub_80D24F0: @ 80D24F0 lsrs r1, r0, 24 cmp r1, 0x1D bhi _080D2504 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00003d84 adds r0, r2 @@ -21659,7 +21659,7 @@ _080D2504: thumb_func_start sub_80D2510 sub_80D2510: @ 80D2510 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003d70 adds r0, r1 @@ -21670,7 +21670,7 @@ sub_80D2510: @ 80D2510 thumb_func_start sub_80D2524 sub_80D2524: @ 80D2524 push {r4,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r2, [r2] ldr r4, =0x00003d70 adds r3, r2, r4 @@ -21686,7 +21686,7 @@ sub_80D2524: @ 80D2524 thumb_func_start sub_80D2548 sub_80D2548: @ 80D2548 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003d74 adds r0, r1 @@ -21698,11 +21698,11 @@ sub_80D2548: @ 80D2548 sub_80D255C: @ 80D255C push {lr} adds r1, r0, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00003d74 adds r0, r2 - bl CopyString + bl StringCopy pop {r0} bx r0 .pool @@ -21712,7 +21712,7 @@ sub_80D255C: @ 80D255C sub_80D2578: @ 80D2578 push {lr} movs r1, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00003d74 adds r0, r2 @@ -23812,7 +23812,7 @@ sub_80D352C: @ 80D352C lsls r0, 24 lsrs r0, 24 lsls r1, 24 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsrs r1, 22 adds r1, r2 ldr r2, [r1] @@ -23841,7 +23841,7 @@ sub_80D355C: @ 80D355C adds r2, r0 lsls r2, 3 adds r2, r3 - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable lsrs r1, 22 adds r1, r0 ldr r0, [r1] @@ -23863,7 +23863,7 @@ sub_80D3584: @ 80D3584 adds r2, r0 lsls r2, 3 adds r2, r3 - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable lsrs r1, 22 adds r1, r0 ldr r0, [r1] @@ -24096,7 +24096,7 @@ _080D3754: lsrs r0, 24 movs r1, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 bl GetMonAbility lsls r0, 24 @@ -25303,13 +25303,13 @@ objc_8097BBC: @ 80D4174 ldrsh r0, [r4, r1] movs r2, 0x2E ldrsh r1, [r4, r2] - bl sine + bl Sin strh r0, [r4, 0x24] movs r1, 0x32 ldrsh r0, [r4, r1] movs r2, 0x2E ldrsh r1, [r4, r2] - bl cosine + bl Cos strh r0, [r4, 0x26] ldrh r0, [r4, 0x32] adds r0, 0x8 @@ -25546,7 +25546,7 @@ sub_80D4354: @ 80D4354 sub_80D436C: @ 80D436C push {r4,r5,lr} movs r4, 0 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr _080D4372: lsls r1, r4, 3 adds r1, r4 @@ -25620,7 +25620,7 @@ sub_80D43F0: @ 80D43F0 push {r4,lr} adds r4, r0, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 bl itemid_is_mail @@ -25629,7 +25629,7 @@ sub_80D43F0: @ 80D43F0 beq _080D4418 adds r0, r4, 0 movs r1, 0x40 - bl pokemon_getattr + bl GetMonData cmp r0, 0xFF beq _080D4418 movs r0, 0x1 @@ -25662,7 +25662,7 @@ sub_80D4420: @ 80D4420 strb r1, [r0, 0x1] add r3, sp, 0x4 strb r2, [r3] - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr mov r10, r4 mov r9, r3 adds r4, r3, 0 @@ -25683,9 +25683,9 @@ _080D444C: b _080D45A8 _080D4468: movs r4, 0 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr mov r12, r2 - ldr r7, =gUnknown_03005D8C + ldr r7, =gSaveBlock1Ptr add r5, sp, 0x4 ldr r3, =0x0000ffff adds r6, r3, 0 @@ -25709,7 +25709,7 @@ _080D4476: cmp r4, 0x8 bls _080D4476 movs r4, 0 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr add r3, sp, 0x4 _080D44A0: ldr r2, [r5] @@ -25756,9 +25756,9 @@ _080D44A0: movs r1, 0 bl sub_81DB4DC movs r4, 0 - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr add r3, sp, 0x4 - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr _080D4500: ldr r2, [r6] ldrb r1, [r3] @@ -25900,7 +25900,7 @@ sub_80D460C: @ 80D460C ldrb r2, [r4] cmp r2, 0xFF beq _080D4670 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] lsls r0, r2, 3 adds r0, r2 @@ -25957,10 +25957,10 @@ sub_80D4680: @ 80D4680 beq _080D46D2 adds r0, r4, 0 movs r1, 0x40 - bl pokemon_getattr + bl GetMonData add r2, sp, 0x4 strb r0, [r2] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r3, [r0] ldrb r1, [r2] lsls r0, r1, 3 @@ -25997,7 +25997,7 @@ _080D46D2: sub_80D46E0: @ 80D46E0 lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] lsls r1, r0, 3 adds r1, r0 @@ -26029,7 +26029,7 @@ sub_80D4700: @ 80D4700 strb r0, [r1] movs r7, 0x6 mov r9, r1 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr mov r8, r0 ldr r3, =0x00002be0 _080D4724: @@ -26049,7 +26049,7 @@ _080D4724: adds r0, r5, 0 movs r1, 0x40 str r3, [sp, 0x8] - bl pokemon_getattr + bl GetMonData mov r1, r8 ldr r2, [r1] lsls r1, r0, 3 @@ -26066,7 +26066,7 @@ _080D4724: stm r4!, {r0,r2,r3} adds r0, r5, 0 movs r1, 0x40 - bl pokemon_getattr + bl GetMonData mov r1, r8 ldr r2, [r1] lsls r1, r0, 3 @@ -26375,7 +26375,7 @@ _080D49DC: mov r4, sp adds r4, 0xF ldr r1, =gUnknown_0857F544 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000cb2 adds r0, r2 @@ -26385,7 +26385,7 @@ _080D49DC: ldr r1, [r0] _080D49F2: adds r0, r4, 0 - bl CopyString + bl StringCopy b _080D4A18 .pool _080D4A08: @@ -28102,7 +28102,7 @@ sub_80D57B8: @ 80D57B8 ldrsh r0, [r5, r1] movs r2, 0xA ldrsh r1, [r5, r2] - bl sine + bl Sin ldr r2, =gUnknown_02020630 lsls r1, r4, 4 adds r1, r4 @@ -28113,7 +28113,7 @@ sub_80D57B8: @ 80D57B8 ldrsh r0, [r5, r1] movs r2, 0xC ldrsh r1, [r5, r2] - bl cosine + bl Cos negs r0, r0 strh r0, [r4, 0x26] ldrh r1, [r5, 0xC] @@ -28728,7 +28728,7 @@ sub_80D5CE4: @ 80D5CE4 lsrs r0, 8 movs r2, 0xC ldrsh r1, [r5, r2] - bl sine + bl Sin strh r0, [r4, 0x26] ldrh r0, [r5, 0x16] ldrh r1, [r5, 0x1C] @@ -29011,7 +29011,7 @@ sub_80D5F3C: @ 80D5F3C mov r0, r8 movs r2, 0xA ldrsh r1, [r4, r2] - bl sine + bl Sin lsls r0, 16 lsrs r5, r0, 16 mov r9, r5 diff --git a/asm/rom_813C5BC.s b/asm/rom_813C5BC.s index 554c066f1..ac01a4846 100644 --- a/asm/rom_813C5BC.s +++ b/asm/rom_813C5BC.s @@ -39,7 +39,7 @@ sub_813C5EC: @ 813C5EC lsls r1, 3 ldr r0, =gTasks adds r4, r1, r0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -406,7 +406,7 @@ sub_813C904: @ 813C904 sub_813C91C: @ 813C91C push {r4,lr} sub sp, 0x4 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -494,7 +494,7 @@ _0813C9F0: movs r3, 0 bl BeginNormalPaletteFade _0813CA00: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -513,7 +513,7 @@ _0813CA14: bl CreateTask ldr r0, =sub_813C8EC bl SetMainCallback2 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 diff --git a/asm/rom_8158B30.s b/asm/rom_8158B30.s index c26779f96..df78857e0 100644 --- a/asm/rom_8158B30.s +++ b/asm/rom_8158B30.s @@ -389,7 +389,7 @@ _08158E38: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty b _08158E6A .pool _08158E5C: @@ -399,11 +399,11 @@ _08158E5C: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty _08158E6A: adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 _08158E76: @@ -514,7 +514,7 @@ _08158F48: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty b _08158F7A .pool _08158F6C: @@ -524,11 +524,11 @@ _08158F6C: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty _08158F7A: adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 _08158F86: @@ -1025,7 +1025,7 @@ sub_815936C: @ 815936C bx_exec_buffer_A_ch0_tbl6: @ 8159388 push {lr} ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r3, [r0] lsls r0, r3, 2 @@ -1059,7 +1059,7 @@ _081593D4: thumb_func_start bx_battle_menu_t6_2 bx_battle_menu_t6_2: @ 81593D8 push {r4,r5,lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r2, 0x1 adds r0, r2, 0 @@ -1307,7 +1307,7 @@ sub_81595E4: @ 81595E4 ands r0, r1 cmp r0, 0 bne _0815960E - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldr r0, =0x00000439 adds r3, r2, r0 ldrb r1, [r3] @@ -1382,7 +1382,7 @@ _08159684: thumb_func_start sub_8159698 sub_8159698: @ 8159698 push {lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, [r0, 0x4] ldr r0, =sub_8038420 cmp r1, r0 @@ -1439,7 +1439,7 @@ dp01_tbl6_exec_completed: @ 8159704 adds r0, r1 ldr r1, =bx_exec_buffer_A_ch0_tbl6 str r1, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -1462,7 +1462,7 @@ dp01_tbl6_exec_completed: @ 8159704 .pool _08159758: ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r1 @@ -1561,7 +1561,7 @@ sub_81597F4: @ 81597F4 thumb_func_start sub_8159800 sub_8159800: @ 8159800 push {r4-r6,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldrb r0, [r0, 0x8] ldr r5, =gUnknown_02024064 @@ -1975,7 +1975,7 @@ sub_8159B84: @ 8159B84 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 movs r2, 0xB bl healthbar_draw_field_maybe @@ -2200,10 +2200,10 @@ sub_8159D20: @ 8159D20 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 movs r1, 0x19 @@ -2250,7 +2250,7 @@ sub_8159D90: @ 8159D90 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 movs r2, 0xA bl healthbar_draw_field_maybe @@ -2381,7 +2381,7 @@ sub_8159E90: @ 8159E90 movs r0, 0x3 bl BeginFastPaletteFade bl dp01_tbl6_exec_completed - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x6 ands r0, r1 @@ -3583,7 +3583,7 @@ _0815A84C: strh r1, [r4, 0x24] ands r0, r3 movs r1, 0x5 - bl sine + bl Sin movs r2, 0x36 ldrsh r1, [r4, r2] lsrs r2, r1, 31 @@ -5201,7 +5201,7 @@ _0815B566: sub_815B570: @ 815B570 push {r4,lr} adds r4, r0, 0 - bl GenerateRandomNumber2 + bl Random2 movs r1, 0x3 ands r0, r1 cmp r0, 0 @@ -5224,7 +5224,7 @@ _0815B592: ands r0, r2 orrs r0, r1 strh r0, [r4, 0x4] - bl GenerateRandomNumber2 + bl Random2 movs r1, 0x7 ands r0, r1 adds r1, r0, 0 @@ -6218,7 +6218,7 @@ sub_815BE04: @ 815BE04 push {r5-r7} sub sp, 0x4 adds r7, r0, 0 - bl GenerateRandomNumber2 + bl Random2 lsls r0, 16 movs r1, 0xFC lsls r1, 14 @@ -7317,7 +7317,7 @@ _0815C732: movs r0, 0xFF ands r0, r1 movs r1, 0x10 - bl sine + bl Sin b _0815C768 .pool _0815C744: @@ -7337,7 +7337,7 @@ _0815C75C: movs r0, 0xFF ands r0, r1 movs r1, 0x10 - bl cosine + bl Cos _0815C768: strh r0, [r4, 0x26] pop {r4} @@ -7864,7 +7864,7 @@ _0815CB78: sub_815CB88: @ 815CB88 push {r4,r5,lr} adds r4, r0, 0 - bl GenerateRandomNumber2 + bl Random2 lsls r0, 16 lsrs r0, 16 movs r1, 0xC @@ -7882,10 +7882,10 @@ sub_815CB88: @ 815CB88 ands r0, r2 orrs r0, r1 strh r0, [r4, 0x4] - bl GenerateRandomNumber2 + bl Random2 ldr r5, =0x000001ff ands r5, r0 - bl GenerateRandomNumber2 + bl Random2 movs r1, 0xFF ands r1, r0 movs r0, 0x1 @@ -8176,14 +8176,14 @@ sub_815CDFC: @ 815CDFC ldrh r1, [r4, 0x32] lsls r1, 16 asrs r1, 24 - bl sine + bl Sin strh r0, [r4, 0x24] movs r2, 0x30 ldrsh r0, [r4, r2] ldrh r1, [r4, 0x34] lsls r1, 16 asrs r1, 24 - bl cosine + bl Cos strh r0, [r4, 0x26] ldrh r0, [r4, 0x30] adds r0, 0x9 @@ -8320,10 +8320,10 @@ _0815CF18: ldrh r0, [r0] movs r5, 0x64 muls r0, r5 - ldr r7, =gUnknown_020244EC + ldr r7, =gPlayerParty adds r0, r7 movs r1, 0 - bl pokemon_getattr + bl GetMonData mov r9, r0 ldrb r0, [r4] lsls r0, 1 @@ -8332,7 +8332,7 @@ _0815CF18: muls r0, r5 adds r0, r7 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData mov r8, r0 ldr r0, =gUnknown_020244D0 ldr r0, [r0] @@ -8362,11 +8362,11 @@ _0815CF9C: adds r0, r6 ldrh r0, [r0] muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 _0815CFAA: movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r6, r0, 16 b _0815CFBE @@ -8388,10 +8388,10 @@ _0815CFC4: ldrh r0, [r0] movs r5, 0x64 muls r0, r5 - ldr r7, =gUnknown_02024744 + ldr r7, =gEnemyParty adds r0, r7 movs r1, 0 - bl pokemon_getattr + bl GetMonData mov r9, r0 ldrb r0, [r4] lsls r0, 1 @@ -8400,7 +8400,7 @@ _0815CFC4: muls r0, r5 adds r0, r7 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData mov r8, r0 ldr r0, =gUnknown_020244D0 ldr r0, [r0] @@ -8421,7 +8421,7 @@ _0815CFC4: adds r0, r6 ldrh r0, [r0] muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 b _0815D048 .pool @@ -8434,7 +8434,7 @@ _0815D03C: adds r0, r7 _0815D048: movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r6, r0, 16 b _0815D056 @@ -9388,7 +9388,7 @@ sub_815D804: @ 815D804 bl sub_815D794 adds r0, r4, 0 movs r1, 0x8 - bl sine + bl Sin strh r0, [r5, 0x26] movs r1, 0x2E ldrsh r0, [r5, r1] @@ -13411,7 +13411,7 @@ _0815F80E: ldrsh r0, [r4, r2] movs r2, 0x38 ldrsh r1, [r4, r2] - bl cosine + bl Cos strh r0, [r4, 0x24] movs r1, 0x2E ldrsh r0, [r4, r1] @@ -13669,10 +13669,10 @@ _0815FA28: ldrh r0, [r0] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5 movs r1, 0 - bl pokemon_getattr + bl GetMonData mov r10, r0 ldrb r0, [r4] lsls r0, 1 @@ -13681,7 +13681,7 @@ _0815FA28: muls r0, r6 adds r0, r5 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData mov r9, r0 ldr r0, =gUnknown_020244D0 ldr r0, [r0] @@ -13698,7 +13698,7 @@ _0815FA28: muls r0, r6 adds r0, r5 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r6, r0, 16 b _0815FA9E @@ -13733,10 +13733,10 @@ _0815FAC8: ldrh r0, [r0] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_02024744 + ldr r5, =gEnemyParty adds r0, r5 movs r1, 0 - bl pokemon_getattr + bl GetMonData mov r10, r0 ldrb r0, [r4] lsls r0, 1 @@ -13745,7 +13745,7 @@ _0815FAC8: muls r0, r6 adds r0, r5 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData mov r9, r0 ldr r0, =gUnknown_020244D0 ldr r0, [r0] @@ -13762,7 +13762,7 @@ _0815FAC8: muls r0, r6 adds r0, r5 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r6, r0, 16 b _0815FB2E @@ -14235,7 +14235,7 @@ _0815FF3A: ldrsh r0, [r4, r1] movs r2, 0x2E ldrsh r1, [r4, r2] - bl sine + bl Sin strh r0, [r4, 0x26] ldrh r2, [r4, 0x30] adds r0, r2, 0x5 @@ -14696,12 +14696,12 @@ sub_81602E0: @ 81602E0 movs r1, 0x30 ldrsh r0, [r4, r1] movs r1, 0x14 - bl cosine + bl Cos strh r0, [r4, 0x24] movs r1, 0x30 ldrsh r0, [r4, r1] movs r1, 0x14 - bl sine + bl Sin strh r0, [r4, 0x26] adds r0, r4, 0 adds r0, 0x3F @@ -15307,9 +15307,9 @@ sub_816082C: @ 816082C sub_816084C: @ 816084C push {r4,lr} adds r1, r0, 0 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 bl sub_81D2BF4 pop {r4} @@ -15456,7 +15456,7 @@ _081609A8: movs r0, 0x64 adds r4, r1, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 bl sub_8161054 adds r1, r0, 0 @@ -15611,14 +15611,14 @@ _08160B1E: b _08160E88 .pool _08160B2C: - ldr r4, =gUnknown_02021DC4 + ldr r4, =gStringVar2 bl sub_8161054 movs r1, 0xD muls r1, r0 ldr r0, =gMoveNames adds r1, r0 adds r0, r4, 0 - bl CopyString + bl StringCopy ldr r0, =gUnknown_085EF960 bl sub_816084C ldr r0, =gUnknown_0203BC34 @@ -15745,7 +15745,7 @@ _08160C56: bl sub_8161054 lsls r0, 16 lsrs r0, 16 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty ldr r1, =gUnknown_0203BC34 ldr r1, [r1] adds r1, 0x44 @@ -15864,14 +15864,14 @@ _08160D6C: ldrb r0, [r0] movs r4, 0x64 muls r0, r4 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5 ldrb r1, [r2] adds r1, 0xD - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 - ldr r2, =gUnknown_02021EC4 + ldr r2, =gStringVar3 movs r1, 0xD mov r8, r1 mov r1, r8 @@ -15879,7 +15879,7 @@ _08160D6C: ldr r6, =gMoveNames adds r1, r6 adds r0, r2, 0 - bl CopyString + bl StringCopy ldr r1, [r7] adds r0, r1, 0 adds r0, 0x44 @@ -15903,13 +15903,13 @@ _08160D6C: ldrb r2, [r0] adds r0, r4, 0 bl sub_80691F4 - ldr r4, =gUnknown_02021DC4 + ldr r4, =gStringVar2 bl sub_8161054 mov r1, r8 muls r1, r0 adds r1, r6 adds r0, r4, 0 - bl CopyString + bl StringCopy ldr r0, =gUnknown_085EF979 bl sub_816084C ldr r1, [r7] @@ -15958,7 +15958,7 @@ _08160E58: b _08160E88 .pool _08160E70: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -16036,10 +16036,10 @@ _08160EF0: ble _08160EF0 cmp r5, 0 bne _08160F38 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EF8C2 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x3 movs r1, 0x11 bl FillWindowPixelBuffer @@ -16087,7 +16087,7 @@ sub_8160F50: @ 8160F50 adds r0, 0x1 cmp r5, r0 bne _08161010 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x30 ands r0, r1 @@ -16132,10 +16132,10 @@ _08160FE4: ldr r1, [r6] movs r0, 0xC strb r0, [r1] - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EF9E6 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 bl sub_81D2BF4 b _0816103E @@ -16147,16 +16147,16 @@ _08161010: ldr r1, [r6] movs r0, 0x8 strb r0, [r1] - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 movs r1, 0xD muls r1, r5 ldr r2, =gMoveNames adds r1, r2 - bl CopyString - ldr r4, =gUnknown_02021FC4 + bl StringCopy + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EF8DA adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 bl sub_81D2BF4 _0816103E: @@ -16190,10 +16190,10 @@ sub_8161074: @ 8161074 lsrs r5, r0, 24 cmp r5, 0 bne _081610A6 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EF8C2 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x3 movs r1, 0x11 bl FillWindowPixelBuffer @@ -16443,7 +16443,7 @@ sub_8161280: @ 8161280 ldrb r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 adds r1, 0x12 bl sub_806E0B4 @@ -16497,14 +16497,14 @@ _081612F6: ldrb r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr - ldr r0, =gUnknown_02021CC4 + bl GetMonData + ldr r0, =gStringVar1 mov r1, sp - bl CopyString_Limit10 + bl StringCopy10 ldr r2, [r4] movs r5, 0x88 lsls r5, 1 @@ -16742,10 +16742,10 @@ hm_prepare_dive_probably: @ 8161508 lsrs r0, 24 movs r6, 0x64 muls r0, r6 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 @@ -16755,7 +16755,7 @@ hm_prepare_dive_probably: @ 8161508 muls r0, r6 adds r0, r4 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 @@ -16843,12 +16843,12 @@ _081615EC: mov r10, r0 mov r0, r10 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty mov r9, r1 adds r6, r0, r1 adds r0, r6, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 cmp r4, 0 @@ -16857,7 +16857,7 @@ _081615EC: beq _0816161A adds r0, r6, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData cmp r0, r4 bne _08161628 _0816161A: @@ -16873,7 +16873,7 @@ _08161628: muls r0, r1 add r0, r9 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData movs r1, 0x5 bl __udivsi3 adds r3, r0, 0 @@ -16912,10 +16912,10 @@ sub_816166C: @ 816166C ldrsb r1, [r5, r1] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData movs r1, 0x5 bl __udivsi3 adds r3, r0, 0 @@ -16945,14 +16945,14 @@ sub_81616C0: @ 81616C0 ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl GetMonNickname - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E9C17 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0 bl sub_81B1B5C @@ -17070,7 +17070,7 @@ sub_81617F4: @ 81617F4 push {r4,lr} ldr r0, =gUnknown_0203BC40 mov r12, r0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r2, =0x00002734 adds r0, r1, r2 @@ -17517,7 +17517,7 @@ _08161B16: thumb_func_start sub_8161B34 sub_8161B34: @ 8161B34 push {r4,r5,lr} - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r0, [r5] ldr r4, =0x000031dc adds r0, r4 @@ -17571,7 +17571,7 @@ sub_8161B94: @ 8161B94 lsls r0, 16 cmp r0, 0 bne _08161BBC - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r2, =0x000031dc adds r1, r2 @@ -17579,7 +17579,7 @@ sub_8161B94: @ 8161B94 b _08161BC8 .pool _08161BBC: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r2, =0x000031dc adds r1, r2 @@ -17588,7 +17588,7 @@ _08161BBC: _08161BC8: strh r2, [r1, 0x8] adds r7, r0, 0 - ldr r6, =gUnknown_02024744 + ldr r6, =gEnemyParty ldr r0, [r7] ldr r5, =0x000031dc adds r0, r5 @@ -17615,19 +17615,19 @@ _08161BC8: strb r1, [r0, 0x13] adds r0, r6, 0 movs r1, 0x42 - bl pokemon_getattr + bl GetMonData ldr r1, [r7] adds r1, r5 str r0, [r1] adds r0, r6, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData ldr r1, [r7] adds r1, r5 str r0, [r1, 0x4] adds r0, r6, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData ldr r1, [r7] adds r1, r5 movs r2, 0 @@ -17635,38 +17635,38 @@ _08161BC8: strh r0, [r1, 0xA] adds r0, r6, 0 movs r1, 0x16 - bl pokemon_getattr + bl GetMonData ldr r1, [r7] adds r1, r5 strb r0, [r1, 0xE] adds r0, r6, 0 movs r1, 0x17 - bl pokemon_getattr + bl GetMonData ldr r1, [r7] adds r1, r5 strb r0, [r1, 0xF] adds r0, r6, 0 movs r1, 0x18 - bl pokemon_getattr + bl GetMonData ldr r1, [r7] adds r1, r5 strb r0, [r1, 0x10] adds r0, r6, 0 movs r1, 0x21 - bl pokemon_getattr + bl GetMonData ldr r1, [r7] adds r1, r5 strb r0, [r1, 0x11] adds r0, r6, 0 movs r1, 0x2F - bl pokemon_getattr + bl GetMonData ldr r1, [r7] adds r1, r5 strb r0, [r1, 0x12] ldr r4, =gUnknown_0203BC86 mov r0, r8 strb r0, [r4] - bl GenerateRandomNumber + bl Random ldr r5, =gUnknown_085CEC30 lsls r0, 16 lsrs r0, 16 @@ -17713,7 +17713,7 @@ mapnumbers_history_shift_sav1_0_2_4_out: @ 8161CD8 strb r1, [r0, 0x2] ldrb r1, [r0, 0x1] strb r1, [r0, 0x3] - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] ldrb r1, [r2, 0x4] strb r1, [r0] @@ -17727,7 +17727,7 @@ mapnumbers_history_shift_sav1_0_2_4_out: @ 8161CD8 sub_8161D00: @ 8161D00 push {r4,r5,lr} movs r1, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x000031dc adds r0, r2 @@ -17739,7 +17739,7 @@ sub_8161D00: @ 8161D00 ldr r5, =gUnknown_085CEC30 adds r4, r0, 0 _08161D1A: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x14 @@ -17766,7 +17766,7 @@ _08161D3E: sub_8161D54: @ 8161D54 push {r4-r7,lr} movs r4, 0 - bl GenerateRandomNumber + bl Random lsls r0, 16 movs r1, 0xF0 lsls r1, 12 @@ -17776,7 +17776,7 @@ sub_8161D54: @ 8161D54 bl sub_8161D00 b _08161DE2 _08161D6E: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000031dc adds r0, r1 @@ -17798,7 +17798,7 @@ _08161D80: adds r5, r2, 0x1 ldr r4, =gUnknown_0203BC80 _08161D96: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x5 @@ -17839,7 +17839,7 @@ sub_8161DE8: @ 8161DE8 lsrs r2, r0, 24 lsls r1, 24 lsrs r1, 24 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r3, =0x000031dc adds r0, r3 @@ -17867,9 +17867,9 @@ _08161E22: sub_8161E28: @ 8161E28 push {r4,r5,lr} sub sp, 0x4 - ldr r5, =gUnknown_02024744 + ldr r5, =gEnemyParty bl zero_enemy_party_data - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] ldr r1, =0x000031dc adds r0, r1 @@ -17932,7 +17932,7 @@ sub_8161E28: @ 8161E28 thumb_func_start sub_8161EDC sub_8161EDC: @ 8161EDC push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldrb r0, [r1, 0x4] ldrb r1, [r1, 0x5] @@ -17941,7 +17941,7 @@ sub_8161EDC: @ 8161EDC lsrs r0, 24 cmp r0, 0x1 bne _08161F10 - bl GenerateRandomNumber + bl Random lsls r0, 16 movs r1, 0xC0 lsls r1, 10 @@ -17964,15 +17964,15 @@ sub_8161F18: @ 8161F18 push {r4-r6,lr} adds r6, r0, 0 movs r1, 0x39 - bl pokemon_getattr - ldr r5, =gUnknown_03005D8C + bl GetMonData + ldr r5, =gSaveBlock1Ptr ldr r1, [r5] ldr r4, =0x000031dc adds r1, r4 strh r0, [r1, 0xA] adds r0, r6, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData ldr r1, [r5] adds r1, r4 strb r0, [r1, 0xD] @@ -17985,7 +17985,7 @@ sub_8161F18: @ 8161F18 thumb_func_start sub_8161F4C sub_8161F4C: @ 8161F4C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000031dc adds r0, r1 @@ -18024,7 +18024,7 @@ sub_8161F74: @ 8161F74 thumb_func_start sub_8161F94 sub_8161F94: @ 8161F94 push {r4-r7,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =0x00000ca9 adds r0, r1 @@ -18084,7 +18084,7 @@ sub_8161F94: @ 8161F94 strh r7, [r1] _0816200E: bl sub_8164ED8 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x4 ldrsb r1, [r0, r1] @@ -18105,7 +18105,7 @@ _0816200E: thumb_func_start sub_8162054 sub_8162054: @ 8162054 push {r4-r6,lr} - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r0, [r5] ldr r4, =0x00000ca9 adds r0, r4 @@ -18175,7 +18175,7 @@ _081620E8: thumb_func_start sub_81620F4 sub_81620F4: @ 81620F4 push {r4-r7,lr} - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r0, [r6] ldr r7, =0x00000ca9 adds r0, r7 @@ -18271,13 +18271,13 @@ sub_81621C0: @ 81621C0 lsls r0, 1 cmp r1, r0 bne _081621DA - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000bec adds r0, r1 bl sub_816534C _081621DA: - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r0, [r5] ldr r1, =0x00000d04 adds r2, r0, r1 @@ -18316,7 +18316,7 @@ sub_816222C: @ 816222C sub sp, 0x3C movs r0, 0 str r0, [sp, 0x24] - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =0x00000ca9 adds r0, r1 @@ -18352,7 +18352,7 @@ _0816227A: movs r4, 0xE7 lsls r4, 3 adds r0, r4 - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r1, [r5] movs r2, 0 mov r8, r2 @@ -18376,7 +18376,7 @@ _08162298: adds r2, r7, 0 muls r2, r0 _081622B2: - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r1, [r3] movs r0, 0x2C muls r0, r5 @@ -18410,7 +18410,7 @@ _081622E4: ldrb r0, [r0] cmp r6, r0 blt _0816233E - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r2, [r3] movs r4, 0xEC adds r3, r7, 0 @@ -18455,7 +18455,7 @@ _0816233E: bne _08162396 bl sub_8165B20 movs r7, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r4, =gUnknown_085DF9EC adds r2, r0, 0 @@ -18502,7 +18502,7 @@ _0816239C: .pool _081623C0: ldr r4, =gUnknown_02038BCA - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 ldr r1, [sp, 0x24] @@ -18527,7 +18527,7 @@ _081623DA: thumb_func_start sub_81623F0 sub_81623F0: @ 81623F0 push {r4-r7,lr} - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r0, [r6] ldr r1, =0x00000ca9 adds r0, r1 @@ -18622,7 +18622,7 @@ _081624BA: ldrh r0, [r0] cmp r0, r3 beq _081624FC - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] subs r2, 0x2 adds r0, r1, r2 @@ -18649,7 +18649,7 @@ _081624FC: ldrh r0, [r4] movs r1, 0 bl sub_8162614 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r2, =0x00000cb2 adds r0, r1, r2 @@ -18711,7 +18711,7 @@ _0816258A: adds r0, 0x1 lsls r0, 16 lsrs r5, r0, 16 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r5, 0 @@ -18790,7 +18790,7 @@ sub_8162614: @ 8162614 lsls r0, 1 cmp r4, r0 bne _08162640 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000bed adds r0, r1 @@ -18818,7 +18818,7 @@ _0816266C: ldr r0, =0x0000018f cmp r4, r0 bhi _08162698 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0xfffffed4 adds r2, r4, r1 @@ -18831,7 +18831,7 @@ _0816266C: .pool _08162698: ldr r3, =gUnknown_08610970 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r0, =0xfffffe70 adds r2, r6, r0 @@ -18968,7 +18968,7 @@ sub_81627A4: @ 81627A4 lsls r0, 1 cmp r4, r0 bne _081627CC - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000bed adds r0, r1 @@ -18989,7 +18989,7 @@ _081627E8: ldr r0, =0x0000018f cmp r4, r0 bhi _08162814 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0xfffffed4 adds r2, r4, r1 @@ -19002,7 +19002,7 @@ _081627E8: .pool _08162814: ldr r3, =gUnknown_08610970 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r0, =0xfffffe70 adds r2, r5, r0 @@ -19083,7 +19083,7 @@ sub_81628A0: @ 81628A0 mov r8, r1 mov r10, r0 movs r5, 0 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r0, [r2] mov r4, r10 ldrb r4, [r4, 0xC] @@ -19109,7 +19109,7 @@ _081628DE: adds r3, 0x1 cmp r3, 0x3 bgt _081628FA - ldr r7, =gUnknown_03005D90 + ldr r7, =gSaveBlock2Ptr ldr r0, [r7] adds r1, r3, r4 ldr r7, =0x00000744 @@ -19124,7 +19124,7 @@ _081628FA: cmp r3, 0x4 bne _08162944 movs r6, 0 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] ldr r3, =0x0000073c adds r0, r3 @@ -19148,7 +19148,7 @@ _08162930: adds r6, 0x1 cmp r6, 0x6 bgt _08162944 - ldr r7, =gUnknown_03005D90 + ldr r7, =gSaveBlock2Ptr ldr r0, [r7] adds r0, r3 adds r0, r2 @@ -19170,7 +19170,7 @@ _08162944: _0816295A: cmp r5, 0x4 bgt _08162974 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r0, [r2] movs r1, 0xEC muls r1, r5 @@ -19182,7 +19182,7 @@ _0816295A: .pool _08162974: movs r5, 0 - ldr r7, =gUnknown_03005D90 + ldr r7, =gSaveBlock2Ptr ldr r0, [r7] ldr r1, =0x0000073a adds r0, r1 @@ -19206,7 +19206,7 @@ _0816298A: _0816299E: cmp r5, 0x4 bgt _081629C4 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] movs r1, 0xEC muls r1, r5 @@ -19222,7 +19222,7 @@ _081629B2: .pool _081629C4: mov r2, sp - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r3, =0x0000073a adds r0, r3 @@ -19242,7 +19242,7 @@ _081629E4: adds r7, r5, 0x1 cmp r3, r8 bge _08162A2E - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] movs r2, 0xEC adds r1, r5, 0 @@ -19280,7 +19280,7 @@ _08162A2E: lsls r2, r1, 1 mov r4, sp adds r3, r4, r2 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] movs r4, 0xEC adds r1, r5, 0 @@ -19297,13 +19297,13 @@ _08162A54: adds r5, r7, 0 cmp r5, 0x4 ble _081629E4 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 mov r1, r8 bl __modsi3 adds r5, r0, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r5, 1 add r1, sp @@ -19342,7 +19342,7 @@ sub_8162AA0: @ 8162AA0 cmp r4, r0 bne _08162AD0 ldr r1, =gTrainerPicIndices - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000bed adds r0, r2 @@ -19377,7 +19377,7 @@ _08162B08: ldr r0, =0x0000018f cmp r4, r0 bhi _08162B64 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -19393,7 +19393,7 @@ _08162B08: .pool _08162B38: ldr r3, =gTrainerPicIndices - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0xfffffed4 adds r2, r4, r1 @@ -19407,7 +19407,7 @@ _08162B38: b _08162BC8 .pool _08162B64: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -19416,7 +19416,7 @@ _08162B64: bne _08162BB0 ldr r4, =gTrainerPicIndices ldr r3, =gUnknown_08610970 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r0, =0xfffffe70 adds r2, r5, r0 @@ -19469,7 +19469,7 @@ sub_8162BD8: @ 8162BD8 cmp r4, r0 bne _08162C08 ldr r1, =gTrainerClassNameIndices - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000bed adds r0, r2 @@ -19515,7 +19515,7 @@ _08162C60: ldr r0, =0x0000018f cmp r4, r0 bhi _08162CBC - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -19532,7 +19532,7 @@ _08162C60: .pool _08162C90: ldr r3, =gTrainerClassNameIndices - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0xfffffed4 adds r2, r4, r1 @@ -19547,7 +19547,7 @@ _08162C90: b _08162D1E .pool _08162CBC: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -19571,7 +19571,7 @@ _08162CBC: _08162CF4: ldr r4, =gTrainerClassNameIndices ldr r3, =gUnknown_08610970 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r0, =0xfffffe70 adds r2, r5, r0 @@ -19608,7 +19608,7 @@ sub_8162D34: @ 8162D34 lsls r0, 1 cmp r4, r0 bne _08162D5C - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000bed adds r0, r1 @@ -19629,7 +19629,7 @@ _08162D78: ldr r0, =0x0000018f cmp r4, r0 bhi _08162DC0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -19642,7 +19642,7 @@ _08162D78: b _08162E0C .pool _08162DA0: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0xfffffed4 adds r2, r4, r1 @@ -19654,7 +19654,7 @@ _08162DA0: b _08162E0A .pool _08162DC0: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -19672,7 +19672,7 @@ _08162DC0: .pool _08162DE8: ldr r3, =gUnknown_08610970 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r0, =0xfffffe70 adds r2, r5, r0 @@ -19710,7 +19710,7 @@ sub_8162E20: @ 8162E20 lsls r0, 1 cmp r5, r0 bne _08162E54 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r1, 0xBF lsls r1, 4 @@ -19772,7 +19772,7 @@ _08162EB4: ldr r0, =0x0000018f cmp r5, r0 bhi _08162F00 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -19784,7 +19784,7 @@ _08162EB4: b _08162F62 .pool _08162ED8: - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr movs r0, 0xEC adds r1, r5, 0 muls r1, r0 @@ -19800,7 +19800,7 @@ _08162ED8: b _08162F62 .pool _08162F00: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -19816,7 +19816,7 @@ _08162F00: b _08162F3E .pool _08162F24: - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr lsls r0, r5, 4 adds r0, r5 lsls r0, 2 @@ -19860,7 +19860,7 @@ sub_8162F68: @ 8162F68 lsls r0, 1 cmp r4, r0 bne _08162F90 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000bed adds r0, r1 @@ -19890,7 +19890,7 @@ _08162FC0: ldr r0, =0x0000018f cmp r4, r0 bhi _08162FEC - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0xfffffed4 adds r2, r4, r1 @@ -19903,7 +19903,7 @@ _08162FC0: .pool _08162FEC: ldr r3, =gUnknown_08610970 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r0, =0xfffffe70 adds r2, r5, r0 @@ -20069,11 +20069,11 @@ _08163138: blt _0816314A b _08163426 _0816314A: - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr _0816314C: movs r0, 0x64 muls r0, r7 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldr r5, [sp, 0x18] subs r2, r7, r5 @@ -20121,7 +20121,7 @@ _081631A4: ldr r5, =0xfffef2a8 adds r4, r0, r5 _081631B6: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] movs r0, 0x2C adds r2, r6, 0 @@ -20142,7 +20142,7 @@ _081631B6: bhi _081631F0 movs r0, 0x64 muls r0, r7 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 adds r1, r3, r4 adds r2, 0x34 @@ -20166,7 +20166,7 @@ _08163218: blt _08163222 b _08163426 _08163222: - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr lsls r0, r5, 4 adds r0, r5 lsls r0, 2 @@ -20176,7 +20176,7 @@ _08163222: _08163230: movs r0, 0x64 muls r0, r7 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldr r1, [r6] adds r1, r5 @@ -20207,9 +20207,9 @@ _08163260: bne _08163260 _08163278: movs r7, 0 - bl GenerateRandomNumber + bl Random adds r4, r0, 0 - bl GenerateRandomNumber + bl Random lsls r4, 16 lsrs r4, 16 lsls r0, 16 @@ -20220,7 +20220,7 @@ _08163278: bne _08163296 b _08163426 _08163296: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 ldr r1, [sp, 0x28] @@ -20254,11 +20254,11 @@ _081632D2: movs r1, 0x64 adds r0, r6, 0 muls r0, r1 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty adds r0, r2 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r1, =gUnknown_0203BC8C ldr r2, [r1] lsls r1, r4, 4 @@ -20278,20 +20278,20 @@ _081632FC: mov r9, r5 movs r3, 0 _08163308: - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r5, r3, r0 adds r0, r5, 0 movs r1, 0xC movs r2, 0 str r3, [sp, 0x38] - bl pokemon_getattr + bl GetMonData ldr r3, [sp, 0x38] cmp r0, 0 beq _0816333E adds r0, r5, 0 movs r1, 0xC movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r1, =gUnknown_0203BC8C ldr r2, [r1] lsls r1, r4, 4 @@ -20337,7 +20337,7 @@ _08163368: movs r1, 0x64 mov r0, r8 muls r0, r1 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty adds r0, r2 ldr r5, =gUnknown_0203BC8C ldr r2, [r5] @@ -20365,7 +20365,7 @@ _08163368: muls r3, r0 mov r1, r9 str r1, [sp, 0x3C] - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty mov r10, r2 _081633B8: ldr r0, [r5] @@ -20400,7 +20400,7 @@ _081633EC: movs r5, 0x64 mov r4, r8 muls r4, r5 - ldr r6, =gUnknown_02024744 + ldr r6, =gEnemyParty adds r4, r6 adds r0, r4, 0 movs r1, 0x20 @@ -20448,7 +20448,7 @@ sub_8163444: @ 8163444 movs r1, 0xFF add r0, sp, 0x4 strb r1, [r0] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] movs r0, 0xDC adds r0, r2 @@ -20483,7 +20483,7 @@ _08163494: adds r6, r2, r7 movs r0, 0x64 muls r0, r6 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 lsls r5, r7, 1 adds r4, r5, r7 @@ -20519,7 +20519,7 @@ _081634D4: movs r0, 0x64 adds r4, r6, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 adds r0, r4, 0 movs r1, 0x20 @@ -20577,7 +20577,7 @@ _08163558: cmp r1, r0 bne _0816354C _0816355E: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r4, 0 @@ -20605,7 +20605,7 @@ _08163580: sub_8163590: @ 8163590 push {lr} bl zero_enemy_party_data - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 @@ -20648,7 +20648,7 @@ sub_81635D4: @ 81635D4 ldr r0, =0x0000012b cmp r2, r0 bhi _0816364A - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, =0x000040ce bl VarGet lsls r0, 24 @@ -20693,11 +20693,11 @@ _0816364A: blt _0816365C b _08163776 _0816365C: - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr _0816365E: movs r0, 0x64 muls r0, r7 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldr r1, [sp, 0x10] subs r2, r7, r1 @@ -20733,7 +20733,7 @@ _081636A6: lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x14] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldrb r2, [r1, 0xA] ldrb r0, [r1, 0xB] @@ -20758,7 +20758,7 @@ _081636CE: movs r0, 0x64 adds r6, r5, 0 muls r6, r0 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r6, r1 ldr r3, =gUnknown_0203BC8C ldr r2, [r3] @@ -20794,7 +20794,7 @@ _08163718: adds r0, 0x2 adds r0, r1 ldrh r1, [r0] - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty adds r0, r6, r2 adds r2, r3, 0 str r3, [sp, 0x1C] @@ -20808,7 +20808,7 @@ _08163718: movs r3, 0x64 adds r4, r5, 0 muls r4, r3 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 adds r0, r4, 0 movs r1, 0x20 @@ -20852,7 +20852,7 @@ sub_816379C: @ 816379C lsls r1, 24 lsrs r1, 24 str r1, [sp, 0x10] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldrb r0, [r1, 0xA] mov r9, r0 @@ -20880,7 +20880,7 @@ _081637D0: movs r7, 0x64 adds r6, r5, 0 muls r6, r7 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r6, r1 ldr r7, =gUnknown_0203BC8C ldr r2, [r7] @@ -20913,7 +20913,7 @@ _08163818: adds r0, 0x2 adds r0, r4 ldrh r1, [r0] - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty adds r0, r6, r2 adds r2, r7, 0 bl sub_81A7024 @@ -20937,7 +20937,7 @@ _08163846: movs r2, 0x64 mov r4, r10 muls r4, r2 - ldr r7, =gUnknown_02024744 + ldr r7, =gEnemyParty adds r4, r7 adds r0, r4, 0 movs r1, 0x20 @@ -20974,7 +20974,7 @@ _08163846: ConvertBattleFrontierTrainerSpeechToString: @ 81638AC push {r4,r5,lr} adds r5, r0, 0 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 adds r0, r4, 0 adds r1, r5, 0 movs r2, 0x3 @@ -21004,7 +21004,7 @@ _081638E4: cmp r0, 0xFE bne _081638E4 _081638EE: - ldr r2, =gUnknown_02021FC4 + ldr r2, =gStringVar4 adds r0, r1, r2 ldrb r0, [r0] adds r3, r2, 0 @@ -21046,7 +21046,7 @@ _08163932: lsls r0, 1 cmp r3, r0 bne _08163950 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000bfc b _08163986 @@ -21069,7 +21069,7 @@ _08163974: ldr r0, =0x0000018f cmp r3, r0 bhi _0816399C - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr movs r0, 0xEC muls r0, r3 ldr r1, [r1] @@ -21121,7 +21121,7 @@ _081639D0: .4byte _081639FC .4byte _081639FC _081639FC: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000ebc adds r1, r0, r2 @@ -21145,7 +21145,7 @@ _08163A2C: .pool _08163A38: movs r5, 0 - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr _08163A3C: movs r0, 0x64 adds r4, r5, 0 @@ -21156,10 +21156,10 @@ _08163A3C: ldr r0, [r6] adds r0, r1 movs r1, 0xC - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1] - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0xC @@ -21192,7 +21192,7 @@ sub_8163A8C: @ 8163A8C lsrs r0, 24 cmp r0, 0x1 bne _08163AB0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =sub_81639AC str r1, [r0, 0x8] ldr r0, =sub_8036760 @@ -21240,7 +21240,7 @@ _08163AF0: .4byte _08163DF4 .4byte _08163DC8 _08163B1C: - ldr r5, =gUnknown_02022FEC + ldr r5, =gBattleTypeFlags movs r0, 0x84 lsls r0, 1 str r0, [r5] @@ -21277,7 +21277,7 @@ _08163B64: movs r0, 0x2 bl sub_816306C ldr r1, =gUnknown_02038BCE - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000cd6 adds r0, r2 @@ -21309,15 +21309,15 @@ _08163BA6: .pool _08163BC0: movs r5, 0 - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr _08163BC4: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r0, r4, r0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1] movs r0, 0x8E @@ -21342,11 +21342,11 @@ _08163BC4: _08163C10: bl zero_enemy_party_data movs r5, 0 - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr _08163C18: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x2C adds r2, r5, 0 @@ -21360,7 +21360,7 @@ _08163C18: adds r5, 0x1 cmp r5, 0x2 ble _08163C18 - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r0, =0x00000808 str r0, [r1] ldr r1, =gUnknown_02038BCA @@ -21375,7 +21375,7 @@ _08163C18: b _08163E10 .pool _08163C70: - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags ldr r0, =0x00010008 str r0, [r4] ldr r0, =0x000040ce @@ -21405,7 +21405,7 @@ _08163C9A: b _08163E10 .pool _08163CC4: - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags ldr r0, =0x00020008 str r0, [r4] ldr r0, =0x000040ce @@ -21418,7 +21418,7 @@ _08163CC4: orrs r0, r1 str r0, [r4] _08163CDE: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000ca9 adds r0, r2 @@ -21444,10 +21444,10 @@ _08163D12: b _08163E10 .pool _08163D28: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r0, =0x00040008 str r0, [r1] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 @@ -21473,7 +21473,7 @@ _08163D5E: b _08163E10 .pool _08163D74: - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags ldr r0, =0x00080008 str r0, [r4] ldr r0, =0x000040ce @@ -21496,7 +21496,7 @@ _08163D8E: b _08163E10 .pool _08163DB4: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0x84 lsls r0, 1 str r0, [r1] @@ -21505,7 +21505,7 @@ _08163DB4: b _08163E00 .pool _08163DC8: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r0, =0x00200008 str r0, [r1] movs r0, 0x3 @@ -21519,7 +21519,7 @@ _08163DC8: b _08163E10 .pool _08163DF4: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r0, =0x00008109 str r0, [r1] movs r0, 0x1 @@ -21539,7 +21539,7 @@ _08163E10: b _08163E68 .pool _08163E2C: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r0, =0x00408049 str r0, [r1] ldr r5, =0x00000c03 @@ -21574,7 +21574,7 @@ _08163E68: thumb_func_start sub_8163E90 sub_8163E90: @ 8163E90 push {r4-r6,lr} - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r0, [r6] ldr r1, =0x00000ca9 adds r0, r1 @@ -21616,7 +21616,7 @@ sub_8163EE4: @ 8163EE4 mov r7, r9 mov r6, r8 push {r6,r7} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =0x0000064c adds r5, r0, r1 @@ -21665,13 +21665,13 @@ _08163F52: strb r0, [r5, 0x1] adds r0, r5, 0 adds r0, 0xC - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r1, [r4] adds r1, 0xA bl sub_80842F4 adds r0, r5, 0x4 ldr r1, [r4] - bl CopyString_Limit7 + bl StringCopy7 adds r0, r6, 0 adds r1, r7, 0 bl sub_8164FCC @@ -21692,7 +21692,7 @@ _08163F96: lsls r2, r4, 1 mov r1, r12 adds r3, r1, r2 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r7, =0x00002bbc adds r0, r1, r7 @@ -21717,7 +21717,7 @@ _08163F96: ble _08163F96 movs r4, 0 _08163FCC: - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r0, [r6] lsls r1, r4, 1 ldr r2, =0x00000caa @@ -21740,7 +21740,7 @@ _08163FF4: adds r4, 0x1 cmp r4, 0x3 ble _08163FCC - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] mov r7, r8 strb r0, [r7] @@ -21761,7 +21761,7 @@ _08163FF4: thumb_func_start sub_8164040 sub_8164040: @ 8164040 push {r4,r5,lr} - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r0, [r5] ldr r1, =0x00000ca9 adds r0, r1 @@ -21798,7 +21798,7 @@ sub_8164040: @ 8164040 _0816408A: bl sub_8163EE4 _0816408E: - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =gUnknown_020375E2 ldrh r1, [r1] @@ -21840,23 +21840,23 @@ sub_81640E0: @ 81640E0 adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r7, r0, 16 adds r4, 0x64 adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 movs r6, 0 movs r2, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r0, =0xfffffe70 adds r5, r0 @@ -21879,7 +21879,7 @@ _08164130: adds r2, 0x1 cmp r2, 0x2 ble _08164122 - bl GenerateRandomNumber + bl Random ldr r4, =gUnknown_03006298 lsls r0, 16 lsrs r0, 16 @@ -21890,7 +21890,7 @@ _08164130: ldr r0, [r0] strh r0, [r4] _08164150: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r6, 0 @@ -21922,7 +21922,7 @@ sub_8164188: @ 8164188 adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r0, [r6] ldr r1, =0x00000ca9 adds r0, r1 @@ -21930,11 +21930,11 @@ sub_8164188: @ 8164188 lsls r0, 30 lsrs r0, 30 str r0, [sp, 0xC] - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x10] @@ -21942,7 +21942,7 @@ sub_8164188: @ 8164188 adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x14] @@ -22004,7 +22004,7 @@ _0816423A: adds r7, 0x1 cmp r7, 0x3 ble _081641E6 - bl GenerateRandomNumber + bl Random ldr r4, =gUnknown_03006298 lsls r0, 16 lsrs r0, 16 @@ -22015,7 +22015,7 @@ _0816423A: ldr r0, [r0] strh r0, [r4, 0x4] _08164258: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 mov r1, r8 @@ -22048,13 +22048,13 @@ sub_81642A0: @ 81642A0 mov r5, r8 push {r5-r7} sub sp, 0x4C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0xC7 lsls r1, 4 adds r1, r0, r1 str r1, [sp, 0x24] - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r0, [r5] ldr r2, =0x00000ca9 adds r0, r2 @@ -22080,17 +22080,17 @@ sub_81642A0: @ 81642A0 lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x18] - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x1C] adds r4, 0x64 adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x20] bl sub_8165C40 movs r7, 0 @@ -22159,7 +22159,7 @@ _08164368: ldr r0, [sp, 0x24] str r0, [sp, 0x40] _0816438C: - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] mov r2, r9 lsls r1, r2, 1 @@ -22194,7 +22194,7 @@ _081643C0: ands r0, r7 cmp r0, 0 beq _081643F4 - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r0, [r3] ldr r4, =0x00000cb4 adds r0, r4 @@ -22215,7 +22215,7 @@ _081643F4: movs r5, 0x8 cmp r5, r10 bge _08164430 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r0, [r2] ldr r1, =gUnknown_0203BC8C ldr r3, [r1] @@ -22246,7 +22246,7 @@ _0816440E: _08164430: cmp r5, r10 bne _081643C0 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] ldr r2, =0x00000cb4 adds r0, r2 @@ -22271,7 +22271,7 @@ _08164430: bl sub_8165B20 movs r4, 0 mov r9, r4 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r2, 0 adds r6, r0, 0 @@ -22302,7 +22302,7 @@ _08164474: cmp r0, r3 bne _081644E0 movs r5, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xE0 adds r1, r2, r0 @@ -22344,8 +22344,8 @@ _081644E0: mov r4, r10 cmp r4, 0 beq _08164532 - bl GenerateRandomNumber - ldr r6, =gUnknown_03005D90 + bl Random + ldr r6, =gSaveBlock2Ptr ldr r4, [r6] lsls r0, 16 lsrs r0, 16 @@ -22377,7 +22377,7 @@ _08164532: mov r1, sp str r1, [sp, 0x3C] _0816453C: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr movs r2, 0xEC mov r1, r9 muls r1, r2 @@ -22399,7 +22399,7 @@ _0816455A: adds r7, 0x1 cmp r7, 0x39 bls _0816455A - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r5, [r0] movs r1, 0xEC mov r6, r9 @@ -22436,7 +22436,7 @@ _0816455A: bne _08164656 movs r5, 0 movs r7, 0 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr mov r8, r2 ldr r3, =0x0000076c _081645B8: @@ -22507,8 +22507,8 @@ _08164660: mov r1, r10 cmp r1, 0 beq _081646A0 - bl GenerateRandomNumber - ldr r6, =gUnknown_03005D90 + bl Random + ldr r6, =gSaveBlock2Ptr ldr r4, [r6] lsls r0, 16 lsrs r0, 16 @@ -22579,7 +22579,7 @@ _081646FC: ldr r0, =0x0000018f cmp r5, r0 bhi _08164750 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] ldr r1, =gUnknown_03006298 ldr r0, =gUnknown_020375E2 @@ -22608,7 +22608,7 @@ _081646FC: b _081647CE .pool _08164750: - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r3, [r4] ldr r1, =gUnknown_03006298 ldr r0, =gUnknown_020375E2 @@ -22635,7 +22635,7 @@ _08164750: ldrh r3, [r3] mov r10, r3 movs r3, 0 - ldr r7, =gUnknown_02021EC4 + ldr r7, =gStringVar3 mov r8, r7 adds r0, r4, 0 mov r12, r0 @@ -22658,7 +22658,7 @@ _08164794: adds r1, r3, r7 movs r0, 0xFF strb r0, [r1] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r0, =0xfffffe70 adds r1, r5, r0 @@ -22670,24 +22670,24 @@ _08164794: adds r0, r2, r1 ldrb r1, [r0] adds r0, r7, 0 - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString _081647CE: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r1, 0xD mov r2, r9 muls r2, r1 adds r1, r2, 0 ldr r2, =gMoveNames adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 movs r1, 0xB mov r2, r10 muls r2, r1 adds r1, r2, 0 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy pop {r3-r5} mov r8, r3 mov r9, r4 @@ -22718,7 +22718,7 @@ sub_8164828: @ 8164828 ldr r0, =gUnknown_020375F2 ldrh r0, [r0] subs r5, r0, 0x2 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r5, 1 ldr r2, =0x00000cb4 @@ -22781,7 +22781,7 @@ _081648D6: cmp r7, r0 bgt _081648F4 _081648E2: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r7, 0 bl sub_8162E20 b _08164AC2 @@ -22790,9 +22790,9 @@ _081648F4: movs r3, 0 lsls r2, r7, 16 mov r10, r2 - ldr r6, =gUnknown_02021CC4 + ldr r6, =gStringVar1 mov r9, r6 - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr mov r8, r4 ldr r5, =0xfffffe70 adds r1, r7, r5 @@ -22817,7 +22817,7 @@ _08164910: adds r1, r3, r6 movs r0, 0xFF strb r0, [r1] - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r1, [r2] ldr r3, =0xfffffe70 adds r0, r7, r3 @@ -22829,24 +22829,24 @@ _08164910: adds r0, r1, r5 ldrb r1, [r0] adds r0, r6, 0 - bl StopMusicWhileStringIsPrinted - ldr r0, =gUnknown_02021DC4 - ldr r2, =gUnknown_03005D90 + bl ConvertInternationalString + ldr r0, =gStringVar2 + ldr r2, =gSaveBlock2Ptr ldr r1, [r2] adds r1, r4 adds r1, 0xDE ldrb r1, [r1] movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r0, =gUnknown_02021EC4 + bl ConvertIntToDecimalStringN + ldr r0, =gStringVar3 mov r3, r10 lsrs r1, r3, 16 bl sub_8162E20 b _08164AC2 .pool _08164984: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] lsls r0, r5, 2 adds r1, r0 @@ -22855,7 +22855,7 @@ _08164984: b _081649A8 .pool _0816499C: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] lsls r0, r5, 2 adds r1, r0 @@ -22873,7 +22873,7 @@ _081649BC: ldr r0, =0x0000012b cmp r7, r0 bgt _08164A08 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r4, [r0] lsls r1, r5, 1 adds r0, r1, 0 @@ -22899,7 +22899,7 @@ _08164A08: ldr r0, =0x0000018f cmp r7, r0 bgt _08164A30 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r3, =gUnknown_03006298 ldrh r2, [r3, 0x4] @@ -22910,7 +22910,7 @@ _08164A08: b _08164A40 .pool _08164A30: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r3, =gUnknown_03006298 ldrh r2, [r3] @@ -22952,7 +22952,7 @@ _08164A60: movs r2, 0 cmp r2, r5 bge _08164AA2 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] ldr r4, =0x00000cb4 adds r0, r4 @@ -22974,7 +22974,7 @@ _08164A8E: _08164AA2: cmp r2, r5 bne _08164A60 - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r0, [r5] ldr r1, =0x00000cb4 adds r0, r1 @@ -22983,7 +22983,7 @@ _08164AA2: mov r5, r9 cmp r5, 0xD ble _08164A4E - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r0, [r2] ldr r3, =0x00000cd6 adds r0, r3 @@ -23021,7 +23021,7 @@ _08164B04: b _08164B54 .pool _08164B28: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r0, =0xfffffe70 adds r2, r7, r0 @@ -23061,7 +23061,7 @@ sub_8164B74: @ 8164B74 mov r6, r8 push {r6,r7} sub sp, 0x4 - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =0x00000ca9 adds r0, r1 @@ -23103,7 +23103,7 @@ _08164BEC: beq _08164BF2 b _08164DB0 _08164BF2: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r7, 1 adds r0, r1 @@ -23152,7 +23152,7 @@ _08164C4A: _08164C60: str r0, [sp] movs r4, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr mov r9, r0 _08164C68: adds r1, r4, 0x1 @@ -23179,7 +23179,7 @@ _08164C74: ldrh r0, [r0] cmp r0, r3 beq _08164CB0 - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr adds r5, r1, 0 _08164C9C: adds r2, 0x1 @@ -23217,7 +23217,7 @@ _08164CE0: bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] ldr r3, =0x00000cb4 adds r1, r3 @@ -23234,7 +23234,7 @@ _08164D14: cmp r1, 0x3 bne _08164DB6 bl sub_800A5B4 - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r5, =0x00000cb4 adds r0, r5 @@ -23265,7 +23265,7 @@ _08164D14: ldrb r0, [r0] cmp r0, 0 beq _08164DB0 - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _08164DB0 @@ -23303,7 +23303,7 @@ _08164DB6: thumb_func_start sub_8164DCC sub_8164DCC: @ 8164DCC push {lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _08164DDA @@ -23317,7 +23317,7 @@ _08164DDA: thumb_func_start sub_8164DE4 sub_8164DE4: @ 8164DE4 push {lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000cd6 adds r0, r1 @@ -23343,13 +23343,13 @@ sub_8164E04: @ 8164E04 mov r0, sp bl sub_8162E20 mov r0, sp - bl StripExtendedControlCodes - ldr r4, =gUnknown_03005D90 + bl StripExtCtrlCodes + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =0x00000bd8 adds r0, r1 mov r1, sp - bl CopyString + bl StringCopy ldr r0, [r4] ldr r2, =0x00000beb adds r0, r2 @@ -23359,22 +23359,22 @@ sub_8164E04: @ 8164E04 ldrh r0, [r6, 0x2] movs r5, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r1, [r4] ldr r2, =0x00000bd6 adds r1, r2 strh r0, [r1] ldrh r0, [r6] muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r1, [r4] ldr r2, =0x00000bd4 adds r1, r2 @@ -23413,7 +23413,7 @@ sub_8164ED8: @ 8164ED8 push {r4-r7,lr} mov r7, r8 push {r7} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r3, 0 movs r2, 0 @@ -23425,7 +23425,7 @@ _08164EEA: adds r2, 0x1 cmp r2, 0x39 bls _08164EEA - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r1, [r5] ldr r2, =0x00000734 adds r0, r1, r2 @@ -23548,7 +23548,7 @@ sub_8164FCC: @ 8164FCC push {lr} lsls r0, 24 lsls r1, 24 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r2, [r2] lsrs r0, 23 lsrs r1, 22 @@ -23602,7 +23602,7 @@ sub_816502C: @ 816502C mov r5, r8 push {r5-r7} sub sp, 0xC - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 @@ -23640,10 +23640,10 @@ _0816506A: movs r6, 0 cmp r6, r8 bge _081650DC - ldr r7, =gUnknown_03005D8C + ldr r7, =gSaveBlock1Ptr mov r5, sp _0816508C: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r6, 1 ldr r2, =0x00000caa @@ -23662,7 +23662,7 @@ _0816508C: ldr r0, [r7] adds r0, r4 mov r1, r10 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _081650D4 movs r0, 0x1 @@ -23714,7 +23714,7 @@ _08165110: ldrb r0, [r0, 0x1] cmp r0, 0x4 bls _08165132 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr mov r0, sp ldrb r1, [r0] movs r0, 0x64 @@ -23744,7 +23744,7 @@ sub_816515C: @ 816515C mov r7, r9 mov r6, r8 push {r6,r7} - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r2, [r1] ldr r0, =0x00000bec adds r7, r2, r0 @@ -23785,12 +23785,12 @@ _081651A6: bl sub_80842F4 adds r0, r7, 0x4 ldr r1, [r5] - bl CopyString_Limit7 + bl StringCopy7 movs r0, 0x1 strh r0, [r7, 0x2] movs r6, 0x7 movs r4, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr mov r8, r0 adds r5, r7, 0 adds r5, 0x10 @@ -23823,7 +23823,7 @@ _081651E0: _08165206: movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2C muls r1, r4 @@ -23847,7 +23847,7 @@ _08165206: thumb_func_start sub_8165244 sub_8165244: @ 8165244 ldr r1, =gTrainerPicIndices - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000bed adds r0, r2 @@ -23861,7 +23861,7 @@ sub_8165244: @ 8165244 thumb_func_start sub_8165264 sub_8165264: @ 8165264 ldr r1, =gTrainerClassNameIndices - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000bed adds r0, r2 @@ -23877,7 +23877,7 @@ sub_8165284: @ 8165284 push {r4,lr} adds r3, r0, 0 movs r2, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r1, 0xBF lsls r1, 4 @@ -23905,7 +23905,7 @@ sub_81652B4: @ 81652B4 ldr r2, =gUnknown_020375F0 movs r0, 0 strh r0, [r2] - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] ldr r3, =0x00000bec adds r5, r0, r3 @@ -23993,7 +23993,7 @@ _08165352: thumb_func_start sub_8165360 sub_8165360: @ 8165360 push {lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000bfc adds r0, r1 @@ -24010,7 +24010,7 @@ sub_816537C: @ 816537C ldrb r0, [r0] cmp r0, 0x3 bne _08165398 - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 movs r0, 0xFF strb r0, [r1] b _081653C0 @@ -24018,7 +24018,7 @@ sub_816537C: @ 816537C _08165398: cmp r0, 0x1 bne _081653B4 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000c14 adds r0, r1 @@ -24026,7 +24026,7 @@ _08165398: b _081653C0 .pool _081653B4: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000c08 adds r0, r1 @@ -24040,7 +24040,7 @@ _081653C0: thumb_func_start sub_81653CC sub_81653CC: @ 81653CC push {lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000ca8 adds r0, r1 @@ -24098,9 +24098,9 @@ _0816542A: ldr r6, =gUnknown_085DD6D0 adds r5, r0, r6 _08165440: - bl GenerateRandomNumber + bl Random adds r4, r0, 0 - bl GenerateRandomNumber + bl Random lsls r4, 16 lsrs r4, 16 lsls r0, 16 @@ -24218,7 +24218,7 @@ _0816554C: cmp r7, r0 bne _08165564 add r0, sp, 0x10 - ldr r1, =gUnknown_82E9531 + ldr r1, =gGameLanguage ldrb r1, [r1] strb r1, [r0] b _0816585A @@ -24238,9 +24238,9 @@ _0816556C: lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x4C] - bl GenerateRandomNumber + bl Random adds r4, r0, 0 - bl GenerateRandomNumber + bl Random lsls r4, 16 lsrs r4, 16 lsls r0, 16 @@ -24255,7 +24255,7 @@ _0816556C: adds r0, 0x48 str r0, [sp, 0x5C] _081655A6: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] mov r0, r10 adds r0, 0x12 @@ -24423,7 +24423,7 @@ _081656F0: movs r1, 0x24 str r1, [sp, 0x6C] _08165710: - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr movs r0, 0xEC adds r4, r7, 0 muls r4, r0 @@ -24452,7 +24452,7 @@ _08165710: stm r0!, {r2,r3} adds r1, r4, 0x4 add r0, sp, 0x10 - bl CopyString + bl StringCopy adds r4, 0xE4 ldrb r0, [r4] cmp r0, 0x1 @@ -24468,7 +24468,7 @@ _08165710: strb r0, [r1] add r0, sp, 0x38 movs r1, 0x1 - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString b _0816579C .pool _0816578C: @@ -24527,7 +24527,7 @@ _081657F0: mov r3, sp adds r3, 0x44 str r3, [sp, 0x64] - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr mov r8, r6 movs r5, 0x24 lsls r0, r7, 4 @@ -24956,7 +24956,7 @@ sub_8165B20: @ 8165B20 mov r6, r8 push {r6,r7} movs r5, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr mov r8, r0 mov r9, r8 _08165B30: @@ -25016,21 +25016,21 @@ sub_8165B88: @ 8165B88 lsls r0, 1 cmp r2, r0 bne _08165BA4 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage b _08165C28 .pool _08165BA4: ldr r0, =0x0000012b cmp r2, r0 bhi _08165BB8 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage b _08165C28 .pool _08165BB8: ldr r0, =0x0000018f cmp r2, r0 bhi _08165BFC - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -25041,7 +25041,7 @@ _08165BB8: b _08165C2A .pool _08165BDC: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0xfffffed4 adds r2, r1 @@ -25053,7 +25053,7 @@ _08165BDC: b _08165C28 .pool _08165BFC: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -25064,7 +25064,7 @@ _08165BFC: b _08165C2A .pool _08165C14: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r0, =0xfffffe70 adds r1, r3, r0 @@ -25087,7 +25087,7 @@ _08165C2A: thumb_func_start sub_8165C40 sub_8165C40: @ 8165C40 push {lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000ca9 adds r2, r0, r1 @@ -25150,18 +25150,18 @@ _08165CBA: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08165CF4 adds r0, r4, 0 movs r1, 0x41 movs r2, 0 - bl pokemon_getattr + bl GetMonData movs r1, 0xCE lsls r1, 1 cmp r0, r1 @@ -25169,7 +25169,7 @@ _08165CBA: adds r0, r4, 0 movs r1, 0x38 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, r6 ble _08165CF4 adds r6, r0, 0 @@ -25231,7 +25231,7 @@ sub_8165D40: @ 8165D40 cmp r0, 0x4 bne _08165D70 _08165D58: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x1E @@ -25306,7 +25306,7 @@ _08165E02: thumb_func_start sub_8165E18 sub_8165E18: @ 8165E18 push {r4,r5,lr} - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr _08165E1C: bl sub_8165D40 lsls r0, 16 @@ -25323,7 +25323,7 @@ _08165E1C: ldrh r0, [r0] cmp r0, r4 beq _08165E58 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] subs r2, 0x2 adds r0, r1, r2 @@ -25350,7 +25350,7 @@ _08165E58: ldrh r0, [r5] movs r1, 0 bl sub_8162614 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r2, =0x00000cb2 adds r0, r1, r2 @@ -25420,9 +25420,9 @@ _08165EFE: bne _08165EEC movs r0, 0 mov r8, r0 - bl GenerateRandomNumber + bl Random adds r4, r0, 0 - bl GenerateRandomNumber + bl Random lsls r4, 16 lsrs r4, 16 lsls r0, 16 @@ -25431,7 +25431,7 @@ _08165EFE: b _08166092 .pool _08165F24: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 ldr r1, [sp, 0x24] @@ -25452,11 +25452,11 @@ _08165F44: movs r1, 0x64 adds r0, r6, 0 muls r0, r1 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty adds r0, r2 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r1, =gUnknown_0203BC8C ldr r2, [r1] lsls r1, r4, 4 @@ -25476,20 +25476,20 @@ _08165F6E: mov r9, r0 movs r3, 0 _08165F7A: - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r5, r3, r1 adds r0, r5, 0 movs r1, 0xC movs r2, 0 str r3, [sp, 0x34] - bl pokemon_getattr + bl GetMonData ldr r3, [sp, 0x34] cmp r0, 0 beq _08165FB0 adds r0, r5, 0 movs r1, 0xC movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r1, =gUnknown_0203BC8C ldr r2, [r1] lsls r1, r4, 4 @@ -25536,7 +25536,7 @@ _08165FDA: movs r6, 0x64 adds r0, r7, 0 muls r0, r6 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldr r5, =gUnknown_0203BC8C ldr r2, [r5] @@ -25565,7 +25565,7 @@ _08165FDA: mov r8, r1 adds r3, r5, 0 mov r5, r9 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty mov r10, r2 _0816602E: ldr r0, [r3] @@ -25598,7 +25598,7 @@ _0816605E: movs r2, 0x64 adds r4, r7, 0 muls r4, r2 - ldr r6, =gUnknown_02024744 + ldr r6, =gEnemyParty adds r4, r6 adds r0, r4, 0 movs r1, 0x20 @@ -25697,7 +25697,7 @@ sub_8166124: @ 8166124 push {r4-r6,lr} lsls r0, 24 lsrs r6, r0, 24 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr movs r0, 0xEC muls r0, r6 movs r1, 0xE7 @@ -25751,7 +25751,7 @@ _08166182: thumb_func_start sub_8166188 sub_8166188: @ 8166188 push {r4-r7,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 @@ -25768,12 +25768,12 @@ _081661A6: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 cmp r1, 0 beq _081661E2 @@ -26046,7 +26046,7 @@ _08166468: bne _08166556 b _0816653C _08166474: - ldr r1, =gUnknown_030022B0 + ldr r1, =gKeyRepeatStartDelay movs r0, 0x14 strh r0, [r1] bl sub_8167420 @@ -26259,7 +26259,7 @@ _08166658: .4byte _081667AC .4byte _081667F4 _08166678: - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2C] movs r0, 0x40 ands r0, r1 @@ -26413,7 +26413,7 @@ _081667E8: b _0816680E .pool _081667F4: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -26505,7 +26505,7 @@ _08166888: bl Free str r5, [r4] bl FreeAllWindowBuffers - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =sub_816624C str r0, [r1, 0x8] bl sub_8179D70 @@ -26674,7 +26674,7 @@ _08166A58: .4byte _08166BB6 _08166A70: ldr r4, [r5] - ldr r3, =gUnknown_020244EC + ldr r3, =gPlayerParty str r3, [r4, 0xC] ldr r0, =gUnknown_0203BCAC ldr r0, [r0] @@ -26696,7 +26696,7 @@ _08166A70: b _08166BAA .pool _08166AAC: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -26804,7 +26804,7 @@ _08166BAC: strb r0, [r1] b _08166BDA _08166BB6: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -26987,20 +26987,20 @@ sub_8166D44: @ 8166D44 lsrs r0, 24 movs r1, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2 add r2, sp, 0xC - bl pokemon_getattr + bl GetMonData add r0, sp, 0xC - bl GetStringEnd_Limit7 + bl StringGetEnd10 ldr r1, =gUnknown_085EC7A0 add r0, sp, 0xC - bl AppendString - ldr r4, =gUnknown_02021FC4 + bl StringAppend + ldr r4, =gStringVar4 adds r0, r4, 0 add r1, sp, 0xC - bl CopyString + bl StringCopy movs r0, 0x2 movs r1, 0x11 bl FillWindowPixelBuffer @@ -27125,7 +27125,7 @@ _08166E84: ldrb r0, [r1] cmp r0, 0x4 bhi _08166EA8 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldrb r1, [r1] adds r2, 0x61 adds r2, r1 @@ -27134,7 +27134,7 @@ _08166E84: b _08166EB8 .pool _08166EA8: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_0203BC90 ldr r1, [r1] adds r1, 0x53 @@ -27142,7 +27142,7 @@ _08166EA8: movs r2, 0 bl sub_8166FD4 _08166EB8: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 bl sub_8166FB0 movs r0, 0x2 bl PutWindowTilemap @@ -27190,7 +27190,7 @@ _08166F18: movs r0, 0 b _08166F44 _08166F1E: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r0, [r5] adds r1, r0, 0 adds r1, 0x53 @@ -27263,7 +27263,7 @@ sub_8166F94: @ 8166F94 sub_8166FB0: @ 8166FB0 push {lr} sub sp, 0xC - ldr r2, =gUnknown_02021FC4 + ldr r2, =gStringVar4 movs r0, 0x1 str r0, [sp] movs r0, 0 @@ -27300,16 +27300,16 @@ _08166FEC: adds r0, r1 ldr r1, [r0] adds r0, r4, 0 - bl CopyString + bl StringCopy ldr r1, =gUnknown_085EC7E1 adds r0, r4, 0 - bl AppendString + bl StringAppend b _08167018 .pool _08167010: ldr r1, =gUnknown_085EC7EF adds r0, r4, 0 - bl CopyString + bl StringCopy _08167018: pop {r4} pop {r0} @@ -27329,7 +27329,7 @@ _0816702E: adds r0, r7 ldr r1, [r0] adds r0, r6, 0 - bl pokemon_getattr + bl GetMonData adds r1, r5, r4 strb r0, [r1] adds r0, r4, 0x1 @@ -27353,7 +27353,7 @@ sub_8167054: @ 8167054 adds r5, r1, 0 adds r0, r5, 0 movs r1, 0x30 - bl pokemon_getattr + bl GetMonData cmp r0, 0xFF beq _081670F0 mov r0, r8 @@ -27368,7 +27368,7 @@ _08167078: ldr r6, [r0] adds r0, r5, 0 adds r1, r6, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r0, 24 strb r0, [r7] @@ -27403,7 +27403,7 @@ _081670B0: bls _08167078 adds r0, r5, 0 movs r1, 0x30 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r0, 24 mov r2, r8 @@ -27434,7 +27434,7 @@ _081670F0: thumb_func_start sub_8167104 sub_8167104: @ 8167104 push {r4,r5,lr} - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty ldr r0, =gUnknown_0203BCAC ldr r1, [r0] ldr r2, =0x00008041 @@ -27640,10 +27640,10 @@ sub_81672A4: @ 81672A4 _081672AC: movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _081672D2 cmp r5, 0 @@ -27680,10 +27680,10 @@ sub_81672E4: @ 81672E4 _081672F2: movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0816730A adds r0, r6, 0x1 @@ -27841,10 +27841,10 @@ sub_8167420: @ 8167420 _08167430: movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData adds r3, r0, 0 cmp r3, 0 bne _0816746C @@ -28684,7 +28684,7 @@ sub_8167BA0: @ 8167BA0 lsrs r0, 24 movs r1, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 bl GetNature adds r4, r0, 0 @@ -28694,12 +28694,12 @@ sub_8167BA0: @ 8167BA0 ldr r6, =0x0000804a adds r0, r6 ldr r1, =gUnknown_085EBF8D - bl CopyString + bl StringCopy ldr r1, =gNatureNamePointers lsls r4, 2 adds r4, r1 ldr r1, [r4] - bl CopyString + bl StringCopy ldr r0, =gUnknown_085DFCC9 str r0, [sp] str r5, [sp, 0x4] @@ -29356,10 +29356,10 @@ sub_81681F4: @ 81681F4 lsrs r0, 24 movs r1, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x30 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r2, r0, 24 ldr r0, =gUnknown_0203BCAC @@ -29602,7 +29602,7 @@ bx_goto_buffer_A_ch0_tbl3: @ 81683B8 bx_exec_buffer_A_ch0_tbl2: @ 81683F4 push {lr} ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r3, [r0] lsls r0, r3, 2 @@ -29857,7 +29857,7 @@ _081685FC: thumb_func_start sub_8168610 sub_8168610: @ 8168610 push {lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, [r0, 0x4] ldr r0, =sub_8038420 cmp r1, r0 @@ -29904,7 +29904,7 @@ sub_816864C: @ 816864C ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @@ -29929,7 +29929,7 @@ _08168684: ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @@ -29989,7 +29989,7 @@ _081686D2: lsls r0, 24 cmp r0, 0 beq _0816877A - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -30016,7 +30016,7 @@ _081686D2: ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @@ -30050,7 +30050,7 @@ _0816877A: ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @@ -30195,7 +30195,7 @@ _08168842: ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 bl sub_805E990 bl dp01_tbl5_exec_completed @@ -30247,7 +30247,7 @@ _0816897C: ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 bl sub_805E990 bl dp01_tbl5_exec_completed @@ -30425,7 +30425,7 @@ dp01_tbl5_exec_completed: @ 8168AF8 adds r0, r1 ldr r1, =bx_exec_buffer_A_ch0_tbl2 str r1, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -30448,7 +30448,7 @@ dp01_tbl5_exec_completed: @ 8168AF8 .pool _08168B4C: ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r1 @@ -30638,16 +30638,16 @@ _08168D44: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1] adds r0, r4, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x2E] movs r6, 0 @@ -30675,12 +30675,12 @@ _08168D90: adds r1, r6, 0 adds r1, 0xD mov r0, r8 - bl pokemon_getattr + bl GetMonData strh r0, [r4] adds r1, r6, 0 adds r1, 0x11 mov r0, r8 - bl pokemon_getattr + bl GetMonData mov r2, r9 adds r1, r2, r6 strb r0, [r1] @@ -30691,25 +30691,25 @@ _08168D90: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData mov r1, r10 strb r0, [r1] adds r0, r4, 0 movs r1, 0x20 - bl pokemon_getattr + bl GetMonData ldr r2, [sp, 0x80] strb r0, [r2] adds r0, r4, 0 movs r1, 0x19 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x44] adds r0, r4, 0 movs r1, 0x27 - bl pokemon_getattr + bl GetMonData mov r3, sp movs r5, 0x1F ands r0, r5 @@ -30721,7 +30721,7 @@ _08168D90: strb r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x28 - bl pokemon_getattr + bl GetMonData mov r3, sp movs r6, 0x1F ands r0, r6 @@ -30733,7 +30733,7 @@ _08168D90: strh r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x29 - bl pokemon_getattr + bl GetMonData mov r3, sp ands r0, r5 lsls r0, 2 @@ -30745,7 +30745,7 @@ _08168D90: strb r1, [r3, 0x15] adds r0, r4, 0 movs r1, 0x2A - bl pokemon_getattr + bl GetMonData movs r1, 0x1F ands r1, r0 lsls r1, 15 @@ -30756,7 +30756,7 @@ _08168D90: str r0, [sp, 0x14] adds r0, r4, 0 movs r1, 0x2B - bl pokemon_getattr + bl GetMonData mov r3, sp ands r0, r6 lsls r0, 4 @@ -30767,7 +30767,7 @@ _08168D90: strh r1, [r3, 0x16] adds r0, r4, 0 movs r1, 0x2C - bl pokemon_getattr + bl GetMonData mov r3, sp ands r0, r5 lsls r0, 1 @@ -30779,55 +30779,55 @@ _08168D90: strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x48] adds r0, r4, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x4C] adds r0, r4, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData ldr r1, [sp, 0x7C] strb r0, [r1] adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x28] adds r0, r4, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x2C] adds r0, r4, 0 movs r1, 0x3B - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x2] adds r0, r4, 0 movs r1, 0x3C - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x4] adds r0, r4, 0 movs r1, 0x3D - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x6] adds r0, r4, 0 movs r1, 0x3E - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x8] adds r0, r4, 0 movs r1, 0x3F - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0xA] adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData mov r3, sp movs r1, 0x1 ands r0, r1 @@ -30840,7 +30840,7 @@ _08168D90: strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x2E - bl pokemon_getattr + bl GetMonData mov r3, sp lsls r0, 7 ldrb r2, [r3, 0x17] @@ -30850,19 +30850,19 @@ _08168D90: strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x54] adds r0, r4, 0 movs r1, 0x2 ldr r2, [sp, 0x8C] - bl pokemon_getattr + bl GetMonData ldr r0, [sp, 0x84] ldr r1, [sp, 0x8C] - bl CopyString_Limit10 + bl StringCopy10 adds r0, r4, 0 movs r1, 0x7 ldr r2, [sp, 0x88] - bl pokemon_getattr + bl GetMonData mov r2, sp movs r6, 0 _08168F48: @@ -30878,7 +30878,7 @@ _08168F48: _08168F68: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB b _081692E2 @@ -30886,7 +30886,7 @@ _08168F68: _08168F78: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xC b _081692E2 @@ -30900,20 +30900,20 @@ _08168F88: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 mov r8, r9 _08168F9E: adds r1, r6, 0 adds r1, 0xD adds r0, r4, 0 - bl pokemon_getattr + bl GetMonData mov r1, r8 strh r0, [r1] adds r1, r6, 0 adds r1, 0x11 adds r0, r4, 0 - bl pokemon_getattr + bl GetMonData mov r2, r10 adds r1, r2, r6 strb r0, [r1] @@ -30924,10 +30924,10 @@ _08168F9E: ble _08168F9E movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData mov r1, r9 strb r0, [r1, 0xC] mov r2, r9 @@ -30945,7 +30945,7 @@ _08168FDC: _08168FF0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldrb r1, [r3] lsls r1, 9 @@ -30960,14 +30960,14 @@ _0816900C: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty mov r8, r2 _08169018: adds r1, r6, 0 adds r1, 0x11 mov r2, r8 adds r0, r4, r2 - bl pokemon_getattr + bl GetMonData adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 @@ -30975,10 +30975,10 @@ _08169018: ble _08169018 movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 @@ -30987,7 +30987,7 @@ _08169018: _08169048: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldrb r1, [r3] lsls r1, 9 @@ -31000,7 +31000,7 @@ _08169048: _08169064: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1 b _0816907E @@ -31008,11 +31008,11 @@ _08169064: _08169074: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x19 _0816907E: - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 strb r1, [r7] movs r0, 0xFF @@ -31031,7 +31031,7 @@ _0816907E: _081690A4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1A b _081693A2 @@ -31039,7 +31039,7 @@ _081690A4: _081690B4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1B b _081693A2 @@ -31047,7 +31047,7 @@ _081690B4: _081690C4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1C b _081693A2 @@ -31055,7 +31055,7 @@ _081690C4: _081690D4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1D b _081693A2 @@ -31063,7 +31063,7 @@ _081690D4: _081690E4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1E b _081693A2 @@ -31071,7 +31071,7 @@ _081690E4: _081690F4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1F b _081693A2 @@ -31079,7 +31079,7 @@ _081690F4: _08169104: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x20 b _081693A2 @@ -31087,7 +31087,7 @@ _08169104: _08169114: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x22 b _081693A2 @@ -31095,7 +31095,7 @@ _08169114: _08169124: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x23 b _081693A2 @@ -31103,7 +31103,7 @@ _08169124: _08169134: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x24 b _081693A2 @@ -31111,7 +31111,7 @@ _08169134: _08169144: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x25 b _081693A2 @@ -31119,7 +31119,7 @@ _08169144: _08169154: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x26 b _081693A2 @@ -31128,31 +31128,31 @@ _08169164: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x27 - bl pokemon_getattr + bl GetMonData strb r0, [r7] adds r0, r4, 0 movs r1, 0x28 - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x1] adds r0, r4, 0 movs r1, 0x29 - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x2] adds r0, r4, 0 movs r1, 0x2A - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x3] adds r0, r4, 0 movs r1, 0x2B - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x4] adds r0, r4, 0 movs r1, 0x2C - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x5] movs r6, 0x6 b _081693AA @@ -31160,7 +31160,7 @@ _08169164: _081691B4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x27 b _081693A2 @@ -31168,7 +31168,7 @@ _081691B4: _081691C4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x28 b _081693A2 @@ -31176,7 +31176,7 @@ _081691C4: _081691D4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x29 b _081693A2 @@ -31184,7 +31184,7 @@ _081691D4: _081691E4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2A b _081693A2 @@ -31192,7 +31192,7 @@ _081691E4: _081691F4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2B b _081693A2 @@ -31200,7 +31200,7 @@ _081691F4: _08169204: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2C b _081693A2 @@ -31208,7 +31208,7 @@ _08169204: _08169214: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0 b _0816923E @@ -31216,7 +31216,7 @@ _08169214: _08169224: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x9 b _081692E2 @@ -31224,11 +31224,11 @@ _08169224: _08169234: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x37 _0816923E: - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 strb r1, [r7] movs r0, 0xFF @@ -31249,7 +31249,7 @@ _0816923E: _08169268: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x38 b _081693A2 @@ -31257,7 +31257,7 @@ _08169268: _08169278: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x39 b _081692E2 @@ -31265,7 +31265,7 @@ _08169278: _08169288: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3A b _081692E2 @@ -31273,7 +31273,7 @@ _08169288: _08169298: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3B b _081692E2 @@ -31281,7 +31281,7 @@ _08169298: _081692A8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3C b _081692E2 @@ -31289,7 +31289,7 @@ _081692A8: _081692B8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3D b _081692E2 @@ -31297,7 +31297,7 @@ _081692B8: _081692C8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3E b _081692E2 @@ -31305,11 +31305,11 @@ _081692C8: _081692D8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3F _081692E2: - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 strb r0, [r7] @@ -31321,7 +31321,7 @@ _081692E2: _081692F8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x16 b _081693A2 @@ -31329,7 +31329,7 @@ _081692F8: _08169308: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x17 b _081693A2 @@ -31337,7 +31337,7 @@ _08169308: _08169318: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x18 b _081693A2 @@ -31345,7 +31345,7 @@ _08169318: _08169328: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x21 b _081693A2 @@ -31353,7 +31353,7 @@ _08169328: _08169338: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2F b _081693A2 @@ -31361,7 +31361,7 @@ _08169338: _08169348: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x30 b _081693A2 @@ -31369,7 +31369,7 @@ _08169348: _08169358: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x32 b _081693A2 @@ -31377,7 +31377,7 @@ _08169358: _08169368: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x33 b _081693A2 @@ -31385,7 +31385,7 @@ _08169368: _08169378: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x34 b _081693A2 @@ -31393,7 +31393,7 @@ _08169378: _08169388: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x35 b _081693A2 @@ -31401,11 +31401,11 @@ _08169388: _08169398: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x36 _081693A2: - bl pokemon_getattr + bl GetMonData strb r0, [r7] movs r6, 0x1 _081693AA: @@ -31568,7 +31568,7 @@ _08169558: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0xB @@ -31635,7 +31635,7 @@ _081695BE: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x15 @@ -31748,7 +31748,7 @@ _081695BE: _081696F0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -31761,7 +31761,7 @@ _081696F0: _08169710: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -31780,7 +31780,7 @@ _08169730: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r7, r1, r0 adds r6, r3, 0 adds r6, 0x8 @@ -31805,7 +31805,7 @@ _0816974A: ble _0816974A movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x15 mov r2, r9 @@ -31815,7 +31815,7 @@ _0816974A: _08169788: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r3, =gUnknown_02023064 ldr r1, =gUnknown_02024064 @@ -31831,7 +31831,7 @@ _081697B0: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 ldr r5, =gUnknown_02024064 ldrb r2, [r5] @@ -31873,7 +31873,7 @@ _081697B0: _08169814: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r3, =gUnknown_02023064 ldr r1, =gUnknown_02024064 @@ -31892,7 +31892,7 @@ _0816982C: _08169844: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -31905,7 +31905,7 @@ _08169844: _08169864: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -31918,7 +31918,7 @@ _08169864: _08169884: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -31931,7 +31931,7 @@ _08169884: _081698A4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -31944,7 +31944,7 @@ _081698A4: _081698C4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -31957,7 +31957,7 @@ _081698C4: _081698E4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -31970,7 +31970,7 @@ _081698E4: _08169904: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -31983,7 +31983,7 @@ _08169904: _08169924: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -31996,7 +31996,7 @@ _08169924: _08169944: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32009,7 +32009,7 @@ _08169944: _08169964: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32022,7 +32022,7 @@ _08169964: _08169984: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32035,7 +32035,7 @@ _08169984: _081699A4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32048,7 +32048,7 @@ _081699A4: _081699C4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32061,7 +32061,7 @@ _081699C4: _081699E4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32075,7 +32075,7 @@ _08169A04: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 ldr r5, =gUnknown_02024064 ldrb r2, [r5] @@ -32122,7 +32122,7 @@ _08169A04: _08169A74: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32135,7 +32135,7 @@ _08169A74: _08169A94: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32148,7 +32148,7 @@ _08169A94: _08169AB4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32161,7 +32161,7 @@ _08169AB4: _08169AD4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32174,7 +32174,7 @@ _08169AD4: _08169AF4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32187,7 +32187,7 @@ _08169AF4: _08169B14: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32201,7 +32201,7 @@ _08169B24: _08169B34: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32214,7 +32214,7 @@ _08169B34: _08169B54: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32227,7 +32227,7 @@ _08169B54: _08169B74: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32240,7 +32240,7 @@ _08169B74: _08169B94: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32253,7 +32253,7 @@ _08169B94: _08169BB4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32266,7 +32266,7 @@ _08169BB4: _08169BD4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32279,7 +32279,7 @@ _08169BD4: _08169BF4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32292,7 +32292,7 @@ _08169BF4: _08169C14: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32305,7 +32305,7 @@ _08169C14: _08169C34: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32318,7 +32318,7 @@ _08169C34: _08169C54: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32331,7 +32331,7 @@ _08169C54: _08169C74: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32344,7 +32344,7 @@ _08169C74: _08169C94: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32357,7 +32357,7 @@ _08169C94: _08169CB4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32370,7 +32370,7 @@ _08169CB4: _08169CD4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32383,7 +32383,7 @@ _08169CD4: _08169CF4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32396,7 +32396,7 @@ _08169CF4: _08169D14: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32409,7 +32409,7 @@ _08169D14: _08169D34: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32422,7 +32422,7 @@ _08169D34: _08169D54: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32435,7 +32435,7 @@ _08169D54: _08169D74: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32448,7 +32448,7 @@ _08169D74: _08169D94: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32461,7 +32461,7 @@ _08169D94: _08169DB4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32474,7 +32474,7 @@ _08169DB4: _08169DD4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -32491,7 +32491,7 @@ _08169DEA: ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 bl sub_805E990 add sp, 0x34 @@ -33421,10 +33421,10 @@ sub_816A5D4: @ 816A5D4 ldrh r0, [r0] movs r5, 0x64 muls r0, r5 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData mov r8, r0 mov r1, r9 ldrb r0, [r1] @@ -33434,7 +33434,7 @@ sub_816A5D4: @ 816A5D4 muls r0, r5 adds r0, r4 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r3, r0, 0 mov r1, r9 ldrb r0, [r1] @@ -33453,10 +33453,10 @@ _0816A664: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData adds r2, r0, 0 mov r1, r9 ldrb r0, [r1] @@ -33752,10 +33752,10 @@ sub_816A89C: @ 816A89C ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 movs r1, 0x19 @@ -33972,16 +33972,16 @@ sub_816AA80: @ 816AA80 ldrh r1, [r2] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData mov r8, r0 lsls r0, 16 lsrs r0, 16 mov r8, r0 ldr r0, =sub_805D714 - bl object_new_hidden_with_callback + bl CreateInvisibleSpriteWithCallback ldr r1, =gUnknown_03005D7C mov r9, r1 add r9, r6 @@ -34319,7 +34319,7 @@ sub_816AD94: @ 816AD94 movs r0, 0x3 bl BeginFastPaletteFade bl dp01_tbl5_exec_completed - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x6 ands r0, r1 diff --git a/asm/rom_816F318.s b/asm/rom_816F318.s deleted file mode 100644 index eac830ae7..000000000 --- a/asm/rom_816F318.s +++ /dev/null @@ -1,15475 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_816F318 -sub_816F318: @ 816F318 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0xBF - ble _0816F394 - ldrh r1, [r4, 0x34] - movs r2, 0x34 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _0816F336 - subs r0, r1, 0x1 - strh r0, [r4, 0x34] - b _0816F39A -_0816F336: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x30] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x32] - str r1, [sp] - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - movs r0, 0x32 - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 5 - subs r0, r1 - movs r1, 0x64 - bl __divsi3 - strh r0, [r4, 0x32] - movs r2, 0x32 - ldrsh r1, [r4, r2] - adds r0, r1, 0 - subs r0, 0xC0 - cmp r0, 0 - bge _0816F378 - adds r0, 0x7F -_0816F378: - asrs r0, 7 - adds r0, 0x9 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xF - bls _0816F386 - movs r0, 0xF -_0816F386: - lsls r2, r0, 4 - ldrb r1, [r4, 0x5] - movs r0, 0xF - ands r0, r1 - orrs r0, r2 - strb r0, [r4, 0x5] - b _0816F39A -_0816F394: - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_0816F39A: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_816F318 - - thumb_func_start sub_816F3A4 -sub_816F3A4: @ 816F3A4 - push {r4,lr} - adds r4, r0, 0 - ldr r2, =gUnknown_02020630 - movs r1, 0x3C - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r3, 0x3C - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _0816F420 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r3, [r4, 0x22] - adds r0, r3 - strh r0, [r4, 0x22] - adds r0, r4, 0 - movs r1, 0x3 - bl StartObjectImageAnim - movs r0, 0x80 - lsls r0, 3 - strh r0, [r4, 0x32] - ldrh r1, [r4, 0x30] - movs r0, 0x3 - ands r0, r1 - lsls r0, 3 - strh r0, [r4, 0x34] - ldr r0, =sub_816F318 - str r0, [r4, 0x1C] - ldrb r1, [r4, 0x1] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x40 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrb r0, [r4, 0x3] - movs r1, 0xC0 - orrs r0, r1 - strb r0, [r4, 0x3] - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0x3 - movs r3, 0x2 - bl CalcVecFromObjectCenterToObjectUpperLeft - b _0816F44C - .pool -_0816F420: - ldrh r0, [r1, 0x24] - strh r0, [r4, 0x24] - movs r0, 0x3C - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x26] - strh r0, [r4, 0x26] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x20] - strh r0, [r4, 0x20] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x22] - strh r0, [r4, 0x22] -_0816F44C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_816F3A4 - - thumb_func_start sub_816F454 -sub_816F454: @ 816F454 - push {lr} - adds r1, r0, 0 - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _0816F464 - ldr r0, =sub_816F46C - str r0, [r1, 0x1C] -_0816F464: - pop {r0} - bx r0 - .pool - thumb_func_end sub_816F454 - - thumb_func_start sub_816F46C -sub_816F46C: @ 816F46C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r7, r0, 0 - ldrh r4, [r7, 0x20] - movs r1, 0x20 - ldrsh r0, [r7, r1] - cmp r0, 0x74 - bgt _0816F4AC - ldrh r0, [r7, 0x26] - ldrh r1, [r7, 0x22] - adds r0, r1 - movs r1, 0 - strh r0, [r7, 0x22] - strh r1, [r7, 0x26] - adds r0, r4, 0x4 - strh r0, [r7, 0x20] - ldr r0, =0x0000fffc - strh r0, [r7, 0x24] - movs r0, 0x80 - strh r0, [r7, 0x36] - ldr r0, =sub_816F5B4 - str r0, [r7, 0x1C] - b _0816F59E - .pool -_0816F4AC: - ldrh r1, [r7, 0x36] - ldr r5, =gUnknown_08329F40 - lsls r0, r1, 24 - lsrs r0, 23 - adds r0, r5 - ldrh r2, [r0] - adds r0, r1, 0 - adds r0, 0x40 - lsls r0, 24 - lsrs r0, 23 - adds r0, r5 - ldrh r3, [r0] - adds r1, 0x2 - strh r1, [r7, 0x36] - lsls r2, 16 - asrs r0, r2, 16 - cmp r0, 0 - bge _0816F4D2 - adds r0, 0x1F -_0816F4D2: - asrs r0, 5 - strh r0, [r7, 0x26] - subs r0, r4, 0x1 - strh r0, [r7, 0x20] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0816F4E8 - ldrh r0, [r7, 0x22] - adds r0, 0x1 - strh r0, [r7, 0x22] -_0816F4E8: - lsls r0, r3, 16 - asrs r0, 16 - negs r0, r0 - cmp r0, 0 - bge _0816F4F4 - adds r0, 0xF -_0816F4F4: - lsls r1, r0, 12 - lsrs r1, 16 - ldrh r4, [r7, 0x32] - ldrh r3, [r7, 0x34] - adds r0, r1, 0 - subs r0, 0x10 - lsls r0, 24 - lsrs r0, 23 - adds r0, r5 - ldrh r2, [r0] - adds r1, 0x30 - lsls r1, 24 - lsrs r1, 23 - adds r1, r5 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r1, 0 - muls r0, r4 - cmp r0, 0 - bge _0816F51E - adds r0, 0xFF -_0816F51E: - lsls r0, 8 - lsrs r0, 16 - mov r8, r0 - lsls r0, r2, 16 - asrs r2, r0, 16 - negs r0, r2 - muls r0, r3 - cmp r0, 0 - bge _0816F532 - adds r0, 0xFF -_0816F532: - lsls r0, 8 - lsrs r0, 16 - mov r10, r0 - adds r0, r2, 0 - muls r0, r4 - cmp r0, 0 - bge _0816F542 - adds r0, 0xFF -_0816F542: - lsls r0, 8 - lsrs r5, r0, 16 - adds r0, r1, 0 - muls r0, r3 - cmp r0, 0 - bge _0816F550 - adds r0, 0xFF -_0816F550: - lsls r6, r0, 8 - lsrs r6, 16 - ldrh r0, [r7, 0x30] - lsls r0, 24 - lsrs r0, 24 - str r3, [sp] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - ldrh r0, [r7, 0x30] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r5 - mov r1, r10 - lsls r5, r1, 16 - lsrs r3, r5, 16 - lsls r4, r6, 16 - str r6, [sp] - mov r1, r8 - mov r2, r9 - bl SetSpriteTransformationMatrix - ldrh r0, [r7, 0x30] - adds r0, 0x2 - lsls r0, 24 - lsrs r0, 24 - lsls r5, 1 - lsrs r5, 16 - lsls r4, 1 - lsrs r4, 16 - str r4, [sp] - mov r1, r8 - mov r2, r9 - adds r3, r5, 0 - bl SetSpriteTransformationMatrix -_0816F59E: - 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_816F46C - - thumb_func_start sub_816F5B4 -sub_816F5B4: @ 816F5B4 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x3A] - adds r1, 0x40 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - ldrh r0, [r4, 0x30] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x3A] - adds r1, 0x40 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - ldrh r0, [r4, 0x30] - adds r0, 0x2 - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x3A] - adds r1, 0x40 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - ldrh r1, [r4, 0x36] - movs r2, 0x36 - ldrsh r0, [r4, r2] - cmp r0, 0x40 - beq _0816F64C - adds r0, r1, 0 - subs r0, 0x8 - strh r0, [r4, 0x36] - ldrh r0, [r4, 0x36] - adds r1, r0, 0 - ldr r2, =gUnknown_08329F40 - adds r0, 0x40 - lsls r0, 24 - lsrs r0, 23 - adds r0, r2 - movs r3, 0 - ldrsh r0, [r0, r3] - cmp r0, 0 - bge _0816F62E - adds r0, 0x3F -_0816F62E: - asrs r0, 6 - strh r0, [r4, 0x24] - lsls r0, r1, 24 - lsrs r0, 23 - adds r0, r2 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bge _0816F642 - adds r0, 0x3F -_0816F642: - asrs r0, 6 - strh r0, [r4, 0x26] - b _0816F654 - .pool -_0816F64C: - movs r0, 0 - strh r0, [r4, 0x36] - ldr r0, =sub_816F660 - str r0, [r4, 0x1C] -_0816F654: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816F5B4 - - thumb_func_start sub_816F660 -sub_816F660: @ 816F660 - push {r4,lr} - adds r1, r0, 0 - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0x2 - beq _0816F6C0 - ldrh r0, [r1, 0x36] - adds r0, 0x8 - strh r0, [r1, 0x36] - ldr r3, =gUnknown_08329F40 - lsls r0, 24 - lsrs r0, 23 - adds r0, r3 - movs r4, 0 - ldrsh r0, [r0, r4] - cmp r0, 0 - bge _0816F684 - adds r0, 0xF -_0816F684: - asrs r0, 4 - adds r0, 0x40 - lsls r0, 16 - lsrs r2, r0, 16 - adds r0, r2, 0 - adds r0, 0x40 - lsls r0, 24 - lsrs r0, 23 - adds r0, r3 - movs r4, 0 - ldrsh r0, [r0, r4] - cmp r0, 0 - bge _0816F6A0 - adds r0, 0x3F -_0816F6A0: - asrs r0, 6 - strh r0, [r1, 0x24] - lsls r0, r2, 24 - lsrs r0, 23 - adds r0, r3 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, 0 - bge _0816F6B4 - adds r0, 0x3F -_0816F6B4: - asrs r0, 6 - strh r0, [r1, 0x26] - b _0816F6C4 - .pool -_0816F6C0: - ldr r0, =sub_816F6D0 - str r0, [r1, 0x1C] -_0816F6C4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816F660 - - thumb_func_start sub_816F6D0 -sub_816F6D0: @ 816F6D0 - push {r4,lr} - adds r4, r0, 0 - ldrh r2, [r4, 0x22] - movs r0, 0x22 - ldrsh r1, [r4, r0] - movs r3, 0x38 - ldrsh r0, [r4, r3] - cmp r1, r0 - bge _0816F6E8 - adds r0, r2, 0x4 - strh r0, [r4, 0x22] - b _0816F744 -_0816F6E8: - movs r0, 0x1 - strh r0, [r4, 0x3C] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r3, [r4, 0x22] - adds r0, r3 - strh r0, [r4, 0x22] - adds r0, r4, 0 - movs r1, 0x3 - bl StartObjectImageAnim - movs r0, 0x80 - lsls r0, 3 - strh r0, [r4, 0x32] - ldrh r1, [r4, 0x30] - movs r0, 0x3 - ands r0, r1 - lsls r0, 3 - strh r0, [r4, 0x34] - ldr r0, =sub_816F318 - str r0, [r4, 0x1C] - ldrb r1, [r4, 0x1] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x40 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrb r0, [r4, 0x3] - movs r1, 0xC0 - orrs r0, r1 - strb r0, [r4, 0x3] - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0x3 - movs r3, 0x2 - bl CalcVecFromObjectCenterToObjectUpperLeft -_0816F744: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816F6D0 - - thumb_func_start sub_816F750 -sub_816F750: @ 816F750 - push {r4,lr} - adds r4, r0, 0 - ldrh r2, [r4, 0x22] - movs r0, 0x22 - ldrsh r1, [r4, r0] - movs r3, 0x38 - ldrsh r0, [r4, r3] - cmp r1, r0 - bge _0816F768 - adds r0, r2, 0x4 - strh r0, [r4, 0x22] - b _0816F7C4 -_0816F768: - movs r0, 0x1 - strh r0, [r4, 0x3C] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r3, [r4, 0x22] - adds r0, r3 - strh r0, [r4, 0x22] - adds r0, r4, 0 - movs r1, 0x3 - bl StartObjectImageAnim - movs r0, 0x80 - lsls r0, 3 - strh r0, [r4, 0x32] - ldrh r1, [r4, 0x30] - movs r0, 0x3 - ands r0, r1 - lsls r0, 3 - strh r0, [r4, 0x34] - ldr r0, =sub_816F318 - str r0, [r4, 0x1C] - ldrb r1, [r4, 0x1] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x40 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrb r0, [r4, 0x3] - movs r1, 0xC0 - orrs r0, r1 - strb r0, [r4, 0x3] - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0x3 - movs r3, 0x2 - bl CalcVecFromObjectCenterToObjectUpperLeft -_0816F7C4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816F750 - - thumb_func_start sub_816F7D0 -sub_816F7D0: @ 816F7D0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r6, [sp, 0x34] - ldr r0, [sp, 0x38] - mov r8, r0 - lsls r4, 16 - lsls r5, 16 - lsls r2, 16 - lsrs r2, 16 - str r2, [sp, 0x8] - lsls r3, 16 - lsrs r3, 16 - str r3, [sp, 0xC] - lsls r6, 16 - lsrs r6, 16 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - ldr r0, =gUnknown_085E4D64 - lsrs r2, r4, 16 - mov r10, r2 - asrs r4, 16 - lsrs r1, r5, 16 - str r1, [sp, 0x4] - asrs r5, 16 - adds r1, r4, 0 - adds r2, r5, 0 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - ldr r2, =gUnknown_02020630 - mov r9, r2 - lsls r0, r7, 4 - adds r0, r7 - lsls r5, r0, 2 - adds r4, r5, r2 - movs r0, 0 - strh r0, [r4, 0x2E] - strh r0, [r4, 0x3C] - mov r0, sp - ldrh r0, [r0, 0xC] - strh r0, [r4, 0x30] - mov r1, sp - ldrh r1, [r1, 0x8] - strh r1, [r4, 0x32] - mov r2, sp - ldrh r2, [r2, 0x8] - strh r2, [r4, 0x34] - strh r6, [r4, 0x38] - mov r0, sp - ldrh r0, [r0, 0x8] - strh r0, [r4, 0x3A] - ldrb r0, [r4, 0x1] - movs r1, 0x3 - orrs r0, r1 - strb r0, [r4, 0x1] - movs r0, 0x1F - ldr r1, [sp, 0xC] - ands r1, r0 - lsls r1, 1 - ldrb r2, [r4, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x3] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x2 - movs r3, 0x2 - bl CalcVecFromObjectCenterToObjectUpperLeft - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectImageAnim - mov r1, r8 - cmp r1, 0 - bne _0816F898 - mov r0, r9 - adds r0, 0x1C - adds r0, r5, r0 - ldr r1, =sub_816F454 - b _0816F8A0 - .pool -_0816F898: - mov r0, r9 - adds r0, 0x1C - adds r0, r5, r0 - ldr r1, =sub_816F750 -_0816F8A0: - str r1, [r0] - str r7, [sp, 0x10] - mov r2, r10 - lsls r2, 16 - asrs r2, 16 - mov r10, r2 - ldr r0, [sp, 0x4] - lsls r0, 16 - asrs r0, 16 - mov r8, r0 - ldr r0, =gUnknown_085E4D64 - mov r1, r10 - mov r2, r8 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - ldr r5, =gUnknown_02020630 - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - adds r0, r4, r5 - mov r1, sp - ldrh r1, [r1, 0x10] - strh r1, [r0, 0x3C] - ldr r2, [sp, 0xC] - adds r2, 0x1 - mov r9, r2 - strh r2, [r0, 0x30] - ldrb r1, [r0, 0x1] - movs r2, 0x3 - orrs r1, r2 - strb r1, [r0, 0x1] - mov r2, r9 - movs r1, 0x1F - ands r2, r1 - lsls r2, 1 - ldrb r3, [r0, 0x3] - movs r6, 0x3F - negs r6, r6 - adds r1, r6, 0 - ands r1, r3 - orrs r1, r2 - strb r1, [r0, 0x3] - movs r1, 0 - movs r2, 0x2 - movs r3, 0x2 - bl CalcVecFromObjectCenterToObjectUpperLeft - ldr r2, =gUnknown_0202064C - adds r4, r2 - ldr r0, =sub_816F3A4 - str r0, [r4] - ldr r0, =gUnknown_085E4D64 - mov r1, r10 - mov r2, r8 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - adds r5, r4, r5 - mov r1, sp - ldrh r1, [r1, 0x10] - strh r1, [r5, 0x3C] - ldr r2, [sp, 0xC] - adds r2, 0x2 - mov r8, r2 - strh r2, [r5, 0x30] - adds r0, r5, 0 - movs r1, 0x1 - bl StartObjectImageAnim - ldrb r0, [r5, 0x1] - movs r1, 0x3 - orrs r0, r1 - strb r0, [r5, 0x1] - mov r0, r8 - movs r2, 0x1F - ands r0, r2 - lsls r0, 1 - ldrb r1, [r5, 0x3] - ands r6, r1 - orrs r6, r0 - strb r6, [r5, 0x3] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0x2 - movs r3, 0x2 - bl CalcVecFromObjectCenterToObjectUpperLeft - ldr r0, =gUnknown_0202064C - adds r4, r0 - ldr r1, =sub_816F3A4 - str r1, [r4] - ldr r2, [sp, 0xC] - lsls r0, r2, 24 - lsrs r0, 24 - ldr r5, [sp, 0x8] - adds r5, 0x20 - lsls r4, r5, 16 - lsrs r4, 16 - str r4, [sp] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - str r4, [sp] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r5, 17 - lsrs r5, 16 - str r5, [sp] - mov r0, r8 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - ldr r0, [sp, 0x10] - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_816F7D0 - - thumb_func_start sub_816F9D4 -sub_816F9D4: @ 816F9D4 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bhi _0816FA62 - lsls r0, 2 - ldr r1, =_0816F9F0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0816F9F0: - .4byte _0816FA04 - .4byte _0816FA12 - .4byte _0816FA30 - .4byte _0816FA62 - .4byte _0816FA50 -_0816FA04: - adds r0, r4, 0 - movs r1, 0 - bl StartObjectImageAnimIfDifferent - ldrh r0, [r4, 0x20] - subs r0, 0x1 - b _0816FA60 -_0816FA12: - adds r0, r4, 0 - movs r1, 0 - bl StartObjectImageAnimIfDifferent - ldr r0, =gUnknown_030062A0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0816FAAA - ldrh r0, [r4, 0x20] - adds r0, 0x1 - b _0816FA60 - .pool -_0816FA30: - ldrh r2, [r4, 0x20] - movs r1, 0x20 - ldrsh r0, [r4, r1] - cmp r0, 0x78 - ble _0816FA46 - ldr r0, =gUnknown_030062A0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _0816FA6E -_0816FA46: - adds r0, r2, 0x1 - b _0816FA60 - .pool -_0816FA50: - ldrh r2, [r4, 0x20] - movs r0, 0x20 - ldrsh r1, [r4, r0] - movs r0, 0x20 - negs r0, r0 - cmp r1, r0 - ble _0816FA62 - subs r0, r2, 0x2 -_0816FA60: - strh r0, [r4, 0x20] -_0816FA62: - ldr r0, =gUnknown_030062A0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0816FAAA -_0816FA6E: - movs r1, 0x26 - ldrsh r5, [r4, r1] - cmp r5, 0 - beq _0816FA80 - movs r0, 0 - strh r0, [r4, 0x26] - b _0816FAAA - .pool -_0816FA80: - bl GenerateRandomNumber - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x1 - beq _0816FAA8 - cmp r1, 0x1 - bgt _0816FA96 - cmp r1, 0 - beq _0816FA9E - b _0816FAAA -_0816FA96: - cmp r1, 0x3 - bgt _0816FAAA - strh r5, [r4, 0x26] - b _0816FAAA -_0816FA9E: - ldr r0, =0x0000ffff - strh r0, [r4, 0x26] - b _0816FAAA - .pool -_0816FAA8: - strh r1, [r4, 0x26] -_0816FAAA: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_816F9D4 - - thumb_func_start sub_816FAB0 -sub_816FAB0: @ 816FAB0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0816FACA - cmp r0, 0x1 - ble _0816FB12 - cmp r0, 0x2 - beq _0816FAEA - cmp r0, 0x3 - beq _0816FB04 - b _0816FB12 -_0816FACA: - movs r2, 0x24 - ldrsh r0, [r4, r2] - movs r2, 0x20 - ldrsh r1, [r4, r2] - adds r0, r1 - ldr r1, =0x0000012f - cmp r0, r1 - bgt _0816FAE4 - ldrh r0, [r4, 0x24] - adds r0, 0x8 - b _0816FB10 - .pool -_0816FAE4: - movs r0, 0x2 - strh r0, [r4, 0x2E] - b _0816FB12 -_0816FAEA: - movs r1, 0x24 - ldrsh r0, [r4, r1] - movs r2, 0x20 - ldrsh r1, [r4, r2] - adds r0, r1 - cmp r0, 0x78 - ble _0816FAFE - ldrh r0, [r4, 0x24] - subs r0, 0x1 - b _0816FB10 -_0816FAFE: - movs r0, 0x3 - strh r0, [r4, 0x2E] - b _0816FB12 -_0816FB04: - ldrh r1, [r4, 0x24] - movs r2, 0x24 - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _0816FB12 - subs r0, r1, 0x2 -_0816FB10: - strh r0, [r4, 0x24] -_0816FB12: - ldrh r0, [r4, 0x30] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x8 - bl sine - ldr r1, =gUnknown_0203BCCC - ldrh r1, [r1] - subs r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0x4 - strh r0, [r4, 0x30] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816FAB0 - - thumb_func_start sub_816FB38 -sub_816FB38: @ 816FB38 - push {r4-r6,lr} - adds r6, r0, 0 - movs r1, 0x2E - ldrsh r0, [r6, r1] - cmp r0, 0x5 - bls _0816FB46 - b _0816FD38 -_0816FB46: - lsls r0, 2 - ldr r1, =_0816FB54 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0816FB54: - .4byte _0816FB6C - .4byte _0816FB94 - .4byte _0816FBB4 - .4byte _0816FC5C - .4byte _0816FCC4 - .4byte _0816FCF4 -_0816FB6C: - ldrh r1, [r6, 0x30] - movs r2, 0x30 - ldrsh r0, [r6, r2] - cmp r0, 0 - beq _0816FB7C - subs r0, r1, 0x1 - strh r0, [r6, 0x30] - b _0816FD38 -_0816FB7C: - adds r2, r6, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x5 - negs r1, r1 - ands r1, r0 - strb r1, [r2] - adds r0, r6, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - b _0816FCE6 -_0816FB94: - ldr r0, =gUnknown_030062A0 - ldr r0, [r0] - cmp r0, 0x90 - beq _0816FB9E - b _0816FD38 -_0816FB9E: - ldrh r0, [r6, 0x2E] - adds r0, 0x1 - strh r0, [r6, 0x2E] - movs r0, 0x9 - strh r0, [r6, 0x30] - movs r0, 0x2 - strh r0, [r6, 0x34] - b _0816FD38 - .pool -_0816FBB4: - ldrh r1, [r6, 0x34] - movs r2, 0x34 - ldrsh r0, [r6, r2] - cmp r0, 0 - bne _0816FC66 - movs r0, 0x2 - strh r0, [r6, 0x34] - movs r1, 0x30 - ldrsh r0, [r6, r1] - cmp r0, 0 - beq _0816FC14 - lsls r0, 1 - ldr r4, =gUnknown_08D85C50 - adds r0, r4 - ldr r5, =gPlttBufferFaded + 0x23E - adds r1, r5, 0 - movs r2, 0x1 - bl CpuSet - movs r1, 0x30 - ldrsh r0, [r6, r1] - lsls r0, 1 - adds r1, r4, 0 - adds r1, 0x20 - adds r0, r1 - adds r1, r5, 0 - subs r1, 0x16 - movs r2, 0x1 - bl CpuSet - movs r2, 0x30 - ldrsh r0, [r6, r2] - lsls r0, 1 - adds r4, 0x40 - adds r0, r4 - subs r5, 0xA - adds r1, r5, 0 - movs r2, 0x1 - bl CpuSet - ldrh r0, [r6, 0x30] - subs r0, 0x1 - strh r0, [r6, 0x30] - b _0816FD38 - .pool -_0816FC14: - movs r1, 0x30 - ldrsh r0, [r6, r1] - lsls r0, 1 - ldr r4, =gUnknown_08D85C50 - adds r0, r4 - ldr r5, =gPlttBufferFaded + 0x23E - adds r1, r5, 0 - movs r2, 0x1 - bl CpuSet - movs r2, 0x30 - ldrsh r0, [r6, r2] - lsls r0, 1 - adds r1, r4, 0 - adds r1, 0x20 - adds r0, r1 - adds r1, r5, 0 - subs r1, 0x16 - movs r2, 0x1 - bl CpuSet - movs r1, 0x30 - ldrsh r0, [r6, r1] - lsls r0, 1 - adds r4, 0x40 - adds r0, r4 - subs r5, 0xA - adds r1, r5, 0 - movs r2, 0x1 - bl CpuSet - b _0816FCE6 - .pool -_0816FC5C: - ldrh r1, [r6, 0x34] - movs r2, 0x34 - ldrsh r0, [r6, r2] - cmp r0, 0 - beq _0816FC6C -_0816FC66: - subs r0, r1, 0x1 - strh r0, [r6, 0x34] - b _0816FD38 -_0816FC6C: - movs r0, 0x2 - strh r0, [r6, 0x34] - movs r1, 0x30 - ldrsh r0, [r6, r1] - cmp r0, 0x9 - bgt _0816FCE6 - lsls r0, 1 - ldr r4, =gUnknown_08D85C50 - adds r0, r4 - ldr r5, =gPlttBufferFaded + 0x23E - adds r1, r5, 0 - movs r2, 0x1 - bl CpuSet - movs r1, 0x30 - ldrsh r0, [r6, r1] - lsls r0, 1 - adds r1, r4, 0 - adds r1, 0x20 - adds r0, r1 - adds r1, r5, 0 - subs r1, 0x16 - movs r2, 0x1 - bl CpuSet - movs r2, 0x30 - ldrsh r0, [r6, r2] - lsls r0, 1 - adds r4, 0x40 - adds r0, r4 - subs r5, 0xA - adds r1, r5, 0 - movs r2, 0x1 - bl CpuSet - ldrh r0, [r6, 0x30] - adds r0, 0x1 - strh r0, [r6, 0x30] - b _0816FD38 - .pool -_0816FCC4: - ldr r0, =gUnknown_030062A0 - ldr r1, [r0] - movs r0, 0x88 - lsls r0, 1 - cmp r1, r0 - bne _0816FD38 - adds r0, r6, 0 - movs r1, 0x2 - bl StartObjectRotScalAnim - ldrb r1, [r6, 0x1] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r6, 0x1] -_0816FCE6: - ldrh r0, [r6, 0x2E] - adds r0, 0x1 - strh r0, [r6, 0x2E] - b _0816FD38 - .pool -_0816FCF4: - ldr r1, =gUnknown_085E4F48 - movs r2, 0x32 - ldrsh r0, [r6, r2] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - ldrh r1, [r6, 0x34] - adds r0, r1 - strh r0, [r6, 0x34] - movs r2, 0x34 - ldrsh r0, [r6, r2] - movs r1, 0xFF - lsls r1, 8 - ands r0, r1 - asrs r0, 8 - strh r0, [r6, 0x24] - movs r1, 0x32 - ldrsh r0, [r6, r1] - cmp r0, 0x3 - bgt _0816FD24 - movs r2, 0x24 - ldrsh r0, [r6, r2] - negs r0, r0 - strh r0, [r6, 0x24] -_0816FD24: - adds r0, r6, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0816FD38 - adds r0, r6, 0 - bl RemoveObjectAndFreeTiles -_0816FD38: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816FB38 - - thumb_func_start sub_816FD44 -sub_816FD44: @ 816FD44 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0816FD7C - cmp r0, 0x1 - bgt _0816FD5A - cmp r0, 0 - beq _0816FD60 - b _0816FDB0 -_0816FD5A: - cmp r0, 0x2 - beq _0816FD9C - b _0816FDB0 -_0816FD60: - ldr r0, =gUnknown_030062A0 - ldr r0, [r0] - cmp r0, 0x80 - bne _0816FDB0 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x5 - negs r1, r1 - ands r1, r0 - strb r1, [r2] - b _0816FD90 - .pool -_0816FD7C: - ldr r0, =gUnknown_030062A0 - ldr r1, [r0] - movs r0, 0x88 - lsls r0, 1 - cmp r1, r0 - bne _0816FDB0 - adds r0, r4, 0 - movs r1, 0x3 - bl StartObjectRotScalAnim -_0816FD90: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0816FDB0 - .pool -_0816FD9C: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0816FDB0 - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_0816FDB0: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_816FD44 - - thumb_func_start sub_816FDB8 -sub_816FDB8: @ 816FDB8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 16 - lsrs r0, 16 - str r0, [sp] - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0x4] - movs r7, 0 -_0816FDD2: - lsls r5, r7, 2 - ldr r0, =gUnknown_085E4E94 - adds r0, 0x2 - adds r0, r5, r0 - ldr r2, [sp] - lsls r1, r2, 16 - asrs r1, 16 - ldrh r0, [r0] - adds r1, r0 - lsls r1, 16 - asrs r1, 16 - ldr r3, [sp, 0x4] - lsls r2, r3, 16 - asrs r0, r2, 16 - str r0, [sp, 0x8] - ldr r3, =0xfffc0000 - adds r2, r3 - ldr r0, =gUnknown_085E4F5C - asrs r2, 16 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - lsls r4, r6, 4 - adds r4, r6 - lsls r4, 2 - ldr r0, =gUnknown_02020630 - adds r4, r0 - movs r1, 0 - strh r1, [r4, 0x2E] - ldr r0, =gUnknown_085E4FA4 - adds r0, r7, r0 - ldrb r0, [r0] - strh r0, [r4, 0x30] - strh r7, [r4, 0x32] - adds r1, r4, 0 - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - mov r10, r2 - mov r3, r10 - orrs r0, r3 - strb r0, [r1] - adds r1, r7, 0 - adds r1, 0xC - movs r0, 0x1F - mov r9, r0 - mov r2, r9 - ands r1, r2 - lsls r1, 1 - ldrb r0, [r4, 0x3] - movs r3, 0x3F - negs r3, r3 - mov r8, r3 - mov r2, r8 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x3] - ldr r3, =gUnknown_085E4E94 - adds r5, r3 - ldrb r1, [r5] - adds r0, r4, 0 - bl StartObjectImageAnim - adds r0, r4, 0 - movs r1, 0 - bl StartObjectRotScalAnim - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, 0x8 - bls _0816FDD2 - ldr r0, =gUnknown_085E4F8C - ldr r2, [sp, 0x8] - subs r2, 0x6 - lsls r2, 16 - asrs r2, 16 - movs r1, 0x78 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - ldr r1, =gUnknown_02020630 - adds r0, r1 - movs r2, 0 - strh r2, [r0, 0x2E] - adds r2, r0, 0 - adds r2, 0x3E - ldrb r1, [r2] - mov r3, r10 - orrs r1, r3 - strb r1, [r2] - adds r2, r7, 0 - adds r2, 0xC - mov r1, r9 - ands r2, r1 - lsls r2, 1 - ldrb r1, [r0, 0x3] - mov r3, r8 - ands r1, r3 - orrs r1, r2 - strb r1, [r0, 0x3] - movs r1, 0x1 - bl StartObjectRotScalAnim - 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_816FDB8 - - thumb_func_start sub_816FEDC -sub_816FEDC: @ 816FEDC - push {r4-r6,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0816FF48 - ldr r2, =gUnknown_08329F40 - ldrh r1, [r4, 0x32] - lsls r0, r1, 24 - lsrs r0, 23 - adds r0, r2 - ldrh r3, [r0] - adds r1, 0x40 - lsls r1, 24 - lsrs r1, 23 - adds r1, r2 - movs r2, 0 - ldrsh r0, [r1, r2] - movs r1, 0x30 - ldrsh r2, [r4, r1] - adds r1, r0, 0 - muls r1, r2 - adds r0, r1, 0 - cmp r1, 0 - bge _0816FF18 - adds r0, 0xFF -_0816FF18: - lsls r0, 8 - lsrs r6, r0, 16 - lsls r0, r3, 16 - asrs r3, r0, 16 - negs r0, r3 - muls r0, r2 - cmp r0, 0 - bge _0816FF2A - adds r0, 0xFF -_0816FF2A: - lsls r0, 8 - lsrs r5, r0, 16 - adds r0, r3, 0 - muls r0, r2 - cmp r0, 0 - bge _0816FF38 - adds r0, 0xFF -_0816FF38: - lsls r0, 8 - lsrs r2, r0, 16 - adds r1, r6, 0 - adds r3, r5, 0 - str r1, [sp] - movs r0, 0x1 - bl SetSpriteTransformationMatrix -_0816FF48: - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0x1 - beq _0816FF9C - cmp r0, 0x1 - ble _0816FF58 - cmp r0, 0x2 - beq _0816FFFE -_0816FF58: - ldrb r0, [r4, 0x1] - movs r1, 0x3 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrb r1, [r4, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4, 0x3] - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0x3 - movs r3, 0x3 - bl CalcVecFromObjectCenterToObjectUpperLeft - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - movs r1, 0 - movs r0, 0x1 - strh r0, [r4, 0x2E] - movs r0, 0x80 - strh r0, [r4, 0x30] - strh r1, [r4, 0x32] - strh r1, [r4, 0x34] - b _08170038 - .pool -_0816FF9C: - ldrh r0, [r4, 0x34] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x8C - bl sine - negs r0, r0 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x34] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x78 - bl sine - negs r0, r0 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0x7 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x34] - adds r0, 0x3 - strh r0, [r4, 0x34] - movs r1, 0x20 - ldrsh r0, [r4, r1] - movs r2, 0x24 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - bgt _08170038 - ldrb r0, [r4, 0x5] - movs r1, 0xC - orrs r0, r1 - strb r0, [r4, 0x5] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r0, 0x14 - strh r0, [r4, 0x20] - movs r0, 0x28 - strh r0, [r4, 0x22] - movs r0, 0x80 - lsls r0, 2 - strh r0, [r4, 0x30] - movs r0, 0 - strh r0, [r4, 0x32] - movs r0, 0x10 - b _08170036 -_0816FFFE: - ldrh r0, [r4, 0x34] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x22 - bl sine - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x34] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3C - bl cosine - negs r0, r0 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0x2 - strh r0, [r4, 0x30] - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r1, 0x5 - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - bne _08170038 - ldrh r0, [r4, 0x34] - adds r0, 0x1 -_08170036: - strh r0, [r4, 0x34] -_08170038: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_816FEDC - - thumb_func_start sub_8170040 -sub_8170040: @ 8170040 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _08170056 - adds r4, r5, 0 - adds r4, 0x3E - cmp r0, 0x1 - beq _0817008E -_08170056: - adds r4, r5, 0 - adds r4, 0x3E - ldrb r1, [r4] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r4] - ldrb r0, [r5, 0x1] - movs r1, 0x3 - orrs r0, r1 - strb r0, [r5, 0x1] - ldrb r1, [r5, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - movs r1, 0x24 - orrs r0, r1 - strb r0, [r5, 0x3] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0x3 - movs r3, 0x3 - bl CalcVecFromObjectCenterToObjectUpperLeft - movs r0, 0 - strh r0, [r5, 0x30] - movs r0, 0x1 - strh r0, [r5, 0x2E] -_0817008E: - ldrh r0, [r5, 0x3C] - adds r0, 0x1 - strh r0, [r5, 0x3C] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081700A6 - ldrb r0, [r4] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4] - b _081700BE -_081700A6: - ldrb r0, [r4] - movs r1, 0x5 - negs r1, r1 - ands r1, r0 - strb r1, [r4] - ldrh r1, [r5, 0x30] - movs r2, 0x30 - ldrsh r0, [r5, r2] - cmp r0, 0x3F - bgt _081700BE - adds r0, r1, 0x1 - strh r0, [r5, 0x30] -_081700BE: - ldr r1, =gUnknown_08329F40 - ldrh r0, [r5, 0x30] - lsls r0, 24 - lsrs r0, 23 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - subs r1, r0 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - movs r0, 0x12 - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8170040 - - thumb_func_start sub_81700F8 -sub_81700F8: @ 81700F8 - push {r4,r5,lr} - ldr r5, =0x04000208 - ldrh r4, [r5] - movs r0, 0 - strh r0, [r5] - movs r0, 0x1 - bl RegisterRamReset - movs r0, 0 - movs r1, 0x80 - bl ClearGpuRegBits - strh r4, [r5] - ldr r1, =gUnknown_030022C0 - ldr r0, =0x00000439 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - bl sub_815355C - lsls r0, 16 - lsrs r0, 16 - bl InitSaveBlockPointersWithRandomOffset - bl sub_808447C - bl sub_8152680 - movs r0, 0 - bl sub_81534D0 - ldr r0, =gUnknown_03006210 - ldrh r0, [r0] - cmp r0, 0 - beq _08170148 - cmp r0, 0x2 - bne _0817014C -_08170148: - bl init_sav2 -_0817014C: - ldr r0, =gUnknown_03005D90 - ldr r0, [r0] - ldrb r0, [r0, 0x15] - lsls r0, 31 - lsrs r0, 31 - bl SetPokemonCryStereo - ldr r0, =0x02000000 - movs r1, 0xE0 - lsls r1, 9 - bl InitHeap - ldr r0, =sub_8086230 - bl SetMainCallback2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81700F8 - - thumb_func_start sub_817018C -sub_817018C: @ 817018C - push {r4,r5,lr} - adds r5, r0, 0 - movs r0, 0 - bl SetVBlankCallback - ldr r4, =gUnknown_0203BCD0 - movs r0, 0x89 - lsls r0, 4 - bl Alloc - str r0, [r4] - ldr r1, =0x0000088c - adds r2, r0, r1 - movs r1, 0 - strh r1, [r2] - str r5, [r0] - ldr r0, =sub_81701C4 - bl SetMainCallback2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817018C - - thumb_func_start sub_81701C4 -sub_81701C4: @ 81701C4 - push {lr} - movs r0, 0 - 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, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - movs r0, 0x1C - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085E5068 - movs r0, 0x1 - movs r2, 0x2 - bl InitBgsFromTemplates - ldr r0, =gUnknown_085E5070 - bl InitWindows - bl DeactivateAllTextPrinters - movs r0, 0 - movs r1, 0x27 - movs r2, 0xD0 - bl sub_809882C - bl clear_scheduled_bg_copies_to_vram - ldr r0, =sub_8170274 - bl SetMainCallback2 - ldr r0, =sub_8170260 - bl SetVBlankCallback - pop {r0} - bx r0 - .pool - thumb_func_end sub_81701C4 - - thumb_func_start sub_8170260 -sub_8170260: @ 8170260 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - thumb_func_end sub_8170260 - - thumb_func_start sub_8170274 -sub_8170274: @ 8170274 - push {lr} - bl sub_8170290 - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl UpdatePaletteFade - bl do_scheduled_bg_tilemap_copies_to_vram - pop {r0} - bx r0 - thumb_func_end sub_8170274 - - thumb_func_start sub_8170290 -sub_8170290: @ 8170290 - push {r4,r5,lr} - sub sp, 0xC - ldr r1, =gUnknown_0203BCD0 - ldr r0, [r1] - ldr r2, =0x0000088c - adds r0, r2 - ldrh r0, [r0] - adds r4, r1, 0 - cmp r0, 0x6 - bls _081702A6 - b _08170416 -_081702A6: - lsls r0, 2 - ldr r1, =_081702BC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081702BC: - .4byte _081702D8 - .4byte _08170300 - .4byte _08170358 - .4byte _08170380 - .4byte _08170394 - .4byte _081703C0 - .4byte _081703E8 -_081702D8: - ldr r0, [r4] - adds r0, 0x8 - movs r1, 0 - bl sub_8122CDC - movs r0, 0 - movs r1, 0 - bl sub_8124288 - movs r0, 0x1 - movs r1, 0x1 - bl sub_81240D4 - ldr r1, [r4] - ldr r0, =0x0000088c - adds r1, r0 - b _081703D8 - .pool -_08170300: - movs r0, 0x1 - movs r1, 0 - movs r2, 0x27 - movs r3, 0xD - bl SetWindowBorderStyle - ldr r5, =gUnknown_085EE8F1 - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x38 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x1 - str r0, [sp] - movs r4, 0 - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - bl Print - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0 - movs r1, 0 - movs r2, 0x27 - movs r3, 0xD - bl SetWindowBorderStyle - bl sub_8170428 - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - b _081703CC - .pool -_08170358: - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuRegBits - movs r0, 0 - bl ShowBg - movs r0, 0x2 - bl ShowBg - ldr r0, =gUnknown_0203BCD0 - ldr r1, [r0] - ldr r0, =0x0000088c - adds r1, r0 - b _081703D8 - .pool -_08170380: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08170416 - ldr r1, [r4] - b _081703D4 - .pool -_08170394: - bl sub_81230AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _081703A6 - bl sub_8170428 - b _08170416 -_081703A6: - cmp r0, 0x3 - blt _08170416 - cmp r0, 0x5 - bgt _08170416 - ldr r0, =gUnknown_0203BCD0 - ldr r1, [r0] - ldr r0, =0x0000088c - adds r1, r0 - b _081703D8 - .pool -_081703C0: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 -_081703CC: - bl BeginNormalPaletteFade - ldr r0, =gUnknown_0203BCD0 - ldr r1, [r0] -_081703D4: - ldr r2, =0x0000088c - adds r1, r2 -_081703D8: - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _08170416 - .pool -_081703E8: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _08170416 - bl sub_812305C - ldr r4, =gUnknown_0203BCD0 - ldr r0, [r4] - ldr r0, [r0] - bl SetMainCallback2 - ldr r0, [r4] - cmp r0, 0 - beq _08170412 - bl Free - str r5, [r4] -_08170412: - bl FreeAllWindowBuffers -_08170416: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8170290 - - thumb_func_start sub_8170428 -sub_8170428: @ 8170428 - push {r4,lr} - sub sp, 0xC - ldr r4, =gUnknown_0203BCD0 - ldr r0, [r4] - ldrb r0, [r0, 0xA] - cmp r0, 0 - beq _08170460 - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r2, [r4] - adds r2, 0xC - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - b _08170470 - .pool -_08170460: - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram -_08170470: - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8170428 - - thumb_func_start sub_8170478 -sub_8170478: @ 8170478 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x10] - ldr r0, =gUnknown_02038436 - ldrb r4, [r0] - ldr r0, =gUnknown_02022E24 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E26 - strh r1, [r0] - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - ldr r1, =0x00003f3d - movs r0, 0x4A - bl SetGpuReg - movs r1, 0x80 - lsls r1, 8 - movs r0, 0 - bl SetGpuRegBits - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0 - bl lcd_bg_operations - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl lcd_bg_operations - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x1 - bl lcd_bg_operations - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0x1 - bl lcd_bg_operations - ldr r0, =gUnknown_03005D70 - adds r4, r0 - ldrb r0, [r4] - ldr r1, =gUnknown_02020630 - mov r9, r1 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - add r4, r9 - ldrb r7, [r4, 0x6] - ldrh r6, [r4, 0x38] - lsls r6, 24 - lsrs r6, 24 - ldr r0, =DummyObjectCallback - bl object_new_hidden_with_callback - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x14] - ldr r0, =DummyObjectCallback - bl object_new_hidden_with_callback - mov r10, r0 - mov r2, r10 - lsls r2, 24 - lsrs r2, 24 - mov r10, r2 - ldrb r1, [r4, 0x5] - movs r3, 0xD - negs r3, r3 - adds r0, r3, 0 - ands r0, r1 - movs r1, 0x4 - mov r8, r1 - mov r2, r8 - orrs r0, r2 - strb r0, [r4, 0x5] - lsls r5, r7, 4 - adds r5, r7 - lsls r5, 2 - add r5, r9 - ldrb r1, [r5, 0x5] - adds r0, r3, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r5, 0x5] - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - add r1, r9 - ldrb r2, [r1, 0x5] - adds r0, r3, 0 - ands r0, r2 - mov r2, r8 - orrs r0, r2 - strb r0, [r1, 0x5] - ldr r0, [sp, 0x14] - lsls r6, r0, 4 - adds r6, r0 - lsls r6, 2 - mov r1, r9 - adds r7, r6, r1 - adds r0, r7, 0 - adds r1, r4, 0 - movs r2, 0x44 - str r3, [sp, 0x18] - bl memcpy - mov r2, r10 - lsls r4, r2, 4 - add r4, r10 - lsls r4, 2 - adds r0, r4, 0 - add r0, r9 - mov r8, r0 - adds r1, r5, 0 - movs r2, 0x44 - bl memcpy - ldrb r1, [r7, 0x1] - ldr r3, [sp, 0x18] - adds r0, r3, 0 - ands r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r7, 0x1] - mov r2, r8 - ldrb r0, [r2, 0x1] - ands r3, r0 - orrs r3, r1 - strb r3, [r2, 0x1] - movs r0, 0x1C - add r9, r0 - add r6, r9 - ldr r1, =DummyObjectCallback - str r1, [r6] - add r4, r9 - str r1, [r4] - mov r0, sp - bl sub_80A6B30 - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_08C2EA9C - bl sub_80A6D48 - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_08C2EA50 - mov r2, sp - ldrh r2, [r2, 0xA] - bl sub_80A6CC0 - ldr r0, =gUnknown_08C2DDA4 - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 4 - movs r2, 0x20 - bl LoadCompressedPalette - ldr r1, =gUnknown_02022E18 - ldrh r0, [r7, 0x20] - negs r0, r0 - adds r0, 0x20 - strh r0, [r1] - ldr r1, =gUnknown_02022E1A - ldrh r0, [r7, 0x22] - negs r0, r0 - subs r0, 0x20 - strh r0, [r1] - ldr r1, =gTasks - ldr r2, [sp, 0x10] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - movs r1, 0xA0 - lsls r1, 2 - strh r1, [r0, 0xA] - mov r1, sp - ldrh r1, [r1, 0x14] - strh r1, [r0, 0x8] - mov r2, r10 - strh r2, [r0, 0xC] - ldr r1, =sub_8170660 - str r1, [r0] - 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_8170478 - - thumb_func_start sub_8170660 -sub_8170660: @ 8170660 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gUnknown_02038436 - ldrb r0, [r0] - mov r8, r0 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r5, r0, r1 - ldrh r1, [r5, 0xA] - ldrh r0, [r5, 0x22] - adds r1, r0 - movs r3, 0 - strh r1, [r5, 0x22] - ldr r2, =gUnknown_02022E1A - lsls r0, r1, 16 - lsrs r0, 24 - ldrh r4, [r2] - adds r0, r4 - strh r0, [r2] - movs r0, 0xFF - ands r1, r0 - strh r1, [r5, 0x22] - movs r1, 0x26 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _081706F0 - cmp r0, 0x1 - bgt _081706B4 - cmp r0, 0 - beq _081706BA - b _08170814 - .pool -_081706B4: - cmp r0, 0x2 - beq _08170708 - b _08170814 -_081706BA: - ldrh r0, [r5, 0x1E] - adds r1, r0, 0x1 - strh r1, [r5, 0x1E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bgt _081706CA - b _08170814 -_081706CA: - strh r3, [r5, 0x1E] - ldrh r1, [r5, 0x20] - adds r1, 0x1 - strh r1, [r5, 0x20] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r2, 0x20 - ldrsh r0, [r5, r2] - cmp r0, 0x8 - beq _081706EE - b _08170814 -_081706EE: - b _08170700 -_081706F0: - ldrh r0, [r5, 0x1C] - adds r0, 0x1 - strh r0, [r5, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1E - beq _08170700 - b _08170814 -_08170700: - ldrh r0, [r5, 0x26] - adds r0, 0x1 - strh r0, [r5, 0x26] - b _08170814 -_08170708: - ldrh r0, [r5, 0x1E] - adds r1, r0, 0x1 - strh r1, [r5, 0x1E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _08170814 - strh r3, [r5, 0x1E] - ldrh r1, [r5, 0x20] - subs r1, 0x1 - strh r1, [r5, 0x20] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x20 - ldrsh r4, [r5, r0] - cmp r4, 0 - bne _08170814 - movs r0, 0 - bl sub_80A477C - ldr r0, =gUnknown_02022E24 - strh r4, [r0] - ldr r0, =gUnknown_02022E26 - strh r4, [r0] - ldr r4, =0x00003f3f - movs r0, 0x48 - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x4A - adds r1, r4, 0 - bl SetGpuReg - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0817076C - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0 - bl lcd_bg_operations -_0817076C: - movs r0, 0 - bl GetGpuReg - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 8 - adds r0, r2, 0 - eors r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r4, 0x8 - ldrsh r1, [r5, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r6, =gUnknown_02020630 - adds r0, r6 - bl RemoveObjectAndFreeTiles - movs r0, 0xC - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl RemoveObjectAndFreeTiles - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - bl lcd_bg_operations - ldr r0, =gUnknown_03005D70 - add r0, r8 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r2, [r1, 0x6] - mov r8, r2 - ldrh r4, [r1, 0x38] - lsls r4, 24 - lsrs r4, 24 - ldrb r3, [r1, 0x5] - movs r2, 0xD - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - movs r5, 0x4 - orrs r0, r5 - strb r0, [r1, 0x5] - mov r0, r8 - lsls r1, r0, 4 - add r1, r8 - lsls r1, 2 - adds r1, r6 - ldrb r3, [r1, 0x5] - adds r0, r2, 0 - ands r0, r3 - orrs r0, r5 - strb r0, [r1, 0x5] - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r6 - ldrb r1, [r0, 0x5] - ands r2, r1 - orrs r2, r5 - strb r2, [r0, 0x5] - adds r0, r7, 0 - bl move_anim_task_del -_08170814: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8170660 - - thumb_func_start sub_8170834 -sub_8170834: @ 8170834 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r9, r0 - adds r7, r1, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_03005D70 - adds r2, r0 - ldrb r0, [r2] - lsls r5, r0, 4 - adds r5, r0 - lsls r5, 2 - ldr r0, =gUnknown_02020630 - adds r5, r0 - ldrb r1, [r5, 0x6] - mov r10, r1 - ldrh r4, [r5, 0x38] - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x0000d709 - bl AllocObjectPalette - mov r2, r9 - strb r0, [r2] - ldr r0, =0x0000d70a - bl AllocObjectPalette - strb r0, [r7] - ldrb r0, [r5, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r1, 0x80 - lsls r1, 1 - adds r3, r1, 0 - orrs r0, r3 - lsls r6, r4, 4 - adds r6, r4 - lsls r6, 2 - ldr r2, =gUnknown_02020630 - adds r6, r2 - ldrb r4, [r6, 0x5] - lsrs r4, 4 - lsls r4, 4 - orrs r4, r3 - lsls r0, 1 - ldr r1, =gPlttBufferUnfaded - mov r8, r1 - add r0, r8 - mov r2, r9 - ldrb r1, [r2] - lsls r1, 4 - adds r1, r3, r1 - movs r2, 0x20 - str r3, [sp] - bl LoadPalette - lsls r4, 1 - add r4, r8 - ldrb r0, [r7] - lsls r0, 4 - ldr r3, [sp] - adds r3, r0 - adds r0, r4, 0 - adds r1, r3, 0 - movs r2, 0x20 - bl LoadPalette - mov r0, r9 - ldrb r1, [r0] - lsls r1, 4 - ldrb r2, [r5, 0x5] - movs r3, 0xF - adds r0, r3, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - mov r2, r10 - lsls r1, r2, 4 - add r1, r10 - lsls r1, 2 - ldr r0, =gUnknown_02020630 - adds r1, r0 - mov r0, r9 - ldrb r2, [r0] - lsls r2, 4 - ldrb r4, [r1, 0x5] - adds r0, r3, 0 - ands r0, r4 - orrs r0, r2 - strb r0, [r1, 0x5] - ldrb r0, [r7] - lsls r0, 4 - ldrb r1, [r6, 0x5] - ands r3, r1 - orrs r3, r0 - strb r3, [r6, 0x5] - 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_8170834 - - thumb_func_start sub_8170920 -sub_8170920: @ 8170920 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - mov r1, sp - adds r1, 0x1 - ldr r0, =gUnknown_02038436 - ldrb r2, [r0] - mov r0, sp - bl sub_8170834 - adds r0, r4, 0 - bl move_anim_task_del - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8170920 - - thumb_func_start sub_817094C -sub_817094C: @ 817094C - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_03005D70 - adds r0, r1 - ldrb r0, [r0] - ldr r1, =gUnknown_02020630 - mov r8, r1 - lsls r5, r0, 4 - adds r5, r0 - lsls r5, 2 - add r5, r8 - ldrb r0, [r5, 0x6] - mov r9, r0 - ldrh r6, [r5, 0x38] - lsls r6, 24 - lsrs r6, 24 - ldr r0, =0x0000d709 - bl FreeObjectPaletteByTag - ldr r0, =0x0000d70a - bl FreeObjectPaletteByTag - ldr r0, =0x0000d6ff - bl IndexOfObjectPaletteTag - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x0000d704 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsls r4, 4 - ldrb r2, [r5, 0x5] - movs r3, 0xF - adds r1, r3, 0 - ands r1, r2 - orrs r1, r4 - strb r1, [r5, 0x5] - mov r1, r9 - lsls r2, r1, 4 - add r2, r9 - lsls r2, 2 - add r2, r8 - ldrb r5, [r2, 0x5] - adds r1, r3, 0 - ands r1, r5 - orrs r1, r4 - strb r1, [r2, 0x5] - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - add r1, r8 - lsrs r0, 20 - ldrb r2, [r1, 0x5] - ands r3, r2 - orrs r3, r0 - strb r3, [r1, 0x5] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817094C - - thumb_func_start sub_81709EC -sub_81709EC: @ 81709EC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_02038436 - ldrb r0, [r0] - bl sub_817094C - adds r0, r4, 0 - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81709EC - - thumb_func_start sub_8170A0C -sub_8170A0C: @ 8170A0C - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, =gUnknown_0203841E - ldrh r0, [r2] - strh r0, [r1, 0x1C] - ldrh r0, [r2, 0x2] - strh r0, [r1, 0x1E] - ldr r0, =sub_8170A38 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8170A0C - - thumb_func_start sub_8170A38 -sub_8170A38: @ 8170A38 - 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 r0, [r4, 0x8] - adds r0, 0x1 - movs r6, 0 - adds r1, r0, 0x1 - strh r1, [r4, 0x8] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x1E - ldrsh r1, [r4, r2] - cmp r0, r1 - blt _08170AF8 - strh r6, [r4, 0x8] - ldr r0, =0x0000d709 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r2, r0, 24 - movs r3, 0x1C - ldrsh r0, [r4, r3] - movs r1, 0x2 - cmp r0, 0 - bne _08170A76 - movs r1, 0x6 -_08170A76: - movs r3, 0xA - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _08170A8C - cmp r0, 0x1 - beq _08170AC8 - b _08170AF8 - .pool -_08170A8C: - ldrh r0, [r4, 0xC] - adds r0, 0x2 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - ble _08170A9E - movs r0, 0x10 - strh r0, [r4, 0xC] -_08170A9E: - lsls r0, r2, 4 - movs r2, 0x80 - lsls r2, 1 - adds r0, r2 - orrs r0, r1 - ldrb r2, [r4, 0xC] - ldr r3, =0x00007f74 - movs r1, 0x1 - bl BlendPalette - movs r3, 0xC - ldrsh r0, [r4, r3] - cmp r0, 0x10 - bne _08170AF8 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - b _08170AF8 - .pool -_08170AC8: - ldrh r0, [r4, 0xC] - subs r0, 0x2 - strh r0, [r4, 0xC] - lsls r0, 16 - cmp r0, 0 - bge _08170AD6 - strh r6, [r4, 0xC] -_08170AD6: - lsls r0, r2, 4 - movs r2, 0x80 - lsls r2, 1 - adds r0, r2 - orrs r0, r1 - ldrb r2, [r4, 0xC] - ldr r3, =0x00007f74 - movs r1, 0x1 - bl BlendPalette - movs r3, 0xC - ldrsh r0, [r4, r3] - cmp r0, 0 - bne _08170AF8 - adds r0, r5, 0 - bl move_anim_task_del -_08170AF8: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8170A38 - - thumb_func_start sub_8170B04 -sub_8170B04: @ 8170B04 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gUnknown_020241E4 - ldr r0, =gUnknown_02038436 - ldrb r0, [r0] - adds r0, r1 - ldrb r5, [r0] - 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, 0x1 - beq _08170B52 - cmp r0, 0x1 - bgt _08170B3C - cmp r0, 0 - beq _08170B42 - b _08170BA4 - .pool -_08170B3C: - cmp r0, 0x2 - beq _08170B84 - b _08170BA4 -_08170B42: - adds r0, r5, 0 - movs r1, 0 - bl sub_80A7270 - movs r0, 0x80 - lsls r0, 1 - strh r0, [r4, 0x1C] - b _08170B76 -_08170B52: - ldrh r0, [r4, 0x1C] - adds r0, 0x30 - strh r0, [r4, 0x1C] - movs r0, 0x1C - ldrsh r2, [r4, r0] - adds r0, r5, 0 - adds r1, r2, 0 - movs r3, 0 - bl obj_id_set_rotscale - adds r0, r5, 0 - bl sub_80A7E6C - movs r0, 0x1C - ldrsh r1, [r4, r0] - ldr r0, =0x000002cf - cmp r1, r0 - ble _08170BA4 -_08170B76: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _08170BA4 - .pool -_08170B84: - adds r0, r5, 0 - bl sub_80A7344 - ldr r1, =gUnknown_02020630 - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - adds r0, r6, 0 - bl move_anim_task_del -_08170BA4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8170B04 - - thumb_func_start sub_8170BB0 -sub_8170BB0: @ 8170BB0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gUnknown_020241E4 - ldr r4, =gUnknown_02038436 - ldrb r0, [r4] - adds r1, r0, r1 - ldrb r1, [r1] - mov r9, r1 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08170BF8 - ldr r1, =gUnknown_0202406E - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gUnknown_020244EC - b _08170C08 - .pool -_08170BF8: - ldr r1, =gUnknown_0202406E - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gUnknown_02024744 -_08170C08: - adds r0, r1 - movs r1, 0x26 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - bl ball_number_to_ball_processing_index - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r2, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r6, r0, r2 - movs r0, 0x8 - ldrsh r7, [r6, r0] - cmp r7, 0 - beq _08170C44 - cmp r7, 0x1 - beq _08170CC4 - b _08170CEE - .pool -_08170C44: - ldr r5, =gUnknown_02038436 - ldrb r0, [r5] - movs r1, 0 - bl sub_80A5C6C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r5] - movs r1, 0x1 - bl sub_80A5C6C - adds r1, r0, 0 - lsls r1, 24 - ldr r2, =gUnknown_02020630 - mov r3, r9 - lsls r0, r3, 4 - add r0, r9 - lsls r0, 2 - adds r0, r2 - ldrb r2, [r0, 0x5] - lsls r2, 28 - lsrs r2, 30 - adds r0, 0x43 - ldrb r3, [r0] - movs r0, 0x80 - lsls r0, 22 - adds r1, r0 - lsrs r1, 24 - mov r0, r8 - str r0, [sp] - adds r0, r4, 0 - bl sub_8171D98 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x1C] - str r7, [sp] - str r7, [sp, 0x4] - str r7, [sp, 0x8] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_80A75AC - adds r2, r0, 0 - ldrb r1, [r5] - movs r0, 0 - mov r3, r8 - bl sub_81729E8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x1E] - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - b _08170CEE - .pool -_08170CC4: - movs r1, 0x1C - ldrsh r0, [r6, r1] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrb r0, [r1, 0x4] - cmp r0, 0 - bne _08170CEE - movs r3, 0x1E - ldrsh r0, [r6, r3] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrb r0, [r1, 0x4] - cmp r0, 0 - bne _08170CEE - adds r0, r5, 0 - bl move_anim_task_del -_08170CEE: - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8170BB0 - - thumb_func_start sub_8170CFC -sub_8170CFC: @ 8170CFC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_02024208 - ldrh r0, [r0] - bl ball_number_to_ball_processing_index - lsls r0, 24 - lsrs r0, 24 - bl sub_8076A78 - adds r0, r4, 0 - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8170CFC - - thumb_func_start sub_8170D24 -sub_8170D24: @ 8170D24 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_02024208 - ldrh r0, [r0] - bl ball_number_to_ball_processing_index - lsls r0, 24 - lsrs r0, 24 - bl sub_8076AE8 - adds r0, r4, 0 - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8170D24 - - thumb_func_start sub_8170D4C -sub_8170D4C: @ 8170D4C - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x8] - cmp r0, 0x5 - bne _08170D70 - ldr r1, =gUnknown_0203841E - ldr r0, =0x0000ffff - b _08170D74 - .pool -_08170D70: - ldr r1, =gUnknown_0203841E - movs r0, 0 -_08170D74: - strh r0, [r1, 0xE] - adds r0, r2, 0 - bl move_anim_task_del - pop {r0} - bx r0 - .pool - thumb_func_end sub_8170D4C - - thumb_func_start ball_number_to_ball_processing_index -ball_number_to_ball_processing_index: @ 8170D84 - push {lr} - lsls r0, 16 - lsrs r0, 16 - subs r0, 0x1 - cmp r0, 0xB - bhi _08170DFC - lsls r0, 2 - ldr r1, =_08170DA0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08170DA0: - .4byte _08170DD0 - .4byte _08170DD4 - .4byte _08170DD8 - .4byte _08170DFC - .4byte _08170DDC - .4byte _08170DE0 - .4byte _08170DE4 - .4byte _08170DE8 - .4byte _08170DEC - .4byte _08170DF0 - .4byte _08170DF4 - .4byte _08170DF8 -_08170DD0: - movs r0, 0x4 - b _08170DFE -_08170DD4: - movs r0, 0x3 - b _08170DFE -_08170DD8: - movs r0, 0x1 - b _08170DFE -_08170DDC: - movs r0, 0x2 - b _08170DFE -_08170DE0: - movs r0, 0x5 - b _08170DFE -_08170DE4: - movs r0, 0x6 - b _08170DFE -_08170DE8: - movs r0, 0x7 - b _08170DFE -_08170DEC: - movs r0, 0x8 - b _08170DFE -_08170DF0: - movs r0, 0x9 - b _08170DFE -_08170DF4: - movs r0, 0xA - b _08170DFE -_08170DF8: - movs r0, 0xB - b _08170DFE -_08170DFC: - movs r0, 0 -_08170DFE: - pop {r1} - bx r1 - thumb_func_end ball_number_to_ball_processing_index - - thumb_func_start sub_8170E04 -sub_8170E04: @ 8170E04 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - mov r10, r0 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r0, =gUnknown_02024208 - ldrh r0, [r0] - bl ball_number_to_ball_processing_index - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - ldr r1, =gUnknown_0832C588 - adds r0, r1 - movs r1, 0x20 - movs r2, 0x50 - movs r3, 0x1D - bl AddObjectToFront - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =gUnknown_02020630 - mov r9, r1 - lsls r4, r5, 4 - adds r4, r5 - lsls r4, 2 - adds r6, r4, r1 - movs r0, 0x22 - strh r0, [r6, 0x2E] - ldr r2, =gUnknown_02038437 - mov r8, r2 - ldrb r0, [r2] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x30] - mov r1, r8 - ldrb r0, [r1] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x10 - strh r0, [r6, 0x32] - mov r0, r9 - adds r0, 0x1C - adds r4, r0 - ldr r0, =sub_8171104 - str r0, [r4] - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r3, [r0, 0x8] - ldr r1, =gUnknown_020241E4 - mov r2, r8 - ldrb r0, [r2] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r9 - adds r0, 0x3E - ldrb r1, [r0] - lsls r1, 29 - lsrs r1, 31 - lsls r1, 1 - ldrb r2, [r3, 0x9] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x9] - ldr r1, =gTasks - mov r2, r10 - lsls r0, r2, 2 - add r0, r10 - lsls r0, 3 - adds r0, r1 - strh r5, [r0, 0x8] - ldr r1, =sub_8170EF0 - str r1, [r0] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8170E04 - - thumb_func_start sub_8170EF0 -sub_8170EF0: @ 8170EF0 - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, =gTasks - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x8] - ldr r2, =gUnknown_02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x2E] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _08170F1A - adds r0, r3, 0 - bl move_anim_task_del -_08170F1A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8170EF0 - - thumb_func_start sub_8170F2C -sub_8170F2C: @ 8170F2C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gUnknown_02022FEC - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 2 - ands r0, r1 - cmp r0, 0 - beq _08170F50 - movs r6, 0x20 - movs r5, 0xB - b _08170F54 - .pool -_08170F50: - movs r6, 0x17 - movs r5, 0x5 -_08170F54: - ldr r0, =gUnknown_02024208 - ldrh r0, [r0] - bl ball_number_to_ball_processing_index - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - bl sub_80A82E4 - adds r3, r0, 0 - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - ldr r1, =gUnknown_0832C588 - adds r0, r1 - adds r1, r6, 0 - adds r1, 0x20 - movs r2, 0x50 - orrs r5, r2 - adds r2, r5, 0 - bl AddObjectToFront - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_02020630 - mov r9, r0 - lsls r4, r5, 4 - adds r4, r5 - lsls r4, 2 - adds r6, r4, r0 - movs r0, 0x22 - strh r0, [r6, 0x2E] - ldr r1, =gUnknown_02038437 - mov r8, r1 - ldrb r0, [r1] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x30] - mov r1, r8 - ldrb r0, [r1] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x10 - strh r0, [r6, 0x32] - movs r0, 0x1C - add r9, r0 - add r4, r9 - ldr r0, =DummyObjectCallback - str r0, [r4] - movs r0, 0 - bl battle_get_side_with_given_state - ldr r1, =gUnknown_020241E4 - lsls r0, 24 - lsrs r0, 24 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r9 - ldr r1, =sub_8039E84 - str r1, [r0] - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - strh r5, [r0, 0x8] - ldr r1, =sub_8171030 - str r1, [r0] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8170F2C - - thumb_func_start sub_8171030 -sub_8171030: @ 8171030 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r6, =gUnknown_02020630 - movs r0, 0 - bl battle_get_side_with_given_state - ldr r1, =gUnknown_020241E4 - lsls r0, 24 - lsrs r0, 24 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x2B - ldrb r0, [r0] - cmp r0, 0x1 - bne _0817108A - movs r0, 0x3D - movs r1, 0 - bl audio_play_and_stuff - ldr r0, =gTasks - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r6, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_8171104 - str r1, [r0] - ldr r0, =sub_81710A8 - movs r1, 0xA - bl CreateTask - ldr r0, =sub_8170EF0 - str r0, [r4] -_0817108A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8171030 - - thumb_func_start sub_81710A8 -sub_81710A8: @ 81710A8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r6, =gUnknown_02020630 - movs r0, 0 - bl battle_get_side_with_given_state - ldr r4, =gUnknown_020241E4 - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 27 - cmp r0, 0 - bge _081710F4 - movs r0, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0 - bl StartObjectImageAnim - adds r0, r5, 0 - bl DestroyTask -_081710F4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81710A8 - - thumb_func_start sub_8171104 -sub_8171104: @ 8171104 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x30] - ldrh r2, [r4, 0x32] - ldrh r0, [r4, 0x20] - strh r0, [r4, 0x30] - strh r1, [r4, 0x32] - ldrh r0, [r4, 0x22] - strh r0, [r4, 0x34] - strh r2, [r4, 0x36] - ldr r0, =0x0000ffd8 - strh r0, [r4, 0x38] - adds r0, r4, 0 - bl sub_80A68D4 - ldr r0, =sub_8171134 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8171104 - - thumb_func_start sub_8171134 -sub_8171134: @ 8171134 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _081711D2 - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x8] - cmp r0, 0x5 - bne _08171160 - ldr r0, =sub_8171CAC - str r0, [r4, 0x1C] - b _081711D2 - .pool -_08171160: - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectImageAnim - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - movs r1, 0 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - strh r1, [r4, 0x24] - strh r1, [r4, 0x26] - adds r1, r4, 0 - adds r1, 0x2E - movs r2, 0 - adds r0, r4, 0 - adds r0, 0x3C -_08171188: - strh r2, [r0] - subs r0, 0x2 - cmp r0, r1 - bge _08171188 - movs r0, 0 - strh r0, [r4, 0x38] - ldr r0, =sub_81711E8 - str r0, [r4, 0x1C] - ldr r0, =gUnknown_02024208 - ldrh r0, [r0] - bl ball_number_to_ball_processing_index - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0xB - bgt _081711D2 - cmp r5, 0 - blt _081711D2 - ldrh r0, [r4, 0x20] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x22] - subs r1, 0x5 - lsls r1, 24 - lsrs r1, 24 - str r5, [sp] - movs r2, 0x1 - movs r3, 0x1C - bl sub_8171D98 - ldr r0, =gUnknown_02038437 - ldrb r1, [r0] - movs r0, 0 - movs r2, 0xE - adds r3, r5, 0 - bl sub_81729E8 -_081711D2: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8171134 - - thumb_func_start sub_81711E8 -sub_81711E8: @ 81711E8 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - bne _08171224 - ldr r0, =TaskDummy - movs r1, 0x32 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x38] - ldr r0, =sub_8171240 - str r0, [r4, 0x1C] - ldr r2, =gUnknown_02020630 - ldr r1, =gUnknown_020241E4 - ldr r0, =gUnknown_02038437 - ldrb r0, [r0] - 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, 0x30] -_08171224: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81711E8 - - thumb_func_start sub_8171240 -sub_8171240: @ 8171240 - push {r4-r7,lr} - adds r7, r0, 0 - ldr r1, =gUnknown_020241E4 - ldr r0, =gUnknown_02038437 - ldrb r0, [r0] - adds r0, r1 - ldrb r4, [r0] - ldrh r0, [r7, 0x38] - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r5, r0, r1 - ldrh r0, [r5, 0xA] - adds r0, 0x1 - strh r0, [r5, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB - bne _08171272 - movs r0, 0x3C - bl audio_play -_08171272: - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _081712E8 - cmp r0, 0x1 - bgt _08171290 - cmp r0, 0 - beq _08171296 - b _08171354 - .pool -_08171290: - cmp r0, 0x2 - beq _0817132C - b _08171354 -_08171296: - adds r0, r4, 0 - movs r1, 0 - bl sub_80A7270 - movs r0, 0x80 - lsls r0, 1 - strh r0, [r5, 0x1C] - ldr r1, =gUnknown_030062DC - movs r0, 0x1C - str r0, [r1] - ldr r2, =gUnknown_030062E4 - ldr r1, =gUnknown_02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0, 0x26] - ldrh r0, [r0, 0x22] - adds r1, r0 - ldrh r0, [r7, 0x26] - ldrh r7, [r7, 0x22] - adds r0, r7 - subs r1, r0 - strh r1, [r2] - ldr r4, =gUnknown_030062E0 - ldrh r0, [r2] - lsls r0, 8 - movs r1, 0x1C - bl __udivsi3 - strh r0, [r4] - strh r0, [r5, 0xC] - b _08171346 - .pool -_081712E8: - ldrh r0, [r5, 0x1C] - adds r0, 0x20 - strh r0, [r5, 0x1C] - movs r0, 0x1C - ldrsh r2, [r5, r0] - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl obj_id_set_rotscale - ldrh r0, [r5, 0xC] - ldrh r1, [r5, 0xE] - adds r0, r1 - strh r0, [r5, 0xE] - ldr r0, =gUnknown_02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - movs r2, 0xE - ldrsh r0, [r5, r2] - negs r0, r0 - asrs r0, 8 - strh r0, [r1, 0x26] - movs r0, 0x1C - ldrsh r1, [r5, r0] - ldr r0, =0x0000047f - cmp r1, r0 - ble _0817137C - b _08171346 - .pool -_0817132C: - adds r0, r4, 0 - bl sub_80A7344 - ldr r1, =gUnknown_02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_08171346: - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - b _0817137C - .pool -_08171354: - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - movs r2, 0xA - ldrsh r0, [r1, r2] - cmp r0, 0xA - ble _0817137C - adds r0, r6, 0 - bl DestroyTask - adds r0, r7, 0 - movs r1, 0x2 - bl StartObjectImageAnim - movs r0, 0 - strh r0, [r7, 0x38] - ldr r0, =sub_817138C - str r0, [r7, 0x1C] -_0817137C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8171240 - - thumb_func_start sub_817138C -sub_817138C: @ 817138C - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _081713C6 - movs r1, 0 - strh r1, [r4, 0x34] - movs r0, 0x28 - strh r0, [r4, 0x36] - strh r1, [r4, 0x38] - movs r0, 0 - movs r1, 0x28 - bl cosine - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - movs r0, 0x36 - ldrsh r1, [r4, r0] - movs r0, 0 - bl cosine - negs r0, r0 - strh r0, [r4, 0x26] - ldr r0, =sub_81713D0 - str r0, [r4, 0x1C] -_081713C6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817138C - - thumb_func_start sub_81713D0 -sub_81713D0: @ 81713D0 - 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 _081713E6 - cmp r1, 0x1 - beq _0817145A - b _08171486 -_081713E6: - movs r1, 0x38 - ldrsh r0, [r4, r1] - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl cosine - 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 _08171486 - 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 _08171422 - movs r5, 0x1 -_08171422: - cmp r0, 0x2 - beq _08171442 - cmp r0, 0x2 - bgt _08171434 - cmp r0, 0x1 - beq _0817143A - b _08171452 - .pool -_08171434: - cmp r0, 0x3 - beq _0817144A - b _08171452 -_0817143A: - movs r0, 0x38 - bl audio_play - b _08171486 -_08171442: - movs r0, 0x39 - bl audio_play - b _08171486 -_0817144A: - movs r0, 0x3A - bl audio_play - b _08171486 -_08171452: - movs r0, 0x3B - bl audio_play - b _08171486 -_0817145A: - movs r2, 0x38 - ldrsh r0, [r4, r2] - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl cosine - 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 _08171486 - strh r5, [r4, 0x38] - ldr r0, =0xffffff00 - ands r0, r2 - strh r0, [r4, 0x34] -_08171486: - cmp r5, 0 - beq _081714CA - movs r5, 0 - strh r5, [r4, 0x34] - movs r0, 0x40 - movs r1, 0x28 - bl cosine - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - strh r5, [r4, 0x26] - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _081714C0 - strh r5, [r4, 0x38] - ldr r0, =sub_81717B4 - str r0, [r4, 0x1C] - b _081714CA - .pool -_081714C0: - ldr r0, =sub_81714D4 - str r0, [r4, 0x1C] - movs r0, 0x1 - strh r0, [r4, 0x36] - strh r5, [r4, 0x38] -_081714CA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81713D0 - - thumb_func_start sub_81714D4 -sub_81714D4: @ 81714D4 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x34] - adds r0, 0x1 - movs r5, 0 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1F - bne _08171510 - strh r5, [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 StartObjectRotScalAnim - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - strh r5, [r0, 0xC] - ldr r0, =sub_8171520 - str r0, [r4, 0x1C] - movs r0, 0x17 - bl audio_play -_08171510: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81714D4 - - thumb_func_start sub_8171520 -sub_8171520: @ 8171520 - push {r4-r6,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x34] - movs r1, 0xFF - ands r1, r0 - cmp r1, 0x6 - bls _08171530 - b _08171768 -_08171530: - lsls r0, r1, 2 - ldr r1, =_08171540 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08171540: - .4byte _0817155C - .4byte _081715AE - .4byte _081715F4 - .4byte _08171654 - .4byte _081716A4 - .4byte _08171708 - .4byte _08171768 -_0817155C: - ldr r1, =gUnknown_020244D0 - ldr r5, [r1] - ldr r2, [r5, 0x8] - ldrh r3, [r2, 0xC] - movs r6, 0xC - ldrsh r0, [r2, r6] - adds r6, r1, 0 - cmp r0, 0xFF - ble _08171584 - ldrh r0, [r4, 0x36] - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - ldr r1, [r5, 0x8] - ldrb r0, [r1, 0xC] - strh r0, [r1, 0xC] - b _0817158A - .pool -_08171584: - adds r0, r3, 0 - adds r0, 0xB0 - strh r0, [r2, 0xC] -_0817158A: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - movs r3, 0 - 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, 0x7 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xE - bhi _081715AC - b _081717AE -_081715AC: - b _08171644 -_081715AE: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _08171660 - 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 r6, 0x36 - ldrsh r0, [r4, r6] - cmp r0, 0 - bge _081715EA - adds r0, r4, 0 - movs r1, 0x2 - bl sub_80082B8 - b _081717AE -_081715EA: - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80082B8 - b _081717AE -_081715F4: - ldr r1, =gUnknown_020244D0 - ldr r5, [r1] - ldr r2, [r5, 0x8] - ldrh r3, [r2, 0xC] - movs r6, 0xC - ldrsh r0, [r2, r6] - adds r6, r1, 0 - cmp r0, 0xFF - ble _0817161C - ldrh r0, [r4, 0x36] - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - ldr r1, [r5, 0x8] - ldrb r0, [r1, 0xC] - strh r0, [r1, 0xC] - b _08171622 - .pool -_0817161C: - adds r0, r3, 0 - adds r0, 0xB0 - strh r0, [r2, 0xC] -_08171622: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - movs r3, 0 - 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, 0xC - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x18 - bhi _08171644 - b _081717AE -_08171644: - ldr r0, [r6] - ldr r0, [r0, 0x8] - strh r3, [r0, 0xC] - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - strh r3, [r4, 0x38] - b _081717AE -_08171654: - ldrh r0, [r4, 0x38] - adds r1, r0, 0x1 - strh r1, [r4, 0x38] - lsls r0, 16 - cmp r0, 0 - bge _0817166E -_08171660: - adds r0, r4, 0 - adds r0, 0x2C - ldrb r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] - b _081717AE -_0817166E: - 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 r6, 0x36 - ldrsh r0, [r4, r6] - cmp r0, 0 - bge _0817169C - adds r0, r4, 0 - movs r1, 0x2 - bl sub_80082B8 - b _081716A4 -_0817169C: - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80082B8 -_081716A4: - ldr r1, =gUnknown_020244D0 - ldr r5, [r1] - ldr r2, [r5, 0x8] - ldrh r3, [r2, 0xC] - movs r6, 0xC - ldrsh r0, [r2, r6] - adds r6, r1, 0 - cmp r0, 0xFF - ble _081716CC - ldrh r0, [r4, 0x36] - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - ldr r1, [r5, 0x8] - ldrb r0, [r1, 0xC] - strh r0, [r1, 0xC] - b _081716D2 - .pool -_081716CC: - adds r0, r3, 0 - adds r0, 0xB0 - strh r0, [r2, 0xC] -_081716D2: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - movs r3, 0 - 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, 0x4 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x8 - bls _081717AE - ldr r0, [r6] - ldr r0, [r0, 0x8] - strh r3, [r0, 0xC] - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - strh r3, [r4, 0x38] - ldrh r0, [r4, 0x36] - negs r0, r0 - strh r0, [r4, 0x36] - b _081717AE -_08171708: - movs r6, 0x80 - lsls r6, 1 - adds r0, r6, 0 - ldrh r1, [r4, 0x34] - adds r0, r1 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r1, r0, 24 - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x8] - cmp r1, r0 - bne _08171740 - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_81717B4 - str r0, [r4, 0x1C] - b _081717AE - .pool -_08171740: - cmp r0, 0x4 - bne _08171754 - cmp r1, 0x3 - bne _08171754 - ldr r0, =sub_81717D8 - str r0, [r4, 0x1C] - b _0817175A - .pool -_08171754: - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] -_0817175A: - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - b _081717AE -_08171768: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1F - bne _081717AE - 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 StartObjectRotScalAnim - movs r6, 0x36 - ldrsh r0, [r4, r6] - cmp r0, 0 - bge _081717A0 - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectRotScalAnim - b _081717A8 - .pool -_081717A0: - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim -_081717A8: - movs r0, 0x17 - bl audio_play -_081717AE: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8171520 - - thumb_func_start sub_81717B4 -sub_81717B4: @ 81717B4 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x38] - adds r0, 0x1 - strh r0, [r1, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1F - bne _081717CE - movs r0, 0 - strh r0, [r1, 0x38] - ldr r0, =sub_8171AE4 - str r0, [r1, 0x1C] -_081717CE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81717B4 - - thumb_func_start sub_81717D8 -sub_81717D8: @ 81717D8 - adds r3, r0, 0 - adds r3, 0x2C - ldrb r1, [r3] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r3] - ldr r1, =sub_81717F8 - 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_81717D8 - - thumb_func_start sub_81717F8 -sub_81717F8: @ 81717F8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r6, r0, 0 - ldr r7, =gUnknown_02038437 - ldrh r0, [r6, 0x36] - adds r0, 0x1 - movs r1, 0 - mov r8, r1 - strh r0, [r6, 0x36] - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0x28 - bne _0817183C - movs r0, 0xFE - bl audio_play - ldrb r1, [r6, 0x5] - lsrs r1, 4 - movs r0, 0x80 - lsls r0, 9 - lsls r0, r1 - movs r1, 0x6 - movs r2, 0 - bl BlendPalettes - adds r0, r6, 0 - bl sub_81719EC - b _081718BC - .pool -_0817183C: - cmp r1, 0x3C - bne _0817185A - ldrb r1, [r6, 0x5] - lsrs r1, 4 - movs r0, 0x80 - lsls r0, 9 - lsls r0, r1 - mov r1, r8 - str r1, [sp] - movs r1, 0x2 - movs r2, 0x6 - movs r3, 0 - bl BeginNormalPaletteFade - b _081718BC -_0817185A: - cmp r1, 0x5F - bne _08171880 - ldr r0, =gUnknown_020244B9 - movs r1, 0 - strb r1, [r0] - movs r0, 0x1 - bl sub_8072A88 - bl m4aMPlayAllStop - ldr r0, =0x00000213 - bl audio_play - b _081718BC - .pool -_08171880: - ldr r0, =0x0000013b - cmp r1, r0 - bne _081718BC - ldr r5, =gUnknown_02020630 - ldr r4, =gUnknown_020241E4 - ldrb r0, [r7] - 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 rotscale_free_entry - ldrb r0, [r7] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles - mov r0, r8 - strh r0, [r6, 0x2E] - ldr r0, =sub_81718D8 - str r0, [r6, 0x1C] -_081718BC: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81717F8 - - thumb_func_start sub_81718D8 -sub_81718D8: @ 81718D8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _08171944 - cmp r0, 0x1 - bgt _081718F0 - cmp r0, 0 - beq _081718F6 - b _0817198A -_081718F0: - cmp r0, 0x2 - beq _08171976 - b _0817198A -_081718F6: - strh r0, [r4, 0x30] - strh r0, [r4, 0x32] - ldrb r1, [r4, 0x1] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4, 0x1] - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0x10 - bl SetGpuReg - ldr r0, [r4, 0x14] - ldrh r0, [r0, 0x2] - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x10 - movs r1, 0x1 - lsls r1, r0 - ldr r0, =0x00007fff - str r0, [sp] - adds r0, r1, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - b _08171982 - .pool -_08171944: - ldrh r0, [r4, 0x30] - adds r1, r0, 0x1 - strh r1, [r4, 0x30] - lsls r0, 16 - cmp r0, 0 - ble _081719B0 - movs r0, 0 - strh r0, [r4, 0x30] - ldrh r2, [r4, 0x32] - adds r2, 0x1 - strh r2, [r4, 0x32] - lsls r1, r2, 8 - movs r0, 0x10 - subs r0, r2 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x10 - bne _081719B0 - b _08171982 -_08171976: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_08171982: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _081719B0 -_0817198A: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _081719B0 - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - strh r5, [r4, 0x2E] - ldr r0, =sub_81719C0 - str r0, [r4, 0x1C] -_081719B0: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81718D8 - - thumb_func_start sub_81719C0 -sub_81719C0: @ 81719C0 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x2E] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _081719D8 - ldr r0, =0x0000ffff - strh r0, [r4, 0x2E] - b _081719E4 - .pool -_081719D8: - adds r0, r4, 0 - bl obj_free_rotscale_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_081719E4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81719C0 - - thumb_func_start sub_81719EC -sub_81719EC: @ 81719EC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r6, r0, 0 - adds r1, r6, 0 - adds r1, 0x43 - ldrb r0, [r1] - cmp r0, 0 - beq _08171A0C - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - b _08171A14 -_08171A0C: - movs r0, 0 - mov r8, r0 - movs r0, 0x1 - strb r0, [r1] -_08171A14: - movs r0, 0x4 - bl sub_8171D60 - movs r7, 0 - ldr r2, =gUnknown_02020630 - mov r9, r2 - movs r0, 0x1C - add r0, r9 - mov r10, r0 -_08171A26: - movs r2, 0x20 - ldrsh r1, [r6, r2] - movs r0, 0x22 - ldrsh r2, [r6, r0] - ldr r0, =gUnknown_085E5250 - mov r3, r8 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _08171A82 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - mov r2, r9 - adds r5, r4, r2 - movs r0, 0x18 - strh r0, [r5, 0x2E] - ldr r0, =gUnknown_085E5088 - lsls r1, r7, 2 - adds r1, r0 - movs r0, 0 - ldrsb r0, [r1, r0] - ldrh r2, [r6, 0x20] - adds r0, r2 - strh r0, [r5, 0x32] - movs r0, 0x1 - ldrsb r0, [r1, r0] - ldrh r2, [r6, 0x22] - adds r0, r2 - strh r0, [r5, 0x36] - movs r0, 0x2 - ldrsb r0, [r1, r0] - strh r0, [r5, 0x38] - adds r0, r5, 0 - bl sub_80A68D4 - add r4, r10 - ldr r0, =sub_8171AAC - str r0, [r4] - ldr r0, =gUnknown_085E51B4 - ldrb r1, [r0, 0x4] - adds r0, r5, 0 - bl StartObjectImageAnim -_08171A82: - adds r7, 0x1 - cmp r7, 0x2 - bls _08171A26 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81719EC - - thumb_func_start sub_8171AAC -sub_8171AAC: @ 8171AAC - push {r4,lr} - adds r4, r0, 0 - adds r3, r4, 0 - adds r3, 0x3E - ldrb r2, [r3] - lsrs r1, r2, 2 - movs r0, 0x1 - eors r1, r0 - ands r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - adds r0, r4, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _08171ADC - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_08171ADC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8171AAC - - thumb_func_start sub_8171AE4 -sub_8171AE4: @ 8171AE4 - push {r4-r6,lr} - sub sp, 0x4 - adds r4, r0, 0 - movs r1, 0x1 - bl StartObjectImageAnim - adds r0, r4, 0 - movs r1, 0 - bl StartObjectRotScalAnim - ldr r0, =sub_8171BAC - str r0, [r4, 0x1C] - ldr r0, =gUnknown_02024208 - ldrh r0, [r0] - bl ball_number_to_ball_processing_index - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0xB - bgt _08171B36 - cmp r5, 0 - blt _08171B36 - ldrh r0, [r4, 0x20] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x22] - subs r1, 0x5 - lsls r1, 24 - lsrs r1, 24 - str r5, [sp] - movs r2, 0x1 - movs r3, 0x1C - bl sub_8171D98 - ldr r0, =gUnknown_02038437 - ldrb r1, [r0] - movs r0, 0x1 - movs r2, 0xE - adds r3, r5, 0 - bl sub_81729E8 -_08171B36: - ldr r6, =gUnknown_02020630 - ldr r5, =gUnknown_020241E4 - ldr r4, =gUnknown_02038437 - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x1 - bl StartObjectRotScalAnim - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl AnimateObject - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x80 - lsls r1, 5 - strh r1, [r0, 0x30] - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8171AE4 - - thumb_func_start sub_8171BAC -sub_8171BAC: @ 8171BAC - push {r4-r7,lr} - adds r7, r0, 0 - movs r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08171BCA - adds r2, r7, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_08171BCA: - ldr r4, =gUnknown_02020630 - ldr r3, =gUnknown_020241E4 - ldr r2, =gUnknown_02038437 - ldrb r0, [r2] - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r4 - adds r0, r1, 0 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _08171C04 - adds r0, r1, 0 - movs r1, 0 - bl StartObjectRotScalAnim - movs r5, 0x1 - b _08171C24 - .pool -_08171C04: - ldr r6, =0xfffffee0 - adds r0, r6, 0 - ldrh r6, [r1, 0x30] - adds r0, r6 - strh r0, [r1, 0x30] - ldrb r0, [r2] - adds r0, r3 - ldrb r0, [r0] - 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] -_08171C24: - adds r0, r7, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08171C8A - cmp r5, 0 - beq _08171C8A - ldr r4, =gUnknown_02020630 - ldr r3, =gUnknown_020241E4 - ldr r2, =gUnknown_02038437 - ldrb r0, [r2] - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r6, 0 - movs r5, 0 - strh r5, [r0, 0x26] - ldrb r0, [r2] - adds r0, r3 - ldrb r0, [r0] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r4 - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r1, [r0, 0x9] - lsls r1, 30 - adds r2, 0x3E - lsrs r1, 31 - lsls r1, 2 - ldrb r3, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - strh r5, [r7, 0x2E] - ldr r0, =sub_81719C0 - str r0, [r7, 0x1C] - ldr r0, =gUnknown_020244B9 - strb r6, [r0] - movs r0, 0x1 - bl sub_8072A88 -_08171C8A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8171BAC - - thumb_func_start sub_8171CAC -sub_8171CAC: @ 8171CAC - push {r4,lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x24] - ldrh r1, [r2, 0x20] - adds r0, r1 - movs r1, 0 - strh r0, [r2, 0x20] - ldrh r0, [r2, 0x26] - ldrh r3, [r2, 0x22] - adds r0, r3 - strh r0, [r2, 0x22] - strh r1, [r2, 0x26] - strh r1, [r2, 0x24] - ldr r4, =sub_8171CE8 - movs r3, 0 - movs r1, 0x5 - adds r0, r2, 0 - adds r0, 0x38 -_08171CD0: - strh r3, [r0] - subs r0, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _08171CD0 - str r4, [r2, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8171CAC - - thumb_func_start sub_8171CE8 -sub_8171CE8: @ 8171CE8 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x80 - lsls r0, 4 - adds r2, r0, 0 - ldrh r1, [r4, 0x2E] - adds r2, r1 - movs r0, 0xD0 - lsls r0, 3 - adds r3, r0, 0 - ldrh r1, [r4, 0x30] - adds r3, r1 - lsls r1, r3, 16 - asrs r1, 24 - ldrh r0, [r4, 0x24] - subs r0, r1 - strh r0, [r4, 0x24] - lsls r0, r2, 16 - asrs r0, 24 - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - movs r0, 0xFF - ands r2, r0 - strh r2, [r4, 0x2E] - ands r3, r0 - strh r3, [r4, 0x30] - movs r2, 0x22 - ldrsh r0, [r4, r2] - movs r2, 0x26 - ldrsh r1, [r4, r2] - adds r0, r1 - cmp r0, 0xA0 - bgt _08171D3E - movs r1, 0x20 - ldrsh r0, [r4, r1] - movs r2, 0x24 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r1, 0x8 - negs r1, r1 - cmp r0, r1 - bge _08171D52 -_08171D3E: - movs r0, 0 - strh r0, [r4, 0x2E] - ldr r0, =sub_81719C0 - str r0, [r4, 0x1C] - ldr r1, =gUnknown_020244B9 - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - bl sub_8072A88 -_08171D52: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8171CE8 - - thumb_func_start sub_8171D60 -sub_8171D60: @ 8171D60 - push {r4,r5,lr} - lsls r0, 24 - ldr r1, =gUnknown_085E5094 - lsrs r5, r0, 21 - adds r4, r5, r1 - ldrh r0, [r4, 0x6] - bl GetObjectTileRangeStartByTag - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - bne _08171D86 - adds r0, r4, 0 - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_085E50F4 - adds r0, r5, r0 - bl LoadCompressedObjectPaletteUsingHeap -_08171D86: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8171D60 - - thumb_func_start sub_8171D98 -sub_8171D98: @ 8171D98 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - adds r6, r0, 0 - mov r8, r1 - mov r9, r2 - mov r10, r3 - ldr r5, [sp, 0x1C] - lsls r6, 24 - lsrs r6, 24 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - mov r1, r9 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - mov r0, r10 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r5, 0 - bl sub_8171D60 - ldr r1, =gUnknown_085E51C0 - lsls r0, r5, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x5 - bl CreateTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - strh r6, [r0, 0xA] - mov r1, r8 - strh r1, [r0, 0xC] - mov r1, r9 - strh r1, [r0, 0xE] - mov r1, r10 - strh r1, [r0, 0x10] - strh r5, [r0, 0x26] - movs r0, 0xF - bl audio_play - adds r0, r4, 0 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8171D98 - - thumb_func_start sub_8171E20 -sub_8171E20: @ 8171E20 - push {lr} - ldr r0, =gUnknown_030022C0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08171E3E - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r1, [r0, 0x8] - ldrb r0, [r1, 0xA] - adds r0, 0x1 - strb r0, [r1, 0xA] -_08171E3E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8171E20 - - thumb_func_start sub_8171E50 -sub_8171E50: @ 8171E50 - 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 r6, r0, r1 - ldrh r0, [r6, 0x26] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r2, 0x8 - ldrsh r0, [r6, r2] - adds r2, r1, 0 - cmp r0, 0xF - bgt _08171F48 - ldrb r1, [r6, 0xA] - ldrb r2, [r6, 0xC] - ldrb r4, [r6, 0xE] - mov r9, r4 - ldrb r3, [r6, 0x10] - ldr r4, [sp] - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - ldr r4, =gUnknown_085E51F0 - adds r0, r4 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - cmp r0, 0x40 - beq _08171EEC - bl sub_8171E20 - mov r0, r10 - lsls r4, r0, 4 - add r4, r10 - lsls r4, 2 - ldr r5, =gUnknown_02020630 - adds r7, r4, r5 - ldr r0, =gUnknown_085E51B4 - ldr r1, [sp] - adds r0, r1, r0 - ldrb r1, [r0] - adds r0, r7, 0 - bl StartObjectImageAnim - adds r5, 0x1C - adds r4, r5 - ldr r0, =sub_8171F68 - str r0, [r4] - movs r0, 0x3 - mov r2, r9 - ands r2, r0 - lsls r2, 2 - ldrb r1, [r7, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - orrs r0, r2 - strb r0, [r7, 0x5] - ldrb r0, [r6, 0x8] - cmp r0, 0x7 - bls _08171EE8 - subs r0, 0x8 - lsls r0, 24 - lsrs r0, 24 -_08171EE8: - lsls r0, 5 - strh r0, [r7, 0x2E] -_08171EEC: - ldr r0, =gTasks - mov r4, r8 - lsls r1, r4, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r2, 0x8 - ldrsh r1, [r1, r2] - adds r2, r0, 0 - cmp r1, 0xF - bne _08171F48 - ldr r0, =gUnknown_030022C0 - ldr r4, =0x00000439 - adds r0, r4 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08171F22 - ldr r0, =gUnknown_02020630 - mov r2, r10 - lsls r1, r2, 4 - add r1, r10 - lsls r1, 2 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x3C] -_08171F22: - mov r0, r8 - bl DestroyTask - b _08171F58 - .pool -_08171F48: - mov r4, r8 - lsls r0, r4, 2 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] -_08171F58: - 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_8171E50 - - thumb_func_start sub_8171F68 -sub_8171F68: @ 8171F68 - push {lr} - adds r1, r0, 0 - ldrh r2, [r1, 0x30] - movs r3, 0x30 - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _08171F80 - ldr r0, =sub_8171F88 - str r0, [r1, 0x1C] - b _08171F84 - .pool -_08171F80: - subs r0, r2, 0x1 - strh r0, [r1, 0x30] -_08171F84: - pop {r0} - bx r0 - thumb_func_end sub_8171F68 - - thumb_func_start sub_8171F88 -sub_8171F88: @ 8171F88 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r2, 0x30 - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r2, 0x30 - ldrsh r1, [r4, r2] - bl cosine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0x2 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x32 - bne _08171FBC - adds r0, r4, 0 - bl sub_8172944 -_08171FBC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8171F88 - - thumb_func_start sub_8171FC4 -sub_8171FC4: @ 8171FC4 - 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 r9, r0 - ldr r0, =gTasks - mov r2, r9 - lsls r1, r2, 2 - add r1, r9 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x26] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldrb r3, [r1, 0xA] - str r3, [sp] - ldrb r0, [r1, 0xC] - str r0, [sp, 0x4] - ldrb r2, [r1, 0xE] - str r2, [sp, 0x8] - ldrb r1, [r1, 0x10] - str r1, [sp, 0xC] - movs r7, 0 - ldr r3, =gUnknown_02020630 - mov r10, r3 - mov r1, r8 - lsls r0, r1, 1 - add r0, r8 - lsls r0, 3 - str r0, [sp, 0x10] -_0817200A: - ldr r0, =gUnknown_085E51F0 - ldr r2, [sp, 0x10] - adds r0, r2, r0 - ldr r1, [sp] - ldr r2, [sp, 0x4] - ldr r3, [sp, 0xC] - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x40 - beq _0817206A - bl sub_8171E20 - lsls r4, r6, 4 - adds r4, r6 - lsls r4, 2 - mov r3, r10 - adds r5, r4, r3 - ldr r0, =gUnknown_085E51B4 - add r0, r8 - ldrb r1, [r0] - adds r0, r5, 0 - bl StartObjectImageAnim - ldr r0, =gUnknown_0202064C - adds r4, r0 - ldr r0, =sub_8172508 - str r0, [r4] - movs r0, 0x3 - ldr r2, [sp, 0x8] - ands r2, r0 - lsls r2, 2 - ldrb r0, [r5, 0x5] - movs r3, 0xD - negs r3, r3 - adds r1, r3, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r5, 0x5] - lsls r0, r7, 5 - strh r0, [r5, 0x2E] - movs r0, 0xA - strh r0, [r5, 0x36] - movs r0, 0x2 - strh r0, [r5, 0x38] - movs r0, 0x1 - strh r0, [r5, 0x3A] -_0817206A: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x7 - bls _0817200A - ldr r0, =gUnknown_030022C0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08172092 - ldr r0, =gUnknown_02020630 - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x3C] -_08172092: - mov r0, r9 - bl DestroyTask - 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_8171FC4 - - thumb_func_start sub_81720C8 -sub_81720C8: @ 81720C8 - 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 r9, r0 - ldr r0, =gTasks - mov r2, r9 - lsls r1, r2, 2 - add r1, r9 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x26] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldrb r3, [r1, 0xA] - str r3, [sp] - ldrb r0, [r1, 0xC] - str r0, [sp, 0x4] - ldrb r2, [r1, 0xE] - str r2, [sp, 0x8] - ldrb r1, [r1, 0x10] - str r1, [sp, 0xC] - movs r7, 0 - ldr r3, =gUnknown_02020630 - mov r10, r3 - mov r1, r8 - lsls r0, r1, 1 - add r0, r8 - lsls r0, 3 - str r0, [sp, 0x10] -_0817210E: - ldr r0, =gUnknown_085E51F0 - ldr r2, [sp, 0x10] - adds r0, r2, r0 - ldr r1, [sp] - ldr r2, [sp, 0x4] - ldr r3, [sp, 0xC] - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x40 - beq _0817216E - bl sub_8171E20 - lsls r4, r6, 4 - adds r4, r6 - lsls r4, 2 - mov r3, r10 - adds r5, r4, r3 - ldr r0, =gUnknown_085E51B4 - add r0, r8 - ldrb r1, [r0] - adds r0, r5, 0 - bl StartObjectImageAnim - ldr r0, =gUnknown_0202064C - adds r4, r0 - ldr r0, =sub_8172508 - str r0, [r4] - movs r0, 0x3 - ldr r2, [sp, 0x8] - ands r2, r0 - lsls r2, 2 - ldrb r0, [r5, 0x5] - movs r3, 0xD - negs r3, r3 - adds r1, r3, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r5, 0x5] - lsls r0, r7, 5 - strh r0, [r5, 0x2E] - movs r0, 0xA - strh r0, [r5, 0x36] - movs r0, 0x1 - strh r0, [r5, 0x38] - movs r0, 0x2 - strh r0, [r5, 0x3A] -_0817216E: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x7 - bls _0817210E - ldr r0, =gUnknown_030022C0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08172196 - ldr r0, =gUnknown_02020630 - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x3C] -_08172196: - mov r0, r9 - bl DestroyTask - 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_81720C8 - - thumb_func_start sub_81721CC -sub_81721CC: @ 81721CC - 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 r9, r0 - ldr r1, =gTasks - lsls r0, 2 - add r0, r9 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x26] - lsls r1, 24 - lsrs r1, 24 - ldrb r2, [r0, 0xA] - str r2, [sp] - ldrb r3, [r0, 0xC] - str r3, [sp, 0x4] - ldrb r2, [r0, 0xE] - str r2, [sp, 0x8] - ldrb r0, [r0, 0x10] - str r0, [sp, 0xC] - movs r7, 0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - str r0, [sp, 0x10] - ldr r3, =gUnknown_02020630 - mov r8, r3 - ldr r0, =gUnknown_085E51B4 - adds r1, r0 - mov r10, r1 -_08172212: - ldr r0, =gUnknown_085E51F0 - ldr r1, [sp, 0x10] - adds r0, r1, r0 - ldr r1, [sp] - ldr r2, [sp, 0x4] - ldr r3, [sp, 0xC] - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x40 - beq _0817226E - bl sub_8171E20 - lsls r4, r6, 4 - adds r4, r6 - lsls r4, 2 - mov r2, r8 - adds r5, r4, r2 - mov r3, r10 - ldrb r1, [r3] - adds r0, r5, 0 - bl StartObjectImageAnim - ldr r0, =gUnknown_0202064C - adds r4, r0 - ldr r0, =sub_8172508 - str r0, [r4] - movs r0, 0x3 - ldr r2, [sp, 0x8] - ands r2, r0 - lsls r2, 2 - ldrb r0, [r5, 0x5] - movs r3, 0xD - negs r3, r3 - adds r1, r3, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r5, 0x5] - lsls r0, r7, 5 - strh r0, [r5, 0x2E] - movs r0, 0x4 - strh r0, [r5, 0x36] - movs r0, 0x1 - strh r0, [r5, 0x38] - strh r0, [r5, 0x3A] -_0817226E: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x7 - bls _08172212 - ldr r0, =gUnknown_030022C0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08172296 - ldr r0, =gUnknown_02020630 - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x3C] -_08172296: - mov r0, r9 - bl DestroyTask - 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_81721CC - - thumb_func_start sub_81722CC -sub_81722CC: @ 81722CC - 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 r9, r0 - ldr r0, =gTasks - mov r2, r9 - lsls r1, r2, 2 - add r1, r9 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x26] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldrb r3, [r1, 0xA] - str r3, [sp] - ldrb r0, [r1, 0xC] - str r0, [sp, 0x4] - ldrb r2, [r1, 0xE] - str r2, [sp, 0x8] - ldrb r1, [r1, 0x10] - str r1, [sp, 0xC] - movs r7, 0 - ldr r3, =gUnknown_02020630 - mov r10, r3 - mov r1, r8 - lsls r0, r1, 1 - add r0, r8 - lsls r0, 3 - str r0, [sp, 0x10] -_08172312: - ldr r0, =gUnknown_085E51F0 - ldr r2, [sp, 0x10] - adds r0, r2, r0 - ldr r1, [sp] - ldr r2, [sp, 0x4] - ldr r3, [sp, 0xC] - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x40 - beq _08172376 - bl sub_8171E20 - lsls r4, r6, 4 - adds r4, r6 - lsls r4, 2 - mov r3, r10 - adds r5, r4, r3 - ldr r0, =gUnknown_085E51B4 - add r0, r8 - ldrb r1, [r0] - adds r0, r5, 0 - bl StartObjectImageAnim - ldr r0, =gUnknown_0202064C - adds r4, r0 - ldr r0, =sub_8172508 - str r0, [r4] - movs r0, 0x3 - ldr r2, [sp, 0x8] - ands r2, r0 - lsls r2, 2 - ldrb r0, [r5, 0x5] - movs r3, 0xD - negs r3, r3 - adds r1, r3, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r5, 0x5] - lsls r0, r7, 1 - adds r0, r7 - lsls r0, 3 - adds r0, r7 - strh r0, [r5, 0x2E] - movs r0, 0x5 - strh r0, [r5, 0x36] - movs r0, 0x1 - strh r0, [r5, 0x38] - strh r0, [r5, 0x3A] -_08172376: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x9 - bls _08172312 - ldr r0, =gUnknown_030022C0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0817239E - ldr r0, =gUnknown_02020630 - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x3C] -_0817239E: - mov r0, r9 - bl DestroyTask - 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_81722CC - - thumb_func_start sub_81723D4 -sub_81723D4: @ 81723D4 - 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 - mov r8, r0 - ldr r1, =gTasks - lsls r2, r0, 2 - adds r0, r2, r0 - lsls r0, 3 - adds r3, r0, r1 - ldrh r1, [r3, 0x16] - movs r4, 0x16 - ldrsh r0, [r3, r4] - cmp r0, 0 - beq _08172404 - subs r0, r1, 0x1 - strh r0, [r3, 0x16] - b _081724D6 - .pool -_08172404: - ldrh r0, [r3, 0x26] - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r3, 0xA] - str r1, [sp] - ldrb r4, [r3, 0xC] - str r4, [sp, 0x4] - ldrb r1, [r3, 0xE] - str r1, [sp, 0x8] - ldrb r3, [r3, 0x10] - str r3, [sp, 0xC] - movs r7, 0 - str r2, [sp, 0x14] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 3 - str r1, [sp, 0x10] - ldr r3, =gUnknown_02020630 - mov r9, r3 - ldr r1, =gUnknown_085E51B4 - adds r0, r1 - mov r10, r0 -_08172430: - ldr r0, =gUnknown_085E51F0 - ldr r4, [sp, 0x10] - adds r0, r4, r0 - ldr r1, [sp] - ldr r2, [sp, 0x4] - ldr r3, [sp, 0xC] - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x40 - beq _0817248C - bl sub_8171E20 - lsls r4, r6, 4 - adds r4, r6 - lsls r4, 2 - mov r0, r9 - adds r5, r4, r0 - mov r3, r10 - ldrb r1, [r3] - adds r0, r5, 0 - bl StartObjectImageAnim - ldr r0, =gUnknown_0202064C - adds r4, r0 - ldr r0, =sub_8172508 - str r0, [r4] - movs r0, 0x3 - ldr r2, [sp, 0x8] - ands r2, r0 - lsls r2, 2 - ldrb r0, [r5, 0x5] - movs r3, 0xD - negs r3, r3 - adds r1, r3, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r5, 0x5] - lsls r0, r7, 5 - strh r0, [r5, 0x2E] - movs r0, 0x8 - strh r0, [r5, 0x36] - movs r0, 0x2 - strh r0, [r5, 0x38] - strh r0, [r5, 0x3A] -_0817248C: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x7 - bls _08172430 - ldr r0, =gTasks - ldr r1, [sp, 0x14] - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r0, 0x8 - strh r0, [r1, 0x16] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - lsls r0, 16 - asrs r2, r0, 16 - cmp r2, 0x2 - bne _081724D6 - ldr r0, =gUnknown_030022C0 - ldr r4, =0x00000439 - adds r0, r4 - ldrb r1, [r0] - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _081724D0 - ldr r0, =gUnknown_02020630 - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x3C] -_081724D0: - mov r0, r8 - bl DestroyTask -_081724D6: - 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_81723D4 - - thumb_func_start sub_8172508 -sub_8172508: @ 8172508 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r2, 0x30 - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r2, 0x32 - ldrsh r1, [r4, r2] - bl cosine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x36] - ldrh r1, [r4, 0x2E] - adds r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x38] - ldrh r2, [r4, 0x30] - adds r0, r2 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x3A] - ldrh r1, [r4, 0x32] - adds r0, r1 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x33 - bne _08172558 - adds r0, r4, 0 - bl sub_8172944 -_08172558: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8172508 - - thumb_func_start sub_8172560 -sub_8172560: @ 8172560 - 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 r9, r0 - ldr r1, =gTasks - lsls r0, 2 - add r0, r9 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x26] - lsls r1, 24 - lsrs r1, 24 - ldrb r2, [r0, 0xA] - str r2, [sp] - ldrb r3, [r0, 0xC] - str r3, [sp, 0x4] - ldrb r2, [r0, 0xE] - str r2, [sp, 0x8] - ldrb r0, [r0, 0x10] - str r0, [sp, 0xC] - movs r7, 0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - str r0, [sp, 0x10] - ldr r3, =gUnknown_02020630 - mov r8, r3 - ldr r0, =gUnknown_085E51B4 - adds r1, r0 - mov r10, r1 -_081725A6: - ldr r0, =gUnknown_085E51F0 - ldr r1, [sp, 0x10] - adds r0, r1, r0 - ldr r1, [sp] - ldr r2, [sp, 0x4] - ldr r3, [sp, 0xC] - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x40 - beq _081725FE - bl sub_8171E20 - lsls r4, r6, 4 - adds r4, r6 - lsls r4, 2 - mov r2, r8 - adds r5, r4, r2 - mov r3, r10 - ldrb r1, [r3] - adds r0, r5, 0 - bl StartObjectImageAnim - ldr r0, =gUnknown_0202064C - adds r4, r0 - ldr r0, =sub_817265C - str r0, [r4] - movs r0, 0x3 - ldr r2, [sp, 0x8] - ands r2, r0 - lsls r2, 2 - ldrb r0, [r5, 0x5] - movs r3, 0xD - negs r3, r3 - adds r1, r3, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r5, 0x5] - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 2 - adds r0, r7 - strh r0, [r5, 0x2E] -_081725FE: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0xB - bls _081725A6 - ldr r0, =gUnknown_030022C0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08172626 - ldr r0, =gUnknown_02020630 - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x3C] -_08172626: - mov r0, r9 - bl DestroyTask - 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_8172560 - - thumb_func_start sub_817265C -sub_817265C: @ 817265C - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - movs r2, 0x30 - ldrsh r1, [r5, r2] - bl sine - strh r0, [r5, 0x24] - movs r0, 0x2E - ldrsh r4, [r5, r0] - movs r2, 0x32 - ldrsh r1, [r5, r2] - adds r0, r4, 0 - bl sine - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl cosine - strh r0, [r5, 0x26] - ldrh r0, [r5, 0x2E] - adds r0, 0x6 - movs r1, 0xFF - ands r0, r1 - strh r0, [r5, 0x2E] - ldrh r0, [r5, 0x30] - adds r0, 0x1 - strh r0, [r5, 0x30] - ldrh r0, [r5, 0x32] - adds r0, 0x1 - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x34] - adds r0, 0x1 - strh r0, [r5, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x33 - bne _081726B4 - adds r0, r5, 0 - bl sub_8172944 -_081726B4: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_817265C - - thumb_func_start sub_81726BC -sub_81726BC: @ 81726BC - 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] - ldr r0, =gTasks - ldr r2, [sp] - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x26] - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldrb r3, [r1, 0xA] - str r3, [sp, 0x4] - ldrb r0, [r1, 0xC] - str r0, [sp, 0x8] - ldrb r2, [r1, 0xE] - str r2, [sp, 0xC] - ldrb r1, [r1, 0x10] - str r1, [sp, 0x10] - movs r3, 0 - mov r8, r3 - mov r1, r9 - lsls r0, r1, 1 - add r0, r9 - lsls r0, 3 - str r0, [sp, 0x14] -_08172700: - movs r7, 0 - movs r2, 0x1 - add r2, r8 - mov r10, r2 -_08172708: - ldr r0, =gUnknown_085E51F0 - ldr r3, [sp, 0x14] - adds r0, r3, r0 - ldr r1, [sp, 0x4] - ldr r2, [sp, 0x8] - ldr r3, [sp, 0x10] - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x40 - beq _08172790 - bl sub_8171E20 - lsls r4, r6, 4 - adds r4, r6 - lsls r4, 2 - ldr r0, =gUnknown_02020630 - adds r5, r4, r0 - ldr r0, =gUnknown_085E51B4 - add r0, r9 - ldrb r1, [r0] - adds r0, r5, 0 - bl StartObjectImageAnim - ldr r1, =gUnknown_0202064C - adds r4, r1 - ldr r0, =sub_8172508 - str r0, [r4] - movs r0, 0x3 - ldr r1, [sp, 0xC] - ands r1, r0 - lsls r1, 2 - ldrb r0, [r5, 0x5] - movs r3, 0xD - negs r3, r3 - adds r2, r3, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - lsls r0, r7, 5 - strh r0, [r5, 0x2E] - movs r0, 0x8 - strh r0, [r5, 0x36] - mov r0, r8 - cmp r0, 0 - bne _08172788 - movs r0, 0x2 - strh r0, [r5, 0x38] - movs r0, 0x1 - b _0817278E - .pool -_08172788: - movs r0, 0x1 - strh r0, [r5, 0x38] - movs r0, 0x2 -_0817278E: - strh r0, [r5, 0x3A] -_08172790: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x7 - bls _08172708 - mov r1, r10 - lsls r0, r1, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x1 - bls _08172700 - ldr r0, =gUnknown_030022C0 - ldr r2, =0x00000439 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _081727C4 - ldr r0, =gUnknown_02020630 - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x3C] -_081727C4: - ldr r0, [sp] - bl DestroyTask - 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_81726BC - - thumb_func_start sub_81727E8 -sub_81727E8: @ 81727E8 - 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 r9, r0 - ldr r1, =gTasks - lsls r0, 2 - add r0, r9 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x26] - lsls r1, 24 - lsrs r1, 24 - ldrb r2, [r0, 0xA] - str r2, [sp] - ldrb r3, [r0, 0xC] - str r3, [sp, 0x4] - ldrb r2, [r0, 0xE] - str r2, [sp, 0x8] - ldrb r0, [r0, 0x10] - str r0, [sp, 0xC] - movs r7, 0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - str r0, [sp, 0x10] - ldr r3, =gUnknown_02020630 - mov r8, r3 - ldr r0, =gUnknown_085E51B4 - adds r1, r0 - mov r10, r1 -_0817282E: - ldr r0, =gUnknown_085E51F0 - ldr r1, [sp, 0x10] - adds r0, r1, r0 - ldr r1, [sp] - ldr r2, [sp, 0x4] - ldr r3, [sp, 0xC] - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x40 - beq _08172880 - bl sub_8171E20 - lsls r4, r6, 4 - adds r4, r6 - lsls r4, 2 - mov r2, r8 - adds r5, r4, r2 - mov r3, r10 - ldrb r1, [r3] - adds r0, r5, 0 - bl StartObjectImageAnim - ldr r0, =gUnknown_0202064C - adds r4, r0 - ldr r0, =sub_81728E0 - str r0, [r4] - movs r0, 0x3 - ldr r2, [sp, 0x8] - ands r2, r0 - lsls r2, 2 - ldrb r0, [r5, 0x5] - movs r3, 0xD - negs r3, r3 - adds r1, r3, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r5, 0x5] - lsls r0, r7, 5 - strh r0, [r5, 0x2E] -_08172880: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x7 - bls _0817282E - ldr r0, =gUnknown_030022C0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _081728A8 - ldr r0, =gUnknown_02020630 - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x3C] -_081728A8: - mov r0, r9 - bl DestroyTask - 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_81727E8 - - thumb_func_start sub_81728E0 -sub_81728E0: @ 81728E0 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - movs r2, 0x30 - ldrsh r1, [r5, r2] - bl sine - strh r0, [r5, 0x24] - movs r0, 0x2E - ldrsh r4, [r5, r0] - ldrh r1, [r5, 0x2E] - movs r0, 0x3F - ands r0, r1 - movs r2, 0x32 - ldrsh r1, [r5, r2] - bl sine - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl cosine - strh r0, [r5, 0x26] - ldrh r0, [r5, 0x2E] - adds r0, 0xA - movs r1, 0xFF - ands r0, r1 - strh r0, [r5, 0x2E] - ldrh r0, [r5, 0x30] - adds r0, 0x1 - strh r0, [r5, 0x30] - ldrh r0, [r5, 0x32] - adds r0, 0x1 - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x34] - adds r0, 0x1 - strh r0, [r5, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x33 - bne _0817293C - adds r0, r5, 0 - bl sub_8172944 -_0817293C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81728E0 - - thumb_func_start sub_8172944 -sub_8172944: @ 8172944 - push {r4-r7,lr} - adds r7, r0, 0 - ldr r0, =gUnknown_030022C0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08172970 - movs r1, 0x3C - ldrsh r0, [r7, r1] - cmp r0, 0x1 - bne _081729CA - adds r0, r7, 0 - bl RemoveObjectAndFreeResources - b _081729E2 - .pool -_08172970: - ldr r2, =gUnknown_020244D0 - ldr r0, [r2] - ldr r1, [r0, 0x8] - ldrb r0, [r1, 0xA] - subs r0, 0x1 - strb r0, [r1, 0xA] - ldr r0, [r2] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0xA] - cmp r0, 0 - bne _081729DC - movs r4, 0 - ldr r5, =gUnknown_085E51C0 - b _08172998 - .pool -_08172994: - adds r5, 0x4 - adds r4, 0x1 -_08172998: - cmp r4, 0xB - bgt _081729AA - ldr r0, [r5] - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08172994 -_081729AA: - cmp r4, 0xC - bne _081729CA - movs r6, 0 - ldr r5, =gUnknown_085E5094 - ldr r4, =gUnknown_085E50F4 -_081729B4: - ldrh r0, [r5, 0x6] - bl FreeObjectTilesByTag - ldrh r0, [r4, 0x4] - bl FreeObjectPaletteByTag - adds r5, 0x8 - adds r4, 0x8 - adds r6, 0x1 - cmp r6, 0xB - ble _081729B4 -_081729CA: - adds r0, r7, 0 - bl RemoveObjectAndFreeTiles - b _081729E2 - .pool -_081729DC: - adds r0, r7, 0 - bl RemoveObjectAndFreeTiles -_081729E2: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8172944 - - thumb_func_start sub_81729E8 -sub_81729E8: @ 81729E8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - adds r4, r0, 0 - mov r9, r2 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r3, 24 - lsrs r7, r3, 24 - ldr r0, =sub_8172AB0 - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =gTasks - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r5, r0, r1 - strh r7, [r5, 0x26] - strh r6, [r5, 0xE] - mov r0, r9 - strh r0, [r5, 0x1C] - mov r1, r9 - lsrs r0, r1, 16 - strh r0, [r5, 0x1E] - cmp r4, 0 - bne _08172A58 - lsls r0, r6, 20 - movs r2, 0x80 - lsls r2, 17 - adds r0, r2 - lsrs r0, 16 - ldr r2, =gUnknown_085E5310 - lsls r1, r7, 1 - adds r1, r2 - ldrh r3, [r1] - movs r1, 0x10 - movs r2, 0 - bl BlendPalette - movs r0, 0x1 - strh r0, [r5, 0xA] - b _08172A7E - .pool -_08172A58: - lsls r0, r6, 20 - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - lsrs r0, 16 - ldr r2, =gUnknown_085E5310 - lsls r1, r7, 1 - adds r1, r2 - ldrh r3, [r1] - movs r1, 0x10 - movs r2, 0x10 - bl BlendPalette - movs r0, 0x10 - strh r0, [r5, 0x8] - ldr r0, =0x0000ffff - strh r0, [r5, 0xA] - ldr r0, =sub_8172B40 - str r0, [r5] -_08172A7E: - ldr r0, =0x00007fff - str r0, [sp] - mov r0, r9 - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - mov r0, r8 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81729E8 - - thumb_func_start sub_8172AB0 -sub_8172AB0: @ 8172AB0 - push {r4,r5,lr} - sub sp, 0x4 - 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, 0x26] - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0xC - ldrsh r0, [r4, r2] - cmp r0, 0x10 - bgt _08172B08 - movs r2, 0xE - ldrsh r0, [r4, r2] - lsls r0, 20 - movs r2, 0x80 - lsls r2, 17 - adds r0, r2 - lsrs r0, 16 - ldrb r2, [r4, 0x8] - ldr r3, =gUnknown_085E5310 - lsls r1, 1 - adds r1, r3 - ldrh r3, [r1] - movs r1, 0x10 - bl BlendPalette - ldrh r0, [r4, 0xA] - ldrh r1, [r4, 0x8] - adds r0, r1 - strh r0, [r4, 0x8] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - b _08172B30 - .pool -_08172B08: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08172B30 - ldrh r0, [r4, 0x1C] - ldrh r1, [r4, 0x1E] - lsls r1, 16 - orrs r0, r1 - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - adds r0, r5, 0 - bl DestroyTask -_08172B30: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8172AB0 - - thumb_func_start sub_8172B40 -sub_8172B40: @ 8172B40 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08172B78 - ldr r0, =gTasks - lsls r4, r2, 2 - adds r4, r2 - lsls r4, 3 - adds r4, r0 - ldrh r0, [r4, 0x1C] - ldrh r1, [r4, 0x1E] - lsls r1, 16 - orrs r0, r1 - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r0, =sub_8172B90 - str r0, [r4] -_08172B78: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8172B40 - - thumb_func_start sub_8172B90 -sub_8172B90: @ 8172B90 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r1, r0, 24 - movs r3, 0xC - ldrsh r0, [r4, r3] - cmp r0, 0x10 - bgt _08172BE4 - movs r2, 0xE - ldrsh r0, [r4, r2] - lsls r0, 20 - movs r3, 0x80 - lsls r3, 17 - adds r0, r3 - lsrs r0, 16 - ldrb r2, [r4, 0x8] - ldr r3, =gUnknown_085E5310 - lsls r1, 1 - adds r1, r3 - ldrh r3, [r1] - movs r1, 0x10 - bl BlendPalette - ldrh r0, [r4, 0xA] - ldrh r1, [r4, 0x8] - adds r0, r1 - strh r0, [r4, 0x8] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - b _08172BEA - .pool -_08172BE4: - adds r0, r2, 0 - bl DestroyTask -_08172BEA: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8172B90 - - thumb_func_start sub_8172BF0 -sub_8172BF0: @ 8172BF0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - movs r0, 0 - mov r8, r0 - ldr r0, =gUnknown_020241E4 - ldr r3, =gUnknown_02038436 - ldrb r2, [r3] - adds r0, r2, r0 - ldrb r6, [r0] - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r5, r0, r1 - movs r1, 0x1C - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _08172CC8 - cmp r0, 0x1 - bgt _08172C30 - cmp r0, 0 - beq _08172C36 - b _08172D8A - .pool -_08172C30: - cmp r0, 0x2 - beq _08172CDA - b _08172D8A -_08172C36: - ldr r0, =gUnknown_0203841E - ldrh r0, [r0] - strh r0, [r5, 0x1E] - movs r2, 0xA0 - lsls r2, 3 - adds r0, r2, 0 - ldrh r4, [r5, 0x8] - adds r0, r4 - strh r0, [r5, 0x8] - ldrb r0, [r3] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08172C78 - ldr r2, =gUnknown_02020630 - lsls r3, r6, 4 - adds r1, r3, r6 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r5, 0x8] - lsls r0, 16 - asrs r0, 24 - ldrh r4, [r1, 0x24] - adds r0, r4 - strh r0, [r1, 0x24] - adds r4, r3, 0 - b _08172C90 - .pool -_08172C78: - ldr r3, =gUnknown_02020630 - lsls r4, r6, 4 - adds r2, r4, r6 - lsls r2, 2 - adds r2, r3 - ldrh r1, [r5, 0x8] - lsls r1, 16 - asrs r1, 24 - ldrh r0, [r2, 0x24] - subs r0, r1 - strh r0, [r2, 0x24] - adds r2, r3, 0 -_08172C90: - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r3, r0, r1 - ldrb r0, [r3, 0x8] - strh r0, [r3, 0x8] - adds r0, r4, r6 - lsls r0, 2 - adds r0, r2 - movs r2, 0x20 - ldrsh r1, [r0, r2] - movs r4, 0x24 - ldrsh r0, [r0, r4] - adds r1, r0 - adds r1, 0x20 - movs r0, 0x98 - lsls r0, 1 - cmp r1, r0 - bls _08172D8A - ldrh r0, [r3, 0x1C] - adds r0, 0x1 - strh r0, [r3, 0x1C] - b _08172D8A - .pool -_08172CC8: - ldrb r1, [r5, 0x1E] - adds r0, r2, 0 - adds r2, r6, 0 - bl refresh_graphics_maybe - ldrh r0, [r5, 0x1C] - adds r0, 0x1 - strh r0, [r5, 0x1C] - b _08172D8A -_08172CDA: - movs r1, 0xA0 - lsls r1, 3 - adds r0, r1, 0 - ldrh r2, [r5, 0x8] - adds r0, r2 - strh r0, [r5, 0x8] - ldrb r0, [r3] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08172D10 - ldr r0, =gUnknown_02020630 - lsls r3, r6, 4 - adds r2, r3, r6 - lsls r2, 2 - adds r2, r0 - ldrh r1, [r5, 0x8] - lsls r1, 16 - asrs r1, 24 - ldrh r0, [r2, 0x24] - subs r0, r1 - strh r0, [r2, 0x24] - adds r4, r3, 0 - b _08172D28 - .pool -_08172D10: - ldr r0, =gUnknown_02020630 - lsls r2, r6, 4 - adds r1, r2, r6 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r5, 0x8] - lsls r0, 16 - asrs r0, 24 - ldrh r3, [r1, 0x24] - adds r0, r3 - strh r0, [r1, 0x24] - adds r4, r2, 0 -_08172D28: - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x8] - strh r1, [r0, 0x8] - ldr r0, =gUnknown_02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _08172D68 - ldr r0, =gUnknown_02020630 - adds r1, r4, r6 - lsls r1, 2 - adds r1, r0 - movs r4, 0x24 - ldrsh r0, [r1, r4] - cmp r0, 0 - bgt _08172D7E - movs r0, 0 - strh r0, [r1, 0x24] - b _08172D84 - .pool -_08172D68: - ldr r0, =gUnknown_02020630 - adds r1, r4, r6 - lsls r1, 2 - adds r1, r0 - movs r3, 0x24 - ldrsh r0, [r1, r3] - cmp r0, 0 - blt _08172D7E - strh r2, [r1, 0x24] - movs r4, 0x1 - mov r8, r4 -_08172D7E: - mov r0, r8 - cmp r0, 0 - beq _08172D8A -_08172D84: - adds r0, r7, 0 - bl move_anim_task_del -_08172D8A: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8172BF0 - - thumb_func_start sub_8172D98 -sub_8172D98: @ 8172D98 - 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, 0x26 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _08172E14 - cmp r0, 0x1 - bgt _08172DC0 - cmp r0, 0 - beq _08172DC6 - b _08172E84 - .pool -_08172DC0: - cmp r0, 0x2 - beq _08172E4E - b _08172E84 -_08172DC6: - ldr r0, =gUnknown_02038436 - ldrb r0, [r0] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08172DE8 - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - b _08172DF0 - .pool -_08172DE8: - ldr r1, =0x00003f44 - movs r0, 0x50 - bl SetGpuReg -_08172DF0: - movs r0, 0x52 - movs r1, 0x10 - bl SetGpuReg - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x26] - adds r0, 0x1 - strh r0, [r1, 0x26] - b _08172E84 - .pool -_08172E14: - ldrh r0, [r4, 0xA] - adds r1, r0, 0x1 - strh r1, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _08172E84 - movs r0, 0 - strh r0, [r4, 0xA] - ldrh r2, [r4, 0x8] - adds r2, 0x1 - strh r2, [r4, 0x8] - lsls r1, r2, 8 - movs r0, 0x10 - subs r0, r2 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x10 - bne _08172E84 - ldrh r0, [r4, 0x26] - adds r0, 0x1 - strh r0, [r4, 0x26] - b _08172E84 -_08172E4E: - ldr r1, =gUnknown_020241E4 - ldr r4, =gUnknown_02038436 - ldrb r0, [r4] - adds r0, r1 - ldrb r1, [r0] - ldr r2, =gUnknown_02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x4] - lsls r1, 22 - lsrs r1, 17 - ldr r0, =0x06010000 - adds r1, r0 - movs r2, 0x80 - lsls r2, 4 - movs r0, 0 - movs r3, 0x1 - bl RequestDma3Fill - ldrb r0, [r4] - bl sub_805E974 - adds r0, r5, 0 - bl move_anim_task_del -_08172E84: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8172D98 - - thumb_func_start sub_8172E9C -sub_8172E9C: @ 8172E9C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gUnknown_0203841E - ldr r1, =gUnknown_020244D0 - ldr r2, [r1] - ldr r1, =gUnknown_02038436 - ldrb r1, [r1] - ldr r2, [r2] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - lsls r1, 29 - lsrs r1, 31 - strh r1, [r3, 0xE] - bl move_anim_task_del - pop {r0} - bx r0 - .pool - thumb_func_end sub_8172E9C - - thumb_func_start sub_8172ED0 -sub_8172ED0: @ 8172ED0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_02038437 - ldr r1, =gUnknown_0202420E - ldrb r1, [r1] - strb r1, [r2] - bl move_anim_task_del - pop {r0} - bx r0 - .pool - thumb_func_end sub_8172ED0 - - thumb_func_start sub_8172EF0 -sub_8172EF0: @ 8172EF0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r1, 0 - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0 - mov r8, r0 - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] - adds r0, r4, 0 - movs r1, 0x1 - bl pokemon_getattr - adds r5, r0, 0 - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - adds r4, r0, 0 - adds r0, r6, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _08172FC8 - lsrs r0, r5, 16 - ldr r7, =0x0000ffff - ands r5, r7 - eors r0, r5 - lsrs r1, r4, 16 - eors r0, r1 - ands r4, r7 - eors r0, r4 - cmp r0, 0x7 - bhi _08172F4E - movs r0, 0x1 - mov r8, r0 -_08172F4E: - mov r0, r8 - cmp r0, 0 - beq _08172FC8 - ldr r0, =0x000027f9 - bl GetObjectTileRangeStartByTag - lsls r0, 16 - lsrs r0, 16 - cmp r0, r7 - bne _08172F6E - ldr r0, =gUnknown_0852528C - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_08525B94 - bl LoadCompressedObjectPaletteUsingHeap -_08172F6E: - ldr r5, =sub_8172FEC - adds r0, r5, 0 - movs r1, 0xA - bl CreateTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0xA - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gTasks - lsls r2, r4, 2 - adds r2, r4 - lsls r2, 3 - adds r2, r3 - movs r4, 0 - strh r6, [r2, 0x8] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r3 - strh r6, [r1, 0x8] - strh r4, [r2, 0xA] - movs r0, 0x1 - strh r0, [r1, 0xA] - b _08172FDE - .pool -_08172FC8: - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x1] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0, 0x1] -_08172FDE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8172EF0 - - thumb_func_start sub_8172FEC -sub_8172FEC: @ 8172FEC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r4, r0, r1 - ldrh r1, [r4, 0x22] - movs r2, 0x22 - ldrsh r0, [r4, r2] - cmp r0, 0x3B - bgt _08173018 - adds r0, r1, 0x1 - strh r0, [r4, 0x22] - b _08173190 - .pool -_08173018: - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0xA] - cmp r0, 0 - beq _08173026 - b _08173190 -_08173026: - ldrh r0, [r4, 0x1C] - adds r1, r0, 0x1 - strh r1, [r4, 0x1C] - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r0 - cmp r1, 0 - beq _0817303A - b _08173190 -_0817303A: - ldrb r0, [r4, 0x8] - mov r8, r0 - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r5, r0, 24 - mov r0, r8 - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0x1E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08173074 - ldr r0, =gUnknown_085CE388 - adds r1, r5, 0 - movs r3, 0x5 - bl AddObjectToFront - lsls r0, 24 - lsrs r5, r0, 24 - b _081730D6 - .pool -_08173074: - cmp r0, 0 - blt _081730A8 - cmp r0, 0x3 - bgt _081730A8 - ldr r0, =gUnknown_085CE3A0 - adds r1, r5, 0 - movs r3, 0x5 - bl AddObjectToFront - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gUnknown_02020630 - lsls r2, r5, 4 - adds r2, r5 - lsls r2, 2 - adds r2, r0 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x4 - b _081730C8 - .pool -_081730A8: - ldr r0, =gUnknown_085CE3A0 - adds r1, r5, 0 - movs r3, 0x5 - bl AddObjectToFront - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gUnknown_02020630 - lsls r2, r5, 4 - adds r2, r5 - lsls r2, 2 - adds r2, r0 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x5 -_081730C8: - ldr r4, =0x000003ff - adds r0, r4, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x4] -_081730D6: - ldr r2, =gTasks - lsls r1, r7, 2 - adds r0, r1, r7 - lsls r0, 3 - adds r6, r0, r2 - movs r2, 0xA - ldrsh r0, [r6, r2] - mov r9, r1 - cmp r0, 0 - bne _08173118 - ldr r1, =gUnknown_02020630 - lsls r2, r5, 4 - adds r0, r2, r5 - lsls r0, 2 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_81731FC - str r1, [r0] - adds r4, r2, 0 - b _08173160 - .pool -_08173118: - ldr r3, =gUnknown_02020630 - lsls r4, r5, 4 - adds r1, r4, r5 - lsls r1, 2 - adds r0, r3, 0 - adds r0, 0x1C - adds r0, r1, r0 - ldr r2, =sub_8173250 - str r2, [r0] - adds r1, r3 - ldr r0, =0x0000ffe0 - strh r0, [r1, 0x24] - movs r0, 0x20 - strh r0, [r1, 0x26] - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - movs r1, 0x1E - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _08173160 - mov r0, r8 - bl battle_side_get_owner - lsls r0, 24 - movs r1, 0x3F - cmp r0, 0 - bne _08173156 - movs r1, 0xC0 -_08173156: - lsls r1, 24 - asrs r1, 24 - movs r0, 0x66 - bl audio_play_and_stuff -_08173160: - ldr r1, =gUnknown_02020630 - adds r0, r4, r5 - lsls r0, 2 - adds r0, r1 - strh r7, [r0, 0x2E] - ldr r1, =gTasks - mov r2, r9 - adds r0, r2, r7 - lsls r0, 3 - adds r1, r0, r1 - ldrh r0, [r1, 0x1E] - adds r0, 0x1 - strh r0, [r1, 0x1E] - cmp r5, 0x40 - beq _08173184 - ldrh r0, [r1, 0x20] - adds r0, 0x1 - strh r0, [r1, 0x20] -_08173184: - movs r4, 0x1E - ldrsh r0, [r1, r4] - cmp r0, 0x5 - bne _08173190 - ldr r0, =sub_81731B0 - str r0, [r1] -_08173190: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8172FEC - - thumb_func_start sub_81731B0 -sub_81731B0: @ 81731B0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - adds r3, r0, 0 - ldr r1, =gTasks - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r1, r0, r1 - movs r2, 0x20 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _081731F0 - movs r2, 0xA - ldrsh r0, [r1, r2] - cmp r0, 0x1 - bne _081731EA - ldrb r1, [r1, 0x8] - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0, 0x1] -_081731EA: - adds r0, r3, 0 - bl DestroyTask -_081731F0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81731B0 - - thumb_func_start sub_81731FC -sub_81731FC: @ 81731FC - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x18 - bl sine - strh r0, [r4, 0x24] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x18 - bl cosine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0xC - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _08173246 - ldr r2, =gTasks - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r1, [r0, 0x20] - subs r1, 0x1 - strh r1, [r0, 0x20] - adds r0, r4, 0 - bl obj_free_rotscale_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_08173246: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81731FC - - thumb_func_start sub_8173250 -sub_8173250: @ 8173250 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x30] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r0, 0x3 - bgt _08173264 - adds r0, r1, 0x1 - strh r0, [r4, 0x30] - b _081732A6 -_08173264: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldrh r1, [r4, 0x24] - adds r1, 0x5 - strh r1, [r4, 0x24] - ldrh r0, [r4, 0x26] - subs r0, 0x5 - strh r0, [r4, 0x26] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x20 - ble _081732A6 - ldr r2, =gTasks - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r1, [r0, 0x20] - subs r1, 0x1 - strh r1, [r0, 0x20] - adds r0, r4, 0 - bl obj_free_rotscale_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_081732A6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173250 - - thumb_func_start sub_81732B0 -sub_81732B0: @ 81732B0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_085253AC - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_08525CB4 - bl LoadCompressedObjectPaletteUsingHeap - ldr r0, =0x0000281d - bl IndexOfObjectPaletteTag - adds r0, r4, 0 - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81732B0 - - thumb_func_start sub_81732E4 -sub_81732E4: @ 81732E4 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =0x0000281d - adds r0, r5, 0 - bl FreeObjectTilesByTag - adds r0, r5, 0 - bl FreeObjectPaletteByTag - adds r0, r4, 0 - bl move_anim_task_del - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81732E4 - - thumb_func_start sub_817330C -sub_817330C: @ 817330C - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0 - bl sub_80A69CC - movs r0, 0x1E - strh r0, [r4, 0x2E] - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - ldr r5, =gUnknown_0203841E - lsrs r0, 24 - ldrh r1, [r5, 0x4] - adds r0, r1 - strh r0, [r4, 0x32] - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r5, [r5, 0x6] - adds r0, r5 - strh r0, [r4, 0x36] - ldr r0, =0x0000ffe0 - strh r0, [r4, 0x38] - adds r0, r4, 0 - bl sub_80A68D4 - ldr r2, =gUnknown_02020630 - ldr r1, =gUnknown_020241E4 - ldr r0, =gUnknown_02038436 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_8039E84 - str r1, [r0] - ldr r0, =sub_817339C - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817330C - - thumb_func_start sub_817339C -sub_817339C: @ 817339C - push {lr} - adds r3, r0, 0 - ldr r2, =gUnknown_02020630 - ldr r1, =gUnknown_020241E4 - ldr r0, =gUnknown_02038436 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x2B - ldrb r0, [r0] - cmp r0, 0x1 - bne _081733C0 - ldr r0, =sub_81733D4 - str r0, [r3, 0x1C] -_081733C0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_817339C - - thumb_func_start sub_81733D4 -sub_81733D4: @ 81733D4 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _081733F6 - movs r0, 0 - strh r0, [r4, 0x2E] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_8173400 - str r0, [r4, 0x1C] -_081733F6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81733D4 - - thumb_func_start sub_8173400 -sub_8173400: @ 8173400 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =gUnknown_02020630 - ldr r3, =gUnknown_020241E4 - ldr r2, =gUnknown_02038436 - ldrb r0, [r2] - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 27 - cmp r0, 0 - bge _08173448 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - cmp r0, 0 - ble _08173448 - ldrb r0, [r2] - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0 - bl StartObjectImageAnim - adds r0, r4, 0 - bl move_anim_8072740 -_08173448: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173400 - - thumb_func_start sub_817345C -sub_817345C: @ 817345C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_0203841E - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _08173478 - cmp r0, 0x1 - beq _0817348C - b _081734A0 - .pool -_08173478: - movs r0, 0 - bl battle_get_side_with_given_state - ldr r1, =gUnknown_02038436 - strb r0, [r1] - movs r0, 0x1 - b _08173498 - .pool -_0817348C: - movs r0, 0x1 - bl battle_get_side_with_given_state - ldr r1, =gUnknown_02038436 - strb r0, [r1] - movs r0, 0 -_08173498: - bl battle_get_side_with_given_state - ldr r1, =gUnknown_02038437 - strb r0, [r1] -_081734A0: - adds r0, r4, 0 - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817345C - - thumb_func_start sub_81734B4 -sub_81734B4: @ 81734B4 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrh r1, [r0] - cmp r1, 0x53 - bne _081734D4 - ldr r1, =gUnknown_0203841E - movs r0, 0x1 - b _0817350C - .pool -_081734D4: - cmp r1, 0xFA - bne _081734E4 - ldr r1, =gUnknown_0203841E - movs r0, 0x2 - b _0817350C - .pool -_081734E4: - cmp r1, 0x80 - bne _081734F4 - ldr r1, =gUnknown_0203841E - movs r0, 0x3 - b _0817350C - .pool -_081734F4: - movs r0, 0xA4 - lsls r0, 1 - cmp r1, r0 - bne _08173508 - ldr r1, =gUnknown_0203841E - movs r0, 0x4 - b _0817350C - .pool -_08173508: - ldr r1, =gUnknown_0203841E - movs r0, 0 -_0817350C: - strh r0, [r1] - adds r0, r2, 0 - bl move_anim_task_del - pop {r0} - bx r0 - .pool - thumb_func_end sub_81734B4 - - thumb_func_start sub_817351C -sub_817351C: @ 817351C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gUnknown_02038436 - ldr r1, =gUnknown_020244D0 - ldr r2, [r1] - ldr r1, [r2, 0x8] - ldrh r1, [r1] - strb r1, [r3] - ldr r3, =gUnknown_02038437 - ldr r1, [r2, 0x8] - ldrh r1, [r1] - lsrs r1, 8 - strb r1, [r3] - bl move_anim_task_del - pop {r0} - bx r0 - .pool - thumb_func_end sub_817351C - - thumb_func_start sub_817354C -sub_817354C: @ 817354C - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - thumb_func_end sub_817354C - - thumb_func_start sub_8173560 -sub_8173560: @ 8173560 - push {lr} - bl RunTasks - bl RunTextPrinters - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl UpdatePaletteFade - pop {r0} - bx r0 - thumb_func_end sub_8173560 - - thumb_func_start sub_817357C -sub_817357C: @ 817357C - push {r4,lr} - sub sp, 0x4 - ldr r0, =gUnknown_030022C0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x4 - bls _08173590 - b _08173688 -_08173590: - lsls r0, 2 - ldr r1, =_081735A4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081735A4: - .4byte _081735B8 - .4byte _081735E8 - .4byte _081735EE - .4byte _08173620 - .4byte _0817365C -_081735B8: - movs r0, 0 - bl SetVBlankCallback - bl sub_8174EC4 - ldr r4, =gUnknown_0203BCDC - ldr r0, =0x00002014 - bl AllocZeroed - str r0, [r4] - ldr r0, =gUnknown_030022C0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - b _08173688 - .pool -_081735E8: - bl sub_8174F70 - b _08173642 -_081735EE: - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0xE2 - lsls r1, 3 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - bl sub_8174FAC - ldr r0, =gUnknown_0203BCDC - ldr r1, [r0] - movs r0, 0 - strh r0, [r1] - b _08173642 - .pool -_08173620: - bl sub_8175024 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _08173688 - ldr r0, =sub_817354C - bl SetVBlankCallback - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade -_08173642: - ldr r1, =gUnknown_030022C0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08173688 - .pool -_0817365C: - bl UpdatePaletteFade - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08173688 - ldr r0, =sub_8173560 - bl SetMainCallback2 - movs r0, 0xDA - lsls r0, 1 - bl song_play_for_text - movs r0, 0 - b _0817368A - .pool -_08173688: - movs r0, 0x1 -_0817368A: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_817357C - - thumb_func_start sub_8173694 -sub_8173694: @ 8173694 - push {r4,lr} - bl sub_817357C - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _081736C4 - ldr r0, =sub_817371C - 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] - ldr r4, =gUnknown_0203BCD8 - movs r0, 0x78 - bl AllocZeroed - str r0, [r4] -_081736C4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173694 - - thumb_func_start sub_81736D8 -sub_81736D8: @ 81736D8 - push {r4,lr} - bl sub_817357C - lsls r0, 24 - cmp r0, 0 - bne _08173708 - ldr r0, =sub_817371C - 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 r0, 0x1 - strh r0, [r1, 0x8] - ldr r4, =gUnknown_0203BCD8 - movs r0, 0x78 - bl AllocZeroed - str r0, [r4] -_08173708: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81736D8 - - thumb_func_start sub_817371C -sub_817371C: @ 817371C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - 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 r1, 0 - strh r1, [r0, 0xC] - movs r7, 0 - ldr r0, =gUnknown_0203BCD8 - mov r9, r0 -_08173740: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =gUnknown_020244EC - adds r6, r1, r0 - adds r0, r6, 0 - movs r1, 0xB - bl pokemon_getattr - adds r5, r0, 0 - cmp r5, 0 - beq _0817380C - adds r0, r6, 0 - movs r1, 0x41 - bl pokemon_getattr - mov r1, r9 - ldr r3, [r1] - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 2 - adds r3, r4 - ldr r2, =0x000001ff - adds r1, r2, 0 - ands r0, r1 - ldrh r1, [r3, 0x8] - ldr r5, =0xfffffe00 - adds r2, r5, 0 - ands r1, r2 - orrs r1, r0 - strh r1, [r3, 0x8] - adds r0, r6, 0 - movs r1, 0x1 - bl pokemon_getattr - mov r2, r9 - ldr r1, [r2] - adds r1, r4 - str r0, [r1] - adds r0, r6, 0 - movs r1, 0 - bl pokemon_getattr - mov r5, r9 - ldr r1, [r5] - adds r1, 0x4 - adds r1, r4 - str r0, [r1] - adds r0, r6, 0 - movs r1, 0x38 - bl pokemon_getattr - ldr r2, [r5] - adds r2, r4 - lsls r0, 1 - ldrb r3, [r2, 0x9] - movs r1, 0x1 - ands r1, r3 - orrs r1, r0 - strb r1, [r2, 0x9] - adds r0, r6, 0 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - movs r2, 0 - mov r6, r8 - lsls r5, r6, 2 - ldr r3, =gUnknown_0203BCD8 -_081737CA: - ldr r0, [r3] - adds r1, r2, r4 - adds r0, 0xA - adds r0, r1 - mov r6, sp - adds r1, r6, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x9 - bls _081737CA - ldr r0, =gTasks - mov r2, r8 - adds r1, r5, r2 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0xC] - adds r0, 0x1 - strh r0, [r1, 0xC] - b _08173840 - .pool -_0817380C: - mov r6, r9 - ldr r3, [r6] - lsls r2, r7, 2 - adds r2, r7 - lsls r2, 2 - adds r4, r3, r2 - ldrh r0, [r4, 0x8] - ldr r6, =0xfffffe00 - adds r1, r6, 0 - ands r0, r1 - strh r0, [r4, 0x8] - str r5, [r4] - adds r3, 0x4 - adds r3, r2 - str r5, [r3] - ldrb r1, [r4, 0x9] - movs r0, 0x1 - ands r0, r1 - strb r0, [r4, 0x9] - mov r1, r9 - ldr r0, [r1] - adds r0, r2 - movs r1, 0xFF - strb r1, [r0, 0xA] - mov r2, r8 - lsls r5, r2, 2 -_08173840: - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, 0x5 - bhi _0817384C - b _08173740 -_0817384C: - ldr r0, =gUnknown_0203BCD4 - movs r3, 0 - str r3, [r0] - ldr r4, =gTasks - mov r6, r8 - adds r1, r5, r6 - lsls r1, 3 - adds r2, r1, r4 - strh r3, [r2, 0xA] - movs r0, 0xFF - strh r0, [r2, 0x10] - movs r7, 0 - adds r3, r4, 0 - adds r3, 0x8 - movs r2, 0xFF -_0817386A: - adds r0, r7, 0x5 - lsls r0, 1 - adds r0, r1 - adds r0, r3 - strh r2, [r0] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, 0x5 - bls _0817386A - mov r1, r8 - adds r0, r5, r1 - lsls r0, 3 - adds r1, r0, r4 - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _081738A4 - ldr r0, =sub_8173A8C - b _081738A6 - .pool -_081738A4: - ldr r0, =sub_81738BC -_081738A6: - str 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_817371C - - thumb_func_start sub_81738BC -sub_81738BC: @ 81738BC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r7, =0x0201c000 - ldr r0, =gUnknown_0203BCE4 - ldrb r0, [r0] - cmp r0, 0 - bne _081738EC - movs r2, 0x80 - lsls r2, 6 - adds r0, r7, 0 - movs r1, 0 - bl memset - b _08173906 - .pool -_081738EC: - movs r0, 0x3 - bl sub_81534D0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08173906 - movs r2, 0x80 - lsls r2, 6 - adds r0, r7, 0 - movs r1, 0 - bl memset -_08173906: - movs r5, 0 - ldrh r1, [r7, 0x8] - ldr r2, =0x000001ff - adds r0, r2, 0 - ands r0, r1 - mov r1, r9 - lsls r1, 2 - mov r8, r1 - cmp r0, 0 - beq _08173930 -_0817391A: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - adds r7, 0x78 - cmp r5, 0x31 - bhi _08173934 - ldrh r1, [r7, 0x8] - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _0817391A -_08173930: - cmp r5, 0x31 - bls _08173956 -_08173934: - ldr r4, =0x0201c000 - adds r6, r4, 0 - adds r4, 0x78 - movs r5, 0 - subs r7, 0x78 -_0817393E: - adds r0, r6, 0 - adds r1, r4, 0 - movs r2, 0x78 - bl memcpy - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - adds r6, 0x78 - adds r4, 0x78 - cmp r5, 0x30 - bls _0817393E -_08173956: - ldr r0, =gUnknown_0203BCD8 - ldr r1, [r0] - adds r0, r7, 0 - movs r2, 0x78 - bl memcpy - movs r0, 0 - movs r1, 0 - bl sub_81973C4 - ldr r2, =gUnknown_082C8959 - 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, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParametrized - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r1, =gTasks - mov r0, r8 - add r0, r9 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81739C4 - str r1, [r0] - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81738BC - - thumb_func_start sub_81739C4 -sub_81739C4: @ 81739C4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_03006214 - ldr r0, =sub_81736D8 - str r0, [r1] - movs r0, 0x3 - bl save_game_when_memory_present - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _08173A34 - ldr r0, =gUnknown_030061FC - ldr r0, [r0] - cmp r0, 0 - beq _08173A34 - movs r0, 0x1 - bl UnsetBgTilemapBuffer - movs r0, 0x3 - bl UnsetBgTilemapBuffer - bl FreeAllWindowBuffers - ldr r5, =gUnknown_0203BCDC - ldr r0, [r5] - cmp r0, 0 - beq _08173A06 - bl Free - movs r0, 0 - str r0, [r5] -_08173A06: - ldr r5, =gUnknown_0203BCD8 - ldr r0, [r5] - cmp r0, 0 - beq _08173A16 - bl Free - movs r0, 0 - str r0, [r5] -_08173A16: - adds r0, r4, 0 - bl DestroyTask - b _08173A4C - .pool -_08173A34: - movs r0, 0x37 - bl audio_play - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8173A5C - str r1, [r0] - movs r1, 0x20 - strh r1, [r0, 0xE] -_08173A4C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81739C4 - - thumb_func_start sub_8173A5C -sub_8173A5C: @ 8173A5C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrh r2, [r1, 0xE] - movs r3, 0xE - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _08173A80 - subs r0, r2, 0x1 - strh r0, [r1, 0xE] - b _08173A84 - .pool -_08173A80: - ldr r0, =sub_8173A8C - str r0, [r1] -_08173A84: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173A5C - - thumb_func_start sub_8173A8C -sub_8173A8C: @ 8173A8C - 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_8173AA8 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8173A8C - - thumb_func_start sub_8173AA8 -sub_8173AA8: @ 8173AA8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =gTasks - mov r2, r8 - lsls r1, r2, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - ldrh r6, [r1, 0xA] - ldr r2, =gUnknown_0203BCD8 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 2 - ldr r2, [r2] - adds r7, r2, r0 - movs r2, 0xC - ldrsh r0, [r1, r2] - cmp r0, 0x3 - ble _08173AEC - ldr r1, =gUnknown_085E53B4 - b _08173AEE - .pool -_08173AEC: - ldr r1, =gUnknown_085E53E4 -_08173AEE: - lsls r2, r6, 3 - adds r0, r2, r1 - ldrh r3, [r0] - adds r0, r1, 0x2 - adds r0, r2, r0 - ldrh r4, [r0] - adds r0, r1, 0x4 - adds r0, r2, r0 - ldrh r0, [r0] - mov r9, r0 - adds r1, 0x6 - adds r2, r1 - ldrh r5, [r2] - ldrh r2, [r7, 0x8] - ldr r0, =0x000001ff - ands r0, r2 - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _08173B20 - lsls r0, r5, 16 - movs r1, 0xA0 - lsls r1, 12 - adds r0, r1 - lsrs r5, r0, 16 -_08173B20: - lsls r0, r2, 23 - lsrs r0, 23 - ldr r1, [r7] - ldr r2, [r7, 0x4] - lsls r3, 16 - asrs r3, 16 - str r3, [sp] - lsls r3, r4, 16 - asrs r3, 16 - str r3, [sp, 0x4] - lsls r3, r6, 24 - lsrs r3, 24 - str r3, [sp, 0x8] - ldr r3, =0x0000ffff - str r3, [sp, 0xC] - movs r3, 0x1 - bl sub_818D3E4 - lsls r0, 24 - lsrs r0, 24 - ldr r4, =gUnknown_02020630 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r3, r2, r4 - movs r1, 0 - mov r12, r1 - mov r1, r9 - strh r1, [r3, 0x30] - strh r5, [r3, 0x32] - mov r1, r12 - strh r1, [r3, 0x2E] - ldrh r1, [r7, 0x8] - lsls r1, 23 - lsrs r1, 23 - strh r1, [r3, 0x3C] - adds r4, 0x1C - adds r2, r4 - ldr r1, =sub_8175120 - str r1, [r2] - ldr r5, =gTasks - adds r1, r6, 0x5 - lsls r1, 1 - mov r2, r8 - lsls r4, r2, 2 - add r4, r8 - lsls r4, 3 - adds r1, r4 - adds r2, r5, 0 - adds r2, 0x8 - adds r1, r2 - strh r0, [r1] - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - adds r4, r5 - ldr r0, =sub_8173BC0 - str r0, [r4] - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173AA8 - - thumb_func_start sub_8173BC0 -sub_8173BC0: @ 8173BC0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r4, =gTasks - lsls r3, r0, 2 - adds r3, r0 - lsls r3, 3 - adds r5, r3, r4 - ldrh r0, [r5, 0xA] - ldr r2, =gUnknown_0203BCD8 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - ldr r2, [r2] - adds r2, r1 - adds r0, 0x5 - lsls r0, 1 - adds r0, r3 - adds r4, 0x8 - adds r0, r4 - movs r3, 0 - ldrsh r1, [r0, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02020630 - adds r3, r0, r1 - ldr r1, [r3, 0x1C] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _08173C1A - ldrb r1, [r3, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - strb r0, [r3, 0x1] - adds r0, r2, 0 - movs r1, 0 - movs r2, 0xE - bl sub_8174A88 - movs r0, 0x78 - strh r0, [r5, 0xE] - ldr r0, =sub_8173C34 - str r0, [r5] -_08173C1A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173BC0 - - thumb_func_start sub_8173C34 -sub_8173C34: @ 8173C34 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r6, r0, 3 - adds r4, r6, r2 - ldrh r3, [r4, 0xA] - ldr r1, =gUnknown_0203BCD8 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 2 - ldr r1, [r1] - adds r1, r0 - mov r9, r1 - ldrh r1, [r4, 0xE] - movs r7, 0xE - ldrsh r0, [r4, r7] - mov r12, r2 - cmp r0, 0 - beq _08173C78 - subs r0, r1, 0x1 - strh r0, [r4, 0xE] - b _08173D10 - .pool -_08173C78: - ldr r2, =gUnknown_0203BCD4 - ldr r0, =gUnknown_02020630 - mov r8, r0 - adds r0, r3, 0x5 - lsls r0, 1 - adds r0, r6 - mov r1, r12 - adds r1, 0x8 - adds r6, r0, r1 - movs r7, 0 - ldrsh r1, [r6, r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldrb r0, [r0, 0x5] - lsrs r0, 4 - movs r1, 0x80 - lsls r1, 9 - lsls r1, r0 - ldr r3, [r2] - orrs r3, r1 - str r3, [r2] - ldrh r2, [r4, 0xA] - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bgt _08173D04 - mov r7, r9 - ldrh r1, [r7, 0x1C] - ldr r0, =0x000001ff - ands r0, r1 - cmp r0, 0 - beq _08173D04 - adds r0, r2, 0x1 - strh r0, [r4, 0xA] - ldr r0, =0x000063b0 - str r0, [sp] - adds r0, r3, 0 - movs r1, 0 - movs r2, 0xC - movs r3, 0xC - bl BeginNormalPaletteFade - movs r0, 0 - ldrsh r1, [r6, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0, 0x5] - ldr r0, =sub_8173AA8 - str r0, [r4] - b _08173D10 - .pool -_08173D04: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - add r0, r12 - ldr r1, =sub_8173D24 - str r1, [r0] -_08173D10: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173C34 - - thumb_func_start sub_8173D24 -sub_8173D24: @ 8173D24 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0xffff0000 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0 - bl BeginNormalPaletteFade - movs r3, 0 - lsls r1, r4, 2 - adds r0, r1, r4 - lsls r5, r0, 3 - ldr r0, =gTasks + 0x8 - mov r12, r0 - mov r8, r1 - ldr r6, =gUnknown_02020630 - movs r7, 0xD - negs r7, r7 -_08173D52: - adds r0, r3, 0x5 - lsls r0, 1 - adds r0, r5 - mov r2, r12 - adds r1, r0, r2 - movs r2, 0 - ldrsh r0, [r1, r2] - cmp r0, 0xFF - beq _08173D74 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r2, [r1, 0x5] - adds r0, r7, 0 - ands r0, r2 - strb r0, [r1, 0x5] -_08173D74: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x5 - bls _08173D52 - movs r0, 0 - movs r1, 0xF - bl sub_8174A38 - movs r0, 0x69 - bl audio_play - ldr r1, =gTasks - mov r2, r8 - adds r0, r2, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0xC8 - lsls r1, 1 - strh r1, [r0, 0xE] - ldr r1, =sub_8173DC0 - str r1, [r0] - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173D24 - - thumb_func_start sub_8173DC0 -sub_8173DC0: @ 8173DC0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r7, =gTasks - lsls r4, r6, 2 - adds r0, r4, r6 - lsls r5, r0, 3 - adds r1, r5, r7 - ldrh r2, [r1, 0xE] - movs r3, 0xE - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _08173E04 - subs r2, 0x1 - strh r2, [r1, 0xE] - movs r0, 0x3 - ands r0, r2 - cmp r0, 0 - bne _08173E7E - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, 0x6E - ble _08173E7E - bl sub_81751FC - b _08173E7E - .pool -_08173E04: - movs r3, 0 - mov r9, r4 - ldr r0, =gUnknown_0203BCD4 - mov r10, r0 - adds r4, r5, 0 - adds r7, 0x8 - mov r8, r7 - ldr r7, =gUnknown_02020630 - movs r1, 0xD - negs r1, r1 - mov r12, r1 - movs r5, 0x4 -_08173E1C: - adds r0, r3, 0x5 - lsls r0, 1 - adds r0, r4 - mov r2, r8 - adds r1, r0, r2 - movs r2, 0 - ldrsh r0, [r1, r2] - cmp r0, 0xFF - beq _08173E40 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - ldrb r2, [r1, 0x5] - mov r0, r12 - ands r0, r2 - orrs r0, r5 - strb r0, [r1, 0x5] -_08173E40: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x5 - bls _08173E1C - mov r3, r10 - ldr r0, [r3] - ldr r1, =0x000063b0 - str r1, [sp] - movs r1, 0 - movs r2, 0xC - movs r3, 0xC - bl BeginNormalPaletteFade - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r1, =gTasks - mov r2, r9 - adds r0, r2, r6 - lsls r0, 3 - adds r0, r1 - movs r1, 0x7 - strh r1, [r0, 0xE] - ldr r1, =sub_8173EA4 - str r1, [r0] -_08173E7E: - 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_8173DC0 - - thumb_func_start sub_8173EA4 -sub_8173EA4: @ 8173EA4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrh r2, [r1, 0xE] - movs r3, 0xE - ldrsh r0, [r1, r3] - cmp r0, 0xF - ble _08173ECC - ldr r0, =sub_8173EE4 - str r0, [r1] - b _08173EDE - .pool -_08173ECC: - adds r0, r2, 0x1 - strh r0, [r1, 0xE] - movs r0, 0xE - ldrsh r1, [r1, r0] - lsls r1, 24 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg -_08173EDE: - pop {r0} - bx r0 - thumb_func_end sub_8173EA4 - - thumb_func_start sub_8173EE4 -sub_8173EE4: @ 8173EE4 - push {r4-r6,lr} - sub sp, 0x8 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x3 - bl ShowBg - ldr r6, =gUnknown_03005D90 - ldr r0, [r6] - ldrb r0, [r0, 0x8] - movs r1, 0x1 - bl sub_818D97C - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x6 - str r1, [sp] - ldr r1, =0x0000ffff - str r1, [sp, 0x4] - movs r1, 0x1 - movs r2, 0x78 - movs r3, 0x48 - bl sub_818D8AC - ldr r1, =gTasks - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r1 - strh r0, [r4, 0x10] - ldr r0, =gUnknown_085E5380 - bl AddWindow - ldr r0, [r6] - ldrb r1, [r0, 0x14] - lsrs r1, 3 - ldr r2, =0x0000021d - movs r0, 0x1 - movs r3, 0xD0 - bl sub_80987D4 - movs r0, 0x1 - bl stdpal_get - movs r1, 0xE0 - movs r2, 0x20 - bl LoadPalette - movs r0, 0x78 - strh r0, [r4, 0xE] - ldr r0, =sub_8173F84 - str r0, [r4] - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173EE4 - - thumb_func_start sub_8173F84 -sub_8173F84: @ 8173F84 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r0, [r4, 0xE] - movs r1, 0xE - ldrsh r5, [r4, r1] - cmp r5, 0 - beq _08173FAC - subs r0, 0x1 - strh r0, [r4, 0xE] - b _08174018 - .pool -_08173FAC: - ldr r2, =gUnknown_02020630 - movs r3, 0x10 - ldrsh r1, [r4, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - ldrh r2, [r1, 0x20] - movs r3, 0x20 - ldrsh r0, [r1, r3] - cmp r0, 0xC0 - beq _08173FD0 - adds r0, r2, 0x1 - strh r0, [r1, 0x20] - b _08174018 - .pool -_08173FD0: - 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, 0x2 - bl sub_8174C98 - movs r0, 0 - movs r1, 0 - bl sub_81973C4 - ldr r2, =gUnknown_085E8C14 - str r5, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParametrized - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =sub_8174028 - str r0, [r4] -_08174018: - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173F84 - - thumb_func_start sub_8174028 -sub_8174028: @ 8174028 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_030022C0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0817404E - movs r0, 0x4 - bl play_sound_effect - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8174060 - str r0, [r1] -_0817404E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174028 - - thumb_func_start sub_8174060 -sub_8174060: @ 8174060 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gPlttBufferFaded - ldr r1, =gPlttBufferUnfaded - movs r2, 0x80 - lsls r2, 2 - bl CpuSet - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r1, 0x8 - 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_81740B0 - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174060 - - thumb_func_start sub_81740B0 -sub_81740B0: @ 81740B0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,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 _08174164 - lsls r0, r7, 2 - mov r8, r0 - ldr r1, =gTasks - adds r0, r7 - lsls r0, 3 - adds r1, 0x12 - adds r5, r0, r1 - ldr r2, =gUnknown_02020630 - mov r9, r2 - movs r6, 0x5 -_081740DC: - ldrb r4, [r5] - cmp r4, 0xFF - beq _081740FA - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - add r0, r9 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - adds r0, r4, 0 - bl sub_818D820 -_081740FA: - adds r5, 0x2 - subs r6, 0x1 - cmp r6, 0 - bge _081740DC - ldr r0, =gTasks - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x10] - bl sub_818D8F0 - movs r0, 0 - bl HideBg - movs r0, 0x1 - bl HideBg - movs r0, 0x3 - bl HideBg - bl FreeAllWindowBuffers - movs r0, 0x1 - bl UnsetBgTilemapBuffer - movs r0, 0x3 - bl UnsetBgTilemapBuffer - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - adds r0, r7, 0 - bl DestroyTask - ldr r4, =gUnknown_0203BCDC - ldr r0, [r4] - cmp r0, 0 - beq _08174150 - bl Free - movs r0, 0 - str r0, [r4] -_08174150: - ldr r4, =gUnknown_0203BCD8 - ldr r0, [r4] - cmp r0, 0 - beq _08174160 - bl Free - movs r0, 0 - str r0, [r4] -_08174160: - bl sub_8174184 -_08174164: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81740B0 - - thumb_func_start sub_8174184 -sub_8174184: @ 8174184 - push {lr} - ldr r0, =sub_8175620 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174184 - - thumb_func_start sub_8174194 -sub_8174194: @ 8174194 - push {r4,lr} - ldr r0, =gUnknown_030022C0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x5 - bhi _081741D0 - lsls r0, 2 - ldr r1, =_081741B8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081741B8: - .4byte _081741D0 - .4byte _08174200 - .4byte _08174214 - .4byte _08174240 - .4byte _08174280 - .4byte _081742B0 -_081741D0: - movs r0, 0 - bl SetVBlankCallback - bl sub_8174EC4 - ldr r4, =gUnknown_0203BCDC - ldr r0, =0x00002014 - bl AllocZeroed - str r0, [r4] - ldr r0, =gUnknown_030022C0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r1, 0x1 - strb r1, [r0] - b _08174308 - .pool -_08174200: - bl sub_8174F70 - ldr r1, =gUnknown_030022C0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _081742A2 - .pool -_08174214: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - bl sub_8174FAC - ldr r1, =gUnknown_030022C0 - movs r4, 0x87 - lsls r4, 3 - adds r1, r4 - b _081742A2 - .pool -_08174240: - bl sub_8175024 - lsls r0, 24 - cmp r0, 0 - bne _08174308 - ldr r1, =0x0201c000 - ldr r0, =gUnknown_085E56D4 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2,r3} - stm r1!, {r2,r3} - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl sub_80F9BCC - ldr r0, =sub_817354C - bl SetVBlankCallback - ldr r1, =gUnknown_030022C0 - movs r4, 0x87 - lsls r4, 3 - adds r1, r4 - b _081742A2 - .pool -_08174280: - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl UpdatePaletteFade - bl sub_80F9C1C - lsls r0, 24 - cmp r0, 0 - bne _08174308 - ldr r1, =gUnknown_030022C0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 -_081742A2: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08174308 - .pool -_081742B0: - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0xE2 - lsls r1, 3 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - ldr r0, =sub_8174324 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - movs r2, 0 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r4, =gTasks + 0x8 - movs r3, 0xFF -_081742E2: - adds r0, r2, 0x5 - lsls r0, 1 - adds r0, r1 - adds r0, r4 - strh r3, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _081742E2 - ldr r4, =gUnknown_0203BCD8 - movs r0, 0x80 - lsls r0, 6 - bl AllocZeroed - str r0, [r4] - ldr r0, =sub_8173560 - bl SetMainCallback2 -_08174308: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174194 - - thumb_func_start sub_8174324 -sub_8174324: @ 8174324 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x00000226 - str r0, [sp] - movs r0, 0 - movs r1, 0x1E - movs r2, 0 - movs r3, 0xC - bl sub_81980F0 - movs r0, 0x3 - bl sub_81534D0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08174364 - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81749A0 - b _081743DA - .pool -_08174364: - ldr r0, =0x0201c000 - ldr r4, =gUnknown_0203BCD8 - ldr r1, [r4] - movs r2, 0x80 - lsls r2, 5 - bl CpuSet - ldr r4, [r4] - movs r2, 0 - ldrh r1, [r4, 0x8] - ldr r3, =0x000001ff - adds r0, r3, 0 - ands r0, r1 - lsls r5, r6, 2 - cmp r0, 0 - beq _0817439A -_08174384: - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - adds r4, 0x78 - cmp r2, 0x31 - bhi _081743BC - ldrh r1, [r4, 0x8] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - bne _08174384 -_0817439A: - cmp r2, 0x31 - bhi _081743BC - ldr r0, =gTasks - adds r1, r5, r6 - lsls r1, 3 - adds r1, r0 - subs r0, r2, 0x1 - b _081743C6 - .pool -_081743BC: - ldr r0, =gTasks - adds r1, r5, r6 - lsls r1, 3 - adds r1, r0 - movs r0, 0x31 -_081743C6: - strh r0, [r1, 0x8] - movs r0, 0xA - bl sub_80847F8 - ldr r2, =gTasks - adds r1, r5, r6 - lsls r1, 3 - adds r1, r2 - strh r0, [r1, 0xA] - ldr r0, =sub_81743EC -_081743DA: - str r0, [r1] - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174324 - - thumb_func_start sub_81743EC -sub_81743EC: @ 81743EC - 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 - mov r8, r0 - ldr r0, =gUnknown_0203BCD8 - ldr r3, [r0] - movs r5, 0 - ldr r1, =gTasks - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r4, 0x8 - ldrsh r0, [r0, r4] - adds r4, r1, 0 - ldr r2, =gUnknown_0203BCD4 - cmp r5, r0 - bge _0817442A - adds r1, r0, 0 -_0817441E: - adds r3, 0x78 - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, r1 - blt _0817441E -_0817442A: - adds r6, r3, 0 - movs r0, 0 - str r0, [r2] - mov r5, r8 - lsls r2, r5, 2 - adds r1, r2, r5 - lsls r1, 3 - adds r1, r4 - strh r0, [r1, 0xC] - strh r0, [r1, 0x10] - movs r5, 0 - str r2, [sp, 0x14] - ldr r4, =0x000001ff - adds r2, r1, 0 -_08174446: - ldrh r1, [r6, 0x8] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _08174456 - ldrh r0, [r2, 0x10] - adds r0, 0x1 - strh r0, [r2, 0x10] -_08174456: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - adds r6, 0x14 - cmp r5, 0x5 - bls _08174446 - adds r6, r3, 0 - movs r5, 0 - ldr r1, =gTasks - ldr r0, [sp, 0x14] - add r0, r8 - lsls r0, 3 - mov r9, r0 - adds r0, r1 - str r0, [sp, 0x10] - ldr r1, =0x000001ff - mov r10, r1 -_08174478: - ldrh r0, [r6, 0x8] - mov r1, r10 - ands r1, r0 - adds r7, r0, 0 - cmp r1, 0 - beq _08174540 - ldr r2, [sp, 0x10] - movs r4, 0x10 - ldrsh r0, [r2, r4] - cmp r0, 0x3 - ble _081744B8 - lsls r1, r5, 3 - ldr r0, =gUnknown_085E53B4 - adds r0, 0x4 - adds r0, r1, r0 - ldrh r3, [r0] - ldr r0, =gUnknown_085E53BA - adds r1, r0 - ldrh r4, [r1] - b _081744C8 - .pool -_081744B8: - ldr r0, =gUnknown_085E53E4 - lsls r2, r5, 3 - adds r1, r0, 0x4 - adds r1, r2, r1 - ldrh r3, [r1] - adds r0, 0x6 - adds r2, r0 - ldrh r4, [r2] -_081744C8: - mov r1, r10 - ands r1, r7 - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - bne _081744DE - lsls r0, r4, 16 - movs r1, 0xA0 - lsls r1, 12 - adds r0, r1 - lsrs r4, r0, 16 -_081744DE: - lsls r0, r7, 23 - lsrs r0, 23 - ldr r1, [r6] - ldr r2, [r6, 0x4] - lsls r3, 16 - asrs r3, 16 - str r3, [sp] - lsls r3, r4, 16 - asrs r3, 16 - str r3, [sp, 0x4] - lsls r3, r5, 24 - lsrs r3, 24 - str r3, [sp, 0x8] - ldr r3, =0x0000ffff - str r3, [sp, 0xC] - movs r3, 0x1 - bl sub_818D7D8 - lsls r0, 16 - lsrs r0, 16 - ldr r2, =gUnknown_02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r3, [r1, 0x5] - movs r4, 0xD - negs r4, r4 - adds r2, r4, 0 - ands r3, r2 - movs r2, 0x4 - orrs r3, r2 - strb r3, [r1, 0x5] - adds r1, r5, 0x5 - lsls r1, 1 - add r1, r9 - ldr r2, =gTasks + 0x8 - adds r1, r2 - strh r0, [r1] - b _0817454E - .pool -_08174540: - adds r0, r5, 0x5 - lsls r0, 1 - add r0, r9 - ldr r4, =gTasks + 0x8 - adds r0, r4 - movs r1, 0xFF - strh r1, [r0] -_0817454E: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - adds r6, 0x14 - cmp r5, 0x5 - bls _08174478 - ldr r0, =0xffff0000 - ldr r2, =0x000063b0 - movs r1, 0xC - bl BlendPalettes - ldr r0, =gUnknown_02021CC4 - ldr r1, =gTasks - ldr r4, [sp, 0x14] - add r4, r8 - lsls r4, 3 - adds r4, r1 - movs r5, 0xA - ldrsh r1, [r4, r5] - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r5, =gUnknown_02021FC4 - ldr r1, =gUnknown_085E8C00 - adds r0, r5, 0 - bl ExpandStringRefs - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bgt _081745C0 - ldr r1, =gUnknown_085E8574 - movs r0, 0x1 - str r0, [sp] - adds r0, r5, 0 - movs r2, 0 - movs r3, 0 - bl sub_8198204 - b _081745D0 - .pool -_081745C0: - ldr r1, =gUnknown_085E855C - movs r0, 0x1 - str r0, [sp] - adds r0, r5, 0 - movs r2, 0 - movs r3, 0 - bl sub_8198204 -_081745D0: - ldr r0, =gTasks - ldr r1, [sp, 0x14] - add r1, r8 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81745FC - str r0, [r1] - 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_81743EC - - thumb_func_start sub_81745FC -sub_81745FC: @ 81745FC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_0203BCD8 - ldr r5, [r0] - movs r3, 0 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - cmp r3, r0 - bge _08174630 - adds r1, r0, 0 -_08174624: - adds r5, 0x78 - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, r1 - blt _08174624 -_08174630: - movs r3, 0 - lsls r7, r4, 2 - adds r0, r7, r4 - lsls r6, r0, 3 - ldr r0, =gTasks + 0x8 - mov r10, r0 - ldr r1, =gUnknown_02020630 - mov r8, r1 - movs r2, 0xD - negs r2, r2 - mov r9, r2 - movs r0, 0x4 - mov r12, r0 -_0817464A: - adds r0, r3, 0x5 - lsls r0, 1 - adds r0, r6 - add r0, r10 - ldrh r1, [r0] - cmp r1, 0xFF - beq _0817466C - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldrb r2, [r0, 0x5] - mov r1, r9 - ands r1, r2 - mov r2, r12 - orrs r1, r2 - strb r1, [r0, 0x5] -_0817466C: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x5 - bls _0817464A - adds r1, r7, r4 - lsls r1, 3 - ldr r0, =gTasks - adds r6, r1, r0 - movs r2, 0xC - ldrsh r0, [r6, r2] - adds r0, 0x5 - lsls r0, 1 - adds r0, r1 - ldr r1, =gTasks - adds r1, 0x8 - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02020630 - adds r0, r1 - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - strb r1, [r0, 0x5] - lsrs r1, 4 - movs r0, 0x80 - lsls r0, 9 - lsls r0, r1 - ldr r1, =0xffff0000 - eors r0, r1 - ldr r2, =gUnknown_0203BCD4 - str r0, [r2] - ldr r2, =0x000063b0 - movs r1, 0xC - bl BlendPalettesUnfaded - movs r0, 0xC - ldrsh r1, [r6, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r4, r5, r0 - ldrh r1, [r4, 0x8] - ldr r0, =0x000001ff - ands r0, r1 - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _081746E6 - bl sub_80A369C - ldrh r0, [r4, 0x8] - lsls r0, 23 - lsrs r0, 23 - movs r1, 0 - bl cry_related -_081746E6: - adds r0, r4, 0 - movs r1, 0 - movs r2, 0xE - bl sub_8174A88 - ldr r0, =sub_8174728 - 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_81745FC - - thumb_func_start sub_8174728 -sub_8174728: @ 8174728 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gUnknown_030022C0 - ldrh r2, [r1, 0x2E] - movs r0, 0x1 - ands r0, r2 - adds r3, r1, 0 - cmp r0, 0 - beq _081747E4 - ldr r0, =gTasks - mov r12, r0 - lsls r0, r6, 2 - adds r1, r0, r6 - lsls r3, r1, 3 - mov r1, r12 - adds r4, r3, r1 - ldrh r2, [r4, 0x8] - movs r5, 0x8 - ldrsh r1, [r4, r5] - mov r9, r0 - cmp r1, 0 - beq _081747B8 - subs r0, r2, 0x1 - strh r0, [r4, 0x8] - movs r5, 0 - adds r7, r3, 0 - movs r0, 0x8 - add r0, r12 - mov r8, r0 -_0817476A: - adds r0, r5, 0x5 - lsls r0, 1 - adds r0, r7 - mov r1, r8 - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0xFF - beq _08174782 - bl sub_818D820 - movs r0, 0xFF - strh r0, [r4] -_08174782: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x5 - bls _0817476A - ldr r0, =gTasks - mov r2, r9 - adds r1, r2, r6 - lsls r1, 3 - adds r1, r0 - ldrh r2, [r1, 0xA] - movs r3, 0xA - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _081747A4 - subs r0, r2, 0x1 - strh r0, [r1, 0xA] -_081747A4: - ldr r0, =sub_81743EC - str r0, [r1] - b _08174884 - .pool -_081747B8: - bl sub_80A36C8 - lsls r0, 24 - cmp r0, 0 - beq _081747D2 - bl sub_80A369C - ldr r0, =gMPlay_BGM - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl m4aMPlayVolumeControl -_081747D2: - ldr r0, =sub_8174898 - str r0, [r4] - b _08174884 - .pool -_081747E4: - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - beq _08174828 - bl sub_80A36C8 - lsls r0, 24 - cmp r0, 0 - beq _08174806 - bl sub_80A369C - ldr r0, =gMPlay_BGM - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl m4aMPlayVolumeControl -_08174806: - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8174898 - str r0, [r1] - b _08174884 - .pool -_08174828: - movs r0, 0x40 - ands r0, r2 - cmp r0, 0 - beq _08174858 - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldrh r2, [r1, 0xC] - movs r4, 0xC - ldrsh r0, [r1, r4] - cmp r0, 0 - beq _08174858 - subs r0, r2, 0x1 - strh r0, [r1, 0xC] - ldr r0, =sub_81745FC - str r0, [r1] - b _08174884 - .pool -_08174858: - ldrh r1, [r3, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08174884 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r2, r0, r1 - movs r5, 0xC - ldrsh r1, [r2, r5] - movs r3, 0x10 - ldrsh r0, [r2, r3] - subs r0, 0x1 - cmp r1, r0 - bge _08174884 - ldrh r0, [r2, 0xC] - adds r0, 0x1 - strh r0, [r2, 0xC] - ldr r0, =sub_81745FC - str r0, [r2] -_08174884: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174728 - - thumb_func_start sub_8174898 -sub_8174898: @ 8174898 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gPlttBufferFaded - ldr r1, =gPlttBufferUnfaded - movs r2, 0x80 - lsls r2, 2 - bl CpuSet - ldr r1, =0x0201c000 - ldr r0, =gUnknown_085E56D4 - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldm r0!, {r2,r3} - stm r1!, {r2,r3} - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl sub_80F9BF4 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81748F0 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174898 - - thumb_func_start sub_81748F0 -sub_81748F0: @ 81748F0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - bl sub_80F9C30 - lsls r0, 24 - cmp r0, 0 - bne _08174988 - movs r5, 0 - lsls r0, r6, 2 - adds r0, r6 - lsls r7, r0, 3 - ldr r0, =gTasks + 0x8 - mov r8, r0 -_08174910: - adds r0, r5, 0x5 - lsls r0, 1 - adds r0, r7 - mov r1, r8 - adds r4, r0, r1 - ldrh r0, [r4] - cmp r0, 0xFF - beq _08174928 - bl sub_818D820 - movs r0, 0xFF - strh r0, [r4] -_08174928: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _08174910 - movs r0, 0 - bl HideBg - movs r0, 0x1 - bl HideBg - movs r0, 0x3 - bl HideBg - bl sub_8198314 - bl FreeAllWindowBuffers - movs r0, 0x1 - bl UnsetBgTilemapBuffer - movs r0, 0x3 - bl UnsetBgTilemapBuffer - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - adds r0, r6, 0 - bl DestroyTask - ldr r4, =gUnknown_0203BCDC - ldr r0, [r4] - cmp r0, 0 - beq _08174974 - bl Free - movs r0, 0 - str r0, [r4] -_08174974: - ldr r4, =gUnknown_0203BCD8 - ldr r0, [r4] - cmp r0, 0 - beq _08174984 - bl Free - movs r0, 0 - str r0, [r4] -_08174984: - bl sub_8137C3C -_08174988: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81748F0 - - thumb_func_start sub_81749A0 -sub_81749A0: @ 81749A0 - push {r4,lr} - sub sp, 0x10 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_085E8588 - movs r1, 0x8 - movs r2, 0x1 - bl sub_8198180 - movs r0, 0 - movs r1, 0 - bl sub_81973C4 - ldr r2, =gUnknown_085E8BDC - 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, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParametrized - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8174A08 - str r1, [r0] - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81749A0 - - thumb_func_start sub_8174A08 -sub_8174A08: @ 8174A08 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gUnknown_030022C0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08174A28 - ldr r0, =gTasks - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8174898 - str r0, [r1] -_08174A28: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174A08 - - thumb_func_start sub_8174A38 -sub_8174A38: @ 8174A38 - push {r4,lr} - sub sp, 0xC - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - bl PutWindowTilemap - ldr r4, =gUnknown_085E8B3E - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xD0 - bl GetStringCenterAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_085E5388 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x1 - bl box_print - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174A38 - - thumb_func_start sub_8174A88 -sub_8174A88: @ 8174A88 - push {r4-r7,lr} - sub sp, 0x2C - adds r7, r0, 0 - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - bl PutWindowTilemap - ldrh r0, [r7, 0x8] - ldr r1, =0x000001ff - ands r1, r0 - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - beq _08174B30 - ldr r1, =gUnknown_085E8C36 - add r0, sp, 0xC - bl CopyString - adds r6, r0, 0 - ldrh r0, [r7, 0x8] - lsls r0, 23 - lsrs r0, 23 - bl sub_806E3C0 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x0000ffff - cmp r4, r0 - beq _08174B04 - adds r0, r4, 0 - movs r1, 0x64 - bl __divsi3 - subs r0, 0x5F - strb r0, [r6] - adds r6, 0x1 - adds r0, r4, 0 - movs r1, 0x64 - bl __modsi3 - adds r4, r0, 0 - movs r1, 0xA - bl __divsi3 - subs r0, 0x5F - strb r0, [r6] - adds r6, 0x1 - adds r0, r4, 0 - movs r1, 0xA - bl __modsi3 - subs r0, 0x5F - b _08174B0E - .pool -_08174B04: - movs r0, 0xAC - strb r0, [r6] - adds r6, 0x1 - strb r0, [r6] - adds r6, 0x1 -_08174B0E: - strb r0, [r6] - adds r6, 0x1 - movs r0, 0xFF - strb r0, [r6] - ldr r0, =gUnknown_085E5388 - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - add r0, sp, 0xC - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r2, 0x10 - movs r3, 0x1 - bl box_print -_08174B30: - adds r1, r7, 0 - adds r1, 0xA - add r0, sp, 0xC - movs r2, 0xA - bl memcpy - add r1, sp, 0xC - movs r0, 0xFF - strb r0, [r1, 0xA] - ldrh r1, [r7, 0x8] - ldr r4, =0x000001ff - adds r0, r4, 0 - ands r0, r1 - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _08174B8C - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0xD0 - bl GetStringCenterAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - ldr r0, =gUnknown_085E5388 - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - add r0, sp, 0xC - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r3, 0x1 - bl box_print - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - b _08174C82 - .pool -_08174B8C: - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0x80 - bl GetStringRightAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - ldr r0, =gUnknown_085E5388 - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - add r0, sp, 0xC - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r3, 0x1 - bl box_print - add r1, sp, 0xC - movs r0, 0xBA - strb r0, [r1] - mov r0, sp - adds r0, 0xD - ldrh r1, [r7, 0x8] - lsls r1, 23 - lsrs r1, 23 - movs r2, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - adds r6, r0, 0 - ldrh r1, [r7, 0x8] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0x20 - beq _08174C0A - cmp r0, 0x1D - beq _08174C0A - lsls r0, r1, 23 - lsrs r0, 23 - ldr r1, [r7, 0x4] - bl pokemon_species_get_gender_info - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _08174C00 - cmp r0, 0xFE - beq _08174C04 - b _08174C0A - .pool -_08174C00: - movs r0, 0xB5 - b _08174C06 -_08174C04: - movs r0, 0xB6 -_08174C06: - strb r0, [r6] - adds r6, 0x1 -_08174C0A: - movs r0, 0xFF - strb r0, [r6] - ldr r5, =gUnknown_085E5388 - str r5, [sp] - movs r4, 0x1 - negs r4, r4 - str r4, [sp, 0x4] - add r0, sp, 0xC - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r2, 0x80 - movs r3, 0x1 - bl box_print - ldr r1, =gUnknown_085E8C3B - add r0, sp, 0xC - bl CopyString - adds r6, r0, 0 - ldrb r1, [r7, 0x9] - lsrs r1, 1 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - str r5, [sp] - str r4, [sp, 0x4] - add r0, sp, 0xC - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r2, 0x24 - movs r3, 0x11 - bl box_print - ldr r1, =gUnknown_085E8C4D - add r0, sp, 0xC - bl CopyString - adds r6, r0, 0 - ldrh r1, [r7] - movs r2, 0x2 - movs r3, 0x5 - bl ConvertIntToDecimalString - str r5, [sp] - str r4, [sp, 0x4] - add r0, sp, 0xC - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r2, 0x68 - movs r3, 0x11 - bl box_print - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram -_08174C82: - add sp, 0x2C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174A88 - - thumb_func_start sub_8174C98 -sub_8174C98: @ 8174C98 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - movs r0, 0x1 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0x1 - bl PutWindowTilemap - ldr r2, =0x0000021d - movs r0, 0x1 - movs r1, 0 - movs r3, 0xD - bl SetWindowBorderStyle - ldr r0, =gUnknown_085E538C - mov r8, r0 - str r0, [sp] - movs r1, 0x1 - negs r1, r1 - mov r9, r1 - str r1, [sp, 0x4] - ldr r0, =gUnknown_085E8C48 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - movs r3, 0x1 - bl box_print - ldr r0, =gUnknown_03005D90 - mov r10, r0 - ldr r1, [r0] - movs r0, 0x1 - movs r2, 0x70 - bl GetStringRightAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - mov r1, r8 - str r1, [sp] - mov r0, r9 - str r0, [sp, 0x4] - mov r1, r10 - ldr r0, [r1] - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x1 - bl box_print - mov r1, r10 - ldr r0, [r1] - ldrb r4, [r0, 0xA] - ldrb r0, [r0, 0xB] - lsls r0, 8 - orrs r4, r0 - mov r0, r8 - str r0, [sp] - movs r7, 0 - str r7, [sp, 0x4] - ldr r0, =gUnknown_085E8C4D - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - movs r3, 0x11 - bl box_print - add r6, sp, 0xC - ldr r1, =0x000186a0 - adds r0, r4, 0 - bl __modsi3 - ldr r5, =0x00002710 - adds r1, r5, 0 - bl __divsi3 - subs r0, 0x5F - strb r0, [r6] - add r6, sp, 0xC - adds r0, r4, 0 - adds r1, r5, 0 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r5, 0xFA - lsls r5, 2 - adds r1, r5, 0 - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r6, 0x1] - add r6, sp, 0xC - adds r0, r4, 0 - adds r1, r5, 0 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r6, 0x2] - add r5, sp, 0xC - adds r0, r4, 0 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r5, 0x3] - add r5, sp, 0xC - adds r0, r4, 0 - movs r1, 0xA - bl __umodsi3 - adds r0, 0xA1 - strb r0, [r5, 0x4] - add r1, sp, 0xC - movs r0, 0xFF - strb r0, [r1, 0x5] - movs r0, 0x1 - movs r2, 0x70 - bl GetStringRightAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - mov r1, r8 - str r1, [sp] - mov r0, r9 - str r0, [sp, 0x4] - add r1, sp, 0xC - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x11 - bl box_print - mov r0, r8 - str r0, [sp] - mov r1, r9 - str r1, [sp, 0x4] - ldr r0, =gUnknown_085E84CE - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - movs r3, 0x21 - bl box_print - add r5, sp, 0xC - mov r0, r10 - ldr r4, [r0] - ldrh r0, [r4, 0xE] - movs r1, 0x64 - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r5] - add r5, sp, 0xC - ldrh r0, [r4, 0xE] - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r5, 0x1] - add r5, sp, 0xC - ldrh r0, [r4, 0xE] - movs r1, 0xA - bl __umodsi3 - adds r0, 0xA1 - strb r0, [r5, 0x2] - add r0, sp, 0xC - ldrb r0, [r0] - cmp r0, 0xA1 - bne _08174E1E - add r0, sp, 0xC - strb r7, [r0] -_08174E1E: - add r0, sp, 0xC - ldrb r1, [r0] - cmp r1, 0 - bne _08174E30 - ldrb r0, [r0, 0x1] - cmp r0, 0xA1 - bne _08174E30 - add r0, sp, 0xC - strb r1, [r0, 0x8] -_08174E30: - add r1, sp, 0xC - movs r0, 0xF0 - strb r0, [r1, 0x3] - adds r4, r1, 0 - ldr r0, =gUnknown_03005D90 - ldr r5, [r0] - ldrb r0, [r5, 0x10] - movs r1, 0x64 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0xA - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r4, 0x4] - add r4, sp, 0xC - ldrb r0, [r5, 0x10] - movs r1, 0xA - bl __umodsi3 - adds r0, 0xA1 - strb r0, [r4, 0x5] - add r1, sp, 0xC - movs r0, 0xFF - strb r0, [r1, 0x6] - movs r0, 0x1 - movs r2, 0x70 - bl GetStringRightAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - ldr r0, =gUnknown_085E538C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - add r1, sp, 0xC - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x21 - bl box_print - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram - 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_8174C98 - - thumb_func_start sub_8174EC4 -sub_8174EC4: @ 8174EC4 - 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 -_08174EEA: - 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 _08174EEA - 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] - bl ResetPaletteFade - ldr r0, =gUnknown_085E54E8 - movs r1, 0 - movs r2, 0x20 - bl LoadPalette - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174EC4 - - thumb_func_start sub_8174F70 -sub_8174F70: @ 8174F70 - push {lr} - bl remove_some_task - bl ResetTasks - bl ResetAllObjectData - bl reset_temp_tile_data_buffers - bl dp13_810BB8C - bl ResetObjectPaletteAllocator - ldr r1, =gUnknown_0300301C - movs r0, 0x8 - strb r0, [r1] - ldr r0, =gUnknown_085E5394 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085E53A4 - bl LoadCompressedObjectPalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174F70 - - thumb_func_start sub_8174FAC -sub_8174FAC: @ 8174FAC - push {r4,lr} - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085E5374 - movs r0, 0 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r4, =gUnknown_0203BCDC - ldr r1, [r4] - adds r1, 0x12 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00001012 - adds r1, r0 - movs r0, 0x3 - bl SetBgTilemapBuffer - 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 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174FAC - - thumb_func_start sub_8175024 -sub_8175024: @ 8175024 - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203BCDC - ldr r0, [r0] - ldrh r0, [r0] - cmp r0, 0x4 - bhi _08175108 - lsls r0, 2 - ldr r1, =_08175044 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08175044: - .4byte _08175058 - .4byte _08175070 - .4byte _0817507C - .4byte _081750D2 - .4byte _081750DC -_08175058: - ldr r1, =gUnknown_085E5508 - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - b _08175108 - .pool -_08175070: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - beq _08175108 - b _08175112 -_0817507C: - movs r4, 0x20 - str r4, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - movs r0, 0xB - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0x3 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - movs r0, 0x6 - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - movs r3, 0xE - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x3 - movs r1, 0x2 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - b _08175108 -_081750D2: - bl sub_81971D0 - bl sub_8197200 - b _08175108 -_081750DC: - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x3 - bl ShowBg - ldr r0, =gUnknown_0203BCDC - ldr r1, [r0] - movs r0, 0 - strh r0, [r1] - b _08175114 - .pool -_08175108: - ldr r0, =gUnknown_0203BCDC - ldr r1, [r0] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_08175112: - movs r0, 0x1 -_08175114: - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8175024 - - thumb_func_start sub_8175120 -sub_8175120: @ 8175120 - push {r4,lr} - adds r2, r0, 0 - ldr r1, [r2, 0x20] - ldr r0, [r2, 0x30] - cmp r1, r0 - beq _08175176 - ldrh r3, [r2, 0x20] - movs r1, 0x20 - ldrsh r0, [r2, r1] - movs r4, 0x30 - ldrsh r1, [r2, r4] - cmp r0, r1 - bge _08175140 - adds r0, r3, 0 - adds r0, 0xF - strh r0, [r2, 0x20] -_08175140: - ldrh r3, [r2, 0x20] - movs r4, 0x20 - ldrsh r0, [r2, r4] - cmp r0, r1 - ble _08175150 - adds r0, r3, 0 - subs r0, 0xF - strh r0, [r2, 0x20] -_08175150: - ldrh r3, [r2, 0x22] - movs r1, 0x22 - ldrsh r0, [r2, r1] - movs r4, 0x32 - ldrsh r1, [r2, r4] - cmp r0, r1 - bge _08175164 - adds r0, r3, 0 - adds r0, 0xA - strh r0, [r2, 0x22] -_08175164: - ldrh r3, [r2, 0x22] - movs r4, 0x22 - ldrsh r0, [r2, r4] - cmp r0, r1 - ble _0817519C - adds r0, r3, 0 - subs r0, 0xA - strh r0, [r2, 0x22] - b _0817519C -_08175176: - ldrh r0, [r2, 0x3C] - lsls r1, r0, 16 - movs r0, 0xCE - lsls r0, 17 - cmp r1, r0 - bne _08175190 - lsrs r1, 16 - adds r0, r2, 0 - movs r2, 0x1 - movs r3, 0x3 - bl sub_806ED40 - b _0817519C -_08175190: - lsrs r1, 16 - adds r0, r2, 0 - movs r2, 0 - movs r3, 0x3 - bl sub_806ED40 -_0817519C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8175120 - - thumb_func_start sub_81751A4 -sub_81751A4: @ 81751A4 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r1, [r5, 0x26] - movs r2, 0x26 - ldrsh r0, [r5, r2] - cmp r0, 0x78 - ble _081751BA - adds r0, r5, 0 - bl RemoveObjectAndFreeTiles - b _081751F2 -_081751BA: - adds r0, r1, 0x1 - ldrh r1, [r5, 0x30] - adds r0, r1 - strh r0, [r5, 0x26] - ldrh r4, [r5, 0x2E] - lsls r4, 24 - lsrs r4, 24 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - ands r0, r1 - adds r0, 0x8 - ldr r1, =gUnknown_08329F40 - lsls r4, 1 - adds r4, r1 - movs r2, 0 - ldrsh r1, [r4, r2] - muls r0, r1 - cmp r0, 0 - bge _081751E8 - adds r0, 0xFF -_081751E8: - asrs r0, 8 - strh r0, [r5, 0x24] - ldrh r0, [r5, 0x2E] - adds r0, 0x4 - strh r0, [r5, 0x2E] -_081751F2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81751A4 - - thumb_func_start sub_81751FC -sub_81751FC: @ 81751FC - push {r4,lr} - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF0 - bl __umodsi3 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl GenerateRandomNumber - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x7 - ands r2, r0 - negs r2, r2 - ldr r0, =gUnknown_085E54D0 - lsls r4, 16 - asrs r4, 16 - lsls r2, 16 - asrs r2, 16 - adds r1, r4, 0 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =gUnknown_02020630 - adds r4, r1, r0 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x11 - bl __umodsi3 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - bl GenerateRandomNumber - movs r1, 0x3 - ands r1, r0 - cmp r1, 0 - beq _08175274 - movs r0, 0 - b _08175276 - .pool -_08175274: - movs r0, 0x1 -_08175276: - strh r0, [r4, 0x30] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81751FC - - thumb_func_start sub_8175280 -sub_8175280: @ 8175280 - push {r4,lr} - ldr r4, =gUnknown_020375E0 - movs r0, 0xB4 - strh r0, [r4] - ldr r0, =sub_8175364 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _081752AA - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r4] - strh r1, [r0, 0xA] - ldr r0, =gUnknown_020375E2 - strh r2, [r0] -_081752AA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175280 - - thumb_func_start sub_81752C0 -sub_81752C0: @ 81752C0 - push {r4,lr} - ldr r0, =sub_8175364 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _081752D4 - bl DestroyTask -_081752D4: - bl sub_8152254 - ldr r4, =0x000003e9 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81752C0 - - thumb_func_start sub_81752F4 -sub_81752F4: @ 81752F4 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r1, [r5, 0xE] - movs r2, 0xE - ldrsh r0, [r5, r2] - cmp r0, 0x6E - ble _08175324 - ldr r2, =gTasks - movs r0, 0x28 - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r1, [r0, 0x26] - subs r1, 0x1 - strh r1, [r0, 0x26] - ldrb r0, [r5, 0x16] - bl sub_81525D0 - b _08175358 - .pool -_08175324: - adds r0, r1, 0x1 - ldrh r1, [r5, 0x1C] - adds r0, r1 - strh r0, [r5, 0xE] - ldrb r4, [r5, 0x1A] - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - ands r0, r1 - adds r0, 0x8 - ldr r1, =gUnknown_08329F40 - lsls r4, 1 - adds r4, r1 - movs r2, 0 - ldrsh r1, [r4, r2] - muls r0, r1 - cmp r0, 0 - bge _0817534E - adds r0, 0xFF -_0817534E: - asrs r0, 8 - strh r0, [r5, 0xC] - ldrh r0, [r5, 0x1A] - adds r0, 0x4 - strh r0, [r5, 0x1A] -_08175358: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81752F4 - - thumb_func_start sub_8175364 -sub_8175364: @ 8175364 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r4, r0, 24 - mov r8, r4 - movs r7, 0 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r6, r0, r1 - ldrh r0, [r6] - cmp r0, 0x1 - beq _081753E0 - cmp r0, 0x1 - bgt _08175394 - cmp r0, 0 - beq _0817539C - b _081754B0 - .pool -_08175394: - cmp r0, 0xFF - bne _0817539A - b _081754A0 -_0817539A: - b _081754B0 -_0817539C: - movs r0, 0x40 - bl sub_81521C0 - cmp r0, 0 - bne _081753B8 - adds r0, r4, 0 - bl DestroyTask - ldr r0, =gUnknown_020375E0 - strh r7, [r0] - ldr r1, =gUnknown_020375E2 - ldr r2, =0x0000ffff - adds r0, r2, 0 - strh r0, [r1] -_081753B8: - ldr r0, =gUnknown_085E5394 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085E53A4 - bl LoadCompressedObjectPalette - ldrh r0, [r6] - adds r0, 0x1 - strh r0, [r6] - b _081754B0 - .pool -_081753E0: - ldrh r0, [r6, 0x2] - cmp r0, 0 - beq _08175478 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _08175478 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF0 - bl __umodsi3 - adds r5, r0, 0 - lsls r5, 16 - asrs r5, 16 - bl GenerateRandomNumber - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0x7 - ands r4, r0 - negs r4, r4 - lsls r4, 16 - asrs r4, 16 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x11 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_085E53FC - ldr r2, =0x000003e9 - str r4, [sp] - str r0, [sp, 0x4] - str r7, [sp, 0x8] - adds r0, r1, 0 - adds r1, r2, 0 - adds r3, r5, 0 - bl sub_81524C4 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0xFF - beq _08175478 - adds r4, r7, 0 - ldr r1, =sub_81752F4 - adds r0, r4, 0 - bl sub_8152438 - bl GenerateRandomNumber - movs r1, 0x3 - ands r1, r0 - cmp r1, 0 - bne _08175468 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0x1 - bl sub_8152474 -_08175468: - adds r0, r4, 0 - movs r1, 0x7 - mov r2, r8 - bl sub_8152474 - ldrh r0, [r6, 0x1E] - adds r0, 0x1 - strh r0, [r6, 0x1E] -_08175478: - bl sub_81522D4 - ldrh r0, [r6, 0x2] - cmp r0, 0 - beq _08175494 - subs r0, 0x1 - strh r0, [r6, 0x2] - b _081754B0 - .pool -_08175494: - ldrh r0, [r6, 0x1E] - cmp r0, 0 - bne _081754B0 - movs r0, 0xFF - strh r0, [r6] - b _081754B0 -_081754A0: - bl sub_81752C0 - ldr r0, =gUnknown_020375E0 - strh r7, [r0] - ldr r1, =gUnknown_020375E2 - ldr r2, =0x0000ffff - adds r0, r2, 0 - strh r0, [r1] -_081754B0: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175364 - - thumb_func_start sub_81754C8 -sub_81754C8: @ 81754C8 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - thumb_func_end sub_81754C8 - - thumb_func_start sub_81754DC -sub_81754DC: @ 81754DC - push {lr} - bl RunTasks - bl CallObjectCallbacks - ldr r0, =gUnknown_030022C0 - ldrh r1, [r0, 0x2C] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08175522 - ldr r0, =gUnknown_0203BCE4 - ldrb r0, [r0] - cmp r0, 0 - beq _08175522 - ldr r2, =gTasks - ldr r0, =gUnknown_0203BCE2 - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldr r1, [r0] - ldr r0, =sub_8175774 - cmp r1, r0 - bne _08175522 - bl sub_81754C8 - bl RunTasks - bl CallObjectCallbacks - ldr r1, =gUnknown_0203BCE5 - movs r0, 0x1 - strb r0, [r1] -_08175522: - bl PrepareSpritesForOamLoad - bl UpdatePaletteFade - pop {r0} - bx r0 - .pool - thumb_func_end sub_81754DC - - thumb_func_start sub_8175548 -sub_8175548: @ 8175548 - push {lr} - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085E6F68 - movs r0, 0 - movs r2, 0x1 - bl InitBgsFromTemplates - movs r0, 0x80 - lsls r0, 4 - bl AllocZeroed - adds r1, r0, 0 - movs r0, 0 - bl SetBgTilemapBuffer - ldr r0, =gUnknown_085E56F0 - movs r1, 0x80 - movs r2, 0x40 - bl LoadPalette - ldr r0, =gUnknown_085E6F6C - bl InitWindows - bl DeactivateAllTextPrinters - movs r0, 0 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0 - bl ShowBg - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175548 - - thumb_func_start sub_81755A4 -sub_81755A4: @ 81755A4 - push {lr} - bl FreeAllWindowBuffers - movs r0, 0 - bl GetBgTilemapBuffer - cmp r0, 0 - beq _081755B8 - bl Free -_081755B8: - pop {r0} - bx r0 - thumb_func_end sub_81755A4 - - thumb_func_start sub_81755BC -sub_81755BC: @ 81755BC - push {r4,r5,lr} - sub sp, 0x18 - adds r4, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r2, 24 - add r1, sp, 0x14 - movs r0, 0 - strb r0, [r1] - cmp r2, 0x1 - bne _081755DC - movs r0, 0x3 - strb r0, [r1, 0x1] - movs r0, 0x4 - b _081755E4 -_081755DC: - add r1, sp, 0x14 - movs r0, 0x1 - strb r0, [r1, 0x1] - movs r0, 0x2 -_081755E4: - strb r0, [r1, 0x2] - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xF0 - movs r3, 0x1 - bl GetStringCenterAlignXOffsetWithLetterSpacing - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - add r0, sp, 0x14 - str r0, [sp, 0x8] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0xC] - str r4, [sp, 0x10] - movs r0, 0 - movs r1, 0x1 - adds r3, r5, 0 - bl AddTextPrinterParametrized2 - add sp, 0x18 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81755BC - - thumb_func_start sub_8175620 -sub_8175620: @ 8175620 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - bl sub_8175CE4 - movs r0, 0 - bl SetVBlankCallback - ldr r0, =0x02000000 - movs r1, 0xE0 - lsls r1, 9 - bl InitHeap - bl ResetPaletteFade - bl ResetTasks - bl sub_8175548 - ldr r0, =sub_8175744 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x10] - strh r1, [r0, 0x16] - strh r1, [r0, 0x1E] - movs r1, 0x1 - strh r1, [r0, 0x22] -_0817566A: - movs r0, 0 - adds r1, r7, 0 - bl sub_8176AB0 - lsls r0, 24 - cmp r0, 0 - beq _0817566A - ldr r5, =gTasks - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 3 - adds r4, r5 - movs r0, 0xA - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r1, 0 - mov r8, r1 - movs r6, 0 - movs r1, 0x28 - strh r1, [r0, 0x8] - ldr r1, =0x0000fffc - movs r0, 0x12 - bl SetGpuReg - ldr r0, =sub_8175DA0 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r5 - strh r7, [r1, 0xA] - strh r0, [r4, 0x26] - movs r0, 0x1 - negs r0, r0 - str r6, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - movs r0, 0x1 - bl EnableInterrupts - ldr r0, =sub_81754C8 - bl SetVBlankCallback - ldr r0, =0x000001c7 - bl m4aSongNumStart - ldr r0, =sub_81754DC - bl SetMainCallback2 - ldr r0, =gUnknown_0203BCE5 - mov r1, r8 - strb r1, [r0] - ldr r4, =gUnknown_0203BCE8 - movs r0, 0xEB - lsls r0, 2 - bl AllocZeroed - str r0, [r4] - bl sub_8177388 - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x8E - strh r6, [r0] - adds r0, 0x2 - strh r6, [r0] - adds r0, 0x2 - strh r6, [r0] - ldr r0, =gUnknown_0203BCE2 - strh r7, [r0] - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175620 - - thumb_func_start sub_8175744 -sub_8175744: @ 8175744 - 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 _08175764 - ldr r0, =gTasks - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8175774 - str r0, [r1] -_08175764: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175744 - - thumb_func_start sub_8175774 -sub_8175774: @ 8175774 - push {r4,lr} - sub sp, 0x4 - 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, 0x10 - ldrsh r1, [r4, r0] - cmp r1, 0 - beq _081757B0 - movs r3, 0xA - ldrsh r1, [r4, r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x1E - strh r1, [r0, 0x8] - movs r0, 0x80 - lsls r0, 1 - strh r0, [r4, 0x20] - ldr r0, =sub_8175A9C - b _081757FA - .pool -_081757B0: - ldr r0, =gUnknown_0203BCE0 - strh r1, [r0] - ldrh r2, [r4, 0x1E] - movs r3, 0x1E - ldrsh r0, [r4, r3] - cmp r0, 0x1 - bne _081757E0 - strh r2, [r4, 0x22] - strh r1, [r4, 0x1E] - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r0, =sub_8175808 - b _081757FA - .pool -_081757E0: - cmp r0, 0x2 - bne _081757FC - strh r2, [r4, 0x22] - strh r1, [r4, 0x1E] - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r0, =sub_81758A4 -_081757FA: - str r0, [r4] -_081757FC: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175774 - - thumb_func_start sub_8175808 -sub_8175808: @ 8175808 - 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 _08175836 - movs r0, 0 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl sub_8176CA0 - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =c2_080C9BFC - str r0, [r1] -_08175836: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175808 - - thumb_func_start c2_080C9BFC -c2_080C9BFC: @ 8175848 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - bl SetVBlankCallback - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r5, r0, r1 - ldrb r0, [r5, 0x16] - adds r1, r4, 0 - bl sub_8176AB0 - lsls r0, 24 - cmp r0, 0 - beq _08175890 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - movs r0, 0x1 - bl EnableInterrupts - ldr r0, =sub_81754C8 - bl SetVBlankCallback - ldr r0, =sub_8175744 - str r0, [r5] -_08175890: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end c2_080C9BFC - - thumb_func_start sub_81758A4 -sub_81758A4: @ 81758A4 - 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 _081758D2 - movs r0, 0 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl sub_8176CA0 - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81758E4 - str r0, [r1] -_081758D2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81758A4 - - thumb_func_start sub_81758E4 -sub_81758E4: @ 81758E4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gUnknown_030022C0 - movs r1, 0x87 - lsls r1, 3 - adds r1, r0 - mov r8, r1 - ldrb r7, [r1] - cmp r7, 0 - beq _08175906 - cmp r7, 0x1 - beq _081759F0 -_08175906: - bl ResetAllObjectData - bl dp13_810BB8C - bl ResetObjectPaletteAllocator - ldr r1, =gUnknown_0300301C - movs r0, 0x8 - strb r0, [r1] - ldr r0, =gUnknown_085B0E04 - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gUnknown_085B0C0C - ldr r1, =0x06003800 - bl LZ77UnCompVram - ldr r0, =gUnknown_085B0A02 - movs r1, 0x1 - movs r2, 0x3E - bl LoadPalette - movs r1, 0 - ldr r4, =0x0201c000 - movs r3, 0x11 - ldr r2, =0x000007ff -_0817593C: - adds r0, r1, r4 - strb r3, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r2 - bls _0817593C - movs r1, 0 - ldr r2, =0x0201d800 - ldr r6, =gUnknown_085E701C - ldr r0, =0xfffff000 - adds r5, r2, r0 - movs r4, 0x22 - ldr r3, =0x000007ff -_08175958: - adds r0, r1, r5 - strb r4, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r3 - bls _08175958 - movs r1, 0 - ldr r5, =0x0201d000 - movs r4, 0x33 - ldr r3, =0x000007ff -_0817596E: - adds r0, r1, r5 - strb r4, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r3 - bls _0817596E - movs r0, 0 - strh r0, [r2] - ldr r1, =0x000053ff - adds r0, r1, 0 - strh r0, [r2, 0x2] - ldr r1, =0x0000529f - adds r0, r1, 0 - strh r0, [r2, 0x4] - ldr r1, =0x00007e94 - adds r0, r1, 0 - strh r0, [r2, 0x6] - adds r0, r6, 0 - bl LoadObjectPic - ldr r0, =gUnknown_085E702C - bl LoadTaggedObjectPalette - ldr r1, =gUnknown_030022C0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08175A7A - .pool -_081759F0: - ldr r0, =sub_81760FC - movs r1, 0 - bl CreateTask - ldr r2, =gTasks - lsls r4, r6, 2 - adds r4, r6 - lsls r4, 3 - adds r4, r2 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - mov r9, r1 - movs r5, 0 - strh r0, [r4, 0xE] - movs r0, 0xE - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - strh r7, [r0, 0x8] - movs r0, 0xE - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - strh r6, [r0, 0xA] - movs r0, 0xE - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r1, [r4, 0x16] - strh r1, [r0, 0xC] - movs r0, 0x1 - negs r0, r0 - str r5, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - movs r0, 0x1C - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0x20 - bl SetGpuReg - ldr r1, =0x00000703 - movs r0, 0xE - bl SetGpuReg - movs r1, 0xCA - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - mov r0, r9 - mov r1, r8 - strb r0, [r1] - ldr r0, =gUnknown_0203BD28 - strh r5, [r0] - ldr r0, =sub_8175744 - str r0, [r4] -_08175A7A: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81758E4 - - thumb_func_start sub_8175A9C -sub_8175A9C: @ 8175A9C - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r0, [r4, 0x20] - movs r2, 0x20 - ldrsh r1, [r4, r2] - cmp r1, 0 - beq _08175AC4 - subs r0, 0x1 - strh r0, [r4, 0x20] - b _08175AD8 - .pool -_08175AC4: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0xC - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r0, =sub_8175AE4 - str r0, [r4] -_08175AD8: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175A9C - - thumb_func_start sub_8175AE4 -sub_8175AE4: @ 8175AE4 - 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 _08175B0A - adds r0, r4, 0 - bl sub_8176CA0 - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8175B1C - str r0, [r1] -_08175B0A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175AE4 - - thumb_func_start sub_8175B1C -sub_8175B1C: @ 8175B1C - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8175CE4 - bl ResetPaletteFade - movs r1, 0xE0 - lsls r1, 6 - movs r0, 0 - movs r2, 0 - bl sub_8176D1C - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r1, 0x8 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - movs r1, 0xE0 - lsls r1, 3 - movs r0, 0x8 - bl SetGpuReg - movs r0, 0x1 - bl EnableInterrupts - movs r1, 0xA0 - lsls r1, 1 - movs r0, 0 - bl SetGpuReg - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0xEB - strh r1, [r0, 0x8] - ldr r1, =sub_8175B90 - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175B1C - - thumb_func_start sub_8175B90 -sub_8175B90: @ 8175B90 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r0, [r4, 0x8] - movs r2, 0x8 - ldrsh r1, [r4, r2] - cmp r1, 0 - beq _08175BB8 - subs r0, 0x1 - strh r0, [r4, 0x8] - b _08175BCC - .pool -_08175BB8: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0x6 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r0, =sub_8175BD8 - str r0, [r4] -_08175BCC: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175B90 - - thumb_func_start sub_8175BD8 -sub_8175BD8: @ 8175BD8 - push {r4,r5,lr} - sub sp, 0x4 - 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 _08175C1E - movs r0, 0xE0 - lsls r0, 6 - movs r1, 0 - bl sub_8176E40 - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0xE1 - lsls r1, 5 - strh r1, [r0, 0x8] - ldr r1, =sub_8175C34 - str r1, [r0] -_08175C1E: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175BD8 - - thumb_func_start sub_8175C34 -sub_8175C34: @ 8175C34 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08175CB8 - 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, 0 - beq _08175C62 - ldr r0, =gUnknown_030022C0 - ldrh r0, [r0, 0x2E] - cmp r0, 0 - beq _08175C94 -_08175C62: - movs r0, 0x4 - bl play_sound_effect - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0x8 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r0, =sub_8175CC8 - str r0, [r4] - b _08175CB8 - .pool -_08175C94: - ldr r0, =0x00001be8 - cmp r1, r0 - bne _08175CA0 - movs r0, 0x8 - bl play_sound_effect -_08175CA0: - movs r0, 0x8 - ldrsh r1, [r4, r0] - ldr r0, =0x00001ab8 - cmp r1, r0 - bne _08175CB2 - movs r0, 0xE4 - lsls r0, 1 - bl m4aSongNumStart -_08175CB2: - ldrh r0, [r4, 0x8] - subs r0, 0x1 - strh r0, [r4, 0x8] -_08175CB8: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175C34 - - thumb_func_start sub_8175CC8 -sub_8175CC8: @ 8175CC8 - push {lr} - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08175CDC - movs r0, 0xFF - bl SoftReset -_08175CDC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175CC8 - - thumb_func_start sub_8175CE4 -sub_8175CE4: @ 8175CE4 - push {lr} - sub sp, 0x8 - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1C - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - movs r0, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r0, 0x10 - movs r1, 0 - bl SetGpuReg - movs r0, 0x12 - 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 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, =0x040000d4 - mov r0, sp - str r0, [r1] - movs r0, 0xC0 - lsls r0, 19 - str r0, [r1, 0x4] - ldr r0, =0x8100c000 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r2, 0 - str r2, [sp, 0x4] - add r0, sp, 0x4 - str r0, [r1] - movs r0, 0xE0 - lsls r0, 19 - str r0, [r1, 0x4] - ldr r0, =0x85000100 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - mov r0, sp - strh r2, [r0] - str r0, [r1] - ldr r0, =0x05000002 - str r0, [r1, 0x4] - ldr r0, =0x810001ff - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175CE4 - - thumb_func_start sub_8175DA0 -sub_8175DA0: @ 8175DA0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - 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 r5, r1, 0 - cmp r0, 0xA - bhi _08175E00 - lsls r0, 2 - ldr r1, =_08175DD4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08175DD4: - .4byte _08175E00 - .4byte _08175E40 - .4byte _08175E60 - .4byte _08175F38 - .4byte _08175F5C - .4byte _08175FC8 - .4byte _08175E00 - .4byte _08175E00 - .4byte _08175E00 - .4byte _08175E00 - .4byte _08175FFC -_08175E00: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _08175E12 - b _0817602A -_08175E12: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r5 - movs r1, 0x1 - strh r1, [r0, 0x8] - movs r1, 0x48 - strh r1, [r0, 0xE] - movs r3, 0xA - ldrsh r1, [r0, r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r2, [r0, 0x24] - ldr r0, =gUnknown_0203BCE0 - strh r2, [r0] - b _0817602A - .pool -_08175E40: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r5 - ldrh r2, [r1, 0xE] - movs r3, 0xE - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _08175E58 - subs r0, r2, 0x1 - strh r0, [r1, 0xE] - b _0817602A -_08175E58: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0817602A -_08175E60: - lsls r2, r4, 2 - adds r0, r2, r4 - lsls r0, 3 - adds r3, r0, r5 - movs r0, 0xA - ldrsh r1, [r3, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r5, r0, r5 - ldr r1, [r5] - ldr r0, =sub_8175774 - mov r9, r2 - cmp r1, r0 - bne _08175F32 - movs r1, 0xC - ldrsh r0, [r3, r1] - cmp r0, 0x38 - bgt _08175F2C - movs r5, 0 - ldr r2, =gUnknown_085E6AF4 - mov r8, r2 - adds r7, r3, 0 - movs r6, 0xA0 - lsls r6, 19 -_08175E92: - movs r3, 0xC - ldrsh r1, [r7, r3] - lsls r0, r1, 2 - adds r0, r1 - adds r0, r5 - lsls r0, 2 - add r0, r8 - ldr r2, [r0] - ldr r0, [r2, 0x4] - lsrs r1, r6, 24 - ldrb r2, [r2, 0x1] - bl sub_81755BC - movs r0, 0x80 - lsls r0, 21 - adds r6, r0 - adds r5, 0x1 - cmp r5, 0x4 - ble _08175E92 - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - ldr r3, =gTasks - mov r2, r9 - adds r1, r2, r4 - lsls r1, 3 - adds r1, r3 - ldrh r0, [r1, 0xC] - adds r0, 0x1 - strh r0, [r1, 0xC] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - movs r0, 0xA - ldrsh r2, [r1, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r3 - movs r2, 0x1 - strh r2, [r0, 0x24] - movs r2, 0xA - ldrsh r1, [r1, r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r3 - movs r3, 0x22 - ldrsh r0, [r0, r3] - cmp r0, 0x1 - bne _08175F14 - movs r0, 0xC0 - lsls r0, 2 - ldr r1, =0x0000328d - b _08175F1A - .pool -_08175F14: - movs r0, 0xC0 - lsls r0, 2 - ldr r1, =0x00001967 -_08175F1A: - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - b _0817602A - .pool -_08175F2C: - movs r0, 0xA - strh r0, [r3, 0x8] - b _0817602A -_08175F32: - movs r0, 0 - strh r0, [r5, 0x24] - b _0817602A -_08175F38: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0817602A - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r5 - movs r1, 0x73 - strh r1, [r0, 0xE] - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - b _0817602A - .pool -_08175F5C: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r5 - ldrh r1, [r4, 0xE] - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08175F74 - subs r0, r1, 0x1 - strh r0, [r4, 0xE] - b _0817602A -_08175F74: - ldrb r0, [r4, 0xC] - ldrb r1, [r4, 0xA] - bl sub_817603C - lsls r0, 24 - cmp r0, 0 - beq _08175F8A - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0817602A -_08175F8A: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r3, 0xA - ldrsh r1, [r4, r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r1, 0x22 - ldrsh r0, [r0, r1] - cmp r0, 0x1 - bne _08175FB0 - movs r0, 0xC0 - lsls r0, 2 - ldr r1, =0x0000328d - b _08175FB6 - .pool -_08175FB0: - movs r0, 0xC0 - lsls r0, 2 - ldr r1, =0x00001967 -_08175FB6: - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - b _0817602A - .pool -_08175FC8: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0817602A - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0x2 - strh r0, [r1, 0x8] - b _0817602A - .pool -_08175FFC: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r5 - movs r2, 0xA - ldrsh r1, [r0, r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r5, 0 - movs r1, 0x1 - strh r1, [r0, 0x10] - adds r0, r4, 0 - bl DestroyTask - bl sub_81755A4 - ldr r4, =gUnknown_0203BCE8 - ldr r0, [r4] - bl Free - str r5, [r4] -_0817602A: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175DA0 - - thumb_func_start sub_817603C -sub_817603C: @ 817603C - push {r4-r6,lr} - lsls r0, 24 - lsrs r3, r0, 24 - adds r6, r3, 0 - lsls r1, 24 - lsrs r2, r1, 24 - adds r5, r2, 0 - ldr r4, =gTasks - cmp r3, 0x6 - bne _0817605C - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r4 - movs r1, 0x2 - strh r1, [r0, 0x1E] -_0817605C: - cmp r3, 0xC - bne _0817606E - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r4 - movs r1, 0x1 - strh r1, [r0, 0x16] - strh r1, [r0, 0x1E] -_0817606E: - cmp r3, 0x12 - bne _0817607E - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r4 - movs r1, 0x2 - strh r1, [r0, 0x1E] -_0817607E: - cmp r3, 0x18 - bne _08176092 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r4 - movs r1, 0x2 - strh r1, [r0, 0x16] - movs r1, 0x1 - strh r1, [r0, 0x1E] -_08176092: - cmp r3, 0x1E - bne _081760A2 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r4 - movs r1, 0x2 - strh r1, [r0, 0x1E] -_081760A2: - cmp r3, 0x24 - bne _081760B6 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r4 - movs r1, 0x3 - strh r1, [r0, 0x16] - movs r1, 0x1 - strh r1, [r0, 0x1E] -_081760B6: - cmp r3, 0x2A - bne _081760C6 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r4 - movs r1, 0x2 - strh r1, [r0, 0x1E] -_081760C6: - cmp r6, 0x30 - bne _081760DA - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r4 - movs r1, 0x4 - strh r1, [r0, 0x16] - movs r1, 0x1 - strh r1, [r0, 0x1E] -_081760DA: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r4 - movs r1, 0x1E - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _081760F4 - movs r0, 0 - b _081760F6 - .pool -_081760F4: - movs r0, 0x1 -_081760F6: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_817603C - - thumb_func_start sub_81760FC -sub_81760FC: @ 81760FC - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r2, r0, r4 - movs r1, 0x8 - ldrsh r0, [r2, r1] - cmp r0, 0x1 - beq _0817612C - cmp r0, 0x1 - bgt _0817611A - b _08176244 -_0817611A: - cmp r0, 0x2 - beq _08176158 - cmp r0, 0x3 - bne _08176124 - b _08176230 -_08176124: - b _08176244 - .pool -_0817612C: - ldr r0, =gUnknown_0203BCE8 - ldr r0, [r0] - adds r0, 0x90 - ldrh r0, [r0] - cmp r0, 0 - bne _0817614E - movs r3, 0xA - ldrsh r0, [r2, r3] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r4 - movs r3, 0x24 - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _0817614E - b _08176244 -_0817614E: - ldrh r0, [r2, 0x8] - adds r0, 0x1 - b _08176242 - .pool -_08176158: - ldr r6, =gUnknown_0203BCE8 - ldr r3, [r6] - adds r0, r3, 0 - adds r0, 0x8E - ldrh r0, [r0] - cmp r0, 0x47 - beq _08176244 - movs r0, 0xA - ldrsh r1, [r2, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - ldr r1, [r0] - ldr r0, =sub_8175774 - cmp r1, r0 - bne _08176244 - adds r0, r3, 0 - adds r0, 0x92 - ldrh r0, [r0] - lsls r0, 1 - adds r0, r3, r0 - ldrh r0, [r0] - ldr r4, =gUnknown_085E6F7C - adds r1, r3, 0 - adds r1, 0x90 - ldrh r3, [r1] - lsls r2, r3, 1 - adds r1, r2, r4 - ldrb r1, [r1] - adds r4, 0x1 - adds r2, r4 - ldrb r2, [r2] - bl sub_8177224 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, [r6] - adds r1, r0, 0 - adds r1, 0x92 - ldrh r3, [r1] - adds r0, 0x94 - ldrh r0, [r0] - subs r0, 0x1 - cmp r3, r0 - bge _081761D8 - adds r0, r3, 0x1 - strh r0, [r1] - ldr r1, =gUnknown_02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - movs r1, 0x32 - b _081761EA - .pool -_081761D8: - movs r0, 0 - strh r0, [r1] - ldr r1, =gUnknown_02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - movs r1, 0x80 - lsls r1, 2 -_081761EA: - strh r1, [r0, 0x34] - ldr r0, =gUnknown_0203BCE8 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x8E - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - adds r1, 0x90 - ldrh r0, [r1] - cmp r0, 0x2 - bne _08176210 - movs r0, 0 - b _08176212 - .pool -_08176210: - adds r0, 0x1 -_08176212: - strh r0, [r1] - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r0, 0x32 - strh r0, [r1, 0xE] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _08176244 - .pool -_08176230: - ldrh r1, [r2, 0xE] - movs r3, 0xE - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _08176240 - subs r0, r1, 0x1 - strh r0, [r2, 0xE] - b _08176244 -_08176240: - movs r0, 0x1 -_08176242: - strh r0, [r2, 0x8] -_08176244: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81760FC - - thumb_func_start sub_817624C -sub_817624C: @ 817624C - 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 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r6, r1, 0 - cmp r0, 0x32 - bls _08176268 - b _08176514 -_08176268: - lsls r0, 2 - ldr r1, =_0817627C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0817627C: - .4byte _08176348 - .4byte _0817636C - .4byte _081763C0 - .4byte _081763D8 - .4byte _08176414 - .4byte _08176438 - .4byte _08176484 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176490 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _081764B0 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _081764D4 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176508 -_08176348: - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r6 - ldrh r0, [r4, 0x12] - lsls r0, 16 - asrs r0, 17 - movs r1, 0x7F - ands r0, r1 - movs r1, 0xC - bl sine - ldr r1, =gUnknown_0203BD26 - strh r0, [r1] - b _08176390 - .pool -_0817636C: - ldr r7, =gUnknown_0203BD26 - movs r3, 0 - ldrsh r4, [r7, r3] - cmp r4, 0 - beq _0817639C - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r6 - ldrh r0, [r4, 0x12] - lsls r0, 16 - asrs r0, 17 - movs r1, 0x7F - ands r0, r1 - movs r1, 0xC - bl sine - strh r0, [r7] -_08176390: - ldrh r0, [r4, 0x12] - adds r0, 0x1 - strh r0, [r4, 0x12] - b _08176514 - .pool -_0817639C: - ldr r3, =gUnknown_02020630 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r6 - movs r0, 0xC - ldrsh r2, [r1, r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - movs r2, 0x2 - strh r2, [r0, 0x2E] - strh r4, [r1, 0x12] - b _08176430 - .pool -_081763C0: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r1, r0, r6 - ldrh r2, [r1, 0x12] - movs r3, 0x12 - ldrsh r0, [r1, r3] - cmp r0, 0x3F - bgt _08176430 - adds r0, r2, 0x1 - strh r0, [r1, 0x12] - b _0817644E -_081763D8: - ldr r3, =gUnknown_02020630 - lsls r2, r5, 2 - adds r2, r5 - lsls r2, 3 - adds r2, r6 - movs r0, 0xC - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0x3 - strh r1, [r0, 0x2E] - movs r0, 0xE - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0x1 - strh r1, [r0, 0x2E] - movs r0, 0x78 - strh r0, [r2, 0x10] - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] - b _08176514 - .pool -_08176414: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r1, r0, r6 - ldrh r2, [r1, 0x10] - movs r3, 0x10 - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _0817642C - subs r0, r2, 0x1 - strh r0, [r1, 0x10] - b _08176514 -_0817642C: - movs r0, 0x40 - strh r0, [r1, 0x12] -_08176430: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _08176514 -_08176438: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r6 - ldrh r1, [r4, 0x12] - movs r2, 0x12 - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _08176464 - subs r0, r1, 0x1 - strh r0, [r4, 0x12] -_0817644E: - movs r1, 0x7F - ands r0, r1 - movs r1, 0x14 - bl sine - ldr r1, =gUnknown_0203BD26 - strh r0, [r1] - b _08176514 - .pool -_08176464: - ldr r2, =gUnknown_02020630 - movs r3, 0xC - ldrsh r1, [r4, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - strh r1, [r0, 0x2E] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _08176514 - .pool -_08176484: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r6 - movs r1, 0x32 - b _08176512 -_08176490: - ldr r3, =gUnknown_02020630 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r6 - movs r0, 0xE - ldrsh r2, [r1, r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - movs r2, 0x2 - b _081764C8 - .pool -_081764B0: - ldr r3, =gUnknown_02020630 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r6 - movs r0, 0xC - ldrsh r2, [r1, r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - movs r2, 0x4 -_081764C8: - strh r2, [r0, 0x2E] - movs r0, 0x32 - strh r0, [r1, 0x8] - b _08176514 - .pool -_081764D4: - ldr r3, =gUnknown_02020630 - lsls r2, r5, 2 - adds r2, r5 - lsls r2, 3 - adds r2, r6 - movs r0, 0xC - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0x5 - strh r1, [r0, 0x2E] - movs r0, 0xE - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0x3 - strh r1, [r0, 0x2E] - movs r0, 0x32 - strh r0, [r2, 0x8] - b _08176514 - .pool -_08176508: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r6 - movs r1, 0 -_08176512: - strh r1, [r0, 0x8] -_08176514: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_817624C - - thumb_func_start sub_817651C -sub_817651C: @ 817651C - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - movs r3, 0x8 - ldrsh r0, [r0, r3] - adds r4, r1, 0 - cmp r0, 0x4 - bhi _0817655C - lsls r0, 2 - ldr r1, =_08176548 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08176548: - .4byte _0817655C - .4byte _081765A0 - .4byte _081765AC - .4byte _081765F4 - .4byte _08176640 -_0817655C: - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r2, r0, r4 - movs r1, 0xA - ldrsh r0, [r2, r1] - ldr r5, =0x00007fff - cmp r0, r5 - beq _081765A0 - movs r3, 0xC - ldrsh r1, [r2, r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r3, r0, r4 - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r1, 0xC - ldrsh r0, [r0, r1] - cmp r0, 0x2 - bne _081765A0 - movs r1, 0xA - ldrsh r0, [r3, r1] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r4 - movs r0, 0x14 - strh r0, [r1, 0x8] - strh r5, [r2, 0xA] -_081765A0: - movs r0, 0 - bl sub_817B540 - b _08176646 - .pool -_081765AC: - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r2, r0, r4 - movs r3, 0xA - ldrsh r0, [r2, r3] - ldr r5, =0x00007fff - cmp r0, r5 - beq _08176638 - movs r0, 0xC - ldrsh r1, [r2, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r3, 0xA - ldrsh r1, [r0, r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r3, r0, r4 - ldrh r1, [r3, 0x12] - movs r0, 0x80 - negs r0, r0 - ands r0, r1 - movs r1, 0xA0 - lsls r1, 2 - cmp r0, r1 - bne _08176638 - movs r0, 0x1 - strh r0, [r3, 0x8] - strh r5, [r2, 0xA] - b _08176638 - .pool -_081765F4: - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r2, r0, r4 - ldrh r3, [r2, 0xA] - movs r0, 0xA - ldrsh r1, [r2, r0] - ldr r5, =0x00007fff - cmp r1, r5 - beq _08176638 - movs r0, 0x92 - lsls r0, 2 - cmp r1, r0 - bne _08176634 - movs r3, 0xC - ldrsh r1, [r2, r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r3, 0xA - ldrsh r1, [r0, r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r1, 0xA - strh r1, [r0, 0x8] - strh r5, [r2, 0xA] - b _08176638 - .pool -_08176634: - adds r0, r3, 0x1 - strh r0, [r2, 0xA] -_08176638: - movs r0, 0x1 - bl sub_817B540 - b _08176646 -_08176640: - movs r0, 0x2 - bl sub_817B540 -_08176646: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_817651C - - thumb_func_start sub_817664C -sub_817664C: @ 817664C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 24 - lsrs r7, r1, 24 - cmp r0, 0x4 - bls _08176662 - b _081769E0 -_08176662: - lsls r0, 2 - ldr r1, =_08176670 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08176670: - .4byte _08176684 - .4byte _0817672C - .4byte _081767D8 - .4byte _08176884 - .4byte _08176934 -_08176684: - ldr r5, =gUnknown_02020630 - ldr r0, =gTasks - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 3 - adds r4, r0 - movs r1, 0x12 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r3, 0 - movs r2, 0x88 - lsls r2, 1 - strh r2, [r0, 0x20] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x20] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r2, 0x2E - strh r2, [r0, 0x22] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x22] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - movs r2, 0x20 - b _081769D4 - .pool -_0817672C: - ldr r5, =gUnknown_02020630 - ldr r0, =gTasks - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 3 - adds r4, r0 - movs r1, 0x12 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r3, 0 - movs r1, 0x78 - strh r1, [r0, 0x20] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x88 - lsls r1, 1 - strh r1, [r0, 0x20] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r2, 0x2E - strh r2, [r0, 0x22] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x22] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - movs r2, 0x20 - b _081769D4 - .pool -_081767D8: - ldr r5, =gUnknown_02020630 - ldr r0, =gTasks - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 3 - adds r4, r0 - movs r1, 0x12 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r3, 0 - movs r1, 0x78 - strh r1, [r0, 0x20] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x88 - lsls r1, 1 - strh r1, [r0, 0x20] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r2, 0x2E - strh r2, [r0, 0x22] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x22] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r1, 0x80 - lsls r1, 6 - movs r2, 0x80 - lsls r2, 2 - movs r0, 0x1 - b _081769D4 - .pool -_08176884: - ldr r5, =gUnknown_02020630 - ldr r0, =gTasks - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 3 - adds r4, r0 - movs r1, 0x12 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r3, 0 - movs r1, 0x78 - strh r1, [r0, 0x20] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x0000ffe0 - strh r1, [r0, 0x20] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r2, 0x2E - strh r2, [r0, 0x22] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x22] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r1, 0x80 - lsls r1, 6 - movs r2, 0x80 - lsls r2, 2 - movs r0, 0x1 - b _081769D4 - .pool -_08176934: - ldr r5, =gUnknown_02020630 - ldr r0, =gTasks - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 3 - adds r4, r0 - movs r1, 0x12 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r3, 0 - movs r1, 0x58 - strh r1, [r0, 0x20] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x98 - strh r1, [r0, 0x20] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r2, 0x2E - strh r2, [r0, 0x22] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x22] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r1, 0x80 - lsls r1, 6 - movs r2, 0x80 - lsls r2, 2 - movs r0, 0x2 -_081769D4: - movs r3, 0x8 - bl sub_817B3DC - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x8] -_081769E0: - ldr r0, =sub_817651C - movs r1, 0 - bl CreateTask - ldr r6, =gTasks - lsls r1, r7, 2 - adds r1, r7 - lsls r1, 3 - adds r5, r1, r6 - lsls r0, 24 - lsrs r0, 24 - movs r4, 0 - strh r0, [r5, 0xC] - movs r0, 0xC - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - mov r1, r8 - strh r1, [r0, 0x8] - movs r0, 0xC - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - strh r4, [r0, 0xA] - movs r0, 0xC - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - strh r7, [r0, 0xC] - ldr r0, =sub_817624C - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0xA] - movs r0, 0xA - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - strh r4, [r0, 0x8] - movs r0, 0xA - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - strh r7, [r0, 0xA] - movs r0, 0xA - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - ldrh r1, [r5, 0x12] - strh r1, [r0, 0xC] - movs r0, 0xA - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - ldrh r1, [r5, 0x14] - strh r1, [r0, 0xE] - movs r0, 0xA - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - strh r4, [r0, 0x10] - mov r1, r8 - cmp r1, 0x2 - bne _08176A94 - movs r1, 0xA - ldrsh r0, [r5, r1] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r6 - movs r0, 0x45 - strh r0, [r1, 0x12] -_08176A94: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817664C - - thumb_func_start sub_8176AB0 -sub_8176AB0: @ 8176AB0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - ldr r0, =gUnknown_030022C0 - movs r1, 0x87 - lsls r1, 3 - adds r6, r0, r1 - ldrb r0, [r6] - cmp r0, 0x1 - beq _08176B30 - cmp r0, 0x1 - ble _08176AD6 - cmp r0, 0x2 - beq _08176B54 - cmp r0, 0x3 - bne _08176AD6 - b _08176C80 -_08176AD6: - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1C - movs r1, 0x8 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - movs r0, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - 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 r0, 0x52 - movs r1, 0 - bl SetGpuReg - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - movs r0, 0x1 - strb r0, [r6] - b _08176C96 - .pool -_08176B30: - ldr r1, =gUnknown_0203BD24 - movs r0, 0x22 - strh r0, [r1] - ldr r1, =gUnknown_0203BD26 - movs r0, 0 - strh r0, [r1] - adds r0, r4, 0 - bl sub_817B1C8 - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] - b _08176C96 - .pool -_08176B54: - ldr r0, =gUnknown_03005D90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _08176BD8 - ldr r0, =gUnknown_085F5334 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F53BC - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F5354 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F5384 - bl LoadTaggedObjectPalettes - movs r0, 0x78 - movs r1, 0x2E - bl sub_817B834 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gTasks - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - strh r2, [r4, 0x12] - ldr r6, =gUnknown_02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r5, r6, 0 - adds r5, 0x1C - adds r2, r0, r5 - ldr r1, =sub_8176EE8 - str r1, [r2] - adds r6, 0x8 - adds r0, r6 - ldr r1, =gUnknown_085E6FD0 - str r1, [r0] - movs r0, 0x88 - lsls r0, 1 - movs r1, 0x2E - bl sub_817B88C - b _08176C2C - .pool -_08176BD8: - ldr r0, =gUnknown_085F5344 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F53AC - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F5354 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F5384 - bl LoadTaggedObjectPalettes - movs r0, 0x78 - movs r1, 0x2E - bl sub_817B88C - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gTasks - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - strh r2, [r4, 0x12] - ldr r6, =gUnknown_02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r5, r6, 0 - adds r5, 0x1C - adds r2, r0, r5 - ldr r1, =sub_8176EE8 - str r1, [r2] - adds r6, 0x8 - adds r0, r6 - ldr r1, =gUnknown_085E6FD0 - str r1, [r0] - movs r0, 0x88 - lsls r0, 1 - movs r1, 0x2E - bl sub_817B834 -_08176C2C: - lsls r0, 24 - lsrs r2, r0, 24 - strh r2, [r4, 0x14] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r5, r0, r5 - ldr r1, =sub_8176F90 - str r1, [r5] - adds r0, r6 - ldr r1, =gUnknown_085E7010 - str r1, [r0] - ldr r1, =gUnknown_030022C0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08176C96 - .pool -_08176C80: - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_817664C - adds r0, r4, 0 - bl sub_817B3A8 - movs r0, 0 - strb r0, [r6] - movs r0, 0x1 - b _08176C98 -_08176C96: - movs r0, 0 -_08176C98: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8176AB0 - - thumb_func_start sub_8176CA0 -sub_8176CA0: @ 8176CA0 - 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 - ldrh r1, [r4, 0x8] - movs r2, 0x8 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08176CC6 - lsls r0, r1, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - strh r0, [r4, 0x8] -_08176CC6: - ldrh r1, [r4, 0xA] - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08176CDC - lsls r0, r1, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - strh r0, [r4, 0xA] -_08176CDC: - ldrh r1, [r4, 0xC] - movs r2, 0xC - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08176CF2 - lsls r0, r1, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - strh r0, [r4, 0xC] -_08176CF2: - ldrh r1, [r4, 0xE] - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08176D08 - lsls r0, r1, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - strh r0, [r4, 0xE] -_08176D08: - ldr r1, =gUnknown_0203BD28 - movs r0, 0x1 - strh r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8176CA0 - - thumb_func_start sub_8176D1C -sub_8176D1C: @ 8176D1C - push {r4-r7,lr} - adds r3, r0, 0 - adds r4, r2, 0 - lsls r3, 16 - lsrs r3, 16 - lsls r1, 16 - lsrs r7, r1, 16 - lsls r4, 16 - lsrs r5, r4, 16 - ldr r0, =gUnknown_085E5770 - movs r6, 0xC0 - lsls r6, 19 - adds r3, r6 - adds r1, r3, 0 - bl LZ77UnCompVram - ldr r0, =gIntroCopyright_Pal - adds r1, r5, 0 - movs r2, 0x20 - bl LoadPalette - lsrs r4, 20 - lsls r4, 28 - lsrs r4, 16 - movs r1, 0 - adds r4, 0x1 - ldr r2, =0x000003ff -_08176D52: - lsls r0, r1, 1 - adds r0, r7 - adds r0, r6 - strh r4, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r2 - bls _08176D52 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8176D1C - - thumb_func_start sub_8176D78 -sub_8176D78: @ 8176D78 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - adds r3, r2, 0 - movs r0, 0x3F - ands r0, r2 - adds r1, r0, 0 - adds r1, 0x50 - cmp r2, 0xFF - bne _08176D90 - movs r0, 0x1 - b _08176DB6 -_08176D90: - movs r0, 0x80 - ands r0, r2 - cmp r0, 0 - beq _08176DA0 - movs r2, 0x80 - lsls r2, 4 - adds r0, r2, 0 - orrs r1, r0 -_08176DA0: - movs r0, 0x40 - ands r3, r0 - cmp r3, 0 - beq _08176DB4 - movs r2, 0x80 - lsls r2, 3 - adds r0, r2, 0 - orrs r1, r0 - lsls r0, r1, 16 - lsrs r1, r0, 16 -_08176DB4: - adds r0, r1, 0 -_08176DB6: - pop {r1} - bx r1 - thumb_func_end sub_8176D78 - - thumb_func_start sub_8176DBC -sub_8176DBC: @ 8176DBC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - str r0, [sp] - ldr r0, [sp, 0x2C] - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x4] - lsls r3, 16 - lsrs r3, 16 - str r3, [sp, 0x8] - lsls r0, 16 - lsrs r0, 20 - lsls r0, 28 - lsrs r0, 16 - mov r9, r0 - movs r5, 0 -_08176DEA: - movs r4, 0 - lsls r7, r5, 1 - ldr r1, [sp, 0x4] - adds r0, r1, r5 - adds r2, r5, 0x1 - mov r8, r2 - lsls r0, 6 - ldr r1, [sp, 0x8] - adds r6, r0, r1 -_08176DFC: - adds r0, r7, r5 - adds r0, r4 - ldr r2, [sp] - adds r0, r2, r0 - ldrb r0, [r0] - bl sub_8176D78 - mov r2, r10 - adds r1, r2, r4 - lsls r1, 1 - adds r1, r6 - movs r2, 0xC0 - lsls r2, 19 - adds r1, r2 - add r0, r9 - strh r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _08176DFC - mov r1, r8 - lsls r0, r1, 24 - lsrs r5, r0, 24 - cmp r5, 0x4 - bls _08176DEA - 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_8176DBC - - thumb_func_start sub_8176E40 -sub_8176E40: @ 8176E40 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 16 - lsrs r6, r1, 16 - lsrs r1, 20 - lsls r1, 28 - lsrs r1, 16 - movs r2, 0 - ldr r7, =gUnknown_085E5BAC - movs r4, 0xC0 - lsls r4, 19 - adds r1, 0x1 - ldr r3, =0x000003ff -_08176E5E: - lsls r0, r2, 1 - adds r0, r5 - adds r0, r4 - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, r3 - bls _08176E5E - str r6, [sp] - adds r0, r7, 0 - movs r1, 0x3 - movs r2, 0x7 - adds r3, r5, 0 - bl sub_8176DBC - ldr r0, =gUnknown_085E5BBB - str r6, [sp] - movs r1, 0x7 - movs r2, 0x7 - adds r3, r5, 0 - bl sub_8176DBC - ldr r4, =gUnknown_085E5BCA - str r6, [sp] - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0x7 - adds r3, r5, 0 - bl sub_8176DBC - str r6, [sp] - adds r0, r4, 0 - movs r1, 0x10 - movs r2, 0x7 - adds r3, r5, 0 - bl sub_8176DBC - ldr r0, =gUnknown_085E5BD9 - str r6, [sp] - movs r1, 0x14 - movs r2, 0x7 - adds r3, r5, 0 - bl sub_8176DBC - ldr r0, =gUnknown_085E5BE8 - str r6, [sp] - movs r1, 0x18 - movs r2, 0x7 - adds r3, r5, 0 - bl sub_8176DBC - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8176E40 - - thumb_func_start sub_8176EE8 -sub_8176EE8: @ 8176EE8 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_0203BD28 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _08176F04 - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - b _08176F88 - .pool -_08176F04: - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0x5 - bhi _08176F88 - lsls r0, 2 - ldr r1, =_08176F1C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08176F1C: - .4byte _08176F34 - .4byte _08176F3E - .4byte _08176F44 - .4byte _08176F4E - .4byte _08176F58 - .4byte _08176F6E -_08176F34: - adds r0, r4, 0 - movs r1, 0 - bl StartObjectImageAnimIfDifferent - b _08176F88 -_08176F3E: - adds r0, r4, 0 - movs r1, 0x1 - b _08176F72 -_08176F44: - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectImageAnimIfDifferent - b _08176F88 -_08176F4E: - adds r0, r4, 0 - movs r1, 0x3 - bl StartObjectImageAnimIfDifferent - b _08176F88 -_08176F58: - adds r0, r4, 0 - movs r1, 0 - bl StartObjectImageAnimIfDifferent - ldrh r1, [r4, 0x20] - movs r2, 0x20 - ldrsh r0, [r4, r2] - cmp r0, 0x78 - ble _08176F88 - subs r0, r1, 0x1 - b _08176F86 -_08176F6E: - adds r0, r4, 0 - movs r1, 0 -_08176F72: - bl StartObjectImageAnimIfDifferent - ldrh r2, [r4, 0x20] - movs r0, 0x20 - ldrsh r1, [r4, r0] - movs r0, 0x20 - negs r0, r0 - cmp r1, r0 - ble _08176F88 - subs r0, r2, 0x1 -_08176F86: - strh r0, [r4, 0x20] -_08176F88: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8176EE8 - - thumb_func_start sub_8176F90 -sub_8176F90: @ 8176F90 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_0203BD28 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _08176FAC - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - b _08177048 - .pool -_08176FAC: - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _08176FD4 - cmp r0, 0x1 - bgt _08176FBE - cmp r0, 0 - beq _08176FC8 - b _08177048 -_08176FBE: - cmp r0, 0x2 - beq _08177010 - cmp r0, 0x3 - beq _0817702E - b _08177048 -_08176FC8: - strh r0, [r4, 0x26] - adds r0, r4, 0 - movs r1, 0 - bl StartObjectImageAnimIfDifferent - b _08177048 -_08176FD4: - movs r1, 0x20 - ldrsh r0, [r4, r1] - cmp r0, 0xC8 - ble _08176FE6 - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectImageAnimIfDifferent - b _08176FEE -_08176FE6: - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectImageAnimIfDifferent -_08176FEE: - ldrh r2, [r4, 0x20] - movs r0, 0x20 - ldrsh r1, [r4, r0] - movs r0, 0x20 - negs r0, r0 - cmp r1, r0 - ble _08177000 - subs r0, r2, 0x2 - strh r0, [r4, 0x20] -_08177000: - ldr r0, =gUnknown_0203BD26 - ldrh r0, [r0] - negs r0, r0 - strh r0, [r4, 0x26] - b _08177048 - .pool -_08177010: - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] - adds r0, r4, 0 - movs r1, 0 - bl StartObjectImageAnimIfDifferent - ldrh r1, [r4, 0x3C] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _08177048 - ldrh r0, [r4, 0x20] - adds r0, 0x1 - b _08177046 -_0817702E: - adds r0, r4, 0 - movs r1, 0 - bl StartObjectImageAnimIfDifferent - ldrh r2, [r4, 0x20] - movs r0, 0x20 - ldrsh r1, [r4, r0] - movs r0, 0x20 - negs r0, r0 - cmp r1, r0 - ble _08177048 - subs r0, r2, 0x1 -_08177046: - strh r0, [r4, 0x20] -_08177048: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8176F90 - - thumb_func_start sub_8177050 -sub_8177050: @ 8177050 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, =gUnknown_0203BD28 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _0817706C - ldrh r0, [r5, 0x3A] - bl sub_818D820 - b _0817721C - .pool -_0817706C: - ldrh r0, [r5, 0x3C] - adds r0, 0x1 - strh r0, [r5, 0x3C] - movs r2, 0x2E - ldrsh r0, [r5, r2] - cmp r0, 0xA - bhi _081770B4 - lsls r0, 2 - ldr r1, =_08177088 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08177088: - .4byte _081770B4 - .4byte _0817710E - .4byte _08177190 - .4byte _081771C6 - .4byte _081770B4 - .4byte _081770B4 - .4byte _081770B4 - .4byte _081770B4 - .4byte _081770B4 - .4byte _081771FE - .4byte _08177206 -_081770B4: - ldrb r1, [r5, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r5, 0x1] - movs r0, 0x30 - ldrsh r1, [r5, r0] - movs r0, 0x1F - ands r1, r0 - lsls r1, 1 - ldrb r2, [r5, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x3] - movs r0, 0x10 - strh r0, [r5, 0x32] - ldrh r4, [r5, 0x30] - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x80 - lsls r0, 9 - movs r1, 0x10 - bl __divsi3 - adds r1, r0, 0 - str r1, [sp] - adds r0, r4, 0 - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - adds r2, r5, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - movs r0, 0x1 - strh r0, [r5, 0x2E] - b _0817721C -_0817710E: - ldrh r1, [r5, 0x32] - movs r2, 0x32 - ldrsh r0, [r5, r2] - cmp r0, 0xFF - bgt _08177144 - adds r0, r1, 0 - adds r0, 0x8 - strh r0, [r5, 0x32] - ldrh r4, [r5, 0x30] - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x32 - ldrsh r1, [r5, r0] - movs r0, 0x80 - lsls r0, 9 - bl __divsi3 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - adds r0, r4, 0 - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - b _0817714A -_08177144: - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] -_0817714A: - movs r2, 0x30 - ldrsh r1, [r5, r2] - cmp r1, 0x2 - beq _0817721C - cmp r1, 0x2 - bgt _0817715C - cmp r1, 0x1 - beq _08177162 - b _0817721C -_0817715C: - cmp r1, 0x3 - beq _0817717A - b _0817721C -_08177162: - ldrh r1, [r5, 0x3C] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _08177172 - ldrh r0, [r5, 0x22] - adds r0, 0x1 - strh r0, [r5, 0x22] -_08177172: - ldrh r0, [r5, 0x20] - subs r0, 0x2 - strh r0, [r5, 0x20] - b _0817721C -_0817717A: - ldrh r0, [r5, 0x3C] - ands r1, r0 - cmp r1, 0 - bne _08177188 - ldrh r0, [r5, 0x22] - adds r0, 0x1 - strh r0, [r5, 0x22] -_08177188: - ldrh r0, [r5, 0x20] - adds r0, 0x2 - strh r0, [r5, 0x20] - b _0817721C -_08177190: - ldrh r1, [r5, 0x34] - movs r2, 0x34 - ldrsh r0, [r5, r2] - cmp r0, 0 - beq _081771A0 - subs r0, r1, 0x1 - strh r0, [r5, 0x34] - b _0817721C -_081771A0: - movs r1, 0xF4 - lsls r1, 4 - movs r0, 0x50 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0x10 - bl SetGpuReg - ldrb r1, [r5, 0x1] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r5, 0x1] - movs r0, 0x10 - strh r0, [r5, 0x34] - b _081771FE -_081771C6: - ldrh r1, [r5, 0x34] - movs r2, 0x34 - ldrsh r0, [r5, r2] - cmp r0, 0 - beq _081771EC - subs r1, 0x1 - strh r1, [r5, 0x34] - movs r0, 0x34 - ldrsh r2, [r5, r0] - movs r0, 0x10 - subs r0, r2 - lsls r0, 8 - adds r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - b _0817721C -_081771EC: - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x9 - strh r0, [r5, 0x2E] - b _0817721C -_081771FE: - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - b _0817721C -_08177206: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - ldrh r0, [r5, 0x3A] - bl sub_818D820 -_0817721C: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8177050 - - thumb_func_start sub_8177224 -sub_8177224: @ 8177224 - push {r4-r7,lr} - adds r5, r3, 0 - lsls r0, 16 - lsrs r0, 16 - lsls r5, 16 - lsrs r5, 16 - lsls r1, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - adds r3, r5, 0 - bl sub_80C0E9C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r6, =gUnknown_02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r2, r1, r6 - ldrb r3, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - movs r3, 0x4 - orrs r0, r3 - strb r0, [r2, 0x5] - adds r0, r5, 0x1 - strh r0, [r2, 0x30] - movs r0, 0x3E - adds r0, r2 - mov r12, r0 - ldrb r0, [r0] - orrs r0, r3 - mov r3, r12 - strb r0, [r3] - adds r0, r6, 0 - adds r0, 0x1C - adds r1, r0 - ldr r0, =sub_8177050 - str r0, [r1] - strh r4, [r2, 0x3A] - ldr r0, =gUnknown_085E7068 - movs r7, 0x20 - ldrsh r1, [r2, r7] - movs r3, 0x22 - ldrsh r2, [r2, r3] - movs r3, 0x1 - bl AddObjectToFront - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r4, [r0, 0x2E] - lsls r5, 24 - lsrs r5, 24 - adds r1, r5, 0 - bl StartObjectImageAnimIfDifferent - adds r0, r4, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8177224 - - thumb_func_start sub_81772B8 -sub_81772B8: @ 81772B8 - push {r4,lr} - adds r3, r0, 0 - ldr r4, =gUnknown_02020630 - movs r1, 0x2E - ldrsh r0, [r3, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0xA - beq _081772DC - ldr r0, =gUnknown_0203BD28 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, 0 - beq _081772EC -_081772DC: - adds r0, r3, 0 - bl RemoveObjectAndFreeTiles - b _08177380 - .pool -_081772EC: - adds r0, r1, 0 - adds r0, 0x3E - ldrb r0, [r0] - movs r1, 0x3E - adds r1, r3 - mov r12, r1 - movs r1, 0x4 - ands r1, r0 - mov r0, r12 - ldrb r2, [r0] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - movs r2, 0x2E - ldrsh r1, [r3, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x1] - movs r0, 0xC - ands r0, r1 - ldrb r2, [r3, 0x1] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x1] - movs r0, 0x2E - ldrsh r2, [r3, r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x1] - lsls r0, 30 - lsrs r0, 30 - movs r2, 0x4 - negs r2, r2 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x1] - movs r2, 0x2E - ldrsh r1, [r3, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x3] - movs r1, 0x3E - ands r1, r0 - ldrb r2, [r3, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x3] - movs r0, 0x2E - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x20] - strh r0, [r3, 0x20] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x22] - strh r0, [r3, 0x22] -_08177380: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81772B8 - - thumb_func_start sub_8177388 -sub_8177388: @ 8177388 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x00004023 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - bl sub_8133EDC - lsls r0, 16 - lsrs r0, 16 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - movs r4, 0x1 - movs r6, 0 - ldr r5, =0x00000181 -_081773B4: - adds r0, r4, 0 - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - beq _081773D4 - ldr r0, =gUnknown_0203BCE8 - ldr r0, [r0] - lsls r1, r6, 1 - adds r0, 0x96 - adds r0, r1 - strh r4, [r0] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 -_081773D4: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r5 - bls _081773B4 - adds r4, r6, 0 - ldr r0, =0x00000181 - ldr r1, =gUnknown_0203BCE8 - mov r8, r1 - lsls r7, r4, 16 - cmp r4, r0 - bhi _08177406 - mov r5, r8 - movs r3, 0 - adds r2, r0, 0 -_081773F2: - ldr r0, [r5] - lsls r1, r4, 1 - adds r0, 0x96 - adds r0, r1 - strh r3, [r0] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r2 - bls _081773F2 -_08177406: - mov r2, r8 - ldr r1, [r2] - ldr r2, =0x0000039a - adds r0, r1, r2 - strh r6, [r0] - lsrs r0, r7, 16 - cmp r0, 0x46 - bhi _08177430 - adds r0, r1, 0 - adds r0, 0x94 - strh r6, [r0] - b _08177436 - .pool -_08177430: - adds r1, 0x94 - movs r0, 0x47 - strh r0, [r1] -_08177436: - movs r6, 0 - ldr r0, =gUnknown_0203BCE8 - mov r9, r0 - ldr r1, =0x0000039a - mov r8, r1 - movs r7, 0 - b _08177450 - .pool -_0817744C: - cmp r6, 0x46 - bhi _081774AC -_08177450: - bl GenerateRandomNumber - mov r2, r9 - ldr r4, [r2] - mov r1, r8 - adds r5, r4, r1 - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r5] - bl __umodsi3 - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, r6, 1 - adds r1, r4, r1 - lsls r0, r3, 1 - adds r4, 0x96 - adds r2, r4, r0 - ldrh r0, [r2] - strh r0, [r1] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - strh r7, [r2] - ldrh r0, [r5] - subs r0, 0x1 - strh r0, [r5] - lsls r0, 16 - lsrs r0, 16 - cmp r3, r0 - beq _081774A0 - ldrh r0, [r5] - lsls r0, 1 - adds r0, r4, r0 - ldrh r0, [r0] - strh r0, [r2] - ldrh r0, [r5] - lsls r0, 1 - adds r0, r4, r0 - strh r7, [r0] -_081774A0: - mov r2, r9 - ldr r0, [r2] - add r0, r8 - ldrh r0, [r0] - cmp r0, 0 - bne _0817744C -_081774AC: - ldr r1, =gUnknown_0203BCE8 - ldr r2, [r1] - adds r3, r2, 0 - adds r3, 0x94 - ldrh r0, [r3] - mov r8, r1 - cmp r0, 0x46 - bhi _081774F8 - adds r6, r0, 0 - movs r3, 0 - cmp r6, 0x46 - bhi _081774EE - mov r4, r8 -_081774C6: - ldr r2, [r4] - lsls r1, r6, 1 - adds r1, r2, r1 - lsls r0, r3, 1 - adds r0, r2, r0 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - adds r2, 0x94 - ldrh r2, [r2] - cmp r3, r2 - bne _081774E4 - movs r3, 0 -_081774E4: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x46 - bls _081774C6 -_081774EE: - mov r1, r8 - ldr r0, [r1] - b _08177538 - .pool -_081774F8: - movs r4, 0 - ldrh r0, [r2] - cmp r0, r10 - beq _08177516 - adds r1, r2, 0 -_08177502: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - lsls r0, r4, 1 - adds r0, r1, r0 - ldrh r0, [r0] - cmp r0, r10 - beq _08177516 - cmp r4, 0x46 - bls _08177502 -_08177516: - mov r0, r8 - ldr r2, [r0] - adds r0, r2, 0 - adds r0, 0x94 - ldrh r0, [r0] - subs r0, 0x1 - cmp r4, r0 - bge _08177536 - lsls r0, r4, 1 - adds r0, r2, r0 - adds r2, 0x8C - ldrh r1, [r2] - strh r1, [r0] - mov r1, r10 - strh r1, [r2] - b _0817753E -_08177536: - adds r0, r2, 0 -_08177538: - adds r0, 0x8C - mov r2, r10 - strh r2, [r0] -_0817753E: - mov r1, r8 - ldr r0, [r1] - adds r0, 0x94 - movs r1, 0x47 - strh r1, [r0] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8177388 - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_81700F8.s b/asm/rom_81700F8.s new file mode 100644 index 000000000..124d12bf3 --- /dev/null +++ b/asm/rom_81700F8.s @@ -0,0 +1,64 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_81700F8 +sub_81700F8: @ 81700F8 + push {r4,r5,lr} + ldr r5, =0x04000208 + ldrh r4, [r5] + movs r0, 0 + strh r0, [r5] + movs r0, 0x1 + bl RegisterRamReset + movs r0, 0 + movs r1, 0x80 + bl ClearGpuRegBits + strh r4, [r5] + ldr r1, =gMain + ldr r0, =0x00000439 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + bl sub_815355C + lsls r0, 16 + lsrs r0, 16 + bl InitSaveBlockPointersWithRandomOffset + bl sub_808447C + bl sub_8152680 + movs r0, 0 + bl sub_81534D0 + ldr r0, =gUnknown_03006210 + ldrh r0, [r0] + cmp r0, 0 + beq _08170148 + cmp r0, 0x2 + bne _0817014C +_08170148: + bl init_sav2 +_0817014C: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldrb r0, [r0, 0x15] + lsls r0, 31 + lsrs r0, 31 + bl SetPokemonCryStereo + ldr r0, =0x02000000 + movs r1, 0xE0 + lsls r1, 9 + bl InitHeap + ldr r0, =sub_8086230 + bl SetMainCallback2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81700F8 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_817B064.s b/asm/rom_817C95C.s similarity index 59% rename from asm/rom_817B064.s rename to asm/rom_817C95C.s index d9898c388..343f21347 100644 --- a/asm/rom_817B064.s +++ b/asm/rom_817C95C.s @@ -5,3016 +5,6 @@ .text - thumb_func_start load_intro_part2_graphics -load_intro_part2_graphics: @ 817B064 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_085F0740 - ldr r1, =0x06004000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F0BC0 - ldr r1, =0x06007800 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F06E0 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - cmp r4, 0 - beq _0817B08C - cmp r4, 0x1 - beq _0817B0EC -_0817B08C: - ldr r0, =gUnknown_085F0DBC - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F1398 - ldr r1, =0x06003000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F0CFC - movs r1, 0 - movs r2, 0x60 - bl LoadPalette - ldr r0, =gUnknown_085F5064 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F1668 - movs r1, 0x80 - lsls r1, 1 - movs r2, 0x20 - bl LoadPalette - bl sub_817B76C - b _0817B11E - .pool -_0817B0EC: - ldr r0, =gUnknown_085F1824 - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F1EAC - ldr r1, =0x06003000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F17E4 - movs r1, 0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_085F50EC - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F21B0 - movs r1, 0x80 - lsls r1, 1 - movs r2, 0x20 - bl LoadPalette - bl sub_817B788 -_0817B11E: - ldr r1, =gUnknown_0203BD28 - movs r0, 0 - strh r0, [r1] - ldr r1, =gUnknown_0300301C - movs r0, 0x8 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end load_intro_part2_graphics - - thumb_func_start sub_817B150 -sub_817B150: @ 817B150 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0817B162 - cmp r0, 0x1 - ble _0817B162 - cmp r0, 0x2 - beq _0817B194 -_0817B162: - ldr r1, =0x00000603 - movs r0, 0xE - bl SetGpuReg - ldr r1, =0x00000702 - movs r0, 0xC - bl SetGpuReg - ldr r1, =0x00000f05 - movs r0, 0xA - bl SetGpuReg - movs r1, 0xF2 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - b _0817B1B6 - .pool -_0817B194: - ldr r1, =0x00000603 - movs r0, 0xE - bl SetGpuReg - ldr r1, =0x00000702 - movs r0, 0xC - bl SetGpuReg - ldr r1, =0x00000f05 - movs r0, 0xA - bl SetGpuReg - movs r1, 0xF2 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg -_0817B1B6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B150 - - thumb_func_start sub_817B1C8 -sub_817B1C8: @ 817B1C8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_085F0740 - ldr r1, =0x06004000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F0BC0 - ldr r1, =0x06007800 - bl LZ77UnCompVram - cmp r4, 0x4 - bhi _0817B214 - lsls r0, r4, 2 - ldr r1, =_0817B200 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0817B200: - .4byte _0817B214 - .4byte _0817B270 - .4byte _0817B2DC - .4byte _0817B2DC - .4byte _0817B334 -_0817B214: - ldr r0, =gUnknown_085F06E0 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_085F0DBC - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F1398 - ldr r1, =0x06003000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F0CFC - movs r1, 0 - movs r2, 0x60 - bl LoadPalette - ldr r0, =gUnknown_085F5064 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F16A8 - ldr r1, =0x06010000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F1668 - b _0817B2A6 - .pool -_0817B270: - ldr r0, =gUnknown_085F0700 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_085F0DBC - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F1398 - ldr r1, =0x06003000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F0D5C - movs r1, 0 - movs r2, 0x60 - bl LoadPalette - ldr r0, =gUnknown_085F5064 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F16A8 - ldr r1, =0x06010000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F1688 -_0817B2A6: - movs r1, 0x80 - lsls r1, 1 - movs r2, 0x20 - bl LoadPalette - bl sub_817B76C - b _0817B370 - .pool -_0817B2DC: - ldr r0, =gUnknown_085F0700 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_085F1824 - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F1EAC - ldr r1, =0x06003000 - bl LZ77UnCompVram - ldr r4, =gUnknown_085F1804 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_085F50EC - bl LoadCompressedObjectPic - movs r1, 0x80 - lsls r1, 1 - adds r0, r4, 0 - movs r2, 0x20 - bl LoadPalette - bl sub_817B788 - b _0817B370 - .pool -_0817B334: - ldr r0, =gUnknown_085F0720 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_085F235C - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F2568 - ldr r1, =0x06003000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F231C - movs r1, 0 - movs r2, 0x40 - bl LoadPalette - ldr r0, =gUnknown_085F5180 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F2548 - movs r1, 0x80 - lsls r1, 1 - movs r2, 0x20 - bl LoadPalette - bl sub_817B7A4 -_0817B370: - ldr r1, =gUnknown_0300301C - movs r0, 0x8 - strb r0, [r1] - ldr r1, =gUnknown_0203BD28 - movs r0, 0 - strh r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B1C8 - - thumb_func_start sub_817B3A8 -sub_817B3A8: @ 817B3A8 - push {lr} - ldr r1, =0x00000603 - movs r0, 0xE - bl SetGpuReg - ldr r1, =0x00000702 - movs r0, 0xC - bl SetGpuReg - ldr r1, =0x00000f05 - movs r0, 0xA - bl SetGpuReg - movs r1, 0xFA - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B3A8 - - thumb_func_start sub_817B3DC -sub_817B3DC: @ 817B3DC - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r5, r0, 0 - adds r6, r1, 0 - mov r8, r2 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 16 - lsrs r6, 16 - mov r0, r8 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r3, 16 - lsrs r3, 16 - ldr r1, =sub_817B458 - mov r9, r1 - mov r0, r9 - movs r1, 0 - str r3, [sp] - bl CreateTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0 - strh r5, [r0, 0x8] - strh r6, [r0, 0xA] - strh r2, [r0, 0xC] - strh r2, [r0, 0xE] - mov r1, r8 - strh r1, [r0, 0x10] - strh r2, [r0, 0x12] - strh r2, [r0, 0x14] - ldr r3, [sp] - strh r3, [r0, 0x16] - movs r1, 0x8 - strh r1, [r0, 0x18] - strh r2, [r0, 0x1A] - adds r0, r4, 0 - bl _call_via_r9 - adds r0, r4, 0 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817B3DC - - thumb_func_start sub_817B458 -sub_817B458: @ 817B458 - 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, 0xA] - lsls r2, r0, 16 - cmp r2, 0 - beq _0817B4A0 - movs r1, 0xC - ldrsh r0, [r4, r1] - lsls r0, 16 - ldrh r1, [r4, 0xE] - adds r1, r0, r1 - lsrs r0, r2, 12 - subs r1, r0 - asrs r0, r1, 16 - strh r0, [r4, 0xC] - strh r1, [r4, 0xE] - ldrh r1, [r4, 0xC] - movs r0, 0x14 - bl SetGpuReg - ldr r2, =gUnknown_0203BD24 - ldr r0, =gUnknown_0203BD26 - ldrh r1, [r0] - ldrh r2, [r2] - adds r1, r2 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x16 - bl SetGpuReg -_0817B4A0: - ldrh r0, [r4, 0x10] - lsls r2, r0, 16 - cmp r2, 0 - beq _0817B4FA - movs r1, 0x12 - ldrsh r0, [r4, r1] - lsls r0, 16 - ldrh r1, [r4, 0x14] - adds r1, r0, r1 - lsrs r0, r2, 12 - subs r1, r0 - asrs r0, r1, 16 - strh r0, [r4, 0x12] - strh r1, [r4, 0x14] - ldrh r1, [r4, 0x12] - movs r0, 0x18 - bl SetGpuReg - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0817B4F0 - ldr r2, =gUnknown_0203BD24 - ldr r0, =gUnknown_0203BD26 - ldrh r1, [r0] - ldrh r2, [r2] - adds r1, r2 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x1A - bl SetGpuReg - b _0817B4FA - .pool -_0817B4F0: - ldr r0, =gUnknown_0203BD24 - ldrh r1, [r0] - movs r0, 0x1A - bl SetGpuReg -_0817B4FA: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r2, r1, r0 - ldrh r0, [r2, 0x16] - lsls r3, r0, 16 - cmp r3, 0 - beq _0817B532 - movs r1, 0x18 - ldrsh r0, [r2, r1] - lsls r0, 16 - ldrh r1, [r2, 0x1A] - adds r1, r0, r1 - lsrs r0, r3, 12 - subs r1, r0 - asrs r0, r1, 16 - strh r0, [r2, 0x18] - strh r1, [r2, 0x1A] - ldrh r1, [r2, 0x18] - movs r0, 0x1C - bl SetGpuReg - ldr r0, =gUnknown_0203BD24 - ldrh r1, [r0] - movs r0, 0x1E - bl SetGpuReg -_0817B532: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B458 - - thumb_func_start sub_817B540 -sub_817B540: @ 817B540 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0817B620 - cmp r0, 0x1 - ble _0817B554 - cmp r0, 0x2 - beq _0817B5B8 -_0817B554: - ldr r0, =gUnknown_030022C0 - ldr r2, [r0, 0x20] - movs r0, 0x3 - ands r0, r2 - cmp r0, 0 - bne _0817B620 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0817B620 - movs r0, 0x4 - ands r2, r0 - cmp r2, 0 - beq _0817B58C - ldr r2, =gPlttBufferUnfaded - ldrh r1, [r2, 0x12] - mov r0, sp - strh r1, [r0] - ldrh r1, [r2, 0x14] - b _0817B596 - .pool -_0817B58C: - ldr r2, =gPlttBufferUnfaded - ldrh r1, [r2, 0x14] - mov r0, sp - strh r1, [r0] - ldrh r1, [r2, 0x12] -_0817B596: - adds r0, 0x2 - strh r1, [r0] - adds r4, r0, 0 - mov r0, sp - movs r1, 0x9 - movs r2, 0x2 - bl LoadPalette - adds r0, r4, 0 - movs r1, 0xA - movs r2, 0x2 - bl LoadPalette - b _0817B620 - .pool -_0817B5B8: - ldr r0, =gUnknown_030022C0 - ldr r2, [r0, 0x20] - movs r0, 0x3 - ands r0, r2 - cmp r0, 0 - bne _0817B620 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0817B620 - movs r0, 0x4 - ands r2, r0 - cmp r2, 0 - beq _0817B5F8 - mov r1, sp - ldr r2, =0x00003d27 - adds r0, r2, 0 - strh r0, [r1] - adds r1, 0x2 - ldr r2, =0x00000295 - b _0817B606 - .pool -_0817B5F8: - mov r1, sp - movs r2, 0xC7 - lsls r2, 2 - adds r0, r2, 0 - strh r0, [r1] - adds r1, 0x2 - ldr r2, =0x00003d27 -_0817B606: - adds r0, r2, 0 - strh r0, [r1] - adds r4, r1, 0 - mov r0, sp - movs r1, 0xC - movs r2, 0x2 - bl LoadPalette - adds r0, r4, 0 - movs r1, 0xD - movs r2, 0x2 - bl LoadPalette -_0817B620: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B540 - - thumb_func_start sub_817B62C -sub_817B62C: @ 817B62C - push {lr} - adds r2, r0, 0 - ldr r0, =gUnknown_0203BD28 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0x2 - beq _0817B690 - cmp r0, 0 - beq _0817B64C - adds r0, r2, 0 - bl RemoveObjectAndFreeTiles - b _0817B690 - .pool -_0817B64C: - movs r1, 0x20 - ldrsh r0, [r2, r1] - lsls r0, 16 - ldrh r1, [r2, 0x32] - orrs r0, r1 - ldrh r1, [r2, 0x30] - adds r0, r1 - asrs r1, r0, 16 - strh r1, [r2, 0x20] - strh r0, [r2, 0x32] - cmp r1, 0xFF - ble _0817B668 - ldr r0, =0x0000ffe0 - strh r0, [r2, 0x20] -_0817B668: - movs r1, 0x2E - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _0817B688 - ldr r1, =gUnknown_0203BD24 - ldr r0, =gUnknown_0203BD26 - ldrh r0, [r0] - ldrh r1, [r1] - adds r0, r1 - b _0817B68C - .pool -_0817B688: - ldr r0, =gUnknown_0203BD24 - ldrh r0, [r0] -_0817B68C: - negs r0, r0 - strh r0, [r2, 0x26] -_0817B690: - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B62C - - thumb_func_start sub_817B698 -sub_817B698: @ 817B698 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - str r1, [sp, 0x4] - str r2, [sp, 0x8] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - movs r7, 0 - cmp r7, r8 - bcs _0817B74E - ldr r0, =gUnknown_02020630 - mov r10, r0 - movs r2, 0x3F - mov r9, r2 -_0817B6C2: - lsls r6, r7, 3 - ldr r0, [sp, 0x4] - adds r6, r0 - ldrb r1, [r6, 0x1] - ldrb r2, [r6, 0x2] - ldrb r3, [r6, 0x3] - ldr r0, =gUnknown_085F504C - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r5, r0, 4 - adds r5, r0 - lsls r5, 2 - mov r2, r10 - adds r4, r5, r2 - ldrb r2, [r6] - lsls r1, r2, 26 - lsrs r1, 30 - lsrs r2, 6 - adds r0, r4, 0 - movs r3, 0 - bl CalcVecFromObjectCenterToObjectUpperLeft - ldrb r3, [r4, 0x5] - movs r0, 0xC - orrs r3, r0 - strb r3, [r4, 0x5] - ldrb r1, [r6] - lsls r1, 26 - lsrs r1, 30 - lsls r1, 6 - ldrb r2, [r4, 0x1] - mov r0, r9 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrb r1, [r6] - lsrs r1, 6 - lsls r1, 6 - ldrb r2, [r4, 0x3] - mov r0, r9 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x3] - movs r0, 0xF - ands r3, r0 - strb r3, [r4, 0x5] - ldr r0, =gUnknown_02020638 - adds r5, r0 - ldr r2, [sp, 0x8] - str r2, [r5] - ldrb r1, [r6] - lsls r1, 28 - lsrs r1, 28 - adds r0, r4, 0 - bl StartObjectImageAnim - movs r1, 0 - mov r0, sp - ldrh r0, [r0] - strh r0, [r4, 0x2E] - ldrh r0, [r6, 0x4] - strh r0, [r4, 0x30] - strh r1, [r4, 0x32] - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, r8 - bcc _0817B6C2 -_0817B74E: - 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_817B698 - - thumb_func_start sub_817B76C -sub_817B76C: @ 817B76C - push {lr} - ldr r1, =gUnknown_085F50A4 - ldr r2, =gUnknown_085F5094 - movs r0, 0 - movs r3, 0x9 - bl sub_817B698 - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B76C - - thumb_func_start sub_817B788 -sub_817B788: @ 817B788 - push {lr} - ldr r1, =gUnknown_085F5120 - ldr r2, =gUnknown_085F5114 - movs r0, 0x1 - movs r3, 0xC - bl sub_817B698 - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B788 - - thumb_func_start sub_817B7A4 -sub_817B7A4: @ 817B7A4 - push {lr} - ldr r1, =gUnknown_085F519C - ldr r2, =gUnknown_085F5198 - movs r0, 0x1 - movs r3, 0x6 - bl sub_817B698 - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B7A4 - - thumb_func_start nullsub_65 -nullsub_65: @ 817B7C0 - bx lr - thumb_func_end nullsub_65 - - thumb_func_start sub_817B7C4 -sub_817B7C4: @ 817B7C4 - push {r4,lr} - ldr r4, =gUnknown_02020630 - movs r1, 0x2E - ldrsh r2, [r0, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r1, [r1] - movs r2, 0x3E - adds r2, r0 - mov r12, r2 - movs r2, 0x4 - ands r2, r1 - mov r1, r12 - ldrb r3, [r1] - movs r1, 0x5 - negs r1, r1 - ands r1, r3 - orrs r1, r2 - mov r2, r12 - strb r1, [r2] - movs r1, 0x2E - ldrsh r2, [r0, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x20] - strh r1, [r0, 0x20] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x24] - strh r1, [r0, 0x24] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x26] - strh r1, [r0, 0x26] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B7C4 - - thumb_func_start sub_817B834 -sub_817B834: @ 817B834 - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r1, 0 - ldr r0, =gUnknown_085F51EC - lsls r5, 16 - asrs r5, 16 - lsls r4, 16 - asrs r4, 16 - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x2 - bl AddObjectToFront - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =gUnknown_085F523C - adds r4, 0x8 - lsls r4, 16 - asrs r4, 16 - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x3 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - strh r6, [r1, 0x2E] - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817B834 - - thumb_func_start sub_817B88C -sub_817B88C: @ 817B88C - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r1, 0 - ldr r0, =gUnknown_085F5204 - lsls r5, 16 - asrs r5, 16 - lsls r4, 16 - asrs r4, 16 - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x2 - bl AddObjectToFront - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =gUnknown_085F5254 - adds r4, 0x8 - lsls r4, 16 - asrs r4, 16 - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x3 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - strh r6, [r1, 0x2E] - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817B88C - - thumb_func_start nullsub_66 -nullsub_66: @ 817B8E4 - bx lr - thumb_func_end nullsub_66 - - thumb_func_start sub_817B8E8 -sub_817B8E8: @ 817B8E8 - push {r4,lr} - ldr r4, =gUnknown_02020630 - movs r1, 0x2E - ldrsh r2, [r0, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r1, [r1] - movs r2, 0x3E - adds r2, r0 - mov r12, r2 - movs r2, 0x4 - ands r2, r1 - mov r1, r12 - ldrb r3, [r1] - movs r1, 0x5 - negs r1, r1 - ands r1, r3 - orrs r1, r2 - mov r2, r12 - strb r1, [r2] - movs r1, 0x2E - ldrsh r2, [r0, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x22] - strh r1, [r0, 0x22] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x24] - strh r1, [r0, 0x24] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x26] - strh r1, [r0, 0x26] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B8E8 - - thumb_func_start sub_817B948 -sub_817B948: @ 817B948 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r2, r0, 0 - adds r5, r1, 0 - ldr r0, =gUnknown_085F528C - mov r8, r0 - lsls r2, 16 - asrs r4, r2, 16 - ldr r0, =0xffe00000 - adds r2, r0 - asrs r2, 16 - lsls r5, 16 - asrs r5, 16 - mov r0, r8 - adds r1, r2, 0 - adds r2, r5, 0 - movs r3, 0x5 - bl AddObjectToFront - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - adds r4, 0x20 - lsls r4, 16 - asrs r4, 16 - mov r0, r8 - adds r1, r4, 0 - adds r2, r5, 0 - movs r3, 0x6 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_02020630 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - adds r0, r4, r5 - strh r6, [r0, 0x2E] - movs r1, 0x1 - bl StartObjectImageAnim - adds r5, 0x1C - adds r4, r5 - ldr r0, =sub_817B8E8 - str r0, [r4] - adds r0, r6, 0 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817B948 - - thumb_func_start sub_817B9C4 -sub_817B9C4: @ 817B9C4 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r2, r0, 0 - adds r5, r1, 0 - ldr r0, =gUnknown_085F52A4 - mov r8, r0 - lsls r2, 16 - asrs r4, r2, 16 - ldr r0, =0xffe00000 - adds r2, r0 - asrs r2, 16 - lsls r5, 16 - asrs r5, 16 - mov r0, r8 - adds r1, r2, 0 - adds r2, r5, 0 - movs r3, 0x5 - bl AddObjectToFront - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - adds r4, 0x20 - lsls r4, 16 - asrs r4, 16 - mov r0, r8 - adds r1, r4, 0 - adds r2, r5, 0 - movs r3, 0x6 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_02020630 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - adds r0, r4, r5 - strh r6, [r0, 0x2E] - movs r1, 0x1 - bl StartObjectImageAnim - adds r5, 0x1C - adds r4, r5 - ldr r0, =sub_817B8E8 - str r0, [r4] - adds r0, r6, 0 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817B9C4 - - thumb_func_start nullsub_67 -nullsub_67: @ 817BA40 - bx lr - thumb_func_end nullsub_67 - - thumb_func_start sub_817BA44 -sub_817BA44: @ 817BA44 - push {r4,r5,lr} - sub sp, 0x4 - movs r4, 0 - ldr r5, =gUnknown_085F5458 -_0817BA4C: - adds r0, r4, 0 - adds r0, 0x14 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r4, 1 - adds r1, r5 - ldrh r1, [r1] - str r1, [sp] - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0xB - bls _0817BA4C - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817BA44 - - thumb_func_start sub_817BA7C -sub_817BA7C: @ 817BA7C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x22 - ldrsh r0, [r4, r1] - cmp r0, 0x8 - ble _0817BB2A - movs r2, 0x3C - ldrsh r0, [r4, r2] - adds r1, r0, 0 - muls r1, r0 - adds r0, r1, 0 - movs r1, 0x50 - bl __divsi3 - movs r1, 0x58 - subs r1, r0 - strh r1, [r4, 0x22] - ldrh r0, [r4, 0x3A] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl sine - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0817BAB6 - adds r0, 0x3 -_0817BAB6: - asrs r0, 2 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x3A] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl cosine - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x3A] - adds r0, 0x4 - strh r0, [r4, 0x3A] - ldrh r1, [r4, 0x3C] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0817BAE0 - ldrh r0, [r4, 0x38] - subs r0, 0x1 - strh r0, [r4, 0x38] -_0817BAE0: - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] - movs r1, 0x26 - ldrsh r0, [r4, r1] - cmp r0, 0 - ble _0817BAF6 - adds r1, r4, 0 - adds r1, 0x43 - movs r0, 0x1 - b _0817BAFC -_0817BAF6: - adds r1, r4, 0 - adds r1, 0x43 - movs r0, 0x14 -_0817BAFC: - strb r0, [r1] - movs r2, 0x38 - ldrsh r0, [r4, r2] - cmp r0, 0 - bge _0817BB08 - adds r0, 0x3 -_0817BB08: - asrs r0, 2 - adds r0, 0x14 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x1F - bls _0817BB16 - movs r2, 0x1F -_0817BB16: - movs r0, 0x1F - ands r2, r0 - lsls r2, 1 - ldrb r1, [r4, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - orrs r0, r2 - strb r0, [r4, 0x3] - b _0817BB30 -_0817BB2A: - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_0817BB30: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_817BA7C - - thumb_func_start sub_817BB38 -sub_817BB38: @ 817BB38 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gUnknown_085F5440 - movs r1, 0x78 - movs r2, 0x58 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _0817BB82 - ldr r4, =gUnknown_02020630 - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - adds r2, r3, r4 - movs r1, 0 - movs r0, 0x30 - strh r0, [r2, 0x38] - strh r5, [r2, 0x3A] - strh r1, [r2, 0x3C] - ldrb r1, [r2, 0x1] - subs r0, 0x34 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x1] - ldrb r0, [r2, 0x3] - movs r1, 0x3E - orrs r0, r1 - strb r0, [r2, 0x3] - adds r4, 0x1C - adds r3, r4 - ldr r0, =sub_817BA7C - str r0, [r3] -_0817BB82: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817BB38 - - thumb_func_start sub_817BB94 -sub_817BB94: @ 817BB94 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x22 - ldrsh r0, [r4, r1] - cmp r0, 0x57 - bgt _0817BBFA - movs r2, 0x3C - ldrsh r0, [r4, r2] - adds r1, r0, 0 - muls r1, r0 - adds r0, r1, 0 - movs r1, 0x5 - bl __divsi3 - adds r0, 0x8 - strh r0, [r4, 0x22] - ldrh r0, [r4, 0x3A] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl sine - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0817BBCC - adds r0, 0x3 -_0817BBCC: - asrs r0, 2 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x3A] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl cosine - strh r0, [r4, 0x24] - movs r1, 0x3C - ldrsh r0, [r4, r1] - lsls r0, 26 - lsrs r0, 24 - movs r1, 0x28 - bl sine - adds r0, 0x8 - strh r0, [r4, 0x38] - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] - b _0817BC00 -_0817BBFA: - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_0817BC00: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_817BB94 - - thumb_func_start sub_817BC08 -sub_817BC08: @ 817BC08 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gUnknown_085F5440 - movs r1, 0x78 - movs r2, 0x8 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _0817BC5E - ldr r4, =gUnknown_02020630 - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - adds r2, r3, r4 - movs r1, 0 - movs r0, 0x8 - strh r0, [r2, 0x38] - strh r5, [r2, 0x3A] - strh r1, [r2, 0x3C] - ldrb r1, [r2, 0x1] - subs r0, 0xC - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x1] - ldrb r1, [r2, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - movs r1, 0x32 - orrs r0, r1 - strb r0, [r2, 0x3] - adds r2, 0x43 - movs r0, 0x1 - strb r0, [r2] - adds r4, 0x1C - adds r3, r4 - ldr r0, =sub_817BB94 - str r0, [r3] -_0817BC5E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817BC08 - - thumb_func_start sub_817BC70 -sub_817BC70: @ 817BC70 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x38 - ldrsh r0, [r4, r1] - cmp r0, 0x8 - ble _0817BCAC - ldrh r0, [r4, 0x3A] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x3A] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl cosine - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x38] - ldrh r1, [r4, 0x34] - subs r0, r1 - strh r0, [r4, 0x38] - ldrh r0, [r4, 0x3A] - adds r0, 0x4 - strh r0, [r4, 0x3A] - b _0817BCB2 -_0817BCAC: - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_0817BCB2: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_817BC70 - - thumb_func_start sub_817BCB8 -sub_817BCB8: @ 817BCB8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - ldr r0, =gUnknown_085F5440 - movs r1, 0x78 - movs r2, 0x38 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _0817BD0E - ldr r4, =gUnknown_02020630 - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - adds r2, r3, r4 - movs r1, 0 - strh r5, [r2, 0x34] - movs r0, 0x78 - strh r0, [r2, 0x38] - strh r6, [r2, 0x3A] - strh r1, [r2, 0x3C] - ldrb r1, [r2, 0x1] - subs r0, 0x7C - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x1] - ldrb r0, [r2, 0x3] - movs r1, 0x3E - orrs r0, r1 - strb r0, [r2, 0x3] - adds r2, 0x43 - movs r0, 0x1 - strb r0, [r2] - adds r4, 0x1C - adds r3, r4 - ldr r0, =sub_817BC70 - str r0, [r3] -_0817BD0E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817BCB8 - - thumb_func_start sub_817BD20 -sub_817BD20: @ 817BD20 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x3C] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _0817BD34 - ldrh r0, [r4, 0x22] - adds r0, 0x1 - strh r0, [r4, 0x22] -_0817BD34: - ldrh r1, [r4, 0x3A] - movs r2, 0x3A - ldrsh r0, [r4, r2] - cmp r0, 0x7F - bgt _0817BDE4 - lsls r0, r1, 24 - lsrs r0, 24 - movs r5, 0x38 - ldrsh r1, [r4, r5] - bl sine - negs r0, r0 - strh r0, [r4, 0x26] - movs r0, 0x34 - ldrsh r1, [r4, r0] - movs r2, 0x3C - ldrsh r0, [r4, r2] - muls r0, r1 - movs r1, 0x3 - bl __divsi3 - adds r0, 0x78 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x3A] - adds r3, r0, 0x1 - strh r3, [r4, 0x3A] - movs r5, 0x3A - ldrsh r1, [r4, r5] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - cmp r0, 0 - bge _0817BD78 - adds r0, 0x7F -_0817BD78: - asrs r0, 7 - movs r1, 0x1F - subs r1, r0 - lsls r1, 24 - lsrs r2, r1, 24 - lsls r0, r3, 16 - asrs r0, 16 - cmp r0, 0x40 - ble _0817BD94 - adds r1, r4, 0 - adds r1, 0x43 - movs r0, 0x1 - strb r0, [r1] - b _0817BDC4 -_0817BD94: - adds r3, r4, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] - adds r1, r4, 0 - adds r1, 0x43 - movs r0, 0x14 - strb r0, [r1] - ldrh r1, [r4, 0x3A] - movs r5, 0x3A - ldrsh r0, [r4, r5] - cmp r0, 0x70 - ble _0817BDC4 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0817BDC4 - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r3] -_0817BDC4: - cmp r2, 0x13 - bhi _0817BDCA - movs r2, 0x14 -_0817BDCA: - movs r0, 0x1F - ands r2, r0 - lsls r2, 1 - ldrb r1, [r4, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - orrs r0, r2 - strb r0, [r4, 0x3] - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] - b _0817BDEA -_0817BDE4: - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_0817BDEA: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_817BD20 - - thumb_func_start sub_817BDF0 -sub_817BDF0: @ 817BDF0 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =gUnknown_085F5440 - movs r1, 0x78 - movs r2, 0x38 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x40 - beq _0817BE60 - bl GenerateRandomNumber - ldr r6, =gUnknown_02020630 - lsls r5, r4, 4 - adds r5, r4 - lsls r5, 2 - adds r4, r5, r6 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x7 - bl __umodsi3 - movs r1, 0x3 - subs r1, r0 - movs r0, 0 - mov r8, r0 - strh r1, [r4, 0x34] - bl GenerateRandomNumber - movs r1, 0x3F - ands r1, r0 - adds r1, 0x30 - strh r1, [r4, 0x38] - mov r0, r8 - strh r0, [r4, 0x3C] - ldrb r1, [r4, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrb r0, [r4, 0x3] - movs r1, 0x3E - orrs r0, r1 - strb r0, [r4, 0x3] - adds r4, 0x43 - movs r0, 0x14 - strb r0, [r4] - adds r6, 0x1C - adds r5, r6 - ldr r0, =sub_817BD20 - str r0, [r5] -_0817BE60: - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817BDF0 - - thumb_func_start sub_817BE78 -sub_817BE78: @ 817BE78 - push {lr} - ldr r0, =gUnknown_085F540C - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_085F541C - bl LoadTaggedObjectPalettes - pop {r0} - bx r0 - .pool - thumb_func_end sub_817BE78 - - thumb_func_start sub_817BE94 -sub_817BE94: @ 817BE94 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =sub_817BEC4 - 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, 0xA] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817BE94 - - thumb_func_start sub_817BEC4 -sub_817BEC4: @ 817BEC4 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_817BA44 - ldr r0, =gTasks - lsls r5, r4, 2 - adds r5, r4 - lsls r5, 3 - adds r5, r0 - movs r0, 0 - strh r0, [r5, 0x26] - movs r0, 0xA - ldrsh r1, [r5, r0] - movs r0, 0x3 - lsls r0, r1 - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0xA - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r0, =sub_817BF14 - str r0, [r5] - movs r0, 0x8C - bl audio_play - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817BEC4 - - thumb_func_start sub_817BF14 -sub_817BF14: @ 817BF14 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r3, r5, 2 - adds r0, r3, r5 - lsls r0, 3 - adds r1, r0, r1 - ldrh r2, [r1, 0x26] - movs r4, 0x26 - ldrsh r0, [r1, r4] - cmp r0, 0x3F - bgt _0817BF70 - movs r0, 0x7 - ands r0, r2 - adds r7, r3, 0 - cmp r0, 0 - bne _0817BF5A - movs r4, 0 - adds r6, r1, 0 -_0817BF3C: - ldrh r1, [r6, 0x26] - movs r0, 0x78 - ands r0, r1 - lsls r0, 1 - lsls r1, r4, 6 - adds r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl sub_817BB38 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _0817BF3C -_0817BF5A: - ldr r0, =gTasks - adds r1, r7, r5 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x26] - adds r0, 0x1 - strh r0, [r1, 0x26] - b _0817BF78 - .pool -_0817BF70: - movs r0, 0x60 - strh r0, [r1, 0x26] - ldr r0, =sub_817BF84 - str r0, [r1] -_0817BF78: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817BF14 - - thumb_func_start sub_817BF84 -sub_817BF84: @ 817BF84 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0, r1 - ldrh r3, [r1, 0x26] - movs r4, 0x26 - ldrsh r0, [r1, r4] - cmp r0, 0 - beq _0817BFA8 - subs r0, r3, 0x1 - strh r0, [r1, 0x26] - b _0817BFAE - .pool -_0817BFA8: - adds r0, r2, 0 - bl DestroyTask -_0817BFAE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_817BF84 - - thumb_func_start sub_817BFB4 -sub_817BFB4: @ 817BFB4 - push {lr} - ldr r0, =sub_817BFCC - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_817BFB4 - - thumb_func_start sub_817BFCC -sub_817BFCC: @ 817BFCC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_817BA44 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x26] - ldr r1, =sub_817C000 - str r1, [r0] - movs r0, 0xB7 - bl audio_play - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817BFCC - - thumb_func_start sub_817C000 -sub_817C000: @ 817C000 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r2, r5, 2 - adds r0, r2, r5 - lsls r0, 3 - adds r1, r0, r1 - movs r3, 0x26 - ldrsh r0, [r1, r3] - cmp r0, 0x5F - bgt _0817C048 - adds r6, r2, 0 - cmp r0, 0x5 - bgt _0817C032 - movs r4, 0 -_0817C020: - lsls r0, r4, 28 - lsrs r0, 24 - bl sub_817BC08 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x8 - bls _0817C020 -_0817C032: - ldr r0, =gTasks - adds r1, r6, r5 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x26] - adds r0, 0x1 - strh r0, [r1, 0x26] - b _0817C04C - .pool -_0817C048: - ldr r0, =sub_817C058 - str r0, [r1] -_0817C04C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C000 - - thumb_func_start sub_817C058 -sub_817C058: @ 817C058 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - pop {r0} - bx r0 - thumb_func_end sub_817C058 - - thumb_func_start sub_817C068 -sub_817C068: @ 817C068 - push {lr} - ldr r0, =sub_817C080 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_817C068 - - thumb_func_start sub_817C080 -sub_817C080: @ 817C080 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_817BA44 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x26] - ldr r1, =sub_817C0B4 - str r1, [r0] - movs r0, 0x66 - bl audio_play - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C080 - - thumb_func_start sub_817C0B4 -sub_817C0B4: @ 817C0B4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r2, r5, 2 - adds r0, r2, r5 - lsls r0, 3 - adds r1, r0, r1 - movs r3, 0x26 - ldrsh r0, [r1, r3] - cmp r0, 0x2F - bgt _0817C124 - adds r6, r2, 0 - cmp r0, 0 - bne _0817C0E8 - movs r4, 0 -_0817C0D4: - lsls r0, r4, 28 - lsrs r0, 24 - movs r1, 0x4 - bl sub_817BCB8 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _0817C0D4 -_0817C0E8: - ldr r0, =gTasks - adds r1, r6, r5 - lsls r1, 3 - adds r1, r0 - movs r2, 0x26 - ldrsh r0, [r1, r2] - cmp r0, 0x20 - bne _0817C10E - movs r4, 0 -_0817C0FA: - lsls r0, r4, 28 - lsrs r0, 24 - movs r1, 0x8 - bl sub_817BCB8 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _0817C0FA -_0817C10E: - ldr r0, =gTasks - adds r1, r6, r5 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x26] - adds r0, 0x1 - strh r0, [r1, 0x26] - b _0817C128 - .pool -_0817C124: - ldr r0, =sub_817C134 - str r0, [r1] -_0817C128: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C0B4 - - thumb_func_start sub_817C134 -sub_817C134: @ 817C134 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - pop {r0} - bx r0 - thumb_func_end sub_817C134 - - thumb_func_start sub_817C144 -sub_817C144: @ 817C144 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =sub_817C174 - 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, 0xC] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817C144 - - thumb_func_start sub_817C174 -sub_817C174: @ 817C174 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_817BA44 - ldr r0, =gTasks - lsls r5, r4, 2 - adds r5, r4 - lsls r5, 3 - adds r5, r0 - movs r0, 0 - strh r0, [r5, 0x26] - ldr r0, =gPlttBufferFaded + 0x40 - ldr r1, =gPlttBufferUnfaded + 0x40 - movs r2, 0x30 - bl CpuSet - ldr r0, =0xfff9041c - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r0, =sub_817C1D4 - str r0, [r5] - movs r0, 0xCA - bl audio_play - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C174 - - thumb_func_start sub_817C1D4 -sub_817C1D4: @ 817C1D4 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gTasks - lsls r5, r6, 2 - adds r0, r5, r6 - lsls r0, 3 - adds r1, r0, r1 - movs r0, 0x26 - ldrsh r2, [r1, r0] - cmp r2, 0x7F - bgt _0817C250 - adds r0, r2, 0 - cmp r0, 0 - beq _0817C210 - cmp r0, 0x20 - beq _0817C224 - cmp r2, 0x31 - bgt _0817C234 - bl GenerateRandomNumber - movs r1, 0x7 - ands r0, r1 - bl sub_817BDF0 - b _0817C234 - .pool -_0817C210: - movs r4, 0 -_0817C212: - adds r0, r4, 0 - bl sub_817BDF0 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _0817C212 - b _0817C234 -_0817C224: - ldr r0, =0xffff041c - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0x10 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade -_0817C234: - ldr r0, =gTasks - adds r1, r5, r6 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x26] - adds r0, 0x1 - strh r0, [r1, 0x26] - b _0817C254 - .pool -_0817C250: - ldr r0, =sub_817C260 - str r0, [r1] -_0817C254: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C1D4 - - thumb_func_start sub_817C260 -sub_817C260: @ 817C260 - 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 _0817C278 - adds r0, r2, 0 - bl DestroyTask -_0817C278: - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C260 - - thumb_func_start sub_817C280 -sub_817C280: @ 817C280 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =sub_817C2B0 - 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, 0xC] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817C280 - - thumb_func_start sub_817C2B0 -sub_817C2B0: @ 817C2B0 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_817BA44 - ldr r0, =gTasks - lsls r5, r4, 2 - adds r5, r4 - lsls r5, 3 - adds r5, r0 - movs r0, 0 - strh r0, [r5, 0x26] - ldr r0, =gPlttBufferFaded + 0x40 - ldr r1, =gPlttBufferUnfaded + 0x40 - movs r2, 0x30 - bl CpuSet - ldr r0, =0xfff90400 - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r0, =sub_817C310 - str r0, [r5] - movs r0, 0xCA - bl audio_play - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C2B0 - - thumb_func_start sub_817C310 -sub_817C310: @ 817C310 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gTasks - lsls r5, r6, 2 - adds r0, r5, r6 - lsls r0, 3 - adds r1, r0, r1 - movs r0, 0x26 - ldrsh r2, [r1, r0] - cmp r2, 0x7F - bgt _0817C38C - adds r0, r2, 0 - cmp r0, 0 - beq _0817C34C - cmp r0, 0x20 - beq _0817C360 - cmp r2, 0x31 - bgt _0817C370 - bl GenerateRandomNumber - movs r1, 0x7 - ands r0, r1 - bl sub_817BDF0 - b _0817C370 - .pool -_0817C34C: - movs r4, 0 -_0817C34E: - adds r0, r4, 0 - bl sub_817BDF0 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _0817C34E - b _0817C370 -_0817C360: - ldr r0, =0xffff0400 - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0x10 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade -_0817C370: - ldr r0, =gTasks - adds r1, r5, r6 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x26] - adds r0, 0x1 - strh r0, [r1, 0x26] - b _0817C390 - .pool -_0817C38C: - ldr r0, =sub_817C260 - str r0, [r1] -_0817C390: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C310 - - thumb_func_start nullsub_68 -nullsub_68: @ 817C39C - bx lr - thumb_func_end nullsub_68 - - thumb_func_start sub_817C3A0 -sub_817C3A0: @ 817C3A0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - movs r1, 0 - ldr r3, =sub_817C4EC - ldr r2, =0x00007fff -_0817C3BA: - lsls r0, r1, 1 - add r0, sp - adds r0, 0x4 - strh r2, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0xF - bls _0817C3BA - adds r0, r3, 0 - movs r1, 0 - bl CreateTask - mov r8, r0 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =gTasks - mov r1, r8 - lsls r6, r1, 2 - add r6, r8 - lsls r6, 3 - adds r6, r0 - strh r5, [r6, 0xA] - strh r7, [r6, 0xC] - movs r1, 0x80 - lsls r1, 1 - strh r1, [r6, 0xE] - movs r0, 0x10 - strh r0, [r6, 0x10] - movs r4, 0x80 - lsls r4, 9 - str r1, [sp] - movs r0, 0x1E - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - movs r0, 0x10 - ldrsh r1, [r6, r0] - adds r0, r4, 0 - bl __divsi3 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - movs r0, 0x1F - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - ldr r1, =gUnknown_02020630 - mov r9, r1 - lsls r2, r5, 4 - adds r2, r5 - lsls r2, 2 - mov r3, r9 - adds r3, 0x1C - adds r0, r2, r3 - ldr r1, =nullsub_68 - str r1, [r0] - add r2, r9 - ldrb r1, [r2, 0x1] - movs r4, 0x4 - negs r4, r4 - adds r0, r4, 0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x1] - ldrb r1, [r2, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - movs r1, 0x3C - orrs r0, r1 - strb r0, [r2, 0x3] - movs r0, 0x3E - adds r0, r2 - mov r10, r0 - ldrb r1, [r0] - movs r5, 0x5 - negs r5, r5 - adds r0, r5, 0 - ands r0, r1 - mov r1, r10 - strb r0, [r1] - ldrb r1, [r2, 0x5] - lsrs r1, 4 - lsls r1, 5 - ldr r0, =gPlttBufferFaded + 0x200 - mov r10, r0 - add r1, r10 - add r0, sp, 0x4 - movs r2, 0x10 - str r3, [sp, 0x24] - bl CpuSet - lsls r1, r7, 4 - adds r1, r7 - lsls r1, 2 - ldr r3, [sp, 0x24] - adds r3, r1, r3 - ldr r0, =nullsub_68 - str r0, [r3] - add r1, r9 - ldrb r0, [r1, 0x1] - ands r4, r0 - movs r0, 0x1 - orrs r4, r0 - strb r4, [r1, 0x1] - ldrb r0, [r1, 0x3] - movs r2, 0x3E - orrs r0, r2 - strb r0, [r1, 0x3] - adds r2, r1, 0 - adds r2, 0x3E - ldrb r0, [r2] - ands r5, r0 - strb r5, [r2] - ldrb r1, [r1, 0x5] - lsrs r1, 4 - lsls r1, 5 - add r1, r10 - add r0, sp, 0x4 - movs r2, 0x10 - bl CpuSet - movs r1, 0 - strh r1, [r6, 0x18] - mov r0, r8 - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817C3A0 - - thumb_func_start sub_817C4EC -sub_817C4EC: @ 817C4EC - 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 r0, [r1, 0x12] - movs r0, 0x8 - strh r0, [r1, 0x14] - ldr r0, =sub_817C510 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_817C4EC - - thumb_func_start sub_817C510 -sub_817C510: @ 817C510 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, =gTasks - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r2, r0, r1 - movs r1, 0x18 - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _0817C534 - adds r0, r3, 0 - bl sub_817C72C - b _0817C556 - .pool -_0817C534: - ldrh r1, [r2, 0x14] - movs r4, 0x14 - ldrsh r0, [r2, r4] - cmp r0, 0x80 - bne _0817C546 - adds r0, r3, 0 - bl sub_817C67C - b _0817C556 -_0817C546: - adds r0, r1, 0x2 - strh r0, [r2, 0x14] - ldrh r0, [r2, 0x12] - movs r1, 0x1 - eors r0, r1 - strh r0, [r2, 0x12] - ldr r0, =sub_817C560 - str r0, [r2] -_0817C556: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C510 - - thumb_func_start sub_817C560 -sub_817C560: @ 817C560 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r1 - movs r3, 0x18 - ldrsh r0, [r2, r3] - adds r5, r1, 0 - cmp r0, 0 - beq _0817C58C - ldr r0, =sub_817C72C - str r0, [r2] - b _0817C670 - .pool -_0817C58C: - movs r6, 0 - movs r7, 0x12 - ldrsh r0, [r2, r7] - cmp r0, 0 - bne _0817C5DC - movs r0, 0xE - ldrsh r1, [r2, r0] - movs r3, 0x14 - ldrsh r0, [r2, r3] - movs r3, 0x80 - lsls r3, 1 - subs r0, r3, r0 - cmp r1, r0 - bge _0817C5B2 - ldrh r0, [r2, 0x14] - ldrh r7, [r2, 0xE] - adds r0, r7 - strh r0, [r2, 0xE] - b _0817C5B6 -_0817C5B2: - strh r3, [r2, 0xE] - movs r6, 0x1 -_0817C5B6: - lsls r2, r4, 2 - adds r0, r2, r4 - lsls r0, 3 - adds r3, r0, r5 - movs r0, 0x10 - ldrsh r1, [r3, r0] - movs r7, 0x14 - ldrsh r0, [r3, r7] - adds r0, 0x10 - cmp r1, r0 - ble _0817C5D6 - ldrh r0, [r3, 0x10] - ldrh r1, [r3, 0x14] - subs r0, r1 - strh r0, [r3, 0x10] - b _0817C626 -_0817C5D6: - movs r0, 0x10 - strh r0, [r3, 0x10] - b _0817C620 -_0817C5DC: - movs r0, 0x10 - ldrsh r1, [r2, r0] - movs r3, 0x14 - ldrsh r0, [r2, r3] - movs r3, 0x80 - lsls r3, 1 - subs r0, r3, r0 - cmp r1, r0 - bge _0817C5F8 - ldrh r0, [r2, 0x14] - ldrh r7, [r2, 0x10] - adds r0, r7 - strh r0, [r2, 0x10] - b _0817C5FC -_0817C5F8: - strh r3, [r2, 0x10] - movs r6, 0x1 -_0817C5FC: - lsls r2, r4, 2 - adds r0, r2, r4 - lsls r0, 3 - adds r3, r0, r5 - movs r0, 0xE - ldrsh r1, [r3, r0] - movs r7, 0x14 - ldrsh r0, [r3, r7] - adds r0, 0x10 - cmp r1, r0 - ble _0817C61C - ldrh r0, [r3, 0xE] - ldrh r1, [r3, 0x14] - subs r0, r1 - strh r0, [r3, 0xE] - b _0817C626 -_0817C61C: - movs r0, 0x10 - strh r0, [r3, 0xE] -_0817C620: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0817C626: - adds r0, r2, r4 - lsls r0, 3 - adds r5, r0, r5 - movs r0, 0xE - ldrsh r1, [r5, r0] - movs r4, 0x80 - lsls r4, 9 - adds r0, r4, 0 - bl __divsi3 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - movs r0, 0x1E - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - movs r3, 0x10 - ldrsh r1, [r5, r3] - adds r0, r4, 0 - bl __divsi3 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - movs r0, 0x1F - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - cmp r6, 0x2 - bne _0817C670 - ldr r0, =sub_817C510 - str r0, [r5] -_0817C670: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C560 - - thumb_func_start sub_817C67C -sub_817C67C: @ 817C67C - push {r4-r6,lr} - mov r6, r8 - push {r6} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_02020630 - mov r8, r1 - ldr r1, =gTasks - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - movs r2, 0xA - ldrsh r1, [r4, r2] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - add r2, r8 - ldrb r3, [r2, 0x1] - movs r6, 0x4 - negs r6, r6 - adds r1, r6, 0 - ands r1, r3 - strb r1, [r2, 0x1] - movs r2, 0xA - ldrsh r1, [r4, r2] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - add r2, r8 - ldrb r3, [r2, 0x3] - movs r5, 0x3F - negs r5, r5 - adds r1, r5, 0 - ands r1, r3 - strb r1, [r2, 0x3] - movs r1, 0xA - ldrsh r2, [r4, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r8 - adds r1, 0x3E - ldrb r2, [r1] - movs r3, 0x4 - orrs r2, r3 - strb r2, [r1] - movs r1, 0xC - ldrsh r2, [r4, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x1] - ands r6, r2 - strb r6, [r1, 0x1] - movs r1, 0xC - ldrsh r2, [r4, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x3] - ands r5, r2 - strb r5, [r1, 0x3] - movs r1, 0xC - ldrsh r2, [r4, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r8 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - ands r2, r3 - strb r2, [r1] - bl DestroyTask - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C67C - - thumb_func_start sub_817C72C -sub_817C72C: @ 817C72C - push {r4-r6,lr} - mov r6, r8 - push {r6} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_02020630 - mov r8, r1 - ldr r1, =gTasks - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - movs r2, 0xA - ldrsh r1, [r4, r2] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - add r2, r8 - ldrb r3, [r2, 0x1] - movs r6, 0x4 - negs r6, r6 - adds r1, r6, 0 - ands r1, r3 - strb r1, [r2, 0x1] - movs r2, 0xA - ldrsh r1, [r4, r2] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - add r2, r8 - ldrb r3, [r2, 0x3] - movs r5, 0x3F - negs r5, r5 - adds r1, r5, 0 - ands r1, r3 - strb r1, [r2, 0x3] - movs r1, 0xA - ldrsh r2, [r4, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r8 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - ands r2, r3 - strb r2, [r1] - movs r1, 0xC - ldrsh r2, [r4, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x1] - ands r6, r2 - strb r6, [r1, 0x1] - movs r1, 0xC - ldrsh r2, [r4, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x3] - ands r5, r2 - strb r5, [r1, 0x3] - movs r1, 0xC - ldrsh r2, [r4, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r8 - adds r1, 0x3E - ldrb r2, [r1] - movs r3, 0x4 - orrs r2, r3 - strb r2, [r1] - bl DestroyTask - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C72C - - thumb_func_start sub_817C7DC -sub_817C7DC: @ 817C7DC - ldr r2, =gUnknown_0860A320 - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - lsls r1, 1 - adds r1, r0 - movs r2, 0 - ldrsh r0, [r1, r2] - bx lr - .pool - thumb_func_end sub_817C7DC - - thumb_func_start sub_817C7F4 -sub_817C7F4: @ 817C7F4 - push {r4,r5,lr} - lsls r4, r0, 16 - lsrs r5, r4, 16 - adds r0, r5, 0 - bl sub_811EB10 - lsls r0, 24 - cmp r0, 0 - beq _0817C810 - ldr r0, =gUnknown_0860A3AC - b _0817C84E - .pool -_0817C810: - lsrs r0, r4, 25 - ldr r2, =0x000001ff - ands r2, r5 - cmp r0, 0x13 - bhi _0817C828 - cmp r0, 0x12 - bcs _0817C834 - cmp r0, 0 - beq _0817C82C - b _0817C83C - .pool -_0817C828: - cmp r0, 0x15 - bne _0817C83C -_0817C82C: - ldr r1, =gUnknown_085F5494 - b _0817C844 - .pool -_0817C834: - ldr r1, =gUnknown_085FA1D8 - b _0817C844 - .pool -_0817C83C: - ldr r1, =gUnknown_0860A168 - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] -_0817C844: - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 4 - adds r1, r0 - adds r0, r1, 0 -_0817C84E: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817C7F4 - - thumb_func_start sub_817C858 -sub_817C858: @ 817C858 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - lsls r1, 16 - lsrs r7, r1, 16 - movs r0, 0 - strh r0, [r5, 0x4] - movs r6, 0 - ldr r0, =gUnknown_0860A3DC - mov r8, r0 - adds r4, r5, 0 - adds r4, 0x18 -_0817C872: - lsls r0, r6, 3 - ldr r1, [r5, 0x30] - adds r2, r1, r0 - ldrb r0, [r2] - cmp r0, 0xFF - beq _0817C8A0 - movs r1, 0x1 - ldrsb r1, [r2, r1] - lsls r0, 2 - add r0, r8 - ldr r0, [r0] - adds r1, r0 - strh r1, [r4] - adds r0, r7, 0 - adds r0, 0x1E - adds r1, r6, 0 - bl sub_817C7DC - strh r0, [r4, 0x2] - ldrh r0, [r4] - ldrh r1, [r5, 0x4] - adds r0, r1 - strh r0, [r5, 0x4] -_0817C8A0: - adds r4, 0x4 - adds r6, 0x1 - cmp r6, 0x5 - ble _0817C872 - movs r0, 0 - strb r0, [r5, 0x1] - strh r0, [r5, 0xA] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C858 - - thumb_func_start sub_817C8BC -sub_817C8BC: @ 817C8BC - push {lr} - ldr r0, =gUnknown_02037318 - ldrb r0, [r0, 0x17] - bl is_light_level_1_2_3_or_6 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0817C8D8 - movs r0, 0 - b _0817C8E6 - .pool -_0817C8D8: - ldr r1, =gUnknown_03005DB0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =gUnknown_0203CEEC - ldr r0, =hm_teleport_run_dp02scr - str r0, [r1] - movs r0, 0x1 -_0817C8E6: - pop {r1} - bx r1 - .pool - thumb_func_end sub_817C8BC - - thumb_func_start hm_teleport_run_dp02scr -hm_teleport_run_dp02scr: @ 817C8FC - push {lr} - bl sub_808469C - movs r0, 0x3F - 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 hm_teleport_run_dp02scr - - thumb_func_start sub_817C91C -sub_817C91C: @ 817C91C - 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_817C94C - lsrs r0, r2, 16 - strh r0, [r1, 0x18] - strh r2, [r1, 0x1A] - movs r0, 0x1 - bl SetPlayerAvatarTransitionFlags - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_817C91C - - thumb_func_start sub_817C94C -sub_817C94C: @ 817C94C - push {lr} - movs r0, 0x3F - bl FieldEffectActiveListRemove - bl sub_80B7FC8 - pop {r0} - bx r0 - thumb_func_end sub_817C94C - thumb_func_start sub_817C95C sub_817C95C: @ 817C95C push {r4-r7,lr} @@ -3026,7 +16,7 @@ sub_817C95C: @ 817C95C lsls r0, 16 lsrs r0, 16 str r0, [sp] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -3049,7 +39,7 @@ _0817C988: bl battle_side_get_owner lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 @@ -3076,7 +66,7 @@ _0817C988: ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty b _0817CA10 .pool _0817CA00: @@ -3087,31 +77,31 @@ _0817CA00: ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty _0817CA10: adds r1, r0 str r1, [sp, 0x8] cmp r6, 0 bne _0817CA3C - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] lsls r0, 1 adds r0, r2 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty b _0817CA4C .pool _0817CA3C: - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] lsls r0, 1 adds r0, r2 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty _0817CA4C: adds r1, r0 str r1, [sp, 0xC] @@ -3150,7 +140,7 @@ _0817CA9C: lsls r0, 24 lsrs r0, 25 mov r8, r0 - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] bl battle_get_per_side_status lsls r0, 24 @@ -3535,7 +525,7 @@ _0817D070: movs r2, 0x2 movs r3, 0 bl sub_817E684 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -3552,7 +542,7 @@ _0817D098: movs r2, 0x1 movs r3, 0 bl sub_817E684 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -3563,7 +553,7 @@ _0817D0B4: ldr r0, [sp, 0xC] movs r1, 0x39 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0817D0C6 bl _0817E0A6 @@ -3951,7 +941,7 @@ _0817D3F2: bl _0817E0A6 _0817D3FE: ldr r0, =gUnknown_0202420B - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex ldrb r0, [r0] ldrb r1, [r1] cmp r0, r1 @@ -4055,7 +1045,7 @@ _0817D4E0: ldr r0, [sp, 0x8] movs r1, 0x39 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0817D4F2 bl _0817E0A6 @@ -4193,7 +1183,7 @@ _0817D608: ldr r0, [sp, 0x8] movs r1, 0x39 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0817D61A bl _0817E0A6 @@ -4261,7 +1251,7 @@ _0817D698: ldr r0, [sp, 0x8] movs r1, 0x39 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0817D6AA bl _0817E0A6 @@ -4358,7 +1348,7 @@ _0817D76C: ldr r0, [sp, 0x8] movs r1, 0x39 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0817D77E bl _0817E0A6 @@ -4501,7 +1491,7 @@ _0817D8A4: ldr r0, [sp, 0x8] movs r1, 0x39 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0817D8B6 bl _0817E0A6 @@ -5553,7 +2543,7 @@ sub_817E0FC: @ 817E0FC lsls r1, 16 lsrs r1, 16 str r1, [sp] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -5574,7 +2564,7 @@ _0817E122: lsls r0, 24 lsrs r0, 24 mov r9, r0 - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 @@ -5811,7 +2801,7 @@ sub_817E32C: @ 817E32C push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -5944,11 +2934,11 @@ _0817E434: movs r0, 0x64 adds r4, r6, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r0, r4, r0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0817E454 mov r0, r8 @@ -5957,11 +2947,11 @@ _0817E434: lsrs r0, 24 mov r8, r0 _0817E454: - ldr r5, =gUnknown_02024744 + ldr r5, =gEnemyParty adds r0, r4, r5 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _0817E46A adds r0, r7, 0x1 @@ -5971,7 +2961,7 @@ _0817E46A: adds r6, 0x1 cmp r6, 0x5 ble _0817E434 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -5991,12 +2981,12 @@ _0817E484: _0817E48E: mov r1, r8 muls r1, r6 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r7, r0, 16 adds r0, r6, 0x1 @@ -6006,7 +2996,7 @@ _0817E48E: adds r0, r4, 0 movs r1, 0x2D movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0817E4EE movs r4, 0 @@ -6039,12 +3029,12 @@ _0817E4C4: _0817E4EE: mov r0, r8 muls r0, r6 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty adds r4, r0, r2 adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r7, r0, 16 ldr r3, [sp, 0x8] @@ -6055,7 +3045,7 @@ _0817E4EE: adds r0, r4, 0 movs r1, 0x2D movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0817E5A0 movs r4, 0 @@ -6088,20 +3078,20 @@ _0817E534: bne _0817E590 mov r0, r8 muls r0, r6 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x19 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 ldr r2, [sp, 0x14] mov r0, r8 muls r0, r2 - ldr r3, =gUnknown_02024744 + ldr r3, =gEnemyParty adds r0, r3 movs r1, 0x19 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r4, r0 bls _0817E5A0 b _0817E594 @@ -6125,7 +3115,7 @@ _0817E5A8: movs r4, 0 movs r6, 0 movs r3, 0 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty ldr r7, [sp, 0x10] lsls r0, r7, 3 mov r1, r10 @@ -6151,7 +3141,7 @@ _0817E5C8: adds r1, r6, 0 adds r1, 0xD movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 ldr r2, [sp, 0x1C] @@ -6159,7 +3149,7 @@ _0817E5C8: beq _0817E670 cmp r4, 0 beq _0817E670 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -6259,7 +3249,7 @@ sub_817E684: @ 817E684 bl battle_side_get_owner lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 @@ -6724,7 +3714,7 @@ sub_817EA80: @ 817EA80 bl battle_side_get_owner lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 @@ -7271,7 +4261,7 @@ sub_817EECC: @ 817EECC mov r5, r8 push {r5-r7} sub sp, 0x28 - ldr r7, =gUnknown_02022FEC + ldr r7, =gBattleTypeFlags ldr r0, [r7] ldr r1, =0x02000003 ands r0, r1 @@ -7288,7 +4278,7 @@ _0817EEE6: bne _0817EEF8 b _0817F1FA _0817EEF8: - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons ldrb r4, [r4] movs r1, 0x58 adds r6, r4, 0 @@ -7301,7 +4291,7 @@ _0817EEF8: bgt _0817EF10 b _0817F1FA _0817EF10: - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r0, [r0] muls r0, r1 adds r0, r5 @@ -7385,7 +4375,7 @@ _0817EF98: mov r1, sp adds r1, r0 adds r1, 0x10 - ldr r0, =gUnknown_020241F0 + ldr r0, =gBattleMoveDamage ldr r0, [r0] str r0, [r1] ldr r0, =gUnknown_020241EA @@ -7396,7 +4386,7 @@ _0817EF98: mov r10, r3 mov r8, r0 add r7, sp, 0x10 - ldr r4, =gUnknown_0202420C + ldr r4, =gEnemyMonIndex mov r9, r4 _0817EFC2: lsls r1, r5, 1 @@ -7405,7 +4395,7 @@ _0817EFC2: movs r2, 0x58 muls r0, r2 adds r1, r0 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r0, 0xC adds r1, r0 ldrh r0, [r1] @@ -7434,7 +4424,7 @@ _0817EFC2: ldrb r0, [r2] movs r4, 0x58 muls r0, r4 - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons adds r0, r6 mov r2, r9 ldrb r1, [r2] @@ -7455,7 +4445,7 @@ _0817EFC2: str r4, [sp, 0xC] bl sub_806957C adds r3, r0, 0 - ldr r4, =gUnknown_020241F0 + ldr r4, =gBattleMoveDamage str r3, [r4] ldr r1, =gUnknown_020242AC ldr r2, =gUnknown_0202420B @@ -7490,7 +4480,7 @@ _0817F06A: lsls r0, 28 cmp r0, 0 bge _0817F08C - ldr r4, =gUnknown_020241F0 + ldr r4, =gBattleMoveDamage ldr r1, [r4] lsls r0, r1, 4 subs r0, r1 @@ -7506,7 +4496,7 @@ _0817F08C: bl move_effectiveness_something lsls r0, 24 lsrs r1, r0, 24 - ldr r0, =gUnknown_020241F0 + ldr r0, =gBattleMoveDamage ldr r0, [r0] str r0, [r7] cmp r0, 0 @@ -7555,8 +4545,8 @@ _0817F0D8: movs r7, 0 _0817F0F6: movs r5, 0 - ldr r4, =gUnknown_0202420C - ldr r6, =gUnknown_02024744 + ldr r4, =gEnemyMonIndex + ldr r6, =gEnemyParty ldr r0, =gUnknown_0202420B ldrb r0, [r0] add r0, r10 @@ -7588,7 +4578,7 @@ _0817F11A: adds r0, r6 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r6, r0, 0 lsls r6, 16 lsrs r6, 16 @@ -7600,11 +4590,11 @@ _0817F11A: mov r3, r9 muls r3, r0 adds r0, r3, 0 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -7633,7 +4623,7 @@ _0817F1D4: bgt _0817F1DC b _0817F0CC _0817F1DC: - ldr r2, =gUnknown_020241F0 + ldr r2, =gBattleMoveDamage ldr r1, =gUnknown_020244B0 ldr r0, =gUnknown_0202420B ldrb r0, [r0] @@ -7704,7 +4694,7 @@ _0817F252: _0817F270: cmp r2, 0x95 bne _0817F294 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -7735,7 +4725,7 @@ _0817F2A0: thumb_func_start sub_817F2A8 sub_817F2A8: @ 817F2A8 push {r4,r5,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -7813,10 +4803,10 @@ sub_817F33C: @ 817F33C adds r0, r5, 0 bl battle_side_get_owner lsls r0, 24 - ldr r6, =gUnknown_02024744 + ldr r6, =gEnemyParty cmp r0, 0 bne _0817F356 - ldr r6, =gUnknown_020244EC + ldr r6, =gPlayerParty _0817F356: movs r4, 0 ldr r1, =gUnknown_0202406E @@ -7836,7 +4826,7 @@ _0817F36E: adds r1, r4, 0 adds r1, 0xD movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r0, r7 bne _0817F36C _0817F388: @@ -7925,24 +4915,24 @@ sub_817F3F0: @ 817F3F0 mov r8, r0 asrs r5, 16 adds r1, r5, 0 - bl cosine + bl Cos adds r6, r0, 0 lsls r4, 16 asrs r4, 16 mov r0, r8 adds r1, r4, 0 - bl sine + bl Sin subs r6, r0 lsls r6, 16 lsrs r6, 16 mov r0, r8 adds r1, r4, 0 - bl cosine + bl Cos adds r2, r0, 0 mov r0, r8 adds r1, r5, 0 str r2, [sp] - bl sine + bl Sin ldr r2, [sp] adds r2, r0 negs r5, r5 diff --git a/asm/rom_8184DA4.s b/asm/rom_8184DA4.s index 4144bc665..aaaab32d9 100644 --- a/asm/rom_8184DA4.s +++ b/asm/rom_8184DA4.s @@ -44,7 +44,7 @@ _08184DD0: mov r3, r12 cmp r3, 0x1 bne _08184E1C - ldr r5, =gUnknown_02022FEC + ldr r5, =gBattleTypeFlags movs r3, 0xFF movs r1, 0xA6 lsls r1, 2 @@ -96,7 +96,7 @@ sub_8184E58: @ 8184E58 cmp r0, 0x1 bne _08184EA0 ldr r1, =gUnknown_0203BD2C - ldr r0, =gUnknown_03005D80 + ldr r0, =gRngValue ldr r0, [r0] str r0, [r1] ldr r4, =gUnknown_0203C7AE @@ -111,12 +111,12 @@ sub_8184E58: @ 8184E58 _08184EA0: cmp r0, 0x2 bne _08184EAC - ldr r0, =gUnknown_03005D80 + ldr r0, =gRngValue ldr r1, =gUnknown_0203BD2C ldr r1, [r1] str r1, [r0] _08184EAC: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r5, [r0] movs r0, 0x2 ands r5, r0 @@ -163,12 +163,12 @@ _08184EDC: mov r0, r8 adds r1, r3, r0 mov r0, sp - bl CopyString + bl StringCopy mov r0, sp - bl StripExtendedControlCodes + bl StripExtCtrlCodes adds r0, r4, r7 mov r1, sp - bl CopyString + bl StringCopy adds r5, 0x1 b _08184F56 .pool @@ -194,7 +194,7 @@ _08184F56: .pool _08184F64: ldr r3, =gUnknown_0203CC80 - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r2, [r4] ldrb r1, [r2, 0xA] ldrb r0, [r2, 0xB] @@ -210,7 +210,7 @@ _08184F64: ldrb r0, [r2, 0x8] strb r0, [r3, 0xC] strh r5, [r3, 0xE] - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strh r0, [r3, 0x10] movs r5, 0 @@ -489,7 +489,7 @@ sub_81851A8: @ 81851A8 movs r1, 0x2 mov r0, sp strb r1, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ands r0, r1 cmp r0, 0 @@ -510,7 +510,7 @@ _081851DA: lsrs r0, 24 cmp r5, r0 blt _081851D0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x4 ands r0, r1 @@ -628,7 +628,7 @@ sub_81852B0: @ 81852B0 ldr r4, =0x00000f7c adds r0, r5, 0 adds r1, r4, 0 - bl sub_806F96C + bl CalcByteArraySum adds r4, r5, r4 ldr r1, [r4] cmp r0, r1 @@ -662,7 +662,7 @@ sub_81852F0: @ 81852F0 ldr r4, =0x00000f7c adds r0, r5, 0 adds r1, r4, 0 - bl sub_806F96C + bl CalcByteArraySum adds r4, r5, r4 str r0, [r4] movs r0, 0x1F @@ -723,7 +723,7 @@ _0818535E: cmp r6, 0x5 ble _0818535E movs r6, 0 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr mov r9, r2 movs r3, 0x9A lsls r3, 3 @@ -1522,7 +1522,7 @@ start_ov_to_battle_anim: @ 8185A88 thumb_func_start sub_8185AB0 sub_8185AB0: @ 8185AB0 push {lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r0, =gUnknown_0203C7AD ldrb r0, [r0] @@ -1539,7 +1539,7 @@ sub_8185AB0: @ 8185AB0 ldr r1, =gUnknown_0202433A movs r0, 0 strb r0, [r1] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags movs r1, 0 str r1, [r0] ldr r0, =gUnknown_02038BCA @@ -1573,7 +1573,7 @@ sub_8185B1C: @ 8185B1C lsls r1, 16 cmp r1, 0 bne _08185B4A - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =sub_8185AB0 str r1, [r0, 0x8] ldr r0, =sub_8036760 @@ -1599,7 +1599,7 @@ sub_8185B60: @ 8185B60 bl zero_player_party_data bl zero_enemy_party_data movs r6, 0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty mov r8, r0 _08185B7C: movs r0, 0x64 @@ -1611,7 +1611,7 @@ _08185B7C: adds r1, r5, 0 movs r2, 0x64 bl memcpy - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 movs r2, 0x96 lsls r2, 2 @@ -1688,7 +1688,7 @@ _08185BE8: cmp r3, 0 beq _08185C2A ldr r0, [sp] - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString _08185C2A: ldr r0, [sp] adds r0, 0x1C @@ -1707,7 +1707,7 @@ _08185C2A: adds r0, r7, r3 ldr r0, [r0] str r0, [r1] - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r1, =0x000004ec adds r0, r7, r1 ldr r0, [r0] @@ -1736,7 +1736,7 @@ _08185C2A: ldrh r0, [r0] strb r0, [r1] ldr r1, =gUnknown_0203C7AD - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r0, [r3] ldr r2, =0x00000ca9 adds r0, r2 @@ -1953,13 +1953,13 @@ _08185EBE: adds r4, r5, 0 muls r4, r0 adds r0, r4, r6 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r1, r4, r1 movs r2, 0x64 bl memcpy ldr r0, =gUnknown_0203CA18 adds r0, r4, r0 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r4, r1 adds r1, r4, 0 movs r2, 0x64 @@ -1977,7 +1977,7 @@ _08185EBE: sub_8185EFC: @ 8185EFC push {r4-r6,lr} movs r5, 0 - ldr r6, =gUnknown_020244EC + ldr r6, =gPlayerParty _08185F02: movs r0, 0x64 adds r4, r5, 0 @@ -1987,7 +1987,7 @@ _08185F02: adds r1, r4, r1 movs r2, 0x64 bl memcpy - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r0, r4, r0 ldr r1, =gUnknown_0203CA18 adds r4, r1 @@ -2102,7 +2102,7 @@ sub_8185FD0: @ 8185FD0 lsrs r0, 24 cmp r0, 0x1 beq _0818601C - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 @@ -2150,7 +2150,7 @@ sub_818603C: @ 818603C lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x24] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 @@ -2297,7 +2297,7 @@ _08186142: movs r1, 0x58 mov r0, r10 muls r0, r1 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons adds r0, r2 adds r6, r0, 0 adds r6, 0x3B @@ -2316,7 +2316,7 @@ _0818617E: cmp r5, 0x3 ble _0818617E movs r5, 0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons mov r9, r1 movs r2, 0x58 mov r7, r10 @@ -2361,7 +2361,7 @@ _081861A6: adds r0, r2 ldrb r1, [r0, 0x18] lsrs r1, 4 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] @@ -2422,7 +2422,7 @@ _0818622C: ands r0, r1 strb r0, [r2, 0x18] movs r5, 0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons adds r4, r1 adds r4, 0x3B ldr r0, =gUnknown_020242BC @@ -2476,11 +2476,11 @@ _081862CA: ldrh r1, [r6] movs r0, 0x64 muls r0, r1 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 movs r1, 0x15 movs r2, 0 - bl pokemon_getattr + bl GetMonData mov r1, sp adds r3, r1, r5 lsls r2, r5, 1 @@ -2510,7 +2510,7 @@ _08186304: ldrb r1, [r4] adds r1, 0xD movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r6] ldrh r0, [r7] mov r2, r9 @@ -2520,7 +2520,7 @@ _08186304: ldrb r1, [r4] adds r1, 0x11 movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r3, [sp, 0x34] adds r1, r3, r5 strb r0, [r1] @@ -2541,7 +2541,7 @@ _08186304: adds r7, r1, r0 movs r2, 0x64 mov r9, r2 - ldr r3, =gUnknown_020244EC + ldr r3, =gPlayerParty mov r8, r3 ldr r6, [sp, 0x30] adds r6, 0x8 @@ -2575,7 +2575,7 @@ _08186360: strb r0, [r3] movs r5, 0 ldr r4, =gUnknown_0202406E - ldr r6, =gUnknown_020244EC + ldr r6, =gPlayerParty ldr r3, [sp, 0x3C] ldr r2, [sp, 0x40] _081863A2: @@ -2612,7 +2612,7 @@ _081863CA: mov r1, r10 muls r1, r4 adds r0, r1 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons adds r1, 0xC adds r0, r1 ldrh r0, [r0] @@ -2690,7 +2690,7 @@ _08186472: strb r0, [r3, 0x7] ldrb r1, [r5] adds r0, r3, 0 - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString pop {r4,r5} pop {r0} bx r0 @@ -2768,7 +2768,7 @@ sub_81864EC: @ 81864EC sub_8186508: @ 8186508 push {lr} ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r3, [r0] lsls r0, r3, 2 @@ -2947,7 +2947,7 @@ sub_8186678: @ 8186678 lsls r0, 24 cmp r0, 0 beq _081866F8 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -3186,7 +3186,7 @@ sub_818686C: @ 818686C ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @@ -3211,7 +3211,7 @@ _081868AC: ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @@ -3249,7 +3249,7 @@ _081868DE: lsls r0, 24 cmp r0, 0 beq _08186964 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -3267,7 +3267,7 @@ _081868DE: ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @@ -3291,7 +3291,7 @@ _08186964: ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @@ -3357,7 +3357,7 @@ _081869AE: ands r0, r1 cmp r0, 0 bne _08186A4C - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x42 ands r0, r1 @@ -3487,7 +3487,7 @@ _08186B26: lsls r0, 24 cmp r0, 0 beq _08186B8A - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -3514,10 +3514,10 @@ _08186B26: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -3542,10 +3542,10 @@ _08186B8A: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -3639,7 +3639,7 @@ sub_8186C48: @ 8186C48 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r1, r0 adds r0, r3, 0 bl sub_8172EF0 @@ -4040,7 +4040,7 @@ sub_8186F94: @ 8186F94 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @@ -4087,7 +4087,7 @@ sub_8187084: @ 8187084 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @@ -4127,10 +4127,10 @@ _081870B6: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -4208,7 +4208,7 @@ sub_81871AC: @ 81871AC adds r0, r1 ldr r1, =sub_8186508 str r1, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -4231,7 +4231,7 @@ sub_81871AC: @ 81871AC .pool _08187200: ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r1 @@ -4397,16 +4397,16 @@ _081873C8: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1] adds r0, r4, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x2E] movs r6, 0 @@ -4434,12 +4434,12 @@ _08187414: adds r1, r6, 0 adds r1, 0xD mov r0, r8 - bl pokemon_getattr + bl GetMonData strh r0, [r4] adds r1, r6, 0 adds r1, 0x11 mov r0, r8 - bl pokemon_getattr + bl GetMonData mov r2, r9 adds r1, r2, r6 strb r0, [r1] @@ -4450,25 +4450,25 @@ _08187414: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 adds r0, r4, 0 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData mov r1, r10 strb r0, [r1] adds r0, r4, 0 movs r1, 0x20 - bl pokemon_getattr + bl GetMonData ldr r2, [sp, 0x80] strb r0, [r2] adds r0, r4, 0 movs r1, 0x19 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x44] adds r0, r4, 0 movs r1, 0x27 - bl pokemon_getattr + bl GetMonData mov r3, sp movs r5, 0x1F ands r0, r5 @@ -4480,7 +4480,7 @@ _08187414: strb r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x28 - bl pokemon_getattr + bl GetMonData mov r3, sp movs r6, 0x1F ands r0, r6 @@ -4492,7 +4492,7 @@ _08187414: strh r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x29 - bl pokemon_getattr + bl GetMonData mov r3, sp ands r0, r5 lsls r0, 2 @@ -4504,7 +4504,7 @@ _08187414: strb r1, [r3, 0x15] adds r0, r4, 0 movs r1, 0x2A - bl pokemon_getattr + bl GetMonData movs r1, 0x1F ands r1, r0 lsls r1, 15 @@ -4515,7 +4515,7 @@ _08187414: str r0, [sp, 0x14] adds r0, r4, 0 movs r1, 0x2B - bl pokemon_getattr + bl GetMonData mov r3, sp ands r0, r6 lsls r0, 4 @@ -4526,7 +4526,7 @@ _08187414: strh r1, [r3, 0x16] adds r0, r4, 0 movs r1, 0x2C - bl pokemon_getattr + bl GetMonData mov r3, sp ands r0, r5 lsls r0, 1 @@ -4538,55 +4538,55 @@ _08187414: strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x48] adds r0, r4, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x4C] adds r0, r4, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData ldr r1, [sp, 0x7C] strb r0, [r1] adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x28] adds r0, r4, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x2C] adds r0, r4, 0 movs r1, 0x3B - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x2] adds r0, r4, 0 movs r1, 0x3C - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x4] adds r0, r4, 0 movs r1, 0x3D - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x6] adds r0, r4, 0 movs r1, 0x3E - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x8] adds r0, r4, 0 movs r1, 0x3F - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0xA] adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData mov r3, sp movs r1, 0x1 ands r0, r1 @@ -4599,7 +4599,7 @@ _08187414: strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x2E - bl pokemon_getattr + bl GetMonData mov r3, sp lsls r0, 7 ldrb r2, [r3, 0x17] @@ -4609,19 +4609,19 @@ _08187414: strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x54] adds r0, r4, 0 movs r1, 0x2 ldr r2, [sp, 0x8C] - bl pokemon_getattr + bl GetMonData ldr r0, [sp, 0x84] ldr r1, [sp, 0x8C] - bl CopyString_Limit10 + bl StringCopy10 adds r0, r4, 0 movs r1, 0x7 ldr r2, [sp, 0x88] - bl pokemon_getattr + bl GetMonData mov r2, sp movs r6, 0 _081875CC: @@ -4637,7 +4637,7 @@ _081875CC: _081875EC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xB b _08187966 @@ -4645,7 +4645,7 @@ _081875EC: _081875FC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xC b _08187966 @@ -4659,20 +4659,20 @@ _0818760C: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r1, r0 mov r8, r9 _08187622: adds r1, r6, 0 adds r1, 0xD adds r0, r4, 0 - bl pokemon_getattr + bl GetMonData mov r1, r8 strh r0, [r1] adds r1, r6, 0 adds r1, 0x11 adds r0, r4, 0 - bl pokemon_getattr + bl GetMonData mov r2, r10 adds r1, r2, r6 strb r0, [r1] @@ -4683,10 +4683,10 @@ _08187622: ble _08187622 movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData mov r1, r9 strb r0, [r1, 0xC] mov r2, r9 @@ -4704,7 +4704,7 @@ _08187660: _08187674: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r1, [r3] lsls r1, 9 @@ -4719,14 +4719,14 @@ _08187690: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty mov r8, r2 _0818769C: adds r1, r6, 0 adds r1, 0x11 mov r2, r8 adds r0, r4, r2 - bl pokemon_getattr + bl GetMonData adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 @@ -4734,10 +4734,10 @@ _0818769C: ble _0818769C movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 @@ -4746,7 +4746,7 @@ _0818769C: _081876CC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r1, [r3] lsls r1, 9 @@ -4759,7 +4759,7 @@ _081876CC: _081876E8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x1 b _08187702 @@ -4767,11 +4767,11 @@ _081876E8: _081876F8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x19 _08187702: - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 strb r1, [r7] movs r0, 0xFF @@ -4790,7 +4790,7 @@ _08187702: _08187728: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x1A b _08187A26 @@ -4798,7 +4798,7 @@ _08187728: _08187738: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x1B b _08187A26 @@ -4806,7 +4806,7 @@ _08187738: _08187748: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x1C b _08187A26 @@ -4814,7 +4814,7 @@ _08187748: _08187758: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x1D b _08187A26 @@ -4822,7 +4822,7 @@ _08187758: _08187768: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x1E b _08187A26 @@ -4830,7 +4830,7 @@ _08187768: _08187778: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x1F b _08187A26 @@ -4838,7 +4838,7 @@ _08187778: _08187788: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x20 b _08187A26 @@ -4846,7 +4846,7 @@ _08187788: _08187798: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x22 b _08187A26 @@ -4854,7 +4854,7 @@ _08187798: _081877A8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x23 b _08187A26 @@ -4862,7 +4862,7 @@ _081877A8: _081877B8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x24 b _08187A26 @@ -4870,7 +4870,7 @@ _081877B8: _081877C8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x25 b _08187A26 @@ -4878,7 +4878,7 @@ _081877C8: _081877D8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x26 b _08187A26 @@ -4887,31 +4887,31 @@ _081877E8: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 adds r0, r4, 0 movs r1, 0x27 - bl pokemon_getattr + bl GetMonData strb r0, [r7] adds r0, r4, 0 movs r1, 0x28 - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x1] adds r0, r4, 0 movs r1, 0x29 - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x2] adds r0, r4, 0 movs r1, 0x2A - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x3] adds r0, r4, 0 movs r1, 0x2B - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x4] adds r0, r4, 0 movs r1, 0x2C - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x5] movs r6, 0x6 b _08187A2E @@ -4919,7 +4919,7 @@ _081877E8: _08187838: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x27 b _08187A26 @@ -4927,7 +4927,7 @@ _08187838: _08187848: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x28 b _08187A26 @@ -4935,7 +4935,7 @@ _08187848: _08187858: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x29 b _08187A26 @@ -4943,7 +4943,7 @@ _08187858: _08187868: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x2A b _08187A26 @@ -4951,7 +4951,7 @@ _08187868: _08187878: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x2B b _08187A26 @@ -4959,7 +4959,7 @@ _08187878: _08187888: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x2C b _08187A26 @@ -4967,7 +4967,7 @@ _08187888: _08187898: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0 b _081878C2 @@ -4975,7 +4975,7 @@ _08187898: _081878A8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x9 b _08187966 @@ -4983,11 +4983,11 @@ _081878A8: _081878B8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x37 _081878C2: - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 strb r1, [r7] movs r0, 0xFF @@ -5008,7 +5008,7 @@ _081878C2: _081878EC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x38 b _08187A26 @@ -5016,7 +5016,7 @@ _081878EC: _081878FC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x39 b _08187966 @@ -5024,7 +5024,7 @@ _081878FC: _0818790C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x3A b _08187966 @@ -5032,7 +5032,7 @@ _0818790C: _0818791C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x3B b _08187966 @@ -5040,7 +5040,7 @@ _0818791C: _0818792C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x3C b _08187966 @@ -5048,7 +5048,7 @@ _0818792C: _0818793C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x3D b _08187966 @@ -5056,7 +5056,7 @@ _0818793C: _0818794C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x3E b _08187966 @@ -5064,11 +5064,11 @@ _0818794C: _0818795C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x3F _08187966: - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 strb r0, [r7] @@ -5080,7 +5080,7 @@ _08187966: _0818797C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x16 b _08187A26 @@ -5088,7 +5088,7 @@ _0818797C: _0818798C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x17 b _08187A26 @@ -5096,7 +5096,7 @@ _0818798C: _0818799C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x18 b _08187A26 @@ -5104,7 +5104,7 @@ _0818799C: _081879AC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x21 b _08187A26 @@ -5112,7 +5112,7 @@ _081879AC: _081879BC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x2F b _08187A26 @@ -5120,7 +5120,7 @@ _081879BC: _081879CC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x30 b _08187A26 @@ -5128,7 +5128,7 @@ _081879CC: _081879DC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x32 b _08187A26 @@ -5136,7 +5136,7 @@ _081879DC: _081879EC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x33 b _08187A26 @@ -5144,7 +5144,7 @@ _081879EC: _081879FC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x34 b _08187A26 @@ -5152,7 +5152,7 @@ _081879FC: _08187A0C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x35 b _08187A26 @@ -5160,11 +5160,11 @@ _08187A0C: _08187A1C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x36 _08187A26: - bl pokemon_getattr + bl GetMonData strb r0, [r7] movs r6, 0x1 _08187A2E: @@ -5328,7 +5328,7 @@ _08187BDC: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 adds r0, r4, 0 movs r1, 0xB @@ -5395,7 +5395,7 @@ _08187C42: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 adds r0, r4, 0 movs r1, 0x15 @@ -5508,7 +5508,7 @@ _08187C42: _08187D74: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5520,7 +5520,7 @@ _08187D74: _08187D90: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5538,7 +5538,7 @@ _08187DAC: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r7, r1, r0 adds r6, r4, 0 adds r6, 0x8 @@ -5562,7 +5562,7 @@ _08187DC4: ble _08187DC4 movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x15 mov r2, r9 @@ -5572,7 +5572,7 @@ _08187DC4: _08187E00: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldr r3, =gUnknown_02023064 ldrb r2, [r6] @@ -5587,7 +5587,7 @@ _08187E20: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 ldrb r2, [r6] lsls r2, 9 @@ -5633,7 +5633,7 @@ _08187E20: _08187E88: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldr r3, =gUnknown_02023064 ldrb r2, [r6] @@ -5651,7 +5651,7 @@ _08187E9E: _08187EB0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5663,7 +5663,7 @@ _08187EB0: _08187ECC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5675,7 +5675,7 @@ _08187ECC: _08187EE8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5687,7 +5687,7 @@ _08187EE8: _08187F04: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5699,7 +5699,7 @@ _08187F04: _08187F20: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5711,7 +5711,7 @@ _08187F20: _08187F3C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5723,7 +5723,7 @@ _08187F3C: _08187F58: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5735,7 +5735,7 @@ _08187F58: _08187F74: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5747,7 +5747,7 @@ _08187F74: _08187F90: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5759,7 +5759,7 @@ _08187F90: _08187FAC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5771,7 +5771,7 @@ _08187FAC: _08187FC8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5783,7 +5783,7 @@ _08187FC8: _08187FE4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5795,7 +5795,7 @@ _08187FE4: _08188000: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5807,7 +5807,7 @@ _08188000: _0818801C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5820,7 +5820,7 @@ _08188038: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 ldrb r2, [r6] lsls r2, 9 @@ -5872,7 +5872,7 @@ _08188038: _081880AC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5884,7 +5884,7 @@ _081880AC: _081880C8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5896,7 +5896,7 @@ _081880C8: _081880E4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5908,7 +5908,7 @@ _081880E4: _08188100: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5920,7 +5920,7 @@ _08188100: _0818811C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5932,7 +5932,7 @@ _0818811C: _08188138: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5945,7 +5945,7 @@ _08188146: _08188154: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5957,7 +5957,7 @@ _08188154: _08188170: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5969,7 +5969,7 @@ _08188170: _0818818C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5981,7 +5981,7 @@ _0818818C: _081881A8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -5993,7 +5993,7 @@ _081881A8: _081881C4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -6005,7 +6005,7 @@ _081881C4: _081881E0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -6017,7 +6017,7 @@ _081881E0: _081881FC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -6029,7 +6029,7 @@ _081881FC: _08188218: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -6041,7 +6041,7 @@ _08188218: _08188234: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -6053,7 +6053,7 @@ _08188234: _08188250: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -6065,7 +6065,7 @@ _08188250: _0818826C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -6077,7 +6077,7 @@ _0818826C: _08188288: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -6089,7 +6089,7 @@ _08188288: _081882A4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -6101,7 +6101,7 @@ _081882A4: _081882C0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -6113,7 +6113,7 @@ _081882C0: _081882DC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -6125,7 +6125,7 @@ _081882DC: _081882F8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -6137,7 +6137,7 @@ _081882F8: _08188314: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -6149,7 +6149,7 @@ _08188314: _08188330: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -6161,7 +6161,7 @@ _08188330: _0818834C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -6173,7 +6173,7 @@ _0818834C: _08188368: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -6185,7 +6185,7 @@ _08188368: _08188384: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -6197,7 +6197,7 @@ _08188384: _081883A0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 ldrb r2, [r6] lsls r2, 9 @@ -6233,7 +6233,7 @@ sub_81883C8: @ 81883C8 adds r0, r4, 0x1 adds r0, r2, r0 ldrb r0, [r0] - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 adds r5, r3, r0 movs r3, 0 @@ -6289,11 +6289,11 @@ sub_818843C: @ 818843C mov r2, r10 muls r2, r0 adds r0, r2, 0 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty mov r9, r1 add r0, r9 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 @@ -6390,7 +6390,7 @@ sub_818843C: @ 818843C adds r0, r1, 0 add r0, r9 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -6473,16 +6473,16 @@ sub_81885D8: @ 81885D8 mov r1, r9 muls r1, r0 adds r0, r1, 0 - ldr r5, =gUnknown_02024744 + ldr r5, =gEnemyParty adds r0, r5 movs r1, 0xB - bl pokemon_getattr + bl GetMonData mov r8, r0 lsls r0, 16 lsrs r0, 16 mov r8, r0 ldr r0, =sub_805D714 - bl object_new_hidden_with_callback + bl CreateInvisibleSpriteWithCallback ldr r1, =gUnknown_03005D7C mov r10, r1 add r10, r6 @@ -6754,7 +6754,7 @@ sub_818888C: @ 818888C mov r7, r9 mov r6, r8 push {r6,r7} - ldr r5, =gUnknown_02022FEC + ldr r5, =gBattleTypeFlags ldr r0, [r5] movs r1, 0x40 ands r0, r1 @@ -7513,7 +7513,7 @@ sub_8188F14: @ 8188F14 thumb_func_start sub_8188F20 sub_8188F20: @ 8188F20 push {r4,r5,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 10 @@ -7629,10 +7629,10 @@ sub_8188FD0: @ 8188FD0 ldrh r0, [r0] movs r5, 0x64 muls r0, r5 - ldr r4, =gUnknown_02024744 + ldr r4, =gEnemyParty adds r0, r4 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData mov r8, r0 mov r1, r9 ldrb r0, [r1] @@ -7642,7 +7642,7 @@ sub_8188FD0: @ 8188FD0 muls r0, r5 adds r0, r4 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r3, r0, 0 mov r1, r9 ldrb r0, [r1] @@ -7661,10 +7661,10 @@ _08189060: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData adds r2, r0, 0 mov r1, r9 ldrb r0, [r1] @@ -7719,7 +7719,7 @@ sub_81890CC: @ 81890CC ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty adds r1, r2 movs r2, 0x9 bl healthbar_draw_field_maybe @@ -8087,10 +8087,10 @@ sub_81893C8: @ 81893C8 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 movs r1, 0x19 @@ -8263,7 +8263,7 @@ c3_0803D564: @ 8189548 lsls r0, 24 cmp r0, 0 beq _08189582 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -8729,7 +8729,7 @@ sub_818994C: @ 818994C sub_8189968: @ 8189968 push {lr} ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r3, [r0] lsls r0, r3, 2 @@ -8889,7 +8889,7 @@ _08189ABA: lsls r0, 24 cmp r0, 0 beq _08189B0C - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -9035,7 +9035,7 @@ _08189B86: ldrh r0, [r0] movs r6, 0x64 muls r0, r6 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 bl sub_805E990 bl battle_type_is_double @@ -9075,7 +9075,7 @@ _08189C60: lsls r0, 24 cmp r0, 0 beq _08189CB0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -9198,7 +9198,7 @@ sub_8189D40: @ 8189D40 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @@ -9223,7 +9223,7 @@ _08189D8C: ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r1, r0 adds r0, r3, 0 bl sub_8172EF0 @@ -9266,7 +9266,7 @@ _08189DBE: lsls r0, 24 cmp r0, 0 beq _08189E54 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -9285,7 +9285,7 @@ _08189DBE: ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @@ -9311,7 +9311,7 @@ _08189E54: ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @@ -9381,7 +9381,7 @@ _08189EA2: ands r0, r1 cmp r0, 0 bne _08189F44 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x42 ands r0, r1 @@ -9452,7 +9452,7 @@ _08189F62: lsls r0, 24 cmp r0, 0 beq _08189FC8 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -9597,7 +9597,7 @@ _0818A0EC: ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 bl sub_805E990 bl sub_818A514 @@ -9634,10 +9634,10 @@ sub_818A114: @ 818A114 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 bl nullsub_24 @@ -9931,7 +9931,7 @@ sub_818A37C: @ 818A37C ldrh r0, [r0] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5 bl sub_805E990 ldr r1, =gUnknown_020241E4 @@ -9999,7 +9999,7 @@ sub_818A470: @ 818A470 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @@ -10056,7 +10056,7 @@ sub_818A514: @ 818A514 adds r0, r1 ldr r1, =sub_8189968 str r1, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -10079,7 +10079,7 @@ sub_818A514: @ 818A514 .pool _0818A568: ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r1 @@ -10293,16 +10293,16 @@ _0818A790: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1] adds r0, r4, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x2E] movs r6, 0 @@ -10330,12 +10330,12 @@ _0818A7DC: adds r1, r6, 0 adds r1, 0xD mov r0, r8 - bl pokemon_getattr + bl GetMonData strh r0, [r4] adds r1, r6, 0 adds r1, 0x11 mov r0, r8 - bl pokemon_getattr + bl GetMonData mov r2, r9 adds r1, r2, r6 strb r0, [r1] @@ -10346,25 +10346,25 @@ _0818A7DC: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData mov r1, r10 strb r0, [r1] adds r0, r4, 0 movs r1, 0x20 - bl pokemon_getattr + bl GetMonData ldr r2, [sp, 0x80] strb r0, [r2] adds r0, r4, 0 movs r1, 0x19 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x44] adds r0, r4, 0 movs r1, 0x27 - bl pokemon_getattr + bl GetMonData mov r3, sp movs r5, 0x1F ands r0, r5 @@ -10376,7 +10376,7 @@ _0818A7DC: strb r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x28 - bl pokemon_getattr + bl GetMonData mov r3, sp movs r6, 0x1F ands r0, r6 @@ -10388,7 +10388,7 @@ _0818A7DC: strh r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x29 - bl pokemon_getattr + bl GetMonData mov r3, sp ands r0, r5 lsls r0, 2 @@ -10400,7 +10400,7 @@ _0818A7DC: strb r1, [r3, 0x15] adds r0, r4, 0 movs r1, 0x2A - bl pokemon_getattr + bl GetMonData movs r1, 0x1F ands r1, r0 lsls r1, 15 @@ -10411,7 +10411,7 @@ _0818A7DC: str r0, [sp, 0x14] adds r0, r4, 0 movs r1, 0x2B - bl pokemon_getattr + bl GetMonData mov r3, sp ands r0, r6 lsls r0, 4 @@ -10422,7 +10422,7 @@ _0818A7DC: strh r1, [r3, 0x16] adds r0, r4, 0 movs r1, 0x2C - bl pokemon_getattr + bl GetMonData mov r3, sp ands r0, r5 lsls r0, 1 @@ -10434,55 +10434,55 @@ _0818A7DC: strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x48] adds r0, r4, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x4C] adds r0, r4, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData ldr r1, [sp, 0x7C] strb r0, [r1] adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x28] adds r0, r4, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x2C] adds r0, r4, 0 movs r1, 0x3B - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x2] adds r0, r4, 0 movs r1, 0x3C - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x4] adds r0, r4, 0 movs r1, 0x3D - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x6] adds r0, r4, 0 movs r1, 0x3E - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x8] adds r0, r4, 0 movs r1, 0x3F - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0xA] adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData mov r3, sp movs r1, 0x1 ands r0, r1 @@ -10495,7 +10495,7 @@ _0818A7DC: strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x2E - bl pokemon_getattr + bl GetMonData mov r3, sp lsls r0, 7 ldrb r2, [r3, 0x17] @@ -10505,19 +10505,19 @@ _0818A7DC: strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x54] adds r0, r4, 0 movs r1, 0x2 ldr r2, [sp, 0x8C] - bl pokemon_getattr + bl GetMonData ldr r0, [sp, 0x84] ldr r1, [sp, 0x8C] - bl CopyString_Limit10 + bl StringCopy10 adds r0, r4, 0 movs r1, 0x7 ldr r2, [sp, 0x88] - bl pokemon_getattr + bl GetMonData mov r2, sp movs r6, 0 _0818A994: @@ -10533,7 +10533,7 @@ _0818A994: _0818A9B4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB b _0818AD2E @@ -10541,7 +10541,7 @@ _0818A9B4: _0818A9C4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xC b _0818AD2E @@ -10555,20 +10555,20 @@ _0818A9D4: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 mov r8, r9 _0818A9EA: adds r1, r6, 0 adds r1, 0xD adds r0, r4, 0 - bl pokemon_getattr + bl GetMonData mov r1, r8 strh r0, [r1] adds r1, r6, 0 adds r1, 0x11 adds r0, r4, 0 - bl pokemon_getattr + bl GetMonData mov r2, r10 adds r1, r2, r6 strb r0, [r1] @@ -10579,10 +10579,10 @@ _0818A9EA: ble _0818A9EA movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData mov r1, r9 strb r0, [r1, 0xC] mov r2, r9 @@ -10600,7 +10600,7 @@ _0818AA28: _0818AA3C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldrb r1, [r3] lsls r1, 9 @@ -10615,14 +10615,14 @@ _0818AA58: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty mov r8, r2 _0818AA64: adds r1, r6, 0 adds r1, 0x11 mov r2, r8 adds r0, r4, r2 - bl pokemon_getattr + bl GetMonData adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 @@ -10630,10 +10630,10 @@ _0818AA64: ble _0818AA64 movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 @@ -10642,7 +10642,7 @@ _0818AA64: _0818AA94: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldrb r1, [r3] lsls r1, 9 @@ -10655,7 +10655,7 @@ _0818AA94: _0818AAB0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1 b _0818AACA @@ -10663,11 +10663,11 @@ _0818AAB0: _0818AAC0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x19 _0818AACA: - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 strb r1, [r7] movs r0, 0xFF @@ -10686,7 +10686,7 @@ _0818AACA: _0818AAF0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1A b _0818ADEE @@ -10694,7 +10694,7 @@ _0818AAF0: _0818AB00: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1B b _0818ADEE @@ -10702,7 +10702,7 @@ _0818AB00: _0818AB10: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1C b _0818ADEE @@ -10710,7 +10710,7 @@ _0818AB10: _0818AB20: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1D b _0818ADEE @@ -10718,7 +10718,7 @@ _0818AB20: _0818AB30: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1E b _0818ADEE @@ -10726,7 +10726,7 @@ _0818AB30: _0818AB40: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1F b _0818ADEE @@ -10734,7 +10734,7 @@ _0818AB40: _0818AB50: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x20 b _0818ADEE @@ -10742,7 +10742,7 @@ _0818AB50: _0818AB60: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x22 b _0818ADEE @@ -10750,7 +10750,7 @@ _0818AB60: _0818AB70: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x23 b _0818ADEE @@ -10758,7 +10758,7 @@ _0818AB70: _0818AB80: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x24 b _0818ADEE @@ -10766,7 +10766,7 @@ _0818AB80: _0818AB90: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x25 b _0818ADEE @@ -10774,7 +10774,7 @@ _0818AB90: _0818ABA0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x26 b _0818ADEE @@ -10783,31 +10783,31 @@ _0818ABB0: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x27 - bl pokemon_getattr + bl GetMonData strb r0, [r7] adds r0, r4, 0 movs r1, 0x28 - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x1] adds r0, r4, 0 movs r1, 0x29 - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x2] adds r0, r4, 0 movs r1, 0x2A - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x3] adds r0, r4, 0 movs r1, 0x2B - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x4] adds r0, r4, 0 movs r1, 0x2C - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x5] movs r6, 0x6 b _0818ADF6 @@ -10815,7 +10815,7 @@ _0818ABB0: _0818AC00: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x27 b _0818ADEE @@ -10823,7 +10823,7 @@ _0818AC00: _0818AC10: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x28 b _0818ADEE @@ -10831,7 +10831,7 @@ _0818AC10: _0818AC20: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x29 b _0818ADEE @@ -10839,7 +10839,7 @@ _0818AC20: _0818AC30: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2A b _0818ADEE @@ -10847,7 +10847,7 @@ _0818AC30: _0818AC40: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2B b _0818ADEE @@ -10855,7 +10855,7 @@ _0818AC40: _0818AC50: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2C b _0818ADEE @@ -10863,7 +10863,7 @@ _0818AC50: _0818AC60: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0 b _0818AC8A @@ -10871,7 +10871,7 @@ _0818AC60: _0818AC70: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x9 b _0818AD2E @@ -10879,11 +10879,11 @@ _0818AC70: _0818AC80: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x37 _0818AC8A: - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 strb r1, [r7] movs r0, 0xFF @@ -10904,7 +10904,7 @@ _0818AC8A: _0818ACB4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x38 b _0818ADEE @@ -10912,7 +10912,7 @@ _0818ACB4: _0818ACC4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x39 b _0818AD2E @@ -10920,7 +10920,7 @@ _0818ACC4: _0818ACD4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3A b _0818AD2E @@ -10928,7 +10928,7 @@ _0818ACD4: _0818ACE4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3B b _0818AD2E @@ -10936,7 +10936,7 @@ _0818ACE4: _0818ACF4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3C b _0818AD2E @@ -10944,7 +10944,7 @@ _0818ACF4: _0818AD04: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3D b _0818AD2E @@ -10952,7 +10952,7 @@ _0818AD04: _0818AD14: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3E b _0818AD2E @@ -10960,11 +10960,11 @@ _0818AD14: _0818AD24: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3F _0818AD2E: - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 strb r0, [r7] @@ -10976,7 +10976,7 @@ _0818AD2E: _0818AD44: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x16 b _0818ADEE @@ -10984,7 +10984,7 @@ _0818AD44: _0818AD54: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x17 b _0818ADEE @@ -10992,7 +10992,7 @@ _0818AD54: _0818AD64: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x18 b _0818ADEE @@ -11000,7 +11000,7 @@ _0818AD64: _0818AD74: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x21 b _0818ADEE @@ -11008,7 +11008,7 @@ _0818AD74: _0818AD84: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2F b _0818ADEE @@ -11016,7 +11016,7 @@ _0818AD84: _0818AD94: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x30 b _0818ADEE @@ -11024,7 +11024,7 @@ _0818AD94: _0818ADA4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x32 b _0818ADEE @@ -11032,7 +11032,7 @@ _0818ADA4: _0818ADB4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x33 b _0818ADEE @@ -11040,7 +11040,7 @@ _0818ADB4: _0818ADC4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x34 b _0818ADEE @@ -11048,7 +11048,7 @@ _0818ADC4: _0818ADD4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x35 b _0818ADEE @@ -11056,11 +11056,11 @@ _0818ADD4: _0818ADE4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x36 _0818ADEE: - bl pokemon_getattr + bl GetMonData strb r0, [r7] movs r6, 0x1 _0818ADF6: @@ -11223,7 +11223,7 @@ _0818AFA4: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0xB @@ -11290,7 +11290,7 @@ _0818B00A: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x15 @@ -11403,7 +11403,7 @@ _0818B00A: _0818B13C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11416,7 +11416,7 @@ _0818B13C: _0818B15C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11435,7 +11435,7 @@ _0818B17C: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r7, r1, r0 adds r6, r3, 0 adds r6, 0x8 @@ -11460,7 +11460,7 @@ _0818B196: ble _0818B196 movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x15 mov r2, r9 @@ -11470,7 +11470,7 @@ _0818B196: _0818B1D4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r3, =gUnknown_02023064 ldr r1, =gUnknown_02024064 @@ -11486,7 +11486,7 @@ _0818B1FC: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 ldr r5, =gUnknown_02024064 ldrb r2, [r5] @@ -11528,7 +11528,7 @@ _0818B1FC: _0818B260: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r3, =gUnknown_02023064 ldr r1, =gUnknown_02024064 @@ -11547,7 +11547,7 @@ _0818B278: _0818B290: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11560,7 +11560,7 @@ _0818B290: _0818B2B0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11573,7 +11573,7 @@ _0818B2B0: _0818B2D0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11586,7 +11586,7 @@ _0818B2D0: _0818B2F0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11599,7 +11599,7 @@ _0818B2F0: _0818B310: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11612,7 +11612,7 @@ _0818B310: _0818B330: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11625,7 +11625,7 @@ _0818B330: _0818B350: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11638,7 +11638,7 @@ _0818B350: _0818B370: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11651,7 +11651,7 @@ _0818B370: _0818B390: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11664,7 +11664,7 @@ _0818B390: _0818B3B0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11677,7 +11677,7 @@ _0818B3B0: _0818B3D0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11690,7 +11690,7 @@ _0818B3D0: _0818B3F0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11703,7 +11703,7 @@ _0818B3F0: _0818B410: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11716,7 +11716,7 @@ _0818B410: _0818B430: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11730,7 +11730,7 @@ _0818B450: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 ldr r5, =gUnknown_02024064 ldrb r2, [r5] @@ -11777,7 +11777,7 @@ _0818B450: _0818B4C0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11790,7 +11790,7 @@ _0818B4C0: _0818B4E0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11803,7 +11803,7 @@ _0818B4E0: _0818B500: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11816,7 +11816,7 @@ _0818B500: _0818B520: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11829,7 +11829,7 @@ _0818B520: _0818B540: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11842,7 +11842,7 @@ _0818B540: _0818B560: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11856,7 +11856,7 @@ _0818B570: _0818B580: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11869,7 +11869,7 @@ _0818B580: _0818B5A0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11882,7 +11882,7 @@ _0818B5A0: _0818B5C0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11895,7 +11895,7 @@ _0818B5C0: _0818B5E0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11908,7 +11908,7 @@ _0818B5E0: _0818B600: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11921,7 +11921,7 @@ _0818B600: _0818B620: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11934,7 +11934,7 @@ _0818B620: _0818B640: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11947,7 +11947,7 @@ _0818B640: _0818B660: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11960,7 +11960,7 @@ _0818B660: _0818B680: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11973,7 +11973,7 @@ _0818B680: _0818B6A0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11986,7 +11986,7 @@ _0818B6A0: _0818B6C0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -11999,7 +11999,7 @@ _0818B6C0: _0818B6E0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -12012,7 +12012,7 @@ _0818B6E0: _0818B700: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -12025,7 +12025,7 @@ _0818B700: _0818B720: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -12038,7 +12038,7 @@ _0818B720: _0818B740: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -12051,7 +12051,7 @@ _0818B740: _0818B760: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -12064,7 +12064,7 @@ _0818B760: _0818B780: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -12077,7 +12077,7 @@ _0818B780: _0818B7A0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -12090,7 +12090,7 @@ _0818B7A0: _0818B7C0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -12103,7 +12103,7 @@ _0818B7C0: _0818B7E0: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -12116,7 +12116,7 @@ _0818B7E0: _0818B800: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -12129,7 +12129,7 @@ _0818B800: _0818B820: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -12146,7 +12146,7 @@ _0818B836: ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 bl sub_805E990 add sp, 0x34 @@ -12177,7 +12177,7 @@ sub_818B86C: @ 818B86C adds r0, r4, 0x1 adds r0, r2, r0 ldrb r0, [r0] - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 adds r5, r3, r0 movs r3, 0 @@ -12229,7 +12229,7 @@ sub_818B8E0: @ 818B8E0 ldrh r0, [r0] movs r5, 0x64 muls r0, r5 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 bl sub_805DD7C ldrb r0, [r6] @@ -12239,7 +12239,7 @@ sub_818B8E0: @ 818B8E0 muls r0, r5 adds r0, r4 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 @@ -12358,7 +12358,7 @@ sub_818B9FC: @ 818B9FC ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 bl sub_805DD7C ldrb r0, [r5] @@ -12404,16 +12404,16 @@ sub_818BA6C: @ 818BA6C ldrh r1, [r2] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData mov r8, r0 lsls r0, 16 lsrs r0, 16 mov r8, r0 ldr r0, =sub_805D714 - bl object_new_hidden_with_callback + bl CreateInvisibleSpriteWithCallback ldr r1, =gUnknown_03005D7C mov r9, r1 add r9, r6 @@ -12676,7 +12676,7 @@ sub_818BD04: @ 818BD04 mov r7, r9 mov r6, r8 push {r6,r7} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 18 @@ -12707,7 +12707,7 @@ _0818BD48: _0818BD4A: ldrb r4, [r0, 0x13] _0818BD4C: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r2, 0x40 ands r1, r2 @@ -12761,7 +12761,7 @@ _0818BD9E: bne _0818BDC0 b _0818BEDC _0818BDC0: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] bl sub_806F000 @@ -13104,7 +13104,7 @@ _0818C0B8: ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 bl sub_805E990 movs r1, 0x40 @@ -13573,7 +13573,7 @@ _0818C4C6: thumb_func_start sub_818C4D8 sub_818C4D8: @ 818C4D8 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 10 @@ -13617,7 +13617,7 @@ sub_818C52C: @ 818C52C thumb_func_start sub_818C538 sub_818C538: @ 818C538 push {r4,r5,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 10 @@ -13733,10 +13733,10 @@ sub_818C5E8: @ 818C5E8 ldrh r0, [r0] movs r5, 0x64 muls r0, r5 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData mov r8, r0 mov r1, r9 ldrb r0, [r1] @@ -13746,7 +13746,7 @@ sub_818C5E8: @ 818C5E8 muls r0, r5 adds r0, r4 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r3, r0, 0 mov r1, r9 ldrb r0, [r1] @@ -13765,10 +13765,10 @@ _0818C678: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData adds r2, r0, 0 mov r1, r9 ldrb r0, [r1] @@ -13830,7 +13830,7 @@ sub_818C6F4: @ 818C6F4 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 movs r2, 0x9 bl healthbar_draw_field_maybe @@ -14198,10 +14198,10 @@ sub_818C9F0: @ 818C9F0 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 movs r1, 0x19 @@ -14318,7 +14318,7 @@ sub_818CA64: @ 818CA64 bl AllocObjectPalette lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 18 @@ -14336,7 +14336,7 @@ sub_818CA64: @ 818CA64 b _0818CB5A .pool _0818CB54: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] _0818CB5A: @@ -14451,7 +14451,7 @@ _0818CC50: lsls r0, 24 cmp r0, 0 beq _0818CC70 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -14504,7 +14504,7 @@ _0818CCA0: ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 bl sub_805DD7C ldrb r0, [r7] @@ -16115,7 +16115,7 @@ _0818D9A2: thumb_func_start sub_818D9AC sub_818D9AC: @ 818D9AC - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003b58 adds r0, r1 @@ -16141,7 +16141,7 @@ sub_818D9C0: @ 818D9C0 lsrs r0, 24 cmp r0, 0x2 bne _0818DA20 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =0x00003b58 adds r1, r0 @@ -16170,7 +16170,7 @@ _0818DA24: thumb_func_start sub_818DA30 sub_818DA30: @ 818DA30 push {lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r1, [r0, 0xB] lsls r1, 8 @@ -16239,7 +16239,7 @@ _0818DAA6: thumb_func_start sub_818DAAC sub_818DAAC: @ 818DAAC push {lr} - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -16308,7 +16308,7 @@ _0818DB14: thumb_func_start sub_818DB20 sub_818DB20: @ 818DB20 push {r4-r6,lr} - bl GenerateRandomNumber + bl Random ldr r5, =gUnknown_0203CD64 ldr r4, [r5] lsls r0, 16 @@ -16326,7 +16326,7 @@ sub_818DB20: @ 818DB20 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r4, 0 @@ -16351,7 +16351,7 @@ sub_818DB20: @ 818DB20 sub_818DB7C: @ 818DB7C push {lr} ldr r2, =gUnknown_0203CD64 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003b58 adds r0, r1 @@ -16370,7 +16370,7 @@ sub_818DB7C: @ 818DB7C strb r3, [r0, 0x3] ldr r1, [r2] strh r3, [r1, 0xE] - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r1, 0x12] bl sub_818DB20 @@ -16382,7 +16382,7 @@ sub_818DB7C: @ 818DB7C thumb_func_start sub_818DBC4 sub_818DBC4: @ 818DBC4 ldr r3, =gUnknown_0203CD64 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003b58 adds r0, r1 @@ -16400,7 +16400,7 @@ sub_818DBC4: @ 818DBC4 sub_818DBE8: @ 818DBE8 push {lr} ldr r1, =gUnknown_0203CD64 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 @@ -16438,17 +16438,17 @@ sub_818DC1C: @ 818DC1C sub_818DC2C: @ 818DC2C push {r4,lr} ldr r1, =gUnknown_0203CD64 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 str r0, [r1] - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 ldrb r0, [r0, 0xC] bl sub_818DC1C adds r1, r0, 0 adds r0, r4, 0 - bl CopyString + bl StringCopy pop {r4} pop {r0} bx r0 @@ -16459,7 +16459,7 @@ sub_818DC2C: @ 818DC2C sub_818DC60: @ 818DC60 push {r4,r5,lr} ldr r5, =gUnknown_0203CD64 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r2, =0x00003b58 adds r0, r1, r2 @@ -16471,15 +16471,15 @@ sub_818DC60: @ 818DC60 b _0818DC9C .pool _0818DC84: - ldr r4, =gUnknown_02021EC4 + ldr r4, =gStringVar3 ldr r0, =0x00003b5c adds r1, r0 adds r0, r4, 0 - bl CopyString_Limit7 + bl StringCopy7 ldr r0, [r5] ldrb r1, [r0, 0x12] adds r0, r4, 0 - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString movs r0, 0x1 _0818DC9C: pop {r4,r5} @@ -16497,7 +16497,7 @@ sub_818DCAC: @ 818DCAC bl itemid_get_item adds r1, r0, 0 adds r0, r4, 0 - bl CopyString + bl StringCopy pop {r4} pop {r0} bx r0 @@ -16507,12 +16507,12 @@ sub_818DCAC: @ 818DCAC sub_818DCC8: @ 818DCC8 push {lr} ldr r2, =gUnknown_0203CD64 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =0x00003b58 adds r1, r0 str r1, [r2] - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r1, [r1, 0xE] bl sub_818DCAC pop {r0} @@ -16531,7 +16531,7 @@ sub_818DCF4: @ 818DCF4 bl memset adds r0, r4, 0 adds r1, r5, 0 - bl CopyString_Limit7 + bl StringCopy7 pop {r4,r5} pop {r0} bx r0 @@ -16541,20 +16541,20 @@ sub_818DCF4: @ 818DCF4 sub_818DD14: @ 818DD14 push {r4,r5,lr} ldr r5, =gUnknown_0203CD64 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00003b58 adds r1, r0, r2 str r1, [r5] ldr r1, =0x00003b5c adds r0, r1 - ldr r4, =gUnknown_02021EC4 + ldr r4, =gStringVar3 adds r1, r4, 0 bl sub_818DCF4 ldr r0, [r5] ldrb r1, [r0, 0x12] adds r0, r4, 0 - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString pop {r4,r5} pop {r0} bx r0 @@ -16564,7 +16564,7 @@ sub_818DD14: @ 818DD14 thumb_func_start sub_818DD54 sub_818DD54: @ 818DD54 ldr r1, =gUnknown_0203CD64 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 @@ -16593,7 +16593,7 @@ sub_818DD84: @ 818DD84 lsls r0, 16 lsrs r5, r0, 16 ldr r4, =gUnknown_0203CD64 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003b58 adds r0, r1 @@ -16610,17 +16610,17 @@ sub_818DD84: @ 818DD84 ldr r1, [r4] movs r0, 0x1 strb r0, [r1, 0x1] - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r5, 0 bl sub_818DCAC ldr r1, [r4] strh r5, [r1, 0xE] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r1, 0x4 bl sub_818DCF4 ldr r1, [r4] - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r1, 0x12] movs r7, 0 @@ -16687,7 +16687,7 @@ sub_818DE44: @ 818DE44 sub_818DE5C: @ 818DE5C push {lr} ldr r1, =gUnknown_0203CD64 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 @@ -16710,7 +16710,7 @@ sub_818DE88: @ 818DE88 adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 bl sub_818DCAC pop {r0} bx r0 @@ -16721,7 +16721,7 @@ sub_818DE88: @ 818DE88 sub_818DEA0: @ 818DEA0 push {r4,r5,lr} ldr r5, =gUnknown_0203CD64 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003b58 adds r0, r1 @@ -16767,7 +16767,7 @@ sub_818DEF4: @ 818DEF4 thumb_func_start sub_818DF00 sub_818DF00: @ 818DF00 push {r4-r7,lr} - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r4, r0, 16 movs r0, 0xF @@ -16817,7 +16817,7 @@ _0818DF1A: sub_818DF68: @ 818DF68 push {r4-r6,lr} ldr r2, =gUnknown_0203CD68 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003b58 adds r0, r1 @@ -16828,7 +16828,7 @@ sub_818DF68: @ 818DF68 strb r1, [r0, 0x1] movs r3, 0 adds r4, r2, 0 - ldr r6, =gUnknown_82E9531 + ldr r6, =gGameLanguage adds r5, r4, 0 ldr r0, =0x0000ffff adds r2, r0, 0 @@ -16889,7 +16889,7 @@ _0818DFB4: thumb_func_start sub_818E004 sub_818E004: @ 818E004 ldr r2, =gUnknown_0203CD68 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003b58 adds r0, r1 @@ -16912,7 +16912,7 @@ sub_818E004: @ 818E004 sub_818E038: @ 818E038 push {lr} ldr r1, =gUnknown_0203CD68 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 @@ -16942,7 +16942,7 @@ sub_818E06C: @ 818E06C mov r6, r9 mov r5, r8 push {r5-r7} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r4, [r0] ldr r0, =0x00003b58 adds r7, r4, r0 @@ -17038,7 +17038,7 @@ sub_818E13C: @ 818E13C push {r4-r7,lr} movs r7, 0x1 ldr r5, =gUnknown_0203CD68 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r2, =0x00003b58 adds r0, r1, r2 @@ -17046,29 +17046,29 @@ sub_818E13C: @ 818E13C ldrb r0, [r0, 0x18] cmp r0, 0xFF bne _0818E174 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EEB7E - bl CopyString_Limit7 + bl StringCopy7 movs r7, 0 b _0818E1DC .pool _0818E174: - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 ldr r0, =0x00003b70 adds r1, r0 adds r0, r4, 0 - bl CopyString_Limit7 + bl StringCopy7 ldr r0, [r5] adds r0, 0x2D ldrb r1, [r0] adds r0, r4, 0 - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString ldr r0, [r5] adds r0, 0x18 bl sub_818E258 lsls r0, 24 lsrs r4, r0, 24 - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r0, [r6] bl sub_818E258 lsls r0, 24 @@ -17094,7 +17094,7 @@ _0818E1BA: ldr r1, [r0] adds r1, 0x18 adds r1, r2 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, r2 ldrb r1, [r1] @@ -17115,7 +17115,7 @@ _0818E1DC: sub_818E1F4: @ 818E1F4 push {r4-r6,lr} ldr r3, =gUnknown_0203CD68 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r2, =0x00003b58 adds r0, r1, r2 @@ -17124,7 +17124,7 @@ sub_818E1F4: @ 818E1F4 movs r4, 0 ldr r0, =0x00003b78 adds r1, r0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldrh r1, [r1] adds r6, r3, 0 @@ -17182,14 +17182,14 @@ _0818E268: thumb_func_start sub_818E274 sub_818E274: @ 818E274 push {r4,lr} - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 ldr r0, =gUnknown_0203CD68 ldr r0, [r0] ldrh r0, [r0, 0x28] bl itemid_get_item adds r1, r0, 0 adds r0, r4, 0 - bl CopyString + bl StringCopy pop {r4} pop {r0} bx r0 @@ -17200,7 +17200,7 @@ sub_818E274: @ 818E274 sub_818E298: @ 818E298 push {r4,lr} ldr r4, =gUnknown_0203CD68 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003b58 adds r0, r1 @@ -17214,7 +17214,7 @@ sub_818E298: @ 818E298 .pool _0818E2C0: ldr r0, [r4] - ldr r1, =gUnknown_82E9531 + ldr r1, =gGameLanguage ldrb r1, [r1] adds r0, 0x2D strb r1, [r0] @@ -17229,7 +17229,7 @@ _0818E2CC: thumb_func_start sub_818E2D8 sub_818E2D8: @ 818E2D8 ldr r2, =gUnknown_0203CD68 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r3, =0x00003b58 adds r1, r0, r3 @@ -17253,23 +17253,23 @@ sub_818E2FC: @ 818E2FC sub_818E308: @ 818E308 push {r4-r6,lr} ldr r5, =gUnknown_0203CD68 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003b58 adds r0, r1 str r0, [r5] - ldr r6, =gUnknown_02021CC4 + ldr r6, =gStringVar1 ldrh r1, [r0, 0x14] adds r0, r6, 0 bl CopyEasyChatWord - ldr r4, =gUnknown_02021DC4 + ldr r4, =gStringVar2 ldr r0, [r5] ldrh r1, [r0, 0x16] adds r0, r4, 0 bl CopyEasyChatWord adds r0, r6, 0 adds r1, r4, 0 - bl CompareString + bl StringCompare movs r1, 0 cmp r0, 0 bne _0818E33C @@ -17285,7 +17285,7 @@ _0818E33C: thumb_func_start sub_818E358 sub_818E358: @ 818E358 ldr r1, =gUnknown_0203CD68 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 @@ -17300,7 +17300,7 @@ sub_818E358: @ 818E358 thumb_func_start sub_818E37C sub_818E37C: @ 818E37C ldr r1, =gUnknown_0203CD68 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 @@ -17314,7 +17314,7 @@ sub_818E37C: @ 818E37C thumb_func_start sub_818E39C sub_818E39C: @ 818E39C ldr r1, =gUnknown_0203CD68 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 @@ -17328,7 +17328,7 @@ sub_818E39C: @ 818E39C thumb_func_start sub_818E3BC sub_818E3BC: @ 818E3BC ldr r1, =gUnknown_0203CD68 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 @@ -17351,7 +17351,7 @@ sub_818E3E0: @ 818E3E0 sub_818E3EC: @ 818E3EC push {r4,lr} ldr r4, =gUnknown_0203CD68 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003b58 adds r0, r1 @@ -17383,7 +17383,7 @@ _0818E422: sub_818E430: @ 818E430 push {r4,r5,lr} ldr r1, =gUnknown_0203CD68 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 @@ -17443,7 +17443,7 @@ sub_818E490: @ 818E490 sub_818E4A4: @ 818E4A4 push {r4-r6,lr} ldr r2, =gUnknown_0203CD68 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003b58 adds r0, r1 @@ -17453,7 +17453,7 @@ sub_818E4A4: @ 818E4A4 strh r1, [r0, 0x28] movs r3, 0 adds r4, r2, 0 - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr adds r5, r4, 0 adds r2, r6, 0 _0818E4C2: @@ -17474,9 +17474,9 @@ _0818E4C2: ldr r0, [r4] adds r0, 0x18 ldr r1, [r6] - bl CopyString_Limit7 + bl StringCopy7 ldr r0, [r4] - ldr r1, =gUnknown_82E9531 + ldr r1, =gGameLanguage ldrb r1, [r1] adds r0, 0x2D strb r1, [r0] @@ -17489,7 +17489,7 @@ _0818E4C2: thumb_func_start sub_818E510 sub_818E510: @ 818E510 ldr r2, =gUnknown_0203CD68 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r3, =0x00003b58 adds r1, r0, r3 @@ -17506,12 +17506,12 @@ sub_818E510: @ 818E510 sub_818E538: @ 818E538 push {lr} ldr r2, =gUnknown_0203CD68 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =0x00003b58 adds r1, r0 str r1, [r2] - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldrh r1, [r1, 0x14] bl CopyEasyChatWord pop {r0} @@ -17531,7 +17531,7 @@ sub_818E564: @ 818E564 sub_818E570: @ 818E570 push {r4-r7,lr} ldr r2, =gUnknown_0203CD68 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r1, [r1] ldr r4, =0x00003b58 adds r3, r1, r4 @@ -17553,7 +17553,7 @@ sub_818E570: @ 818E570 bne _0818E5E4 adds r4, r7, 0 _0818E59E: - bl GenerateRandomNumber + bl Random ldr r2, [r4] lsls r0, 16 lsrs r0, 16 @@ -17614,7 +17614,7 @@ sub_818E604: @ 818E604 strb r1, [r0, 0x3] ldr r0, [r4] strb r1, [r0, 0xC] - bl GenerateRandomNumber + bl Random ldr r4, [r4] lsls r0, 16 lsrs r0, 16 @@ -17631,7 +17631,7 @@ sub_818E604: @ 818E604 sub_818E638: @ 818E638 push {r4,lr} ldr r4, =gUnknown_0203CD6C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003b58 adds r0, r1 @@ -17643,7 +17643,7 @@ sub_818E638: @ 818E638 strb r2, [r0, 0x1] bl sub_818E604 ldr r1, [r4] - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r1, 0xE] pop {r4} @@ -17656,7 +17656,7 @@ sub_818E638: @ 818E638 sub_818E674: @ 818E674 push {lr} ldr r2, =gUnknown_0203CD6C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003b58 adds r0, r1 @@ -17687,7 +17687,7 @@ sub_818E6B0: @ 818E6B0 lsls r0, 24 lsrs r2, r0, 24 ldr r4, =gUnknown_0203CD6C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r3, =0x00003b58 adds r1, r0, r3 @@ -17702,13 +17702,13 @@ sub_818E6B0: @ 818E6B0 movs r2, 0x8 bl memset ldr r1, [r4] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr adds r1, 0x4 ldr r0, [r0] ldm r0!, {r2,r3} stm r1!, {r2,r3} ldr r1, [r4] - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r1, 0xE] _0818E6EA: @@ -17725,7 +17725,7 @@ sub_818E704: @ 818E704 movs r3, 0 movs r4, 0 ldr r1, =gUnknown_0203CD6C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r5, =0x00003b58 adds r0, r5 @@ -17795,7 +17795,7 @@ sub_818E794: @ 818E794 push {r4,r5,lr} adds r5, r1, 0 ldr r4, =gUnknown_0203CD6C - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r1, [r1] ldr r2, =0x00003b58 adds r1, r2 @@ -17805,7 +17805,7 @@ sub_818E794: @ 818E794 lsls r1, 2 adds r1, r2 ldr r1, [r1] - bl CopyString + bl StringCopy ldr r1, =gUnknown_0860B310 ldr r0, [r4] ldrb r0, [r0, 0xD] @@ -17813,7 +17813,7 @@ sub_818E794: @ 818E794 adds r0, r1 ldr r1, [r0] adds r0, r5, 0 - bl CopyString_Limit10 + bl StringCopy10 pop {r4,r5} pop {r0} bx r0 @@ -17825,7 +17825,7 @@ sub_818E7E0: @ 818E7E0 push {r4,lr} adds r3, r1, 0 ldr r2, =gUnknown_0203CD6C - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r1, [r1] ldr r4, =0x00003b58 adds r1, r4 @@ -17838,7 +17838,7 @@ sub_818E7E0: @ 818E7E0 adds r0, r2 ldr r1, [r0] adds r0, r3, 0 - bl CopyString + bl StringCopy pop {r4} pop {r0} bx r0 @@ -17849,14 +17849,14 @@ sub_818E7E0: @ 818E7E0 sub_818E81C: @ 818E81C push {r4,lr} ldr r3, =gUnknown_0203CD6C - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r1, [r1] ldr r4, =0x00003b58 adds r2, r1, r4 str r2, [r3] ldr r2, =0x00003b5c adds r1, r2 - bl CopyString + bl StringCopy pop {r4} pop {r0} bx r0 @@ -17866,7 +17866,7 @@ sub_818E81C: @ 818E81C thumb_func_start sub_818E848 sub_818E848: @ 818E848 ldr r2, =gUnknown_0203CD6C - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r1, [r1] ldr r3, =0x00003b58 adds r1, r3 @@ -17885,7 +17885,7 @@ sub_818E868: @ 818E868 lsrs r1, 22 adds r1, r2 ldr r1, [r1] - bl CopyString + bl StringCopy pop {r0} bx r0 .pool @@ -17895,7 +17895,7 @@ sub_818E868: @ 818E868 sub_818E880: @ 818E880 push {lr} ldr r1, =gUnknown_0203CD6C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 @@ -17922,7 +17922,7 @@ _0818E8AE: sub_818E8B4: @ 818E8B4 push {lr} ldr r1, =gUnknown_0203CD6C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 @@ -17945,7 +17945,7 @@ sub_818E8E0: @ 818E8E0 push {r4,lr} movs r3, 0 ldr r1, =gUnknown_0203CD6C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r4, =0x00003b58 adds r2, r0, r4 @@ -17969,8 +17969,8 @@ _0818E8FE: thumb_func_start sub_818E914 sub_818E914: @ 818E914 push {lr} - ldr r0, =gUnknown_02021DC4 - ldr r1, =gUnknown_02021CC4 + ldr r0, =gStringVar2 + ldr r1, =gStringVar1 bl sub_818E794 pop {r0} bx r0 @@ -17991,7 +17991,7 @@ sub_818E92C: @ 818E92C thumb_func_start sub_818E940 sub_818E940: @ 818E940 ldr r1, =gUnknown_0203CD6C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 @@ -18005,7 +18005,7 @@ sub_818E940: @ 818E940 thumb_func_start sub_818E960 sub_818E960: @ 818E960 ldr r1, =gUnknown_0203CD6C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 @@ -18024,7 +18024,7 @@ sub_818E960: @ 818E960 thumb_func_start sub_818E990 sub_818E990: @ 818E990 ldr r1, =gUnknown_0203CD6C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 @@ -18052,7 +18052,7 @@ sub_818E9AC: @ 818E9AC thumb_func_start sub_818E9CC sub_818E9CC: @ 818E9CC push {r4-r7,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =0x00000ca9 adds r0, r1 @@ -18108,7 +18108,7 @@ sub_818E9CC: @ 818E9CC adds r1, r0 strh r6, [r1] _0818EA3E: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x4 ldrsb r1, [r0, r1] @@ -18129,7 +18129,7 @@ _0818EA3E: thumb_func_start sub_818EA84 sub_818EA84: @ 818EA84 push {r4-r6,lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 @@ -18166,7 +18166,7 @@ _0818EAC8: .4byte _0818ECF4 _0818EAF0: ldr r3, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r5, 1 lsls r2, r6, 2 @@ -18180,7 +18180,7 @@ _0818EAF0: .pool _0818EB14: ldr r4, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r3, =0x00000cdc adds r2, r3 @@ -18200,7 +18200,7 @@ _0818EB14: .pool _0818EB48: ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000d08 adds r0, r2 @@ -18210,7 +18210,7 @@ _0818EB48: .pool _0818EB64: ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r3, =0x00000d08 adds r0, r3 @@ -18220,7 +18220,7 @@ _0818EB64: .pool _0818EB80: ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000d08 adds r0, r2 @@ -18228,7 +18228,7 @@ _0818EB80: .pool _0818EB98: ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r3, =0x00000d08 adds r0, r3 @@ -18246,7 +18246,7 @@ _0818EBB4: cmp r5, 0 beq _0818EBE8 ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000d08 adds r0, r2 @@ -18256,7 +18256,7 @@ _0818EBB4: .pool _0818EBE8: ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r3, =0x00000d08 adds r0, r3 @@ -18268,7 +18268,7 @@ _0818EC04: cmp r5, 0 beq _0818EC24 ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000d08 adds r0, r2 @@ -18278,7 +18278,7 @@ _0818EC04: .pool _0818EC24: ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r3, =0x00000d08 adds r0, r3 @@ -18296,7 +18296,7 @@ _0818EC40: cmp r5, 0 beq _0818EC74 ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000d08 adds r0, r2 @@ -18307,7 +18307,7 @@ _0818EC40: .pool _0818EC74: ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r3, =0x00000d08 adds r0, r3 @@ -18319,7 +18319,7 @@ _0818EC90: cmp r5, 0 beq _0818ECB0 ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000d08 adds r0, r2 @@ -18329,7 +18329,7 @@ _0818EC90: .pool _0818ECB0: ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r3, =0x00000d08 adds r0, r3 @@ -18344,7 +18344,7 @@ _0818ECBE: _0818ECD0: bl sub_81B8558 ldr r2, =gUnknown_0203CEF8 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r1, 0xCB lsls r1, 4 @@ -18358,7 +18358,7 @@ _0818ECD0: .pool _0818ECF4: ldr r2, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r3, =0x00000d0a adds r0, r1, r3 @@ -18381,7 +18381,7 @@ _0818ED10: thumb_func_start sub_818ED28 sub_818ED28: @ 818ED28 push {r4,r5,lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 @@ -18416,7 +18416,7 @@ _0818ED6C: .4byte _0818EF50 .4byte _0818F008 _0818ED90: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] lsls r0, r4, 1 lsls r1, r5, 2 @@ -18434,7 +18434,7 @@ _0818EDB4: ldrh r0, [r0] cmp r0, 0 beq _0818EDE8 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r0, =0x00000cdc adds r2, r0 @@ -18450,7 +18450,7 @@ _0818EDB4: b _0818F01E .pool _0818EDE8: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r1, =0x00000cdc adds r2, r1 @@ -18466,7 +18466,7 @@ _0818EDE8: b _0818F01E .pool _0818EE10: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r0, =gUnknown_020375E4 ldrb r0, [r0] @@ -18480,7 +18480,7 @@ _0818EE10: b _0818EF74 .pool _0818EE34: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] ldr r0, =gUnknown_020375E4 ldrb r0, [r0] @@ -18495,7 +18495,7 @@ _0818EE34: b _0818EFF4 .pool _0818EE5C: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] ldr r0, =gUnknown_020375E4 ldrb r0, [r0] @@ -18504,7 +18504,7 @@ _0818EE5C: b _0818EFE8 .pool _0818EE78: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] ldr r0, =gUnknown_020375E4 ldrb r0, [r0] @@ -18527,7 +18527,7 @@ _0818EEA0: bne _0818EF00 cmp r4, 0 beq _0818EEDC - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] ldr r0, =gUnknown_020375E4 ldrb r0, [r0] @@ -18541,7 +18541,7 @@ _0818EEA0: b _0818EFF4 .pool _0818EEDC: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] ldr r0, =gUnknown_020375E4 ldrb r0, [r0] @@ -18557,7 +18557,7 @@ _0818EEDC: _0818EF00: cmp r4, 0 beq _0818EF2C - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] ldr r0, =gUnknown_020375E4 ldrb r0, [r0] @@ -18572,7 +18572,7 @@ _0818EF00: b _0818EFF4 .pool _0818EF2C: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r0, =gUnknown_020375E4 ldrb r0, [r0] @@ -18594,7 +18594,7 @@ _0818EF50: bne _0818EFB0 cmp r4, 0 beq _0818EF8C - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r0, =gUnknown_020375E4 ldrb r1, [r0] @@ -18610,7 +18610,7 @@ _0818EF74: b _0818F01E .pool _0818EF8C: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] ldr r0, =gUnknown_020375E4 ldrb r0, [r0] @@ -18626,7 +18626,7 @@ _0818EF8C: _0818EFB0: cmp r4, 0 beq _0818EFDC - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] ldr r0, =gUnknown_020375E4 ldrb r0, [r0] @@ -18641,7 +18641,7 @@ _0818EFB0: b _0818EFF4 .pool _0818EFDC: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] ldr r0, =gUnknown_020375E4 ldrb r0, [r0] @@ -18661,7 +18661,7 @@ _0818EFF4: b _0818F01E .pool _0818F008: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r0, =gUnknown_0203CEF8 ldrb r1, [r0] @@ -18697,7 +18697,7 @@ sub_818F02C: @ 818F02C movs r0, 0x18 bl AllocZeroed str r0, [sp, 0x1C] - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r1, [r4] ldr r2, =0x00000ca9 adds r0, r1, r2 @@ -18761,7 +18761,7 @@ _0818F0BA: add r0, r9 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData mov r5, r8 ldr r1, [r5] ldr r7, =0x00000d64 @@ -18785,7 +18785,7 @@ _0818F0E8: adds r1, r5, 0 adds r1, 0xD movs r2, 0 - bl pokemon_getattr + bl GetMonData mov r2, r8 ldr r1, [r2] ldr r3, =0x00000efc @@ -18797,7 +18797,7 @@ _0818F0E8: cmp r5, 0x3 ble _0818F0E8 movs r5, 0 - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr _0818F11C: ldr r0, [r6] ldr r1, =0x00000caa @@ -18810,7 +18810,7 @@ _0818F11C: adds r1, r5, 0 adds r1, 0x1A movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r1, [r6] adds r2, r5, r7 ldr r3, =0x00000f04 @@ -18861,7 +18861,7 @@ _0818F184: movs r5, 0x1 cmp r5, r10 bge _0818F1CA - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r0, [r3] ldr r7, =0x00000d28 adds r0, r7 @@ -18888,7 +18888,7 @@ _0818F1B2: _0818F1CA: cmp r5, r10 bne _0818F184 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] ldr r1, [sp, 0x34] adds r3, r1 @@ -18915,7 +18915,7 @@ _0818F22C: movs r5, 0x1 cmp r5, r10 bge _0818F274 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] ldr r2, =0x00000d28 adds r0, r2 @@ -18942,7 +18942,7 @@ _0818F25C: _0818F274: cmp r5, r10 bne _0818F22C - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r3, [r5] ldr r7, [sp, 0x34] adds r3, r7 @@ -18980,7 +18980,7 @@ _0818F2AE: movs r7, 0 cmp r7, r5 bge _0818F300 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, [sp, 0x8] mov r8, r1 @@ -19016,7 +19016,7 @@ _0818F2D4: _0818F300: cmp r7, r5 bne _0818F2AE - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r0, [r3] ldr r1, [sp, 0x38] add r1, r9 @@ -19047,7 +19047,7 @@ _0818F300: adds r1, r3, 0 ands r0, r1 strb r0, [r2] - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r2, [r5] adds r2, r7 ldr r7, =0x00000d25 @@ -19082,10 +19082,10 @@ _0818F37C: strh r7, [r2] movs r3, 0 mov r10, r3 - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable ldr r5, =gBaseStats _0818F38A: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] mov r2, r10 lsls r1, r2, 1 @@ -19096,12 +19096,12 @@ _0818F38A: subs r4, r0, 0x1 movs r0, 0x64 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x3B movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r2, [sp, 0x18] ldrh r1, [r2] adds r1, r0 @@ -19109,7 +19109,7 @@ _0818F38A: adds r0, r4, 0 movs r1, 0x3C movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r3, [sp, 0x18] ldrh r1, [r3] adds r1, r0 @@ -19117,7 +19117,7 @@ _0818F38A: adds r0, r4, 0 movs r1, 0x3E movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r2, [sp, 0x18] ldrh r1, [r2] adds r1, r0 @@ -19125,7 +19125,7 @@ _0818F38A: adds r0, r4, 0 movs r1, 0x3F movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r3, [sp, 0x18] ldrh r1, [r3] adds r1, r0 @@ -19133,7 +19133,7 @@ _0818F38A: adds r0, r4, 0 movs r1, 0x3D movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r2, [sp, 0x18] ldrh r1, [r2] adds r1, r0 @@ -19141,7 +19141,7 @@ _0818F38A: adds r0, r4, 0 movs r1, 0x3A movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r3, [sp, 0x18] ldrh r1, [r3] adds r1, r0 @@ -19149,7 +19149,7 @@ _0818F38A: adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r1, r0, 3 subs r1, r0 lsls r1, 2 @@ -19162,7 +19162,7 @@ _0818F38A: adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r1, r0, 3 subs r1, r0 lsls r1, 2 @@ -19213,7 +19213,7 @@ _0818F462: _0818F494: movs r7, 0 strh r7, [r6] - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] mov r2, r10 lsls r1, r2, 2 @@ -19231,7 +19231,7 @@ _0818F494: ldr r0, [sp, 0x30] mov r9, r0 _0818F4BC: - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] mov r4, r9 add r4, r10 @@ -19269,7 +19269,7 @@ _0818F4BC: ldr r1, [r2] adds r0, r1 strh r0, [r6] - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r0, [r3] ldr r1, =0x00000d64 adds r0, r1 @@ -19287,7 +19287,7 @@ _0818F4BC: adds r1, r3 ldrb r0, [r1, 0x6] lsls r0, 2 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable adds r0, r2 ldr r0, [r0] orrs r7, r0 @@ -19353,7 +19353,7 @@ _0818F5A0: bcc _0818F5C2 cmp r1, r0 bne _0818F61E - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] lsls r0, r5, 2 adds r0, r1, r0 @@ -19403,7 +19403,7 @@ _0818F626: beq _0818F6EE movs r3, 0 mov r10, r3 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r4, =0x00000d24 adds r1, r4 @@ -19473,7 +19473,7 @@ _0818F6CC: lsls r0, r1, 24 lsrs r0, 24 bl sub_81A4FF0 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] ldr r2, =0x00000d64 adds r1, r2 @@ -19761,7 +19761,7 @@ sub_818F904: @ 818F904 ldrh r3, [r2] strh r3, [r4] strh r5, [r2] - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r5, [r2] lsls r6, r0, 2 adds r6, r5, r6 @@ -19792,7 +19792,7 @@ sub_818F904: @ 818F904 mov r7, r8 orrs r3, r7 strh r3, [r5] - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr mov r8, r2 add r12, r0 add r9, r1 @@ -19830,9 +19830,9 @@ _0818F974: thumb_func_start sub_818F9B0 sub_818F9B0: @ 818F9B0 push {lr} - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r2, =gUnknown_085CCD20 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] ldr r3, =0x00000cb2 adds r1, r3 @@ -19840,7 +19840,7 @@ sub_818F9B0: @ 818F9B0 lsls r1, 2 adds r1, r2 ldr r1, [r1] - bl CopyString + bl StringCopy pop {r0} bx r0 .pool @@ -19849,9 +19849,9 @@ sub_818F9B0: @ 818F9B0 thumb_func_start sub_818F9E0 sub_818F9E0: @ 818F9E0 push {lr} - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r2, =gUnknown_085CCD20 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] ldr r3, =0x00000cb2 adds r1, r3 @@ -19859,8 +19859,8 @@ sub_818F9E0: @ 818F9E0 lsls r1, 2 adds r1, r2 ldr r1, [r1] - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 ldr r1, =gUnknown_02038BCA ldrh r1, [r1] bl sub_8195898 @@ -19875,18 +19875,18 @@ sub_818FA20: @ 818FA20 ldr r1, =gUnknown_0203CD70 movs r0, 0 str r0, [r1] - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4, 0 movs r1, 0x3A movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r5, =gUnknown_0203CD74 str r0, [r5] adds r4, 0x64 adds r0, r4, 0 movs r1, 0x3A movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r1, [r5] adds r1, r0 str r1, [r5] @@ -19940,9 +19940,9 @@ sub_818FA74: @ 818FA74 adds r3, r4, 0 muls r3, r0 str r3, [sp, 0x18] - ldr r6, =gUnknown_02024744 + ldr r6, =gEnemyParty adds r0, r3, r6 - ldr r7, =gUnknown_03005D90 + ldr r7, =gSaveBlock2Ptr ldr r4, [r7] lsls r5, 1 ldr r3, [sp, 0x28] @@ -19985,7 +19985,7 @@ sub_818FA74: @ 818FA74 mov r4, r10 str r4, [sp, 0x20] _0818FB18: - ldr r7, =gUnknown_03005D90 + ldr r7, =gSaveBlock2Ptr ldr r1, [r7] ldr r2, [sp, 0x28] lsls r0, r2, 1 @@ -20008,12 +20008,12 @@ _0818FB18: lsrs r2, 24 mov r12, r2 ldr r7, [sp, 0x1C] - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty adds r0, r7, r2 mov r2, r12 str r3, [sp, 0x24] bl sub_80691F4 - ldr r7, =gUnknown_03005D90 + ldr r7, =gSaveBlock2Ptr ldr r0, [r7] add r0, r9 adds r0, r5 @@ -20038,13 +20038,13 @@ _0818FB74: ldr r1, [sp, 0x10] adds r4, r1, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 adds r0, r4, 0 movs r1, 0x20 add r2, sp, 0xC bl pokemon_setattr - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, [sp, 0x20] add r1, r8 @@ -20087,14 +20087,14 @@ sub_818FBDC: @ 818FBDC mov r0, r8 bl sub_818FC78 adds r5, r0, 0 - bl GenerateRandomNumber + bl Random adds r4, r0, 0 - bl GenerateRandomNumber + bl Random lsls r4, 16 lsrs r7, r4, 16 lsls r0, 16 orrs r7, r0 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xA @@ -20159,7 +20159,7 @@ sub_818FC78: @ 818FC78 lsls r0, 16 lsrs r4, r0, 16 adds r5, r4, 0 - bl GenerateRandomNumber + bl Random movs r1, 0x1 ands r1, r0 cmp r1, 0 @@ -20227,7 +20227,7 @@ _0818FCFA: adds r2, r7, 0x1 mov r10, r2 _0818FD00: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r2, [sp, 0x18] adds r0, r1, r2 @@ -20272,11 +20272,11 @@ _0818FD3C: _0818FD60: movs r0, 0x64 muls r0, r6 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 adds r0, r4, 0 movs r2, 0 @@ -20347,7 +20347,7 @@ _0818FDF6: adds r2, r7, 0x1 mov r10, r2 _0818FDFC: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r2, [sp, 0x18] adds r0, r1, r2 @@ -20392,11 +20392,11 @@ _0818FE38: _0818FE5C: movs r0, 0x64 muls r0, r6 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 adds r0, r4, 0 movs r2, 0x1 @@ -20460,10 +20460,10 @@ _0818FECE: cmp r1, 0 beq _0818FFAA movs r3, 0 - ldr r4, =gUnknown_0832A328 + ldr r4, =gBitTable _0818FEF0: str r3, [sp, 0x14] - bl GenerateRandomNumber + bl Random movs r1, 0x3 ands r1, r0 ldr r3, [sp, 0x14] @@ -20518,7 +20518,7 @@ _0818FF4E: bne _0818FF7A str r2, [sp, 0x10] str r3, [sp, 0x14] - bl GenerateRandomNumber + bl Random movs r1, 0x1 ands r1, r0 ldr r2, [sp, 0x10] @@ -20546,7 +20546,7 @@ _0818FF84: adds r3, 0x1 cmp r3, 0x1 ble _0818FF26 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable mov r1, sp movs r3, 0x1 _0818FF96: @@ -20849,7 +20849,7 @@ sub_81901A0: @ 81901A0 adds r3, r0, 0 adds r2, r1, 0 movs r5, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r4, =0x00000d24 adds r1, r4 @@ -20980,7 +20980,7 @@ sub_8190298: @ 8190298 thumb_func_start sub_81902AC sub_81902AC: @ 81902AC push {r4,lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r4, [r0] ldr r1, =0x00000cb2 adds r0, r4, r1 @@ -21015,7 +21015,7 @@ sub_81902E4: @ 81902E4 thumb_func_start sub_81902F8 sub_81902F8: @ 81902F8 push {r4,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =gUnknown_020375E2 ldrh r1, [r1] @@ -21043,7 +21043,7 @@ sub_81902F8: @ 81902F8 thumb_func_start sub_819033C sub_819033C: @ 819033C push {r4,r5,lr} - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r0, [r5] ldr r1, =0x00000ca9 adds r0, r1 @@ -22014,7 +22014,7 @@ sub_8190B40: @ 8190B40 adds r0, r1 ldrb r0, [r0] mov r10, r0 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r5, [r1] ldr r7, =0x00000cb2 adds r0, r5, r7 @@ -24586,13 +24586,13 @@ sub_819221C: @ 819221C adds r0, r5, r0 ldrb r0, [r0] mov r10, r0 - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r0, [r3] ldr r1, =0x00000cb2 adds r0, r1 ldrh r0, [r0] mov r8, r0 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldrh r4, [r1, 0x2E] movs r0, 0x3 ands r0, r4 @@ -24674,7 +24674,7 @@ _08192304: ands r0, r1 cmp r0, 0 beq _08192360 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r0, [r2] mov r3, r10 lsls r1, r3, 2 @@ -24698,7 +24698,7 @@ _08192304: strb r0, [r2, 0x10] movs r7, 0x4 _0819233C: - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r0, [r3] add r0, r12 ldr r1, =0x00000d25 @@ -24925,7 +24925,7 @@ sub_81924E0: @ 81924E0 movs r0, 0x24 bl AllocZeroed mov r8, r0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r3, [sp, 0x20] lsls r0, r3, 2 @@ -25065,7 +25065,7 @@ _08192624: ldr r1, [sp, 0x24] cmp r1, r0 bne _08192660 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000d64 adds r0, r2 @@ -25083,7 +25083,7 @@ _08192660: ldr r3, [sp, 0x24] cmp r3, r0 bne _08192690 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000d64 adds r0, r1 @@ -25097,7 +25097,7 @@ _08192660: b _081926B0 .pool _08192690: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r3, =0x00000d64 adds r0, r3 @@ -25229,7 +25229,7 @@ _081927A2: ldrb r0, [r0] cmp r0, 0xFF beq _081927CA - ldr r3, =gUnknown_02021CC4 + ldr r3, =gStringVar1 adds r0, r1, r2 adds r2, r7, r0 _081927BA: @@ -25242,7 +25242,7 @@ _081927BA: cmp r0, 0xFF bne _081927BA _081927CA: - ldr r5, =gUnknown_02021CC4 + ldr r5, =gStringVar1 adds r1, r7, r5 movs r0, 0 strb r0, [r1] @@ -25254,10 +25254,10 @@ _081927CA: ldr r2, [sp, 0x24] cmp r2, r0 bne _08192800 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r0, r5, 0 - bl AppendString + bl StringAppend b _08192836 .pool _08192800: @@ -25265,26 +25265,26 @@ _08192800: ldr r3, [sp, 0x24] cmp r3, r0 bne _08192824 - ldr r4, =gUnknown_02021DC4 + ldr r4, =gStringVar2 adds r0, r4, 0 bl sub_8195938 adds r0, r5, 0 adds r1, r4, 0 - bl AppendString + bl StringAppend b _08192836 .pool _08192824: - ldr r4, =gUnknown_02021DC4 + ldr r4, =gStringVar2 ldr r1, [sp, 0x24] adds r0, r4, 0 bl sub_8195898 adds r0, r5, 0 adds r1, r4, 0 - bl AppendString + bl StringAppend _08192836: add r0, sp, 0xC ldrb r0, [r0, 0x5] - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 add r1, sp, 0xC ldrb r3, [r1, 0xA] adds r1, r4, 0 @@ -25329,7 +25329,7 @@ _0819288A: ldr r4, [sp, 0x24] cmp r4, r0 bne _081928C0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] lsls r0, r7, 1 add r0, r9 @@ -25342,7 +25342,7 @@ _081928C0: ldr r4, [sp, 0x24] cmp r4, r0 bne _081928E4 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] lsls r0, r7, 1 add r0, r9 @@ -25351,7 +25351,7 @@ _081928C0: b _081928FA .pool _081928E4: - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r1, [r4] lsls r0, r7, 1 add r0, r9 @@ -25482,7 +25482,7 @@ _08192A00: ldr r1, [sp, 0x24] cmp r1, r0 bne _08192A20 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000efc adds r0, r1 @@ -25490,7 +25490,7 @@ _08192A00: b _08192A48 .pool _08192A20: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] mov r12, r0 ldr r0, [sp, 0x3C] @@ -25616,7 +25616,7 @@ _08192AF0: b _08192B34 .pool _08192B24: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r7, 4 adds r1, r5, r1 @@ -25650,7 +25650,7 @@ _08192B4C: b _08192B7E .pool _08192B70: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r7, 4 adds r0, r1 @@ -25749,7 +25749,7 @@ _08192C24: mov r9, r0 movs r7, 0x2 _08192C34: - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r0, [r3] ldr r4, =0x00000d64 adds r0, r4 @@ -25783,7 +25783,7 @@ _08192C60: adds r1, r6, 0 bl __divsi3 adds r6, r0, 0 - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r0, [r3] ldr r4, =0x00000d64 adds r0, r4 @@ -25817,7 +25817,7 @@ _08192C9C: movs r5, 0 mov r4, r8 _08192CB4: - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] ldr r2, =0x00000d64 adds r0, r2 @@ -26150,7 +26150,7 @@ sub_8192F08: @ 8192F08 adds r3, r2, 0 cmp r6, r0 bge _08192FD4 - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r1, =0x000003ff mov r10, r1 ldr r2, =0x000003fe @@ -26180,22 +26180,22 @@ _08192F42: lsrs r0, r1, 22 cmp r0, r10 bne _08192F9C - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r2, 0 - bl CopyString + bl StringCopy b _08192FB8 .pool _08192F9C: lsrs r0, r1, 22 cmp r0, r9 bne _08192FB0 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 bl sub_8195938 b _08192FB8 .pool _08192FB0: lsrs r1, 22 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 bl sub_8195898 _08192FB8: movs r2, 0x1 @@ -26237,7 +26237,7 @@ _08192FE8: blt _08193006 b _08193126 _08193006: - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr mov r10, r5 ldr r0, =0x00000d25 mov r9, r0 @@ -26292,8 +26292,8 @@ _0819300E: muls r1, r0 ldr r0, =gMoveNames adds r1, r0 - ldr r0, =gUnknown_02021DC4 - bl CopyString + ldr r0, =gStringVar2 + bl StringCopy mov r2, r10 ldr r1, [r2] ldr r5, [sp, 0xC] @@ -26326,22 +26326,22 @@ _081930BC: ldr r0, =0xffc00000 cmp r1, r0 bne _081930E0 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r3, 0 - bl CopyString + bl StringCopy b _08193100 .pool _081930E0: ldr r0, =0xff800000 cmp r1, r0 bne _081930F8 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 bl sub_8195938 b _08193100 .pool _081930F8: lsrs r1, 22 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 bl sub_8195898 _08193100: mov r0, r8 @@ -26505,7 +26505,7 @@ _081931C2: ldr r0, [r4] adds r0, 0x11 mov r12, r0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r4, [r0] ldr r0, =gUnknown_0860D3C6 movs r3, 0 @@ -26561,7 +26561,7 @@ _081932A2: ldr r0, =0x000003ff cmp r1, r0 bne _081932D4 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] bl sub_806F000 @@ -26647,7 +26647,7 @@ _0819335A: ldr r0, =0x000003ff cmp r1, r0 bne _08193388 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] bl sub_806F000 @@ -26744,7 +26744,7 @@ _0819342C: ldr r0, =0x000003ff cmp r1, r0 bne _08193464 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r1, [sp, 0x1C] lsls r0, r1, 1 @@ -26761,7 +26761,7 @@ _08193464: ldr r0, =0x000003fe cmp r1, r0 bne _08193490 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r1, [sp, 0x1C] lsls r0, r1, 1 @@ -26775,7 +26775,7 @@ _08193464: b _081934B0 .pool _08193490: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r1, [sp, 0x1C] lsls r0, r1, 1 @@ -26890,7 +26890,7 @@ _08193564: ldr r0, =0x000003ff cmp r1, r0 bne _081935AC - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r3, [sp, 0x48] ldr r1, [r3, 0x4] @@ -26908,7 +26908,7 @@ _081935AC: ldr r0, =0x000003fe cmp r1, r0 bne _081935D8 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r0, [sp, 0x48] ldr r1, [r0, 0x4] @@ -26923,7 +26923,7 @@ _081935AC: b _081935FA .pool _081935D8: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r0, [sp, 0x48] ldr r1, [r0, 0x4] @@ -27057,13 +27057,13 @@ _081936A0: adds r1, r2, 0 movs r0, 0xD0 strb r0, [r1, 0xD] - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r0, =gUnknown_0860D38C ldr r7, [sp, 0x70] adds r0, r7, r0 ldr r1, [r0] adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders str r4, [sp, 0xC] add r0, sp, 0xC add r1, sp, 0x6C @@ -27090,22 +27090,22 @@ _081936A0: ldr r0, =0x000003ff cmp r1, r0 bne _0819375C - ldr r0, =gUnknown_02021CC4 - ldr r1, =gUnknown_03005D90 + ldr r0, =gStringVar1 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy b _0819377E .pool _0819375C: ldr r0, =0x000003fe cmp r1, r0 bne _08193774 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 bl sub_8195938 b _0819377E .pool _08193774: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 lsls r1, 16 lsrs r1, 16 bl sub_8195898 @@ -27114,7 +27114,7 @@ _0819377E: movs r4, 0x2 strb r4, [r0, 0x5] strb r4, [r0, 0xA] - ldr r5, =gUnknown_02021CC4 + ldr r5, =gStringVar1 str r5, [sp, 0xC] add r2, sp, 0x64 ldrb r2, [r2] @@ -27145,10 +27145,10 @@ _0819377E: ldr r0, =0x000003ff cmp r1, r0 bne _081937E4 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r0, r5, 0 - bl CopyString + bl StringCopy b _08193802 .pool _081937E4: @@ -27165,7 +27165,7 @@ _081937F8: adds r0, r5, 0 bl sub_8195898 _08193802: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 str r0, [sp, 0xC] add r0, sp, 0xC movs r6, 0 @@ -27267,7 +27267,7 @@ sub_81938A4: @ 81938A4 sub_81938E0: @ 81938E0 push {r4,lr} bl sub_8194D48 - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r2, [r4] ldr r1, =0x00000d0a adds r0, r2, r1 @@ -27606,12 +27606,12 @@ sub_8193BDC: @ 8193BDC adds r0, r1 movs r1, 0xA ldrsh r5, [r0, r1] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000cb2 adds r0, r1 ldrh r6, [r0] - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] adds r2, r1, 0 adds r3, r0, 0 @@ -27796,7 +27796,7 @@ sub_8193D7C: @ 8193D7C ldr r5, =gUnknown_02038BCA ldrh r0, [r5] bl sub_8195358 - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r2, [r4] lsls r0, 2 adds r2, r0 @@ -27849,7 +27849,7 @@ _08193E10: ldr r5, =0x000003ff adds r0, r5, 0 bl sub_8195358 - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r2, [r4] lsls r0, 2 adds r2, r0 @@ -27909,7 +27909,7 @@ _08193E78: orrs r0, r1 strb r0, [r2] _08193E92: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000cb2 adds r0, r1 @@ -27978,7 +27978,7 @@ _08193F18: adds r1, r5, r0 movs r0, 0 str r0, [r1] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] ldr r1, [sp, 0x6C] adds r0, r3, r1 @@ -28074,14 +28074,14 @@ _08193FE2: adds r3, r7 mov r8, r3 _08193FEE: - bl GenerateRandomNumber + bl Random adds r4, r0, 0 - bl GenerateRandomNumber + bl Random lsls r4, 16 lsrs r5, r4, 16 lsls r0, 16 orrs r5, r0 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r0, [r2] ldr r4, =0x00000d64 adds r0, r4 @@ -28294,7 +28294,7 @@ _08194182: ldr r0, [sp, 0x48] lsls r5, r0, 24 _0819419A: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r4, [r0] ldr r2, [sp, 0x50] lsls r1, r2, 24 @@ -28685,7 +28685,7 @@ _081944FC: movs r7, 0 movs r5, 0xF _0819456C: - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r0, [r3] adds r0, r7 ldr r1, =0x00000d24 @@ -28698,7 +28698,7 @@ _0819456C: mov r2, r10 cmp r2, 0x1 bne _081945C4 - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r2, [r3] adds r0, r2, r7 ldr r1, =0x00000d25 @@ -28721,7 +28721,7 @@ _081945C4: mov r3, r10 cmp r3, 0 bne _08194634 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] adds r0, r2, r7 ldr r1, =0x00000d25 @@ -28781,7 +28781,7 @@ _08194634: ldrsh r0, [r0, r1] cmp r0, 0 beq _08194660 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r0, [r2] ldr r3, =0x00000cb2 adds r0, r3 @@ -28790,7 +28790,7 @@ _08194634: b _0819466E .pool _08194660: - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] ldr r2, =0x00000cb2 adds r0, r2 @@ -29221,7 +29221,7 @@ _081949CE: movs r7, 0 ldr r0, =gUnknown_02022E2C mov r9, r0 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr mov r8, r1 adds r4, r2, 0 ldr r6, =gUnknown_0860D3F1 @@ -29320,7 +29320,7 @@ _08194AD4: strh r0, [r1, 0x8] b _08194B3C _08194AEE: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -29570,7 +29570,7 @@ sub_8194D68: @ 8194D68 sub sp, 0x8 movs r3, 0 _08194D76: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r0, =gUnknown_0203CEF8 adds r0, r3, r0 @@ -29606,21 +29606,21 @@ _08194DBC: _08194DBE: cmp r5, 0x3 bgt _08194DEA - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r0, [r1] add r0, r9 adds r1, r5, 0 adds r1, 0xD movs r2, 0 str r3, [sp, 0x4] - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 adds r1, r6, 0 adds r1, 0xD - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r7, r2 movs r2, 0 - bl pokemon_getattr + bl GetMonData ldr r3, [sp, 0x4] cmp r4, r0 bne _08194DBC @@ -29629,7 +29629,7 @@ _08194DEA: bne _08194E00 lsls r2, r6, 24 lsrs r2, 24 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r7, r1 movs r1, 0xA6 str r3, [sp, 0x4] @@ -29639,7 +29639,7 @@ _08194E00: mov r6, r8 cmp r6, 0x3 ble _08194DA8 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, [r2] movs r2, 0x64 mov r1, r10 @@ -29650,7 +29650,7 @@ _08194E00: adds r0, r1 adds r1, r3, 0 muls r1, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 movs r2, 0x64 bl memcpy @@ -29673,11 +29673,11 @@ sub_8194E44: @ 8194E44 push {r4-r7,lr} sub sp, 0x4 movs r4, 0 - ldr r7, =gUnknown_03005D8C + ldr r7, =gSaveBlock1Ptr movs r6, 0x64 movs r5, 0 _08194E50: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r0, =gUnknown_0203CEF8 adds r0, r4, r0 @@ -29698,10 +29698,10 @@ _08194E50: adds r0, r1 movs r1, 0xC movs r2, 0 - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1] - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r0, r5, r0 movs r1, 0xC mov r2, sp @@ -29756,7 +29756,7 @@ sub_8194EF8: @ 8194EF8 push {r4,lr} bl sub_8194D48 movs r2, 0 - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r0, [r3] ldr r1, =0x00000d25 adds r0, r1 @@ -29779,8 +29779,8 @@ _08194F14: cmp r0, 0 blt _08194F14 _08194F2A: - ldr r0, =gUnknown_02021CC4 - ldr r1, =gUnknown_03005D90 + ldr r0, =gStringVar1 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] lsls r2, 2 adds r1, r2 @@ -29808,7 +29808,7 @@ sub_8194F58: @ 8194F58 str r0, [sp, 0x8] str r0, [sp, 0xC] str r0, [sp, 0x10] - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r2, [r4] ldr r5, =0x00000d0a adds r0, r2, r5 @@ -29859,7 +29859,7 @@ _08194FCC: mov r0, r10 cmp r0, 0x4 bgt _08194FFC - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xA @@ -29872,7 +29872,7 @@ _08194FFC: mov r1, r10 cmp r1, 0xE bgt _0819501A - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x14 @@ -29883,7 +29883,7 @@ _08194FFC: adds r4, 0xA b _08195030 _0819501A: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xA @@ -29896,7 +29896,7 @@ _08195030: movs r6, 0 cmp r6, r10 bge _08195064 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r0, [r2] ldr r3, =0x00000d24 adds r0, r3 @@ -29923,7 +29923,7 @@ _0819504C: _08195064: cmp r6, r10 bne _08194FCC - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r3, [r5] ldr r0, [sp, 0x38] adds r3, r0 @@ -29960,7 +29960,7 @@ _0819509E: movs r7, 0 cmp r7, r6 bge _081950F4 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =gUnknown_0203BC8C mov r9, r1 @@ -29998,7 +29998,7 @@ _081950C8: _081950F4: cmp r7, r6 bne _0819509E - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r0, [r3] ldr r4, [sp, 0x28] ldr r2, [sp, 0x3C] @@ -30019,7 +30019,7 @@ _081950F4: ldr r6, [sp, 0x24] cmp r6, 0x2 ble _08195092 - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r2, [r4] ldr r5, [sp, 0x38] adds r2, r5 @@ -30031,7 +30031,7 @@ _081950F4: adds r1, r4, 0 ands r0, r1 strb r0, [r2] - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r2, [r5] ldr r0, [sp, 0x38] adds r2, r0 @@ -30071,7 +30071,7 @@ _08195178: _08195182: movs r7, 0 strh r7, [r5] - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] mov r2, r10 lsls r1, r2, 2 @@ -30089,7 +30089,7 @@ _08195182: ldr r4, [sp, 0x34] mov r9, r4 _081951AA: - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] mov r4, r9 add r4, r10 @@ -30127,7 +30127,7 @@ _081951AA: ldr r1, [r2] adds r0, r1 strh r0, [r5] - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r0, [r3] ldr r1, =0x00000d64 adds r0, r1 @@ -30145,7 +30145,7 @@ _081951AA: adds r1, r3 ldrb r0, [r1, 0x6] lsls r0, 2 - ldr r4, =gUnknown_0832A328 + ldr r4, =gBitTable adds r0, r4 ldr r0, [r0] orrs r7, r0 @@ -30216,7 +30216,7 @@ _08195288: _081952C4: cmp r1, r0 bne _081952F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] mov r3, r10 lsls r0, r3, 2 @@ -30263,7 +30263,7 @@ _08195314: mov r3, r10 cmp r3, 0x3 ble _08195314 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r4, =0x00000ca9 adds r1, r4 @@ -30292,7 +30292,7 @@ sub_8195358: @ 8195358 lsls r0, 16 lsrs r3, r0, 16 movs r2, 0 - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =0x00000d24 adds r0, r1 @@ -30330,7 +30330,7 @@ sub_81953A0: @ 81953A0 lsls r0, 16 lsrs r3, r0, 16 movs r2, 0 - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =0x00000d24 adds r0, r1 @@ -30425,7 +30425,7 @@ sub_8195438: @ 8195438 lsls r0, 3 str r0, [sp, 0x14] _0819545E: - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r0, [r2] lsls r4, r5, 2 adds r1, r0, r4 @@ -30453,7 +30453,7 @@ _08195488: ldr r0, [sp] bl sub_81901A0 str r0, [sp, 0x8] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] adds r0, r3, r4 ldr r1, =0x00000d24 @@ -30474,7 +30474,7 @@ _08195488: movs r3, 0x4 orrs r0, r3 strb r0, [r1] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r1, r2 ldr r2, =0x00000d25 @@ -30489,7 +30489,7 @@ _08195488: ldr r1, [sp, 0x8] ldr r2, [sp] bl sub_8193ED0 - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r1, [r3] ldr r5, [sp, 0x8] lsls r2, r5, 1 @@ -30500,7 +30500,7 @@ _08195488: b _08195874 .pool _08195504: - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r3, [r4] ldr r0, [sp, 0x8] lsls r2, r0, 2 @@ -30582,7 +30582,7 @@ _081955AA: lsls r7, r5, 1 ldr r4, [sp, 0x18] _081955B0: - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r1, [r2] ldr r3, =0x00000d64 adds r1, r3 @@ -30614,7 +30614,7 @@ _081955B0: adds r5, 0x1 cmp r5, 0x3 ble _081955AA - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r0, [r2] ldr r3, =0x00000d64 adds r0, r3 @@ -30653,7 +30653,7 @@ _081955B0: mov r2, r10 cmp r2, 0x2 ble _081955A4 - bl GenerateRandomNumber + bl Random movs r1, 0x1F ands r1, r0 adds r5, r1 @@ -30687,7 +30687,7 @@ _08195678: str r5, [sp, 0x3C] ldr r4, [sp, 0x20] _08195682: - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r1, [r5] ldr r0, =0x00000d64 adds r1, r0 @@ -30721,7 +30721,7 @@ _08195682: ldr r5, [sp, 0x3C] cmp r5, 0x3 ble _08195678 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r0, [r2] ldr r5, [sp, 0x1C] adds r1, r3, r5 @@ -30758,7 +30758,7 @@ _08195682: mov r5, r10 cmp r5, 0x2 ble _08195668 - bl GenerateRandomNumber + bl Random movs r1, 0x1F ands r1, r0 ldr r0, [sp, 0x10] @@ -30769,7 +30769,7 @@ _08195682: ldr r2, [sp, 0xC] cmp r2, r0 ble _08195784 - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r1, [r3] ldr r5, [sp, 0x30] adds r1, r5 @@ -30794,7 +30794,7 @@ _08195682: ldr r1, [sp, 0x8] ldr r2, [sp] bl sub_8193ED0 - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r1, [r3] movs r5, 0xEC lsls r5, 4 @@ -30808,7 +30808,7 @@ _08195784: ldr r5, [sp, 0x10] cmp r3, r5 bge _081957DC - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r3, [sp, 0x4] lsls r2, r3, 2 @@ -30819,7 +30819,7 @@ _08195784: movs r3, 0x4 orrs r0, r3 strb r0, [r1] - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r1, [r5] adds r1, r2 ldr r0, =0x00000d25 @@ -30848,7 +30848,7 @@ _081957DC: ldr r5, [sp, 0x8] cmp r3, r5 ble _08195830 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r2, [sp, 0x30] adds r1, r2 @@ -30858,7 +30858,7 @@ _081957DC: movs r5, 0x4 orrs r0, r5 strb r0, [r1] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r1, r2 adds r1, r3 @@ -30873,7 +30873,7 @@ _081957DC: ldr r1, [sp, 0x8] ldr r2, [sp] bl sub_8193ED0 - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r1, [r5] movs r2, 0xEC lsls r2, 4 @@ -30882,7 +30882,7 @@ _081957DC: b _08195872 .pool _08195830: - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r1, [r5] ldr r0, [sp, 0x4] lsls r2, r0, 2 @@ -30893,7 +30893,7 @@ _08195830: movs r5, 0x4 orrs r0, r5 strb r0, [r1] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r1, r2 adds r1, r3 @@ -30908,7 +30908,7 @@ _08195830: ldr r1, [sp, 0x4] ldr r2, [sp] bl sub_8193ED0 - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r1, [r5] movs r2, 0xEC lsls r2, 4 @@ -30954,7 +30954,7 @@ _081958B8: ldr r0, =0x000003ff cmp r5, r0 bne _081958DC - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] _081958C2: adds r0, r6, r4 @@ -31056,7 +31056,7 @@ sub_8195960: @ 8195960 thumb_func_start sub_8195980 sub_8195980: @ 8195980 push {r4-r7,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =0x00000ca9 adds r0, r1 @@ -31112,7 +31112,7 @@ sub_8195980: @ 8195980 adds r1, r0 strh r6, [r1] _081959F2: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x4 ldrsb r1, [r0, r1] @@ -31133,7 +31133,7 @@ _081959F2: thumb_func_start sub_8195A38 sub_8195A38: @ 8195A38 push {r4-r7,lr} - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r0, [r5] ldr r1, =0x00000ca9 adds r0, r1 @@ -31207,7 +31207,7 @@ _08195AD0: thumb_func_start sub_8195AE4 sub_8195AE4: @ 8195AE4 push {r4-r6,lr} - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r0, [r6] ldr r1, =0x00000ca9 adds r0, r1 @@ -31299,7 +31299,7 @@ sub_8195BB0: @ 8195BB0 ldr r0, =0x000040ce bl VarGet lsls r0, 16 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r2, [r1] ldr r3, =0x00000ca9 adds r1, r2, r3 @@ -31315,7 +31315,7 @@ sub_8195BB0: @ 8195BB0 cmp r0, 0x31 bhi _08195C00 ldr r4, =gUnknown_020375F0 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -31346,7 +31346,7 @@ _08195C16: sub_8195C20: @ 8195C20 push {r4,lr} ldr r4, =gUnknown_02038BCA - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xFF @@ -31390,7 +31390,7 @@ _08195C6C: thumb_func_start sub_8195C7C sub_8195C7C: @ 8195C7C push {r4-r7,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =0x00000ca9 adds r0, r1 @@ -31438,7 +31438,7 @@ _08195CCA: thumb_func_start sub_8195CE4 sub_8195CE4: @ 8195CE4 push {r4,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =gUnknown_020375E2 ldrh r1, [r1] @@ -31469,7 +31469,7 @@ sub_8195D28: @ 8195D28 ldr r0, =0x000040ce bl VarGet lsls r0, 16 - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r2, [r4] ldr r3, =0x00000ca9 adds r1, r2, r3 @@ -31484,7 +31484,7 @@ sub_8195D28: @ 8195D28 ldrh r0, [r2] cmp r0, 0x29 bls _08195D88 - bl GenerateRandomNumber + bl Random ldr r4, [r4] ldr r5, =gUnknown_0860DE84 lsls r0, 16 @@ -31500,7 +31500,7 @@ sub_8195D28: @ 8195D28 b _08195DA6 .pool _08195D88: - bl GenerateRandomNumber + bl Random ldr r4, [r4] ldr r5, =gUnknown_0860DE78 lsls r0, 16 @@ -31524,7 +31524,7 @@ _08195DA6: thumb_func_start sub_8195DB8 sub_8195DB8: @ 8195DB8 push {r4,r5,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =0x00000dc6 adds r0, r1 @@ -31539,7 +31539,7 @@ sub_8195DB8: @ 8195DB8 ldr r1, =0x00000dc6 adds r0, r1 ldrh r0, [r0] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name ldr r0, [r4] ldr r1, =0x00000dc6 @@ -31629,10 +31629,10 @@ _08195E86: sub_8195E8C: @ 8195E8C push {r4,r5,lr} movs r5, 0x1 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4, 0 movs r1, 0x6 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _08195EAE adds r0, r4, 0 @@ -31643,7 +31643,7 @@ sub_8195E8C: @ 8195E8C bne _08195EAE movs r5, 0x2 _08195EAE: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xA @@ -31749,7 +31749,7 @@ sub_8195F68: @ 8195F68 adds r4, r0, 0 cmp r4, 0 beq _08195FB8 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r4, 0 @@ -32182,12 +32182,12 @@ sub_81962D8: @ 81962D8 cmp r0, 0 bne _0819630C ldrh r0, [r1, 0x4] - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 bl sub_81967AC _0819630C: movs r1, 0x4 ldrsh r0, [r4, r1] - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 bl sub_81965D8 movs r0, 0x1 b _0819632A @@ -32219,7 +32219,7 @@ sub_8196330: @ 8196330 lsls r0, 24 cmp r0, 0 bne _08196388 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -32577,7 +32577,7 @@ sub_81965D8: @ 81965D8 sub_8196648: @ 8196648 push {r4,lr} adds r4, r0, 0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2C] movs r0, 0x1 ands r0, r1 @@ -32672,7 +32672,7 @@ _081966FC: thumb_func_start sub_8196710 sub_8196710: @ 8196710 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r1, [r1] ldr r2, =0x000009ca adds r1, r2 @@ -32798,7 +32798,7 @@ _081967EC: bl sub_80B1E94 b _08196832 _0819680A: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -32897,7 +32897,7 @@ sub_8196890: @ 8196890 sub_81968BC: @ 81968BC push {r4,lr} adds r4, r0, 0 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -32939,7 +32939,7 @@ sub_8196910: @ 8196910 push {r4-r7,lr} sub sp, 0x4 adds r6, r0, 0 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x1 @@ -32965,7 +32965,7 @@ _08196940: ble _0819692C cmp r5, 0 beq _081969AC - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r5, 0 @@ -33046,7 +33046,7 @@ sub_81969E0: @ 81969E0 bl sub_81969FC ldr r1, [r4] adds r0, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders pop {r4,r5} pop {r0} bx r0 @@ -33116,7 +33116,7 @@ _08196A5A: adds r0, r1, r0 ldr r1, [r0] adds r0, r5, 0 - bl CopyString + bl StringCopy b _08196A90 .pool _08196A78: @@ -33130,7 +33130,7 @@ _08196A78: ldr r0, =gTrainers + 0x4 @ name offset adds r1, r0 adds r0, r5, 0 - bl CopyString + bl StringCopy _08196A90: pop {r4-r6} pop {r0} @@ -33157,7 +33157,7 @@ sub_8196A9C: @ 8196A9C thumb_func_start sub_8196AB8 sub_8196AB8: @ 8196AB8 push {lr} - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -33246,7 +33246,7 @@ _08196B4A: thumb_func_start sub_8196B50 sub_8196B50: @ 8196B50 push {lr} - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -33363,7 +33363,7 @@ _08196C02: _08196C26: cmp r6, 0 beq _08196C5C - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r6, 0 @@ -33376,7 +33376,7 @@ _08196C26: ldr r0, =gSpeciesNames adds r1, r0 mov r0, r8 - bl CopyString + bl StringCopy b _08196C62 .pool _08196C5C: @@ -33413,7 +33413,7 @@ sub_8196C70: @ 8196C70 adds r0, 0x24 adds r0, r4, r0 ldr r6, [r0] - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r4, r5 @@ -33449,7 +33449,7 @@ _08196CD6: ldr r0, =gSpeciesNames adds r1, r0 adds r0, r7, 0 - bl CopyString + bl StringCopy pop {r4-r7} pop {r0} bx r0 @@ -33466,7 +33466,7 @@ sub_8196CF4: @ 8196CF4 lsls r1, 2 adds r1, r2 ldr r1, [r1] - bl CopyString + bl StringCopy pop {r0} bx r0 .pool @@ -33496,7 +33496,7 @@ _08196D34: lsrs r3, 24 adds r0, r5, 0 movs r2, 0 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN pop {r4-r6} pop {r0} bx r0 @@ -33540,14 +33540,14 @@ sub_8196D74: @ 8196D74 ble _08196DF4 bl GameFreakRTC_GetNumDays adds r4, r0, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xA bl sub_80842DC adds r6, r0, 0 ldr r0, =0x0000ffff ands r6, r0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002e6a adds r0, r1 @@ -33617,7 +33617,7 @@ _08196E24: .4byte _08196F60 _08196E40: movs r3, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000d14 adds r0, r1 @@ -33642,7 +33642,7 @@ _08196E5A: b _08196F7C .pool _08196E74: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000e08 adds r0, r1 @@ -33662,7 +33662,7 @@ _08196E86: .pool _08196E9C: movs r3, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r1, 0xCF lsls r1, 4 @@ -33690,7 +33690,7 @@ _08196EB8: .pool _08196ED0: movs r3, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r1, 0xDD lsls r1, 4 @@ -33718,7 +33718,7 @@ _08196EEC: .pool _08196F04: movs r3, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000dea adds r0, r1 @@ -33744,7 +33744,7 @@ _08196F1E: b _08196F7E .pool _08196F38: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000dde adds r0, r1 @@ -33764,7 +33764,7 @@ _08196F4A: b _08196F7E .pool _08196F60: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000e1e adds r0, r1 @@ -33959,19 +33959,19 @@ _081970A2: bl sub_80C0844 lsls r0, 16 lsrs r6, r0, 16 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 mov r10, r0 adds r1, r4, 0 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r1, =gUnknown_02021DC4 + bl ConvertIntToDecimalStringN + ldr r1, =gStringVar2 mov r9, r1 mov r0, r9 adds r1, r6, 0 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r0, r6, 0 bl sub_8196F90 adds r4, r0, 0 @@ -33979,14 +33979,14 @@ _081970A2: lsrs r4, 24 ldr r1, =gUnknown_082A5C9C adds r0, r7, 0 - bl CopyString + bl StringCopy adds r5, r0, 0 movs r6, 0xFB strb r6, [r5] adds r5, 0x1 ldr r1, =gUnknown_082A5D2C adds r0, r5, 0 - bl CopyString + bl StringCopy adds r5, r0, 0 strb r6, [r5] adds r5, 0x1 @@ -33995,10 +33995,10 @@ _081970A2: adds r4, r0 ldr r1, [r4] adds r0, r5, 0 - bl CopyString + bl StringCopy mov r0, r8 adds r1, r7, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r5, r0, 0 bl sub_809D42C cmp r0, 0 @@ -34017,15 +34017,15 @@ _081970A2: adds r1, r4, 0 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN mov r0, r9 adds r1, r6, 0 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r1, =gUnknown_082A633D adds r0, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders _08197156: adds r0, r7, 0 bl Free @@ -34224,7 +34224,7 @@ AddTextPrinterForMessage: @ 81972C4 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 - ldr r2, =gUnknown_02021FC4 + ldr r2, =gStringVar4 str r5, [sp] movs r0, 0x2 str r0, [sp, 0x4] @@ -34261,7 +34261,7 @@ AddTextPrinterForMessage_2: @ 8197310 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 - ldr r2, =gUnknown_02021FC4 + ldr r2, =gStringVar4 movs r0, 0 str r0, [sp] movs r0, 0x2 @@ -34298,7 +34298,7 @@ AddTextPrinterWithCustomSpeedForMessage: @ 819735C ands r1, r2 orrs r1, r0 strb r1, [r4] - ldr r2, =gUnknown_02021FC4 + ldr r2, =gStringVar4 movs r0, 0 str r0, [sp] movs r0, 0x2 @@ -35042,7 +35042,7 @@ sub_8197964: @ 8197964 ands r0, r1 cmp r0, 0 bne _08197988 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x14] lsls r0, 29 @@ -35059,7 +35059,7 @@ _0819798A: thumb_func_start sav2_get_text_speed sav2_get_text_speed: @ 8197990 push {lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldrb r1, [r2, 0x14] lsls r0, r1, 29 @@ -35231,7 +35231,7 @@ AddTextPrinterWithCallbackForMessage: @ 8197A9C adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 - ldr r2, =gUnknown_02021FC4 + ldr r2, =gStringVar4 str r5, [sp] movs r0, 0x2 str r0, [sp, 0x4] @@ -36569,7 +36569,7 @@ GetMenuCursorPos: @ 8198560 thumb_func_start ProcessMenuInput ProcessMenuInput: @ 819856C push {r4,lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -36630,7 +36630,7 @@ ProcessMenuInputNoWrapAround: @ 81985D8 ldr r4, =gUnknown_0203CD90 ldrb r5, [r4, 0x2] adds r6, r5, 0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -36693,7 +36693,7 @@ _08198650: thumb_func_start ProcessMenuInput_other ProcessMenuInput_other: @ 8198658 push {r4,lr} - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r0, 0x1 ands r0, r1 @@ -36752,7 +36752,7 @@ ProcessMenuInputNoWrapAround_other: @ 81986C4 ldr r4, =gUnknown_0203CD90 ldrb r5, [r4, 0x2] adds r6, r5, 0 - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r0, 0x1 ands r0, r1 @@ -38280,7 +38280,7 @@ _08199276: thumb_func_start sub_8199284 sub_8199284: @ 8199284 push {r4,lr} - ldr r4, =gUnknown_030022C0 + ldr r4, =gMain ldrh r1, [r4, 0x2E] movs r0, 0x1 ands r0, r1 @@ -38372,7 +38372,7 @@ sub_8199334: @ 8199334 push {r4-r6,lr} ldr r5, =gUnknown_0203CD90 ldrb r4, [r5, 0x2] - ldr r6, =gUnknown_030022C0 + ldr r6, =gMain ldrh r1, [r6, 0x2E] movs r0, 0x1 ands r0, r1 @@ -38458,7 +38458,7 @@ _081993D2: thumb_func_start sub_81993D8 sub_81993D8: @ 81993D8 push {r4,r5,lr} - ldr r4, =gUnknown_030022C0 + ldr r4, =gMain ldrh r1, [r4, 0x2E] movs r0, 0x1 ands r0, r1 @@ -38548,7 +38548,7 @@ sub_8199484: @ 8199484 push {r4-r6,lr} ldr r6, =gUnknown_0203CD90 ldrb r4, [r6, 0x2] - ldr r5, =gUnknown_030022C0 + ldr r5, =gMain ldrh r1, [r5, 0x2E] movs r0, 0x1 ands r0, r1 @@ -40111,10 +40111,10 @@ sub_819A024: @ 819A024 lsls r3, 16 lsrs r5, r3, 16 movs r2, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] ldrb r0, [r3] - ldr r6, =gUnknown_02021FC4 + ldr r6, =gStringVar4 cmp r0, 0xFF beq _0819A04C _0819A042: @@ -40125,7 +40125,7 @@ _0819A042: bne _0819A042 _0819A04C: adds r0, r6, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders lsls r3, r4, 24 lsrs r3, 24 lsls r0, r5, 24 @@ -40559,10 +40559,10 @@ _0819A384: .4byte _0819A404 .4byte _0819A414 _0819A398: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r0, r5, 0 - bl CopyString + bl StringCopy b _0819A43C .pool _0819A3A8: @@ -40582,19 +40582,19 @@ _0819A3BE: adds r0, r5, 0 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r5, r0, 0 movs r0, 0xFF strb r0, [r5] b _0819A43C _0819A3D6: - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldrh r1, [r0, 0xE] adds r0, r5, 0 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r5, r0, 0 movs r0, 0xF0 strb r0, [r5] @@ -40604,7 +40604,7 @@ _0819A3D6: adds r0, r5, 0 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN b _0819A43C .pool _0819A404: @@ -40673,7 +40673,7 @@ sub_819A44C: @ 819A44C strh r0, [r5, 0x2E] b _0819A4C2 _0819A484: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x5 @@ -40746,7 +40746,7 @@ sub_819A4F8: @ 819A4F8 sub_819A514: @ 819A514 push {r4,r5,lr} sub sp, 0xC - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -40880,7 +40880,7 @@ _0819A5C0: movs r0, 0x4A movs r1, 0 bl SetGpuReg - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r3, 0x87 lsls r3, 3 adds r1, r3 @@ -40957,7 +40957,7 @@ _0819A738: movs r1, 0x20 movs r2, 0x4 bl LoadPalette - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -41043,7 +41043,7 @@ _0819A854: movs r0, 0x3 bl HideBg _0819A85A: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r3, 0x87 lsls r3, 3 adds r1, r3 @@ -41067,7 +41067,7 @@ _0819A878: bne _0819A88C bl sub_819BE34 _0819A88C: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -41081,7 +41081,7 @@ _0819A8AC: bl sub_819BCF8 movs r0, 0x5 bl PutWindowTilemap - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r3, 0x87 lsls r3, 3 adds r1, r3 @@ -41091,7 +41091,7 @@ _0819A8C4: bl sub_819B9E8 movs r0, 0x1 bl PutWindowTilemap - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -41103,7 +41103,7 @@ _0819A8DC: _0819A8E2: bl PutWindowTilemap _0819A8E6: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -41215,7 +41215,7 @@ _0819A9D2: lsrs r2, r0, 24 cmp r2, 0x5 bls _0819A9D2 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 @@ -42014,7 +42014,7 @@ _0819B07A: strh r0, [r5, 0x8] b _0819B11A _0819B084: - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r0, 0x1 mov r8, r0 @@ -42169,7 +42169,7 @@ _0819B1CE: b _0819B344 .pool _0819B1EC: - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r7, 0x1 movs r6, 0x1 @@ -42392,7 +42392,7 @@ _0819B3BA: b _0819B476 .pool _0819B3DC: - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r0, [r2, 0x2E] ands r1, r0 cmp r1, 0 @@ -42435,7 +42435,7 @@ _0819B432: bl sub_819B9E8 b _0819B476 _0819B440: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r6, 0x1 adds r0, r6, 0 @@ -42485,7 +42485,7 @@ sub_819B484: @ 819B484 lsls r0, 24 lsrs r0, 24 adds r6, r0, 0 - ldr r7, =gUnknown_03005D90 + ldr r7, =gSaveBlock2Ptr ldr r2, [r7] ldr r0, =0x00000ca9 adds r4, r2, r0 @@ -42541,7 +42541,7 @@ _0819B4EA: movs r3, 0 mov r8, r3 _0819B518: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] mov r2, r8 lsls r0, r2, 1 @@ -42686,7 +42686,7 @@ sub_819B63C: @ 819B63C ldr r2, =gUnknown_0203BC8C ldr r0, =gSlateportBattleTentMons str r0, [r2] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldrb r3, [r1, 0xA] ldrb r0, [r1, 0xB] @@ -42702,7 +42702,7 @@ sub_819B63C: @ 819B63C movs r7, 0 mov r9, r7 _0819B678: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] mov r2, r9 lsls r0, r2, 1 @@ -42819,7 +42819,7 @@ sub_819B764: @ 819B764 movs r7, 0 ldr r0, =gUnknown_0300127C mov r10, r0 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr mov r8, r1 _0819B778: movs r2, 0 @@ -42838,7 +42838,7 @@ _0819B77E: movs r0, 0x64 adds r5, r7, 0 muls r5, r0 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r5, r2 adds r1, 0x14 adds r0, r5, 0 @@ -42861,7 +42861,7 @@ _0819B77E: adds r0, r5, 0 movs r1, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData mov r2, r8 ldr r1, [r2] ldr r2, =0x00000e74 @@ -43135,16 +43135,16 @@ sub_819B9E8: @ 819B9E8 adds r0, 0x14 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 movs r1, 0xB muls r1, r0 ldr r0, =gSpeciesNames adds r1, r0 adds r0, r4, 0 - bl CopyString + bl StringCopy movs r0, 0x1 adds r1, r4, 0 movs r2, 0x56 @@ -43496,7 +43496,7 @@ sub_819BCF8: @ 819BCF8 adds r0, 0x14 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 bl SpeciesToNationalPokedexNum @@ -43548,19 +43548,19 @@ sub_819BD70: @ 819BD70 adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 adds r0, r4, 0 movs r1, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData mov r8, r0 adds r0, r4, 0 movs r1, 0x1 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 movs r0, 0x58 str r0, [sp] @@ -43666,19 +43666,19 @@ sub_819BE34: @ 819BE34 adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 adds r0, r4, 0 movs r1, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData mov r9, r0 adds r0, r4, 0 movs r1, 0x1 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 movs r0, 0x58 str r0, [sp] @@ -43770,19 +43770,19 @@ _0819BF48: adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 adds r0, r4, 0 movs r1, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r6, r0, 0 adds r0, r4, 0 movs r1, 0x1 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r0, r7, 3 adds r0, r7 @@ -44809,14 +44809,14 @@ sub_819C810: @ 819C810 mov r5, r8 push {r5,r6} sub sp, 0x4 - ldr r4, =gUnknown_020244EC + 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, =gUnknown_02024744 + ldr r2, =gEnemyParty mov r9, r2 ldrb r1, [r1, 0x13] muls r1, r6 @@ -44833,7 +44833,7 @@ sub_819C810: @ 819C810 movs r1, 0x20 mov r2, sp bl pokemon_setattr - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr mov r8, r3 ldr r3, [r3] ldr r4, [r5] @@ -44876,7 +44876,7 @@ sub_819C810: @ 819C810 add r0, r9 movs r1, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData mov r1, r8 ldr r2, [r1] ldr r4, [r5] @@ -45005,7 +45005,7 @@ _0819C9C4: adds r0, r1 ldrh r0, [r0] strh r0, [r2, 0x24] - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty ldrb r2, [r2, 0x3] ldr r0, =sub_819DC1C str r0, [sp] @@ -45171,7 +45171,7 @@ _0819CB50: strh r0, [r4, 0x8] b _0819CBD6 _0819CB5A: - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r6, 0x1 adds r5, r6, 0 @@ -45454,7 +45454,7 @@ _0819CDA4: ldrb r0, [r0] cmp r0, 0x1 beq _0819CE36 - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r0, 0x1 mov r8, r0 @@ -45552,7 +45552,7 @@ _0819CE64: b _0819CF4C .pool _0819CE88: - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] adds r5, r1, 0 ands r5, r0 @@ -47202,7 +47202,7 @@ sub_819DC00: @ 819DC00 sub_819DC1C: @ 819DC1C push {r4-r6,lr} sub sp, 0xC - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 @@ -47257,7 +47257,7 @@ _0819DC84: ldr r0, =gUnknown_086108C8 bl InitWindows bl DeactivateAllTextPrinters - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -47399,7 +47399,7 @@ _0819DDA8: movs r1, 0x20 movs r2, 0x4 bl LoadPalette - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -47431,7 +47431,7 @@ _0819DE94: bl LoadCompressedObjectPic ldr r0, =sub_819C7FC bl SetVBlankCallback - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -47471,7 +47471,7 @@ _0819DF10: bl sub_819EBEC movs r0, 0x2 bl PutWindowTilemap - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -47492,7 +47492,7 @@ _0819DF3C: _0819DF4A: movs r0, 0x1 bl PutWindowTilemap - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -47521,7 +47521,7 @@ _0819DF8C: bl sub_819ED78 movs r0, 0x3 bl PutWindowTilemap - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -47564,7 +47564,7 @@ _0819E000: movs r0, 0x3 bl HideBg _0819E006: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -49016,27 +49016,27 @@ _0819EB70: bne _0819EB84 movs r0, 0x64 muls r0, r2 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty b _0819EB8A .pool _0819EB84: movs r0, 0x64 muls r0, r2 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty _0819EB8A: adds r0, r1 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r1, r0, 16 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 movs r0, 0xB muls r1, r0 ldr r0, =gSpeciesNames adds r1, r0 adds r0, r4, 0 - bl CopyString + bl StringCopy movs r0, 0x1 adds r1, r4, 0 movs r2, 0x56 @@ -49363,27 +49363,27 @@ _0819EE74: bne _0819EE88 movs r0, 0x64 muls r0, r2 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty b _0819EE8E .pool _0819EE88: movs r0, 0x64 muls r0, r2 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty _0819EE8E: adds r0, r1 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r1, r0, 16 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 movs r0, 0xB muls r1, r0 ldr r0, =gSpeciesNames adds r1, r0 adds r0, r4, 0 - bl CopyString + bl StringCopy movs r0, 0x1 adds r1, r4, 0 movs r2, 0x56 @@ -49440,27 +49440,27 @@ _0819EF2C: bne _0819EF40 movs r0, 0x64 muls r0, r2 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty b _0819EF46 .pool _0819EF40: movs r0, 0x64 muls r0, r2 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty _0819EF46: adds r0, r1 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r1, r0, 16 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 movs r0, 0xB muls r1, r0 ldr r0, =gSpeciesNames adds r1, r0 adds r0, r4, 0 - bl CopyString + bl StringCopy movs r0, 0x1 adds r1, r4, 0 movs r2, 0x56 @@ -49515,18 +49515,18 @@ _0819EFD0: bne _0819EFEC movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty b _0819EFF2 .pool _0819EFEC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty _0819EFF2: adds r0, r1 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 bl SpeciesToNationalPokedexNum @@ -49923,24 +49923,24 @@ sub_819F304: @ 819F304 movs r0, 0x64 adds r4, r1, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 adds r0, r4, 0 movs r1, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData mov r9, r0 adds r0, r4, 0 movs r1, 0x1 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r2, r0, 0 movs r0, 0x58 str r0, [sp] @@ -50113,7 +50113,7 @@ _0819F4DC: b _0819F54E .pool _0819F4F8: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -50190,11 +50190,11 @@ sub_819F59C: @ 819F59C lsrs r0, 24 movs r1, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r5, r0, 16 movs r4, 0 @@ -50206,11 +50206,11 @@ _0819F5B8: beq _0819F5EC movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 cmp r0, r5 @@ -50596,32 +50596,32 @@ sub_819F8E0: @ 819F8E0 ldrb r1, [r1, 0x3] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty b _0819F908 .pool _0819F900: ldrb r1, [r1, 0x3] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty _0819F908: adds r6, r1, r0 adds r0, r6, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r6, 0 movs r1, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r5, r0, 0 adds r0, r6, 0 movs r1, 0x1 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 movs r0, 0x58 str r0, [sp] @@ -50676,7 +50676,7 @@ sub_819F99C: @ 819F99C push {r7} lsls r0, 24 lsrs r5, r0, 24 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r1, [r2] lsls r0, r5, 4 adds r0, r5 @@ -50686,7 +50686,7 @@ sub_819F99C: @ 819F99C ldrb r1, [r1] movs r6, 0 adds r7, r2, 0 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 mov r8, r0 cmp r1, 0 beq _0819F9DC @@ -50713,22 +50713,22 @@ _0819F9DC: lsls r0, 1 adds r1, r0 mov r0, r8 - bl CopyString_Limit7 + bl StringCopy7 ldr r0, [r7] adds r0, r4 ldr r1, =0x0000011b adds r0, r1 ldrb r1, [r0] mov r0, r8 - bl StopMusicWhileStringIsPrinted - ldr r0, =gUnknown_02021DC4 + 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 ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r1, =gUnknown_08611330 ldr r0, [r7] adds r0, r4 @@ -50738,8 +50738,8 @@ _0819F9DC: lsrs r0, 25 adds r0, r1 ldr r1, [r0] - ldr r0, =gUnknown_02021FC4 - bl ExpandStringRefs + ldr r0, =gStringVar4 + bl StringExpandPlaceholders pop {r3} mov r8, r3 pop {r4-r7} @@ -50800,7 +50800,7 @@ sub_819FAA0: @ 819FAA0 mov r6, r9 mov r5, r8 push {r5-r7} - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r1, [r3] adds r1, 0xB2 ldrb r2, [r1] @@ -50878,7 +50878,7 @@ _0819FAD6: adds r0, 0xDD strb r4, [r0] movs r2, 0 - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr movs r4, 0x88 lsls r4, 1 _0819FB48: @@ -50898,7 +50898,7 @@ _0819FB48: adds r2, r7, r3 lsls r2, 2 adds r0, r2 - ldr r4, =gUnknown_82E9531 + ldr r4, =gGameLanguage ldrb r1, [r4] ldr r3, =0x0000011b adds r0, r3 @@ -50929,7 +50929,7 @@ _0819FB48: thumb_func_start sub_819FBB0 sub_819FBB0: @ 819FBB0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB1 ldrb r0, [r0] @@ -50945,7 +50945,7 @@ sub_819FBB0: @ 819FBB0 thumb_func_start sub_819FBC8 sub_819FBC8: @ 819FBC8 push {r4,r5,lr} - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r0, [r2] adds r0, 0xDE ldrb r0, [r0] @@ -50954,7 +50954,7 @@ sub_819FBC8: @ 819FBC8 adds r4, r2, 0 ldr r5, =gUnknown_08611548 _0819FBDA: - bl GenerateRandomNumber + bl Random ldr r2, [r4] lsls r0, 16 movs r1, 0xE0 @@ -50980,7 +50980,7 @@ _0819FBDA: _0819FC10: adds r4, r2, 0 _0819FC12: - bl GenerateRandomNumber + bl Random ldr r2, [r4] lsls r0, 16 lsrs r0, 16 @@ -51008,7 +51008,7 @@ _0819FC38: sub_819FC40: @ 819FC40 lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r2, [r1] adds r2, 0xB1 movs r1, 0x3 @@ -51038,7 +51038,7 @@ _0819FC66: bls _0819FC66 movs r5, 0 _0819FC78: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xA @@ -51046,7 +51046,7 @@ _0819FC78: adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xA @@ -51066,7 +51066,7 @@ _0819FC78: cmp r5, 0x31 bls _0819FC78 movs r5, 0 - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr movs r4, 0xF _0819FCBC: ldr r3, [r6] @@ -51109,7 +51109,7 @@ sub_819FCF8: @ 819FCF8 bne _0819FD4C ldr r6, =gUnknown_030062EC _0819FD06: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -51185,14 +51185,14 @@ _0819FD80: movs r5, 0 ldr r6, [sp, 0x14] _0819FD92: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 bl __umodsi3 lsls r0, 24 lsrs r4, r0, 24 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -51225,14 +51225,14 @@ _0819FDD0: bls _0819FDD0 movs r5, 0 _0819FDE6: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xA bl __umodsi3 lsls r0, 24 lsrs r4, r0, 24 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xA @@ -51284,7 +51284,7 @@ _0819FE36: strb r0, [r7] movs r5, 0 _0819FE60: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] lsls r4, r5, 2 adds r3, r4 @@ -51311,7 +51311,7 @@ _0819FE60: ldr r1, [sp, 0x14] ldr r2, [sp, 0x18] bl sub_819FCF8 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r3, [r1] add r3, r8 adds r3, 0xB8 @@ -51325,7 +51325,7 @@ _0819FE60: ands r0, r1 orrs r0, r2 strb r0, [r3] - ldr r7, =gUnknown_03005D90 + ldr r7, =gSaveBlock2Ptr ldr r0, [r7] add r0, r8 adds r0, 0xB8 @@ -51341,7 +51341,7 @@ _0819FE60: ldr r0, =gUnknown_030062EC mov r9, r0 _0819FED2: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r4, r0, 16 movs r1, 0x3 @@ -51388,7 +51388,7 @@ _0819FF12: adds r0, 0x20 adds r0, r1 strb r4, [r0] - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r2, [r6] add r2, r8 adds r2, 0xB8 @@ -51454,7 +51454,7 @@ sub_819FF98: @ 819FF98 ldr r1, [sp] cmp r1, 0x2 bhi _0819FFE0 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r1, [r2] adds r0, r1, 0 adds r0, 0xB4 @@ -51476,7 +51476,7 @@ sub_819FF98: @ 819FF98 .pool _0819FFE0: movs r4, 0 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr _0819FFE4: ldr r3, =gUnknown_08610970 lsls r1, r4, 1 @@ -51537,7 +51537,7 @@ _081A004C: movs r3, 0 str r3, [sp, 0x4] _081A0052: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x1 @@ -51551,7 +51551,7 @@ _081A0068: ldr r1, =0x000001ff mov r8, r1 _081A006C: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3A @@ -51612,7 +51612,7 @@ _081A00EA: lsls r0, r4, 24 mov r9, r0 _081A00F6: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r4, 0 @@ -51746,7 +51746,7 @@ sub_81A01E8: @ 81A01E8 mov r12, r1 lsls r0, 16 lsrs r2, r0, 16 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB1 ldrb r1, [r0] @@ -51834,7 +51834,7 @@ sub_81A0284: @ 81A0284 lsrs r6, r1, 24 lsls r2, 24 lsrs r5, r2, 24 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r2, [r1] adds r0, r2, 0 adds r0, 0xB1 @@ -51971,7 +51971,7 @@ sub_81A0390: @ 81A0390 lsrs r0, 24 mov r8, r0 movs r5, 0 - ldr r7, =gUnknown_03005D90 + ldr r7, =gSaveBlock2Ptr adds r6, r7, 0 movs r4, 0 _081A03A6: @@ -52030,7 +52030,7 @@ _081A03E6: cmp r5, 0x2 bls _081A03E6 movs r5, 0 - ldr r7, =gUnknown_03005D90 + ldr r7, =gSaveBlock2Ptr ldr r6, =gUnknown_086109A4 _081A0416: ldr r0, [r7] @@ -52076,7 +52076,7 @@ _081A0416: movs r5, 0 cmp r5, r8 bcs _081A04D6 - ldr r7, =gUnknown_03005D90 + ldr r7, =gSaveBlock2Ptr _081A0470: ldr r1, [r7] lsls r0, r5, 2 @@ -52185,7 +52185,7 @@ _081A0540: movs r4, 0 ldr r0, =gSpeciesNames mov r9, r0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] movs r1, 0xB2 adds r1, r3 @@ -52236,7 +52236,7 @@ _081A05B4: movs r0, 0x12 mov r10, r0 movs r6, 0x8 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB1 ldrb r0, [r0] @@ -52581,7 +52581,7 @@ sub_81A085C: @ 81A085C sub_81A087C: @ 81A087C push {r4-r7,lr} bl sub_819FBC8 - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r1, [r3] adds r1, 0xB1 ldrb r2, [r1] @@ -52622,7 +52622,7 @@ _081A08BE: cmp r4, 0x2 bls _081A08BE movs r4, 0 - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr movs r0, 0x4 negs r0, r0 mov r12, r0 @@ -52727,7 +52727,7 @@ sub_81A0984: @ 81A0984 thumb_func_start sub_81A0990 sub_81A0990: @ 81A0990 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] adds r2, 0xB1 ldrb r3, [r2] @@ -52749,7 +52749,7 @@ sub_81A0990: @ 81A0990 thumb_func_start sub_81A09B4 sub_81A09B4: @ 81A09B4 ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB1 ldrb r0, [r0] @@ -52763,7 +52763,7 @@ sub_81A09B4: @ 81A09B4 thumb_func_start sub_81A09D0 sub_81A09D0: @ 81A09D0 push {lr} - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r0, [r3] adds r0, 0xB1 ldrb r0, [r0] @@ -52850,7 +52850,7 @@ sub_81A0A70: @ 81A0A70 cmp r0, 0x6 bne _081A0A94 ldr r1, =gUnknown_08610FF0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB0 ldrb r0, [r0] @@ -52861,7 +52861,7 @@ _081A0A94: cmp r0, 0x7 bne _081A0AB0 ldr r1, =gUnknown_08610FF0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB0 ldrb r0, [r0] @@ -52873,7 +52873,7 @@ _081A0AB0: cmp r0, 0x8 bne _081A0ACC ldr r1, =gUnknown_086111B0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB0 ldrb r0, [r0] @@ -52884,7 +52884,7 @@ _081A0ACC: cmp r0, 0x9 bne _081A0AE8 ldr r1, =gUnknown_086111B0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB0 ldrb r0, [r0] @@ -52896,7 +52896,7 @@ _081A0AE8: cmp r0, 0x4 bne _081A0B04 ldr r1, =gUnknown_08611230 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB0 ldrb r0, [r0] @@ -52907,7 +52907,7 @@ _081A0B04: cmp r0, 0x5 bne _081A0B20 ldr r1, =gUnknown_08611230 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB0 ldrb r0, [r0] @@ -52919,7 +52919,7 @@ _081A0B20: cmp r0, 0xA bne _081A0B40 ldr r2, =gUnknown_08611070 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB0 ldrb r1, [r0] @@ -52932,7 +52932,7 @@ _081A0B40: cmp r0, 0xB bne _081A0B5C ldr r1, =gUnknown_086112B0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB0 ldrb r0, [r0] @@ -52943,7 +52943,7 @@ _081A0B5C: cmp r0, 0xC bne _081A0B7C ldr r2, =gUnknown_08611070 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB0 ldrb r1, [r0] @@ -52957,7 +52957,7 @@ _081A0B7C: cmp r0, 0xD bne _081A0B9C ldr r2, =gUnknown_08611070 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB0 ldrb r1, [r0] @@ -52972,7 +52972,7 @@ _081A0B9C: cmp r0, 0x10 bne _081A0BC0 ldr r2, =gUnknown_08611070 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB0 ldrb r1, [r0] @@ -52986,7 +52986,7 @@ _081A0BC0: cmp r0, 0xE bne _081A0BE4 ldr r2, =gUnknown_08611070 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB0 ldrb r1, [r0] @@ -53003,7 +53003,7 @@ _081A0BE4: cmp r0, 0xF bne _081A0C00 ldr r1, =gUnknown_086112B0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB0 ldrb r0, [r0] @@ -53015,7 +53015,7 @@ _081A0C00: cmp r0, 0 bne _081A0C1C ldr r1, =gUnknown_08610EF0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB0 ldrb r0, [r0] @@ -53026,7 +53026,7 @@ _081A0C1C: cmp r0, 0x1 bne _081A0C38 ldr r1, =gUnknown_08610EF0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB0 ldrb r0, [r0] @@ -53038,7 +53038,7 @@ _081A0C38: cmp r0, 0x2 bne _081A0C54 ldr r1, =gUnknown_08610EF0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB0 ldrb r0, [r0] @@ -53050,7 +53050,7 @@ _081A0C54: cmp r0, 0x3 bne _081A0C74 ldr r1, =gUnknown_08610EF0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB0 ldrb r0, [r0] @@ -53065,8 +53065,8 @@ _081A0C74: bl script_env_2_enable_and_set_ctx_running b _081A0C8E _081A0C7A: - ldr r0, =gUnknown_02021FC4 - bl ExpandStringRefs + ldr r0, =gStringVar4 + bl StringExpandPlaceholders movs r0, 0x1 bl AddTextPrinterForMessage ldr r0, =sub_81A0A34 @@ -53096,7 +53096,7 @@ sub_81A0C9C: @ 81A0C9C thumb_func_start sub_81A0CC0 sub_81A0CC0: @ 81A0CC0 push {lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] adds r0, r2, 0 adds r0, 0xB1 @@ -53165,7 +53165,7 @@ sub_81A0D40: @ 81A0D40 cmp r0, 0 beq _081A0D6E ldr r4, =gUnknown_020375E4 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] adds r2, 0xB2 ldrb r3, [r2] @@ -53192,7 +53192,7 @@ _081A0D6E: thumb_func_start sub_81A0D80 sub_81A0D80: @ 81A0D80 push {lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] adds r0, r3, 0 adds r0, 0xB1 @@ -53240,7 +53240,7 @@ sub_81A0DD4: @ 81A0DD4 push {r6,r7} movs r6, 0 movs r2, 0 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] adds r0, 0xB8 ldrb r0, [r0] @@ -53277,7 +53277,7 @@ _081A0E14: ldrh r0, [r0] cmp r0, 0x2 bne _081A0E88 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r5, [r0] adds r6, r5, 0 adds r6, 0xB1 @@ -53321,7 +53321,7 @@ _081A0E3C: _081A0E88: cmp r0, 0x3 bne _081A0F54 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr mov r8, r0 ldr r5, [r0] movs r1, 0xB1 @@ -53423,7 +53423,7 @@ _081A0EC4: _081A0F54: cmp r0, 0x4 bne _081A0FCE - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] adds r0, r3, 0 adds r0, 0xB1 @@ -53526,15 +53526,15 @@ _081A1018: beq _081A1030 b _081A11E6 _081A101E: - ldr r5, =gUnknown_02021CC4 + ldr r5, =gStringVar1 b _081A1032 .pool _081A1028: - ldr r5, =gUnknown_02021DC4 + ldr r5, =gStringVar2 b _081A1032 .pool _081A1030: - ldr r5, =gUnknown_02021EC4 + ldr r5, =gStringVar3 _081A1032: ldr r0, =gUnknown_020375E4 ldrh r0, [r0] @@ -53611,7 +53611,7 @@ _081A10DC: b _081A1174 .pool _081A10F4: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r0, r1, 0 adds r0, 0xB1 @@ -53628,7 +53628,7 @@ _081A10F4: b _081A1174 .pool _081A1118: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB0 ldrb r0, [r0] @@ -53640,11 +53640,11 @@ _081A1118: bl sub_81DB5E8 adds r0, r5, 0 mov r1, sp - bl CopyString + bl StringCopy b _081A11E6 .pool _081A1140: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB1 ldrb r1, [r0] @@ -53660,20 +53660,20 @@ _081A115C: b _081A1174 .pool _081A1164: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r1, 0x82 lsls r1, 1 adds r0, r1 bl ConvertBattleFrontierTrainerSpeechToString - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 _081A1174: adds r0, r5, 0 - bl CopyString + bl StringCopy b _081A11E6 .pool _081A1184: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] adds r1, r3, 0 adds r1, 0xB1 @@ -53720,7 +53720,7 @@ _081A11C2: ldr r0, =gSpeciesNames adds r1, r0 adds r0, r5, 0 - bl CopyString + bl StringCopy _081A11E6: add sp, 0x10 pop {r4-r6} @@ -53731,7 +53731,7 @@ _081A11E6: thumb_func_start sub_81A11F8 sub_81A11F8: @ 81A11F8 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r0, =gUnknown_020375E2 ldrb r1, [r0] @@ -53760,7 +53760,7 @@ sub_81A1224: @ 81A1224 mov r7, r9 mov r6, r8 push {r6,r7} - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r3, [r1] adds r0, r3, 0 adds r0, 0xB1 @@ -53931,7 +53931,7 @@ sub_81A1370: @ 81A1370 mov r6, r9 mov r5, r8 push {r5-r7} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] movs r2, 0x8A lsls r2, 1 @@ -53971,7 +53971,7 @@ _081A13B8: negs r2, r2 mov r9, r2 movs r5, 0x1 - ldr r7, =gUnknown_03005D90 + ldr r7, =gSaveBlock2Ptr movs r0, 0x90 lsls r0, 1 mov r8, r0 @@ -54005,7 +54005,7 @@ _081A13FC: mov r5, r9 cmp r5, 0 ble _081A1422 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] lsls r0, r5, 4 add r0, r9 @@ -54028,7 +54028,7 @@ _081A1422: thumb_func_start sub_81A1438 sub_81A1438: @ 81A1438 push {r4,r5,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r2, [r4] adds r0, r2, 0 adds r0, 0xB0 @@ -54075,7 +54075,7 @@ _081A148C: cmp r0, 0 bne _081A147C _081A1496: - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] adds r0, 0xDD strb r2, [r0] @@ -54114,9 +54114,9 @@ _081A14C2: movs r2, 0x8A lsls r2, 1 adds r0, r1, r2 - bl CopyString + bl StringCopy ldr r1, [r5] - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] ldr r2, =0x0000011b adds r1, r2 @@ -54134,7 +54134,7 @@ _081A14C2: sub_81A150C: @ 81A150C push {lr} ldr r2, =gUnknown_08610970 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xDC ldrb r0, [r0] @@ -54204,7 +54204,7 @@ _081A1594: sub_81A15A4: @ 81A15A4 push {lr} ldr r2, =gUnknown_08610970 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xB0 ldrb r1, [r0] @@ -54343,7 +54343,7 @@ sub_81A16B4: @ 81A16B4 push {lr} lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -54367,7 +54367,7 @@ sub_81A16DC: @ 81A16DC push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -54464,7 +54464,7 @@ sub_81A17A0: @ 81A17A0 lsls r0, 7 movs r1, 0xFF bl VarSet - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000ca8 adds r0, r1 @@ -54496,7 +54496,7 @@ _081A17EE: bl sub_813A878 movs r0, 0x80 lsls r0, 7 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] ldr r2, =0x00000ca8 adds r1, r2 @@ -54507,7 +54507,7 @@ _081A17EE: _081A1810: movs r0, 0x80 lsls r0, 7 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] ldr r2, =0x00000ca8 adds r1, r2 @@ -54558,7 +54558,7 @@ _081A186C: .4byte _081A1938 _081A188C: ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000ca8 adds r0, r2 @@ -54568,7 +54568,7 @@ _081A188C: .pool _081A18A8: ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000ca9 adds r0, r2 @@ -54580,7 +54580,7 @@ _081A18A8: .pool _081A18C8: ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000cb2 adds r0, r2 @@ -54590,7 +54590,7 @@ _081A18C8: .pool _081A18E4: ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000ca9 adds r0, r2 @@ -54609,7 +54609,7 @@ _081A1900: .pool _081A1918: ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000ca9 adds r0, r2 @@ -54622,7 +54622,7 @@ _081A1926: .pool _081A1938: ldr r4, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] movs r0, 0xD0 lsls r0, 4 @@ -54681,7 +54681,7 @@ _081A19A4: .4byte _081A1A7C .4byte _081A1AA8 _081A19C4: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =gUnknown_020375E4 ldrh r1, [r1] @@ -54691,7 +54691,7 @@ _081A19C4: b _081A1AC4 .pool _081A19E0: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r0, =gUnknown_020375E4 ldrb r0, [r0] @@ -54708,7 +54708,7 @@ _081A19E0: b _081A1AC4 .pool _081A1A0C: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =gUnknown_020375E4 ldrh r1, [r1] @@ -54718,7 +54718,7 @@ _081A1A0C: b _081A1AC4 .pool _081A1A28: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] ldr r0, =gUnknown_020375E4 ldrb r0, [r0] @@ -54734,7 +54734,7 @@ _081A1A28: .pool _081A1A50: movs r2, 0 - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r4, =0x00000caa ldr r3, =gUnknown_0203CEF8 _081A1A58: @@ -54751,7 +54751,7 @@ _081A1A58: b _081A1AC4 .pool _081A1A7C: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] ldr r0, =gUnknown_020375E4 ldrb r0, [r0] @@ -54770,7 +54770,7 @@ _081A1A94: b _081A1AC4 .pool _081A1AA8: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] movs r0, 0xD0 lsls r0, 4 @@ -54801,7 +54801,7 @@ sub_81A1AD4: @ 81A1AD4 cmp r3, r0 bge _081A1B00 ldr r7, =gUnknown_0203CEF8 - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r5, =0x00000caa _081A1AEA: adds r2, r3, r7 @@ -54826,7 +54826,7 @@ _081A1B00: thumb_func_start sub_81A1B1C sub_81A1B1C: @ 81A1B1C push {lr} - bl Reset + bl DoSoftReset pop {r0} bx r0 thumb_func_end sub_81A1B1C @@ -54846,7 +54846,7 @@ sub_81A1B38: @ 81A1B38 movs r4, 0 movs r5, 0x64 _081A1B3E: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r4, 1 ldr r2, =0x00000caa @@ -54858,7 +54858,7 @@ _081A1B3E: lsrs r0, 16 cmp r0, 0x5 bhi _081A1B76 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r1] subs r1, 0x1 @@ -54867,7 +54867,7 @@ _081A1B3E: movs r1, 0x8E lsls r1, 2 adds r0, r1 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r4, 0 muls r1, r5 adds r1, r2 @@ -54951,7 +54951,7 @@ _081A1C1E: thumb_func_start sub_81A1C24 sub_81A1C24: @ 81A1C24 push {lr} - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] ldr r2, =0x00000cdc adds r1, r2 @@ -55082,15 +55082,15 @@ sub_81A1CD8: @ 81A1CD8 bls _081A1D24 adds r6, r0, 0 _081A1D24: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0 movs r2, 0x1 movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EE302 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders mov r1, r10 ldrb r0, [r1] str r7, [sp] @@ -55126,7 +55126,7 @@ sub_81A1D78: @ 81A1D78 lsrs r3, 24 lsls r5, 24 lsrs r5, 24 - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r4, [r4] lsrs r1, 23 lsrs r0, 22 @@ -55151,7 +55151,7 @@ sub_81A1DBC: @ 81A1DBC push {lr} lsls r0, 24 lsls r1, 24 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r2, [r2] lsrs r1, 23 lsrs r0, 22 @@ -55294,33 +55294,33 @@ sub_81A1EA8: @ 81A1EA8 bl FillWindowPixelBuffer cmp r7, 0 bne _081A1EF0 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085EE158 - bl ExpandStringRefs + bl StringExpandPlaceholders b _081A1F28 .pool _081A1EF0: cmp r7, 0x1 bne _081A1F08 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085EE178 - bl ExpandStringRefs + bl StringExpandPlaceholders b _081A1F28 .pool _081A1F08: cmp r7, 0x2 bne _081A1F20 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085EE198 - bl ExpandStringRefs + bl StringExpandPlaceholders b _081A1F28 .pool _081A1F20: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085EE1B7 - bl ExpandStringRefs + bl StringExpandPlaceholders _081A1F28: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 movs r1, 0x2 bl sub_81A1C4C ldr r6, =gUnknown_0203AB74 @@ -55396,7 +55396,7 @@ sub_81A1FD8: @ 81A1FD8 push {lr} lsls r0, 24 lsls r1, 24 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r2, [r2] lsrs r1, 23 lsrs r0, 22 @@ -55449,15 +55449,15 @@ sub_81A2008: @ 81A2008 movs r1, 0x1 mov r2, r12 bl Print - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 movs r2, 0x1 movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 adds r0, r4, 0 adds r1, r7, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders mov r1, r10 ldrb r0, [r1] str r5, [sp] @@ -55582,17 +55582,17 @@ sub_81A2134: @ 81A2134 bl FillWindowPixelBuffer cmp r7, 0 bne _081A217C - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085EE1DB - bl ExpandStringRefs + bl StringExpandPlaceholders b _081A2184 .pool _081A217C: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085EE1FE - bl ExpandStringRefs + bl StringExpandPlaceholders _081A2184: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 movs r1, 0 bl sub_81A1C4C ldr r1, =gUnknown_0203AB74 @@ -55625,7 +55625,7 @@ _081A2184: movs r2, 0x40 movs r3, 0x79 bl sub_81A2094 - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] lsls r5, r7, 2 ldr r1, =0x00000d14 @@ -55748,15 +55748,15 @@ sub_81A22B8: @ 81A22B8 bls _081A2304 adds r6, r0, 0 _081A2304: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0 movs r2, 0x1 movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EE302 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders mov r1, r10 ldrb r0, [r1] str r7, [sp] @@ -55792,7 +55792,7 @@ sub_81A2358: @ 81A2358 lsrs r3, 24 lsls r5, 24 lsrs r5, 24 - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r4, [r4] lsrs r1, 23 lsrs r0, 22 @@ -55817,7 +55817,7 @@ sub_81A239C: @ 81A239C push {lr} lsls r0, 24 lsls r1, 24 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r2, [r2] lsrs r1, 23 lsrs r0, 22 @@ -55935,17 +55935,17 @@ sub_81A2460: @ 81A2460 bl FillWindowPixelBuffer cmp r7, 0 bne _081A24A8 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085EE221 - bl ExpandStringRefs + bl StringExpandPlaceholders b _081A24B0 .pool _081A24A8: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085EE241 - bl ExpandStringRefs + bl StringExpandPlaceholders _081A24B0: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 movs r1, 0x2 bl sub_81A1C4C ldr r6, =gUnknown_0203AB74 @@ -56020,7 +56020,7 @@ _081A24B0: sub_81A2560: @ 81A2560 push {lr} lsls r0, 24 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] lsrs r0, 23 ldr r2, =0x00000e04 @@ -56071,15 +56071,15 @@ sub_81A258C: @ 81A258C movs r1, 0x1 mov r2, r12 bl Print - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 movs r2, 0x1 movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 adds r0, r4, 0 adds r1, r7, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders mov r1, r10 ldrb r0, [r1] str r5, [sp] @@ -56181,10 +56181,10 @@ sub_81A2698: @ 81A2698 ldrb r0, [r6] movs r1, 0x11 bl FillWindowPixelBuffer - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EE261 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0 bl sub_81A1C4C @@ -56218,7 +56218,7 @@ sub_81A2698: @ 81A2698 ldr r0, =gUnknown_085EE319 mov r10, r0 ldr r7, =gUnknown_085EE35B - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r0, [r5] ldr r1, =0x00000e08 adds r0, r1 @@ -56329,15 +56329,15 @@ sub_81A27E8: @ 81A27E8 bls _081A2834 adds r6, r0, 0 _081A2834: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0 movs r2, 0x1 movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EE381 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders mov r1, r10 ldrb r0, [r1] str r7, [sp] @@ -56373,7 +56373,7 @@ sub_81A2888: @ 81A2888 lsrs r5, 24 lsls r3, 24 lsrs r3, 24 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] lsrs r0, 23 ldr r2, =0x00000dde @@ -56396,7 +56396,7 @@ sub_81A2888: @ 81A2888 sub_81A28CC: @ 81A28CC push {lr} lsls r0, 24 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] lsrs r0, 23 ldr r2, =0x00000dda @@ -56486,10 +56486,10 @@ sub_81A2968: @ 81A2968 bl FillWindowPixelBuffer movs r0, 0xA bl sub_81A1C90 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EE27C adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0x2 bl sub_81A1C4C @@ -56591,16 +56591,16 @@ sub_81A2A28: @ 81A2A28 bls _081A2A80 adds r7, r0, 0 _081A2A80: - ldr r5, =gUnknown_02021CC4 + ldr r5, =gStringVar1 adds r0, r5, 0 adds r1, r7, 0 movs r2, 0x1 movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EE302 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders mov r1, r10 ldrb r0, [r1] str r6, [sp] @@ -56616,10 +56616,10 @@ _081A2A80: ldr r1, [sp, 0xC] movs r2, 0x1 movs r3, 0x4 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r1, =gUnknown_085EE392 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders mov r1, r10 ldrb r0, [r1] str r6, [sp] @@ -56661,7 +56661,7 @@ sub_81A2B04: @ 81A2B04 lsrs r4, 24 lsls r5, 24 lsrs r5, 24 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r2, [r2] lsrs r1, 23 lsrs r0, 22 @@ -56696,7 +56696,7 @@ sub_81A2B70: @ 81A2B70 push {lr} lsls r0, 24 lsls r1, 24 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r2, [r2] lsrs r1, 23 lsrs r0, 22 @@ -56720,7 +56720,7 @@ sub_81A2BA0: @ 81A2BA0 push {lr} lsls r0, 24 lsls r1, 24 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r2, [r2] lsrs r1, 23 lsrs r0, 22 @@ -56861,17 +56861,17 @@ sub_81A2C94: @ 81A2C94 bl FillWindowPixelBuffer cmp r7, 0 bne _081A2CD8 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085EE298 - bl ExpandStringRefs + bl StringExpandPlaceholders b _081A2CE0 .pool _081A2CD8: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085EE2B8 - bl ExpandStringRefs + bl StringExpandPlaceholders _081A2CE0: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 movs r1, 0 bl sub_81A1C4C ldr r0, =gUnknown_0203AB74 @@ -56997,15 +56997,15 @@ sub_81A2DB4: @ 81A2DB4 bls _081A2E00 adds r6, r0, 0 _081A2E00: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0 movs r2, 0x1 movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EE39C adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders mov r1, r10 ldrb r0, [r1] str r7, [sp] @@ -57041,7 +57041,7 @@ sub_81A2E54: @ 81A2E54 lsrs r5, 24 lsls r3, 24 lsrs r3, 24 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] lsrs r0, 23 ldr r2, =0x00000e1e @@ -57064,7 +57064,7 @@ sub_81A2E54: @ 81A2E54 sub_81A2E98: @ 81A2E98 push {lr} lsls r0, 24 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] lsrs r0, 23 ldr r2, =0x00000e1a @@ -57154,10 +57154,10 @@ sub_81A2F38: @ 81A2F38 ldrb r0, [r5] movs r1, 0x11 bl FillWindowPixelBuffer - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EE2D8 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0x2 bl sub_81A1C4C @@ -57232,10 +57232,10 @@ sub_81A2FF8: @ 81A2FF8 ldrb r0, [r4] movs r1, 0x11 bl FillWindowPixelBuffer - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 mov r9, r0 ldr r1, =gUnknown_085EDF86 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 mov r1, r9 movs r2, 0xD0 @@ -57378,7 +57378,7 @@ _081A314A: lsrs r7, r0, 24 lsls r4, r1, 3 _081A315C: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000624 adds r0, r1 @@ -57387,7 +57387,7 @@ _081A315C: mov r0, r9 movs r2, 0x1 movs r3, 0x4 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r6, =gUnknown_0203AB74 ldrb r0, [r6] movs r1, 0x26 @@ -57434,7 +57434,7 @@ sub_81A31FC: @ 81A31FC mov r5, r8 push {r5-r7} sub sp, 0x24 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 @@ -57470,7 +57470,7 @@ _081A3250: .4byte _081A354C .4byte _081A3594 _081A326C: - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr mov r9, r2 ldr r0, [r2] lsls r3, r7, 1 @@ -57508,9 +57508,9 @@ _081A3298: ldr r5, =gUnknown_020229F0 adds r1, r5 mov r0, sp - bl CopyString + bl StringCopy mov r0, sp - bl StripExtendedControlCodes + bl StripExtCtrlCodes lsls r1, r7, 3 ldr r0, =0x00000ee1 adds r1, r0 @@ -57518,7 +57518,7 @@ _081A3298: ldr r0, [r2] adds r0, r1 mov r1, sp - bl CopyString + bl StringCopy ldrb r0, [r6] eors r4, r0 lsls r0, r4, 3 @@ -57620,7 +57620,7 @@ _081A338E: bl sub_80EE8C8 b _081A35CE _081A33A8: - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r0, [r6] lsls r7, 1 mov r2, r8 @@ -57670,7 +57670,7 @@ _081A3404: bl sub_80EE8C8 b _081A35CE _081A3414: - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r0, [r6] lsls r7, 1 mov r2, r8 @@ -57721,7 +57721,7 @@ _081A346C: bl sub_80EE8C8 b _081A35CE _081A347C: - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r1, [r6] lsls r4, r7, 1 ldr r5, =0x00000dda @@ -57757,7 +57757,7 @@ _081A34AE: b _081A35CE .pool _081A34CC: - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r2, [r6] lsls r7, 1 mov r9, r7 @@ -57811,7 +57811,7 @@ _081A353C: bl sub_80EE8C8 b _081A35CE _081A354C: - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r1, [r6] lsls r4, r7, 1 ldr r5, =0x00000e04 @@ -57841,7 +57841,7 @@ _081A354C: b _081A35CE .pool _081A3594: - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r1, [r6] lsls r4, r7, 1 ldr r5, =0x00000e1a @@ -58017,7 +58017,7 @@ _081A36F2: lsls r0, 1 cmp r3, r0 bne _081A370C - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000bfc b _081A38C4 @@ -58043,7 +58043,7 @@ _081A3738: ldr r0, =0x0000018f cmp r3, r0 bhi _081A3758 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr movs r0, 0xEC muls r0, r3 ldr r1, [r1] @@ -58063,7 +58063,7 @@ _081A3766: lsls r0, 1 cmp r3, r0 bne _081A3780 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000c08 b _081A38C4 @@ -58095,14 +58095,14 @@ _081A37B8: ldr r0, =0x0000018f cmp r3, r0 bhi _081A37EC - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 ands r0, r1 cmp r0, 0 bne _081A387C - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr movs r0, 0xEC muls r0, r3 ldr r1, [r1] @@ -58111,14 +58111,14 @@ _081A37B8: b _081A38C4 .pool _081A37EC: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 ands r0, r1 cmp r0, 0 bne _081A387C - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr lsls r0, r3, 4 adds r0, r3 lsls r0, 2 @@ -58132,7 +58132,7 @@ _081A3818: lsls r0, 1 cmp r3, r0 bne _081A3830 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000c14 b _081A38C4 @@ -58163,7 +58163,7 @@ _081A3868: ldr r0, =0x0000018f cmp r3, r0 bhi _081A38A8 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -58176,7 +58176,7 @@ _081A387C: b _081A38F8 .pool _081A3890: - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr movs r0, 0xEC muls r0, r3 ldr r1, [r1] @@ -58185,7 +58185,7 @@ _081A3890: b _081A38C4 .pool _081A38A8: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -58204,7 +58204,7 @@ _081A38C4: b _081A38F8 .pool _081A38D4: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r0, =0xfffffe70 adds r2, r3, r0 @@ -58234,7 +58234,7 @@ sub_81A3908: @ 81A3908 mov r6, r9 mov r5, r8 push {r5-r7} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r2, =0x00000cdc adds r1, r2 @@ -58322,7 +58322,7 @@ _081A399E: thumb_func_start sub_81A39C4 sub_81A39C4: @ 81A39C4 push {r4,r5,lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 @@ -58355,7 +58355,7 @@ _081A3A0C: .4byte _081A3A98 .4byte _081A3AAC _081A3A28: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r4, 1 lsls r2, r5, 2 @@ -58365,7 +58365,7 @@ _081A3A28: b _081A3AB4 .pool _081A3A3C: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r4, 1 lsls r2, r5, 2 @@ -58374,7 +58374,7 @@ _081A3A3C: b _081A3AB4 .pool _081A3A54: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r4, 1 lsls r2, r5, 2 @@ -58383,14 +58383,14 @@ _081A3A54: b _081A3AB4 .pool _081A3A6C: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r4, 1 ldr r2, =0x00000dda b _081A3AB4 .pool _081A3A80: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r4, 1 lsls r2, r5, 2 @@ -58399,14 +58399,14 @@ _081A3A80: b _081A3AB4 .pool _081A3A98: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r4, 1 ldr r2, =0x00000e04 b _081A3AB4 .pool _081A3AAC: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r4, 1 ldr r2, =0x00000e1a @@ -58428,7 +58428,7 @@ _081A3AC6: sub_81A3ACC: @ 81A3ACC push {r4,r5,lr} movs r2, 0 - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r4, =0x00000cb4 ldr r0, =0x0000ffff adds r3, r0, 0 @@ -58502,7 +58502,7 @@ sub_81A3B64: @ 81A3B64 mov r6, r8 push {r6,r7} movs r5, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 @@ -58535,7 +58535,7 @@ _081A3BB4: .4byte _081A3C44 .4byte _081A3C60 _081A3BD0: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r4, 1 lsls r2, r6, 2 @@ -58545,7 +58545,7 @@ _081A3BD0: b _081A3C68 .pool _081A3BE4: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r4, 1 lsls r2, r6, 2 @@ -58557,7 +58557,7 @@ _081A3BE4: b _081A3C78 .pool _081A3C00: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r4, 1 lsls r2, r6, 2 @@ -58566,14 +58566,14 @@ _081A3C00: b _081A3C68 .pool _081A3C18: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r4, 1 ldr r2, =0x00000dda b _081A3C68 .pool _081A3C2C: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r4, 1 lsls r2, r6, 2 @@ -58582,7 +58582,7 @@ _081A3C2C: b _081A3C68 .pool _081A3C44: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r4, 1 ldr r2, =0x00000e04 @@ -58593,7 +58593,7 @@ _081A3C44: b _081A3C70 .pool _081A3C60: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r4, 1 ldr r2, =0x00000e1a @@ -58633,18 +58633,18 @@ _081A3C84: bne _081A3CA6 adds r5, 0xA _081A3CA6: - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r1, [r6] ldr r4, =0x00000eb8 adds r1, r4 ldrh r0, [r1] adds r0, r5 strh r0, [r1] - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0 movs r2, 0 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, [r6] adds r2, r0, r4 ldrh r0, [r2] @@ -58739,7 +58739,7 @@ _081A3D94: thumb_func_start sub_81A3DA0 sub_81A3DA0: @ 81A3DA0 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, =gUnknown_020375E2 ldrh r1, [r1] ldr r2, [r0] @@ -58805,60 +58805,60 @@ _081A3E0C: _081A3E38: cmp r5, r4 bne _081A3E50 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085CCB79 - bl AppendString + bl StringAppend b _081A3EC8 .pool _081A3E50: cmp r5, r4 ble _081A3EC8 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085CCB7F - bl AppendString + bl StringAppend b _081A3EC8 .pool _081A3E68: cmp r4, r5 bne _081A3E80 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085CCB79 - bl AppendString + bl StringAppend b _081A3E88 .pool _081A3E80: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085CCB7F - bl AppendString + bl StringAppend _081A3E88: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085CCB86 - bl AppendString + bl StringAppend b _081A3EC8 .pool _081A3EA0: cmp r4, r5 bne _081A3EB8 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085CCB79 - bl AppendString + bl StringAppend b _081A3EC0 .pool _081A3EB8: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085CCB7F - bl AppendString + bl StringAppend _081A3EC0: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085CCB84 - bl AppendString + bl StringAppend _081A3EC8: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r1, 0xB muls r1, r6 ldr r2, =gSpeciesNames adds r1, r2 - bl AppendString + bl StringAppend _081A3ED6: adds r0, r4, 0 pop {r4-r6} @@ -59061,27 +59061,27 @@ _081A404E: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 mov r8, r0 adds r0, r4, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r7, r0, 16 adds r0, r4, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r6, r0, 24 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 ldr r0, =0x000040cf @@ -59164,7 +59164,7 @@ _081A412A: cmp r2, r0 bne _081A4112 _081A4134: - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 movs r0, 0xFF strb r0, [r1] ldr r1, =gUnknown_020375E0 @@ -59196,13 +59196,13 @@ _081A416A: ldrb r4, [r0] cmp r4, 0 bne _081A41A4 - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 ldr r1, =gUnknown_085CCB82 adds r0, r4, 0 - bl AppendString + bl StringAppend ldr r1, =gUnknown_085CCB88 adds r0, r4, 0 - bl AppendString + bl StringAppend b _081A4202 .pool _081A41A4: @@ -59210,26 +59210,26 @@ _081A41A4: ands r0, r4 cmp r0, 0 beq _081A41C0 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085CCB84 - bl AppendString + bl StringAppend b _081A41C8 .pool _081A41C0: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085CCB82 - bl AppendString + bl StringAppend _081A41C8: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085CCB8C - bl AppendString + bl StringAppend b _081A4202 .pool _081A41E0: ldr r1, =gUnknown_020375E0 movs r0, 0 strh r0, [r1] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r0, =gUnknown_020375F0 ldrb r0, [r0] @@ -59266,7 +59266,7 @@ sub_81A4224: @ 81A4224 thumb_func_start sub_81A4230 sub_81A4230: @ 81A4230 push {r4-r7,lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 @@ -59301,7 +59301,7 @@ _081A4278: .4byte _081A4368 .4byte _081A437C _081A4294: - ldr r7, =gUnknown_03005D90 + ldr r7, =gSaveBlock2Ptr ldr r0, [r7] lsls r4, 1 lsls r1, r5, 2 @@ -59331,7 +59331,7 @@ _081A4294: b _081A4392 .pool _081A42DC: - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r0, [r6] lsls r2, r4, 1 lsls r1, r5, 2 @@ -59357,7 +59357,7 @@ _081A42F8: b _081A4392 .pool _081A431C: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] lsls r0, r4, 1 lsls r1, r5, 2 @@ -59368,7 +59368,7 @@ _081A431C: b _081A4388 .pool _081A4338: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r4, 1 ldr r2, =0x00000dda @@ -59376,7 +59376,7 @@ _081A4338: b _081A4386 .pool _081A434C: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] lsls r0, r4, 1 lsls r1, r5, 2 @@ -59387,7 +59387,7 @@ _081A434C: b _081A4388 .pool _081A4368: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r4, 1 ldr r2, =0x00000e04 @@ -59395,7 +59395,7 @@ _081A4368: b _081A4386 .pool _081A437C: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r4, 1 ldr r3, =0x00000e1a @@ -59422,10 +59422,10 @@ sub_81A43A8: @ 81A43A8 push {r4-r6,lr} sub sp, 0x4 movs r4, 0 - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr movs r5, 0x64 _081A43B2: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r4, 1 ldr r2, =0x00000caa @@ -59443,12 +59443,12 @@ _081A43B2: adds r0, r1 movs r1, 0xC movs r2, 0 - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1] adds r0, r4, 0 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xC mov r2, sp @@ -59472,7 +59472,7 @@ sub_81A4410: @ 81A4410 ldr r4, =gUnknown_020375F0 bl sub_8185338 strh r0, [r4] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r0, =0x00000ca9 adds r1, r0 @@ -59498,14 +59498,14 @@ sub_81A443C: @ 81A443C b _081A446E .pool _081A4450: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_02038BCA ldrh r1, [r1] bl sub_8162E20 b _081A446E .pool _081A4464: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_02038BCA ldrh r1, [r1] bl sub_8162E20 @@ -59526,7 +59526,7 @@ sub_81A447C: @ 81A447C movs r0, 0 str r0, [sp] _081A448C: - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] ldr r2, [sp] lsls r1, r2, 1 @@ -59547,7 +59547,7 @@ _081A448C: movs r2, 0x64 adds r1, r0, 0 muls r1, r2 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r7, r1, r0 _081A44BA: movs r5, 0 @@ -59557,7 +59557,7 @@ _081A44BA: adds r0, r6, 0x1 mov r10, r0 _081A44C6: - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] ldr r2, =0x00000caa adds r0, r2 @@ -59569,18 +59569,18 @@ _081A44C6: movs r0, 0xEA lsls r0, 1 adds r1, r0 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, [r2] adds r0, r1 adds r1, r5, 0 adds r1, 0xD movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 adds r0, r7, 0 mov r1, r8 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r4, r0 beq _081A4508 adds r0, r5, 0x1 @@ -59601,9 +59601,9 @@ _081A4516: lsrs r6, r0, 24 cmp r6, 0x3 bls _081A44BA - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r1, [r2] ldr r4, =0x00000caa adds r1, r4 @@ -59616,7 +59616,7 @@ _081A4516: movs r1, 0x8E lsls r1, 2 adds r0, r1 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty ldr r4, [sp] adds r1, r4, 0 muls r1, r3 @@ -59720,11 +59720,11 @@ sub_81A4594: @ 81A4594 bls _081A4618 adds r1, r0, 0 _081A4618: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 movs r2, 0x1 movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r5, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r5, =gStringVar4 ldr r1, =gUnknown_08611D08 ldr r0, [sp, 0x4C] lsls r0, 2 @@ -59732,7 +59732,7 @@ _081A4618: ldr r4, [r0] adds r0, r5, 0 adds r1, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 adds r1, r4, 0 movs r2, 0xC8 @@ -59847,7 +59847,7 @@ sub_81A4684: @ 81A4684 _081A4734: add r0, sp, 0xC adds r1, r4, 0 - bl CopyString + bl StringCopy _081A473C: ldr r2, =gUnknown_0203AB74 mov r9, r2 @@ -59879,16 +59879,16 @@ _081A473C: bls _081A4778 adds r1, r0, 0 _081A4778: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 movs r2, 0x1 movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r5, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r5, =gStringVar4 ldr r0, =gUnknown_08611D08 ldr r4, [r0, 0x24] adds r0, r5, 0 adds r1, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 adds r1, r4, 0 movs r2, 0xC8 @@ -59939,7 +59939,7 @@ sub_81A47E0: @ 81A47E0 bl sub_80E8260 add r0, sp, 0x30 mov r12, r0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r3, [sp, 0x40] lsls r1, r3, 1 @@ -60051,7 +60051,7 @@ sub_81A48B4: @ 81A48B4 str r0, [sp, 0x70] add r1, sp, 0x5C mov r12, r1 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] movs r0, 0x54 mov r2, r10 @@ -60158,18 +60158,18 @@ sub_81A4998: @ 81A4998 sub sp, 0x94 adds r7, r0, 0 str r1, [sp, 0x90] - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r4, =gUnknown_08611CB0 lsls r5, r7, 3 adds r1, r5, r4 ldr r1, [r1] - bl CopyString - ldr r6, =gUnknown_02021FC4 + bl StringCopy + ldr r6, =gStringVar4 adds r4, 0x4 adds r5, r4 ldr r1, [r5] adds r0, r6, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r0, =gUnknown_0203AB74 mov r8, r0 ldrb r0, [r0] @@ -60208,7 +60208,7 @@ sub_81A4998: @ 81A4998 bl Print cmp r7, 0x9 bne _081A4A6C - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r0, [r2] ldr r1, =0x00000ee8 adds r0, r1 @@ -60323,7 +60323,7 @@ sub_81A4B14: @ 81A4B14 push {r5-r7} sub sp, 0x8 movs r1, 0 - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr _081A4B24: movs r6, 0 lsls r0, r1, 1 @@ -60379,7 +60379,7 @@ _081A4B44: cmp r1, 0x8 ble _081A4B24 movs r6, 0 - ldr r7, =gUnknown_03005D90 + ldr r7, =gSaveBlock2Ptr movs r2, 0x54 mov r10, r2 movs r3, 0xFF @@ -60465,7 +60465,7 @@ sub_81A4C30: @ 81A4C30 movs r0, 0xFA lsls r0, 1 adds r6, r7, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty mov r8, r0 _081A4C4E: mov r0, r8 @@ -60486,7 +60486,7 @@ _081A4C4E: bl sav2_gender2_inplace_and_xFE strb r5, [r4] adds r4, r7, 0 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty movs r0, 0xFA lsls r0, 1 adds r6, r7, r0 @@ -60512,7 +60512,7 @@ _081A4C84: thumb_func_start sub_81A4CB0 sub_81A4CB0: @ 81A4CB0 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -60548,7 +60548,7 @@ _081A4CDA: thumb_func_start sub_81A4D00 sub_81A4D00: @ 81A4D00 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -60585,7 +60585,7 @@ _081A4D2A: sub_81A4D50: @ 81A4D50 push {r4,lr} adds r4, r0, 0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -60735,9 +60735,9 @@ _081A4E70: lsls r0, 2 mov r8, r0 _081A4E96: - bl GenerateRandomNumber + bl Random adds r4, r0, 0 - bl GenerateRandomNumber + bl Random lsls r4, 16 lsrs r7, r4, 16 lsls r0, 16 @@ -60773,7 +60773,7 @@ _081A4E96: adds r3, r4, 0 muls r3, r0 mov r8, r3 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty add r1, r8 mov r10, r1 ldr r4, [sp, 0x14] @@ -60806,7 +60806,7 @@ _081A4E96: bl pokemon_setattr movs r7, 0 mov r6, r8 - ldr r3, =gUnknown_02024744 + ldr r3, =gEnemyParty _081A4F32: adds r1, r7, 0 adds r1, 0x1A @@ -60833,7 +60833,7 @@ _081A4F32: muls r6, r2 ldr r3, =gUnknown_08611578 mov r8, r3 - ldr r3, =gUnknown_02024744 + ldr r3, =gEnemyParty adds r5, r4, 0 _081A4F6A: ldr r4, [sp, 0x38] @@ -60869,7 +60869,7 @@ _081A4F9C: movs r1, 0x64 adds r4, r0, 0 muls r4, r1 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 adds r0, r4, 0 movs r1, 0x20 @@ -61114,7 +61114,7 @@ sub_81A51A8: @ 81A51A8 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -61144,7 +61144,7 @@ _081A51E4: b _081A5228 .pool _081A51F4: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r2, =gUnknown_08611DB0 lsls r1, 2 adds r1, r2 @@ -61152,11 +61152,11 @@ _081A51F4: lsls r1, r4, 2 adds r1, r2 ldr r1, [r1] - bl CopyString + bl StringCopy b _081A5228 .pool _081A5214: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r2, =gUnknown_08611DB8 lsls r1, 2 adds r1, r2 @@ -61164,7 +61164,7 @@ _081A5214: lsls r1, r4, 2 adds r1, r2 ldr r1, [r1] - bl CopyString + bl StringCopy _081A5228: pop {r4,r5} pop {r0} @@ -61547,7 +61547,7 @@ _081A55C4: ldrsb r1, [r0, r1] b _081A5612 _081A55D8: - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons mov r9, r3 movs r5, 0x58 adds r0, r7, 0 @@ -61668,7 +61668,7 @@ sub_81A56B4: @ 81A56B4 strb r0, [r1, 0x1] strb r0, [r3] strb r0, [r3, 0x1] - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons ldrh r1, [r0, 0x28] strh r1, [r2] adds r0, 0x80 @@ -61720,7 +61720,7 @@ sub_81A5718: @ 81A5718 ldr r0, =0x000002a2 adds r4, r2, r0 ldrb r2, [r4] - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable lsls r1, r3, 2 adds r1, r0 ldr r1, [r1] @@ -61736,7 +61736,7 @@ sub_81A5718: @ 81A5718 b _081A57D8 .pool _081A576C: - ldr r0, =gUnknown_0202427C + ldr r0, =gBattleMoveFlags ldrb r1, [r0] movs r0, 0x29 ands r0, r1 @@ -61885,7 +61885,7 @@ sub_81A586C: @ 81A586C adds r3, r1 lsls r2, r0, 1 adds r2, r3 - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons movs r4, 0x58 adds r1, r0, 0 muls r1, r4 @@ -61913,7 +61913,7 @@ _081A58A4: thumb_func_start sub_81A58B4 sub_81A58B4: @ 81A58B4 push {r4-r6,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r1, [r4] ldr r3, =0x00000ca9 adds r0, r1, r3 @@ -61967,7 +61967,7 @@ _081A591E: adds r0, r1 strh r2, [r0] _081A5930: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x4 ldrsb r1, [r0, r1] @@ -61989,7 +61989,7 @@ _081A5930: thumb_func_start sub_81A5964 sub_81A5964: @ 81A5964 push {r4,lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] ldr r1, =0x00000ca9 adds r0, r3, r1 @@ -62057,7 +62057,7 @@ _081A59EE: thumb_func_start sub_81A59FC sub_81A59FC: @ 81A59FC push {lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r1, =0x00000ca9 adds r0, r2, r1 @@ -62149,7 +62149,7 @@ _081A5ABA: thumb_func_start sub_81A5AC4 sub_81A5AC4: @ 81A5AC4 push {r4,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =gUnknown_020375E2 ldrh r1, [r1] @@ -62177,7 +62177,7 @@ sub_81A5AC4: @ 81A5AC4 thumb_func_start sub_81A5B08 sub_81A5B08: @ 81A5B08 push {r4,r5,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r1, [r4] ldr r2, =0x00000ca9 adds r0, r1, r2 @@ -62190,7 +62190,7 @@ sub_81A5B08: @ 81A5B08 ldrh r0, [r1] cmp r0, 0x29 bls _081A5B58 - bl GenerateRandomNumber + bl Random ldr r4, [r4] ldr r5, =gUnknown_08611FAC lsls r0, 16 @@ -62206,7 +62206,7 @@ sub_81A5B08: @ 81A5B08 b _081A5B76 .pool _081A5B58: - bl GenerateRandomNumber + bl Random ldr r4, [r4] ldr r5, =gUnknown_08611FA0 lsls r0, 16 @@ -62230,7 +62230,7 @@ _081A5B76: thumb_func_start sub_81A5B88 sub_81A5B88: @ 81A5B88 push {r4,r5,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =0x00000dd8 adds r0, r1 @@ -62245,7 +62245,7 @@ sub_81A5B88: @ 81A5B88 ldr r1, =0x00000dd8 adds r0, r1 ldrh r0, [r0] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name ldr r0, [r4] ldr r1, =0x00000dd8 @@ -62270,7 +62270,7 @@ _081A5BD6: thumb_func_start sub_81A5BE0 sub_81A5BE0: @ 81A5BE0 push {lr} - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_02038BCA ldrh r1, [r1] bl sub_8162E20 @@ -62584,7 +62584,7 @@ sub_81A5E74: @ 81A5E74 thumb_func_start sub_81A5E94 sub_81A5E94: @ 81A5E94 push {r4-r7,lr} - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r0, [r5] ldr r4, =0x00000ca9 adds r0, r4 @@ -62646,7 +62646,7 @@ _081A5F0A: movs r0, 0 strb r0, [r1] movs r2, 0 - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr movs r4, 0xE7 lsls r4, 4 ldr r0, =0x0000ffff @@ -62702,7 +62702,7 @@ _081A5F40: thumb_func_start sub_81A5FA8 sub_81A5FA8: @ 81A5FA8 push {r4-r7,lr} - ldr r7, =gUnknown_03005D90 + ldr r7, =gSaveBlock2Ptr ldr r0, [r7] ldr r1, =0x00000ca9 adds r0, r1 @@ -62777,7 +62777,7 @@ _081A6044: thumb_func_start sub_81A6054 sub_81A6054: @ 81A6054 push {r4-r6,lr} - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r0, [r6] ldr r1, =0x00000ca9 adds r0, r1 @@ -62876,7 +62876,7 @@ _081A6128: thumb_func_start sub_81A613C sub_81A613C: @ 81A613C push {r4,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =gUnknown_020375E2 ldrh r1, [r1] @@ -62945,7 +62945,7 @@ sub_81A61B0: @ 81A61B0 mov r5, r8 push {r5-r7} sub sp, 0x28 - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =0x00000ca9 adds r0, r1 @@ -62995,7 +62995,7 @@ _081A61FA: ldr r2, =0x00000cb4 adds r0, r1, r2 ldrh r0, [r0] - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr cmp r0, r3 beq _081A6244 ldr r1, [r6] @@ -63016,7 +63016,7 @@ _081A6244: ldr r0, [r4] ldr r1, =0x00000cb2 adds r0, r1 - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldrh r0, [r0] cmp r7, r0 bne _081A61FA @@ -63059,7 +63059,7 @@ _081A627A: cmp r0, 0xC9 beq _081A636E movs r3, 0 - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr mov r8, r1 adds r5, r0, 0 ldr r1, [r6] @@ -63202,7 +63202,7 @@ sub_81A63CC: @ 81A63CC push {r4-r7,lr} mov r7, r8 push {r7} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 @@ -63221,7 +63221,7 @@ _081A63FC: _081A6400: str r0, [r1] movs r7, 0 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr mov r8, r2 _081A6408: mov r0, r8 @@ -63242,7 +63242,7 @@ _081A6408: movs r0, 0x64 adds r5, r7, 0 muls r5, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r5, r0 adds r0, r5, 0 movs r1, 0x28 @@ -63257,7 +63257,7 @@ _081A6408: adds r0, r5, 0 movs r1, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData mov r2, r8 ldr r1, [r2] ldr r2, =0x00000e74 @@ -63307,7 +63307,7 @@ sub_81A64C4: @ 81A64C4 mov r5, r8 push {r5-r7} sub sp, 0x24 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000ca9 adds r2, r0, r1 @@ -63353,7 +63353,7 @@ _081A6522: ldr r2, =gUnknown_0203BC8C mov r9, r2 _081A6534: - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r2, [r4] mov r5, r8 lsls r5, 1 @@ -63372,7 +63372,7 @@ _081A6534: movs r1, 0x64 mov r0, r8 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 mov r4, r9 ldr r1, [r4] @@ -63424,7 +63424,7 @@ _081A65A2: movs r0, 0x64 mov r6, r8 muls r6, r0 - ldr r3, =gUnknown_020244EC + ldr r3, =gPlayerParty _081A65C4: mov r1, r9 ldr r0, [r1] @@ -63449,7 +63449,7 @@ _081A65E2: movs r2, 0x64 mov r4, r8 muls r4, r2 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r4, r5 bl pokemon_calc_effective_stats movs r0, 0 @@ -63474,7 +63474,7 @@ _081A6602: movs r5, 0x64 mov r4, r8 muls r4, r5 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x20 @@ -63493,7 +63493,7 @@ _081A6602: mov r2, r10 add r2, r8 lsls r2, 2 - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r0, [r5] adds r2, r0 ldr r0, =0x00000e79 @@ -63520,7 +63520,7 @@ _081A667A: ldr r4, =gUnknown_0203BC8C mov r9, r4 _081A6682: - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r3, [r5] mov r0, r8 adds r0, 0x3 @@ -63538,7 +63538,7 @@ _081A6682: movs r1, 0x64 mov r0, r8 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 mov r4, r9 ldr r1, [r4] @@ -63593,7 +63593,7 @@ _081A66F4: movs r0, 0x64 mov r6, r8 muls r6, r0 - ldr r3, =gUnknown_02024744 + ldr r3, =gEnemyParty _081A6716: mov r1, r9 ldr r0, [r1] @@ -63618,7 +63618,7 @@ _081A6734: movs r2, 0x64 mov r4, r8 muls r4, r2 - ldr r5, =gUnknown_02024744 + ldr r5, =gEnemyParty adds r0, r4, r5 bl pokemon_calc_effective_stats movs r6, 0 @@ -63640,7 +63640,7 @@ _081A674E: movs r2, 0x64 mov r4, r8 muls r4, r2 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 mov r5, r9 ldr r0, [r5] @@ -63655,7 +63655,7 @@ _081A674E: mov r2, r10 add r2, r8 lsls r2, 2 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] adds r2, r0 ldr r5, =0x00000e9d @@ -63697,7 +63697,7 @@ sub_81A67EC: @ 81A67EC mov r1, sp adds r1, 0x18 str r1, [sp, 0x3C] - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr mov r9, r2 movs r2, 0 adds r3, r1, 0 @@ -63889,7 +63889,7 @@ _081A6994: _081A699C: cmp r3, r6 bne _081A69E2 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] mov r5, r8 lsls r3, r5, 1 @@ -64219,7 +64219,7 @@ _081A6C0C: thumb_func_start sub_81A6C1C sub_81A6C1C: @ 81A6C1C push {r4,lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 @@ -64241,9 +64241,9 @@ _081A6C4C: _081A6C50: movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r2, [r1] lsls r1, r4, 1 adds r1, r4 @@ -64306,7 +64306,7 @@ sub_81A6CD0: @ 81A6CD0 mov r5, r8 push {r5-r7} sub sp, 0x34 - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =0x00000ca9 adds r0, r1 @@ -64383,7 +64383,7 @@ _081A6D6A: b _081A6EB8 _081A6D78: movs r2, 0 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] movs r3, 0xE7 lsls r3, 4 @@ -64489,7 +64489,7 @@ _081A6E0C: movs r0, 0x64 mov r5, r9 muls r5, r0 - ldr r6, =gUnknown_02024744 + ldr r6, =gEnemyParty adds r0, r5, r6 ldrh r1, [r4] ldr r7, [sp, 0x20] @@ -64530,7 +64530,7 @@ _081A6E6E: movs r0, 0x64 mov r4, r9 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 adds r0, r4, 0 movs r1, 0x20 @@ -64612,7 +64612,7 @@ _081A6F38: adds r0, 0x1 lsls r0, 16 lsrs r5, r0, 16 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r5, 0 @@ -64633,7 +64633,7 @@ sub_81A6F70: @ 81A6F70 push {lr} lsls r0, 24 lsls r1, 24 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r2, [r2] lsrs r1, 23 lsrs r0, 22 @@ -64667,7 +64667,7 @@ _081A6FA8: thumb_func_start sub_81A6FB4 sub_81A6FB4: @ 81A6FB4 push {r4,r5,lr} - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r0, [r5] ldr r1, =0x00000ca9 adds r0, r1 @@ -64856,7 +64856,7 @@ _081A7132: thumb_func_start sub_81A7140 sub_81A7140: @ 81A7140 push {lr} - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] ldr r2, =0x00000ca9 adds r0, r2 @@ -64965,7 +64965,7 @@ _081A723A: thumb_func_start sub_81A7248 sub_81A7248: @ 81A7248 push {r4,r5,lr} - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] ldr r2, =0x00000ca9 adds r0, r2 @@ -65119,7 +65119,7 @@ _081A73AA: thumb_func_start sub_81A73B8 sub_81A73B8: @ 81A73B8 push {lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000cb2 adds r0, r1 @@ -65171,7 +65171,7 @@ sub_81A740C: @ 81A740C thumb_func_start sub_81A7418 sub_81A7418: @ 81A7418 push {r4,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =gUnknown_020375E2 ldrh r1, [r1] @@ -65273,7 +65273,7 @@ sub_81A74CC: @ 81A74CC thumb_func_start sub_81A74E0 sub_81A74E0: @ 81A74E0 push {r4,lr} - bl GenerateRandomNumber + bl Random adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 @@ -65293,7 +65293,7 @@ sub_81A74E0: @ 81A74E0 thumb_func_start sub_81A7508 sub_81A7508: @ 81A7508 push {lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000cb2 adds r0, r1 @@ -65367,7 +65367,7 @@ _081A759E: bls _081A759E adds r0, r5, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData lsls r2, r0, 16 mov r1, sp strb r0, [r1] @@ -65380,7 +65380,7 @@ _081A759E: bl pokemon_setattr adds r0, r5, 0 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r6, r0, 24 movs r4, 0 @@ -65388,7 +65388,7 @@ _081A75DA: adds r1, r4, 0 adds r1, 0xD adds r0, r5, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 adds r1, r6, 0 @@ -65586,14 +65586,14 @@ _081A7736: movs r4, 0 mov r8, r4 _081A774A: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 bl __umodsi3 lsls r0, 24 lsrs r6, r0, 24 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -65614,7 +65614,7 @@ _081A774A: mov r8, r0 cmp r0, 0x9 bls _081A774A - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r4, =0x00000cb2 adds r0, r4 @@ -65636,7 +65636,7 @@ _081A77A8: _081A77AE: movs r4, 0 mov r9, r4 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -65687,18 +65687,18 @@ _081A7810: ldrb r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r1, r0 adds r0, r5, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData bl pokemon_ailments_get_primary lsls r0, 24 cmp r0, 0 bne _081A7860 adds r0, r5, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081A7860 mov r0, r8 @@ -65708,7 +65708,7 @@ _081A7810: mov r8, r0 adds r0, r5, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 ldr r1, [r7] @@ -65751,7 +65751,7 @@ _081A7898: b _081A78D4 .pool _081A78A4: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r1, r0, 16 movs r2, 0x1 @@ -65785,18 +65785,18 @@ _081A78DC: ldrb r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r1, r0 adds r0, r5, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData bl pokemon_ailments_get_primary lsls r0, 24 cmp r0, 0 bne _081A7946 adds r0, r5, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081A7946 mov r0, r8 @@ -65806,7 +65806,7 @@ _081A78DC: mov r8, r0 adds r0, r5, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 ldr r7, =gUnknown_03001290 @@ -65851,7 +65851,7 @@ _081A7956: thumb_func_start sub_81A7974 sub_81A7974: @ 81A7974 push {r4-r7,lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000cb2 adds r0, r1 @@ -65878,18 +65878,18 @@ _081A79A2: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData bl pokemon_ailments_get_primary lsls r0, 24 cmp r0, 0 bne _081A79D4 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081A79D4 adds r0, r6, 0x1 @@ -65916,7 +65916,7 @@ _081A79E6: sub_81A79EC: @ 81A79EC push {r4-r6,lr} sub sp, 0x8 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] movs r4, 0xE1 lsls r4, 4 @@ -66022,7 +66022,7 @@ _081A7AA0: lsls r0, 24 lsrs r4, r0, 24 _081A7ABE: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r1, 0xE1 lsls r1, 4 @@ -66077,7 +66077,7 @@ _081A7B1C: lsrs r2, r0, 24 cmp r2, 0x7 bls _081A7B06 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r4, 0 @@ -66103,7 +66103,7 @@ _081A7B48: sub_81A7B58: @ 81A7B58 push {r4,lr} ldr r4, =gUnknown_03001294 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x19 @@ -66142,7 +66142,7 @@ sub_81A7B90: @ 81A7B90 bl sub_81A7D00 lsls r0, 24 lsrs r6, r0, 24 - ldr r7, =gUnknown_03005D90 + ldr r7, =gSaveBlock2Ptr ldr r0, [r7] ldr r4, =0x00000ca9 adds r0, r4 @@ -66153,10 +66153,10 @@ sub_81A7B90: @ 81A7B90 adds r0, r1 ldr r0, [r0] str r0, [sp, 0x4] - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r5, r0, 0 lsls r0, r5, 16 lsrs r0, 16 @@ -66215,7 +66215,7 @@ _081A7C32: movs r0, 0 b _081A7CE2 _081A7C4A: - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty ldr r1, =gBaseStats mov r8, r1 lsls r6, 2 @@ -66255,14 +66255,14 @@ _081A7C4A: mov r7, r9 cmp r0, 0 beq _081A7CA8 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x1 ands r0, r1 _081A7CA8: str r0, [sp] - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty movs r1, 0x2E mov r2, sp bl pokemon_setattr @@ -66280,12 +66280,12 @@ _081A7CBA: ldrh r1, [r0] lsls r2, r4, 24 lsrs r2, 24 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty bl sub_80691F4 adds r4, 0x1 cmp r4, 0x3 ble _081A7CBA - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty bl pokemon_calc_effective_stats movs r0, 0x1 _081A7CE2: @@ -66303,7 +66303,7 @@ _081A7CE2: thumb_func_start sub_81A7D00 sub_81A7D00: @ 81A7D00 push {lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r2, =0x00000ca9 adds r0, r1, r2 @@ -66625,7 +66625,7 @@ _081A7F54: bls _081A7F54 movs r5, 0 _081A7F6C: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -66633,7 +66633,7 @@ _081A7F6C: lsls r0, 24 lsrs r0, 24 mov r8, r0 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -66663,16 +66663,16 @@ _081A7FB0: ldrb r1, [r4] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r7, r1, r0 adds r0, r7, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r5, r0, 16 adds r0, r7, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r6, r0, 16 str r4, [sp, 0x8] @@ -66680,7 +66680,7 @@ _081A7FB0: bcc _081A8044 adds r0, r7, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData bl pokemon_ailments_get_primary lsls r0, 24 cmp r0, 0 @@ -66692,7 +66692,7 @@ _081A7FB0: _081A7FFC: adds r0, r7, 0 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r0, 24 mov r9, r0 @@ -66708,7 +66708,7 @@ _081A8014: adds r1, r4, 0 adds r1, 0xD adds r0, r7, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 mov r1, r9 @@ -66719,7 +66719,7 @@ _081A8014: adds r1, r4, 0 adds r1, 0x11 adds r0, r7, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r5, r0, 16 cmp r5, r6 @@ -66735,7 +66735,7 @@ _081A8048: ldrb r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 bl sub_81A7594 ldr r0, [sp, 0x4] @@ -66822,8 +66822,8 @@ sub_81A80DC: @ 81A80DC beq _081A8138 movs r0, 0x1 strh r0, [r4] - bl GenerateRandomNumber - ldr r5, =gUnknown_03005D90 + bl Random + ldr r5, =gSaveBlock2Ptr ldr r4, [r5] lsls r0, 16 lsrs r0, 16 @@ -66850,8 +66850,8 @@ sub_81A80DC: @ 81A80DC b _081A8248 .pool _081A8138: - bl GenerateRandomNumber - ldr r7, =gUnknown_03005D90 + bl Random + ldr r7, =gSaveBlock2Ptr ldr r4, [r7] lsls r0, 16 lsrs r0, 16 @@ -66918,8 +66918,8 @@ _081A81B4: cmp r2, r6 bcc _081A8184 _081A81BE: - bl GenerateRandomNumber - ldr r7, =gUnknown_03005D90 + bl Random + ldr r7, =gSaveBlock2Ptr ldr r4, [r7] lsls r0, 16 lsrs r0, 16 @@ -66962,7 +66962,7 @@ _081A81BE: orrs r0, r1 strb r0, [r2] _081A821C: - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r0, [r5] movs r4, 0xE1 lsls r4, 4 @@ -66998,7 +66998,7 @@ _081A824C: thumb_func_start sub_81A825C sub_81A825C: @ 81A825C ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r2, 0xE1 lsls r2, 4 @@ -67015,7 +67015,7 @@ sub_81A825C: @ 81A825C sub_81A827C: @ 81A827C ldr r2, =gUnknown_020375F0 ldr r1, =gUnknown_0861266C - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r3, 0xE1 lsls r3, 4 @@ -67039,7 +67039,7 @@ sub_81A82A4: @ 81A82A4 bne _081A82B0 movs r7, 0x1 _081A82B0: - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r1, [r4] ldr r2, =0x00000ca9 adds r0, r1, r2 @@ -67099,7 +67099,7 @@ _081A831A: ldrh r0, [r5] movs r1, 0 bl sub_8162614 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r0, =0x00000cb2 adds r2, r1, r0 @@ -67123,7 +67123,7 @@ _081A8356: thumb_func_start sub_81A8374 sub_81A8374: @ 81A8374 push {r4-r7,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r1, [r4] ldr r2, =0x00000ca9 adds r0, r1, r2 @@ -67184,7 +67184,7 @@ _081A83EE: ldrh r0, [r5] movs r1, 0 bl sub_8162614 - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r1, [r3] ldr r0, =0x00000cb2 adds r2, r1, r0 @@ -67218,7 +67218,7 @@ _081A8426: ldrh r0, [r0] cmp r0, r4 beq _081A8466 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] subs r2, 0x2 adds r0, r1, r2 @@ -67245,7 +67245,7 @@ _081A8466: ldrh r0, [r5] movs r1, 0x1 bl sub_8162614 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r0, =0x00000cb2 adds r2, r1, r0 @@ -67270,7 +67270,7 @@ _081A849A: sub_81A84B4: @ 81A84B4 push {r4,r5,lr} movs r2, 0 - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r4, =0x00000cb4 ldr r0, =0x0000ffff adds r3, r0, 0 @@ -67338,13 +67338,13 @@ _081A8542: thumb_func_start sub_81A8554 sub_81A8554: @ 81A8554 push {r4-r6,lr} - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty movs r6, 0 movs r4, 0 _081A855C: adds r0, r5, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _081A856E adds r0, r6, 0x1 @@ -67375,7 +67375,7 @@ sub_81A8590: @ 81A8590 push {r4-r6,lr} lsls r0, 24 movs r6, 0 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r2, [r1] ldr r3, =0x00000ca9 adds r1, r2, r3 @@ -67473,7 +67473,7 @@ sub_81A8658: @ 81A8658 push {r4,lr} ldr r3, =gUnknown_08612675 ldr r2, =gUnknown_020375E6 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r1, 0xE1 lsls r1, 4 @@ -67499,7 +67499,7 @@ sub_81A8658: @ 81A8658 thumb_func_start sub_81A869C sub_81A869C: @ 81A869C - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r0, =gUnknown_020375E2 ldrb r1, [r0] @@ -67534,30 +67534,30 @@ _081A86D4: movs r0, 0x64 mov r1, r10 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r7, r1, r0 adds r0, r7, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 adds r0, r7, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r5, r0, 16 cmp r4, r5 bcc _081A8762 adds r0, r7, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData bl pokemon_ailments_get_primary lsls r0, 24 cmp r0, 0 bne _081A8762 adds r0, r7, 0 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r0, 24 mov r8, r0 @@ -67574,7 +67574,7 @@ _081A8732: adds r1, r6, 0 adds r1, 0xD adds r0, r7, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 mov r1, r8 @@ -67585,7 +67585,7 @@ _081A8732: adds r1, r6, 0 adds r1, 0x11 adds r0, r7, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 cmp r4, r5 @@ -67624,8 +67624,8 @@ _081A8786: sub_81A8794: @ 81A8794 push {r4-r7,lr} movs r5, 0 - ldr r7, =gUnknown_03005D8C - ldr r6, =gUnknown_03005D90 + ldr r7, =gSaveBlock1Ptr + ldr r6, =gSaveBlock2Ptr _081A879C: ldr r0, [r6] lsls r4, r5, 1 @@ -67641,7 +67641,7 @@ _081A879C: ldr r0, [r7] adds r0, r1 movs r1, 0xC - bl pokemon_getattr + bl GetMonData ldr r1, [r6] ldr r2, =0x00000e12 adds r1, r2 @@ -67663,7 +67663,7 @@ sub_81A87E8: @ 81A87E8 push {r4,lr} movs r4, 0 _081A87EC: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] lsls r3, r4, 1 ldr r1, =0x00000caa @@ -67693,7 +67693,7 @@ _081A87EC: thumb_func_start sub_81A8830 sub_81A8830: @ 81A8830 push {r4-r6,lr} - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r1, [r3] ldr r2, =0x00000ca9 adds r0, r1, r2 @@ -67747,10 +67747,10 @@ sub_81A88B0: @ 81A88B0 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4, 0 movs r1, 0x6 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _081A8904 adds r0, r4, 0 @@ -67764,7 +67764,7 @@ sub_81A88B0: @ 81A88B0 _081A88D6: adds r0, r4, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r0, 24 cmp r0, 0x5 @@ -67772,7 +67772,7 @@ _081A88D6: subs r0, 0x5 cmp r5, r0 bgt _081A8904 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x1 @@ -67879,7 +67879,7 @@ sub_81A89A0: @ 81A89A0 lsls r0, 24 lsrs r0, 24 str r0, [sp] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0xC7 lsls r1, 4 @@ -67989,7 +67989,7 @@ _081A8A74: adds r0, r3 strh r0, [r4, 0x6] ldrb r0, [r4] - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr ldr r2, [r6] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] @@ -68061,7 +68061,7 @@ _081A8B0C: lsls r0, 2 mov r10, r0 _081A8B22: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r3, 0xC7 lsls r3, 4 @@ -68145,7 +68145,7 @@ _081A8BB4: lsls r0, 3 adds r0, r7 ldrb r0, [r0] - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] @@ -68238,7 +68238,7 @@ _081A8C72: lsls r0, 3 adds r0, r7 ldrb r0, [r0] - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] @@ -68316,7 +68316,7 @@ _081A8D12: lsls r0, 3 adds r0, r7 ldrb r0, [r0] - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] @@ -68381,7 +68381,7 @@ sub_81A8D94: @ 81A8D94 lsrs r4, r0, 24 lsls r1, 24 lsrs r6, r1, 24 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0xC7 lsls r1, 4 @@ -68525,7 +68525,7 @@ sub_81A8E7C: @ 81A8E7C thumb_func_start sub_81A8E9C sub_81A8E9C: @ 81A8E9C push {r4-r6,lr} - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r1, [r3] ldr r4, =0x00000ca9 adds r0, r1, r4 @@ -68591,7 +68591,7 @@ _081A8F14: thumb_func_start sub_81A8F38 sub_81A8F38: @ 81A8F38 push {r4,lr} - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] ldr r2, =0x00000ca9 adds r0, r2 @@ -68706,7 +68706,7 @@ _081A903A: thumb_func_start sub_81A9048 sub_81A9048: @ 81A9048 push {lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r1, =0x00000ca9 adds r0, r2, r1 @@ -68808,7 +68808,7 @@ _081A9126: thumb_func_start sub_81A9134 sub_81A9134: @ 81A9134 push {r4,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =gUnknown_020375E2 ldrh r1, [r1] @@ -68838,7 +68838,7 @@ sub_81A9134: @ 81A9134 thumb_func_start sub_81A917C sub_81A917C: @ 81A917C push {r4,r5,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r1, [r4] ldr r2, =0x00000ca9 adds r0, r1, r2 @@ -68851,7 +68851,7 @@ sub_81A917C: @ 81A917C ldrh r0, [r1] cmp r0, 0x29 bls _081A91CC - bl GenerateRandomNumber + bl Random ldr r4, [r4] ldr r5, =gUnknown_08613F34 lsls r0, 16 @@ -68867,7 +68867,7 @@ sub_81A917C: @ 81A917C b _081A91EA .pool _081A91CC: - bl GenerateRandomNumber + bl Random ldr r4, [r4] ldr r5, =gUnknown_08613F28 lsls r0, 16 @@ -68891,7 +68891,7 @@ _081A91EA: thumb_func_start sub_81A91FC sub_81A91FC: @ 81A91FC push {r4,r5,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =0x00000e18 adds r0, r1 @@ -68906,7 +68906,7 @@ sub_81A91FC: @ 81A91FC ldr r1, =0x00000e18 adds r0, r1 ldrh r0, [r0] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name ldr r0, [r4] ldr r1, =0x00000e18 @@ -68932,9 +68932,9 @@ _081A924A: sub_81A9254: @ 81A9254 push {r4,r5,lr} movs r4, 0 - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr _081A925A: - bl GenerateRandomNumber + bl Random ldr r1, [r5] lsls r2, r4, 1 ldr r3, =0x00000e22 @@ -68944,7 +68944,7 @@ _081A925A: adds r4, 0x1 cmp r4, 0x3 ble _081A925A - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000e2a adds r0, r1 @@ -68964,7 +68964,7 @@ CalculateBattlePyramidItemBallItemId: @ 81A9290 mov r5, r8 push {r5-r7} sub sp, 0x4 - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r1, [r5] ldr r2, =0x00000ca9 adds r0, r1, r2 @@ -69024,7 +69024,7 @@ _081A92DE: cmp r5, r4 bge _081A9332 _081A9318: - bl GenerateRandomNumber2 + bl Random2 lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -69097,7 +69097,7 @@ _081A9396: thumb_func_start sub_81A93C8 sub_81A93C8: @ 81A93C8 push {r4,r5,lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0xC7 lsls r1, 4 @@ -69153,7 +69153,7 @@ sub_81A9424: @ 81A9424 movs r0, 0 mov r9, r0 movs r7, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0xC7 lsls r1, 4 @@ -69296,12 +69296,12 @@ _081A9572: lsrs r0, 20 adds r0, r1 ldrb r7, [r0, 0x1] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000e2a adds r0, r1 ldrb r2, [r0] - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable movs r6, 0x7 _081A958E: ldr r0, [r1] @@ -69376,7 +69376,7 @@ _081A95EE: thumb_func_start sub_81A9618 sub_81A9618: @ 81A9618 push {r4,r5,lr} - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r1, [r5] ldr r2, =0x00000ca9 adds r0, r1, r2 @@ -69437,7 +69437,7 @@ sub_81A9684: @ 81A9684 b _081A9754 .pool _081A9698: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =gUnknown_020375E2 ldrh r1, [r1] @@ -69461,7 +69461,7 @@ _081A96B4: ands r0, r1 cmp r0, 0 bne _081A9754 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000e68 adds r1, r0, r2 @@ -69490,7 +69490,7 @@ _081A9710: beq _081A9750 subs r0, 0x1 strh r0, [r1] - ldr r3, =gUnknown_03005D90 + ldr r3, =gSaveBlock2Ptr ldr r1, [r3] ldr r2, =0x00000e68 adds r1, r2 @@ -69533,7 +69533,7 @@ sub_81A975C: @ 81A975C movs r5, 0 movs r0, 0x64 mov r9, r0 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty mov r8, r1 _081A9776: movs r4, 0 @@ -69541,7 +69541,7 @@ _081A9776: mov r6, r9 muls r6, r5 _081A977E: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] lsls r1, r4, 1 ldr r2, =0x00000caa @@ -69597,7 +69597,7 @@ sub_81A97DC: @ 81A97DC ands r0, r1 cmp r0, 0 beq _081A980C - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000cb2 adds r0, r1 @@ -69636,7 +69636,7 @@ sub_81A9834: @ 81A9834 movs r0, 0 str r0, [sp] _081A9844: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, [sp] lsls r1, r2, 1 @@ -69657,20 +69657,20 @@ _081A9844: movs r1, 0 str r1, [sp, 0x10] _081A986C: - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, [r2] adds r0, r6 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 - ldr r3, =gUnknown_020244EC + ldr r3, =gPlayerParty ldr r1, [sp, 0x10] adds r0, r1, r3 movs r1, 0xB movs r2, 0 str r3, [sp, 0x14] - bl pokemon_getattr + bl GetMonData ldr r3, [sp, 0x14] cmp r4, r0 bne _081A993C @@ -69698,20 +69698,20 @@ _081A98C4: _081A98C6: cmp r5, 0x3 bgt _081A98EE - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r0, [r1] add r0, r9 adds r1, r5, 0 adds r1, 0xD movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 adds r1, r6, 0 adds r1, 0xD mov r2, r10 adds r0, r7, r2 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r4, r0 bne _081A98C4 _081A98EE: @@ -69727,14 +69727,14 @@ _081A9900: mov r6, r8 cmp r6, 0x3 ble _081A98AC - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r0, [r1] ldr r2, [sp, 0x8] adds r0, r2 movs r5, 0x8E lsls r5, 2 adds r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty ldr r2, [sp, 0x10] adds r1, r2, r1 movs r2, 0x64 @@ -69766,7 +69766,7 @@ _081A994C: _081A9958: movs r2, 0 str r2, [sp] - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r3, =0x00000caa ldr r2, =gUnknown_0203CEF8 _081A9962: @@ -69939,7 +69939,7 @@ _081A9A98: thumb_func_start sub_81A9AA8 sub_81A9AA8: @ 81A9AA8 lsls r0, 24 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] lsrs r0, 23 adds r1, r0 @@ -69955,11 +69955,11 @@ GetBattlePyramidTrainerFlag: @ 81A9AC4 push {r4,lr} lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r2, [r1] ldr r1, =0x00000e2a adds r2, r1 - ldr r4, =gUnknown_0832A328 + ldr r4, =gBitTable ldr r3, =gUnknown_02037350 lsls r1, r0, 3 adds r1, r0 @@ -69984,7 +69984,7 @@ sub_81A9B04: @ 81A9B04 ldr r0, =gUnknown_02038BCA ldrh r0, [r0] bl sub_81A9B44 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 8 @@ -70017,13 +70017,13 @@ sub_81A9B44: @ 81A9B44 ldr r0, =gUnknown_02037350 mov r12, r0 ldr r6, =gUnknown_03005DF0 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr mov r10, r1 - ldr r7, =gUnknown_03005D90 + ldr r7, =gSaveBlock2Ptr mov r9, r7 ldr r0, =0x00000cb4 mov r8, r0 - ldr r4, =gUnknown_0832A328 + ldr r4, =gBitTable _081A9B68: mov r1, r9 ldr r2, [r1] @@ -70092,7 +70092,7 @@ _081A9B86: sub_81A9C04: @ 81A9C04 push {r4-r6,lr} sub sp, 0x14 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r2, =0x00000ca9 adds r0, r1, r2 @@ -70127,11 +70127,11 @@ _081A9C56: lsls r0, 2 adds r0, r1 ldr r6, [r0] - ldr r4, =gUnknown_02024744 + ldr r4, =gEnemyParty adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData subs r0, 0x1 str r0, [sp, 0x10] lsls r2, r0, 1 @@ -70165,7 +70165,7 @@ _081A9C56: adds r0, r6 ldrb r0, [r0, 0x2] subs r5, r0 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xB @@ -70177,7 +70177,7 @@ _081A9C56: b _081A9CF6 .pool _081A9CD4: - bl GenerateRandomNumber + bl Random ldr r2, [sp, 0x10] lsls r1, r2, 1 adds r1, r2 @@ -70193,7 +70193,7 @@ _081A9CD4: subs r0, 0x5 adds r5, r4, r0 _081A9CF6: - ldr r4, =gUnknown_02024744 + ldr r4, =gEnemyParty ldr r2, =gBaseStats ldr r1, [sp, 0x10] lsls r0, r1, 1 @@ -70245,11 +70245,11 @@ _081A9D4C: ldrb r0, [r0, 0x17] cmp r0, 0 beq _081A9D90 - ldr r4, =gUnknown_02024744 + ldr r4, =gEnemyParty adds r0, r4, 0 movs r1, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData movs r1, 0x1 ands r1, r0 str r1, [sp, 0xC] @@ -70262,7 +70262,7 @@ _081A9D7C: .pool _081A9D90: str r0, [sp, 0xC] - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty add r2, sp, 0xC movs r1, 0x2E bl pokemon_setattr @@ -70283,7 +70283,7 @@ _081A9DA4: ldrh r1, [r0] lsls r2, 24 lsrs r2, 24 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty bl sub_80691F4 ldr r0, [sp, 0xC] adds r0, 0x1 @@ -70291,7 +70291,7 @@ _081A9DA4: adds r2, r0, 0 cmp r2, 0x3 ble _081A9DA4 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000e1a adds r0, r1 @@ -70299,7 +70299,7 @@ _081A9DA4: ldrh r0, [r0] cmp r0, 0x8B bls _081A9E0C - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x11 @@ -70313,7 +70313,7 @@ _081A9DA4: _081A9DF6: adds r1, r0, 0 adds r1, 0x27 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty add r2, sp, 0x10 bl pokemon_setattr ldr r0, [sp, 0xC] @@ -70322,7 +70322,7 @@ _081A9DF6: cmp r0, 0x5 ble _081A9DF6 _081A9E0C: - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty bl pokemon_calc_effective_stats add sp, 0x14 pop {r4-r6} @@ -70399,7 +70399,7 @@ sub_81A9E90: @ 81A9E90 cmp r0, 0 beq _081A9EB8 bl sub_81A9834 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000ca8 adds r0, r1 @@ -70422,7 +70422,7 @@ sub_81A9EC8: @ 81A9EC8 lsls r0, 24 cmp r0, 0 beq _081A9ED8 - bl Reset + bl DoSoftReset _081A9ED8: pop {r0} bx r0 @@ -70531,7 +70531,7 @@ sub_81A9F90: @ 81A9F90 push {r7} lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r4, [r0] ldr r1, =0x00000ca9 adds r0, r4, r1 @@ -70565,7 +70565,7 @@ _081A9FCC: movs r2, 0 cmp r2, r5 bge _081AA004 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] ldr r4, =0x00000cb4 adds r0, r4 @@ -70603,7 +70603,7 @@ _081AA026: movs r2, 0 cmp r2, r5 bge _081AA05E - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] ldr r4, =0x00000cb4 adds r0, r4 @@ -70717,7 +70717,7 @@ _081AA10A: str r1, [sp, 0x14] cmp r12, r3 bge _081AA1A2 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr str r2, [sp, 0x18] mov r4, r9 mov r5, r10 @@ -70819,7 +70819,7 @@ sub_81AA1D8: @ 81AA1D8 adds r6, 0x1 add r0, sp, 0x4 mov r8, r0 - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r3, =0x00000cb4 ldr r0, =0x0000ffff adds r2, r0, 0 @@ -70842,7 +70842,7 @@ _081AA1F2: bl sub_81AA33C movs r0, 0 str r0, [sp, 0x4] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] movs r0, 0xC7 lsls r0, 4 @@ -70941,7 +70941,7 @@ _081AA2E4: thumb_func_start sub_81AA2F8 sub_81AA2F8: @ 81AA2F8 push {r4,r5,lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r5, =gUnknown_08252C4F ldr r4, =gUnknown_08252C6A @@ -70977,7 +70977,7 @@ sub_81AA33C: @ 81AA33C push {r4-r7,lr} adds r4, r0, 0 adds r6, r1, 0 - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r1, [r5] ldr r2, =0x00000e28 adds r0, r1, r2 @@ -71037,7 +71037,7 @@ sub_81AA398: @ 81AA398 bl AllocZeroed str r0, [sp, 0x8] bl sub_81AA96C - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000e26 adds r0, r1 @@ -71089,9 +71089,9 @@ _081AA414: cmp r0, 0 beq _081AA4B6 _081AA42E: - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable mov r12, r0 - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r7, =0x00000e28 movs r3, 0x2 lsls r0, r4, 2 @@ -71530,7 +71530,7 @@ sub_81AA760: @ 81AA760 mov r8, r2 lsls r3, 24 lsrs r7, r3, 24 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000e22 adds r0, r1 @@ -71630,7 +71630,7 @@ sub_81AA810: @ 81AA810 mov r10, r4 lsls r5, 24 lsrs r6, r5, 24 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0xC7 lsls r1, 4 @@ -71757,7 +71757,7 @@ _081AA8DC: adds r0, r4, 0 bl sub_81627A4 strb r0, [r5, 0x1] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000cb4 adds r0, r1 @@ -71790,7 +71790,7 @@ _081AA95C: sub_81AA96C: @ 81AA96C push {r4-r7,lr} adds r6, r0, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000e22 adds r1, r0, r2 @@ -71819,7 +71819,7 @@ _081AA994: asrs r4, 3 cmp r3, 0x7 bne _081AA9C0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r2, =0x00000e26 adds r0, r1, r2 @@ -71843,7 +71843,7 @@ _081AA9C0: thumb_func_start sub_81AA9E4 sub_81AA9E4: @ 81AA9E4 push {r4,lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r4, [r0] ldr r1, =0x00000e28 adds r0, r4, r1 @@ -71886,7 +71886,7 @@ _081AAA3A: thumb_func_start sub_81AAA40 sub_81AAA40: @ 81AAA40 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0xC7 lsls r1, 4 @@ -71925,7 +71925,7 @@ sub_81AAA7C: @ 81AAA7C lsls r0, 24 lsrs r0, 24 movs r3, 0 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr mov r8, r1 lsls r1, r0, 2 adds r1, r0 @@ -71968,7 +71968,7 @@ _081AAA9E: thumb_func_start CalculateBattlePyramidPickupItemId CalculateBattlePyramidPickupItemId: @ 81AAAE0 push {r4-r6,lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r2, =0x00000ca9 adds r0, r1, r2 @@ -71988,7 +71988,7 @@ CalculateBattlePyramidPickupItemId: @ 81AAAE0 ble _081AAB0A movs r4, 0x13 _081AAB0A: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -72329,7 +72329,7 @@ _081AADB2: setup_bag_menu: @ 81AADB8 push {r4,r5,lr} sub sp, 0x4 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 @@ -72374,7 +72374,7 @@ _081AAE34: b _081AB012 _081AAE3E: bl remove_some_task - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -72390,7 +72390,7 @@ _081AAE56: movs r1, 0x80 orrs r0, r1 strb r0, [r2, 0x8] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -72411,7 +72411,7 @@ _081AAE86: bne _081AAE94 bl ResetTasks _081AAE94: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -72425,7 +72425,7 @@ _081AAEA4: adds r0, r1 movs r1, 0 strh r1, [r0] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -72441,7 +72441,7 @@ _081AAED8: b _081AB012 _081AAEDA: bl setup_bag_menu_textboxes - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -72454,7 +72454,7 @@ _081AAEEC: b _081AB012 _081AAEFA: bl allocate_bag_item_list_buffers - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -72480,7 +72480,7 @@ _081AAF1C: ldrb r0, [r4, 0x5] movs r1, 0x1 bl bag_menu_draw_pocket_indicator_square - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -72521,7 +72521,7 @@ _081AAFA0: ldr r0, =gUnknown_0203CE58 ldrb r0, [r0, 0x5] bl AddBagVisualObject - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -72533,7 +72533,7 @@ _081AAFBC: _081AAFC2: bl bag_menu_add_pocket_scroll_arrow_indicators_maybe bl bag_menu_add_list_scroll_arrow_indicators_maybe - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -72548,7 +72548,7 @@ _081AAFDE: movs r1, 0x10 movs r2, 0 bl BlendPalettes - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -72568,7 +72568,7 @@ _081AAFF8: ands r0, r1 strb r0, [r2, 0x8] _081AB012: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -72695,7 +72695,7 @@ _081AB13C: lsls r0, 24 cmp r0, 0 bne _081AB164 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 @@ -72719,7 +72719,7 @@ _081AB174: lsrs r0, 24 cmp r0, 0x1 beq _081AB18A - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 @@ -72878,7 +72878,7 @@ _081AB2B6: ldr r0, [r5] adds r0, r4 ldr r1, =gUnknown_085E8DB4 - bl CopyString + bl StringCopy ldr r0, =gUnknown_0203CE74 ldr r0, [r0] lsls r1, r6, 3 @@ -72981,7 +72981,7 @@ get_name: @ 81AB39C b _081AB43E .pool _081AB3C0: - ldr r4, =gUnknown_02021DC4 + ldr r4, =gStringVar2 adds r0, r5, 0 bl ItemIdToBattleMoveId lsls r0, 16 @@ -72991,44 +72991,44 @@ _081AB3C0: ldr r0, =gMoveNames adds r1, r0 adds r0, r4, 0 - bl CopyString + bl StringCopy movs r0, 0xA9 lsls r0, 1 cmp r5, r0 bls _081AB408 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r2, =0xfffffeae adds r1, r5, r2 movs r2, 0x2 movs r3, 0x1 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r1, =gUnknown_085E921A b _081AB438 .pool _081AB408: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r2, =0xfffffee0 adds r1, r5, r2 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN b _081AB436 .pool _081AB420: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0 subs r1, 0x84 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r1, =gUnknown_02021DC4 + bl ConvertIntToDecimalStringN + ldr r1, =gStringVar2 adds r0, r5, 0 bl itemid_get_name _081AB436: ldr r1, =gUnknown_085E9210 _081AB438: adds r0, r6, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders _081AB43E: pop {r4-r6} pop {r0} @@ -73208,15 +73208,15 @@ _081AB5BE: ldrb r0, [r5, 0x5] cmp r0, 0x3 bne _081AB610 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E8DA0 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x7 adds r1, r4, 0 movs r2, 0x77 @@ -73241,15 +73241,15 @@ _081AB610: lsrs r5, r0, 24 cmp r5, 0 bne _081AB66C - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 mov r1, r9 movs r2, 0x1 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E8DA0 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x7 adds r1, r4, 0 movs r2, 0x77 @@ -73270,7 +73270,7 @@ _081AB652: b _081AB696 .pool _081AB66C: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00000496 adds r0, r1 @@ -73326,18 +73326,18 @@ bag_menu_print_description_box_text: @ 81AB6B0 b _081AB6FC .pool _081AB6E0: - ldr r0, =gUnknown_02021CC4 + 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 CopyString - ldr r4, =gUnknown_02021FC4 + bl StringCopy + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E91C0 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders _081AB6FC: movs r0, 0x1 movs r1, 0 @@ -74003,15 +74003,15 @@ sub_81ABC54: @ 81ABC54 bne _081ABC6C movs r3, 0x3 _081ABC6C: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 lsls r1, 16 asrs r1, 16 movs r2, 0x2 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E8DA0 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 adds r1, r4, 0 movs r2, 0x28 @@ -74048,13 +74048,13 @@ sub_81ABCC0: @ 81ABCC0 bne _081ABCD4 movs r3, 0x3 _081ABCD4: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r2, 0x2 - bl ConvertIntToDecimalString - ldr r6, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r6, =gStringVar4 ldr r1, =gUnknown_085E8DA0 adds r0, r6, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders lsls r4, 24 lsrs r4, 24 movs r0, 0x1 @@ -74129,7 +74129,7 @@ _081ABD74: beq _081ABDB8 cmp r0, 0x2 beq _081ABDC0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x4 ands r0, r1 @@ -74310,7 +74310,7 @@ GetSwitchBagPocketDirection: @ 81ABF10 bl GetLRKeysState lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x20 ands r0, r1 @@ -74800,12 +74800,12 @@ bag_menu_swap_items: @ 81AC2E8 bl bag_pocket_get_itemid lsls r0, 16 lsrs r0, 16 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 mov r8, r0 ldr r1, =gUnknown_085E8DFE - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 movs r1, 0 bl FillWindowPixelBuffer @@ -74859,7 +74859,7 @@ sub_81AC3C0: @ 81AC3C0 lsrs r0, 24 cmp r0, 0x1 beq _081AC48E - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain mov r8, r0 ldrh r1, [r0, 0x2E] movs r0, 0x4 @@ -75422,7 +75422,7 @@ _081AC92C: ldr r1, =gUnknown_08614030 movs r2, 0x4 bl memcpy - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00000496 adds r0, r1 @@ -75516,12 +75516,12 @@ _081ACA12: _081ACA50: ldr r0, =gUnknown_0203CE7C ldrh r0, [r0] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E8DBE adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 movs r1, 0 bl FillWindowPixelBuffer @@ -75777,7 +75777,7 @@ _081ACC8C: bl GetMenuCursorPos lsls r0, 24 lsrs r4, r0, 24 - ldr r5, =gUnknown_030022C0 + ldr r5, =gMain ldrh r1, [r5, 0x2E] movs r0, 0x40 ands r0, r1 @@ -76087,12 +76087,12 @@ ItemMenu_Toss: @ 81ACEF4 _081ACF24: ldr r0, =gUnknown_0203CE7C ldrh r0, [r0] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E8EE0 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 movs r1, 0 bl FillWindowPixelBuffer @@ -76137,18 +76137,18 @@ BagMenuConfirmToss: @ 81ACF88 adds r4, r0 ldr r0, =gUnknown_0203CE7C ldrh r0, [r0] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 movs r2, 0x10 ldrsh r1, [r4, r2] movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E8F0E adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 movs r1, 0 bl FillWindowPixelBuffer @@ -76230,7 +76230,7 @@ Task_ChooseHowManyToToss: @ 81AD044 b _081AD0C6 .pool _081AD088: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -76274,18 +76274,18 @@ BagMenuActuallyToss: @ 81AD0CC adds r6, r4, r5 ldr r0, =gUnknown_0203CE7C ldrh r0, [r0] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 movs r2, 0x10 ldrsh r1, [r6, r2] movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r6, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r6, =gStringVar4 ldr r1, =gUnknown_085E8EF9 adds r0, r6, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 movs r1, 0 bl FillWindowPixelBuffer @@ -76334,7 +76334,7 @@ Task_ActuallyToss: @ 81AD150 adds r1, r4, 0 adds r1, 0x8 adds r7, r0, r1 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -76395,7 +76395,7 @@ ItemMenu_Register: @ 81AD1EC adds r6, r1, r2 adds r0, 0x8 adds r5, r1, r0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00000496 adds r1, r0, r2 @@ -76508,12 +76508,12 @@ bag_menu_print_cant_be_held_msg: @ 81AD30C lsrs r4, 24 ldr r0, =gUnknown_0203CE7C ldrh r0, [r0] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name - ldr r5, =gUnknown_02021FC4 + ldr r5, =gStringVar4 ldr r1, =gUnknown_085E8E11 adds r0, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r3, =sub_81AD350 adds r0, r4, 0 movs r1, 0x1 @@ -76530,7 +76530,7 @@ sub_81AD350: @ 81AD350 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -76651,12 +76651,12 @@ _081AD44C: cmp r0, 0 bne _081AD488 ldrh r0, [r4] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E8E27 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r3, =sub_81AD350 adds r0, r5, 0 movs r1, 0x1 @@ -76764,7 +76764,7 @@ _081AD550: movs r1, 0 movs r2, 0 bl ChangeBgY_ScreenOff - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] ldr r5, =0x00000496 adds r1, r0, r5 @@ -76835,12 +76835,12 @@ display_sell_item_ask_str: @ 81AD5DC cmp r0, 0 bne _081AD634 ldrh r0, [r6] - ldr r1, =gUnknown_02021DC4 + ldr r1, =gStringVar2 bl itemid_get_name - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E960F adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r3, =bag_menu_inits_lists_menu adds r0, r5, 0 movs r1, 0x1 @@ -76861,12 +76861,12 @@ _081AD634: b _081AD66A _081AD64C: ldrh r0, [r6] - ldr r1, =gUnknown_02021DC4 + ldr r1, =gStringVar2 bl itemid_get_name - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E962F adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r3, =sub_81AD730 adds r0, r7, 0 movs r1, 0x1 @@ -76890,7 +76890,7 @@ sub_81AD680: @ 81AD680 lsls r4, 3 ldr r0, =gTasks + 0x8 adds r4, r0 - ldr r6, =gUnknown_02021CC4 + ldr r6, =gStringVar1 ldr r0, =gUnknown_0203CE7C ldrh r0, [r0] bl itemid_get_market_price @@ -76902,11 +76902,11 @@ sub_81AD680: @ 81AD680 adds r0, r6, 0 movs r2, 0 movs r3, 0x6 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E9654 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r3, =sub_81AD6E4 adds r0, r5, 0 movs r1, 0x1 @@ -77041,7 +77041,7 @@ sub_81AD794: @ 81AD794 b _081AD844 .pool _081AD7F4: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -77093,9 +77093,9 @@ sub_81AD84C: @ 81AD84C adds r4, r0 ldr r6, =gUnknown_0203CE7C ldrh r0, [r6] - ldr r1, =gUnknown_02021DC4 + ldr r1, =gStringVar2 bl itemid_get_name - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 mov r8, r0 ldrh r0, [r6] bl itemid_get_market_price @@ -77107,11 +77107,11 @@ sub_81AD84C: @ 81AD84C mov r0, r8 movs r2, 0 movs r3, 0x6 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E9677 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r3, =sub_81AD8C8 adds r0, r5, 0 movs r1, 0x1 @@ -77158,7 +77158,7 @@ sub_81AD8C8: @ 81AD8C8 mov r3, r10 ldrh r1, [r3, 0x10] bl remove_item - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r4, [r0] movs r1, 0x92 lsls r1, 3 @@ -77201,7 +77201,7 @@ sub_81AD8C8: @ 81AD8C8 ldr r1, =0x00000819 adds r0, r1 ldrb r4, [r0] - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, [r2] movs r3, 0x92 lsls r3, 3 @@ -77231,7 +77231,7 @@ sub_81AD9C0: @ 81AD9C0 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -77273,12 +77273,12 @@ display_deposit_item_ask_str: @ 81AD9EC _081ADA18: ldr r0, =gUnknown_0203CE7C ldrh r0, [r0] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E8E42 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 movs r1, 0 bl FillWindowPixelBuffer @@ -77339,7 +77339,7 @@ sub_81ADA7C: @ 81ADA7C b _081ADB0E .pool _081ADAC0: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -77424,19 +77424,19 @@ _081ADB6C: cmp r6, 0x1 bne _081ADBD4 ldrh r0, [r4] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 mov r2, r8 movs r3, 0x10 ldrsh r1, [r2, r3] movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E8E5A adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders str r6, [sp] str r5, [sp, 0x4] str r5, [sp, 0x8] @@ -77491,7 +77491,7 @@ sub_81ADC0C: @ 81ADC0C lsls r0, 3 ldr r1, =gTasks + 0x8 adds r5, r0, r1 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -77540,7 +77540,7 @@ PrepareBagForWallyTutorial: @ 81ADC70 movs r0, 0xD0 bl AllocZeroed str r0, [r4] - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r1, [r5] movs r2, 0xAC lsls r2, 3 @@ -77579,7 +77579,7 @@ _081ADCAE: adds r6, 0x1 cmp r6, 0x4 bls _081ADCAE - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] movs r1, 0xAC lsls r1, 3 @@ -77603,7 +77603,7 @@ _081ADCAE: @ void RestoreBagAfterWallyTutorial() RestoreBagAfterWallyTutorial: @ 81ADD00 push {r4-r6,lr} - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r0, [r5] movs r1, 0xAC lsls r1, 3 @@ -78257,7 +78257,7 @@ bag_menu_add_money_window: @ 81AE268 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x92 lsls r1, 3 @@ -78387,12 +78387,12 @@ _081AE354: b _081AE39C .pool _081AE38C: - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 ldrb r1, [r5, 0x1] adds r0, r4, 0 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r2, r4, 0 _081AE39C: movs r0, 0xC @@ -78420,12 +78420,12 @@ _081AE39C: b _081AE3E8 .pool _081AE3D8: - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 ldrb r1, [r2, 0x3] adds r0, r4, 0 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r2, r4, 0 _081AE3E8: movs r0, 0x18 @@ -78442,7 +78442,7 @@ _081AE3E8: movs r1, 0x1 movs r3, 0x7 bl bag_menu_print - ldr r5, =gUnknown_02021CC4 + ldr r5, =gStringVar1 ldr r1, =gBattleMoves adds r0, r6, r7 lsls r0, 2 @@ -78451,7 +78451,7 @@ _081AE3E8: adds r0, r5, 0 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x24 str r0, [sp] str r4, [sp, 0x4] @@ -78563,7 +78563,7 @@ _081AE4F4: ldrb r0, [r5, 0x6] bl ListMenuHandleInput str r0, [r5] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldrh r0, [r1, 0x2E] ands r4, r0 cmp r4, 0 @@ -78712,7 +78712,7 @@ ListMenuHandleInput: @ 81AE604 lsls r1, 3 ldr r0, =gTasks + 0x8 adds r3, r1, r0 - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r0, 0x1 ands r0, r1 @@ -81610,7 +81610,7 @@ _081AFC48: cmp r1, 0 beq _081AFC5E adds r0, r2, 0 - bl CopyString + bl StringCopy adds r2, r0, 0 _081AFC5E: adds r4, 0x1 @@ -81643,7 +81643,7 @@ sub_81AFC74: @ 81AFC74 sav1_are_mapnumbers_in_given_list: @ 81AFC84 push {r4,lr} adds r2, r0, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x4 ldrsb r1, [r0, r1] @@ -81716,7 +81716,7 @@ sav2_set_x9_bit3_when_sav1_in_pokecenter: @ 81AFCFC bl sav1_is_in_pokecenter cmp r0, 0 bne _081AFD18 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldrb r1, [r2, 0x9] movs r0, 0xFD @@ -81724,7 +81724,7 @@ sav2_set_x9_bit3_when_sav1_in_pokecenter: @ 81AFCFC b _081AFD22 .pool _081AFD18: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldrb r1, [r2, 0x9] movs r0, 0x2 @@ -81742,7 +81742,7 @@ sub_81AFD2C: @ 81AFD2C bl sub_81AFCDC cmp r0, 0 bne _081AFD48 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldrb r1, [r2, 0x9] movs r0, 0xFB @@ -81750,7 +81750,7 @@ sub_81AFD2C: @ 81AFD2C b _081AFD52 .pool _081AFD48: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldrb r1, [r2, 0x9] movs r0, 0x4 @@ -81768,7 +81768,7 @@ sub_81AFD5C: @ 81AFD5C bl sub_81AFCEC cmp r0, 0 bne _081AFD78 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldrb r1, [r2, 0x9] movs r0, 0xF7 @@ -81776,7 +81776,7 @@ sub_81AFD5C: @ 81AFD5C b _081AFD82 .pool _081AFD78: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldrb r1, [r2, 0x9] movs r0, 0x8 @@ -81800,7 +81800,7 @@ sav2_set_x9_depending_on_sav1_map: @ 81AFD8C thumb_func_start sub_81AFDA0 sub_81AFDA0: @ 81AFDA0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] adds r2, 0xA8 ldr r0, [r2] @@ -81826,7 +81826,7 @@ sub_81AFDA0: @ 81AFDA0 thumb_func_start sub_81AFDD0 sub_81AFDD0: @ 81AFDD0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldrb r1, [r2, 0x9] movs r0, 0x80 @@ -82265,10 +82265,10 @@ _081B015C: adds r1, r0, 0 movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _081B017E _081B017A: @@ -82346,7 +82346,7 @@ _081B0206: sub_81B020C: @ 81B020C push {r4,lr} sub sp, 0x4 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 @@ -82391,7 +82391,7 @@ _081B0290: bl SetVBlankHBlankCallbacksToNull bl sub_8121DA0 bl clear_scheduled_bg_copies_to_vram - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -82407,7 +82407,7 @@ _081B02B2: movs r1, 0x80 orrs r0, r1 strb r0, [r2, 0x8] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -82418,7 +82418,7 @@ _081B02D4: b _081B0484 _081B02DA: bl ResetObjectPaletteAllocator - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -82435,7 +82435,7 @@ _081B02F8: b _081B0484 _081B02FE: bl sub_81B209C - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -82466,7 +82466,7 @@ _081B0338: bne _081B0344 b _081B04B0 _081B0344: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -82497,7 +82497,7 @@ _081B0368: .pool _081B038C: bl sub_81B5D30 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -82508,7 +82508,7 @@ _081B03A0: b _081B0484 _081B03A6: bl sub_81B6160 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -82549,7 +82549,7 @@ _081B03E0: .pool _081B0400: bl sub_81B0F28 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -82592,7 +82592,7 @@ _081B044C: movs r0, 0x7F ands r0, r1 strb r0, [r2, 0x8] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -82607,7 +82607,7 @@ _081B0474: movs r3, 0 bl BeginNormalPaletteFade _081B0484: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -83051,10 +83051,10 @@ _081B0836: _081B085C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _081B089C ldr r4, =gUnknown_0203CEDC @@ -83168,11 +83168,11 @@ sub_81B0948: @ 81B0948 movs r0, 0x64 adds r1, r4, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r7, r1, r0 adds r0, r7, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData adds r2, r0, 0 cmp r2, 0 beq _081B09A0 @@ -83263,7 +83263,7 @@ sub_81B0A10: @ 81B0A10 movs r1, 0x64 adds r2, r0, 0 muls r2, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r6, r2, r1 ldr r7, =gUnknown_0203CEDC ldr r1, [r7] @@ -83287,7 +83287,7 @@ sub_81B0A10: @ 81B0A10 bl sub_81B2A70 adds r0, r6, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _081B0A7C ldr r1, [r7] @@ -83322,7 +83322,7 @@ sub_81B0A9C: @ 81B0A9C lsrs r5, r0, 24 movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r6, =gUnknown_0203CEF8 bl sub_81B85AC @@ -83378,7 +83378,7 @@ sub_81B0B08: @ 81B0B08 lsrs r4, r0, 24 movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 bl sub_80DAE0C lsls r0, 24 @@ -83420,7 +83420,7 @@ sub_81B0B60: @ 81B0B60 lsrs r4, r0, 24 movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 bl sub_806E25C lsls r0, 24 @@ -83473,10 +83473,10 @@ sub_81B0BC4: @ 81B0BC4 lsrs r4, r0, 24 movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xC - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B0BEC adds r0, r4, 0 @@ -83502,7 +83502,7 @@ sub_81B0BFC: @ 81B0BFC movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r6, r1, r0 ldr r0, =gUnknown_0203CE7C ldrh r4, [r0] @@ -83543,7 +83543,7 @@ _081B0C5A: _081B0C66: adds r0, r6, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _081B0C82 adds r0, r6, 0 @@ -83576,7 +83576,7 @@ sub_81B0C94: @ 81B0C94 lsrs r2, 24 movs r0, 0x64 muls r0, r4 - ldr r3, =gUnknown_020244EC + ldr r3, =gPlayerParty adds r0, r3 bl sub_81B22D8 lsls r0, 24 @@ -83647,14 +83647,14 @@ _081B0D24: movs r2, 0 movs r3, 0 bl _call_via_r4 - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 adds r5, 0x4 add r5, r8 adds r0, r4, 0 adds r1, r5, 0 - bl CopyString + bl StringCopy adds r0, r4, 0 - bl GetStringEnd_Limit7 + bl StringGetEnd10 adds r0, r4, 0 bl sub_81DB52C ldrb r0, [r6, 0x8] @@ -83816,11 +83816,11 @@ _081B0E98: movs r0, 0x64 adds r1, r7, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r6, r1, r0 adds r0, r6, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B0EDC ldr r4, =gUnknown_0203CEDC @@ -83978,10 +83978,10 @@ sub_81B0FCC: @ 81B0FCC beq _081B1074 movs r0, 0x64 muls r0, r7 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B10E8 ldr r6, =gUnknown_0203CEDC @@ -84121,10 +84121,10 @@ sub_81B10F8: @ 81B10F8 _081B110A: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _081B1120 movs r0, 0x2 @@ -84210,14 +84210,14 @@ _081B11AA: _081B11B4: cmp r2, 0x2 bhi _081B11F6 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 11 ands r0, r1 cmp r0, 0 beq _081B11F6 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -84283,13 +84283,13 @@ sub_81B120C: @ 81B120C thumb_func_start sub_81B1250 sub_81B1250: @ 81B1250 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x49 ands r0, r1 cmp r0, 0x49 bne _081B1280 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -84676,10 +84676,10 @@ sub_81B15A4: @ 81B15A4 ldrb r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0x1 beq _081B15C4 movs r0, 0x1 @@ -84790,10 +84790,10 @@ _081B168A: ldr r0, [r0] adds r0, 0xD bl sub_81B302C - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 adds r0, r4, 0 adds r1, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0x1 bl sub_81B1B5C @@ -84888,7 +84888,7 @@ _081B1758: sub_81B1760: @ 81B1760 push {r4,lr} adds r4, r0, 0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x30] adds r3, r0, 0 cmp r1, 0x20 @@ -84933,7 +84933,7 @@ _081B17AA: _081B17AE: movs r1, 0x1 _081B17B0: - ldr r3, =gUnknown_030022C0 + ldr r3, =gMain _081B17B2: ldrh r2, [r3, 0x2E] movs r0, 0x8 @@ -85279,7 +85279,7 @@ _081B1A24: bne _081B1A54 ldr r0, =gUnknown_02024618 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B1AF4 strb r6, [r4] @@ -85302,7 +85302,7 @@ _081B1A5C: ldr r0, =gUnknown_020246E0 _081B1A70: movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B1AF4 strb r5, [r4] @@ -85311,7 +85311,7 @@ _081B1A70: _081B1A88: ldr r0, =gUnknown_0202467C movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B1AF4 movs r0, 0x4 @@ -85389,10 +85389,10 @@ _081B1B0A: asrs r4, r1, 24 movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B1B0A adds r0, r4, 0 @@ -85414,9 +85414,9 @@ GetMonNickname: @ 81B1B44 adds r4, r1, 0 movs r1, 0x2 adds r2, r4, 0 - bl pokemon_getattr + bl GetMonData adds r0, r4, 0 - bl GetStringEnd_Limit7 + bl StringGetEnd10 pop {r4} pop {r1} bx r1 @@ -85575,15 +85575,15 @@ sub_81B1C84: @ 81B1C84 lsrs r4, 16 lsls r5, 24 lsrs r5, 24 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl GetMonNickname - ldr r1, =gUnknown_02021DC4 + ldr r1, =gStringVar2 adds r0, r4, 0 bl itemid_get_name - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E991B adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 adds r1, r5, 0 bl sub_81B1B5C @@ -85604,15 +85604,15 @@ sub_81B1CD0: @ 81B1CD0 lsrs r4, 16 lsls r5, 24 lsrs r5, 24 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl GetMonNickname - ldr r1, =gUnknown_02021DC4 + ldr r1, =gStringVar2 adds r0, r4, 0 bl itemid_get_name - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E999D adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 adds r1, r5, 0 bl sub_81B1B5C @@ -85633,15 +85633,15 @@ sub_81B1D1C: @ 81B1D1C lsrs r4, 16 lsls r5, 24 lsrs r5, 24 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl GetMonNickname - ldr r1, =gUnknown_02021DC4 + ldr r1, =gStringVar2 adds r0, r4, 0 bl itemid_get_name - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E993A adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 adds r1, r5, 0 bl sub_81B1B5C @@ -85664,15 +85664,15 @@ sub_81B1D68: @ 81B1D68 lsrs r4, 16 lsls r5, 24 lsrs r5, 24 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name - ldr r1, =gUnknown_02021DC4 + ldr r1, =gStringVar2 adds r0, r4, 0 bl itemid_get_name - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E99DB adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 adds r1, r5, 0 bl sub_81B1B5C @@ -85728,7 +85728,7 @@ sub_81B1E00: @ 81B1E00 sub sp, 0x4 adds r4, r0, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 mov r1, sp @@ -85764,9 +85764,9 @@ _081B1E3E: thumb_func_start pokemon_item_not_removed pokemon_item_not_removed: @ 81B1E48 push {lr} - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E9A69 - bl ExpandStringRefs + bl StringExpandPlaceholders pop {r0} bx r0 .pool @@ -85796,7 +85796,7 @@ sub_81B1E60: @ 81B1E60 ldrsh r0, [r7, r2] movs r5, 0x64 muls r0, r5 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 movs r1, 0x39 adds r2, r7, 0 @@ -85840,13 +85840,13 @@ _081B1EDC: ldrsh r0, [r7, r2] cmp r1, r0 ble _081B1EF8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 movs r3, 0xA ldrsh r2, [r7, r3] subs r1, r2 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN _081B1EF8: mov r0, r8 bl SwitchTaskToFollowupFunc @@ -85887,7 +85887,7 @@ sub_81B1F18: @ 81B1F18 movs r0, 0x64 mov r6, r9 muls r6, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r6, r0 mov r0, r8 lsls r4, r0, 2 @@ -85897,11 +85897,11 @@ sub_81B1F18: @ 81B1F18 adds r4, r0 adds r0, r6, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData strh r0, [r4] adds r0, r6, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData strh r0, [r4, 0x2] lsls r5, 24 asrs r5, 24 @@ -86032,7 +86032,7 @@ sub_81B205C: @ 81B205C push {r4,lr} adds r4, r0, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _081B206E movs r0, 0x7 @@ -86040,7 +86040,7 @@ sub_81B205C: @ 81B205C _081B206E: adds r0, r4, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData bl pokemon_ailments_get_primary lsls r0, 24 lsrs r0, 24 @@ -86087,7 +86087,7 @@ sub_81B209C: @ 81B209C _081B20C4: movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 bl sub_81B2134 lsls r0, 16 @@ -86111,7 +86111,7 @@ _081B20FC: _081B2100: movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 bl sub_81B2164 lsls r0, 16 @@ -86140,12 +86140,12 @@ sub_81B2134: @ 81B2134 push {r4,lr} adds r4, r0, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0x1 beq _081B215A adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 bl sub_802C908 @@ -86166,12 +86166,12 @@ sub_81B2164: @ 81B2164 push {r4,lr} adds r4, r0, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0x1 beq _081B2182 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0x55 bne _081B2182 movs r0, 0x1 @@ -86356,7 +86356,7 @@ sub_81B22D8: @ 81B22D8 lsrs r6, r2, 24 mov r8, r6 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B22FA movs r0, 0x3 @@ -86380,7 +86380,7 @@ _081B22FA: _081B231C: adds r0, r5, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 adds r1, r6, 0 @@ -87230,7 +87230,7 @@ sub_81B2A70: @ 81B2A70 lsls r2, 24 lsrs r4, r2, 24 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B2AC0 cmp r4, 0x1 @@ -87279,7 +87279,7 @@ sub_81B2AC8: @ 81B2AC8 lsrs r4, r2, 24 mov r8, r4 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B2B34 adds r0, r6, 0 @@ -87315,7 +87315,7 @@ _081B2B1C: beq _081B2B34 adds r0, r6, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r0, 24 adds r1, r7, 0 @@ -87336,19 +87336,19 @@ sub_81B2B40: @ 81B2B40 adds r6, r1, 0 lsls r2, 24 lsrs r2, 24 - ldr r5, =gUnknown_02021DC4 + ldr r5, =gStringVar2 adds r0, r5, 0 adds r1, r2, 0 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021CC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar1 ldr r1, =gUnknown_085E8D4D adds r0, r4, 0 - bl CopyString + bl StringCopy adds r0, r4, 0 adds r1, r5, 0 - bl AppendString + bl StringAppend ldrb r0, [r6, 0x8] ldr r3, [r6] adds r3, 0x8 @@ -87398,7 +87398,7 @@ _081B2BBE: lsrs r4, 24 adds r0, r6, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -87444,7 +87444,7 @@ _081B2C24: ldr r0, =gSpeciesNames adds r1, r0 mov r0, r9 - bl CompareString + bl StringCompare cmp r0, 0 beq _081B2CBA _081B2C38: @@ -87521,7 +87521,7 @@ sub_81B2CD4: @ 81B2CD4 lsrs r4, r2, 24 mov r8, r4 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B2D2E cmp r4, 0 @@ -87548,7 +87548,7 @@ _081B2D16: beq _081B2D2E adds r0, r7, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 adds r1, r6, 0 @@ -87569,12 +87569,12 @@ sub_81B2D3C: @ 81B2D3C adds r4, r1, 0 lsls r2, 16 lsrs r2, 16 - ldr r5, =gUnknown_02021CC4 + ldr r5, =gStringVar1 adds r0, r5, 0 adds r1, r2, 0 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r1, 0xBA strb r1, [r0] movs r1, 0xFF @@ -87603,7 +87603,7 @@ sub_81B2D74: @ 81B2D74 lsrs r4, r2, 24 mov r8, r4 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B2DD0 cmp r4, 0 @@ -87631,7 +87631,7 @@ _081B2DB8: beq _081B2DD0 adds r0, r7, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 adds r1, r6, 0 @@ -87652,19 +87652,19 @@ sub_81B2DDC: @ 81B2DDC adds r6, r1, 0 lsls r2, 16 lsrs r2, 16 - ldr r5, =gUnknown_02021DC4 + ldr r5, =gStringVar2 adds r0, r5, 0 adds r1, r2, 0 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021CC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar1 ldr r1, =gUnknown_085E8D3E adds r0, r4, 0 - bl CopyString + bl StringCopy adds r0, r4, 0 adds r1, r5, 0 - bl AppendString + bl StringAppend ldrb r0, [r6, 0x8] ldr r3, [r6] adds r3, 0x14 @@ -87683,18 +87683,18 @@ sub_81B2E28: @ 81B2E28 adds r5, r0, 0 adds r6, r1, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B2E5C adds r0, r5, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -88027,13 +88027,13 @@ _081B3104: movs r2, 0x4F movs r3, 0xD bl SetWindowBorderStyle - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_08615AF4 lsls r0, r6, 2 adds r0, r1 ldr r1, [r0] adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldrb r0, [r5] movs r1, 0x1 str r1, [sp] @@ -88057,7 +88057,7 @@ _081B313C: thumb_func_start sub_81B314C sub_81B314C: @ 81B314C push {r4-r7,lr} - ldr r7, =gUnknown_020244EC + ldr r7, =gPlayerParty movs r6, 0 ldr r0, =gUnknown_0203CEC8 ldrb r0, [r0, 0xB] @@ -88075,17 +88075,17 @@ _081B316A: adds r4, r7, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B319A adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _081B3194 adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B319A _081B3194: @@ -88447,7 +88447,7 @@ _081B345A: adds r0, r1, r6 adds r1, r7, 0 adds r1, 0xD - bl pokemon_getattr + bl GetMonData lsls r1, r4, 1 adds r1, r5 ldrh r1, [r1] @@ -88487,7 +88487,7 @@ _081B34A0: mov r0, r9 adds r0, 0x64 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B34D2 ldr r0, =gUnknown_0203CEC4 @@ -88504,7 +88504,7 @@ _081B34D2: adds r0, r1, 0 add r0, r9 movs r1, 0xC - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 bl itemid_is_mail @@ -88587,7 +88587,7 @@ _081B3594: beq _081B35AC adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B35FE _081B35AC: @@ -88620,7 +88620,7 @@ _081B35D8: _081B35DC: adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData movs r1, 0x6 cmp r0, 0 beq _081B3600 @@ -88660,9 +88660,9 @@ sub_81B3608: @ 81B3608 ldrsb r1, [r4, r1] movs r0, 0x64 muls r0, r1 - ldr r7, =gUnknown_020244EC + ldr r7, =gPlayerParty adds r5, r0, r7 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 adds r0, r5, 0 bl GetMonNickname ldr r0, =gUnknown_0203CEC4 @@ -88692,15 +88692,15 @@ sub_81B3608: @ 81B3608 _081B3674: adds r0, r5, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r6, r0, 16 cmp r6, 0 bne _081B36C0 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E9980 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0x1 bl sub_81B1B5C @@ -88729,7 +88729,7 @@ _081B36C0: bl sub_81B33B4 movs r0, 0x1 bl sub_81B31B0 - ldr r1, =gUnknown_02021DC4 + ldr r1, =gStringVar2 adds r0, r6, 0 bl itemid_get_name movs r0, 0x1A @@ -88891,7 +88891,7 @@ sub_81B3828: @ 81B3828 cmp r0, 0x1 bne _081B3868 bl pokemon_change_order - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty ldrb r2, [r4, 0x9] ldr r0, =gUnknown_020244E9 ldrb r3, [r0] @@ -88905,7 +88905,7 @@ sub_81B3828: @ 81B3828 b _081B3880 .pool _081B3868: - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty ldrb r2, [r4, 0x9] ldr r0, =gUnknown_020244E9 ldrb r3, [r0] @@ -89817,7 +89817,7 @@ swap_pokemon_and_oams: @ 81B3FDC movs r1, 0x64 adds r4, r3, 0 muls r4, r1 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r5, r2, 0 muls r5, r1 @@ -89957,7 +89957,7 @@ sub_81B4134: @ 81B4134 ldr r0, [r4] adds r0, 0xD bl sub_81B302C - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty ldr r1, =gUnknown_0203CEC8 ldrb r1, [r1, 0x9] movs r2, 0x8 @@ -90056,10 +90056,10 @@ _081B4224: mov r1, r8 muls r1, r0 adds r0, r1, 0 - ldr r7, =gUnknown_020244EC + ldr r7, =gPlayerParty adds r0, r7 movs r1, 0xC - bl pokemon_getattr + bl GetMonData strh r0, [r4] lsls r0, 16 cmp r0, 0 @@ -90145,7 +90145,7 @@ sub_81B42D0: @ 81B42D0 asrs r0, 24 movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5 adds r1, r4, 0 movs r2, 0 @@ -90193,7 +90193,7 @@ sub_81B4350: @ 81B4350 ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_0203CEFC ldrh r1, [r1] @@ -90276,7 +90276,7 @@ _081B4402: bl bag_add_item ldrh r0, [r6] bl pokemon_item_not_removed - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 movs r1, 0 bl sub_81B1B5C ldr r1, =gTasks @@ -90299,7 +90299,7 @@ _081B4458: ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldrh r1, [r5] bl sub_81B1DB8 @@ -90318,7 +90318,7 @@ _081B4498: ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldrh r1, [r5] bl sub_81B1DB8 @@ -90384,13 +90384,13 @@ sub_81B452C: @ 81B452C ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x40 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr lsls r2, r0, 3 adds r2, r0 lsls r2, 2 @@ -90418,11 +90418,11 @@ sub_81B4578: @ 81B4578 ldrsb r1, [r6, r1] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r1, r0 adds r0, r5, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 mov r8, r0 @@ -90501,7 +90501,7 @@ sub_81B4624: @ 81B4624 ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_0203CE7C ldrh r1, [r1] @@ -90541,7 +90541,7 @@ sub_81B469C: @ 81B469C ldrsb r1, [r4, r1] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r6, r1, r0 bl sub_81B1BD4 lsls r0, 24 @@ -90563,7 +90563,7 @@ sub_81B469C: @ 81B469C bne _081B4716 adds r0, r6, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B4704 movs r0, 0x9 @@ -90604,11 +90604,11 @@ sub_81B4724: @ 81B4724 ldrsb r1, [r0, r1] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r1, r0 adds r0, r5, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r6, r0, 16 movs r0, 0x5 @@ -90635,20 +90635,20 @@ sub_81B4724: @ 81B4724 b _081B47BA .pool _081B4788: - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 adds r0, r5, 0 bl GetMonNickname - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E9980 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 b _081B47B4 .pool _081B47AC: adds r0, r6, 0 bl pokemon_item_not_removed - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 _081B47B4: movs r1, 0x1 bl sub_81B1B5C @@ -90678,11 +90678,11 @@ sub_81B47E0: @ 81B47E0 ldrsb r1, [r0, r1] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r7, r1, r0 adds r0, r7, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r5, r0, 16 movs r0, 0x5 @@ -90696,13 +90696,13 @@ sub_81B47E0: @ 81B47E0 bl sub_81B302C cmp r5, 0 bne _081B4864 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 adds r0, r7, 0 bl GetMonNickname - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E9980 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0x1 bl sub_81B1B5C @@ -90715,13 +90715,13 @@ sub_81B47E0: @ 81B47E0 b _081B488A .pool _081B4864: - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 adds r0, r5, 0 bl itemid_get_name - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E9E00 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0x1 bl sub_81B1B5C @@ -90774,7 +90774,7 @@ sub_81B48DC: @ 81B48DC ldrsb r1, [r0, r1] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 bl sub_8198C58 lsls r0, 24 @@ -90796,15 +90796,15 @@ _081B4914: _081B491A: adds r0, r4, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E9E14 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0 bl sub_81B1B5C @@ -90846,7 +90846,7 @@ sub_81B4988: @ 81B4988 ldrsb r1, [r6, r1] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r1, r0 bl sub_81B1BD4 lsls r0, 24 @@ -90906,7 +90906,7 @@ sub_81B4A08: @ 81B4A08 ldr r0, [r4] adds r0, 0xD bl sub_81B302C - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty ldr r1, =gUnknown_0203CEC8 ldrb r1, [r1, 0x9] movs r2, 0x9 @@ -90958,11 +90958,11 @@ sub_81B4A98: @ 81B4A98 ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x40 - bl pokemon_getattr - ldr r2, =gUnknown_03005D8C + bl GetMonData + ldr r2, =gSaveBlock1Ptr lsls r1, r0, 3 adds r1, r0 lsls r1, 2 @@ -91090,7 +91090,7 @@ _081B4BC6: ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 bl sub_80D4700 lsls r0, 24 @@ -91198,10 +91198,10 @@ _081B4CBE: asrs r0, 24 movs r7, 0x64 muls r0, r7 - ldr r6, =gUnknown_020244EC + ldr r6, =gPlayerParty adds r0, r6 movs r1, 0xC - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 adds r0, r4, 0 @@ -91232,7 +91232,7 @@ _081B4CBE: _081B4D24: adds r0, r4, 0 bl pokemon_item_not_removed - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 movs r1, 0 bl sub_81B1B5C ldr r1, =gTasks @@ -91277,7 +91277,7 @@ sub_81B4D78: @ 81B4D78 ldrsb r1, [r5, r1] movs r0, 0x64 muls r0, r1 - ldr r6, =gUnknown_020244EC + ldr r6, =gPlayerParty adds r7, r0, r6 movs r0, 0x5 bl audio_play @@ -91313,10 +91313,10 @@ _081B4DE4: bl sub_81B31B0 adds r0, r7, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 - ldr r1, =gUnknown_02021DC4 + ldr r1, =gStringVar2 bl itemid_get_name movs r0, 0x1A bl display_pokemon_menu_message @@ -91363,7 +91363,7 @@ _081B4E5C: ldr r0, [r5] adds r0, 0xD bl sub_81B302C - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 movs r1, 0x1 bl sub_81B1B5C ldr r1, =gTasks @@ -91452,15 +91452,15 @@ _081B4F2C: cmp r5, r6 bcc _081B4EC6 _081B4F36: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0 movs r2, 0 movs r3, 0x1 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E9830 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x20 bl audio_play adds r0, r4, 0 @@ -91653,10 +91653,10 @@ sub_81B50C8: @ 81B50C8 mov r1, r8 muls r1, r0 adds r0, r1, 0 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData adds r6, r0, 0 lsls r6, 16 lsrs r6, 16 @@ -91668,7 +91668,7 @@ sub_81B50C8: @ 81B50C8 adds r0, r1, 0 adds r0, r4 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 @@ -91680,7 +91680,7 @@ sub_81B50C8: @ 81B50C8 adds r0, r1, 0 adds r0, r4 movs r1, 0x50 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -91701,15 +91701,15 @@ sub_81B50C8: @ 81B50C8 b _081B51B0 .pool _081B515C: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085EA210 - bl ExpandStringRefs + bl StringExpandPlaceholders b _081B5178 .pool _081B5170: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085EA234 - bl ExpandStringRefs + bl StringExpandPlaceholders _081B5178: movs r0, 0x20 bl audio_play @@ -91720,10 +91720,10 @@ _081B5178: ldr r0, [r4] adds r0, 0xD bl sub_81B302C - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EA1CA adds r0, r4, 0 - bl AppendString + bl StringAppend adds r0, r4, 0 movs r1, 0x1 bl sub_81B1B5C @@ -91760,10 +91760,10 @@ brm_trade_1: @ 81B51D4 asrs r0, 24 movs r6, 0x64 muls r0, r6 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData mov r9, r0 mov r1, r9 lsls r1, 16 @@ -91775,7 +91775,7 @@ brm_trade_1: @ 81B51D4 muls r0, r6 adds r0, r4 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 @@ -91785,7 +91785,7 @@ brm_trade_1: @ 81B51D4 muls r0, r6 adds r0, r4 movs r1, 0x50 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -91804,14 +91804,14 @@ brm_trade_1: @ 81B51D4 bl sub_807A7E0 cmp r0, 0 beq _081B52C8 - ldr r5, =gUnknown_02021FC4 + ldr r5, =gStringVar4 ldr r1, =gUnknown_08615E0C subs r0, 0x1 lsls r0, 2 adds r0, r1 ldr r1, [r0] adds r0, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x20 bl audio_play ldr r4, =gUnknown_0203CEC4 @@ -91823,7 +91823,7 @@ brm_trade_1: @ 81B51D4 bl sub_81B302C ldr r1, =gUnknown_085EA1CA adds r0, r5, 0 - bl AppendString + bl StringAppend adds r0, r5, 0 movs r1, 0x1 bl sub_81B1B5C @@ -91863,7 +91863,7 @@ sub_81B52E4: @ 81B52E4 ldr r0, [r4] adds r0, 0xD bl sub_81B302C - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty ldr r1, =gUnknown_0203CEC8 ldrb r1, [r1, 0x9] lsls r1, 24 @@ -91884,21 +91884,21 @@ _081B5328: beq _081B5354 b _081B5368 _081B532E: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085EA1E8 - bl ExpandStringRefs + bl StringExpandPlaceholders b _081B53C0 .pool _081B5340: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085EA210 - bl ExpandStringRefs + bl StringExpandPlaceholders b _081B53C0 .pool _081B5354: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085EA234 - bl ExpandStringRefs + bl StringExpandPlaceholders b _081B53C0 .pool _081B5368: @@ -91909,14 +91909,14 @@ _081B5368: ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl GetMonNickname - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EA1CD adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0x1 bl sub_81B1B5C @@ -91931,10 +91931,10 @@ _081B5368: _081B53C0: movs r0, 0x20 bl audio_play - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EA1CA adds r0, r4, 0 - bl AppendString + bl StringAppend adds r0, r4, 0 movs r1, 0x1 bl sub_81B1B5C @@ -92126,7 +92126,7 @@ _081B5574: bl sub_8161560 b _081B5664 _081B557C: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] movs r0, 0x1C ldrsb r0, [r1, r0] @@ -92139,15 +92139,15 @@ _081B557C: lsrs r1, 16 bl get_mapheader_by_bank_and_number adds r1, r0, 0 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrb r1, [r1, 0x14] bl sub_81245DC - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085EA196 b _081B55E8 .pool _081B55B8: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] adds r0, r1, 0 adds r0, 0x24 @@ -92164,13 +92164,13 @@ _081B55B8: lsrs r1, 16 bl get_mapheader_by_bank_and_number adds r1, r0, 0 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrb r1, [r1, 0x14] bl sub_81245DC - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085EA16B _081B55E8: - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r6, 0 bl sub_81B5674 ldr r0, =gUnknown_0203CEC4 @@ -92230,7 +92230,7 @@ sub_81B5674: @ 81B5674 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 movs r1, 0x1 bl sub_81B1B5C ldr r1, =gTasks @@ -92366,10 +92366,10 @@ brm_get_selected_species: @ 81B578C ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 pop {r1} @@ -92382,7 +92382,7 @@ task_brm_cancel_1_on_keypad_a_or_b: @ 81B57B4 push {lr} lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -92642,7 +92642,7 @@ party_menu_icon_anim: @ 81B59B4 lsrs r0, 24 cmp r0, 0x1 bne _081B59EA - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -92660,13 +92660,13 @@ party_menu_icon_anim: @ 81B59B4 _081B59EA: adds r0, r5, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 str r6, [sp] adds r0, r4, 0 @@ -92821,13 +92821,13 @@ sub_81B5B38: @ 81B5B38 lsrs r5, 24 adds r0, r6, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r6, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData adds r2, r0, 0 lsls r2, 16 lsrs r2, 16 @@ -92933,7 +92933,7 @@ party_menu_held_item_object: @ 81B5C14 adds r5, r0, 0 adds r4, r1, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B5C3C ldr r0, =gUnknown_08615EC0 @@ -92995,7 +92995,7 @@ sub_81B5C94: @ 81B5C94 push {r4,lr} adds r4, r1, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 adds r1, r4, 0 @@ -93101,10 +93101,10 @@ _081B5D60: _081B5D68: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xC - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0 @@ -93133,10 +93133,10 @@ _081B5DA8: _081B5DAC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0xC - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0 @@ -93279,7 +93279,7 @@ party_menu_pokeball_object: @ 81B5ECC push {r4,lr} adds r4, r1, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B5EEA ldr r0, =gUnknown_08615F08 @@ -93482,7 +93482,7 @@ party_menu_status_condition_object: @ 81B6064 adds r5, r0, 0 adds r4, r1, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B608C ldr r0, =gUnknown_08616008 @@ -93627,7 +93627,7 @@ sub_81B617C: @ 81B617C sub sp, 0xC ldr r0, =c2_815ABFC mov r8, r0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -93665,16 +93665,16 @@ _081B61D8: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B61FA adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B61B0 _081B61FA: @@ -93782,7 +93782,7 @@ IsHPRecoveryItem: @ 81B62D0 lsrs r0, 16 cmp r0, 0xAF bne _081B62EC - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003214 adds r0, r1 @@ -93852,104 +93852,104 @@ _081B6334: .4byte _081B6494 .4byte _081B64A8 _081B6380: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E9C3E - bl ExpandStringRefs + bl StringExpandPlaceholders b _081B64C4 .pool _081B6394: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E9C7C - bl ExpandStringRefs + bl StringExpandPlaceholders b _081B64C4 .pool _081B63A8: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E9C8A - bl ExpandStringRefs + bl StringExpandPlaceholders b _081B64C4 .pool _081B63BC: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E9CA2 - bl ExpandStringRefs + bl StringExpandPlaceholders b _081B64C4 .pool _081B63D0: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E9C5F - bl ExpandStringRefs + bl StringExpandPlaceholders b _081B64C4 .pool _081B63E4: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E9DBE - bl ExpandStringRefs + bl StringExpandPlaceholders b _081B64C4 .pool _081B63F8: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E9DE1 - bl ExpandStringRefs + bl StringExpandPlaceholders b _081B64C4 .pool _081B640C: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E9CE0 - bl ExpandStringRefs + bl StringExpandPlaceholders b _081B64C4 .pool _081B6420: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085E96E3 b _081B6474 .pool _081B6430: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085EA33C b _081B6474 .pool _081B6440: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085EA343 b _081B6474 .pool _081B6450: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085EA35B b _081B6474 .pool _081B6460: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085E96E6 b _081B6474 .pool _081B6470: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085E96EE _081B6474: - bl CopyString - ldr r0, =gUnknown_02021FC4 + bl StringCopy + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E9D25 - bl ExpandStringRefs + bl StringExpandPlaceholders b _081B64C4 .pool _081B6494: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E9CF5 - bl ExpandStringRefs + bl StringExpandPlaceholders b _081B64C4 .pool _081B64A8: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E9CB7 - bl ExpandStringRefs + bl StringExpandPlaceholders b _081B64C4 .pool _081B64BC: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E96F6 - bl ExpandStringRefs + bl StringExpandPlaceholders _081B64C4: pop {r0} bx r0 @@ -93970,7 +93970,7 @@ UsingHPEVItemOnShedinja: @ 81B64D0 bne _081B64FC adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData ldr r1, =0x0000012f cmp r0, r1 bne _081B64FC @@ -94017,7 +94017,7 @@ ExecuteTableBasedItemEffect__: @ 81B6520 lsrs r5, r1, 16 lsls r2, 24 lsrs r6, r2, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -94027,7 +94027,7 @@ ExecuteTableBasedItemEffect__: @ 81B6520 bne _081B6558 movs r0, 0x64 muls r0, r3 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 adds r1, r5, 0 adds r2, r3, 0 @@ -94037,7 +94037,7 @@ _081B6558: movs r0, 0x64 adds r4, r3, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r3, 0 bl sub_81B8F38 @@ -94076,7 +94076,7 @@ ItemUseCB_Medicine: @ 81B6588 ldrsb r1, [r0, r1] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r1, r0 ldr r0, =gUnknown_0203CE7C ldrh r6, [r0] @@ -94095,13 +94095,13 @@ ItemUseCB_Medicine: @ 81B6588 bne _081B65EE adds r0, r5, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 mov r10, r0 adds r0, r5, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData cmp r10, r0 bne _081B65EE movs r1, 0 @@ -94189,7 +94189,7 @@ _081B6694: _081B66A8: adds r0, r5, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r3, r0, 0 mov r1, r10 subs r3, r1 @@ -94208,12 +94208,12 @@ _081B66A8: b _081B6710 .pool _081B66E4: - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 adds r0, r5, 0 bl GetMonNickname adds r0, r6, 0 bl GetMedicineItemEffectMessage - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 _081B66F4: movs r1, 0x1 bl sub_81B1B5C @@ -94250,14 +94250,14 @@ sub_81B672C: @ 81B672C ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl GetMonNickname - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E9C17 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0 bl sub_81B1B5C @@ -94321,7 +94321,7 @@ sub_81B67C8: @ 81B67C8 ldrsb r1, [r4, r1] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r1, r0 ldr r0, =gUnknown_0203CE7C ldrh r6, [r0] @@ -94331,7 +94331,7 @@ sub_81B67C8: @ 81B67C8 lsrs r7, r0, 24 adds r0, r5, 0 movs r1, 0x20 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x4] @@ -94350,7 +94350,7 @@ sub_81B67C8: @ 81B67C8 lsrs r4, 24 adds r0, r5, 0 movs r1, 0x20 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 mov r9, r0 @@ -94386,10 +94386,10 @@ _081B6874: adds r0, r6, 0 movs r1, 0x1 bl remove_item - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 adds r0, r5, 0 bl GetMonNickname - ldr r1, =gUnknown_02021DC4 + ldr r1, =gStringVar2 adds r0, r7, 0 bl option_menu_get_string ldr r2, [sp, 0x4] @@ -94398,23 +94398,23 @@ _081B6874: ldr r0, [sp, 0x8] cmp r0, r8 beq _081B68C4 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E9D45 - bl ExpandStringRefs + bl StringExpandPlaceholders b _081B68E0 .pool _081B68C4: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E9D90 - bl ExpandStringRefs + bl StringExpandPlaceholders b _081B68E0 .pool _081B68D8: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E9D6D - bl ExpandStringRefs + bl StringExpandPlaceholders _081B68E0: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 _081B68E2: movs r1, 0x1 bl sub_81B1B5C @@ -94466,7 +94466,7 @@ _081B693C: _081B6954: adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData ldr r1, =0x0000012f cmp r0, r1 beq _081B6992 @@ -94494,7 +94494,7 @@ _081B6984: adds r0, r4, 0 movs r1, 0x1F _081B6988: - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 b _081B6994 @@ -94549,13 +94549,13 @@ _081B69F0: ldr r1, =gUnknown_085E96E6 _081B69F2: adds r0, r2, 0 - bl CopyString + bl StringCopy b _081B6A08 .pool _081B6A00: ldr r1, =gUnknown_085E96EE adds r0, r2, 0 - bl CopyString + bl StringCopy _081B6A08: pop {r0} bx r0 @@ -94585,14 +94585,14 @@ sub_81B6A10: @ 81B6A10 adds r1, r4, 0 muls r1, r0 mov r8, r1 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty mov r9, r0 _081B6A40: adds r1, r5, 0 adds r1, 0xD mov r0, r8 add r0, r9 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 @@ -94686,7 +94686,7 @@ dp05_ether: @ 81B6AFC ldrh r0, [r0] cmp r0, 0xAF bne _081B6B20 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003214 adds r0, r1 @@ -94821,7 +94821,7 @@ _081B6C34: movs r0, 0x64 adds r4, r1, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 movs r0, 0x1 bl audio_play @@ -94832,18 +94832,18 @@ _081B6C34: ldrsh r1, [r7, r0] adds r1, 0xD adds r0, r4, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r1, 0xD muls r1, r4 ldr r2, =gMoveNames adds r1, r2 - bl CopyString + bl StringCopy adds r0, r5, 0 bl GetMedicineItemEffectMessage - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 _081B6C7E: movs r1, 0x1 bl sub_81B1B5C @@ -94944,7 +94944,7 @@ _081B6D4E: adds r1, r4, 0 adds r1, 0xD adds r0, r6, 0 - bl pokemon_getattr + bl GetMonData cmp r0, r5 bne _081B6D60 movs r0, 0x1 @@ -94966,9 +94966,9 @@ _081B6D6C: sub_81B6D74: @ 81B6D74 push {r4,lr} adds r1, r0, 0 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0x1 bl sub_81B1B5C @@ -95015,27 +95015,27 @@ sub_81B6DC4: @ 81B6DC4 ldrsb r1, [r7, r1] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r1, r0 movs r0, 0xE adds r0, r7 mov r8, r0 ldr r0, =gUnknown_0203CE7C ldrh r4, [r0] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 adds r0, r5, 0 bl GetMonNickname adds r0, r4, 0 bl ItemIdToBattleMoveId strh r0, [r7, 0xE] - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 movs r1, 0xE ldrsh r2, [r7, r1] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 - bl CopyString + bl StringCopy movs r0, 0 mov r1, r8 strh r0, [r1, 0x2] @@ -95105,7 +95105,7 @@ sub_81B6EB4: @ 81B6EB4 ldrsb r1, [r2, r1] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r1, r0 adds r6, r2, 0 adds r6, 0xE @@ -95126,21 +95126,21 @@ sub_81B6EB4: @ 81B6EB4 movs r1, 0x1 bl remove_item _081B6EF0: - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 adds r0, r5, 0 bl GetMonNickname - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 movs r1, 0 ldrsh r2, [r6, r1] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 - bl CopyString - ldr r4, =gUnknown_02021FC4 + bl StringCopy + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E9AA5 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0x1 bl sub_81B1B5C @@ -95195,7 +95195,7 @@ sub_81B6F98: @ 81B6F98 lsls r0, 24 cmp r0, 0 beq _081B6FEA - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r2, 0x1 adds r0, r2, 0 @@ -95329,7 +95329,7 @@ _081B70A8: sub_81B70B8: @ 81B70B8 push {r4,lr} sub sp, 0x4 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty ldr r4, =gUnknown_0203CEC8 ldrb r1, [r4, 0x9] ldr r2, =gUnknown_020244E9 @@ -95412,7 +95412,7 @@ sub_81B7154: @ 81B7154 movs r0, 0x64 adds r5, r1, 0 muls r5, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r0 bl sub_81C1B94 adds r1, r0, 0 @@ -95420,19 +95420,19 @@ sub_81B7154: @ 81B7154 lsrs r1, 24 adds r1, 0xD adds r0, r5, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 adds r0, r5, 0 bl GetMonNickname - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 movs r1, 0xD muls r1, r4 ldr r2, =gMoveNames adds r1, r2 - bl CopyString + bl StringCopy ldr r0, =gUnknown_085E9BB8 bl sub_81B6D74 ldr r1, =gTasks @@ -95464,7 +95464,7 @@ sub_81B71D4: @ 81B71D4 movs r0, 0x64 adds r4, r1, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 bl sub_81C1B94 adds r1, r0, 0 @@ -95495,7 +95495,7 @@ sub_81B7230: @ 81B7230 adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_0203CEC8 movs r3, 0xE ldrsh r2, [r1, r3] @@ -95503,11 +95503,11 @@ sub_81B7230: @ 81B7230 muls r1, r2 ldr r2, =gMoveNames adds r1, r2 - bl CopyString - ldr r4, =gUnknown_02021FC4 + bl StringCopy + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E9B5D adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0x1 bl sub_81B1B5C @@ -95561,7 +95561,7 @@ sub_81B72C8: @ 81B72C8 ldrsb r1, [r7, r1] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 bl sub_8198C58 lsls r0, 24 @@ -95581,21 +95581,21 @@ _081B7300: beq _081B7392 b _081B73C2 _081B7306: - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 adds r0, r4, 0 bl GetMonNickname - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 movs r1, 0xE ldrsh r2, [r7, r1] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 - bl CopyString - ldr r4, =gUnknown_02021FC4 + bl StringCopy + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E9B76 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0x1 bl sub_81B1B5C @@ -95631,10 +95631,10 @@ _081B738C: movs r0, 0x5 bl audio_play _081B7392: - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 adds r0, r4, 0 bl GetMonNickname - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_0203CEC8 movs r3, 0xE ldrsh r2, [r1, r3] @@ -95642,7 +95642,7 @@ _081B7392: muls r1, r2 ldr r2, =gMoveNames adds r1, r2 - bl CopyString + bl StringCopy ldr r0, =gUnknown_085E9AE9 bl sub_81B6D74 ldr r1, =gTasks @@ -95693,7 +95693,7 @@ dp05_rare_candy: @ 81B7404 ldrsb r1, [r0, r1] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r1, r0 ldr r0, =gUnknown_0203CEC4 ldr r6, [r0] @@ -95704,7 +95704,7 @@ dp05_rare_candy: @ 81B7404 mov r8, r2 adds r0, r5, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData cmp r0, 0x64 beq _081B7478 adds r0, r5, 0 @@ -95762,22 +95762,22 @@ _081B74B4: ldrh r0, [r0] movs r1, 0x1 bl remove_item - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 adds r0, r5, 0 bl GetMonNickname - ldr r4, =gUnknown_02021DC4 + ldr r4, =gStringVar2 adds r0, r5, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 adds r0, r4, 0 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E9D0A adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0x1 bl sub_81B1B5C @@ -95877,7 +95877,7 @@ sub_81B75D4: @ 81B75D4 lsrs r0, 24 cmp r0, 0x1 beq _081B7620 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -95911,7 +95911,7 @@ sub_81B7634: @ 81B7634 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -96016,7 +96016,7 @@ sub_81B7704: @ 81B7704 lsls r0, 24 cmp r0, 0 beq _081B77A6 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r6, 0x1 adds r0, r6, 0 @@ -96034,7 +96034,7 @@ _081B772C: ldrsb r1, [r4, r1] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1 bl sub_8069318 @@ -96093,7 +96093,7 @@ sub_81B77AC: @ 81B77AC ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0 bl sub_8069318 @@ -96141,7 +96141,7 @@ sub_81B7810: @ 81B7810 ldrsb r1, [r6, r1] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r7, r1, r0 adds r0, r7, 0 movs r1, 0 @@ -96193,22 +96193,22 @@ sub_81B787C: @ 81B787C ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl GetMonNickname - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r6, =gUnknown_020244E2 ldrh r2, [r6] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 - bl CopyString - ldr r4, =gUnknown_02021FC4 + bl StringCopy + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E9AE9 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0x1 bl sub_81B1B5C @@ -96249,20 +96249,20 @@ sub_81B7910: @ 81B7910 ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl GetMonNickname - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 movs r1, 0xD muls r1, r5 ldr r2, =gMoveNames adds r1, r2 - bl CopyString - ldr r4, =gUnknown_02021FC4 + bl StringCopy + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E9AA5 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0x1 bl sub_81B1B5C @@ -96291,27 +96291,27 @@ sub_81B79A0: @ 81B79A0 adds r4, r0, 0 adds r5, r1, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData strh r0, [r5] adds r0, r4, 0 movs r1, 0x3B - bl pokemon_getattr + bl GetMonData strh r0, [r5, 0x2] adds r0, r4, 0 movs r1, 0x3C - bl pokemon_getattr + bl GetMonData strh r0, [r5, 0x4] adds r0, r4, 0 movs r1, 0x3E - bl pokemon_getattr + bl GetMonData strh r0, [r5, 0x8] adds r0, r4, 0 movs r1, 0x3F - bl pokemon_getattr + bl GetMonData strh r0, [r5, 0xA] adds r0, r4, 0 movs r1, 0x3D - bl pokemon_getattr + bl GetMonData strh r0, [r5, 0x6] pop {r4,r5} pop {r0} @@ -96362,16 +96362,16 @@ sub_81B7A28: @ 81B7A28 ldrsb r1, [r6, r1] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r1, r0 adds r0, r5, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B7A6E adds r0, r5, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r7, r0, 16 ldrb r0, [r6, 0x9] @@ -96437,7 +96437,7 @@ _081B7AD6: bl sub_81B0FCC adds r0, r5, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r3, r0, 0 subs r3, r7 lsls r3, 16 @@ -96564,14 +96564,14 @@ sub_81B7C10: @ 81B7C10 ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl GetMonNickname - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E9C17 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r4, 0 movs r1, 0 bl sub_81B1B5C @@ -96653,7 +96653,7 @@ GetItemEffectType: @ 81B7CEC _081B7D00: cmp r1, 0xAF bne _081B7D18 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003214 adds r4, r0, r1 @@ -96859,26 +96859,26 @@ sub_81B7E4C: @ 81B7E4C ldrsb r1, [r7, r1] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r1, r0 movs r0, 0xE adds r0, r7 mov r8, r0 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 adds r0, r5, 0 bl GetMonNickname ldr r4, =gUnknown_020375E2 ldrb r0, [r4] bl sub_81B2360 strh r0, [r7, 0xE] - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 movs r1, 0xE ldrsh r2, [r7, r1] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 - bl CopyString + bl StringCopy movs r0, 0x2 mov r1, r8 strh r0, [r1, 0x2] @@ -97005,10 +97005,10 @@ sub_81B7FAC: @ 81B7FAC mov r1, r8 muls r1, r0 adds r0, r1, 0 - ldr r7, =gUnknown_020244EC + ldr r7, =gPlayerParty adds r0, r7 movs r1, 0xC - bl pokemon_getattr + bl GetMonData strh r0, [r5] lsls r0, 16 cmp r0, 0 @@ -97106,7 +97106,7 @@ sub_81B8088: @ 81B8088 mov r1, r8 muls r1, r0 adds r0, r1, 0 - ldr r6, =gUnknown_020244EC + ldr r6, =gPlayerParty adds r0, r6 adds r1, r5, 0 movs r2, 0 @@ -97154,7 +97154,7 @@ sub_81B8104: @ 81B8104 asrs r2, 24 movs r0, 0x64 muls r0, r2 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_0203CEDC lsls r2, 4 @@ -97178,7 +97178,7 @@ sub_81B814C: @ 81B814C ldrsb r0, [r4, r0] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5 ldrh r1, [r4, 0xC] bl sub_81B1DB8 @@ -97187,10 +97187,10 @@ sub_81B814C: @ 81B814C muls r0, r6 adds r0, r5 movs r1, 0x40 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr lsls r2, r0, 3 adds r2, r0 lsls r2, 2 @@ -97217,11 +97217,11 @@ sub_81B81A8: @ 81B81A8 ldrsb r1, [r6, r1] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r1, r0 adds r0, r5, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r7, r0, 16 ldr r0, =gUnknown_020375F0 @@ -97294,7 +97294,7 @@ _081B8264: ldrsb r1, [r2, r1] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldrh r1, [r2, 0xC] movs r2, 0 @@ -97377,7 +97377,7 @@ _081B82FA: bl sub_81B841C ldrh r0, [r6] bl pokemon_item_not_removed - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 movs r1, 0 bl sub_81B1B5C b _081B8378 @@ -97401,7 +97401,7 @@ _081B835C: ldrsb r1, [r7, r1] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 adds r1, r4, 0 bl sub_81B1DB8 @@ -97541,12 +97541,12 @@ sub_81B8474: @ 81B8474 ldrsb r1, [r0, r1] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r1, r0 ldr r1, =gUnknown_0203CEE8 movs r0, 0 strb r0, [r1] - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_0203BCB8 ldrh r1, [r0] adds r1, 0x6 @@ -97561,7 +97561,7 @@ sub_81B8474: @ 81B8474 adds r4, r1, r0 adds r0, r5, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B84DC ldr r0, =gUnknown_085E9A08 @@ -97603,7 +97603,7 @@ sub_81B8518: @ 81B8518 str r0, [sp] ldr r0, =sub_81B1370 str r0, [sp, 0x4] - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r0, [r0, 0x8] str r0, [sp, 0x8] movs r0, 0x4 @@ -97639,7 +97639,7 @@ sub_81B856C: @ 81B856C asrs r4, r0, 24 movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 bl sub_81B85AC lsls r0, 24 @@ -97673,19 +97673,19 @@ sub_81B85AC: @ 81B85AC adds r5, r0, 0 movs r6, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _081B8608 adds r0, r5, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 bl sub_81B8888 lsls r0, 24 lsrs r0, 24 cmp r4, r0 bhi _081B8608 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0, 0x4] ldr r0, =0x0000191a @@ -97693,7 +97693,7 @@ sub_81B85AC: @ 81B85AC bne _081B85EA adds r0, r5, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _081B8608 _081B85EA: @@ -97707,7 +97707,7 @@ _081B85EA: bne _081B8618 adds r0, r5, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _081B864A _081B8608: @@ -97717,7 +97717,7 @@ _081B8608: _081B8618: adds r0, r5, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 ldr r3, =gUnknown_08611C9A @@ -97772,10 +97772,10 @@ sub_81B865C: @ 81B865C b _081B8758 .pool _081B8688: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r2, 0 movs r3, 0x1 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x11 b _081B8758 .pool @@ -97811,10 +97811,10 @@ _081B86CE: movs r1, 0x64 muls r0, r1 subs r0, 0x64 - ldr r3, =gUnknown_020244EC + ldr r3, =gPlayerParty adds r0, r3, r0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 mov r10, r0 @@ -97822,10 +97822,10 @@ _081B86CE: movs r1, 0x64 muls r0, r1 subs r0, 0x64 - ldr r3, =gUnknown_020244EC + ldr r3, =gPlayerParty adds r0, r3, r0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r6, r0, 16 adds r1, r5, 0x1 @@ -97841,10 +97841,10 @@ _081B870E: ldrb r0, [r5] muls r0, r7 subs r0, 0x64 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1, r0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r10, r0 beq _081B86B8 cmp r6, 0 @@ -97852,10 +97852,10 @@ _081B870E: ldrb r0, [r5] muls r0, r7 subs r0, 0x64 - ldr r3, =gUnknown_020244EC + ldr r3, =gPlayerParty adds r0, r3, r0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData cmp r6, r0 beq _081B86BC _081B873E: @@ -97952,7 +97952,7 @@ sub_81B87E8: @ 81B87E8 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -98246,12 +98246,12 @@ sub_81B8A2C: @ 81B8A2C adds r4, r0, 0 ldr r0, =gUnknown_02024550 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B8A74 adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _081B8A74 ldr r0, =gUnknown_0203CEC8 @@ -98262,7 +98262,7 @@ sub_81B8A2C: @ 81B8A2C b _081B8A76 .pool _081B8A5C: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 11 @@ -98300,12 +98300,12 @@ sub_81B8A7C: @ 81B8A7C cmp r5, 0x5 bne _081B8AC4 _081B8AA2: - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 bl sub_806EBF8 adds r1, r0, 0 adds r0, r4, 0 - bl CopyString - ldr r0, =gUnknown_02021FC4 + bl StringCopy + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E97B2 b _081B8C42 .pool @@ -98313,17 +98313,17 @@ _081B8AC4: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _081B8AF8 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 adds r0, r4, 0 bl GetMonNickname - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E978F b _081B8C42 .pool @@ -98358,15 +98358,15 @@ _081B8B24: movs r7, 0x64 adds r0, r5, 0 muls r0, r7 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty mov r8, r1 adds r6, r0, r1 adds r0, r6, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B8B60 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E97E5 b _081B8C42 .pool @@ -98381,10 +98381,10 @@ _081B8B60: ldrb r1, [r1] cmp r0, r1 bne _081B8B94 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 adds r0, r6, 0 bl GetMonNickname - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E976F b _081B8C42 .pool @@ -98430,11 +98430,11 @@ _081B8BA8: _081B8BFC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl GetMonNickname - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E9754 b _081B8C42 .pool @@ -98450,12 +98450,12 @@ _081B8C20: lsrs r0, 24 muls r0, r7 add r0, r8 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl GetMonNickname - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E9738 _081B8C42: - bl ExpandStringRefs + bl StringExpandPlaceholders _081B8C46: movs r0, 0 _081B8C48: @@ -98990,7 +98990,7 @@ pokemon_change_order: @ 81B9030 adds r0, r4, 0 bl Alloc adds r5, r0, 0 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r2, r4, 0 bl memcpy movs r4, 0 @@ -99001,7 +99001,7 @@ _081B904A: lsls r0, 24 lsrs r0, 24 muls r0, r6 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 adds r1, r4, 0 muls r1, r6 @@ -99029,7 +99029,7 @@ sub_81B9080: @ 81B9080 adds r0, r4, 0 bl Alloc adds r5, r0, 0 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r2, r4, 0 bl memcpy movs r4, 0 @@ -99040,7 +99040,7 @@ _081B909A: lsls r0, 24 lsrs r0, 24 muls r0, r6 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 adds r1, r4, 0 muls r1, r6 @@ -99067,7 +99067,7 @@ sub_81B90D0: @ 81B90D0 push {r7} movs r6, 0x1 movs r7, 0x64 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty mov r8, r0 _081B90DE: adds r0, r6, 0 @@ -99079,12 +99079,12 @@ _081B90DE: adds r5, r0, r1 adds r0, r5, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B912C adds r0, r5, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B912C movs r0, 0 @@ -99134,7 +99134,7 @@ sub_81B9150: @ 81B9150 str r0, [sp] ldr r0, =sub_81B917C str r0, [sp, 0x4] - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r0, [r0, 0x8] str r0, [sp, 0x8] movs r0, 0x5 @@ -99651,7 +99651,7 @@ _081B95A4: ldrh r1, [r5] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 bl sub_806E25C lsls r0, 24 @@ -99688,10 +99688,10 @@ _081B95FA: bhi _081B9614 movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xC - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B95F4 movs r0, 0x1 @@ -99757,7 +99757,7 @@ _081B9678: sub_81B968C: @ 81B968C push {lr} sub sp, 0x4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty ldr r0, =gUnknown_020375E0 ldrb r2, [r0] ldr r0, =gUnknown_020244E9 @@ -99791,11 +99791,11 @@ _081B96DC: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 adds r1, r4, 0 adds r1, 0xD - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081B96FA ldrh r0, [r5] @@ -99821,25 +99821,25 @@ sub_81B9718: @ 81B9718 movs r0, 0x64 adds r5, r1, 0 muls r5, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r0 ldr r0, =gUnknown_020375E2 ldrh r1, [r0] adds r1, 0xD adds r0, r5, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 adds r0, r5, 0 bl GetMonNickname - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 movs r1, 0xD muls r1, r4 ldr r2, =gMoveNames adds r1, r2 - bl CopyString + bl StringCopy pop {r4,r5} pop {r0} bx r0 @@ -99856,7 +99856,7 @@ sub_81B9770: @ 81B9770 ldrh r0, [r0] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5 ldr r4, =gUnknown_020375E2 ldrb r2, [r4] @@ -99876,7 +99876,7 @@ _081B97A2: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 lsls r1, r4, 24 lsrs r1, 24 @@ -99917,7 +99917,7 @@ sub_81B97DC: @ 81B97DC str r0, [sp, 0x8] mov r0, r8 ldr r1, [sp, 0x8] - bl pokemon_getattr + bl GetMonData mov r1, sp adds r1, 0x2 str r1, [sp, 0x14] @@ -99927,7 +99927,7 @@ sub_81B97DC: @ 81B97DC str r3, [sp, 0xC] mov r0, r8 adds r1, r3, 0 - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1] adds r7, r5, 0 @@ -99935,7 +99935,7 @@ sub_81B97DC: @ 81B97DC str r7, [sp, 0x10] mov r0, r8 adds r1, r7, 0 - bl pokemon_getattr + bl GetMonData mov r1, sp adds r1, 0x5 str r1, [sp, 0x18] @@ -99945,13 +99945,13 @@ sub_81B97DC: @ 81B97DC str r3, [sp, 0x1C] mov r0, r8 adds r1, r3, 0 - bl pokemon_getattr + bl GetMonData add r7, sp, 0x4 mov r10, r7 strb r0, [r7] mov r0, r8 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData mov r6, sp adds r6, 0x6 strb r0, [r6] @@ -100025,10 +100025,10 @@ sub_81B98DC: @ 81B98DC ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 cmp r1, 0 beq _081B990C @@ -100058,12 +100058,12 @@ sub_81B9918: @ 81B9918 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_020375E2 ldrh r1, [r1] adds r1, 0xD - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 mov r8, r0 @@ -100081,12 +100081,12 @@ _081B9958: movs r0, 0x64 adds r5, r6, 0 muls r5, r0 - ldr r7, =gUnknown_020244EC + ldr r7, =gPlayerParty _081B996A: adds r1, r4, 0 adds r1, 0xD adds r0, r5, r7 - bl pokemon_getattr + bl GetMonData cmp r0, 0x39 beq _081B999C adds r4, 0x1 @@ -100134,7 +100134,7 @@ sub_81B99B4: @ 81B99B4 thumb_func_start sub_81B99D4 sub_81B99D4: @ 81B99D4 push {lr} - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] ldr r2, =0x00000ca8 adds r0, r2 @@ -100151,7 +100151,7 @@ sub_81B99D4: @ 81B99D4 negs r0, r0 ands r0, r2 strb r0, [r1] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x4 ldrsb r1, [r0, r1] @@ -100169,7 +100169,7 @@ sub_81B99D4: @ 81B99D4 thumb_func_start sub_81B9A28 sub_81B9A28: @ 81B9A28 ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000e6a adds r0, r2 @@ -100181,7 +100181,7 @@ sub_81B9A28: @ 81B9A28 thumb_func_start sub_81B9A44 sub_81B9A44: @ 81B9A44 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =gUnknown_020375E4 ldrh r1, [r1] @@ -100196,7 +100196,7 @@ sub_81B9A44: @ 81B9A44 sub_81B9A60: @ 81B9A60 push {r4,lr} ldr r4, =gUnknown_02038BCA - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xFF @@ -100240,7 +100240,7 @@ _081B9AAC: thumb_func_start sub_81B9ABC sub_81B9ABC: @ 81B9ABC push {r4,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =gUnknown_020375E2 ldrh r1, [r1] @@ -100268,10 +100268,10 @@ sub_81B9ABC: @ 81B9ABC thumb_func_start sub_81B9B00 sub_81B9B00: @ 81B9B00 push {r4,r5,lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r4, [r0] ldr r5, =gUnknown_086160D4 - bl GenerateRandomNumber + bl Random ldrh r0, [r5] ldr r1, =0x00000e6a adds r4, r1 @@ -100285,7 +100285,7 @@ sub_81B9B00: @ 81B9B00 thumb_func_start sub_81B9B28 sub_81B9B28: @ 81B9B28 push {r4,r5,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =0x00000e6a adds r0, r1 @@ -100300,7 +100300,7 @@ sub_81B9B28: @ 81B9B28 ldr r1, =0x00000e6a adds r0, r1 ldrh r0, [r0] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name ldr r0, [r4] ldr r1, =0x00000e6a @@ -100340,7 +100340,7 @@ sub_81B9B80: @ 81B9B80 thumb_func_start sub_81B9BA0 sub_81B9BA0: @ 81B9BA0 push {lr} - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] ldr r2, =0x00000ca8 adds r0, r2 @@ -100357,7 +100357,7 @@ sub_81B9BA0: @ 81B9BA0 negs r0, r0 ands r0, r2 strb r0, [r1] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x4 ldrsb r1, [r0, r1] @@ -100375,7 +100375,7 @@ sub_81B9BA0: @ 81B9BA0 thumb_func_start sub_81B9BF4 sub_81B9BF4: @ 81B9BF4 ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000e6c adds r0, r2 @@ -100387,7 +100387,7 @@ sub_81B9BF4: @ 81B9BF4 thumb_func_start sub_81B9C10 sub_81B9C10: @ 81B9C10 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =gUnknown_020375E4 ldrh r1, [r1] @@ -100401,7 +100401,7 @@ sub_81B9C10: @ 81B9C10 thumb_func_start sub_81B9C2C sub_81B9C2C: @ 81B9C2C push {r4,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =gUnknown_020375E2 ldrh r1, [r1] @@ -100429,10 +100429,10 @@ sub_81B9C2C: @ 81B9C2C thumb_func_start sub_81B9C70 sub_81B9C70: @ 81B9C70 push {r4,r5,lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r4, [r0] ldr r5, =gUnknown_086160F4 - bl GenerateRandomNumber + bl Random ldrh r0, [r5] ldr r1, =0x00000e6c adds r4, r1 @@ -100446,7 +100446,7 @@ sub_81B9C70: @ 81B9C70 thumb_func_start sub_81B9C98 sub_81B9C98: @ 81B9C98 push {r4,r5,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =0x00000e6c adds r0, r1 @@ -100461,7 +100461,7 @@ sub_81B9C98: @ 81B9C98 ldr r1, =0x00000e6c adds r0, r1 ldrh r0, [r0] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name ldr r0, [r4] ldr r1, =0x00000e6c @@ -100486,7 +100486,7 @@ _081B9CE6: thumb_func_start sub_81B9CF0 sub_81B9CF0: @ 81B9CF0 push {lr} - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_02038BCA ldrh r1, [r1] bl sub_8162E20 @@ -100513,7 +100513,7 @@ sub_81B9D08: @ 81B9D08 thumb_func_start sub_81B9D28 sub_81B9D28: @ 81B9D28 push {lr} - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] ldr r2, =0x00000ca8 adds r0, r2 @@ -100530,7 +100530,7 @@ sub_81B9D28: @ 81B9D28 negs r0, r0 ands r0, r2 strb r0, [r1] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x4 ldrsb r1, [r0, r1] @@ -100548,7 +100548,7 @@ sub_81B9D28: @ 81B9D28 thumb_func_start sub_81B9D7C sub_81B9D7C: @ 81B9D7C ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000e6e adds r0, r2 @@ -100560,7 +100560,7 @@ sub_81B9D7C: @ 81B9D7C thumb_func_start sub_81B9D98 sub_81B9D98: @ 81B9D98 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =gUnknown_020375E4 ldrh r1, [r1] @@ -100574,7 +100574,7 @@ sub_81B9D98: @ 81B9D98 thumb_func_start sub_81B9DB4 sub_81B9DB4: @ 81B9DB4 push {r4,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =gUnknown_020375E2 ldrh r1, [r1] @@ -100602,10 +100602,10 @@ sub_81B9DB4: @ 81B9DB4 thumb_func_start sub_81B9DF8 sub_81B9DF8: @ 81B9DF8 push {r4,r5,lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r4, [r0] ldr r5, =gUnknown_08616120 - bl GenerateRandomNumber + bl Random ldrh r0, [r5] ldr r1, =0x00000e6e adds r4, r1 @@ -100619,7 +100619,7 @@ sub_81B9DF8: @ 81B9DF8 thumb_func_start sub_81B9E20 sub_81B9E20: @ 81B9E20 push {r4,r5,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r0, [r4] ldr r1, =0x00000e6e adds r0, r1 @@ -100634,7 +100634,7 @@ sub_81B9E20: @ 81B9E20 ldr r1, =0x00000e6e adds r0, r1 ldrh r0, [r0] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name ldr r0, [r4] ldr r1, =0x00000e6e @@ -100748,7 +100748,7 @@ _081B9EEC: add r6, r9 str r6, [sp, 0x28] _081B9F1E: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x46 @@ -100835,7 +100835,7 @@ _081B9FCC: _081B9FD4: cmp r2, r6 bne _081BA01C - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] mov r2, r8 lsls r3, r2, 1 @@ -100902,14 +100902,14 @@ sub_81BA040: @ 81BA040 ldr r1, =gUnknown_0203BC8C ldr r0, =gSlateportBattleTentMons str r0, [r1] - ldr r7, =gUnknown_03005D90 + ldr r7, =gSaveBlock2Ptr ldr r1, =0x0000ffff mov r8, r1 _081BA062: mov r2, r10 lsls r6, r2, 1 _081BA066: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x1E @@ -100928,7 +100928,7 @@ _081BA066: ldrh r0, [r0] cmp r0, r3 beq _081BA0AA - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r0, r1, r4 ldrh r2, [r0] @@ -100979,7 +100979,7 @@ _081BA0DE: b _081BA062 .pool _081BA110: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r6, =0x00000cb2 adds r3, r1, r6 @@ -101004,7 +101004,7 @@ _081BA12A: ldr r7, =gUnknown_03001298 mov r8, sp _081BA13E: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 mov r1, r10 @@ -101019,7 +101019,7 @@ _081BA13E: ldr r3, [r4] lsls r0, 4 adds r0, r3 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldrh r6, [r0] ldr r1, [r1] _081BA166: @@ -101164,7 +101164,7 @@ _081BA270: .4byte _081BA63C .4byte _081BA64E _081BA28C: - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2C] movs r0, 0x3 ands r0, r1 @@ -101580,7 +101580,7 @@ _081BA5C8: cmp r2, 0 beq _081BA638 ldr r4, =gUnknown_08616124 - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r0, [r5] ldrb r0, [r0, 0x14] lsls r1, r0, 29 diff --git a/asm/rom_81BAD84.s b/asm/rom_81BAD84.s index dccf10f5e..caa355533 100644 --- a/asm/rom_81BAD84.s +++ b/asm/rom_81BAD84.s @@ -75,7 +75,7 @@ sub_81BADF4: @ 81BADF4 bx_exec_buffer_A_ch0_tbl3: @ 81BAE10 push {lr} ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r3, [r0] lsls r0, r3, 2 @@ -224,7 +224,7 @@ sub_81BAF48: @ 81BAF48 lsls r0, 24 cmp r0, 0 beq _081BAFA0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -400,7 +400,7 @@ _081BB07A: lsls r0, 24 cmp r0, 0 beq _081BB134 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -428,7 +428,7 @@ _081BB07A: ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @@ -464,7 +464,7 @@ _081BB134: ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @@ -568,7 +568,7 @@ _081BB25C: ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 bl sub_805E990 bl dp01_tbl3_exec_completed @@ -633,23 +633,23 @@ _081BB2E2: movs r0, 0x64 mov r1, r10 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r6, r1, r0 adds r0, r6, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 adds r0, r6, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r6, 0 movs r1, 0x19 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x4] ldr r3, =gExperienceTables adds r4, 0x1 @@ -790,23 +790,23 @@ sub_81BB414: @ 81BB414 movs r0, 0x64 adds r6, r1, 0 muls r6, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r6, r0 adds r0, r6, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r6, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 adds r0, r6, 0 movs r1, 0x19 - bl pokemon_getattr + bl GetMonData adds r3, r0, 0 ldr r6, =gExperienceTables lsls r1, r4, 2 @@ -907,21 +907,21 @@ _081BB514: movs r0, 0x64 mov r1, r9 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r1, r0 adds r0, r5, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 movs r1, 0x19 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x4] adds r0, r5, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 ldr r3, =gExperienceTables @@ -1069,11 +1069,11 @@ sub_81BB688: @ 81BB688 movs r0, 0x64 adds r1, r4, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r7, r1, r0 adds r0, r7, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData bl battle_type_is_double lsls r0, 24 lsrs r0, 24 @@ -1102,7 +1102,7 @@ _081BB708: ldrb r0, [r0] movs r1, 0x64 muls r1, r4 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @@ -1135,10 +1135,10 @@ sub_81BB740: @ 81BB740 ldrb r1, [r4, 0x8] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData ldrb r0, [r4, 0xC] ldr r1, =gUnknown_03005D60 lsls r0, 2 @@ -1179,10 +1179,10 @@ sub_81BB78C: @ 81BB78C ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 bl nullsub_24 @@ -1476,7 +1476,7 @@ sub_81BB9F4: @ 81BB9F4 ldrh r0, [r0] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5 bl sub_805E990 ldr r1, =gUnknown_020241E4 @@ -1544,7 +1544,7 @@ sub_81BBAE8: @ 81BBAE8 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @@ -1601,7 +1601,7 @@ dp01_tbl3_exec_completed: @ 81BBB8C adds r0, r1 ldr r1, =bx_exec_buffer_A_ch0_tbl3 str r1, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -1624,7 +1624,7 @@ dp01_tbl3_exec_completed: @ 81BBB8C .pool _081BBBE0: ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r1 @@ -1838,16 +1838,16 @@ _081BBE08: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1] adds r0, r4, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x2E] movs r6, 0 @@ -1875,12 +1875,12 @@ _081BBE54: adds r1, r6, 0 adds r1, 0xD mov r0, r8 - bl pokemon_getattr + bl GetMonData strh r0, [r4] adds r1, r6, 0 adds r1, 0x11 mov r0, r8 - bl pokemon_getattr + bl GetMonData mov r2, r9 adds r1, r2, r6 strb r0, [r1] @@ -1891,25 +1891,25 @@ _081BBE54: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData mov r1, r10 strb r0, [r1] adds r0, r4, 0 movs r1, 0x20 - bl pokemon_getattr + bl GetMonData ldr r2, [sp, 0x80] strb r0, [r2] adds r0, r4, 0 movs r1, 0x19 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x44] adds r0, r4, 0 movs r1, 0x27 - bl pokemon_getattr + bl GetMonData mov r3, sp movs r5, 0x1F ands r0, r5 @@ -1921,7 +1921,7 @@ _081BBE54: strb r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x28 - bl pokemon_getattr + bl GetMonData mov r3, sp movs r6, 0x1F ands r0, r6 @@ -1933,7 +1933,7 @@ _081BBE54: strh r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x29 - bl pokemon_getattr + bl GetMonData mov r3, sp ands r0, r5 lsls r0, 2 @@ -1945,7 +1945,7 @@ _081BBE54: strb r1, [r3, 0x15] adds r0, r4, 0 movs r1, 0x2A - bl pokemon_getattr + bl GetMonData movs r1, 0x1F ands r1, r0 lsls r1, 15 @@ -1956,7 +1956,7 @@ _081BBE54: str r0, [sp, 0x14] adds r0, r4, 0 movs r1, 0x2B - bl pokemon_getattr + bl GetMonData mov r3, sp ands r0, r6 lsls r0, 4 @@ -1967,7 +1967,7 @@ _081BBE54: strh r1, [r3, 0x16] adds r0, r4, 0 movs r1, 0x2C - bl pokemon_getattr + bl GetMonData mov r3, sp ands r0, r5 lsls r0, 1 @@ -1979,55 +1979,55 @@ _081BBE54: strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x48] adds r0, r4, 0 movs r1, 0x37 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x4C] adds r0, r4, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData ldr r1, [sp, 0x7C] strb r0, [r1] adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x28] adds r0, r4, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x2C] adds r0, r4, 0 movs r1, 0x3B - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x2] adds r0, r4, 0 movs r1, 0x3C - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x4] adds r0, r4, 0 movs r1, 0x3D - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x6] adds r0, r4, 0 movs r1, 0x3E - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0x8] adds r0, r4, 0 movs r1, 0x3F - bl pokemon_getattr + bl GetMonData mov r1, sp strh r0, [r1, 0xA] adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData mov r3, sp movs r1, 0x1 ands r0, r1 @@ -2040,7 +2040,7 @@ _081BBE54: strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x2E - bl pokemon_getattr + bl GetMonData mov r3, sp lsls r0, 7 ldrb r2, [r3, 0x17] @@ -2050,19 +2050,19 @@ _081BBE54: strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData str r0, [sp, 0x54] adds r0, r4, 0 movs r1, 0x2 ldr r2, [sp, 0x8C] - bl pokemon_getattr + bl GetMonData ldr r0, [sp, 0x84] ldr r1, [sp, 0x8C] - bl CopyString_Limit10 + bl StringCopy10 adds r0, r4, 0 movs r1, 0x7 ldr r2, [sp, 0x88] - bl pokemon_getattr + bl GetMonData mov r2, sp movs r6, 0 _081BC00C: @@ -2078,7 +2078,7 @@ _081BC00C: _081BC02C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB b _081BC3A6 @@ -2086,7 +2086,7 @@ _081BC02C: _081BC03C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xC b _081BC3A6 @@ -2100,20 +2100,20 @@ _081BC04C: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 mov r8, r9 _081BC062: adds r1, r6, 0 adds r1, 0xD adds r0, r4, 0 - bl pokemon_getattr + bl GetMonData mov r1, r8 strh r0, [r1] adds r1, r6, 0 adds r1, 0x11 adds r0, r4, 0 - bl pokemon_getattr + bl GetMonData mov r2, r10 adds r1, r2, r6 strb r0, [r1] @@ -2124,10 +2124,10 @@ _081BC062: ble _081BC062 movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData mov r1, r9 strb r0, [r1, 0xC] mov r2, r9 @@ -2145,7 +2145,7 @@ _081BC0A0: _081BC0B4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldrb r1, [r3] lsls r1, 9 @@ -2160,14 +2160,14 @@ _081BC0D0: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty mov r8, r2 _081BC0DC: adds r1, r6, 0 adds r1, 0x11 mov r2, r8 adds r0, r4, r2 - bl pokemon_getattr + bl GetMonData adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 @@ -2175,10 +2175,10 @@ _081BC0DC: ble _081BC0DC movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 @@ -2187,7 +2187,7 @@ _081BC0DC: _081BC10C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldrb r1, [r3] lsls r1, 9 @@ -2200,7 +2200,7 @@ _081BC10C: _081BC128: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1 b _081BC142 @@ -2208,11 +2208,11 @@ _081BC128: _081BC138: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x19 _081BC142: - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 strb r1, [r7] movs r0, 0xFF @@ -2231,7 +2231,7 @@ _081BC142: _081BC168: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1A b _081BC466 @@ -2239,7 +2239,7 @@ _081BC168: _081BC178: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1B b _081BC466 @@ -2247,7 +2247,7 @@ _081BC178: _081BC188: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1C b _081BC466 @@ -2255,7 +2255,7 @@ _081BC188: _081BC198: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1D b _081BC466 @@ -2263,7 +2263,7 @@ _081BC198: _081BC1A8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1E b _081BC466 @@ -2271,7 +2271,7 @@ _081BC1A8: _081BC1B8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1F b _081BC466 @@ -2279,7 +2279,7 @@ _081BC1B8: _081BC1C8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x20 b _081BC466 @@ -2287,7 +2287,7 @@ _081BC1C8: _081BC1D8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x22 b _081BC466 @@ -2295,7 +2295,7 @@ _081BC1D8: _081BC1E8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x23 b _081BC466 @@ -2303,7 +2303,7 @@ _081BC1E8: _081BC1F8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x24 b _081BC466 @@ -2311,7 +2311,7 @@ _081BC1F8: _081BC208: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x25 b _081BC466 @@ -2319,7 +2319,7 @@ _081BC208: _081BC218: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x26 b _081BC466 @@ -2328,31 +2328,31 @@ _081BC228: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x27 - bl pokemon_getattr + bl GetMonData strb r0, [r7] adds r0, r4, 0 movs r1, 0x28 - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x1] adds r0, r4, 0 movs r1, 0x29 - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x2] adds r0, r4, 0 movs r1, 0x2A - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x3] adds r0, r4, 0 movs r1, 0x2B - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x4] adds r0, r4, 0 movs r1, 0x2C - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x5] movs r6, 0x6 b _081BC46E @@ -2360,7 +2360,7 @@ _081BC228: _081BC278: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x27 b _081BC466 @@ -2368,7 +2368,7 @@ _081BC278: _081BC288: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x28 b _081BC466 @@ -2376,7 +2376,7 @@ _081BC288: _081BC298: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x29 b _081BC466 @@ -2384,7 +2384,7 @@ _081BC298: _081BC2A8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2A b _081BC466 @@ -2392,7 +2392,7 @@ _081BC2A8: _081BC2B8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2B b _081BC466 @@ -2400,7 +2400,7 @@ _081BC2B8: _081BC2C8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2C b _081BC466 @@ -2408,7 +2408,7 @@ _081BC2C8: _081BC2D8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0 b _081BC302 @@ -2416,7 +2416,7 @@ _081BC2D8: _081BC2E8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x9 b _081BC3A6 @@ -2424,11 +2424,11 @@ _081BC2E8: _081BC2F8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x37 _081BC302: - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 strb r1, [r7] movs r0, 0xFF @@ -2449,7 +2449,7 @@ _081BC302: _081BC32C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x38 b _081BC466 @@ -2457,7 +2457,7 @@ _081BC32C: _081BC33C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x39 b _081BC3A6 @@ -2465,7 +2465,7 @@ _081BC33C: _081BC34C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3A b _081BC3A6 @@ -2473,7 +2473,7 @@ _081BC34C: _081BC35C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3B b _081BC3A6 @@ -2481,7 +2481,7 @@ _081BC35C: _081BC36C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3C b _081BC3A6 @@ -2489,7 +2489,7 @@ _081BC36C: _081BC37C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3D b _081BC3A6 @@ -2497,7 +2497,7 @@ _081BC37C: _081BC38C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3E b _081BC3A6 @@ -2505,11 +2505,11 @@ _081BC38C: _081BC39C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3F _081BC3A6: - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 strb r0, [r7] @@ -2521,7 +2521,7 @@ _081BC3A6: _081BC3BC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x16 b _081BC466 @@ -2529,7 +2529,7 @@ _081BC3BC: _081BC3CC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x17 b _081BC466 @@ -2537,7 +2537,7 @@ _081BC3CC: _081BC3DC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x18 b _081BC466 @@ -2545,7 +2545,7 @@ _081BC3DC: _081BC3EC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x21 b _081BC466 @@ -2553,7 +2553,7 @@ _081BC3EC: _081BC3FC: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2F b _081BC466 @@ -2561,7 +2561,7 @@ _081BC3FC: _081BC40C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x30 b _081BC466 @@ -2569,7 +2569,7 @@ _081BC40C: _081BC41C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x32 b _081BC466 @@ -2577,7 +2577,7 @@ _081BC41C: _081BC42C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x33 b _081BC466 @@ -2585,7 +2585,7 @@ _081BC42C: _081BC43C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x34 b _081BC466 @@ -2593,7 +2593,7 @@ _081BC43C: _081BC44C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x35 b _081BC466 @@ -2601,11 +2601,11 @@ _081BC44C: _081BC45C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x36 _081BC466: - bl pokemon_getattr + bl GetMonData strb r0, [r7] movs r6, 0x1 _081BC46E: @@ -2768,7 +2768,7 @@ _081BC61C: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0xB @@ -2835,7 +2835,7 @@ _081BC682: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x15 @@ -2948,7 +2948,7 @@ _081BC682: _081BC7B4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2961,7 +2961,7 @@ _081BC7B4: _081BC7D4: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -2980,7 +2980,7 @@ _081BC7F4: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r7, r1, r0 adds r6, r3, 0 adds r6, 0x8 @@ -3005,7 +3005,7 @@ _081BC80E: ble _081BC80E movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x15 mov r2, r9 @@ -3015,7 +3015,7 @@ _081BC80E: _081BC84C: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r3, =gUnknown_02023064 ldr r1, =gUnknown_02024064 @@ -3031,7 +3031,7 @@ _081BC874: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 ldr r5, =gUnknown_02024064 ldrb r2, [r5] @@ -3073,7 +3073,7 @@ _081BC874: _081BC8D8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r3, =gUnknown_02023064 ldr r1, =gUnknown_02024064 @@ -3092,7 +3092,7 @@ _081BC8F0: _081BC908: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3105,7 +3105,7 @@ _081BC908: _081BC928: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3118,7 +3118,7 @@ _081BC928: _081BC948: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3131,7 +3131,7 @@ _081BC948: _081BC968: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3144,7 +3144,7 @@ _081BC968: _081BC988: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3157,7 +3157,7 @@ _081BC988: _081BC9A8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3170,7 +3170,7 @@ _081BC9A8: _081BC9C8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3183,7 +3183,7 @@ _081BC9C8: _081BC9E8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3196,7 +3196,7 @@ _081BC9E8: _081BCA08: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3209,7 +3209,7 @@ _081BCA08: _081BCA28: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3222,7 +3222,7 @@ _081BCA28: _081BCA48: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3235,7 +3235,7 @@ _081BCA48: _081BCA68: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3248,7 +3248,7 @@ _081BCA68: _081BCA88: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3261,7 +3261,7 @@ _081BCA88: _081BCAA8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3275,7 +3275,7 @@ _081BCAC8: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 ldr r5, =gUnknown_02024064 ldrb r2, [r5] @@ -3322,7 +3322,7 @@ _081BCAC8: _081BCB38: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3335,7 +3335,7 @@ _081BCB38: _081BCB58: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3348,7 +3348,7 @@ _081BCB58: _081BCB78: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3361,7 +3361,7 @@ _081BCB78: _081BCB98: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3374,7 +3374,7 @@ _081BCB98: _081BCBB8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3387,7 +3387,7 @@ _081BCBB8: _081BCBD8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3401,7 +3401,7 @@ _081BCBE8: _081BCBF8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3414,7 +3414,7 @@ _081BCBF8: _081BCC18: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3427,7 +3427,7 @@ _081BCC18: _081BCC38: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3440,7 +3440,7 @@ _081BCC38: _081BCC58: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3453,7 +3453,7 @@ _081BCC58: _081BCC78: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3466,7 +3466,7 @@ _081BCC78: _081BCC98: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3479,7 +3479,7 @@ _081BCC98: _081BCCB8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3492,7 +3492,7 @@ _081BCCB8: _081BCCD8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3505,7 +3505,7 @@ _081BCCD8: _081BCCF8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3518,7 +3518,7 @@ _081BCCF8: _081BCD18: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3531,7 +3531,7 @@ _081BCD18: _081BCD38: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3544,7 +3544,7 @@ _081BCD38: _081BCD58: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3557,7 +3557,7 @@ _081BCD58: _081BCD78: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3570,7 +3570,7 @@ _081BCD78: _081BCD98: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3583,7 +3583,7 @@ _081BCD98: _081BCDB8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3596,7 +3596,7 @@ _081BCDB8: _081BCDD8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3609,7 +3609,7 @@ _081BCDD8: _081BCDF8: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3622,7 +3622,7 @@ _081BCDF8: _081BCE18: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3635,7 +3635,7 @@ _081BCE18: _081BCE38: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3648,7 +3648,7 @@ _081BCE38: _081BCE58: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3661,7 +3661,7 @@ _081BCE58: _081BCE78: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3674,7 +3674,7 @@ _081BCE78: _081BCE98: movs r0, 0x64 muls r0, r5 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_02024064 ldrb r2, [r1] @@ -3691,7 +3691,7 @@ _081BCEAE: ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 bl sub_805E990 add sp, 0x34 @@ -3722,7 +3722,7 @@ sub_81BCEE4: @ 81BCEE4 adds r0, r4, 0x1 adds r0, r2, r0 ldrb r0, [r0] - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 adds r5, r3, r0 movs r3, 0 @@ -3774,7 +3774,7 @@ sub_81BCF58: @ 81BCF58 ldrh r0, [r0] movs r5, 0x64 muls r0, r5 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 bl sub_805DD7C ldrb r0, [r6] @@ -3784,7 +3784,7 @@ sub_81BCF58: @ 81BCF58 muls r0, r5 adds r0, r4 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 @@ -3903,7 +3903,7 @@ sub_81BD074: @ 81BD074 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 bl sub_805DD7C ldrb r0, [r5] @@ -3949,16 +3949,16 @@ sub_81BD0E4: @ 81BD0E4 ldrh r1, [r2] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData mov r8, r0 lsls r0, 16 lsrs r0, 16 mov r8, r0 ldr r0, =sub_805D714 - bl object_new_hidden_with_callback + bl CreateInvisibleSpriteWithCallback ldr r1, =gUnknown_03005D7C mov r9, r1 add r9, r6 @@ -4594,7 +4594,7 @@ _081BD6C8: ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 bl sub_805E990 movs r1, 0x40 @@ -5060,7 +5060,7 @@ sub_81BDAC8: @ 81BDAC8 ldr r0, =gUnknown_02023068 adds r4, r0 movs r0, 0xF - bl sub_8130950 + bl BattleAI_SetupAIData bl sub_8130BA4 lsls r0, 24 lsrs r5, r0, 24 @@ -5077,7 +5077,7 @@ sub_81BDAC8: @ 81BDAC8 ands r0, r1 cmp r0, 0 beq _081BDB02 - ldr r1, =gUnknown_0202420C + ldr r1, =gEnemyMonIndex ldrb r0, [r6] strb r0, [r1] _081BDB02: @@ -5093,11 +5093,11 @@ _081BDB02: beq _081BDB3C movs r0, 0x1 bl battle_get_side_with_given_state - ldr r4, =gUnknown_0202420C + ldr r4, =gEnemyMonIndex strb r0, [r4] ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r2 @@ -5109,7 +5109,7 @@ _081BDB02: bl battle_get_side_with_given_state strb r0, [r4] _081BDB3C: - ldr r0, =gUnknown_0202420C + ldr r0, =gEnemyMonIndex ldrb r2, [r0] lsls r2, 8 orrs r2, r5 @@ -5156,10 +5156,10 @@ _081BDBA4: bgt _081BDBD0 movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081BDBA2 ldr r1, =gUnknown_0202406E @@ -5234,10 +5234,10 @@ sub_81BDC10: @ 81BDC10 ldrh r0, [r0] movs r5, 0x64 muls r0, r5 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData mov r8, r0 mov r1, r9 ldrb r0, [r1] @@ -5247,7 +5247,7 @@ sub_81BDC10: @ 81BDC10 muls r0, r5 adds r0, r4 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r3, r0, 0 mov r1, r9 ldrb r0, [r1] @@ -5266,10 +5266,10 @@ _081BDCA0: ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData adds r2, r0, 0 mov r1, r9 ldrb r0, [r1] @@ -5310,11 +5310,11 @@ sub_81BDD00: @ 81BDD00 movs r0, 0x64 adds r1, r7, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData cmp r0, 0x63 bls _081BDD38 bl dp01_tbl3_exec_completed @@ -5325,7 +5325,7 @@ _081BDD38: bl load_gfxc_health_bar adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData ldrb r1, [r6] lsls r1, 9 adds r0, r5, 0x2 @@ -5382,7 +5382,7 @@ sub_81BDD9C: @ 81BDD9C ldrh r2, [r1] movs r1, 0x64 muls r1, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r1, r2 movs r2, 0x9 bl healthbar_draw_field_maybe @@ -5750,10 +5750,10 @@ sub_81BE098: @ 81BE098 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 movs r1, 0x19 @@ -6001,7 +6001,7 @@ _081BE2F4: lsls r0, 24 cmp r0, 0 beq _081BE314 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -6054,7 +6054,7 @@ _081BE344: ldrh r2, [r0] movs r0, 0x64 muls r0, r2 - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty adds r0, r2 bl sub_805DD7C ldrb r0, [r7] @@ -6394,7 +6394,7 @@ nullsub_128: @ 81BE668 thumb_func_start sub_81BE66C sub_81BE66C: @ 81BE66C push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0, 0x4] movs r0, 0xD0 @@ -6448,7 +6448,7 @@ sub_81BE6B8: @ 81BE6B8 b _081BE718 .pool _081BE6CC: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0, 0x4] movs r0, 0xD0 @@ -6490,7 +6490,7 @@ _081BE718: thumb_func_start sub_81BE72C sub_81BE72C: @ 81BE72C push {r4,lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0, 0x4] movs r0, 0xD0 @@ -6551,7 +6551,7 @@ sub_81BE79C: @ 81BE79C b _081BE7EE .pool _081BE7B8: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r4, r0, 16 movs r0, 0x1 @@ -6598,7 +6598,7 @@ sub_81BE808: @ 81BE808 sub sp, 0x4 lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrb r1, [r0, 0x5] ldrb r2, [r0, 0x4] @@ -7324,7 +7324,7 @@ _081BEDFA: ldr r7, =gUnknown_0203CF10 adds r6, r2, 0 _081BEE14: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x30 @@ -7332,7 +7332,7 @@ _081BEE14: adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x30 @@ -7720,10 +7720,10 @@ _081BF170: ldr r0, =0x000001ff mov r8, r0 _081BF178: - bl GenerateRandomNumber + bl Random adds r4, r6, 0 ands r4, r0 - bl GenerateRandomNumber + bl Random adds r1, r6, 0 ands r1, r0 ldr r0, =gUnknown_0203CF0C @@ -8044,7 +8044,7 @@ _081BF430: beq _081BF43C b _081BF592 _081BF43C: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -8064,7 +8064,7 @@ _081BF45C: beq _081BF468 b _081BF592 _081BF468: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -8172,13 +8172,13 @@ _081BF552: bl sub_81BF7A4 cmp r0, 0x3 bne _081BF592 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq _081BF592 - bl Reset + bl DoSoftReset b _081BF592 .pool _081BF574: @@ -8186,7 +8186,7 @@ _081BF574: bl sub_81BF7A4 cmp r0, 0x4 bne _081BF592 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -8805,7 +8805,7 @@ _081BFB0A: sub_81BFB10: @ 81BFB10 push {r4,lr} sub sp, 0x4 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -8854,7 +8854,7 @@ _081BFB9C: b _081BFDE6 _081BFBAA: bl remove_some_task - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -8870,7 +8870,7 @@ _081BFBBC: .pool _081BFBD0: bl ResetAllObjectData - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -8896,7 +8896,7 @@ _081BFC04: bne _081BFC10 b _081BFE18 _081BFC10: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -8907,7 +8907,7 @@ _081BFC20: b _081BFDE6 _081BFC26: bl sub_81C1BA0 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -8935,7 +8935,7 @@ _081BFC58: bne _081BFC6A b _081BFE18 _081BFC6A: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -8946,7 +8946,7 @@ _081BFC7C: b _081BFDE6 _081BFC82: bl sub_81C286C - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -8963,7 +8963,7 @@ _081BFC94: .pool _081BFCAC: bl sub_81C0348 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -9019,7 +9019,7 @@ _081BFD34: ldr r0, [r0] adds r0, 0xC bl sub_81C4984 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -9034,7 +9034,7 @@ _081BFD50: .pool _081BFD60: bl sub_81C4A88 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -9068,7 +9068,7 @@ _081BFDB0: movs r1, 0x10 movs r2, 0 bl BlendPalettes - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -9089,7 +9089,7 @@ _081BFDCC: _081BFDE4: strb r0, [r2, 0x8] _081BFDE6: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -9427,35 +9427,35 @@ _081C012A: _081C012C: adds r0, r5, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData strh r0, [r6] adds r0, r5, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData strh r0, [r6, 0x2] adds r0, r5, 0 movs r1, 0x19 - bl pokemon_getattr + bl GetMonData str r0, [r6, 0x10] adds r0, r5, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData strb r0, [r6, 0x5] adds r0, r5, 0 movs r1, 0x2E - bl pokemon_getattr + bl GetMonData strb r0, [r6, 0x8] adds r0, r5, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData strh r0, [r6, 0x2E] adds r0, r5, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData str r0, [r6, 0xC] adds r0, r5, 0 movs r1, 0x4 - bl pokemon_getattr + bl GetMonData adds r1, r7, 0 adds r1, 0xA5 strb r0, [r1] @@ -9468,7 +9468,7 @@ _081C012C: _081C018C: adds r0, r5, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData strb r0, [r6, 0x4] b _081C0322 _081C0198: @@ -9485,12 +9485,12 @@ _081C01AA: adds r1, r4, 0 adds r1, 0xD adds r0, r5, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r6] adds r1, r4, 0 adds r1, 0x11 adds r0, r5, 0 - bl pokemon_getattr + bl GetMonData mov r2, r8 adds r1, r2, r4 strb r0, [r1] @@ -9500,13 +9500,13 @@ _081C01AA: bls _081C01AA adds r0, r5, 0 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData mov r1, r9 strb r0, [r1] b _081C0322 _081C01DC: ldr r1, [r7] - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty cmp r1, r0 beq _081C01F8 ldr r2, =0x000040bc @@ -9527,27 +9527,27 @@ _081C01F8: strb r0, [r1] adds r0, r5, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData strh r0, [r6, 0x20] adds r0, r5, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData strh r0, [r6, 0x22] adds r0, r5, 0 movs r1, 0x3B - bl pokemon_getattr + bl GetMonData strh r0, [r6, 0x24] adds r0, r5, 0 movs r1, 0x3C - bl pokemon_getattr + bl GetMonData strh r0, [r6, 0x26] adds r0, r5, 0 movs r1, 0x3E - bl pokemon_getattr + bl GetMonData strh r0, [r6, 0x28] adds r0, r5, 0 movs r1, 0x3F - bl pokemon_getattr + bl GetMonData strh r0, [r6, 0x2A] adds r0, r5, 0 movs r1, 0x3D @@ -9561,32 +9561,32 @@ _081C0254: strb r0, [r1] adds r0, r5, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData strh r0, [r6, 0x20] adds r0, r5, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData strh r0, [r6, 0x22] adds r0, r5, 0 movs r1, 0x54 - bl pokemon_getattr + bl GetMonData strh r0, [r6, 0x24] adds r0, r5, 0 movs r1, 0x55 - bl pokemon_getattr + bl GetMonData strh r0, [r6, 0x26] adds r0, r5, 0 movs r1, 0x57 - bl pokemon_getattr + bl GetMonData strh r0, [r6, 0x28] adds r0, r5, 0 movs r1, 0x58 - bl pokemon_getattr + bl GetMonData strh r0, [r6, 0x2A] adds r0, r5, 0 movs r1, 0x56 _081C02A0: - bl pokemon_getattr + bl GetMonData strh r0, [r6, 0x2C] b _081C0322 _081C02A8: @@ -9595,49 +9595,49 @@ _081C02A8: adds r0, r5, 0 movs r1, 0x7 adds r2, r4, 0 - bl pokemon_getattr + bl GetMonData adds r0, r5, 0 movs r1, 0x3 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString adds r0, r5, 0 bl sub_81B205C strb r0, [r6, 0x7] adds r0, r5, 0 movs r1, 0x31 - bl pokemon_getattr + bl GetMonData adds r1, r7, 0 adds r1, 0xA2 strb r0, [r1] adds r0, r5, 0 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData str r0, [r6, 0x48] adds r0, r5, 0 movs r1, 0x23 - bl pokemon_getattr + bl GetMonData strb r0, [r6, 0x9] adds r0, r5, 0 movs r1, 0x24 - bl pokemon_getattr + bl GetMonData strb r0, [r6, 0xA] adds r0, r5, 0 movs r1, 0x25 - bl pokemon_getattr + bl GetMonData strb r0, [r6, 0xB] adds r0, r5, 0 movs r1, 0x20 - bl pokemon_getattr + bl GetMonData strh r0, [r6, 0x30] b _081C0322 _081C0314: adds r0, r5, 0 movs r1, 0x52 - bl pokemon_getattr + bl GetMonData strb r0, [r6, 0x6] movs r0, 0x1 b _081C0332 @@ -9866,7 +9866,7 @@ sub_81C0510: @ 81C0510 ands r0, r1 cmp r0, 0 bne _081C05FE - ldr r5, =gUnknown_030022C0 + ldr r5, =gMain ldrh r1, [r5, 0x2E] movs r0, 0x40 ands r0, r1 @@ -10367,7 +10367,7 @@ _081C099C: muls r0, r4 adds r0, r7, r0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _081C0968 adds r0, r4, 0 @@ -10462,7 +10462,7 @@ sub_81C0A50: @ 81C0A50 push {r4,lr} adds r4, r0, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081C0A84 ldr r0, =gUnknown_0203CF1C @@ -10474,7 +10474,7 @@ sub_81C0A50: @ 81C0A50 bne _081C0A78 adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _081C0A84 _081C0A78: @@ -11018,7 +11018,7 @@ sub_81C0F44: @ 81C0F44 lsrs r0, 24 cmp r0, 0x1 beq _081C103A - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 @@ -11431,7 +11431,7 @@ sub_81C12E4: @ 81C12E4 lsrs r0, 24 cmp r0, 0x1 beq _081C13AA - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 @@ -11958,7 +11958,7 @@ _081C176A: beq _081C177A b _081C189A _081C177A: - ldr r6, =gUnknown_030022C0 + ldr r6, =gMain ldrh r1, [r6, 0x2E] movs r0, 0x40 ands r0, r1 @@ -12175,7 +12175,7 @@ sub_81C1940: @ 81C1940 bne _081C196C b _081C1B74 _081C196C: - ldr r6, =gUnknown_030022C0 + ldr r6, =gMain ldrh r1, [r6, 0x2E] movs r0, 0x40 ands r0, r1 @@ -13723,19 +13723,19 @@ sub_81C2628: @ 81C2628 ldr r0, =0x0000ffff cmp r5, r0 beq _081C26CE - ldr r6, =gUnknown_02021CC4 + ldr r6, =gStringVar1 ldr r1, =gUnknown_085E8D4F adds r0, r6, 0 - bl CopyString - ldr r4, =gUnknown_02021DC4 + bl StringCopy + ldr r4, =gStringVar2 adds r0, r4, 0 adds r1, r5, 0 movs r2, 0x2 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r0, r6, 0 adds r1, r4, 0 - bl AppendString + bl StringAppend mov r0, r8 bl sub_806EBA4 lsls r0, 24 @@ -13785,19 +13785,19 @@ _081C26E8: movs r0, 0x1 bl sub_81C228C _081C26EE: - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 ldr r1, =gUnknown_085E8D4D adds r0, r4, 0 - bl CopyString - ldr r5, =gUnknown_02021DC4 + bl StringCopy + ldr r5, =gStringVar2 ldrb r1, [r7, 0x5] adds r0, r5, 0 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r0, r4, 0 adds r1, r5, 0 - bl AppendString + bl StringAppend movs r6, 0 str r6, [sp] movs r5, 0x1 @@ -13827,7 +13827,7 @@ _081C26EE: muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy str r6, [sp] str r5, [sp, 0x4] movs r0, 0x13 @@ -13858,7 +13858,7 @@ sub_81C2794: @ 81C2794 ldr r0, =gUnknown_0203CF1C ldr r0, [r0] adds r0, 0xC - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 adds r1, r4, 0 bl GetMonNickname movs r0, 0 @@ -14738,17 +14738,17 @@ sub_81C2F5C: @ 81C2F5C lsrs r0, 24 cmp r0, 0x1 beq _081C2FC0 - ldr r5, =gUnknown_02021CC4 + ldr r5, =gStringVar1 ldr r1, =gUnknown_085E8D59 adds r0, r5, 0 - bl CopyString + bl StringCopy ldr r1, =gUnknown_0203CF1C ldr r1, [r1] adds r1, 0xB8 ldrh r1, [r1] movs r2, 0x2 movs r3, 0x5 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x1 adds r1, r5, 0 movs r2, 0x38 @@ -14882,7 +14882,7 @@ sub_81C307C: @ 81C307C cmp r0, 0x1 bne _081C30E0 _081C30C2: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085EA5DB bl sub_81AFC28 b _081C3182 @@ -14950,7 +14950,7 @@ _081C3158: _081C316E: ldr r1, =gUnknown_085EA544 _081C3170: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 bl sub_81AFC28 adds r0, r6, 0 bl Free @@ -14972,7 +14972,7 @@ sub_81C3194: @ 81C3194 bl sub_81C2D2C lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 movs r2, 0 str r2, [sp] str r2, [sp, 0x4] @@ -15020,7 +15020,7 @@ _081C3202: adds r0, r4, 0 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x3 adds r1, r4, 0 bl sub_81AFC0C @@ -15038,7 +15038,7 @@ sub_81C3220: @ 81C3220 adds r6, r0, 0 adds r6, 0x70 ldr r1, [r0] - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty cmp r1, r0 bne _081C326C bl link_get_multiplayer_id @@ -15055,10 +15055,10 @@ sub_81C3220: @ 81C3220 ldrh r4, [r0] adds r0, r1, r2 ldrb r5, [r0, 0x13] - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r2, 0x8 adds r1, r2 - bl CopyString + bl StringCopy b _081C3282 .pool _081C326C: @@ -15066,11 +15066,11 @@ _081C326C: adds r4, r0, 0 ldr r0, =0x0000ffff ands r4, r0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldrb r5, [r1, 0x8] - ldr r0, =gUnknown_02021CC4 - bl CopyString + ldr r0, =gStringVar1 + bl StringCopy _081C3282: adds r0, r6, 0 adds r0, 0x32 @@ -15082,10 +15082,10 @@ _081C3282: ands r0, r1 cmp r4, r0 bne _081C32A4 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0 adds r1, 0x36 - bl CompareStringWithoutExtendedControlCodes + bl StringCompareWithoutExtCtrlCodes cmp r0, 0 beq _081C32B4 _081C32A4: @@ -15147,14 +15147,14 @@ _081C32FE: thumb_func_start sub_81C3304 sub_81C3304: @ 81C3304 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 15 ands r0, r1 cmp r0, 0 beq _081C3354 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -15238,13 +15238,13 @@ sub_81C335C: @ 81C335C sub_81C33CC: @ 81C33CC push {r4,r5,lr} sub sp, 0x8 - ldr r5, =gUnknown_02021CC4 + ldr r5, =gStringVar1 ldr r1, =gUnknown_085E8D59 adds r0, r5, 0 - bl CopyString + bl StringCopy ldr r1, =gUnknown_085E8D38 adds r0, r5, 0 - bl AppendString + bl StringAppend movs r0, 0x1 adds r1, r5, 0 movs r2, 0x38 @@ -15516,7 +15516,7 @@ _081C3628: .pool _081C3644: ldrh r0, [r1] - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 adds r1, r4, 0 bl itemid_get_name adds r5, r4, 0 @@ -15563,15 +15563,15 @@ sub_81C3690: @ 81C3690 b _081C36C8 .pool _081C36B0: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrb r1, [r1] movs r2, 0x1 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EA3B4 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r5, r4, 0 _081C36C8: movs r0, 0x1 @@ -15626,28 +15626,28 @@ sub_81C3710: @ 81C3710 mov r0, r9 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, [r4] adds r0, 0x92 ldrh r1, [r0] mov r0, r8 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, [r4] adds r0, 0x94 ldrh r1, [r0] adds r0, r6, 0 movs r2, 0x1 movs r3, 0x7 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, [r4] adds r0, 0x96 ldrh r1, [r0] adds r0, r5, 0 movs r2, 0x1 movs r3, 0x7 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN bl sub_81AFBF0 movs r0, 0 mov r1, r9 @@ -15661,7 +15661,7 @@ sub_81C3710: @ 81C3710 movs r0, 0x3 adds r1, r5, 0 bl sub_81AFC0C - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_0861CE82 bl sub_81AFC28 mov r0, r9 @@ -15690,7 +15690,7 @@ sub_81C37D8: @ 81C37D8 bl sub_81C2D2C lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 movs r2, 0 str r2, [sp] str r2, [sp, 0x4] @@ -15708,7 +15708,7 @@ sub_81C3808: @ 81C3808 push {r4-r6,lr} mov r6, r8 push {r6} - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 mov r8, r0 ldr r4, =gUnknown_0203CF1C ldr r0, [r4] @@ -15717,23 +15717,23 @@ sub_81C3808: @ 81C3808 mov r0, r8 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r6, =gUnknown_02021DC4 + 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 ConvertIntToDecimalString - ldr r5, =gUnknown_02021EC4 + 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 ConvertIntToDecimalString + bl ConvertIntToDecimalStringN bl sub_81AFBF0 movs r0, 0 mov r1, r8 @@ -15744,7 +15744,7 @@ sub_81C3808: @ 81C3808 movs r0, 0x2 adds r1, r5, 0 bl sub_81AFC0C - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_0861CE8E bl sub_81AFC28 pop {r3} @@ -15764,7 +15764,7 @@ sub_81C3890: @ 81C3890 bl sub_81C2D2C lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 movs r2, 0 str r2, [sp] str r2, [sp, 0x4] @@ -15790,12 +15790,12 @@ sub_81C38C0: @ 81C38C0 bl sub_81C2D2C lsls r0, 24 lsrs r6, r0, 24 - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 ldr r1, [r5, 0x10] adds r0, r4, 0 movs r2, 0x1 movs r3, 0x7 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x1 adds r1, r4, 0 movs r2, 0x2A @@ -15837,11 +15837,11 @@ sub_81C38C0: @ 81C38C0 _081C3948: movs r1, 0 _081C394A: - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 adds r0, r4, 0 movs r2, 0x1 movs r3, 0x6 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x1 adds r1, r4, 0 movs r2, 0x2A @@ -16090,7 +16090,7 @@ sub_81C3B08: @ 81C3B08 mov r0, r8 movs r2, 0 bl sub_81C25A4 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 mov r8, r0 mov r5, r10 adds r5, 0x8C @@ -16098,13 +16098,13 @@ sub_81C3B08: @ 81C3B08 ldrb r1, [r5] movs r2, 0x1 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021DC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar2 adds r0, r4, 0 adds r1, r6, 0 movs r2, 0x1 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN bl sub_81AFBF0 movs r0, 0 mov r1, r8 @@ -16112,7 +16112,7 @@ sub_81C3B08: @ 81C3B08 movs r0, 0x1 adds r1, r4, 0 bl sub_81AFC0C - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_0861CE97 adds r0, r4, 0 bl sub_81AFC28 @@ -16204,12 +16204,12 @@ sub_81C3C5C: @ 81C3C5C b _081C3CAC .pool _081C3C9C: - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 ldrb r1, [r2, 0x1] adds r0, r4, 0 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r1, r4, 0 _081C3CAC: movs r0, 0 @@ -16230,12 +16230,12 @@ _081C3CAC: b _081C3CEC .pool _081C3CDC: - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 ldrb r1, [r1, 0x3] adds r0, r4, 0 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r1, r4, 0 _081C3CEC: movs r0, 0 @@ -16575,7 +16575,7 @@ _081C3FD0: movs r3, 0x41 bl sub_81C25A4 _081C3FEC: - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 ldr r1, =gBattleMoves lsls r0, r5, 1 adds r0, r5 @@ -16585,7 +16585,7 @@ _081C3FEC: adds r0, r4, 0 movs r2, 0x1 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN bl sub_81AFBF0 movs r0, 0 adds r1, r4, 0 @@ -16593,7 +16593,7 @@ _081C3FEC: movs r0, 0x1 adds r1, r4, 0 bl sub_81AFC0C - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_0861CE97 adds r0, r4, 0 bl sub_81AFC28 @@ -17335,7 +17335,7 @@ _081C4610: b _081C4770 .pool _081C4620: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] @@ -17376,7 +17376,7 @@ _081C4680: cmp r3, 0 beq _081C46E4 ldr r1, [r2] - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty cmp r1, r0 beq _081C46A6 ldr r1, =0x000040bc @@ -17414,7 +17414,7 @@ _081C46D6: .pool _081C46E4: ldr r1, [r2] - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty cmp r1, r0 beq _081C4700 ldr r1, =0x000040bc @@ -17746,7 +17746,7 @@ sub_81C4984: @ 81C4984 beq _081C49CE adds r0, r5, 0 movs r1, 0x8 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -17795,7 +17795,7 @@ sub_81C49E0: @ 81C49E0 sub_81C4A08: @ 81C4A08 push {r4,lr} movs r1, 0x26 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 bl ball_number_to_ball_processing_index @@ -18574,7 +18574,7 @@ _081C5072: sub_81C5078: @ 81C5078 push {lr} sub sp, 0x4 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -18697,7 +18697,7 @@ _081C5188: _081C51A0: strb r0, [r2, 0x8] _081C51A2: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -18855,7 +18855,7 @@ _081C530A: thumb_func_start sub_81C5314 sub_81C5314: @ 81C5314 push {r4-r7,lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r1, =0x00000ca9 adds r0, r2, r1 @@ -18919,7 +18919,7 @@ _081C5382: ldr r0, [r5] adds r0, r4 ldr r1, =gUnknown_085E8DB4 - bl CopyString + bl StringCopy ldr r1, [r5] lsls r2, r6, 3 ldr r3, =0x00000824 @@ -18969,18 +18969,18 @@ sub_81C540C: @ 81C540C lsrs r0, 24 cmp r0, 0x4 bne _081C5450 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 subs r1, 0x84 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r1, =gUnknown_02021DC4 + bl ConvertIntToDecimalStringN + ldr r1, =gStringVar2 adds r0, r4, 0 bl itemid_get_name ldr r1, =gUnknown_085E9210 adds r0, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders b _081C5458 .pool _081C5450: @@ -19022,7 +19022,7 @@ _081C5476: negs r0, r0 cmp r4, r0 beq _081C54E0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] lsls r3, r4, 1 ldr r1, =0x00000ca9 @@ -19104,8 +19104,8 @@ _081C5558: movs r1, 0xFF bl sub_81C5AB8 _081C5560: - ldr r0, =gUnknown_02021CC4 - ldr r1, =gUnknown_03005D90 + ldr r0, =gStringVar1 + ldr r1, =gSaveBlock2Ptr ldr r3, [r1] ldr r2, =0x00000ca9 adds r1, r3, r2 @@ -19122,11 +19122,11 @@ _081C5560: ldrb r1, [r3] movs r2, 0x1 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E8DA0 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x7 adds r1, r4, 0 movs r2, 0x77 @@ -19161,7 +19161,7 @@ sub_81C55D8: @ 81C55D8 negs r0, r0 cmp r3, r0 beq _081C561C - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] lsls r3, 1 ldr r1, =0x00000ca9 @@ -19182,18 +19182,18 @@ sub_81C55D8: @ 81C55D8 b _081C5638 .pool _081C561C: - ldr r0, =gUnknown_02021CC4 + 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 CopyString - ldr r4, =gUnknown_02021FC4 + bl StringCopy + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E91C0 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders _081C5638: movs r0, 0x1 movs r1, 0 @@ -19315,7 +19315,7 @@ sub_81C5738: @ 81C5738 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 - ldr r2, =gUnknown_03005D90 + ldr r2, =gSaveBlock2Ptr ldr r6, [r2] ldr r3, =0x00000ca9 adds r2, r6, r3 @@ -19369,7 +19369,7 @@ sub_81C57A8: @ 81C57A8 adds r7, r4, 0 lsls r1, 24 lsrs r5, r1, 24 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] ldr r1, =0x00000ca9 adds r0, r3, r1 @@ -19464,7 +19464,7 @@ sub_81C586C: @ 81C586C mov r7, r9 mov r6, r8 push {r6,r7} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] ldr r1, =0x00000ca9 adds r0, r3, r1 @@ -19556,7 +19556,7 @@ _081C58FE: thumb_func_start sub_81C5924 sub_81C5924: @ 81C5924 push {r4-r6,lr} - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldr r1, =0x00000ca9 adds r0, r2, r1 @@ -19901,7 +19901,7 @@ _081C5BEA: beq _081C5BF8 b _081C5D16 _081C5BF8: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x4 ands r0, r1 @@ -19970,7 +19970,7 @@ _081C5CA0: bl audio_play ldr r2, =gUnknown_0203CE7C mov r12, r2 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] lsls r3, r6, 1 ldr r0, =0x00000ca9 @@ -20098,12 +20098,12 @@ _081C5DD8: _081C5DDA: ldr r0, =gUnknown_0203CE7C ldrh r0, [r0] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E8DBE adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 movs r1, 0 bl FillWindowPixelBuffer @@ -20335,7 +20335,7 @@ _081C5FF8: bl GetMenuCursorPos lsls r0, 24 lsrs r4, r0, 24 - ldr r5, =gUnknown_030022C0 + ldr r5, =gMain ldrh r1, [r5, 0x2E] movs r0, 0x40 ands r0, r1 @@ -20691,12 +20691,12 @@ sub_81C62C4: @ 81C62C4 _081C62F4: ldr r0, =gUnknown_0203CE7C ldrh r0, [r0] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E8EE0 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 movs r1, 0 bl FillWindowPixelBuffer @@ -20738,18 +20738,18 @@ sub_81C6350: @ 81C6350 adds r4, r0 ldr r0, =gUnknown_0203CE7C ldrh r0, [r0] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 movs r2, 0x10 ldrsh r1, [r4, r2] movs r2, 0 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E8F0E adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 movs r1, 0 bl FillWindowPixelBuffer @@ -20802,15 +20802,15 @@ sub_81C63D0: @ 81C63D0 sub_81C6404: @ 81C6404 push {r4,lr} sub sp, 0xC - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r1, 0x1 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E8DA0 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x3 bl sub_81C6CEC movs r0, 0x1 @@ -20841,16 +20841,16 @@ sub_81C645C: @ 81C645C push {r4,lr} sub sp, 0xC adds r1, r0, 0 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 lsls r1, 16 asrs r1, 16 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E8DA0 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 adds r1, r4, 0 movs r2, 0x28 @@ -20899,7 +20899,7 @@ sub_81C64B4: @ 81C64B4 b _081C6544 .pool _081C64E8: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -20953,18 +20953,18 @@ sub_81C654C: @ 81C654C adds r6, r4, r5 ldr r0, =gUnknown_0203CE7C ldrh r0, [r0] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 movs r2, 0x10 ldrsh r1, [r6, r2] movs r2, 0 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r6, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r6, =gStringVar4 ldr r1, =gUnknown_085E8EF9 adds r0, r6, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 movs r1, 0 bl FillWindowPixelBuffer @@ -21001,7 +21001,7 @@ sub_81C65CC: @ 81C65CC adds r4, r0, r1 ldr r6, =gUnknown_0203CF38 subs r7, r6, 0x2 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -21089,12 +21089,12 @@ sub_81C66AC: @ 81C66AC lsrs r4, 24 ldr r0, =gUnknown_0203CE7C ldrh r0, [r0] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name - ldr r5, =gUnknown_02021FC4 + ldr r5, =gStringVar4 ldr r1, =gUnknown_085E8E11 adds r0, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r2, =sub_81C66EC adds r0, r4, 0 adds r1, r5, 0 @@ -21110,7 +21110,7 @@ sub_81C66EC: @ 81C66EC push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -21243,7 +21243,7 @@ sub_81C67CC: @ 81C67CC movs r1, 0x10 movs r2, 0x1 bl sub_81AF15C - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r3, [r0] movs r0, 0x2 ldrsh r2, [r5, r0] @@ -21261,12 +21261,12 @@ sub_81C67CC: @ 81C67CC adds r3, r0 adds r3, r2 ldrh r0, [r3] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name - ldr r6, =gUnknown_02021FC4 + ldr r6, =gStringVar4 ldr r1, =gUnknown_085E8DFE adds r0, r6, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 movs r1, 0 bl FillWindowPixelBuffer @@ -21316,7 +21316,7 @@ sub_81C68B0: @ 81C68B0 lsrs r0, 24 cmp r0, 0x1 beq _081C695C - ldr r7, =gUnknown_030022C0 + ldr r7, =gMain ldrh r1, [r7, 0x2E] movs r0, 0x4 ands r0, r1 @@ -21520,7 +21520,7 @@ sub_81C6A94: @ 81C6A94 mov r6, r8 push {r6,r7} sub sp, 0x4 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty mov r9, r0 movs r0, 0x14 bl Alloc @@ -21528,7 +21528,7 @@ sub_81C6A94: @ 81C6A94 movs r0, 0xA bl Alloc adds r5, r0, 0 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr mov r8, r1 ldr r2, [r1] ldr r4, =0x00000ca9 @@ -21566,7 +21566,7 @@ _081C6AF8: muls r0, r6 add r0, r9 movs r1, 0xC - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 mov r1, sp @@ -22007,7 +22007,7 @@ sub_81C6E98: @ 81C6E98 ldr r0, =gUnknown_08D9ADD0 adds r1, r4, 0 bl LZDecompressWram - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 @@ -22553,7 +22553,7 @@ _081C7338: bl Free movs r0, 0 str r0, [r4] - bl InitKeypadData + bl InitKeys pop {r4} pop {r0} bx r0 @@ -22592,21 +22592,21 @@ _081C738C: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x5 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081C73BA adds r0, r4, 0 movs r1, 0x6 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _081C73BA adds r0, r4, 0 movs r1, 0x52 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _081C73E2 _081C73BA: @@ -22881,7 +22881,7 @@ sub_81C75E0: @ 81C75E0 thumb_func_start sub_81C75F4 sub_81C75F4: @ 81C75F4 push {lr} - bl InitKeypadData + bl InitKeys pop {r0} bx r0 thumb_func_end sub_81C75F4 @@ -26856,7 +26856,7 @@ sub_81C943C: @ 81C943C movs r0, 0x1 b _081C951A _081C944C: - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r0, 0x1 ands r0, r1 @@ -26889,7 +26889,7 @@ _081C9488: .4byte _081C94E0 .4byte _081C9516 _081C949C: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r1, [r0, 0x15] movs r0, 0x8 @@ -26967,7 +26967,7 @@ sub_81C9520: @ 81C9520 movs r0, 0x1 b _081C9580 _081C9530: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -27019,7 +27019,7 @@ c2_pre_battle_1: @ 81C9588 movs r0, 0x1 b _081C95F8 _081C9598: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -27081,7 +27081,7 @@ sub_81C9600: @ 81C9600 movs r0, 0x1 b _081C9634 _081C9616: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -27111,7 +27111,7 @@ sub_81C963C: @ 81C963C movs r0, 0x1 b _081C96F6 _081C964E: - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r0, 0x1 ands r0, r1 @@ -27204,7 +27204,7 @@ sub_81C96FC: @ 81C96FC movs r0, 0x1 b _081C9792 _081C970C: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -27345,7 +27345,7 @@ sub_81C97F8: @ 81C97F8 sub_81C9814: @ 81C9814 push {r4,r5,lr} adds r4, r0, 0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 @@ -27464,7 +27464,7 @@ _081C98D8: bl sub_81CAE08 cmp r0, 0 beq _081C9914 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000009ca adds r0, r1 @@ -29770,7 +29770,7 @@ sub_81CAB38: @ 81CAB38 sub_81CAB44: @ 81CAB44 push {r4,r5,lr} adds r4, r0, 0 - ldr r3, =gUnknown_030022C0 + ldr r3, =gMain ldrh r1, [r3, 0x30] movs r0, 0x40 ands r0, r1 @@ -29872,7 +29872,7 @@ sub_81CABFC: @ 81CABFC sub_81CAC04: @ 81CAC04 push {r4,lr} adds r4, r0, 0 - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r0, 0x40 ands r0, r1 @@ -29967,7 +29967,7 @@ _081CACAC: sub_81CACB8: @ 81CACB8 push {lr} adds r3, r0, 0 - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x30] movs r0, 0x40 ands r0, r1 @@ -30005,7 +30005,7 @@ _081CACF0: sub_81CACF8: @ 81CACF8 push {lr} adds r2, r0, 0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -30283,7 +30283,7 @@ _081CAED4: _081CAEDC: cmp r4, 0x4E beq _081CAEFC - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000009ca adds r0, r1 @@ -30383,17 +30383,17 @@ _081CAFA4: bne _081CAFC4 ldrh r0, [r1, 0x1E] bl sub_81D15BC - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 bl sub_81967AC strb r0, [r6] b _081CAFCC .pool _081CAFC4: ldrh r0, [r1, 0x1E] - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 bl sub_81D189C _081CAFCC: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 _081CAFCE: pop {r4-r6} pop {r1} @@ -30636,7 +30636,7 @@ _081CB170: bl sub_81CAE08 cmp r0, 0 beq _081CB18A - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000009ca adds r0, r1 @@ -30656,7 +30656,7 @@ _081CB192: beq _081CB1C0 adds r0, r4, 0 bl sub_81D1854 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r1, [r1] ldr r2, =0x000009ca adds r1, r2 @@ -30700,7 +30700,7 @@ sub_81CB1D0: @ 81CB1D0 ldrb r1, [r1, 0x14] cmp r0, r1 bne _081CB258 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000009ca adds r0, r1 @@ -32212,7 +32212,7 @@ sub_81CBE0C: @ 81CBE0C mov r0, sp movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r0, r4, 0 mov r1, sp movs r2, 0x1 @@ -32253,7 +32253,7 @@ _081CBE68: mov r0, sp movs r2, 0 movs r3, 0x5 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r0, r4, 0 mov r1, sp movs r2, 0x3 @@ -32346,7 +32346,7 @@ sub_81CBEF8: @ 81CBEF8 _081CBF1C: ldr r1, =gUnknown_085EC00F add r0, sp, 0xC - bl CopyString + bl StringCopy _081CBF24: movs r0, 0x7 add r1, sp, 0xC @@ -32674,7 +32674,7 @@ sub_81CC158: @ 81CC158 sub_81CC194: @ 81CC194 push {r4,lr} adds r4, r0, 0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2C] movs r0, 0x1 ands r0, r1 @@ -33127,7 +33127,7 @@ _081CC51A: sub_81CC524: @ 81CC524 push {lr} bl sub_8124658 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r3, [r1] movs r1, 0x1 ands r1, r0 @@ -33207,7 +33207,7 @@ _081CC5AE: sub_81CC5B4: @ 81CC5B4 push {lr} adds r2, r0, 0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -33352,7 +33352,7 @@ sub_81CC6D0: @ 81CC6D0 bl sub_81CC5E4 cmp r0, 0 bne _081CC6EC - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x15] lsrs r0, 3 @@ -34222,7 +34222,7 @@ sub_81CCDE8: @ 81CCDE8 sub sp, 0xC mov r9, r0 movs r5, 0 - ldr r6, =gUnknown_02021CC4 + ldr r6, =gStringVar1 movs r4, 0x88 lsls r4, 21 lsls r1, 24 @@ -34234,7 +34234,7 @@ _081CCE08: adds r0, r6, 0 movs r2, 0 movs r3, 0xC - bl CopyStringPadded + bl StringCopyPadded mov r1, r9 ldrb r0, [r1, 0x8] lsrs r1, r4, 24 @@ -34484,7 +34484,7 @@ sub_81CCFD8: @ 81CCFD8 adds r0, r4, r1 bl sub_81D1ED4 bl sub_81CD970 - ldr r1, =gUnknown_030022B0 + ldr r1, =gKeyRepeatStartDelay movs r0, 0x14 strh r0, [r1] ldr r0, =0x00006304 @@ -34515,7 +34515,7 @@ sub_81CD024: @ 81CD024 adds r0, r4, r1 bl sub_81D1ED4 bl sub_81CD9F8 - ldr r1, =gUnknown_030022B0 + ldr r1, =gKeyRepeatStartDelay movs r0, 0x14 strh r0, [r1] ldr r0, =0x00006304 @@ -34560,7 +34560,7 @@ sub_81CD08C: @ 81CD08C lsrs r2, r0, 24 cmp r2, 0 bne _081CD100 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -34643,7 +34643,7 @@ sub_81CD110: @ 81CD110 bne _081CD174 movs r0, 0x64 muls r0, r3 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x8 mov r2, sp @@ -34719,7 +34719,7 @@ sub_81CD1E4: @ 81CD1E4 bl sub_81C763C adds r2, r0, 0 movs r3, 0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2C] movs r0, 0x40 ands r0, r1 @@ -35291,7 +35291,7 @@ sub_81CD624: @ 81CD624 adds r0, r5, 0 movs r2, 0 movs r3, 0xC - bl CopyStringPadded + bl StringCopyPadded b _081CD80E .pool _081CD690: @@ -35301,7 +35301,7 @@ _081CD690: adds r3, r5, 0 bl sub_81D2C68 adds r0, r5, 0 - bl GetStringEnd_Limit7 + bl StringGetEnd10 adds r0, r4, 0 adds r1, r6, 0 movs r2, 0xB @@ -35314,11 +35314,11 @@ _081CD690: movs r0, 0x64 adds r4, r6, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 mov r8, r0 @@ -35353,7 +35353,7 @@ _081CD706: ldr r0, =gSpeciesNames adds r1, r0 adds r0, r5, 0 - bl CompareString + bl StringCompare cmp r0, 0 bne _081CD71C movs r6, 0xFF @@ -35451,7 +35451,7 @@ _081CD790: mov r1, r8 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r3, r0, 0 subs r4, r3, r4 lsls r4, 16 @@ -35668,10 +35668,10 @@ sub_81CD970: @ 81CD970 _081CD998: movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData adds r2, r0, 0 cmp r2, 0 bne _081CD9BE @@ -37272,9 +37272,9 @@ sub_81CE738: @ 81CE738 lsrs r1, 16 movs r2, 0x1 movs r3, 0x4 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r1, =gUnknown_085EBFD7 - bl CopyString + bl StringCopy pop {r1} bx r1 .pool @@ -37403,7 +37403,7 @@ _081CE80C: adds r5, 0x11 ldr r1, =gUnknown_085EBFD7 adds r0, r5, 0 - bl CopyString + bl StringCopy ldr r0, =0x00001821 adds r6, r0 ldrb r0, [r6] @@ -37421,7 +37421,7 @@ _081CE80C: adds r0, r5, 0 movs r2, 0x1 movs r3, 0x4 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldrb r0, [r6] str r7, [sp] str r4, [sp, 0x4] @@ -38331,7 +38331,7 @@ _081CF022: sub_81CF030: @ 81CF030 push {r4,r5,lr} adds r4, r0, 0 - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x30] movs r0, 0x40 ands r0, r1 @@ -38507,16 +38507,16 @@ _081CF158: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x5 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081CF1AA adds r0, r4, 0 movs r1, 0x6 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _081CF1A4 lsls r1, r5, 24 @@ -38528,7 +38528,7 @@ _081CF158: str r0, [sp] ldr r1, [r6, 0x14] adds r0, r4, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 ldr r2, =0x0000ffff ldr r1, [sp] @@ -39386,13 +39386,13 @@ sub_81CF7F4: @ 81CF7F4 bl sub_81CF0F0 adds r7, r0, 0 bl sub_81AFBF0 - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 movs r0, 0 adds r1, r4, 0 bl sub_81AFC0C movs r0, 0xFF strb r0, [r4] - ldr r5, =gUnknown_02021DC4 + ldr r5, =gStringVar2 ldr r1, =gUnknown_085EC029 adds r0, r5, 0 bl sub_81AFC28 @@ -39414,7 +39414,7 @@ sub_81CF7F4: @ 81CF7F4 adds r1, r7, 0 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN mov r1, r8 ldrb r0, [r1, 0x8] mov r1, r10 @@ -39494,7 +39494,7 @@ sub_81CF8E4: @ 81CF8E4 movs r0, 0x64 adds r4, r1, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 bl pokemon_get_gender @@ -39504,10 +39504,10 @@ sub_81CF8E4: @ 81CF8E4 bl level_by_exp lsls r0, 24 lsrs r7, r0, 24 - ldr r2, =gUnknown_02021EC4 + ldr r2, =gStringVar3 adds r0, r4, 0 movs r1, 0x2 - bl pokemon_getattr + bl GetMonData b _081CF94A .pool _081CF924: @@ -39522,14 +39522,14 @@ _081CF924: bl sub_80690C0 lsls r0, 24 lsrs r7, r0, 24 - ldr r2, =gUnknown_02021EC4 + ldr r2, =gStringVar3 adds r0, r4, 0 movs r1, 0x2 bl pokemon_getattr_encrypted _081CF94A: - ldr r4, =gUnknown_02021EC4 + ldr r4, =gStringVar3 adds r0, r4, 0 - bl GetStringEnd_Limit7 + bl StringGetEnd10 adds r0, r6, 0 movs r1, 0x1 adds r2, r4, 0 @@ -39550,9 +39550,9 @@ _081CF974: _081CF97C: ldr r1, =gUnknown_086235C8 _081CF97E: - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 adds r0, r4, 0 - bl CopyString + bl StringCopy movs r1, 0xBA strb r1, [r0] adds r0, 0x1 @@ -39565,7 +39565,7 @@ _081CF97E: adds r1, r7, 0 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r0, r6, 0 movs r1, 0x1 adds r2, r4, 0 @@ -39687,7 +39687,7 @@ _081CFA7A: sub_81CFA88: @ 81CFA88 push {r4,r5,lr} adds r4, r0, 0 - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x30] movs r0, 0x40 ands r0, r1 @@ -39863,26 +39863,26 @@ _081CFBB0: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x5 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081CFC10 adds r0, r4, 0 movs r1, 0x6 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _081CFC0A adds r0, r4, 0 movs r1, 0x4 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _081CFC0A adds r0, r4, 0 movs r1, 0x52 - bl pokemon_getattr + bl GetMonData adds r3, r0, 0 cmp r3, 0 beq _081CFC0A @@ -40083,21 +40083,21 @@ _081CFD5C: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x5 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _081CFD8A adds r0, r4, 0 movs r1, 0x6 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _081CFD8A adds r0, r4, 0 movs r1, 0x53 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _081CFDB2 _081CFD8A: @@ -40782,14 +40782,14 @@ sub_81D02B0: @ 81D02B0 add r0, sp, 0xC movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r1, 0xBA strb r1, [r0] adds r0, 0x1 adds r1, r5, 0 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x1 add r1, sp, 0xC movs r2, 0x38 @@ -40870,7 +40870,7 @@ sub_81D035C: @ 81D035C movs r0, 0x64 adds r4, r1, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 bl pokemon_get_gender @@ -40881,10 +40881,10 @@ sub_81D035C: @ 81D035C lsls r0, 24 lsrs r0, 24 mov r8, r0 - ldr r2, =gUnknown_02021EC4 + ldr r2, =gStringVar3 adds r0, r4, 0 movs r1, 0x2 - bl pokemon_getattr + bl GetMonData b _081D03CC .pool _081D03A4: @@ -40900,14 +40900,14 @@ _081D03A4: lsls r0, 24 lsrs r0, 24 mov r8, r0 - ldr r2, =gUnknown_02021EC4 + ldr r2, =gStringVar3 adds r0, r4, 0 movs r1, 0x2 bl pokemon_getattr_encrypted _081D03CC: - ldr r4, =gUnknown_02021EC4 + ldr r4, =gStringVar3 adds r0, r4, 0 - bl GetStringEnd_Limit7 + bl StringGetEnd10 adds r0, r6, 0 movs r1, 0x1 adds r2, r4, 0 @@ -40928,9 +40928,9 @@ _081D03F8: _081D0400: ldr r1, =gUnknown_086237E8 _081D0402: - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 adds r0, r4, 0 - bl CopyString + bl StringCopy movs r1, 0xBA strb r1, [r0] adds r0, 0x1 @@ -40943,7 +40943,7 @@ _081D0402: mov r1, r8 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r0, r6, 0 movs r1, 0x1 adds r2, r4, 0 @@ -40953,7 +40953,7 @@ _081D0402: ldrh r1, [r7, 0x2] movs r2, 0x1 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN pop {r3} mov r8, r3 pop {r4-r7} @@ -40982,10 +40982,10 @@ sub_81D0450: @ 81D0450 adds r1, 0x98 ldr r0, =sub_81D04C4 str r0, [r1] - ldr r1, =gUnknown_030026FC + ldr r1, =gKeyRepeatContinueDelay movs r0, 0x3 strh r0, [r1] - ldr r1, =gUnknown_030022B0 + ldr r1, =gKeyRepeatStartDelay movs r0, 0xA strh r0, [r1] movs r0, 0x1 @@ -41025,7 +41025,7 @@ sub_81D04B8: @ 81D04B8 sub_81D04C4: @ 81D04C4 push {r4,lr} adds r4, r0, 0 - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x30] movs r0, 0x40 ands r0, r1 @@ -41096,7 +41096,7 @@ _081D053E: sub_81D0548: @ 81D0548 push {r4,lr} adds r4, r0, 0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x30] movs r0, 0x40 ands r0, r1 @@ -41107,7 +41107,7 @@ sub_81D0548: @ 81D0548 cmp r0, 0 bne _081D05A4 _081D0562: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x30] movs r0, 0x80 ands r0, r1 @@ -41118,7 +41118,7 @@ _081D0562: cmp r0, 0 bne _081D05A4 _081D0578: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x30] movs r0, 0x20 ands r0, r1 @@ -41129,7 +41129,7 @@ _081D0578: cmp r0, 0 bne _081D05A4 _081D058E: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x30] movs r0, 0x10 ands r0, r1 @@ -41144,7 +41144,7 @@ _081D05A4: b _081D05CA .pool _081D05AC: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -41360,12 +41360,12 @@ sub_81D06E4: @ 81D06E4 movs r0, 0x64 adds r4, r1, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x2 adds r2, r5, 0 - bl pokemon_getattr + bl GetMonData adds r0, r4, 0 bl level_by_exp strb r0, [r7] @@ -41390,7 +41390,7 @@ _081D0730: bl pokemon_getattr_encrypted _081D0752: adds r0, r5, 0 - bl GetStringEnd_Limit7 + bl StringGetEnd10 pop {r4-r7} pop {r0} bx r0 @@ -41416,19 +41416,19 @@ sub_81D0760: @ 81D0760 movs r0, 0x64 adds r4, r1, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData strh r0, [r5] adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData str r0, [r6] adds r0, r4, 0 movs r1, 0x1 - bl pokemon_getattr + bl GetMonData b _081D07D0 .pool _081D07AC: @@ -41474,10 +41474,10 @@ _081D07FA: ldrb r1, [r1, 0x1] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x52 - bl pokemon_getattr + bl GetMonData _081D080A: pop {r1} bx r1 @@ -41503,10 +41503,10 @@ sub_81D0814: @ 81D0814 ldrb r1, [r1, 0x1] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x53 - bl pokemon_getattr + bl GetMonData b _081D0852 .pool _081D0848: @@ -42291,18 +42291,18 @@ sub_81D0E84: @ 81D0E84 add r0, sp, 0xC movs r2, 0x3 bl memcpy - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 bl sub_81D07D8 adds r1, r0, 0 adds r0, r4, 0 movs r2, 0 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN bl sub_81AFBF0 movs r0, 0 adds r1, r4, 0 bl sub_81AFC0C - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EC030 adds r0, r4, 0 bl sub_81AFC28 @@ -42376,7 +42376,7 @@ _081D0F2E: b _081D0FAA .pool _081D0F60: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] adds r0, r5 ldr r1, =0x0000318f @@ -42454,7 +42454,7 @@ sub_81D0FF0: @ 81D0FF0 adds r0, r5, 0 movs r1, 0x11 bl FillWindowPixelBuffer - ldr r4, =gUnknown_02021EC4 + ldr r4, =gStringVar3 mov r6, sp adds r6, 0xD adds r0, r4, 0 @@ -42487,9 +42487,9 @@ _081D1040: _081D1048: ldr r1, =gUnknown_08624BD8 _081D104A: - ldr r5, =gUnknown_02021CC4 + ldr r5, =gStringVar1 adds r0, r5, 0 - bl CopyString + bl StringCopy movs r1, 0xBA strb r1, [r0] adds r0, 0x1 @@ -42503,7 +42503,7 @@ _081D104A: ldrb r1, [r1] movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN lsls r4, r7, 24 lsrs r4, 24 movs r0, 0x1 @@ -42560,19 +42560,19 @@ sub_81D10D0: @ 81D10D0 adds r4, 0x1 bl sub_81D06D4 adds r6, r0, 0 - ldr r5, =gUnknown_02021CC4 + ldr r5, =gStringVar1 adds r0, r5, 0 adds r1, r4, 0 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r1, 0xBA strb r1, [r0] adds r0, 0x1 adds r1, r6, 0 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x1 adds r1, r5, 0 movs r2, 0x38 @@ -43309,7 +43309,7 @@ _081D168E: sub_81D1694: @ 81D1694 push {lr} adds r2, r0, 0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldrb r0, [r2, 0x1] ldrb r1, [r1, 0x8] @@ -43470,7 +43470,7 @@ sub_81D1790: @ 81D1790 ldrh r0, [r1, 0x4] cmp r0, 0x48 bhi _081D17B8 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x000009ca adds r0, r2 @@ -43491,7 +43491,7 @@ _081D17BA: thumb_func_start sub_81D17C0 sub_81D17C0: @ 81D17C0 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r1, [r1] ldr r2, =0x000009ca adds r1, r2 @@ -43788,7 +43788,7 @@ _081D1974: _081D1984: ldr r1, [r4] mov r0, r9 - bl ExpandStringRefs + bl StringExpandPlaceholders pop {r3,r4} mov r8, r3 mov r9, r4 @@ -43860,7 +43860,7 @@ _081D19F8: _081D1A0A: ldr r1, [r4] mov r0, r10 - bl ExpandStringRefs + bl StringExpandPlaceholders b _081D1A5C .pool _081D1A1C: @@ -43875,7 +43875,7 @@ _081D1A24: lsls r0, 24 cmp r0, 0 beq _081D1A50 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000009ca adds r0, r1 @@ -43895,7 +43895,7 @@ _081D1A50: adds r0, r6 ldr r1, [r0] mov r0, r10 - bl ExpandStringRefs + bl StringExpandPlaceholders _081D1A5C: pop {r3-r5} mov r8, r3 @@ -44308,7 +44308,7 @@ sub_81D1D44: @ 81D1D44 negs r0, r0 cmp r3, r0 beq _081D1DAC - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr lsls r1, r3, 3 adds r1, r3 lsls r1, 2 @@ -44317,18 +44317,18 @@ sub_81D1D44: @ 81D1D44 ldr r0, =0x00002cca adds r1, r0 add r0, sp, 0x14 - bl CopyString + bl StringCopy add r0, sp, 0x14 bl sub_81DB52C add r0, sp, 0x14 - bl GetStringLength + bl StringLength lsls r0, 16 lsrs r0, 16 cmp r0, 0x5 bhi _081D1D8C add r0, sp, 0x14 movs r1, 0x1 - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString _081D1D8C: movs r0, 0 str r0, [sp] @@ -45961,7 +45961,7 @@ _081D29C4: add r0, sp, 0xC movs r2, 0 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN lsls r3, r4, 24 lsrs r3, 24 mov r0, r10 @@ -45984,7 +45984,7 @@ _081D2A3C: add r0, sp, 0xC movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN add r5, sp, 0xC _081D2A4A: movs r0, 0x19 @@ -46008,7 +46008,7 @@ _081D2A70: add r0, sp, 0xC movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN add r5, sp, 0xC _081D2A7E: movs r0, 0x29 @@ -46258,20 +46258,20 @@ sub_81D2C68: @ 81D2C68 _081D2C7E: movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 adds r1, r2, 0 adds r2, r3, 0 - bl pokemon_getattr + bl GetMonData b _081D2CCA .pool _081D2C94: movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 adds r1, r2, 0 - bl pokemon_getattr + bl GetMonData b _081D2CCA .pool _081D2CA8: @@ -46333,7 +46333,7 @@ sub_81D2CD0: @ 81D2CD0 adds r0, r5, 0 movs r2, 0 movs r3, 0xC - bl CopyStringPadded + bl StringCopyPadded b _081D2E70 .pool _081D2D20: @@ -46343,7 +46343,7 @@ _081D2D20: adds r3, r5, 0 bl sub_81D2C68 adds r0, r5, 0 - bl GetStringEnd_Limit7 + bl StringGetEnd10 adds r0, r4, 0 adds r1, r6, 0 movs r2, 0xB @@ -46356,11 +46356,11 @@ _081D2D20: movs r0, 0x64 adds r4, r6, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 mov r8, r0 @@ -46397,7 +46397,7 @@ _081D2D9A: ldr r0, =gSpeciesNames adds r1, r0 adds r0, r5, 0 - bl CompareString + bl StringCompare cmp r0, 0 bne _081D2DB0 movs r6, 0xFF @@ -46494,7 +46494,7 @@ _081D2E24: mov r1, r8 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r3, r0, 0 strb r4, [r3] adds r3, 0x1 @@ -47664,7 +47664,7 @@ _081D36CA: ldr r1, =gUnknown_085EEA73 _081D3704: adds r0, r6, 0 - bl CopyString + bl StringCopy mov r0, r10 str r0, [sp] mov r1, r9 @@ -47694,7 +47694,7 @@ _081D373A: adds r0, r6, 0 movs r2, 0 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r2, r4, 0 adds r2, 0x38 mov r1, r10 @@ -47799,7 +47799,7 @@ _081D3808: mov r0, r9 movs r2, 0 adds r3, r4, 0 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x4 subs r0, r4 lsls r4, r0, 1 @@ -47860,27 +47860,27 @@ sub_81D388C: @ 81D388C adds r4, r0, 0 adds r5, r1, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData strh r0, [r5] adds r0, r4, 0 movs r1, 0x3B - bl pokemon_getattr + bl GetMonData strh r0, [r5, 0x2] adds r0, r4, 0 movs r1, 0x3C - bl pokemon_getattr + bl GetMonData strh r0, [r5, 0x4] adds r0, r4, 0 movs r1, 0x3D - bl pokemon_getattr + bl GetMonData strh r0, [r5, 0x6] adds r0, r4, 0 movs r1, 0x3E - bl pokemon_getattr + bl GetMonData strh r0, [r5, 0x8] adds r0, r4, 0 movs r1, 0x3F - bl pokemon_getattr + bl GetMonData strh r0, [r5, 0xA] pop {r4,r5} pop {r0} @@ -47890,7 +47890,7 @@ sub_81D388C: @ 81D388C thumb_func_start sub_81D38D4 sub_81D38D4: @ 81D38D4 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003d6d adds r0, r1 @@ -47914,7 +47914,7 @@ sub_81D38FC: @ 81D38FC movs r5, 0x9C lsls r5, 2 adds r1, r5, 0 - bl sub_806F96C + bl CalcByteArraySum adds r4, r5 ldr r1, [r4] cmp r0, r1 @@ -47959,7 +47959,7 @@ _081D394C: movs r1, 0x9D lsls r1, 2 muls r1, r6 - bl sub_806F96C + bl CalcByteArraySum ldr r1, [r7, 0x4] cmp r0, r1 bne _081D3964 @@ -47985,7 +47985,7 @@ sub_81D396C: @ 81D396C adds r0, 0x8 movs r1, 0xEE lsls r1, 4 - bl sub_806F96C + bl CalcByteArraySum ldr r1, [r4, 0x4] cmp r0, r1 bne _081D398E @@ -48119,7 +48119,7 @@ _081D3A7E: adds r0, 0x8 movs r1, 0xEE lsls r1, 4 - bl sub_806F96C + bl CalcByteArraySum mov r2, r8 str r0, [r2, 0x4] movs r0, 0x1E @@ -49049,7 +49049,7 @@ sub_81D4238: @ 81D4238 sub_81D4258: @ 81D4258 push {lr} sub sp, 0x4 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrb r1, [r0, 0x5] ldrb r2, [r0, 0x4] @@ -49947,7 +49947,7 @@ sub_81D4998: @ 81D4998 bl VarGet lsls r0, 16 lsrs r2, r0, 16 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0, 0x4] ldr r0, =0x0000391a @@ -49979,7 +49979,7 @@ _081D49E0: FieldObjectIsFarawayIslandMew: @ 81D49E8 push {lr} adds r2, r0, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0, 0x4] ldr r0, =0x0000391a @@ -50001,7 +50001,7 @@ _081D4A0E: thumb_func_start unown_chamber_related unown_chamber_related: @ 81D4A14 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0, 0x4] ldr r0, =0x0000391a @@ -50412,7 +50412,7 @@ sub_81D4D50: @ 81D4D50 strh r0, [r1] movs r0, 0 strh r0, [r4] - ldr r1, =gUnknown_03002710 + ldr r1, =gIntrTable ldr r0, =sub_81D3FAC str r0, [r1, 0x4] ldr r0, =sub_81D3F9C @@ -50668,7 +50668,7 @@ _081D4F6C: strh r0, [r5] b _081D4FE6 _081D4F88: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -50921,7 +50921,7 @@ _081D5198: strb r0, [r4, 0x8] b _081D548A _081D51AE: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -50936,7 +50936,7 @@ _081D51BC: b _081D535A .pool _081D51D0: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -51190,7 +51190,7 @@ _081D5418: lsls r0, 24 cmp r0, 0 beq _081D548A - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -51267,7 +51267,7 @@ sp194_trainer_tower: @ 81D5494 thumb_func_start sub_81D54BC sub_81D54BC: @ 81D54BC push {r4-r6,lr} - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r1, [r4] ldr r3, =0x00000ef9 adds r1, r3 @@ -51282,7 +51282,7 @@ sub_81D54BC: @ 81D54BC negs r0, r0 ands r0, r2 strb r0, [r1] - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, [r2] ldr r1, =0x00003d68 adds r0, r1 @@ -51476,7 +51476,7 @@ _081D560A: mov r6, r9 cmp r6, 0x1 ble _081D55EE - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r0, [r1] ldr r1, =0x00003d64 adds r0, r1 @@ -51524,7 +51524,7 @@ sub_81D56B0: @ 81D56B0 adds r1, 0x61 strb r1, [r0] ldr r1, =gUnknown_0862A5F8 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00003d6e adds r0, r2 @@ -51688,7 +51688,7 @@ sub_81D581C: @ 81D581C bl sub_81D3B34 cmp r0, 0 bne _081D5844 - ldr r3, =gUnknown_03005D8C + ldr r3, =gSaveBlock1Ptr ldr r1, [r3] ldr r0, =0x00003d6e adds r1, r0 @@ -51698,7 +51698,7 @@ sub_81D581C: @ 81D581C b _081D5854 .pool _081D5844: - ldr r3, =gUnknown_03005D8C + ldr r3, =gSaveBlock1Ptr ldr r1, [r3] ldr r0, =0x00003d6e adds r1, r0 @@ -51742,7 +51742,7 @@ _081D5854: negs r0, r0 ands r0, r2 strb r0, [r1] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r1, 0xEE lsls r1, 4 @@ -51770,7 +51770,7 @@ sub_81D58D8: @ 81D58D8 ldr r3, =gUnknown_020375F0 movs r0, 0 strh r0, [r3] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003d6e adds r2, r0, r1 @@ -51813,7 +51813,7 @@ sub_81D5924: @ 81D5924 ldrb r0, [r0, 0x6] cmp r0, 0x4 bne _081D5952 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr mov r8, r0 ldr r0, [r0] ldr r7, =0x00003d6e @@ -51838,7 +51838,7 @@ _081D596C: lsrs r0, 24 cmp r0, 0x1 bne _081D59BC - ldr r1, =gUnknown_02021DC4 + ldr r1, =gStringVar2 adds r0, r5, 0 bl itemid_get_name mov r0, r8 @@ -51848,7 +51848,7 @@ _081D596C: movs r2, 0x1 orrs r0, r2 strb r0, [r1] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r0, =0x00000ef9 adds r1, r0 @@ -51876,7 +51876,7 @@ _081D59C0: thumb_func_start sub_81D59D0 sub_81D59D0: @ 81D59D0 push {r4-r6,lr} - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r2, [r4] ldr r6, =0x00003d6e adds r0, r2, r6 @@ -51926,7 +51926,7 @@ _081D5A48: movs r0, 0x1 strh r0, [r1] _081D5A4E: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r3, =0x00003d6e adds r1, r3 @@ -51943,7 +51943,7 @@ _081D5A4E: thumb_func_start sub_81D5A70 sub_81D5A70: @ 81D5A70 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r1, =0x00003d6e adds r0, r2, r1 @@ -51972,7 +51972,7 @@ _081D5AAE: thumb_func_start sub_81D5AB4 sub_81D5AB4: @ 81D5AB4 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =0x00003d6e adds r1, r0 @@ -51987,7 +51987,7 @@ sub_81D5AB4: @ 81D5AB4 thumb_func_start sub_81D5AD0 sub_81D5AD0: @ 81D5AD0 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003d6e adds r2, r0, r1 @@ -52030,7 +52030,7 @@ _081D5B20: thumb_func_start sub_81D5B2C sub_81D5B2C: @ 81D5B2C push {r4-r7,lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003d64 adds r0, r1 @@ -52062,21 +52062,21 @@ _081D5B40: movs r1, 0x64 bl __divsi3 adds r4, r0, 0 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0 movs r2, 0x1 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, =gUnknown_02021DC4 + bl ConvertIntToDecimalStringN + ldr r0, =gStringVar2 adds r1, r5, 0 movs r2, 0x1 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, =gUnknown_02021EC4 + bl ConvertIntToDecimalStringN + ldr r0, =gStringVar3 adds r1, r4, 0 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN pop {r4-r7} pop {r0} bx r0 @@ -52092,11 +52092,11 @@ sub_81D5BBC: @ 81D5BBC ldrb r0, [r1, 0x6] cmp r0, 0x4 beq _081D5BEC - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrb r1, [r1, 0x6] movs r2, 0 movs r3, 0x1 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r1, =gUnknown_020375F0 movs r0, 0 b _081D5BF0 @@ -52133,7 +52133,7 @@ sub_81D5C18: @ 81D5C18 lsls r0, 16 cmp r0, 0 beq _081D5C42 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003d6e adds r0, r1 @@ -52222,7 +52222,7 @@ sub_81D5C8C: @ 81D5C8C movs r0, 0 mov r8, r0 mov r10, r4 - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 mov r9, r1 _081D5CD6: lsls r3, r7, 24 @@ -52242,7 +52242,7 @@ _081D5CD6: movs r2, 0 bl box_print adds r7, 0xF - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, =0x00003718 adds r4, r1 ldr r0, [r0] @@ -52258,11 +52258,11 @@ _081D5CD6: adds r1, r5, 0 bl __umodsi3 adds r5, r0, 0 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0 movs r2, 0x1 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN adds r0, r5, 0 movs r1, 0x3C bl __udivsi3 @@ -52271,25 +52271,25 @@ _081D5CD6: movs r1, 0x3C bl __umodsi3 adds r5, r0, 0 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r4, 0 movs r2, 0x1 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0xA8 muls r0, r5 movs r1, 0x64 bl __udivsi3 adds r1, r0, 0 - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN mov r0, r9 ldr r1, =gUnknown_085EF895 - bl CopyString + bl StringCopy ldr r1, =gUnknown_085EF8A3 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 mov r1, r9 movs r2, 0xD0 @@ -52350,7 +52350,7 @@ sub_81D5DF8: @ 81D5DF8 mov r5, r8 push {r5-r7} sub sp, 0x8 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0xC7 lsls r1, 4 @@ -52361,7 +52361,7 @@ sub_81D5DF8: @ 81D5DF8 beq _081D5F0E bl sub_81D56B0 movs r7, 0 - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r3, =0x00000cb4 ldr r0, =0x0000ffff adds r2, r0, 0 @@ -52380,7 +52380,7 @@ _081D5E26: bls _081D5E26 movs r0, 0 str r0, [sp] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] movs r2, 0xC7 lsls r2, 4 @@ -52468,7 +52468,7 @@ _081D5E64: strh r0, [r5, 0xE] ldr r0, =gUnknown_082C83F0 str r0, [r5, 0x10] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r4, =0x00000cb4 adds r0, r4 @@ -52790,7 +52790,7 @@ _081D6176: thumb_func_start battle_init battle_init: @ 81D6180 lsls r0, 24 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] lsrs r0, 23 adds r1, r0 @@ -52820,12 +52820,12 @@ GetTrainerHillTrainerFlag: @ 81D619C ldrb r1, [r1, 0x8] adds r0, r1 lsls r0, 24 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] movs r2, 0xEE lsls r2, 4 adds r1, r2 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsrs r0, 22 adds r0, r2 ldr r0, [r0] @@ -52848,8 +52848,8 @@ sub_81D61E8: @ 81D61E8 movs r3, 0 ldr r0, =gUnknown_02038BCA mov r8, r0 - ldr r6, =gUnknown_03005D90 - ldr r1, =gUnknown_0832A328 + ldr r6, =gSaveBlock2Ptr + ldr r1, =gBitTable mov r12, r1 adds r5, r6, 0 _081D6204: @@ -52882,7 +52882,7 @@ _081D6240: cmp r3, 0x1 bls _081D6204 _081D624A: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 8 @@ -52891,7 +52891,7 @@ _081D624A: beq _081D62A2 movs r3, 0 ldr r5, =gUnknown_02038BCC - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable mov r8, r0 _081D6260: ldr r2, [r6] @@ -52990,7 +52990,7 @@ _081D6316: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 mov r1, r8 lsls r0, r1, 4 @@ -53133,7 +53133,7 @@ sub_81D642C: @ 81D642C adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 ldr r5, =gExperienceTables @@ -53187,7 +53187,7 @@ sub_81D6490: @ 81D6490 thumb_func_start sub_81D64AC sub_81D64AC: @ 81D64AC - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] movs r1, 0xEE lsls r1, 4 @@ -53217,7 +53217,7 @@ _081D64D4: thumb_func_start sub_81D64DC sub_81D64DC: @ 81D64DC ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000ef9 adds r0, r2 @@ -53230,7 +53230,7 @@ sub_81D64DC: @ 81D64DC thumb_func_start sub_81D64FC sub_81D64FC: @ 81D64FC - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r0, =0x00000ef9 adds r1, r0 @@ -53244,7 +53244,7 @@ sub_81D64FC: @ 81D64FC thumb_func_start sub_81D6518 sub_81D6518: @ 81D6518 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r0, =0x00000ef9 adds r1, r0 @@ -53286,7 +53286,7 @@ _081D6562: thumb_func_start sub_81D6568 sub_81D6568: @ 81D6568 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00003d6e adds r0, r1 @@ -53312,7 +53312,7 @@ _081D6594: thumb_func_start sub_81D65A0 sub_81D65A0: @ 81D65A0 push {r4,r5,lr} - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r2, [r4] ldr r5, =gUnknown_020375E2 ldr r0, =0x00003d6e @@ -53441,7 +53441,7 @@ _081D66A2: bl sub_81D65E8 lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r5, [r0] ldr r1, =0x00003d6e adds r0, r5, r1 @@ -57684,7 +57684,7 @@ sub_81D8AD8: @ 81D8AD8 ands r0, r1 cmp r0, 0 bne _081D8B1C - bl GenerateRandomNumber + bl Random movs r4, 0x7 adds r1, r4, 0 ands r1, r0 @@ -57693,7 +57693,7 @@ sub_81D8AD8: @ 81D8AD8 movs r0, 0x1 movs r2, 0 bl ChangeBgX - bl GenerateRandomNumber + bl Random ands r4, r0 subs r4, 0x4 lsls r4, 8 @@ -59464,11 +59464,11 @@ sub_81D99BC: @ 81D99BC bl sub_80D2578 cmp r0, 0 bne _081D99DC - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 bl sub_80D2548 adds r1, r0, 0 adds r0, r4, 0 - bl CopyString + bl StringCopy movs r0, 0x1 b _081D99DE .pool @@ -59484,11 +59484,11 @@ _081D99DE: walda_maybe: @ 81D99E4 push {r4,lr} sub sp, 0x8 - ldr r4, =gUnknown_02021DC4 + ldr r4, =gStringVar2 bl sub_80D2548 adds r1, r0, 0 adds r0, r4, 0 - bl CopyString + bl StringCopy movs r0, 0 str r0, [sp] ldr r0, =sub_81D9A1C @@ -59509,7 +59509,7 @@ walda_maybe: @ 81D99E4 sub_81D9A1C: @ 81D9A1C push {r4,r5,lr} ldr r4, =gUnknown_020375E0 - ldr r5, =gUnknown_02021DC4 + ldr r5, =gStringVar2 adds r0, r5, 0 bl sub_81D9A98 strh r0, [r4] @@ -59540,11 +59540,11 @@ _081D9A62: adds r0, r5, 0 bl sub_80D255C _081D9A68: - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 bl sub_80D2548 adds r1, r0, 0 adds r0, r4, 0 - bl CopyString + bl StringCopy ldr r1, =gUnknown_03005DAC ldr r0, =sub_80AF168 str r0, [r1] @@ -59569,7 +59569,7 @@ _081D9AA6: bl sub_80D2548 adds r1, r0, 0 adds r0, r4, 0 - bl CompareString + bl StringCompare cmp r0, 0 beq _081D9ABA movs r0, 0 @@ -59588,7 +59588,7 @@ sub_81D9AC4: @ 81D9AC4 mov r7, r8 push {r7} sub sp, 0x10 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] adds r0, 0xA bl sub_80842DC @@ -59682,7 +59682,7 @@ sub_81D9B68: @ 81D9B68 lsrs r0, 16 mov r9, r0 adds r0, r5, 0 - bl GetStringLength + bl StringLength lsls r0, 16 lsrs r0, 16 cmp r0, 0xF @@ -60048,7 +60048,7 @@ _081D9E24: ldrb r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x32 b _081D9EB4 @@ -60059,7 +60059,7 @@ _081D9E44: ldrb r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x33 b _081D9EB4 @@ -60070,7 +60070,7 @@ _081D9E64: ldrb r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x34 b _081D9EB4 @@ -60081,7 +60081,7 @@ _081D9E84: ldrb r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x35 b _081D9EB4 @@ -60092,11 +60092,11 @@ _081D9EA4: ldrb r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x36 _081D9EB4: - bl pokemon_getattr + bl GetMonData strb r0, [r4] ldr r5, =gUnknown_02039E00 ldr r4, =gUnknown_02039F25 @@ -60550,7 +60550,7 @@ _081DA284: lsls r0, 24 cmp r0, 0 beq _081DA2D4 - ldr r0, =gUnknown_03005D80 + ldr r0, =gRngValue movs r1, 0x4 bl sub_80FC4F4 cmp r0, 0x1 @@ -60563,7 +60563,7 @@ _081DA2AC: lsls r0, 24 cmp r0, 0 beq _081DA2D4 - ldr r0, =gUnknown_03005D80 + ldr r0, =gRngValue ldr r4, =gUnknown_020223C4 adds r1, r4, 0 movs r2, 0x4 @@ -60905,7 +60905,7 @@ sub_81DA57C: @ 81DA57C lsls r0, 24 cmp r0, 0 beq _081DA5CA - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -60955,7 +60955,7 @@ sub_81DA5D4: @ 81DA5D4 bcs _081DA61C mov r4, r9 _081DA5F4: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r4] ldr r2, =0x000009ca @@ -60987,7 +60987,7 @@ _081DA61C: bcs _081DA654 mov r4, r9 _081DA62E: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r4] ldr r2, =0x000009ca @@ -61009,7 +61009,7 @@ _081DA64C: _081DA654: cmp r6, 0 beq _081DA6BA - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r6, 0 @@ -61018,7 +61018,7 @@ _081DA654: movs r5, 0 cmp r5, r7 bcs _081DA6BA - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r3, =0x000009ca mov r4, r9 _081DA674: @@ -61444,7 +61444,7 @@ sub_81DA9BC: @ 81DA9BC push {r4,lr} adds r4, r0, 0 ldrh r0, [r4, 0x32] - bl sine2 + bl Sin2 lsls r0, 16 asrs r0, 16 movs r2, 0x36 @@ -61453,7 +61453,7 @@ sub_81DA9BC: @ 81DA9BC asrs r0, 12 strh r0, [r4, 0x24] ldrh r0, [r4, 0x32] - bl cosine2 + bl Cos2 lsls r0, 16 asrs r0, 16 movs r3, 0x36 @@ -62848,12 +62848,12 @@ sub_81DB468: @ 81DB468 ldr r1, =gPokedexEntries adds r2, r1 adds r1, r2, 0 - bl CopyString + bl StringCopy movs r1, 0 strb r1, [r0] adds r0, 0x1 ldr r1, =gUnknown_085E8268 - bl CopyString + bl StringCopy pop {r0} bx r0 .pool @@ -62868,7 +62868,7 @@ sub_81DB494: @ 81DB494 cmp r5, 0 beq _081DB4B6 adds r1, r5, 0 - bl CopyString + bl StringCopy adds r4, r0, 0 lsls r0, r6, 24 lsrs r0, 24 @@ -62906,9 +62906,9 @@ sub_81DB4DC: @ 81DB4DC adds r4, r0, 0 lsls r1, 24 lsrs r5, r1, 24 - bl StripExtendedControlCodes + bl StripExtCtrlCodes adds r0, r4, 0 - bl GetStringLength + bl StringLength lsls r0, 24 lsrs r1, r0, 24 cmp r5, 0xFC @@ -62949,18 +62949,18 @@ _081DB51E: sub_81DB52C: @ 81DB52C push {r4,lr} adds r4, r0, 0 - bl GetStringLength + bl StringLength lsls r0, 16 lsrs r0, 16 cmp r0, 0x5 bhi _081DB546 adds r0, r4, 0 movs r1, 0x1 - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString b _081DB54C _081DB546: adds r0, r4, 0 - bl StripExtendedControlCodes + bl StripExtCtrlCodes _081DB54C: pop {r4} pop {r0} @@ -62973,20 +62973,20 @@ sub_81DB554: @ 81DB554 adds r4, r0, 0 lsls r1, 24 lsrs r5, r1, 24 - bl GetStringLength + bl StringLength lsls r0, 16 lsrs r0, 16 cmp r0, 0x5 bhi _081DB572 adds r0, r4, 0 movs r1, 0x1 - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString b _081DB5A4 _081DB572: cmp r5, 0xFC bne _081DB57E adds r0, r4, 0 - bl StripExtendedControlCodes + bl StripExtCtrlCodes b _081DB5A4 _081DB57E: adds r1, r4, 0 @@ -63060,12 +63060,12 @@ sub_81DB5E8: @ 81DB5E8 push {r4,r5,lr} adds r5, r0, 0 adds r4, r2, 0 - bl CopyString + bl StringCopy lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 adds r1, r4, 0 - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString pop {r4,r5} pop {r0} bx r0 diff --git a/asm/rotating_gate.s b/asm/rotating_gate.s index a2bb34cf1..b10e27e65 100644 --- a/asm/rotating_gate.s +++ b/asm/rotating_gate.s @@ -8,7 +8,7 @@ thumb_func_start GetCurrentMapRotatingGatePuzzleType GetCurrentMapRotatingGatePuzzleType: @ 80FB7E8 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0, 0x4] movs r0, 0x86 @@ -190,7 +190,7 @@ sub_80FB928: @ 80FB928 lsls r1, 16 lsrs r1, 16 mov r10, r1 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldrh r1, [r2] subs r0, r1, 0x2 @@ -557,7 +557,7 @@ sub_80FBC10: @ 80FBC10 mov r6, r9 mov r5, r8 push {r5-r7} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldrh r1, [r2] subs r0, r1, 0x2 diff --git a/asm/roulette.s b/asm/roulette.s index 0240322b2..71563ffcf 100644 --- a/asm/roulette.s +++ b/asm/roulette.s @@ -353,10 +353,10 @@ _0814054E: _0814056C: movs r0, 0x64 muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 movs r0, 0x98 lsls r0, 1 @@ -394,7 +394,7 @@ _081405B6: sub_81405CC: @ 81405CC push {r4,r5,lr} sub sp, 0xC - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -593,7 +593,7 @@ _0814077A: b _08140806 .pool _081407F8: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -649,12 +649,12 @@ _0814085A: adds r4, r6, 0 ldr r0, [r4] ldrh r0, [r0, 0x24] - bl sine2 + bl Sin2 lsls r0, 16 lsrs r5, r0, 16 ldr r0, [r4] ldrh r0, [r0, 0x24] - bl cosine2 + bl Cos2 lsls r0, 16 lsrs r1, r0, 16 lsls r0, r5, 16 @@ -1259,7 +1259,7 @@ sub_8140D6C: @ 8140D6C movs r0, 0 mov r9, r0 movs r5, 0 - ldr r4, =gUnknown_030022C0 + ldr r4, =gMain ldrh r1, [r4, 0x2E] movs r0, 0x40 ands r0, r1 @@ -1641,7 +1641,7 @@ _0814108A: adds r0, 0x1 strh r0, [r1, 0xA] _0814109A: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -1981,7 +1981,7 @@ sub_8141344: @ 8141344 mov r0, sp movs r2, 0x8 bl memcpy - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r7, r0, 16 adds r0, r7, 0 @@ -2325,7 +2325,7 @@ _08141660: ldrsh r0, [r4, r1] cmp r0, 0x3C bgt _08141690 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -2757,7 +2757,7 @@ sub_8141A18: @ 8141A18 sub sp, 0xC lsls r0, 24 lsrs r0, 24 - ldr r3, =gUnknown_02021CC4 + ldr r3, =gStringVar1 ldr r1, =gUnknown_0203AB88 mov r9, r1 ldr r1, [r1] @@ -2774,12 +2774,12 @@ sub_8141A18: @ 8141A18 adds r0, r3, 0 movs r2, 0 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r2, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r2, =gStringVar4 mov r8, r2 ldr r1, =gUnknown_082A5BEF mov r0, r8 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r5, =gUnknown_0203AB8C ldrb r0, [r5] movs r1, 0 @@ -3278,7 +3278,7 @@ sub_8141EF8: @ 8141EF8 adds r5, r1, 0 cmp r0, 0 beq _08141F1E - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain adds r2, r3, 0 adds r2, 0xAA ldrh r1, [r0, 0x2E] @@ -4589,7 +4589,7 @@ sub_81429A0: @ 81429A0 ldrh r1, [r0, 0x8] adds r1, 0x1 strh r1, [r0, 0x8] - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -4618,7 +4618,7 @@ sub_81429F0: @ 81429F0 sub sp, 0xC lsls r0, 24 lsrs r6, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -4635,14 +4635,14 @@ sub_81429F0: @ 81429F0 adds r0, r1 adds r0, r2 ldrb r1, [r0] - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r2, 0x2 movs r3, 0x1 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_082A5B12 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0 movs r1, 0 bl sub_81973FC @@ -4701,11 +4701,11 @@ sub_8142A88: @ 8142A88 adds r0, r1 adds r0, r2 ldrb r4, [r0] - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 movs r2, 0x2 movs r3, 0x1 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r1, 0x22 ldrsh r0, [r6, r1] cmp r0, r4 @@ -4740,10 +4740,10 @@ sub_8142A88: @ 8142A88 b _08142BB0 .pool _08142B28: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_082A5B12 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0 movs r1, 0 bl sub_81973FC @@ -4770,10 +4770,10 @@ _08142B28: b _08142BB0 .pool _08142B78: - ldr r5, =gUnknown_02021FC4 + ldr r5, =gStringVar4 ldr r1, =gUnknown_082A5B4E adds r0, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0 movs r1, 0 bl sub_81973FC @@ -5640,11 +5640,11 @@ sub_8143280: @ 8143280 lsrs r4, r0, 16 _081432A2: adds r0, r4, 0 - bl sine2 + bl Sin2 lsls r0, 16 lsrs r5, r0, 16 adds r0, r4, 0 - bl cosine2 + bl Cos2 lsls r2, r5, 16 asrs r2, 16 movs r3, 0x30 @@ -6790,12 +6790,12 @@ _08143BEA: bl __fixsfsi strh r0, [r7, 0x36] ldrh r0, [r7, 0x34] - bl sine2 + bl Sin2 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldrh r0, [r7, 0x34] - bl cosine2 + bl Cos2 lsls r4, 16 asrs r4, 16 movs r2, 0x36 @@ -6856,12 +6856,12 @@ sub_8143C90: @ 8143C90 strh r0, [r5, 0x34] _08143CAE: ldrh r0, [r5, 0x34] - bl sine2 + bl Sin2 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldrh r0, [r5, 0x34] - bl cosine2 + bl Cos2 lsls r4, 16 asrs r4, 16 movs r2, 0x36 @@ -7591,7 +7591,7 @@ sub_8144264: @ 8144264 _081442FC: movs r0, 0x38 bl m4aSongNumStart - bl GenerateRandomNumber + bl Random movs r1, 0x1 mov r8, r1 ands r1, r0 @@ -8438,7 +8438,7 @@ sub_8144A24: @ 8144A24 movs r1, 0 movs r2, 0xA bl memset - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x10] diff --git a/asm/rtc.s b/asm/rtc.s index 1d7c508ae..22b0f1ddc 100644 --- a/asm/rtc.s +++ b/asm/rtc.s @@ -194,16 +194,16 @@ GameFreakRTC_GetNumDaysInternal: @ 802F1E0 bx r1 thumb_func_end GameFreakRTC_GetNumDaysInternal - thumb_func_start GameFreakRTC_Init + thumb_func_start RtcInit @ void GameFreakRTC_Init() -GameFreakRTC_Init: @ 802F21C +RtcInit: @ 802F21C push {r4,r5,lr} ldr r5, =gUnknown_03000DB8 movs r0, 0 strh r0, [r5] bl GameFreakRTC_ClearIME - bl RTC_SetReadWrite - bl RTC_Init + bl SiiRtcUnprotect + bl SiiRtcProbe ldr r4, =gUnknown_03000DCC strb r0, [r4] bl GameFreakRTC_RestoreIME @@ -236,7 +236,7 @@ _0802F26E: pop {r0} bx r0 .pool - thumb_func_end GameFreakRTC_Init + thumb_func_end RtcInit thumb_func_start GameFreakRTC_GetErrorFlags @ u16 GameFreakRTC_GetErrorFlags() @@ -281,7 +281,7 @@ GameFreakRTC_GetRTCDateTimeInternal: @ 802F2B8 adds r4, r0, 0 bl GameFreakRTC_ClearIME adds r0, r4, 0 - bl RTC_GetDateTime + bl SiiRtcGetDateTime bl GameFreakRTC_RestoreIME pop {r4} pop {r0} @@ -295,7 +295,7 @@ GameFreakRTC_GetControlReg: @ 802F2D0 adds r4, r0, 0 bl GameFreakRTC_ClearIME adds r0, r4, 0 - bl RTC_GetControlReg + bl SiiRtcGetStatus bl GameFreakRTC_RestoreIME pop {r4} pop {r0} @@ -452,7 +452,7 @@ _0802F3E6: GameFreakRTC_Reset: @ 802F3F8 push {lr} bl GameFreakRTC_ClearIME - bl RTC_Reset + bl SiiRtcReset bl GameFreakRTC_RestoreIME pop {r0} bx r0 @@ -466,20 +466,20 @@ GameFreakRTC_FormatDecimalTimeString: @ 802F40C adds r6, r3, 0 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r4, 0xF0 strb r4, [r0] adds r0, 0x1 adds r1, r5, 0 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN strb r4, [r0] adds r0, 0x1 adds r1, r6, 0 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r1, 0xFF strb r1, [r0] pop {r4-r6} @@ -495,20 +495,20 @@ GameFreakRTC_FormatHexTimeString: @ 802F444 adds r6, r3, 0 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToHexString + bl ConvertIntToHexStringN movs r4, 0xF0 strb r4, [r0] adds r0, 0x1 adds r1, r5, 0 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToHexString + bl ConvertIntToHexStringN strb r4, [r0] adds r0, 0x1 adds r1, r6, 0 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToHexString + bl ConvertIntToHexStringN movs r1, 0xFF strb r1, [r0] pop {r4-r6} @@ -538,20 +538,20 @@ GameFreakRTC_FormatDecimalYearMonthDayString: @ 802F494 adds r6, r3, 0 movs r2, 0x2 movs r3, 0x4 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r4, 0xAE strb r4, [r0] adds r0, 0x1 adds r1, r5, 0 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN strb r4, [r0] adds r0, 0x1 adds r1, r6, 0 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r1, 0xFF strb r1, [r0] pop {r4-r6} @@ -567,20 +567,20 @@ GameFreakRTC_FormatHexYearMonthDayString: @ 802F4CC adds r6, r3, 0 movs r2, 0x2 movs r3, 0x4 - bl ConvertIntToHexString + bl ConvertIntToHexStringN movs r4, 0xAE strb r4, [r0] adds r0, 0x1 adds r1, r5, 0 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToHexString + bl ConvertIntToHexStringN strb r4, [r0] adds r0, 0x1 adds r1, r6, 0 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToHexString + bl ConvertIntToHexStringN movs r1, 0xFF strb r1, [r0] pop {r4-r6} @@ -666,7 +666,7 @@ GameFreakRTC_CalcLocalDateTime: @ 802F588 adds r0, r4, 0 bl GameFreakRTC_GetRTCDateTime ldr r1, =gUnknown_03005CF8 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] adds r2, 0x98 adds r0, r4, 0 @@ -703,7 +703,7 @@ GameFreakRTC_CalcRTCToLocalDelta: @ 802F5C8 ldr r5, =gUnknown_03000DC0 adds r0, r5, 0 bl GameFreakRTC_GetRTCDateTime - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r1, 0x98 adds r0, r5, 0 diff --git a/asm/safari_zone.s b/asm/safari_zone.s index 05f9e17e6..5ea9bf61f 100644 --- a/asm/safari_zone.s +++ b/asm/safari_zone.s @@ -213,7 +213,7 @@ sub_80FC258: @ 80FC258 bl GetXYCoordsOneStepInFrontOfPlayer movs r5, 0 _080FC26A: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r1, =gUnknown_0203A054 lsls r0, r5, 4 @@ -244,8 +244,8 @@ _080FC26A: lsls r0, 2 adds r0, r1 ldr r1, [r0] - ldr r0, =gUnknown_02021CC4 - bl CopyString + ldr r0, =gStringVar1 + bl StringCopy b _080FC2D6 .pool _080FC2C4: @@ -277,7 +277,7 @@ sub_80FC2E8: @ 80FC2E8 bl PlayerGetDestCoords movs r5, 0 adds r6, r4, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r7, [r0] mov r4, sp ldr r0, =gUnknown_0203A054 @@ -405,7 +405,7 @@ sub_80FC3E8: @ 80FC3E8 movs r0, 0x8 adds r0, r2 mov r9, r0 - ldr r7, =gUnknown_03005D8C + ldr r7, =gSaveBlock1Ptr _080FC408: lsls r5, r1, 4 adds r4, r5, r2 @@ -503,14 +503,14 @@ sub_80FC4B4: @ 80FC4B4 ldr r0, =0x0000ffff cmp r1, r0 beq _080FC4EC - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r2, =gUnknown_0203A054 lsls r1, 4 adds r1, r2 ldrb r1, [r1, 0x5] movs r2, 0x2 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x1 b _080FC4EE .pool diff --git a/asm/save.s b/asm/save.s index 9330cc552..004514594 100644 --- a/asm/save.s +++ b/asm/save.s @@ -1312,7 +1312,7 @@ _08153182: sub_8153190: @ 8153190 push {r4,r5,lr} ldr r3, =gUnknown_03006220 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, =gUnknown_085CDC00 ldrh r1, [r2] ldr r0, [r0] @@ -1320,7 +1320,7 @@ sub_8153190: @ 8153190 str r0, [r3] ldrh r0, [r2, 0x2] strh r0, [r3, 0x4] - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr adds r3, 0x8 adds r2, 0x4 movs r4, 0x3 @@ -1489,7 +1489,7 @@ save_game_when_memory_present: @ 8153338 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_03005D88 + ldr r0, =gFlashMemoryPresent ldr r4, [r0] cmp r4, 0x1 bne _0815335A @@ -1522,7 +1522,7 @@ _08153376: thumb_func_start sub_8153380 sub_8153380: @ 8153380 push {lr} - ldr r0, =gUnknown_03005D88 + ldr r0, =gFlashMemoryPresent ldr r0, [r0] cmp r0, 0x1 bne _081533A4 @@ -1609,7 +1609,7 @@ _08153420: thumb_func_start sub_8153430 sub_8153430: @ 8153430 push {r4,lr} - ldr r0, =gUnknown_03005D88 + ldr r0, =gFlashMemoryPresent ldr r0, [r0] cmp r0, 0x1 bne _0815346C @@ -1684,7 +1684,7 @@ sub_81534D0: @ 81534D0 push {r4-r6,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_03005D88 + ldr r0, =gFlashMemoryPresent ldr r0, [r0] cmp r0, 0x1 beq _081534F0 @@ -1748,7 +1748,7 @@ sub_815355C: @ 815355C ldr r0, =gUnknown_0203ABBC str r0, [r5] adds r7, r0, 0 - ldr r0, =gUnknown_03005D88 + ldr r0, =gFlashMemoryPresent ldr r4, [r0] cmp r4, 0x1 beq _0815358C @@ -1927,7 +1927,7 @@ _081536B4: .4byte _08153796 .4byte _081537A8 _081536E4: - ldr r0, =gUnknown_03002700 + ldr r0, =gSoftResetDisabled movs r1, 0x1 strb r1, [r0] movs r0, 0x1 @@ -2033,7 +2033,7 @@ _081537A8: asrs r0, 16 cmp r0, 0x5 ble _081537C2 - ldr r1, =gUnknown_03002700 + ldr r1, =gSoftResetDisabled movs r0, 0 strb r0, [r1] adds r0, r2, 0 diff --git a/asm/save_failed_screen.s b/asm/save_failed_screen.s index 52ff44cc6..617108424 100644 --- a/asm/save_failed_screen.s +++ b/asm/save_failed_screen.s @@ -84,7 +84,7 @@ sub_8178FDC: @ 8178FDC mov r7, r8 push {r7} sub sp, 0xC - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r7, r0, r1 @@ -426,7 +426,7 @@ sub_8179390: @ 8179390 ldr r1, =gUnknown_0203BCFE movs r0, 0 strh r0, [r1] - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -457,7 +457,7 @@ sub_81793E0: @ 81793E0 ldr r0, =gUnknown_0203BCFE movs r2, 0 strh r2, [r0] - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -492,7 +492,7 @@ sub_8179428: @ 8179428 ldr r0, [r5] cmp r0, 0 bne _08179448 - bl Reset + bl DoSoftReset b _0817944E .pool _08179448: @@ -507,7 +507,7 @@ _0817944E: thumb_func_start sub_8179454 sub_8179454: @ 8179454 push {r4,r5,lr} - ldr r5, =gUnknown_030022C0 + ldr r5, =gMain ldr r0, [r5, 0x24] lsrs r4, r0, 3 movs r0, 0x7 diff --git a/asm/scrcmd.s b/asm/scrcmd.s index 17b9ccfdb..84e4f3a0a 100644 --- a/asm/scrcmd.s +++ b/asm/scrcmd.s @@ -936,7 +936,7 @@ s8F_get_random_val: @ 809996C lsls r4, 16 lsrs r4, 16 ldr r5, =gUnknown_020375F0 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r4, 0 @@ -2324,7 +2324,7 @@ s42_get_map_camera_pos: @ 809A45C lsls r0, 16 lsrs r0, 16 bl GetVarPointer - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r1, [r2] ldrh r1, [r1] strh r1, [r5] @@ -2550,7 +2550,7 @@ s4F_execute_movement: @ 809A5E8 adds r3, r0, 0 lsls r0, r4, 24 lsrs r0, 24 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] @@ -2630,7 +2630,7 @@ s51_waitmove: @ 809A698 strh r1, [r0] _0809A6B4: ldr r1, =gUnknown_020375CC - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] movs r0, 0x4 ldrsb r0, [r2, r0] @@ -2694,7 +2694,7 @@ s53_hide_sprite: @ 809A740 bl VarGet lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] @@ -2738,7 +2738,7 @@ s55_show_sprite: @ 809A798 bl VarGet lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] @@ -2800,7 +2800,7 @@ s57_move_sprites: @ 809A7F0 bl VarGet lsls r5, 24 lsrs r5, 24 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] @@ -2869,7 +2869,7 @@ s64_set_sprite_top_left_corner: @ 809A8B0 bl VarGet lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] @@ -3026,7 +3026,7 @@ s5B_npc_set_direction: @ 809A9DC str r1, [r4, 0x8] lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] @@ -3370,7 +3370,7 @@ s68_close_box: @ 809AC8C thumb_func_start sub_809AC98 sub_809AC98: @ 809AC98 push {lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -3643,10 +3643,10 @@ sub_809AE6C: @ 809AE6C sub sp, 0x20 bl script_read_word adds r1, r0, 0 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 adds r1, 0x6 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r2, 0x1 negs r2, r2 movs r0, 0x6 @@ -3755,7 +3755,7 @@ _0809AEC6: movs r1, 0x11 bl FillWindowPixelBuffer ldrb r0, [r5] - ldr r2, =gUnknown_02021FC4 + ldr r2, =gStringVar4 str r4, [sp] movs r1, 0xFF str r1, [sp, 0x4] @@ -3822,7 +3822,7 @@ s7D_load_pokename: @ 809AFBC ldr r0, =gSpeciesNames adds r1, r0 adds r0, r2, 0 - bl CopyString + bl StringCopy movs r0, 0 pop {r4} pop {r1} @@ -3846,17 +3846,17 @@ s7E_load_first_pokenames: @ 809AFFC lsrs r0, 24 movs r1, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData movs r1, 0xB muls r1, r0 ldr r0, =gSpeciesNames adds r1, r0 adds r0, r4, 0 - bl CopyString + bl StringCopy movs r0, 0 pop {r4} pop {r1} @@ -3879,7 +3879,7 @@ s7F_load_pokename_team: @ 809B048 lsrs r0, 16 movs r1, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 ldr r1, =gUnknown_085102D4 lsls r4, 2 @@ -3887,9 +3887,9 @@ s7F_load_pokename_team: @ 809B048 ldr r4, [r4] movs r1, 0x2 adds r2, r4, 0 - bl pokemon_getattr + bl GetMonData adds r0, r4, 0 - bl GetStringEnd_Limit7 + bl StringGetEnd10 movs r0, 0 pop {r4} pop {r1} @@ -3979,7 +3979,7 @@ sub_809B114: @ 809B114 lsrs r1, 11 ldr r2, =gUnknown_085A5C09 adds r1, r2 - bl CopyString + bl StringCopy movs r0, 0 pop {r4} pop {r1} @@ -4009,7 +4009,7 @@ s82_load_item_name: @ 809B150 ldr r0, =gMoveNames adds r1, r0 adds r0, r2, 0 - bl CopyString + bl StringCopy movs r0, 0 pop {r4} pop {r1} @@ -4042,7 +4042,7 @@ s83_load_textvar_var: @ 809B190 ldr r0, [r5] adds r1, r4, 0 movs r2, 0 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0 pop {r4,r5} pop {r1} @@ -4071,7 +4071,7 @@ s84_load_textvar_std_expression: @ 809B1D4 adds r0, r1 ldr r1, [r0] adds r0, r2, 0 - bl CopyString + bl StringCopy movs r0, 0 pop {r4} pop {r1} @@ -4118,7 +4118,7 @@ s85_load_textvar_pointer: @ 809B248 lsls r4, 2 adds r4, r0 ldr r0, [r4] - bl CopyString + bl StringCopy movs r0, 0 pop {r4} pop {r1} @@ -4134,8 +4134,8 @@ sBE_virtual_load_text: @ 809B270 ldr r0, =gUnknown_020375C4 ldr r0, [r0] subs r1, r0 - ldr r0, =gUnknown_02021FC4 - bl ExpandStringRefs + ldr r0, =gStringVar4 + bl StringExpandPlaceholders movs r0, 0 pop {r1} bx r1 @@ -4158,7 +4158,7 @@ sBF_virtual_load_textbuffer: @ 809B294 lsls r4, 2 adds r4, r0 ldr r0, [r4] - bl CopyString + bl StringCopy movs r0, 0 pop {r4} pop {r1} @@ -4186,7 +4186,7 @@ sC6_load_textvar_box_label: @ 809B2C8 bl sav3_get_box_name adds r1, r0, 0 adds r0, r4, 0 - bl CopyString + bl StringCopy movs r0, 0 pop {r4} pop {r1} @@ -4312,7 +4312,7 @@ sub_809B3DC: @ 809B3DC _0809B3F4: adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0809B424 adds r0, r4, 0 @@ -4338,12 +4338,12 @@ _0809B42A: movs r0, 0x64 adds r1, r6, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r5, r0, 16 cmp r5, 0 @@ -4369,7 +4369,7 @@ s90_add_money: @ 809B458 str r0, [r4, 0x8] cmp r1, 0 bne _0809B47E - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x92 lsls r1, 3 @@ -4397,7 +4397,7 @@ s91_subtract_money: @ 809B48C str r0, [r4, 0x8] cmp r1, 0 bne _0809B4B2 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x92 lsls r1, 3 @@ -4426,7 +4426,7 @@ s92_check_money: @ 809B4C0 cmp r1, 0 bne _0809B4EE ldr r4, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x92 lsls r1, 3 @@ -4460,7 +4460,7 @@ s93_display_money: @ 809B500 str r2, [r0, 0x8] cmp r1, 0 bne _0809B530 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x92 lsls r1, 3 @@ -4499,7 +4499,7 @@ s95_update_money: @ 809B548 str r2, [r0, 0x8] cmp r1, 0 bne _0809B56E - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x92 lsls r1, 3 @@ -4944,7 +4944,7 @@ s9F_changeposition_fly: @ 809B870 thumb_func_start sA0_check_gender sA0_check_gender: @ 809B88C ldr r1, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] strh r0, [r1] @@ -5436,7 +5436,7 @@ sCD_set_obedient_bit: @ 809BC44 lsrs r0, 16 movs r1, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x50 mov r2, sp @@ -5460,11 +5460,11 @@ sCE_check_obedient_bit: @ 809BC7C ldr r4, =gUnknown_020375F0 movs r1, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x50 movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r4] movs r0, 0 pop {r4} @@ -5584,7 +5584,7 @@ sub_809BD70: @ 809BD70 bhi _0809BDA6 movs r0, 0x64 muls r0, r3 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x23 mov r2, sp @@ -5633,7 +5633,7 @@ sub_809BDD0: @ 809BDD0 bl sub_806F07C adds r1, r0, 0 adds r0, r4, 0 - bl CopyString + bl StringCopy movs r0, 0 pop {r4} pop {r1} @@ -5661,7 +5661,7 @@ sub_809BE0C: @ 809BE0C bl sub_806F0B0 adds r1, r0, 0 adds r0, r4, 0 - bl CopyString + bl StringCopy movs r0, 0 pop {r4} pop {r1} diff --git a/asm/script.s b/asm/script.s index bd63ecf59..be0a0ff8c 100644 --- a/asm/script.s +++ b/asm/script.s @@ -625,13 +625,13 @@ _080990A8: thumb_func_start sub_80990AC sub_80990AC: @ 80990AC push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x0000372c adds r0, r1 movs r1, 0xFA lsls r1, 2 - bl sub_806F928 + bl CalcCRC16WithTable lsls r0, 16 lsrs r0, 16 pop {r1} @@ -645,7 +645,7 @@ killram: @ 80990D0 sub sp, 0x4 movs r0, 0 str r0, [sp] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =0x00003728 adds r1, r0 @@ -678,7 +678,7 @@ sub_80990FC: @ 80990FC lsrs r7, r3, 24 lsls r0, 24 lsrs r6, r0, 24 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr mov r10, r0 ldr r5, [r0] ldr r1, =0x0000372c @@ -727,7 +727,7 @@ sub_8099188: @ 8099188 adds r4, r1, 0 lsls r0, 24 lsrs r3, r0, 24 - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr ldr r5, [r6] ldr r0, =0x0000372c adds r2, r5, r0 @@ -775,7 +775,7 @@ _080991F2: thumb_func_start sub_80991F8 sub_80991F8: @ 80991F8 push {r4,lr} - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] ldr r2, =0x0000372c adds r1, r0, r2 @@ -812,7 +812,7 @@ _0809923E: thumb_func_start sub_8099244 sub_8099244: @ 8099244 push {r4-r6,lr} - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr ldr r5, [r6] ldr r0, =0x0000372c adds r4, r5, r0 diff --git a/asm/script_menu.s b/asm/script_menu.s index d1978b033..1ebd3670e 100644 --- a/asm/script_menu.s +++ b/asm/script_menu.s @@ -106,9 +106,9 @@ _080E1EC0: ldrb r0, [r4] cmp r0, 0x1 bne _080E1EEC - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] - bl GetStringLength + bl StringLength adds r0, r5, r0 lsls r0, 16 lsrs r5, r0, 16 @@ -334,7 +334,7 @@ _080E209E: _080E20A2: lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0xC0 ands r0, r1 @@ -828,10 +828,10 @@ _080E24B0: adds r3, r7, 0 bl Print _080E24C6: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EB183 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders adds r0, r6, 0 adds r1, r4, 0 adds r2, r7, 0 @@ -1715,7 +1715,7 @@ CreateStartMenu: @ 80E2BAC movs r1, 0x1 movs r3, 0x8 bl Print - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] movs r0, 0x49 str r0, [sp] @@ -1819,7 +1819,7 @@ display_text_and_get_width_internal: @ 80E2D10 sub sp, 0x40 adds r1, r0, 0 mov r0, sp - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x1 mov r1, sp movs r2, 0 diff --git a/asm/script_pokemon_util_80F87D8.s b/asm/script_pokemon_util_80F87D8.s index b68c2418f..4438a1a31 100644 --- a/asm/script_pokemon_util_80F87D8.s +++ b/asm/script_pokemon_util_80F87D8.s @@ -8,7 +8,7 @@ thumb_func_start sub_80F87D8 sub_80F87D8: @ 80F87D8 push {r4,lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r1, =gUnknown_02039E00 ldrb r3, [r1, 0x15] @@ -115,7 +115,7 @@ _080F88A0: _080F88A4: movs r1, 0xC _080F88A6: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] lsls r1, 5 adds r0, r1 @@ -187,7 +187,7 @@ _080F8934: sub_80F8940: @ 80F8940 push {lr} movs r3, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00002f98 adds r1, r0, r2 @@ -349,15 +349,15 @@ _080F8A6E: lsls r4, r6, 6 mov r0, r10 adds r1, r4, r0 - ldr r0, =gUnknown_02021CC4 - bl CopyString - ldr r5, =gUnknown_02021DC4 + ldr r0, =gStringVar1 + bl StringCopy + ldr r5, =gStringVar2 mov r0, r10 adds r0, 0xB adds r4, r0 adds r0, r5, 0 adds r1, r4, 0 - bl CopyString + bl StringCopy adds r0, r5, 0 bl sub_81DB5AC mov r1, r9 @@ -402,7 +402,7 @@ sub_80F8ADC: @ 80F8ADC push {lr} ldr r0, =sub_812FDEC bl SetMainCallback2 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =sub_80F8ACC str r0, [r1, 0x8] pop {r0} @@ -501,7 +501,7 @@ _080F8BBA: ldr r0, =gUnknown_0858D8EC adds r0, r5, r0 ldrb r0, [r0] - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] @@ -584,10 +584,10 @@ sub_80F8C7C: @ 80F8C7C ldrb r0, [r6] movs r5, 0x64 muls r0, r5 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 movs r1, 0x46 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r0, 24 mov r1, sp @@ -992,7 +992,7 @@ sub_80F8FE8: @ 80F8FE8 .pool _080F9020: ldr r4, =gUnknown_020375F0 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 _080F902A: @@ -1188,7 +1188,7 @@ sp000_heal_pokemon: @ 80F9180 ldrb r0, [r0] cmp r8, r0 bcs _080F922C - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty mov r10, r1 mov r6, sp _080F919E: @@ -1198,7 +1198,7 @@ _080F919E: add r4, r10 adds r0, r4, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData lsls r1, r0, 16 strb r0, [r6] lsrs r1, 24 @@ -1209,7 +1209,7 @@ _080F919E: bl pokemon_setattr adds r0, r4, 0 movs r1, 0x15 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r7, r0, 24 movs r5, 0 @@ -1220,7 +1220,7 @@ _080F91D4: adds r1, r5, 0 adds r1, 0xD adds r0, r4, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 adds r1, r7, 0 @@ -1396,11 +1396,11 @@ _080F932C: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 cmp r0, 0 @@ -1409,7 +1409,7 @@ _080F932C: beq _080F9360 adds r0, r4, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData cmp r0, r6 bne _080F9360 movs r0, 0x1 @@ -1440,7 +1440,7 @@ sub_80F9370: @ 80F9370 bl ItemIdToBerryType lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl GetBerryNameByBerryType _080F9392: adds r0, r4, 0 @@ -1465,7 +1465,7 @@ sub_80F93A0: @ 80F93A0 lsls r7, r2, 16 lsrs r6, r7, 16 bl zero_enemy_party_data - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty mov r8, r0 movs r0, 0 str r0, [sp] @@ -1517,7 +1517,7 @@ sub_80F9400: @ 80F9400 _080F941C: movs r0, 0x64 muls r0, r3 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 adds r1, r4, 0 bl sub_80691F4 @@ -1530,7 +1530,7 @@ _080F941C: thumb_func_start sub_80F9438 sub_80F9438: @ 80F9438 push {lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, =sub_80F9460 str r1, [r0, 0x8] ldr r0, =0x000040cf @@ -1569,7 +1569,7 @@ _080F947E: thumb_func_start sub_80F9490 sub_80F9490: @ 80F9490 push {lr} - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =sub_80F94B8 str r0, [r1, 0x8] ldr r0, =gUnknown_020375E0 @@ -1618,7 +1618,7 @@ sub_80F94E8: @ 80F94E8 bl CpuSet movs r5, 0 movs r7, 0x64 - ldr r6, =gUnknown_020244EC + ldr r6, =gPlayerParty mov r4, sp _080F9502: ldr r0, =gUnknown_0203CEF8 @@ -1641,7 +1641,7 @@ _080F951C: add r0, sp, 0x194 movs r1, 0 str r1, [r0] - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty ldr r2, =0x05000096 adds r1, r4, 0 bl CpuSet diff --git a/asm/secret_base.s b/asm/secret_base.s index 26d87219a..03a33beb5 100644 --- a/asm/secret_base.s +++ b/asm/secret_base.s @@ -40,7 +40,7 @@ _080E8B0A: sub_80E8B28: @ 80E8B28 push {r4,r5,lr} movs r4, 0 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr _080E8B2E: lsls r1, r4, 2 adds r1, r4 @@ -89,7 +89,7 @@ _080E8B86: cmp r3, 0x13 bhi _080E8BB0 ldr r2, =gUnknown_0203A01C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] lsls r0, r3, 2 adds r0, r3 @@ -116,7 +116,7 @@ _080E8BB0: thumb_func_start sub_80E8BC8 sub_80E8BC8: @ 80E8BC8 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00001a9c adds r0, r1 @@ -439,7 +439,7 @@ sub_80E8E18: @ 80E8E18 push {r4-r6,lr} mov r6, r8 push {r6} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, [r2] ldr r1, =gUnknown_0203A01C ldrb r1, [r1] @@ -448,7 +448,7 @@ sub_80E8E18: @ 80E8E18 strb r1, [r0] movs r3, 0 ldr r5, =0x00001aa5 - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr _080E8E32: ldr r1, [r2] adds r1, r5 @@ -466,11 +466,11 @@ _080E8E32: ldr r0, =0x00004054 movs r1, 0 bl VarSet - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr ldr r4, [r6] ldr r0, =0x00001a9e adds r4, r0 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr mov r8, r1 ldr r5, [r1] adds r0, r5, 0 @@ -480,7 +480,7 @@ _080E8E32: lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl CopyString_LimitN + bl StringCopyN ldr r3, [r6] mov r1, r8 ldr r0, [r1] @@ -536,7 +536,7 @@ _080E8EEE: cmp r0, 0x8 bne _080E8F82 movs r4, 0 - ldr r7, =gUnknown_03005D8C + ldr r7, =gSaveBlock1Ptr _080E8F0A: ldr r1, [r7] lsls r0, r4, 2 @@ -670,7 +670,7 @@ _080E900C: bl VarGet lsls r0, 16 lsrs r0, 16 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] lsls r1, r0, 2 adds r1, r0 @@ -709,7 +709,7 @@ sub_80E9068: @ 80E9068 movs r0, 0x1 movs r1, 0 bl fade_screen - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x4 ldrsb r1, [r0, r1] @@ -837,7 +837,7 @@ sub_80E916C: @ 80E916C ldrb r0, [r0] movs r1, 0xA bl __udivsi3 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r1, [r1] movs r5, 0x4 ldrsb r5, [r1, r5] @@ -895,7 +895,7 @@ sub_80E91F8: @ 80E91F8 thumb_func_start CurrentMapIsSecretBase CurrentMapIsSecretBase: @ 80E9214 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] movs r0, 0x4 ldrsb r0, [r1, r0] @@ -931,7 +931,7 @@ sub_80E9238: @ 80E9238 bl VarGet lsls r0, 16 lsrs r5, r0, 16 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr lsls r0, r5, 2 adds r0, r5 lsls r0, 5 @@ -1044,7 +1044,7 @@ sub_80E933C: @ 80E933C lsls r0, 24 cmp r0, 0 bne _080E9374 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x0000271c adds r1, r0, r1 @@ -1061,7 +1061,7 @@ _080E9374: bl VarGet lsls r0, 16 lsrs r0, 16 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr lsls r1, r0, 2 adds r1, r0 lsls r1, 5 @@ -1210,7 +1210,7 @@ _080E9462: lsrs r0, 16 bl FlagReset ldrb r0, [r6] - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r2, [r5] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] @@ -1315,7 +1315,7 @@ _080E9588: cmp r0, 0xD bhi _080E95B6 ldrb r0, [r1] - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] @@ -1518,7 +1518,7 @@ sub_80E9728: @ 80E9728 thumb_func_start sub_80E9744 sub_80E9744: @ 80E9744 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00001a9c adds r0, r1 @@ -1549,7 +1549,7 @@ sub_80E9780: @ 80E9780 adds r6, r0, 0 lsls r1, 24 lsrs r1, 24 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr mov r8, r0 lsls r5, r1, 2 adds r5, r1 @@ -1565,7 +1565,7 @@ sub_80E9780: @ 80E9780 lsrs r2, 24 adds r0, r6, 0 adds r1, r4, 0 - bl CopyString_LimitN + bl StringCopyN movs r1, 0xFF strb r1, [r0] mov r1, r8 @@ -1575,10 +1575,10 @@ sub_80E9780: @ 80E9780 adds r0, r1 ldrb r1, [r0] adds r0, r6, 0 - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString ldr r1, =gUnknown_085EA72F adds r0, r6, 0 - bl AppendString + bl StringAppend pop {r3} mov r8, r3 pop {r4-r6} @@ -1613,7 +1613,7 @@ sub_80E980C: @ 80E980C bl VarGet lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr mov r8, r1 lsls r5, r0, 2 adds r5, r0 @@ -1622,7 +1622,7 @@ sub_80E980C: @ 80E980C adds r4, r5, r4 ldr r0, =0x00001a9e adds r4, r0 - ldr r6, =gUnknown_02021CC4 + ldr r6, =gStringVar1 adds r0, r4, 0 bl sub_80E8DF4 adds r2, r0, 0 @@ -1630,7 +1630,7 @@ sub_80E980C: @ 80E980C lsrs r2, 24 adds r0, r6, 0 adds r1, r4, 0 - bl CopyString_LimitN + bl StringCopyN movs r1, 0xFF strb r1, [r0] mov r1, r8 @@ -1640,7 +1640,7 @@ sub_80E980C: @ 80E980C adds r0, r1 ldrb r1, [r0] adds r0, r6, 0 - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString pop {r3} mov r8, r3 pop {r4-r6} @@ -1654,7 +1654,7 @@ sub_80E9878: @ 80E9878 push {lr} lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] lsls r1, r0, 2 adds r1, r0 @@ -1681,37 +1681,37 @@ sub_80E98AC: @ 80E98AC push {r4,r5,lr} adds r5, r0, 0 movs r1, 0x1A - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0x1B - bl pokemon_getattr + bl GetMonData adds r4, r0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0x1C - bl pokemon_getattr + bl GetMonData adds r4, r0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0x1D - bl pokemon_getattr + bl GetMonData adds r4, r0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0x1E - bl pokemon_getattr + bl GetMonData adds r4, r0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0x1F - bl pokemon_getattr + bl GetMonData adds r4, r0 lsls r4, 16 lsrs r4, 16 @@ -1735,7 +1735,7 @@ sub_80E9914: @ 80E9914 sub sp, 0x24 movs r0, 0 mov r10, r0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r2, =0x00001ad0 adds r2, r1, r2 @@ -1768,7 +1768,7 @@ _080E995C: movs r4, 0 lsls r5, r6, 2 lsls r3, r6, 1 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty mov r8, r0 adds r1, r6, 0x1 str r1, [sp, 0x4] @@ -1810,12 +1810,12 @@ _080E996E: adds r4, r5, r3 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _080E9A54 adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _080E9A54 movs r4, 0 @@ -1826,13 +1826,13 @@ _080E996E: lsls r7, r0, 1 adds r0, 0x1 str r0, [sp, 0x8] - ldr r2, =gUnknown_020244EC + ldr r2, =gPlayerParty _080E99DA: adds r1, r4, 0 adds r1, 0xD adds r0, r5, r2 str r2, [sp, 0x20] - bl pokemon_getattr + bl GetMonData mov r3, r8 adds r1, r3, r4 lsls r1, 1 @@ -1848,29 +1848,29 @@ _080E99DA: movs r0, 0x64 adds r4, r6, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData ldr r2, [sp, 0xC] adds r1, r2, r7 strh r0, [r1] adds r0, r4, 0 movs r1, 0xC - bl pokemon_getattr + bl GetMonData ldr r3, [sp, 0x10] adds r1, r3, r7 strh r0, [r1] adds r0, r4, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData ldr r1, [sp, 0x18] add r1, r10 strb r0, [r1] adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData ldr r1, [sp] add r1, r8 str r0, [r1] @@ -1905,7 +1905,7 @@ _080E9A60: thumb_func_start sub_80E9A90 sub_80E9A90: @ 80E9A90 push {r4-r6,lr} - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r0, [r5] ldr r4, =0x00001aaa adds r1, r0, r4 @@ -1951,7 +1951,7 @@ _080E9AE0: adds r7, r1, 0 cmp r0, 0x8 bne _080E9B5C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00001a9c adds r0, r1 @@ -2019,7 +2019,7 @@ sub_80E9B70: @ 80E9B70 bl sub_80E9AD0 movs r0, 0x14 bl sav12_xor_increment - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r0, [r5] ldr r4, =0x00001aaa adds r1, r0, r4 @@ -2109,7 +2109,7 @@ sub_80E9C2C: @ 80E9C2C push {lr} ldr r0, =0x00004054 bl VarGet - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] lsls r0, 16 lsrs r0, 16 @@ -2579,13 +2579,13 @@ sub_80E9FFC: @ 80E9FFC bl RemoveWindow movs r0, 0 bl schedule_bg_copy_tilemap_to_vram - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrb r1, [r4, 0x8] bl sub_80E9780 - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EA737 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r2, =sub_80EA06C adds r0, r5, 0 adds r1, r4, 0 @@ -2639,7 +2639,7 @@ sub_80EA08C: @ 80EA08C mov r1, r9 mov r2, r10 bl sub_81AE6C8 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] movs r0, 0x8 ldrsh r1, [r6, r0] @@ -2790,7 +2790,7 @@ sub_80EA20C: @ 80EA20C push {r4,lr} lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r4, [r1] lsls r1, r0, 2 adds r1, r0 @@ -2899,7 +2899,7 @@ sub_80EA2E4: @ 80EA2E4 lsls r2, 3 adds r0, r2, 0 strh r0, [r1] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r0, =0x08000008 str r0, [r1] pop {r0} @@ -2912,7 +2912,7 @@ sub_80EA30C: @ 80EA30C push {lr} ldr r0, =0x00004054 bl VarGet - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r3, [r1] lsls r0, 16 lsrs r0, 16 @@ -2951,7 +2951,7 @@ sub_80EA354: @ 80EA354 cmp r0, 0 bne _080EA39A movs r3, 0 - ldr r7, =gUnknown_03005D8C + ldr r7, =gSaveBlock1Ptr ldr r4, =0x00001a9d movs r6, 0x21 negs r6, r6 @@ -2982,7 +2982,7 @@ _080EA39A: lsrs r0, 24 strh r0, [r4] ldr r2, =gUnknown_020375F0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] lsls r0, r5, 2 adds r0, r5 @@ -3499,7 +3499,7 @@ sub_80EA828: @ 80EA828 mov r8, r3 lsls r0, 24 lsrs r5, r0, 24 - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr ldr r0, [r6] lsls r2, r5, 2 adds r2, r5 @@ -3555,7 +3555,7 @@ _080EA892: _080EA8A0: cmp r3, 0x5 ble _080EA8B8 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] lsls r0, r5, 2 adds r0, r5 @@ -3691,7 +3691,7 @@ sub_80EA990: @ 80EA990 lsls r0, 24 lsrs r3, r0, 24 movs r1, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r4, =0x00001a9c _080EA99E: @@ -3727,7 +3727,7 @@ _080EA9D0: sub_80EA9D8: @ 80EA9D8 push {r4,lr} movs r2, 0x1 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r3, [r0] ldr r4, =0x00001a9c _080EA9E2: @@ -3763,7 +3763,7 @@ _080EAA12: sub_80EAA18: @ 80EAA18 push {r4,lr} movs r3, 0x1 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r4, [r0] _080EAA20: lsls r2, r3, 16 @@ -3820,7 +3820,7 @@ sub_80EAA64: @ 80EAA64 negs r0, r0 cmp r2, r0 beq _080EAAC4 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] lsls r0, r2, 2 adds r0, r2 @@ -3880,7 +3880,7 @@ sub_80EAAF4: @ 80EAAF4 mov r6, r8 push {r6,r7} sub sp, 0xA0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00001a9c adds r7, r0, r1 @@ -4006,7 +4006,7 @@ sub_80EABDC: @ 80EABDC beq _080EABF8 ldrb r0, [r5, 0x1] lsls r0, 27 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r3, [r1] lsrs r0, 31 adds r6, r1, 0 @@ -4429,7 +4429,7 @@ sub_80EAEF4: @ 80EAEF4 ldr r1, [r4, 0xC] ldr r2, [r4, 0x18] bl sub_80EAC5C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00001a9c adds r0, r1 @@ -4657,7 +4657,7 @@ _080EB0D4: mov r0, sp bl sub_80EAEF4 movs r3, 0x1 - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr movs r7, 0x10 negs r7, r7 _080EB0E2: @@ -4693,7 +4693,7 @@ _080EB112: bls _080EB0E2 bl sub_80EAAF4 movs r3, 0x1 - ldr r7, =gUnknown_03005D8C + ldr r7, =gSaveBlock1Ptr adds r6, r7, 0 adds r4, r5, 0 movs r5, 0x3F diff --git a/asm/shop.s b/asm/shop.s index 6e5c140ad..e58c988b8 100644 --- a/asm/shop.s +++ b/asm/shop.s @@ -390,7 +390,7 @@ VBlankCB_BuyMenu: @ 80DFD80 CB2_InitBuyMenu: @ 80DFD94 push {r4,r5,lr} sub sp, 0xC - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r5, r0, r1 @@ -590,7 +590,7 @@ _080DFF78: ldr r0, [r4] adds r0, r5 ldr r1, =gUnknown_085E8CF7 - bl CopyString + bl StringCopy ldr r2, =gUnknown_02039F74 ldr r0, [r2] lsls r1, r6, 3 @@ -660,7 +660,7 @@ _080E0020: ldr r0, =gUnknown_085A5C09 adds r1, r0 adds r0, r5, 0 - bl CopyString + bl StringCopy _080E002C: str r5, [r6] str r4, [r6, 0x4] @@ -787,7 +787,7 @@ BuyMenuPrintPriceInList: @ 80E0114 ldrb r0, [r0, 0xF] cmp r0, 0 bne _080E0164 - ldr r5, =gUnknown_02021CC4 + ldr r5, =gStringVar1 lsls r0, r1, 16 lsrs r0, 16 bl itemid_get_market_price @@ -803,23 +803,23 @@ BuyMenuPrintPriceInList: @ 80E0114 adds r1, r4, 0 movs r2, 0 movs r3, 0x5 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN b _080E0176 .pool _080E0164: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r2, =gUnknown_085A5C08 lsls r1, 5 adds r1, r2 ldrh r1, [r1, 0x14] movs r2, 0 movs r3, 0x5 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN _080E0176: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E969C adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0x7 adds r1, r4, 0 movs r2, 0x78 @@ -1249,7 +1249,7 @@ BuyMenuDrawGraphics: @ 80E0524 movs r0, 0x13 movs r1, 0xB bl AddMoneyLabelObject - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x92 lsls r1, 3 @@ -2044,7 +2044,7 @@ _080E0B80: ldrh r0, [r0, 0x14] str r0, [r1] _080E0B92: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x92 lsls r1, 3 @@ -2071,7 +2071,7 @@ _080E0BD0: bne _080E0C38 lsls r0, r5, 16 lsrs r5, r0, 16 - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 adds r0, r5, 0 bl itemid_get_name adds r0, r5, 0 @@ -2080,7 +2080,7 @@ _080E0BD0: lsrs r0, 24 cmp r0, 0x3 bne _080E0C24 - ldr r4, =gUnknown_02021DC4 + ldr r4, =gStringVar2 adds r0, r5, 0 bl ItemIdToBattleMoveId lsls r0, 16 @@ -2090,7 +2090,7 @@ _080E0BD0: ldr r0, =gMoveNames adds r1, r0 adds r0, r4, 0 - bl CopyString + bl StringCopy ldr r1, =gUnknown_085E9417 b _080E0C26 .pool @@ -2104,33 +2104,33 @@ _080E0C28: b _080E0C8E .pool _080E0C38: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 lsls r1, r5, 5 ldr r2, =gUnknown_085A5C09 adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 mov r3, r8 ldr r1, [r3] adds r1, r7 ldr r1, [r1] movs r2, 0 movs r3, 0x6 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldrb r0, [r4, 0xF] cmp r0, 0x1 bne _080E0C7C - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E9468 - bl ExpandStringRefs + bl StringExpandPlaceholders b _080E0C84 .pool _080E0C7C: - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 ldr r1, =gUnknown_085E9493 - bl ExpandStringRefs + bl StringExpandPlaceholders _080E0C84: - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 ldr r2, =BuyMenuConfirmPurchase adds r0, r6, 0 bl BuyMenuDisplayMessage @@ -2165,15 +2165,15 @@ Task_BuyHowManyDialogueInit: @ 80E0CA4 movs r2, 0x1 movs r3, 0xD bl SetWindowBorderStyle - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 movs r2, 0x1 movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E93D5 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0 str r0, [sp] str r0, [sp, 0x4] @@ -2193,7 +2193,7 @@ Task_BuyHowManyDialogueInit: @ 80E0CA4 bl BuyMenuPrintItemQuantityAndPrice movs r0, 0 bl schedule_bg_copy_tilemap_to_vram - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] movs r1, 0x92 lsls r1, 3 @@ -2281,7 +2281,7 @@ Task_BuyHowManyDialogueHandleInput: @ 80E0D88 b _080E0EA4 .pool _080E0DF0: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -2302,15 +2302,15 @@ _080E0DF0: movs r0, 0x1 bl PutWindowTilemap ldrh r0, [r5, 0xA] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 bl itemid_get_name - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 movs r2, 0x2 ldrsh r1, [r5, r2] movs r2, 0 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, =gUnknown_02021EC4 + bl ConvertIntToDecimalStringN + ldr r0, =gStringVar3 ldr r1, [r7] movs r2, 0x80 lsls r2, 6 @@ -2318,7 +2318,7 @@ _080E0DF0: ldr r1, [r1] movs r2, 0 movs r3, 0x6 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r1, =gUnknown_085E943F ldr r2, =BuyMenuConfirmPurchase adds r0, r6, 0 @@ -2454,7 +2454,7 @@ BuyMenuSubtractMoney: @ 80E0F88 lsrs r6, r0, 24 movs r0, 0x26 bl sav12_xor_increment - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r0, [r5] movs r4, 0x92 lsls r4, 3 @@ -2513,7 +2513,7 @@ Task_ReturnToItemListAfterItemPurchase: @ 80E100C lsls r0, 3 ldr r1, =gTasks + 0x8 adds r5, r0, r1 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -2557,7 +2557,7 @@ Task_ReturnToItemListAfterDecorationPurchase: @ 80E1078 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -2635,16 +2635,16 @@ BuyMenuPrintItemQuantityAndPrice: @ 80E10EC movs r1, 0x26 movs r2, 0x1 bl PrintMoneyAmount - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r2, 0x2 ldrsh r1, [r4, r2] movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r4, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 ldr r1, =gUnknown_085E8DA0 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0 str r0, [sp] str r0, [sp, 0x4] diff --git a/asm/slot_machine.s b/asm/slot_machine.s index a99ceaf30..f7c85d0bf 100644 --- a/asm/slot_machine.s +++ b/asm/slot_machine.s @@ -91,7 +91,7 @@ sub_812A540: @ 812A540 sub_812A588: @ 812A588 push {lr} sub sp, 0x4 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -168,7 +168,7 @@ _0812A644: bl sub_812AA78 bl sub_812AA90 _0812A64C: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -252,7 +252,7 @@ sub_812A6D4: @ 812A6D4 strh r4, [r0, 0x8] adds r0, 0xA adds r1, r5, 0 - bl sub_806F67C + bl StoreWordInTwoHalfwords pop {r4,r5} pop {r0} bx r0 @@ -279,7 +279,7 @@ sub_812A710: @ 812A710 ldr r1, [r3] adds r1, 0x64 adds r0, r2, 0 - bl sub_806F684 + bl LoadWordFromTwoHalfwords pop {r0} bx r0 .pool @@ -467,7 +467,7 @@ sub_812A8C4: @ 812A8C4 strb r4, [r0] ldr r0, [r5] strb r4, [r0, 0x2] - bl GenerateRandomNumber + bl Random ldr r2, [r5] movs r1, 0x1 ands r1, r0 @@ -844,7 +844,7 @@ _0812ABE8: thumb_func_start sub_812ABF8 sub_812ABF8: @ 812ABF8 push {r4,r5,lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x4 ands r0, r1 @@ -937,7 +937,7 @@ _0812ACB2: ldr r3, [r0] movs r1, 0x12 ldrsh r2, [r3, r1] - ldr r4, =gUnknown_030022C0 + ldr r4, =gMain adds r5, r0, 0 cmp r2, 0x2 bgt _0812ACD0 @@ -1002,7 +1002,7 @@ sub_812ACF4: @ 812ACF4 thumb_func_start sub_812AD34 sub_812AD34: @ 812AD34 push {lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -1142,7 +1142,7 @@ _0812AE40: thumb_func_start sub_812AE4C sub_812AE4C: @ 812AE4C push {r4,lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -1660,7 +1660,7 @@ sub_812B214: @ 812B214 thumb_func_start sub_812B254 sub_812B254: @ 812B254 push {lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -1713,7 +1713,7 @@ sub_812B280: @ 812B280 thumb_func_start sub_812B2C0 sub_812B2C0: @ 812B2C0 push {lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -2019,7 +2019,7 @@ _0812B5AA: thumb_func_start sub_812B5B0 sub_812B5B0: @ 812B5B0 push {r4,lr} - bl GenerateRandomNumber + bl Random lsls r0, 24 lsrs r0, 24 ldr r4, =gUnknown_085A76C0 @@ -2053,7 +2053,7 @@ sub_812B5EC: @ 812B5EC movs r5, 0 ldr r6, =gUnknown_085A76D2 _0812B5F2: - bl GenerateRandomNumber + bl Random movs r2, 0xFF ldr r1, =gUnknown_0203AB34 ldr r3, [r1] @@ -2095,7 +2095,7 @@ sub_812B634: @ 812B634 movs r7, 0x80 lsls r7, 17 _0812B644: - bl GenerateRandomNumber + bl Random movs r5, 0xFF ands r5, r0 ldr r0, =gUnknown_0203AB34 @@ -2194,7 +2194,7 @@ sub_812B700: @ 812B700 ldr r1, [r0] movs r0, 0 strb r0, [r1, 0x5] - bl GenerateRandomNumber + bl Random lsls r0, 24 lsrs r4, r0, 24 movs r0, 0 @@ -2215,7 +2215,7 @@ _0812B72E: asrs r5, r0, 16 cmp r5, 0 ble _0812B74E - bl GenerateRandomNumber + bl Random lsls r0, 24 lsrs r4, r0, 24 lsls r0, r6, 24 @@ -2242,7 +2242,7 @@ sub_812B760: @ 812B760 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 - bl GenerateRandomNumber + bl Random movs r1, 0xFF ands r1, r0 ldr r0, =gUnknown_085A77CE @@ -2291,7 +2291,7 @@ _0812B7BC: ble _0812B7C2 movs r4, 0x1 _0812B7C2: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -2308,7 +2308,7 @@ _0812B7C2: b _0812B822 .pool _0812B7E8: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -2787,7 +2787,7 @@ _0812BB8E: _0812BBA8: movs r0, 0x8 strh r0, [r4, 0xA] - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2C] movs r0, 0x1 ands r0, r1 @@ -2800,7 +2800,7 @@ _0812BBBC: lsls r0, 24 cmp r0, 0 beq _0812BBF6 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x8 ands r0, r1 @@ -7241,7 +7241,7 @@ sub_812DDC4: @ 812DDC4 push {r4,lr} sub sp, 0x4 adds r4, r0, 0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x6 ands r0, r1 @@ -9139,12 +9139,12 @@ sub_812ED20: @ 812ED20 movs r1, 0x2E ldrsh r0, [r5, r1] movs r1, 0x14 - bl cosine + bl Cos strh r0, [r5, 0x24] movs r2, 0x2E ldrsh r0, [r5, r2] movs r1, 0x6 - bl sine + bl Sin strh r0, [r5, 0x26] adds r1, r5, 0 adds r1, 0x43 @@ -10330,7 +10330,7 @@ _0812F602: ldrsh r0, [r0, r2] movs r2, 0x30 ldrsh r1, [r4, r2] - bl cosine + bl Cos strh r0, [r4, 0x24] movs r1, 0x3A ldrsh r0, [r4, r1] @@ -10340,7 +10340,7 @@ _0812F602: ldrsh r0, [r0, r2] movs r2, 0x30 ldrsh r1, [r4, r2] - bl sine + bl Sin strh r0, [r4, 0x26] ldrh r1, [r4, 0x30] movs r2, 0x30 diff --git a/asm/sound.s b/asm/sound.s index bdcb85e16..05331f698 100644 --- a/asm/sound.s +++ b/asm/sound.s @@ -5,8 +5,8 @@ .text - thumb_func_start sound_sources_off -sound_sources_off: @ 80A2DD4 + thumb_func_start InitMapMusic +InitMapMusic: @ 80A2DD4 push {lr} ldr r1, =gUnknown_03005DF8 movs r0, 0 @@ -15,10 +15,10 @@ sound_sources_off: @ 80A2DD4 pop {r0} bx r0 .pool - thumb_func_end sound_sources_off + thumb_func_end InitMapMusic - thumb_func_start sound_something -sound_something: @ 80A2DE8 + thumb_func_start MapMusicMain +MapMusicMain: @ 80A2DE8 push {r4,r5,lr} ldr r0, =gUnknown_03000F4C ldrb r1, [r0] @@ -111,7 +111,7 @@ _080A2ECA: pop {r0} bx r0 .pool - thumb_func_end sound_something + thumb_func_end MapMusicMain thumb_func_start map_music_set_to_zero map_music_set_to_zero: @ 80A2EE0 @@ -692,7 +692,7 @@ sub_80A3344: @ 80A3344 bl sub_80A344C b _080A3394 _080A336E: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -1056,7 +1056,7 @@ sub_80A3678: @ 80A3678 lsrs r0, 24 cmp r0, 0x1 beq _080A3694 - bl sub_8000964 + bl ClearPokemonCrySongs movs r0, 0x1 b _080A3696 .pool @@ -1073,7 +1073,7 @@ sub_80A369C: @ 80A369C ldr r0, =gUnknown_020383E8 ldr r0, [r0] bl m4aMPlayStop - bl sub_8000964 + bl ClearPokemonCrySongs pop {r0} bx r0 .pool @@ -1098,7 +1098,7 @@ sub_80A36C8: @ 80A36C8 bl IsPokemonCryPlaying cmp r0, 0 bne _080A36E4 - bl sub_8000964 + bl ClearPokemonCrySongs movs r0, 0 b _080A36E6 .pool diff --git a/asm/sprite.s b/asm/sprite.s index a214a7f92..92c4150eb 100644 --- a/asm/sprite.s +++ b/asm/sprite.s @@ -82,7 +82,7 @@ PrepareSpritesForOamLoad: @ 8006A0C bl UpdateObjectOamCoords bl BuildObjectPriorityList bl SortObjectsByPriority - ldr r5, =gUnknown_030022C0 + ldr r5, =gMain ldr r0, =0x00000439 adds r5, r0 ldrb r0, [r5] @@ -477,7 +477,7 @@ _08006D04: CopyTransformationMatricesToSprites: @ 8006D1C push {r4-r6,lr} movs r4, 0 - ldr r5, =gUnknown_030022C0 + ldr r5, =gMain ldr r6, =gUnknown_02021BC0 _08006D24: lsls r2, r4, 2 @@ -1062,7 +1062,7 @@ _08007178: @ void LoadOamFromSprites() LoadOamFromSprites: @ 8007188 push {lr} - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldr r1, =0x00000439 adds r0, r2, r1 ldrb r1, [r0] @@ -4250,7 +4250,7 @@ _08008898: cmp r0, 0 bne _080088CC _080088AC: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrb r2, [r3] lsls r2, 3 adds r0, 0x38 diff --git a/asm/start_menu.s b/asm/start_menu.s index 9e3a43e3e..059d23ef8 100644 --- a/asm/start_menu.s +++ b/asm/start_menu.s @@ -259,16 +259,16 @@ sub_809F654: @ 809F654 ldrb r0, [r4] movs r1, 0 bl sub_81973FC - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_0203A04C ldrb r1, [r1] movs r2, 0x1 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r5, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r5, =gStringVar4 ldr r1, =gUnknown_085EE6FF adds r0, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldrb r0, [r4] movs r1, 0x1 str r1, [sp] @@ -294,7 +294,7 @@ sub_809F654: @ 809F654 sub_809F6C8: @ 809F6C8 push {r4,r5,lr} sub sp, 0xC - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000cb2 adds r0, r1 @@ -317,9 +317,9 @@ _0809F6F4: ldrb r0, [r4] movs r1, 0 bl sub_81973FC - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r2, =gUnknown_08510510 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] ldr r3, =0x00000cb2 adds r1, r3 @@ -327,11 +327,11 @@ _0809F6F4: lsls r1, 2 adds r1, r2 ldr r1, [r1] - bl CopyString - ldr r5, =gUnknown_02021FC4 + bl StringCopy + ldr r5, =gStringVar4 ldr r1, =gUnknown_085EE716 adds r0, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldrb r0, [r4] movs r1, 0x1 str r1, [sp] @@ -399,7 +399,7 @@ PrintStartMenuActions: @ 809F7C0 ldrb r2, [r0] ldr r0, =gUnknown_08510540 mov r9, r0 - ldr r1, =gUnknown_02021FC4 + ldr r1, =gStringVar4 mov r10, r1 _0809F7DA: ldr r0, =gUnknown_02037610 @@ -436,7 +436,7 @@ _0809F828: adds r0, r3, r1 ldr r1, [r0] mov r0, r10 - bl ExpandStringRefs + bl StringExpandPlaceholders bl get_start_menu_window_id_maybe lsls r0, 24 lsrs r0, 24 @@ -751,7 +751,7 @@ _0809FAB2: thumb_func_start HandleStartMenuInput HandleStartMenuInput: @ 809FAC4 push {r4,lr} - ldr r4, =gUnknown_030022C0 + ldr r4, =gMain ldrh r1, [r4, 0x2E] movs r0, 0x40 ands r0, r1 @@ -1035,7 +1035,7 @@ _0809FD38: bl overworld_free_bg_tilemaps ldr r0, =CB2_OptionsMenu bl SetMainCallback2 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldr r0, =sub_8086194 str r0, [r1, 0x8] movs r0, 0x1 @@ -1317,9 +1317,9 @@ sub_809FF98: @ 809FF98 push {r4,lr} adds r2, r0, 0 adds r4, r1, 0 - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 adds r1, r2, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0 movs r1, 0x1 bl sub_819786C @@ -1407,7 +1407,7 @@ sub_80A003C: @ 80A003C ldrb r0, [r1] subs r2, r0, 0x1 strb r2, [r1] - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2C] movs r0, 0x1 ands r0, r1 @@ -1436,7 +1436,7 @@ sub_80A0070: @ 80A0070 ldrb r0, [r1] cmp r0, 0 bne _080A0094 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2C] movs r0, 0x1 ands r0, r1 @@ -2092,7 +2092,7 @@ _080A05AC: movs r2, 0x10 movs r3, 0 bl BeginNormalPaletteFade - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _080A0620 @@ -2109,7 +2109,7 @@ _080A061C: movs r0, 0x5 b _080A06A6 _080A0620: - ldr r0, =gUnknown_03002700 + ldr r0, =gSoftResetDisabled movs r1, 0x1 strb r1, [r0] movs r0, 0x1 @@ -2128,7 +2128,7 @@ _080A063C: bl sav2_gender2_inplace_and_xFE movs r0, 0x3 strh r0, [r5] - ldr r1, =gUnknown_03002700 + ldr r1, =gSoftResetDisabled movs r0, 0 strb r0, [r1] b _080A06A8 @@ -2145,7 +2145,7 @@ _080A065C: b _080A06A6 _080A0670: bl FreeAllWindowBuffers - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r0, [r0, 0x8] bl SetMainCallback2 adds r0, r4, 0 @@ -2213,7 +2213,7 @@ _080A06EC: ldrb r0, [r6] movs r1, 0 bl sub_81973FC - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] movs r1, 0x4 @@ -2224,7 +2224,7 @@ _080A06EC: mov r9, r0 _080A0710: movs r4, 0x1 - ldr r5, =gUnknown_02021FC4 + ldr r5, =gStringVar4 movs r0, 0x3 adds r1, r5, 0 movs r2, 0x6 diff --git a/asm/starter_choose.s b/asm/starter_choose.s index 1c23ea3aa..3bc828190 100644 --- a/asm/starter_choose.s +++ b/asm/starter_choose.s @@ -362,7 +362,7 @@ sub_813425C: @ 813425C adds r6, r0, r2 ldrh r7, [r6, 0x8] ldrb r4, [r6, 0x8] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain ldrh r3, [r1, 0x2E] movs r0, 0x1 ands r0, r3 @@ -564,7 +564,7 @@ _08134426: ldrh r0, [r0, 0x8] strh r0, [r2] bl dp13_810BB8C - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r0, [r0, 0x8] bl SetMainCallback2 b _0813449A @@ -898,7 +898,7 @@ sub_81346DC: @ 81346DC movs r1, 0x30 ldrsh r0, [r4, r1] movs r1, 0x8 - bl sine + bl Sin strh r0, [r4, 0x26] ldrh r0, [r4, 0x30] lsls r0, 24 diff --git a/asm/string_util.s b/asm/string_util.s deleted file mode 100644 index 2d5ade7aa..000000000 --- a/asm/string_util.s +++ /dev/null @@ -1,1372 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start CopyString_Limit10 -@ u8 *CopyString_Limit10(u8 *dest, u8 *src) -CopyString_Limit10: @ 8008B10 - push {r4,r5,lr} - adds r4, r0, 0 - movs r5, 0xA - movs r3, 0 -_08008B18: - adds r2, r4, r3 - adds r0, r1, r3 - ldrb r0, [r0] - strb r0, [r2] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _08008B2C - adds r0, r2, 0 - b _08008B3C -_08008B2C: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r5 - bcc _08008B18 - adds r0, r4, r3 - movs r1, 0xFF - strb r1, [r0] -_08008B3C: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end CopyString_Limit10 - - thumb_func_start GetStringEnd_Limit7 -@ u8 *GetStringEnd_Limit7(u8 *s) -GetStringEnd_Limit7: @ 8008B44 - push {r4,lr} - adds r3, r0, 0 - movs r4, 0xA - movs r2, 0 -_08008B4C: - adds r1, r3, r2 - ldrb r0, [r1] - cmp r0, 0xFF - bne _08008B58 - adds r0, r1, 0 - b _08008B68 -_08008B58: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r4 - bcc _08008B4C - adds r0, r3, r2 - movs r1, 0xFF - strb r1, [r0] -_08008B68: - pop {r4} - pop {r1} - bx r1 - thumb_func_end GetStringEnd_Limit7 - - thumb_func_start CopyString_Limit7 -@ u8 *CopyString_Limit7(u8 *dest, u8 *src) -CopyString_Limit7: @ 8008B70 - push {r4,r5,lr} - adds r4, r0, 0 - movs r5, 0x7 - movs r3, 0 -_08008B78: - adds r2, r4, r3 - adds r0, r1, r3 - ldrb r0, [r0] - strb r0, [r2] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _08008B8C - adds r0, r2, 0 - b _08008B98 -_08008B8C: - adds r3, 0x1 - cmp r3, r5 - blt _08008B78 - adds r0, r4, r3 - movs r1, 0xFF - strb r1, [r0] -_08008B98: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end CopyString_Limit7 - - thumb_func_start CopyString -@ u8 *CopyString(u8 *dest, u8 *src) -CopyString: @ 8008BA0 - push {lr} - adds r3, r0, 0 - b _08008BAC -_08008BA6: - strb r2, [r3] - adds r3, 0x1 - adds r1, 0x1 -_08008BAC: - ldrb r2, [r1] - adds r0, r2, 0 - cmp r0, 0xFF - bne _08008BA6 - movs r0, 0xFF - strb r0, [r3] - adds r0, r3, 0 - pop {r1} - bx r1 - thumb_func_end CopyString - - thumb_func_start AppendString -@ u8 *AppendString(u8 *dest, u8 *src) -AppendString: @ 8008BC0 - push {lr} - adds r2, r0, 0 - b _08008BC8 -_08008BC6: - adds r2, 0x1 -_08008BC8: - ldrb r0, [r2] - cmp r0, 0xFF - bne _08008BC6 - adds r0, r2, 0 - bl CopyString - pop {r1} - bx r1 - thumb_func_end AppendString - - thumb_func_start CopyString_LimitN -@ u8 *CopyString_LimitN(u8 *dest, u8 *src, u8 n) -CopyString_LimitN: @ 8008BD8 - push {r4-r6,lr} - adds r4, r0, 0 - adds r6, r1, 0 - lsls r2, 24 - lsrs r5, r2, 24 - movs r3, 0 - adds r0, r5, 0 - cmp r3, r0 - bcs _08008BFE - adds r2, r0, 0 -_08008BEC: - adds r1, r4, r3 - adds r0, r6, r3 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, r2 - bcc _08008BEC -_08008BFE: - adds r0, r4, r5 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end CopyString_LimitN - - thumb_func_start AppendString_LimitN -@ u8 *AppendString_LimitN(u8 *dest, u8 *src, u8 n) -AppendString_LimitN: @ 8008C08 - push {lr} - adds r3, r0, 0 - lsls r2, 24 - lsrs r2, 24 - b _08008C14 -_08008C12: - adds r3, 0x1 -_08008C14: - ldrb r0, [r3] - cmp r0, 0xFF - bne _08008C12 - adds r0, r3, 0 - bl CopyString_LimitN - pop {r1} - bx r1 - thumb_func_end AppendString_LimitN - - thumb_func_start GetStringLength -@ u16 GetStringLength(u8 *s) -GetStringLength: @ 8008C24 - push {lr} - adds r2, r0, 0 - movs r1, 0 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08008C3E -_08008C30: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _08008C30 -_08008C3E: - adds r0, r1, 0 - pop {r1} - bx r1 - thumb_func_end GetStringLength - - thumb_func_start CompareString -@ u8 CompareString(u8 *s1, u8 *s2) -CompareString: @ 8008C44 - push {lr} - adds r2, r0, 0 - b _08008C56 -_08008C4A: - cmp r0, 0xFF - bne _08008C52 - movs r0, 0 - b _08008C64 -_08008C52: - adds r2, 0x1 - adds r1, 0x1 -_08008C56: - ldrb r0, [r2] - ldrb r3, [r1] - cmp r0, r3 - beq _08008C4A - ldrb r0, [r2] - ldrb r1, [r1] - subs r0, r1 -_08008C64: - pop {r1} - bx r1 - thumb_func_end CompareString - - thumb_func_start CompareString_LimitN -@ u8 CompareString_LimitN(u8 *s1, u8 *s2, u32 n) -CompareString_LimitN: @ 8008C68 - push {r4,lr} - adds r3, r0, 0 - b _08008C80 -_08008C6E: - cmp r0, 0xFF - beq _08008C7C - adds r3, 0x1 - adds r1, 0x1 - subs r2, 0x1 - cmp r2, 0 - bne _08008C80 -_08008C7C: - movs r0, 0 - b _08008C8E -_08008C80: - ldrb r0, [r3] - ldrb r4, [r1] - cmp r0, r4 - beq _08008C6E - ldrb r0, [r3] - ldrb r1, [r1] - subs r0, r1 -_08008C8E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end CompareString_LimitN - - thumb_func_start IsStringLengthLessThanN -@ bool8 IsStringLengthLessThanN(u8 *s, s32 n) -IsStringLengthLessThanN: @ 8008C94 - push {lr} - adds r3, r0, 0 - movs r2, 0 - cmp r2, r1 - bge _08008CB8 -_08008C9E: - adds r0, r3, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _08008CAE - cmp r0, 0xFF - beq _08008CAE - movs r0, 0x1 - b _08008CBA -_08008CAE: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r1 - blt _08008C9E -_08008CB8: - movs r0, 0 -_08008CBA: - pop {r1} - bx r1 - thumb_func_end IsStringLengthLessThanN - - thumb_func_start ConvertIntToDecimalString -@ u8 *ConvertIntToDecimalString(u8 *dest, s32 value, u8 mode, u8 numDigits) -ConvertIntToDecimalString: @ 8008CC0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - adds r6, r1, 0 - lsls r3, 24 - ldr r0, =gPowersOfTen - lsrs r3, 22 - subs r3, 0x4 - adds r3, r0 - ldr r0, [r3] - movs r7, 0 - cmp r2, 0x1 - bne _08008CDE - movs r7, 0x2 -_08008CDE: - cmp r2, 0x2 - bne _08008CE4 - movs r7, 0x1 -_08008CE4: - adds r5, r0, 0 - cmp r5, 0 - ble _08008D60 - ldr r0, =gDigits - mov r8, r0 -_08008CEE: - adds r0, r6, 0 - adds r1, r5, 0 - bl __divsi3 - lsls r0, 16 - lsrs r2, r0, 16 - adds r3, r2, 0 - adds r0, r5, 0 - muls r0, r2 - subs r1, r6, r0 - cmp r7, 0x1 - bne _08008D26 - adds r3, r4, 0 - adds r4, 0x1 - cmp r2, 0x9 - bhi _08008D20 - mov r6, r8 - adds r0, r2, r6 - ldrb r0, [r0] - b _08008D22 - .pool -_08008D20: - movs r0, 0xAC -_08008D22: - strb r0, [r3] - b _08008D50 -_08008D26: - cmp r2, 0 - bne _08008D2E - cmp r5, 0x1 - bne _08008D46 -_08008D2E: - movs r7, 0x1 - adds r2, r4, 0 - adds r4, 0x1 - cmp r3, 0x9 - bhi _08008D40 - mov r6, r8 - adds r0, r3, r6 - ldrb r0, [r0] - b _08008D42 -_08008D40: - movs r0, 0xAC -_08008D42: - strb r0, [r2] - b _08008D50 -_08008D46: - cmp r7, 0x2 - bne _08008D50 - movs r0, 0x77 - strb r0, [r4] - adds r4, 0x1 -_08008D50: - adds r6, r1, 0 - adds r0, r5, 0 - movs r1, 0xA - bl __divsi3 - adds r5, r0, 0 - cmp r5, 0 - bgt _08008CEE -_08008D60: - movs r0, 0xFF - strb r0, [r4] - adds r0, r4, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end ConvertIntToDecimalString - - thumb_func_start ConvertUnsignedIntToDecimalString -@ u8 *ConvertUnsignedIntToDecimalString(u8 *dest, u32 value, u8 mode, u8 numDigits) -ConvertUnsignedIntToDecimalString: @ 8008D70 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - adds r6, r1, 0 - lsls r3, 24 - ldr r0, =gPowersOfTen - lsrs r3, 22 - subs r3, 0x4 - adds r3, r0 - ldr r0, [r3] - movs r7, 0 - cmp r2, 0x1 - bne _08008D8E - movs r7, 0x2 -_08008D8E: - cmp r2, 0x2 - bne _08008D94 - movs r7, 0x1 -_08008D94: - adds r5, r0, 0 - cmp r5, 0 - ble _08008E10 - ldr r0, =gDigits - mov r8, r0 -_08008D9E: - adds r0, r6, 0 - adds r1, r5, 0 - bl __udivsi3 - lsls r0, 16 - lsrs r2, r0, 16 - adds r3, r2, 0 - adds r0, r5, 0 - muls r0, r2 - subs r1, r6, r0 - cmp r7, 0x1 - bne _08008DD6 - adds r3, r4, 0 - adds r4, 0x1 - cmp r2, 0x9 - bhi _08008DD0 - mov r6, r8 - adds r0, r2, r6 - ldrb r0, [r0] - b _08008DD2 - .pool -_08008DD0: - movs r0, 0xAC -_08008DD2: - strb r0, [r3] - b _08008E00 -_08008DD6: - cmp r2, 0 - bne _08008DDE - cmp r5, 0x1 - bne _08008DF6 -_08008DDE: - movs r7, 0x1 - adds r2, r4, 0 - adds r4, 0x1 - cmp r3, 0x9 - bhi _08008DF0 - mov r6, r8 - adds r0, r3, r6 - ldrb r0, [r0] - b _08008DF2 -_08008DF0: - movs r0, 0xAC -_08008DF2: - strb r0, [r2] - b _08008E00 -_08008DF6: - cmp r7, 0x2 - bne _08008E00 - movs r0, 0x77 - strb r0, [r4] - adds r4, 0x1 -_08008E00: - adds r6, r1, 0 - adds r0, r5, 0 - movs r1, 0xA - bl __divsi3 - adds r5, r0, 0 - cmp r5, 0 - bgt _08008D9E -_08008E10: - movs r0, 0xFF - strb r0, [r4] - adds r0, r4, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end ConvertUnsignedIntToDecimalString - - thumb_func_start ConvertIntToHexString -@ u8 *ConvertIntToHexString(u8 *dest, s32 value, u8 mode, u8 numDigits) -ConvertIntToHexString: @ 8008E20 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - adds r6, r0, 0 - mov r8, r1 - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x1 - movs r0, 0x1 - cmp r1, r3 - bcs _08008E46 -_08008E3A: - lsls r1, 4 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, r3 - bcc _08008E3A -_08008E46: - movs r3, 0 - cmp r2, 0x1 - bne _08008E4E - movs r3, 0x2 -_08008E4E: - cmp r2, 0x2 - bne _08008E54 - movs r3, 0x1 -_08008E54: - adds r5, r1, 0 - cmp r5, 0 - ble _08008ECA - ldr r0, =gDigits - mov r9, r0 -_08008E5E: - mov r0, r8 - adds r1, r5, 0 - str r3, [sp] - bl __divsi3 - adds r4, r0, 0 - adds r7, r4, 0 - mov r0, r8 - adds r1, r5, 0 - bl __modsi3 - adds r1, r0, 0 - ldr r3, [sp] - cmp r3, 0x1 - bne _08008E90 - adds r2, r6, 0 - adds r6, 0x1 - cmp r4, 0xF - bhi _08008EAA - mov r7, r9 - adds r0, r4, r7 - ldrb r0, [r0] - b _08008EAC - .pool -_08008E90: - cmp r4, 0 - bne _08008E98 - cmp r5, 0x1 - bne _08008EB0 -_08008E98: - movs r3, 0x1 - adds r2, r6, 0 - adds r6, 0x1 - cmp r7, 0xF - bhi _08008EAA - mov r4, r9 - adds r0, r7, r4 - ldrb r0, [r0] - b _08008EAC -_08008EAA: - movs r0, 0xAC -_08008EAC: - strb r0, [r2] - b _08008EBA -_08008EB0: - cmp r3, 0x2 - bne _08008EBA - movs r0, 0x77 - strb r0, [r6] - adds r6, 0x1 -_08008EBA: - mov r8, r1 - adds r0, r5, 0 - cmp r5, 0 - bge _08008EC4 - adds r0, 0xF -_08008EC4: - asrs r5, r0, 4 - cmp r5, 0 - bgt _08008E5E -_08008ECA: - movs r0, 0xFF - strb r0, [r6] - adds r0, r6, 0 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end ConvertIntToHexString - - thumb_func_start ExpandStringRefs -@ u8 *ExpandStringRefs(u8 *dest, u8 *src) -ExpandStringRefs: @ 8008EE0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 -_08008EE6: - ldrb r2, [r5] - adds r5, 0x1 - adds r0, r2, 0 - subs r0, 0xFA - cmp r0, 0x5 - bhi _08008FBA - lsls r0, 2 - ldr r1, =_08008F00 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08008F00: - .4byte _08008FBA - .4byte _08008FBA - .4byte _08008F2C - .4byte _08008F18 - .4byte _08008FBA - .4byte _08008FC0 -_08008F18: - ldrb r0, [r5] - adds r5, 0x1 - bl GetExpandedStringRef - adds r1, r0, 0 - adds r0, r4, 0 - bl ExpandStringRefs - adds r4, r0, 0 - b _08008EE6 -_08008F2C: - strb r2, [r4] - adds r4, 0x1 - ldrb r2, [r5] - adds r5, 0x1 - strb r2, [r4] - adds r4, 0x1 - subs r0, r2, 0x4 - cmp r0, 0x14 - bhi _08008FB0 - lsls r0, 2 - ldr r1, =_08008F4C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08008F4C: - .4byte _08008FA0 - .4byte _08008FB0 - .4byte _08008FB0 - .4byte _08008EE6 - .4byte _08008FB0 - .4byte _08008EE6 - .4byte _08008FB0 - .4byte _08008FA8 - .4byte _08008FB0 - .4byte _08008FB0 - .4byte _08008FB0 - .4byte _08008EE6 - .4byte _08008FB0 - .4byte _08008FB0 - .4byte _08008FB0 - .4byte _08008FB0 - .4byte _08008FB0 - .4byte _08008EE6 - .4byte _08008EE6 - .4byte _08008EE6 - .4byte _08008EE6 -_08008FA0: - ldrb r0, [r5] - strb r0, [r4] - adds r5, 0x1 - adds r4, 0x1 -_08008FA8: - ldrb r0, [r5] - strb r0, [r4] - adds r5, 0x1 - adds r4, 0x1 -_08008FB0: - ldrb r0, [r5] - strb r0, [r4] - adds r5, 0x1 - adds r4, 0x1 - b _08008EE6 -_08008FBA: - strb r2, [r4] - adds r4, 0x1 - b _08008EE6 -_08008FC0: - movs r0, 0xFF - strb r0, [r4] - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end ExpandStringRefs - - thumb_func_start sub_8008FCC -@ u8 *sub_8008FCC(u8 *dest, u8 *src) -sub_8008FCC: @ 8008FCC - push {r4-r6,lr} - sub sp, 0xC - adds r5, r0, 0 - adds r6, r1, 0 - ldr r1, =gUnknown_082EC80C - mov r0, sp - movs r2, 0x4 - bl memcpy - add r4, sp, 0x4 - ldr r1, =gUnknown_082EC810 - adds r0, r4, 0 - movs r2, 0x5 - bl memcpy - adds r0, r5, 0 - mov r1, sp -_08008FEE: - bl CopyString - adds r5, r0, 0 -_08008FF4: - ldrb r0, [r6] - adds r6, 0x1 - cmp r0, 0xFE - beq _0800900C - cmp r0, 0xFF - bne _08009012 - b _0800901E - .pool -_0800900C: - adds r0, r5, 0 - adds r1, r4, 0 - b _08008FEE -_08009012: - strb r0, [r5] - adds r5, 0x1 - adds r0, 0x40 - strb r0, [r5] - adds r5, 0x1 - b _08008FF4 -_0800901E: - strb r0, [r5] - adds r0, r5, 0 - add sp, 0xC - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8008FCC - - thumb_func_start StringRef_GetPossiblyUnusedStringVar -@ u8 *StringRef_GetPossiblyUnusedStringVar() -StringRef_GetPossiblyUnusedStringVar: @ 800902C - ldr r0, =gUnknown_020223AC - bx lr - .pool - thumb_func_end StringRef_GetPossiblyUnusedStringVar - - thumb_func_start StringRef_GetPlayerName -@ u8 *StringRef_GetPlayerName() -StringRef_GetPlayerName: @ 8009034 - ldr r0, =gUnknown_03005D90 - ldr r0, [r0] - bx lr - .pool - thumb_func_end StringRef_GetPlayerName - - thumb_func_start StringRef_GetStringVar1 -@ u8 *StringRef_GetStringVar1() -StringRef_GetStringVar1: @ 8009040 - ldr r0, =gUnknown_02021CC4 - bx lr - .pool - thumb_func_end StringRef_GetStringVar1 - - thumb_func_start StringRef_GetStringVar2 -@ u8 *StringRef_GetStringVar2() -StringRef_GetStringVar2: @ 8009048 - ldr r0, =gUnknown_02021DC4 - bx lr - .pool - thumb_func_end StringRef_GetStringVar2 - - thumb_func_start StringRef_GetStringVar3 -@ u8 *StringRef_GetStringVar3() -StringRef_GetStringVar3: @ 8009050 - ldr r0, =gUnknown_02021EC4 - bx lr - .pool - thumb_func_end StringRef_GetStringVar3 - - thumb_func_start StringRef_GetDummiedOutGenderDependentString -@ u8 *StringRef_GetDummiedOutGenderDependentString() -StringRef_GetDummiedOutGenderDependentString: @ 8009058 - push {lr} - ldr r0, =gUnknown_03005D90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - beq _08009070 - ldr r0, =gUnknown_085E821A - b _08009072 - .pool -_08009070: - ldr r0, =gUnknown_085E8219 -_08009072: - pop {r1} - bx r1 - .pool - thumb_func_end StringRef_GetDummiedOutGenderDependentString - - thumb_func_start StringRef_GetRivalName -@ u8 *StringRef_GetRivalName() -StringRef_GetRivalName: @ 800907C - push {lr} - ldr r0, =gUnknown_03005D90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - beq _08009094 - ldr r0, =gUnknown_085E8258 - b _08009096 - .pool -_08009094: - ldr r0, =gUnknown_085E8260 -_08009096: - pop {r1} - bx r1 - .pool - thumb_func_end StringRef_GetRivalName - - thumb_func_start StringRef_GetEmeraldString -@ u8 *StringRef_GetEmeraldString() -StringRef_GetEmeraldString: @ 80090A0 - ldr r0, =gUnknown_085E8229 - bx lr - .pool - thumb_func_end StringRef_GetEmeraldString - - thumb_func_start StringRef_GetAquaString -@ u8 *StringRef_GetAquaString() -StringRef_GetAquaString: @ 80090A8 - ldr r0, =gUnknown_085E8231 - bx lr - .pool - thumb_func_end StringRef_GetAquaString - - thumb_func_start StringRef_GetMagmaString -@ u8 *StringRef_GetMagmaString() -StringRef_GetMagmaString: @ 80090B0 - ldr r0, =gUnknown_085E8236 - bx lr - .pool - thumb_func_end StringRef_GetMagmaString - - thumb_func_start StringRef_GetArchieString -@ u8 *StringRef_GetArchieString() -StringRef_GetArchieString: @ 80090B8 - ldr r0, =gUnknown_085E823C - bx lr - .pool - thumb_func_end StringRef_GetArchieString - - thumb_func_start StringRef_GetMaxieString -@ u8 *StringRef_GetMaxieString() -StringRef_GetMaxieString: @ 80090C0 - ldr r0, =gUnknown_085E8243 - bx lr - .pool - thumb_func_end StringRef_GetMaxieString - - thumb_func_start StringRef_GetKyogreString -@ u8 *StringRef_GetKyogreString() -StringRef_GetKyogreString: @ 80090C8 - ldr r0, =gUnknown_085E8249 - bx lr - .pool - thumb_func_end StringRef_GetKyogreString - - thumb_func_start StringRef_GetGroudonString -@ u8 *StringRef_GetGroudonString() -StringRef_GetGroudonString: @ 80090D0 - ldr r0, =gUnknown_085E8250 - bx lr - .pool - thumb_func_end StringRef_GetGroudonString - - thumb_func_start GetExpandedStringRef -@ u8 *GetExpandedStringRef(u8 code) -GetExpandedStringRef: @ 80090D8 - push {lr} - cmp r0, 0xD - bhi _080090F0 - ldr r1, =gStringRefFunctionTable - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - b _080090F2 - .pool -_080090F0: - ldr r0, =gUnknown_085E8218 -_080090F2: - pop {r1} - bx r1 - .pool - thumb_func_end GetExpandedStringRef - - thumb_func_start RepeatChar -@ u8 *RepeatChar(u8 *dest, u8 c, u16 n) -RepeatChar: @ 80090FC - push {lr} - adds r3, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 16 - lsrs r2, 16 - movs r0, 0 - cmp r0, r2 - bcs _0800911C -_0800910E: - strb r1, [r3] - adds r3, 0x1 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, r2 - bcc _0800910E -_0800911C: - movs r0, 0xFF - strb r0, [r3] - adds r0, r3, 0 - pop {r1} - bx r1 - thumb_func_end RepeatChar - - thumb_func_start CopyStringPadded -@ u8 *CopyStringPadded(u8 *dest, u8 *src, u8 c, u16 n) -CopyStringPadded: @ 8009128 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 16 - lsrs r3, 16 - b _08009148 -_08009138: - strb r1, [r4] - adds r5, 0x1 - adds r4, 0x1 - cmp r3, 0 - beq _08009148 - subs r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 -_08009148: - ldrb r1, [r5] - adds r0, r1, 0 - cmp r0, 0xFF - bne _08009138 - subs r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - ldr r0, =0x0000ffff - cmp r3, r0 - beq _0800916C - adds r1, r0, 0 -_0800915E: - strb r2, [r4] - adds r4, 0x1 - subs r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, r1 - bne _0800915E -_0800916C: - movs r0, 0xFF - strb r0, [r4] - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end CopyStringPadded - - thumb_func_start RepeatStringTerminator -@ u8 *RepeatStringTerminator(u8 *dest, u16 n) -RepeatStringTerminator: @ 800917C - push {lr} - lsls r2, r1, 16 - lsrs r2, 16 - movs r1, 0xFF - bl RepeatChar - pop {r1} - bx r1 - thumb_func_end RepeatStringTerminator - - thumb_func_start CopyString_LimitN_Multibyte -@ u8 *CopyString_LimitN_Multibyte(u8 *dest, u8 *src, u32 n) -CopyString_LimitN_Multibyte: @ 800918C - push {r4,r5,lr} - adds r4, r0, 0 - adds r3, r1, 0 - subs r2, 0x1 - movs r5, 0x1 - negs r5, r5 - b _080091B2 -_0800919A: - strb r0, [r4] - adds r3, 0x1 - adds r4, 0x1 - subs r0, r3, 0x1 - ldrb r0, [r0] - cmp r0, 0xF9 - bne _080091B0 - ldrb r0, [r3] - strb r0, [r4] - adds r3, 0x1 - adds r4, 0x1 -_080091B0: - subs r2, 0x1 -_080091B2: - cmp r2, r5 - beq _080091BE - ldrb r0, [r3] - adds r1, r0, 0 - cmp r1, 0xFF - bne _0800919A -_080091BE: - movs r0, 0xFF - strb r0, [r4] - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end CopyString_LimitN_Multibyte - - thumb_func_start GetStringLength_Multibyte -@ u32 GetStringLength_Multibyte(u8 *s) -GetStringLength_Multibyte: @ 80091CC - push {lr} - adds r2, r0, 0 - movs r3, 0 - b _080091DE -_080091D4: - cmp r1, 0xF9 - bne _080091DA - adds r2, 0x1 -_080091DA: - adds r2, 0x1 - adds r3, 0x1 -_080091DE: - ldrb r1, [r2] - adds r0, r1, 0 - cmp r0, 0xFF - bne _080091D4 - adds r0, r3, 0 - pop {r1} - bx r1 - thumb_func_end GetStringLength_Multibyte - - thumb_func_start WriteColorChangeControlCode -@ u8 *WriteColorChangeControlCode(u8 *dest, u8 colorType, u8 color) -WriteColorChangeControlCode: @ 80091EC - push {lr} - adds r3, r0, 0 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0xFC - strb r0, [r3] - adds r3, 0x1 - cmp r1, 0x1 - beq _0800920E - cmp r1, 0x1 - bcc _08009208 - cmp r1, 0x2 - beq _08009214 - b _08009218 -_08009208: - movs r0, 0x1 - strb r0, [r3] - b _08009216 -_0800920E: - movs r0, 0x3 - strb r0, [r3] - b _08009216 -_08009214: - strb r1, [r3] -_08009216: - adds r3, 0x1 -_08009218: - strb r2, [r3] - adds r3, 0x1 - movs r0, 0xFF - strb r0, [r3] - adds r0, r3, 0 - pop {r1} - bx r1 - thumb_func_end WriteColorChangeControlCode - - thumb_func_start sub_8009228 -@ bool8 sub_8009228(u8 *s) -sub_8009228: @ 8009228 - push {lr} - adds r2, r0, 0 - b _0800923E -_0800922E: - adds r0, r1, 0 - cmp r0, 0xA0 - bhi _0800923C - cmp r0, 0 - beq _0800923C - movs r0, 0x1 - b _08009248 -_0800923C: - adds r2, 0x1 -_0800923E: - ldrb r1, [r2] - adds r0, r1, 0 - cmp r0, 0xFF - bne _0800922E - movs r0, 0 -_08009248: - pop {r1} - bx r1 - thumb_func_end sub_8009228 - - thumb_func_start sub_800924C -@ bool8 sub_800924C(u8 *s, u32 n) -sub_800924C: @ 800924C - push {r4,lr} - adds r3, r0, 0 - adds r4, r1, 0 - movs r1, 0 - b _08009268 -_08009256: - adds r0, r2, 0 - cmp r0, 0xA0 - bhi _08009264 - cmp r0, 0 - beq _08009264 - movs r0, 0x1 - b _08009276 -_08009264: - adds r3, 0x1 - adds r1, 0x1 -_08009268: - ldrb r2, [r3] - adds r0, r2, 0 - cmp r0, 0xFF - beq _08009274 - cmp r1, r4 - blt _08009256 -_08009274: - movs r0, 0 -_08009276: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_800924C - - thumb_func_start GetExtendedControlCodeLength -@ u8 GetExtendedControlCodeLength(u8 code) -GetExtendedControlCodeLength: @ 800927C - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0 - cmp r1, 0x18 - bhi _0800928E - ldr r0, =gExtendedControlCodeLengths - adds r0, r1, r0 - ldrb r0, [r0] -_0800928E: - pop {r1} - bx r1 - .pool - thumb_func_end GetExtendedControlCodeLength - - thumb_func_start SkipExtendedControlCode -@ u8 *SkipExtendedControlCode(u8 *s) -SkipExtendedControlCode: @ 8009298 - push {r4,lr} - adds r4, r0, 0 - b _080092AC -_0800929E: - adds r4, 0x1 - ldrb r0, [r4] - bl GetExtendedControlCodeLength - lsls r0, 24 - lsrs r0, 24 - adds r4, r0 -_080092AC: - ldrb r0, [r4] - cmp r0, 0xFC - beq _0800929E - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end SkipExtendedControlCode - - thumb_func_start CompareStringWithoutExtendedControlCodes -@ u8 CompareStringWithoutExtendedControlCodes(u8 *s1, u8 *s2) -CompareStringWithoutExtendedControlCodes: @ 80092BC - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r6, 0 - b _080092DE -_080092C6: - cmp r1, r0 - bcs _080092D4 - movs r6, 0x1 - negs r6, r6 - cmp r0, 0xFF - bne _080092D4 - movs r6, 0x1 -_080092D4: - ldrb r0, [r4] - cmp r0, 0xFF - beq _080092FE - adds r4, 0x1 - adds r5, 0x1 -_080092DE: - adds r0, r4, 0 - bl SkipExtendedControlCode - adds r4, r0, 0 - adds r0, r5, 0 - bl SkipExtendedControlCode - adds r5, r0, 0 - ldrb r1, [r4] - ldrb r0, [r5] - cmp r1, r0 - bls _080092C6 - movs r6, 0x1 - cmp r1, 0xFF - bne _080092FE - subs r6, 0x2 -_080092FE: - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end CompareStringWithoutExtendedControlCodes - - thumb_func_start StopMusicWhileStringIsPrinted -@ void StopMusicWhileStringIsPrinted(u8 *s, bool8 stopMusic) -StopMusicWhileStringIsPrinted: @ 8009308 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x1 - bne _08009368 - bl StripExtendedControlCodes - adds r0, r4, 0 - bl GetStringLength - lsls r0, 24 - lsrs r2, r0, 24 - adds r1, r2, 0 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - adds r3, r2, 0 - adds r1, r4, r1 - movs r0, 0xFC - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - adds r3, r4, r3 - movs r0, 0x16 - strb r0, [r3] - adds r0, r2, 0x1 - lsls r0, 24 - adds r2, r4, r2 - movs r1, 0xFF - strb r1, [r2] - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - b _0800935A -_08009350: - adds r1, r2, r4 - ldrb r0, [r1] - strb r0, [r1, 0x2] - subs r0, r2, 0x1 - lsls r0, 24 -_0800935A: - lsrs r2, r0, 24 - cmp r2, 0xFF - bne _08009350 - movs r0, 0xFC - strb r0, [r4] - movs r0, 0x15 - strb r0, [r4, 0x1] -_08009368: - pop {r4} - pop {r0} - bx r0 - thumb_func_end StopMusicWhileStringIsPrinted - - thumb_func_start StripExtendedControlCodes -@ void StripExtendedControlCodes(u8 *s) -StripExtendedControlCodes: @ 8009370 - push {r4-r6,lr} - adds r5, r0, 0 - movs r4, 0 - movs r6, 0 - ldrb r0, [r5] - cmp r0, 0xFF - beq _080093C0 -_0800937E: - adds r0, r5, r4 - ldrb r0, [r0] - cmp r0, 0xFC - bne _080093A0 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r5, r4 - ldrb r0, [r0] - bl GetExtendedControlCodeLength - lsls r0, 24 - lsrs r0, 24 - adds r0, r4, r0 - lsls r0, 16 - lsrs r4, r0, 16 - b _080093B8 -_080093A0: - adds r2, r6, 0 - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - adds r2, r5, r2 - adds r1, r4, 0 - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - adds r1, r5, r1 - ldrb r0, [r1] - strb r0, [r2] -_080093B8: - adds r0, r5, r4 - ldrb r0, [r0] - cmp r0, 0xFF - bne _0800937E -_080093C0: - adds r1, r5, r6 - movs r0, 0xFF - strb r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end StripExtendedControlCodes - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/text.s b/asm/text.s index 7b1e9c53c..87e72f362 100644 --- a/asm/text.s +++ b/asm/text.s @@ -2266,7 +2266,7 @@ TextPrinterWaitWithDownArrow: @ 8005650 _08005674: adds r0, r2, 0 bl TextPrinterDrawDownArrow - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -2302,7 +2302,7 @@ TextPrinterWait: @ 800569C b _080056D4 .pool _080056C0: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -2453,7 +2453,7 @@ _080057D4: .4byte _08005D48 .4byte _08005D5A _080057F0: - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2C] movs r0, 0x3 ands r0, r1 @@ -2499,7 +2499,7 @@ _08005834: b _08005B56 .pool _0800584C: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -3417,15 +3417,15 @@ _08005F8A: beq _08005FA0 b _08005F02 _08005F90: - ldr r6, =gUnknown_02021CC4 + ldr r6, =gStringVar1 b _08005FA2 .pool _08005F98: - ldr r6, =gUnknown_02021DC4 + ldr r6, =gStringVar2 b _08005FA2 .pool _08005FA0: - ldr r6, =gUnknown_02021EC4 + ldr r6, =gStringVar3 _08005FA2: cmp r6, 0 bne _08005FE0 diff --git a/asm/text_window.s b/asm/text_window.s index e2b729a51..737c0018d 100644 --- a/asm/text_window.s +++ b/asm/text_window.s @@ -125,7 +125,7 @@ sub_809882C: @ 809882C lsrs r4, 16 lsls r3, 24 lsrs r3, 24 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] ldrb r1, [r1, 0x14] lsrs r1, 3 @@ -659,7 +659,7 @@ sub_8098C6C: @ 8098C6C lsls r4, 24 lsrs r4, 24 ldr r2, =gUnknown_0851021C - ldr r5, =gUnknown_03005D90 + ldr r5, =gSaveBlock2Ptr ldr r1, [r5] ldrb r1, [r1, 0x14] lsrs r1, 3 diff --git a/asm/title_screen.s b/asm/title_screen.s index 27dd55e05..4090aad96 100644 --- a/asm/title_screen.s +++ b/asm/title_screen.s @@ -482,7 +482,7 @@ title_screen_vblank_callback: @ 80AA780 c2_title_screen_1: @ 80AA7A4 push {r4,lr} sub sp, 0x14 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -581,7 +581,7 @@ _080AA7E0: str r0, [r1, 0x8] ldr r0, [r1, 0x8] bl ResetPaletteFade - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -634,7 +634,7 @@ _080AA8C4: bl LoadPalette ldr r0, =gUnknown_08540100 bl LoadTaggedObjectPalette - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r2 @@ -662,7 +662,7 @@ _080AA998: strh r0, [r1, 0xC] subs r0, 0x10 strh r0, [r1, 0xE] - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -681,7 +681,7 @@ _080AA9E0: bl BeginNormalPaletteFade ldr r0, =title_screen_vblank_callback bl SetVBlankCallback - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r2 @@ -754,7 +754,7 @@ _080AAA14: bl SetGpuReg ldr r0, =0x0000019d bl m4aSongNumStart - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -808,7 +808,7 @@ task_title_screen_1: @ 80AAB44 push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0xF ands r0, r1 @@ -927,7 +927,7 @@ task_title_screen_2: @ 80AAC50 push {r4-r7,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0xF ands r0, r1 @@ -1056,7 +1056,7 @@ task_title_screen_3: @ 80AAD64 sub sp, 0x4 lsls r0, 24 lsrs r5, r0, 24 - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2E] movs r0, 0x1 ands r0, r1 @@ -1115,7 +1115,7 @@ _080AADC8: b _080AAE98 .pool _080AADFC: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2C] movs r0, 0x6 ands r0, r1 @@ -1280,7 +1280,7 @@ title_screen_update_rayquaza_ring_palette: @ 80AAF48 bne _080AAF9C adds r0, r1, 0 movs r1, 0x80 - bl cosine + bl Cos lsls r0, 16 asrs r0, 16 adds r2, r0, 0 diff --git a/asm/trade.s b/asm/trade.s index 46d5398ed..e021af95a 100644 --- a/asm/trade.s +++ b/asm/trade.s @@ -135,7 +135,7 @@ _08077258: thumb_func_start sub_8077260 sub_8077260: @ 8077260 push {lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _08077280 @@ -285,7 +285,7 @@ sub_80773AC: @ 80773AC push {lr} ldr r0, =sub_80773D0 bl SetMainCallback2 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0 str r1, [r0] ldr r0, =gUnknown_020244EA @@ -301,7 +301,7 @@ sub_80773D0: @ 80773D0 mov r7, r8 push {r7} sub sp, 0x28 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 @@ -363,7 +363,7 @@ _08077476: adds r6, 0x1 cmp r6, 0xD ble _08077476 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r3, 0x87 lsls r3, 3 adds r1, r3 @@ -380,7 +380,7 @@ _080774A4: _080774B2: movs r0, 0x64 muls r0, r6 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 str r4, [sp] str r4, [sp, 0x4] @@ -409,7 +409,7 @@ _080774B2: ldr r0, [r0] adds r0, 0xA8 strb r2, [r0] - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _08077528 @@ -420,7 +420,7 @@ _080774B2: .pool _08077528: bl sub_8009734 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r7, 0x87 lsls r7, 3 adds r0, r7 @@ -433,7 +433,7 @@ _08077528: b _08077B46 .pool _0807754C: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -490,14 +490,14 @@ _080775A0: b _08077B46 _080775C0: bl sub_800A620 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r3, 0x87 lsls r3, 3 adds r1, r3 b _08077B22 .pool _080775D8: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r5, 0x87 lsls r5, 3 adds r1, r5 @@ -519,7 +519,7 @@ _080775F2: _08077600: bl sub_8011BD0 bl calc_player_party_count - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r7, 0x87 lsls r7, 3 adds r1, r7 @@ -531,7 +531,7 @@ _08077600: ldr r0, [r0] adds r0, 0xA8 strb r2, [r0] - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 bne _0807762A @@ -543,7 +543,7 @@ _0807762A: b _08077B46 .pool _08077648: - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _08077680 @@ -553,7 +553,7 @@ _08077648: bne _0807765C b _08077B46 _0807765C: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -579,7 +579,7 @@ _08077688: b _08077B46 _08077694: bl sub_807A5B0 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r3, 0x87 lsls r3, 3 adds r1, r3 @@ -616,17 +616,17 @@ _080776E2: movs r0, 0x64 adds r4, r6, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData ldrb r2, [r7] lsls r2, 19 movs r1, 0xE0 @@ -673,18 +673,18 @@ _08077756: movs r0, 0x64 adds r4, r6, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 adds r0, r4, 0 movs r1, 0x41 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData ldrb r2, [r7] lsls r2, 19 movs r3, 0xE0 @@ -717,7 +717,7 @@ _08077756: cmp r6, r0 blt _08077756 _080777B8: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r3, 0x87 lsls r3, 3 adds r1, r3 @@ -732,7 +732,7 @@ _080777E8: adds r1, 0x28 movs r2, 0 bl sub_81B5D4C - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r5, 0x87 lsls r5, 3 adds r1, r5 @@ -746,14 +746,14 @@ _08077810: adds r1, 0x28 movs r2, 0x1 bl sub_81B5D4C - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r7, 0x87 lsls r7, 3 adds r1, r7 b _08077B22 .pool _08077834: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r5, =gUnknown_02032188 ldr r1, [r5] @@ -790,7 +790,7 @@ _08077834: ldr r1, [r5, 0x20] movs r2, 0x18 bl sub_807A308 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -813,7 +813,7 @@ _080778BC: _080778C8: b _08077B1A _080778CA: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] movs r0, 0x1 movs r2, 0x78 @@ -880,7 +880,7 @@ _0807792C: adds r6, 0x1 cmp r6, 0x2 ble _0807792C - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r5, 0x87 lsls r5, 3 adds r1, r5 @@ -966,7 +966,7 @@ _080779BC: ldr r0, [r2] adds r0, 0x35 strb r3, [r0] - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r5, 0x87 lsls r5, 3 adds r1, r5 @@ -989,7 +989,7 @@ _08077A40: ldr r0, [r2] strb r1, [r0, 0x1] bl sub_8078388 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r7, 0x87 lsls r7, 3 adds r1, r7 @@ -1005,7 +1005,7 @@ _08077A80: bl sub_807A320 movs r0, 0x1 bl sub_8079BE0 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -1020,7 +1020,7 @@ _08077A9A: _08077AA8: movs r0, 0x1 bl sub_80782B8 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r3, 0x87 lsls r3, 3 adds r1, r3 @@ -1034,7 +1034,7 @@ _08077ABC: movs r2, 0x10 movs r3, 0 bl BeginNormalPaletteFade - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r5, 0x87 lsls r5, 3 adds r1, r5 @@ -1047,7 +1047,7 @@ _08077ADC: bl SetGpuReg movs r0, 0x2 bl sub_80782B8 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r7, 0x87 lsls r7, 3 adds r1, r7 @@ -1056,7 +1056,7 @@ _08077ADC: _08077AFC: movs r0, 0 bl sub_807A468 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -1067,7 +1067,7 @@ _08077B10: bl sub_807A468 bl sub_807A53C _08077B1A: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -1109,7 +1109,7 @@ sub_8077B74: @ 8077B74 mov r7, r8 push {r7} sub sp, 0x24 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 @@ -1152,7 +1152,7 @@ _08077BA0: .4byte _080780E4 _08077BFC: bl sub_80772A4 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r3, 0x87 lsls r3, 3 adds r1, r3 @@ -1175,14 +1175,14 @@ _08077C20: b _080780D8 _08077C28: bl calc_player_party_count - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 b _080780D8 .pool _08077C3C: - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _08077C50 @@ -1191,7 +1191,7 @@ _08077C3C: movs r1, 0 bl sub_800DFB4 _08077C50: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r3, 0x87 lsls r3, 3 adds r1, r3 @@ -1233,18 +1233,18 @@ _08077CA8: movs r0, 0x64 adds r4, r6, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x41 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData ldrb r2, [r7] lsls r2, 19 movs r1, 0xE0 @@ -1291,18 +1291,18 @@ _08077D1E: movs r0, 0x64 adds r4, r6, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 adds r0, r4, 0 movs r1, 0x41 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData ldrb r2, [r7] lsls r2, 19 movs r3, 0xE0 @@ -1335,7 +1335,7 @@ _08077D1E: cmp r6, r0 blt _08077D1E _08077D80: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r3, 0x87 lsls r3, 3 adds r1, r3 @@ -1350,7 +1350,7 @@ _08077DB0: adds r1, 0x28 movs r2, 0 bl sub_81B5D4C - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r5, 0x87 lsls r5, 3 adds r1, r5 @@ -1364,14 +1364,14 @@ _08077DD8: adds r1, 0x28 movs r2, 0x1 bl sub_81B5D4C - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r7, 0x87 lsls r7, 3 adds r1, r7 b _080780D8 .pool _08077DFC: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r5, =gUnknown_02032188 ldr r1, [r5] @@ -1408,7 +1408,7 @@ _08077DFC: ldr r1, [r5, 0x20] movs r2, 0x18 bl sub_807A308 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -1430,14 +1430,14 @@ _08077E84: bne _08077E90 b _080780F6 _08077E90: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 b _080780D8 .pool _08077EA0: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] movs r0, 0x1 movs r2, 0x78 @@ -1504,7 +1504,7 @@ _08077F02: adds r6, 0x1 cmp r6, 0x2 ble _08077F02 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r5, 0x87 lsls r5, 3 adds r1, r5 @@ -1610,7 +1610,7 @@ _08077FEA: ldr r1, [r4] adds r1, 0x34 strb r0, [r1] - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r7, 0x87 lsls r7, 3 adds r0, r7 @@ -1632,7 +1632,7 @@ _08078040: ldr r0, [r2] strb r1, [r0, 0x1] bl sub_8078388 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -1657,7 +1657,7 @@ _08078068: movs r2, 0x10 movs r3, 0 bl BeginNormalPaletteFade - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r3, 0x87 lsls r3, 3 adds r1, r3 @@ -1670,7 +1670,7 @@ _080780A4: bl SetGpuReg movs r0, 0x2 bl sub_80782B8 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r5, 0x87 lsls r5, 3 adds r1, r5 @@ -1684,7 +1684,7 @@ _080780C4: _080780CC: bl sub_807A53C _080780D0: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -1780,7 +1780,7 @@ sub_807816C: @ 807816C adds r0, 0x7E ldrb r0, [r0] strb r0, [r1, 0x1] - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _080781B4 @@ -1806,10 +1806,10 @@ _080781C2: thumb_func_start sub_80781C8 sub_80781C8: @ 80781C8 push {r4,r5,lr} - ldr r5, =gUnknown_030022C0 + ldr r5, =gMain ldr r0, =sub_80773AC str r0, [r5, 0x8] - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _08078220 @@ -2143,7 +2143,7 @@ _08078484: .4byte _08078720 _080784DC: ldr r0, =gUnknown_020228C4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty movs r2, 0xC8 bl sub_8078438 ldr r3, =gUnknown_0203229C @@ -2193,7 +2193,7 @@ _08078548: beq _08078552 b _080787AA _08078552: - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty movs r2, 0x1 adds r1, r5, 0 eors r1, r2 @@ -2287,7 +2287,7 @@ _0807861A: .pool _08078644: ldr r0, =gUnknown_020228C4 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r1, [r1] ldr r2, =0x00002be0 adds r1, r2 @@ -2329,7 +2329,7 @@ _0807868A: .pool _080786B4: ldr r0, =gUnknown_020228C4 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r1, [r1] ldr r2, =0x000031a8 adds r1, r2 @@ -2369,13 +2369,13 @@ _080786F0: b _080787A2 .pool _08078720: - ldr r4, =gUnknown_02024744 + ldr r4, =gEnemyParty ldr r6, =0x0000012f movs r5, 0x5 _08078726: adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 cmp r0, 0 @@ -2384,16 +2384,16 @@ _08078726: bne _08078766 adds r0, r4, 0 movs r1, 0x3 - bl pokemon_getattr + bl GetMonData cmp r0, 0x1 beq _08078766 adds r0, r4, 0 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData mov r0, sp ldr r1, =gUnknown_0832DF94 - bl CompareStringWithoutExtendedControlCodes + bl StringCompareWithoutExtCtrlCodes cmp r0, 0 bne _08078766 adds r0, r4, 0 @@ -3173,7 +3173,7 @@ _08078DB4: sub_8078DBC: @ 8078DBC push {r4,lr} sub sp, 0x4 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x30] movs r0, 0x40 ands r0, r1 @@ -3221,7 +3221,7 @@ _08078E1C: movs r1, 0x3 bl sub_8078CB8 _08078E30: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -3381,7 +3381,7 @@ _08078F7E: b _08079028 .pool _08078F9C: - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty ldr r1, =gUnknown_020244E9 ldrb r1, [r1] ldr r2, =gUnknown_0203229C @@ -3451,7 +3451,7 @@ _0807902A: thumb_func_start sub_8079034 sub_8079034: @ 8079034 push {lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -3488,7 +3488,7 @@ sub_807905C: @ 807905C ldrb r2, [r3] cmp r2, 0x5 bhi _080790A4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty ldrb r2, [r3] adds r0, 0x36 ldrb r3, [r0] @@ -3502,7 +3502,7 @@ sub_807905C: @ 807905C b _080790C0 .pool _080790A4: - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty subs r2, 0x6 lsls r2, 24 lsrs r2, 24 @@ -3536,7 +3536,7 @@ sub_80790D4: @ 80790D4 lsrs r6, r3, 24 movs r5, 0 movs r3, 0 - ldr r7, =gUnknown_02024744 + ldr r7, =gEnemyParty cmp r5, r1 bge _08079102 _080790EE: @@ -3562,7 +3562,7 @@ _08079102: adds r7, r0, r7 adds r0, r7, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r4, r0, 16 movs r0, 0xCD @@ -3574,7 +3574,7 @@ _08079102: _0807912C: adds r0, r7, 0 movs r1, 0x50 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _08079158 _08079138: @@ -3937,7 +3937,7 @@ _080793F8: thumb_func_start sub_8079408 sub_8079408: @ 8079408 push {r4-r6,lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -4004,7 +4004,7 @@ sub_8079490: @ 8079490 ands r0, r1 cmp r0, 0 bne _080794C4 - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _080794B4 @@ -4029,7 +4029,7 @@ _080794C4: thumb_func_start sub_80794CC sub_80794CC: @ 80794CC push {lr} - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _08079518 @@ -4097,7 +4097,7 @@ _08079574: thumb_func_start sub_807957C sub_807957C: @ 807957C push {lr} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -4675,25 +4675,25 @@ sub_8079A3C: @ 8079A3C bne _08079A64 movs r0, 0x64 muls r0, r2 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData b _08079A74 .pool _08079A64: movs r0, 0x64 muls r0, r2 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData _08079A74: adds r0, r4, 0 mov r1, sp - bl CopyString_Limit10 + bl StringCopy10 movs r0, 0 movs r1, 0x2 bl GetFontAttribute @@ -4739,9 +4739,9 @@ sub_8079AA4: @ 8079AA4 movs r0, 0x64 adds r5, r2, 0 muls r5, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty mov r9, r0 - ldr r2, =gUnknown_02024744 + ldr r2, =gEnemyParty mov r8, r2 _08079ADE: cmp r7, 0 @@ -4758,7 +4758,7 @@ _08079AF8: _08079AFE: adds r0, r5, r2 movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r1, r4, 1 add r1, sp strh r0, [r1] @@ -4769,7 +4769,7 @@ _08079AFE: bls _08079ADE ldr r1, =gUnknown_0832DABC adds r0, r6, 0 - bl CopyString + bl StringCopy movs r4, 0 _08079B20: lsls r0, r4, 1 @@ -4784,11 +4784,11 @@ _08079B20: ldr r0, =gMoveNames adds r1, r0 adds r0, r6, 0 - bl AppendString + bl StringAppend _08079B3C: adds r0, r6, 0 ldr r1, =gUnknown_0832DAD2 - bl AppendString + bl StringAppend adds r0, r4, 0x1 lsls r0, 16 lsrs r4, r0, 16 @@ -4799,10 +4799,10 @@ _08079B3C: _08079B5C: ldr r1, =gUnknown_0832DABC adds r0, r6, 0 - bl CopyString + bl StringCopy ldr r1, =gUnknown_0832DADF adds r0, r6, 0 - bl AppendString + bl StringAppend _08079B6C: add sp, 0x8 pop {r3,r4} @@ -4865,10 +4865,10 @@ sub_8079BE0: @ 8079BE0 sub sp, 0x34 lsls r0, 24 lsrs r6, r0, 24 - ldr r7, =gUnknown_02024744 + ldr r7, =gEnemyParty cmp r6, 0 bne _08079BF0 - ldr r7, =gUnknown_020244EC + ldr r7, =gPlayerParty _08079BF0: movs r4, 0 ldr r0, =gUnknown_0203229C @@ -4885,10 +4885,10 @@ _08079C02: adds r0, r7, r0 movs r1, 0x2 mov r2, sp - bl pokemon_getattr + bl GetMonData adds r0, r5, 0 mov r1, sp - bl CopyString_Limit10 + bl StringCopy10 adds r0, r6, 0 adds r1, r4, 0 adds r2, r5, 0 @@ -4954,18 +4954,18 @@ sub_8079C4C: @ 8079C4C bne _08079CB0 movs r0, 0x64 muls r0, r7 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty b _08079CB6 .pool _08079CB0: movs r0, 0x64 muls r0, r7 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty _08079CB6: adds r0, r1 movs r1, 0x38 movs r2, 0 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r6, r0, 24 ldr r4, =gUnknown_0203229C @@ -5075,7 +5075,7 @@ _08079D94: movs r0, 0x64 adds r4, r7, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 bl pokemon_get_gender @@ -5084,14 +5084,14 @@ _08079D94: adds r0, r4, 0 movs r1, 0x2 add r2, sp, 0xC - bl pokemon_getattr + bl GetMonData b _08079DDE .pool _08079DC0: movs r0, 0x64 adds r4, r7, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 adds r0, r4, 0 bl pokemon_get_gender @@ -5100,7 +5100,7 @@ _08079DC0: adds r0, r4, 0 movs r1, 0x2 add r2, sp, 0xC - bl pokemon_getattr + bl GetMonData _08079DDE: cmp r5, 0 beq _08079DF0 @@ -5780,11 +5780,11 @@ _0807A34E: movs r0, 0x64 adds r1, r7, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 cmp r1, 0x1 bne _0807A380 @@ -5801,7 +5801,7 @@ _0807A34E: _0807A380: adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 cmp r1, 0 bne _0807A39E @@ -5852,11 +5852,11 @@ _0807A3E2: movs r0, 0x64 adds r1, r7, 0 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 cmp r1, 0x1 bne _0807A414 @@ -5873,7 +5873,7 @@ _0807A3E2: _0807A414: adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 cmp r1, 0 bne _0807A432 @@ -5939,16 +5939,16 @@ _0807A488: movs r0, 0x64 adds r4, r6, 0 muls r4, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r5, r0, 16 adds r0, r4, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r0, r5, 16 asrs r0, 16 @@ -5982,16 +5982,16 @@ _0807A4E8: movs r0, 0x64 adds r4, r6, 0 muls r4, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r4, r0 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r5, r0, 16 adds r0, r4, 0 movs r1, 0x3A - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 lsls r0, r5, 16 asrs r0, 16 @@ -6081,7 +6081,7 @@ _0807A596: sub_807A5B0: @ 807A5B0 push {r4,r5,lr} movs r3, 0 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r4, =0x000031a8 _0807A5B8: ldr r0, [r5] @@ -6132,11 +6132,11 @@ _0807A60C: add r4, r8 adds r0, r4, 0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData str r0, [r6, 0x18] adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData stm r6!, {r0} adds r5, 0x1 cmp r5, r7 @@ -6219,7 +6219,7 @@ _0807A6BE: adds r0, r1, 0 add r0, r8 movs r1, 0x50 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0807A6D6 _0807A6D2: @@ -6567,7 +6567,7 @@ _0807A934: muls r0, r5 adds r0, r6, r0 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData str r0, [r4] movs r1, 0xCE lsls r1, 1 @@ -6872,7 +6872,7 @@ sub_807AB28: @ 807AB28 ldrh r0, [r0] str r0, [sp, 0xC] add r0, sp, 0x10 - bl sub_806F6C0 + bl DoBgAffineSet add r0, sp, 0x10 ldrh r1, [r0] movs r0, 0x20 @@ -7087,7 +7087,7 @@ sub_807ACFC: @ 807ACFC ldrb r1, [r0] movs r0, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r1, r0 mov r8, r1 movs r4, 0x1 @@ -7102,7 +7102,7 @@ _0807AD22: lsrs r0, 24 movs r1, 0x64 muls r1, r0 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r1, r0 mov r8, r1 movs r4, 0x3 @@ -7116,12 +7116,12 @@ _0807AD40: _0807AD58: mov r0, r8 movs r1, 0x41 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r5, r0, 16 mov r0, r8 movs r1, 0 - bl pokemon_getattr + bl GetMonData adds r7, r0, 0 cmp r6, 0 bne _0807AD94 @@ -7222,7 +7222,7 @@ _0807AE36: sub_807AE50: @ 807AE50 push {r4,r5,lr} sub sp, 0x4 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 @@ -7278,7 +7278,7 @@ _0807AEC0: bl SetVBlankCallback bl sub_807B170 bl sub_807AC3C - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -7331,7 +7331,7 @@ _0807AF58: movs r1, 0x1 strb r1, [r0] bl sub_8009734 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -7390,7 +7390,7 @@ _0807AFC8: b _0807B116 _0807AFEA: bl sub_800A620 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -7414,7 +7414,7 @@ _0807B014: beq _0807B022 b _0807B116 _0807B022: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -7440,7 +7440,7 @@ _0807B058: movs r0, 0 movs r1, 0x1 bl sub_807ACFC - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -7456,7 +7456,7 @@ _0807B07A: movs r1, 0x1 bl sub_807ACFC bl sub_807B154 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -7480,7 +7480,7 @@ _0807B0B0: bl BeginNormalPaletteFade movs r0, 0 bl ShowBg - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -7490,7 +7490,7 @@ _0807B0D4: bl sub_807B140 bl sub_807BAD8 _0807B0DC: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -7507,7 +7507,7 @@ _0807B0F0: ands r0, r1 cmp r0, 0 bne _0807B116 - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _0807B110 @@ -7662,7 +7662,7 @@ sub_807B270: @ 807B270 mov r6, r8 push {r6} sub sp, 0xC - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -7701,19 +7701,19 @@ _0807B2D0: movs r0, 0x6 strb r0, [r1, 0x1] ldr r4, =gUnknown_020229F0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r0, r4, 0 - bl CopyString - ldr r5, =gUnknown_02024744 + bl StringCopy + ldr r5, =gEnemyParty adds r0, r5, 0 movs r1, 0x7 mov r2, sp - bl pokemon_getattr + bl GetMonData adds r0, r4, 0 adds r0, 0x1C mov r1, sp - bl CopyString + bl StringCopy subs r4, 0x8 movs r0, 0 mov r8, r0 @@ -7721,7 +7721,7 @@ _0807B2D0: strh r0, [r4, 0x1A] adds r0, r5, 0 movs r1, 0x3 - bl pokemon_getattr + bl GetMonData strh r0, [r4, 0x36] ldr r4, =gUnknown_020322A0 movs r5, 0x80 @@ -7768,7 +7768,7 @@ _0807B2D0: adds r0, 0x4 strh r6, [r0] str r6, [r2, 0x64] - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -7825,7 +7825,7 @@ _0807B414: bl sub_807B62C bl sub_807BAD8 _0807B424: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -7859,24 +7859,24 @@ sub_807B464: @ 807B464 lsrs r0, 24 movs r1, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r1, r0 adds r0, r5, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0807B4B8 adds r0, r5, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r5, r0, 0 adds r0, r4, 0 bl SpeciesToNationalPokedexNum @@ -7921,26 +7921,26 @@ sub_807B4D0: @ 807B4D0 movs r5, 0x64 mov r1, r9 muls r1, r5 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r7, r1, r0 adds r0, r7, 0 movs r1, 0x40 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r6, r0, 16 adds r1, r4, 0 muls r1, r5 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty adds r5, r1, r0 adds r0, r5, 0 movs r1, 0x40 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 mov r8, r0 cmp r6, 0xFF beq _0807B52A - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr lsls r1, r6, 3 adds r1, r6 lsls r1, 2 @@ -7968,7 +7968,7 @@ _0807B52A: strb r1, [r0] adds r0, r7, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0807B566 adds r0, r7, 0 @@ -8523,7 +8523,7 @@ sub_807BAD8: @ 807BAD8 beq _0807BB68 bl link_get_multiplayer_id lsls r0, 24 - ldr r3, =gUnknown_02021CC4 + ldr r3, =gStringVar1 movs r2, 0x80 lsls r2, 17 eors r2, r0 @@ -8534,7 +8534,7 @@ sub_807BAD8: @ 807BAD8 ldr r0, =gUnknown_020229F0 adds r1, r0 adds r0, r3, 0 - bl CopyString + bl StringCopy ldr r5, =gUnknown_02032298 ldrb r0, [r5, 0x1] movs r1, 0x6 @@ -8543,24 +8543,24 @@ sub_807BAD8: @ 807BAD8 lsrs r0, 24 movs r4, 0x64 muls r0, r4 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr - ldr r0, =gUnknown_02021EC4 + bl GetMonData + ldr r0, =gStringVar3 mov r1, sp - bl CopyString_Limit10 + bl StringCopy10 ldrb r0, [r5] muls r0, r4 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr - ldr r0, =gUnknown_02021DC4 + bl GetMonData + ldr r0, =gStringVar2 mov r1, sp - bl CopyString_Limit10 + bl StringCopy10 b _0807BBA4 .pool _0807BB68: @@ -8571,25 +8571,25 @@ _0807BB68: lsls r4, 2 ldr r0, =gUnknown_08338ED0 adds r4, r0 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x2B - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 adds r1, r4, 0 - bl CopyString_Limit10 + bl StringCopy10 ldr r0, =gUnknown_020375E2 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr - ldr r0, =gUnknown_02021DC4 + bl GetMonData + ldr r0, =gStringVar2 mov r1, sp - bl CopyString_Limit10 + bl StringCopy10 _0807BBA4: add sp, 0x14 pop {r4,r5} @@ -9003,10 +9003,10 @@ _0807C0F8: bl _0807CFB4 .pool _0807C120: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EE942 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0 adds r1, r4, 0 movs r2, 0 @@ -9069,10 +9069,10 @@ _0807C178: ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EE959 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0 adds r1, r4, 0 movs r2, 0 @@ -10470,10 +10470,10 @@ _0807CDDC: lsls r1, 5 movs r0, 0 bl SetGpuReg - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EE966 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0 adds r1, r4, 0 movs r2, 0 @@ -10541,10 +10541,10 @@ _0807CE70: adds r0, 0x1 movs r5, 0 strh r0, [r1] - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EE977 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0 adds r1, r4, 0 movs r2, 0 @@ -10576,7 +10576,7 @@ _0807CEB6: movs r0, 0x1 b _0807CFB6 _0807CEC6: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -10597,7 +10597,7 @@ _0807CEDC: ldrb r0, [r7] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5 movs r1, 0x1 movs r2, 0 @@ -11065,10 +11065,10 @@ _0807D4D4: bl _0807E400 .pool _0807D4FC: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EE942 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0 adds r1, r4, 0 movs r2, 0 @@ -11131,10 +11131,10 @@ _0807D554: ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EE959 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0 adds r1, r4, 0 movs r2, 0 @@ -12575,10 +12575,10 @@ _0807E228: lsls r1, 5 movs r0, 0 bl SetGpuReg - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EE966 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0 adds r1, r4, 0 movs r2, 0 @@ -12646,10 +12646,10 @@ _0807E2BC: adds r0, 0x1 movs r5, 0 strh r0, [r1] - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EE977 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0 adds r1, r4, 0 movs r2, 0 @@ -12681,7 +12681,7 @@ _0807E302: movs r0, 0x1 b _0807E402 _0807E312: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -12702,7 +12702,7 @@ _0807E328: ldrb r0, [r7] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5 movs r1, 0x1 movs r2, 0 @@ -12791,7 +12791,7 @@ c2_08053788: @ 807E414 push {r4-r7,lr} mov r7, r8 push {r7} - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r0, r2 @@ -12805,7 +12805,7 @@ c2_08053788: @ 807E414 _0807E434: movs r0, 0x4 strb r0, [r1] - ldr r1, =gUnknown_03002700 + ldr r1, =gSoftResetDisabled movs r0, 0x1 b _0807E4B2 .pool @@ -12818,7 +12818,7 @@ _0807E444: ldrb r0, [r7] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5 movs r1, 0x1 movs r2, 0 @@ -13184,18 +13184,18 @@ sub_807E73C: @ 807E73C lsls r4, 2 ldr r0, =gUnknown_08338ED0 adds r4, r0 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r1, [r4, 0x38] movs r6, 0xB muls r1, r6 ldr r5, =gSpeciesNames adds r1, r5 - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 ldrh r1, [r4, 0xC] muls r1, r6 adds r1, r5 - bl CopyString + bl StringCopy ldrh r0, [r4, 0x38] pop {r4-r6} pop {r1} @@ -13218,21 +13218,21 @@ sub_807E784: @ 807E784 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x2 mov r2, sp - bl pokemon_getattr - ldr r0, =gUnknown_02021CC4 + bl GetMonData + ldr r0, =gStringVar1 mov r1, sp - bl CopyString_Limit10 - ldr r0, =gUnknown_02021DC4 + bl StringCopy10 + ldr r0, =gStringVar2 ldrh r2, [r4, 0xC] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy add sp, 0x20 pop {r4} pop {r0} @@ -13255,17 +13255,17 @@ sub_807E7E8: @ 807E7E8 adds r5, r2, r1 movs r1, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 add r4, sp, 0x34 movs r0, 0xFE strb r0, [r4] - ldr r6, =gUnknown_02024744 + ldr r6, =gEnemyParty ldrh r1, [r5, 0xC] movs r3, 0x1 str r3, [sp] @@ -13400,7 +13400,7 @@ _0807E954: movs r1, 0xC bl pokemon_setattr _0807E960: - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty bl pokemon_calc_effective_stats add sp, 0x38 pop {r4-r7} @@ -13437,7 +13437,7 @@ _0807E98E: adds r1, r6, 0 adds r1, 0x2B adds r0, r4, 0 - bl CopyString + bl StringCopy adds r0, r4, 0 movs r1, 0 bl sub_81DB4DC @@ -13466,17 +13466,17 @@ sub_807E9D4: @ 807E9D4 ldrh r0, [r6] movs r5, 0x64 muls r0, r5 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _0807EA08 ldrh r0, [r6] muls r0, r5 adds r0, r4 movs r1, 0xB - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r0, 16 b _0807EA0A @@ -13623,7 +13623,7 @@ _0807EB2C: sub_807EB50: @ 807EB50 push {r4,lr} sub sp, 0x4 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 @@ -13750,14 +13750,14 @@ _0807ED10: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EF6D2 b _0807EDA6 .pool _0807ED2C: movs r0, 0 bl sub_8077288 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -13786,7 +13786,7 @@ _0807ED60: bne _0807ED6A b _0807F03A _0807ED6A: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r2 @@ -13798,7 +13798,7 @@ _0807ED7C: bne _0807ED86 b _0807F03A _0807ED86: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -13813,11 +13813,11 @@ _0807ED98: adds r1, r2, r0 movs r0, 0x32 strb r0, [r1] - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_082C8959 _0807EDA6: adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0 adds r1, r4, 0 movs r2, 0 @@ -13831,7 +13831,7 @@ _0807EDC0: movs r0, 0x15 bl sav12_xor_increment _0807EDCE: - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _0807EDF6 @@ -13852,7 +13852,7 @@ _0807EDCE: _0807EDF6: bl sub_8076D5C bl sub_8153380 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -13884,7 +13884,7 @@ _0807EE38: cmp r1, 0 beq _0807EE5C bl sav2_gender2_inplace_and_xFE - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -13896,7 +13896,7 @@ _0807EE5C: ldr r0, =gUnknown_020322A0 ldr r0, [r0] str r1, [r0, 0x64] - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r2 @@ -13906,7 +13906,7 @@ _0807EE5C: .pool _0807EE78: bl sub_81533E0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -13934,7 +13934,7 @@ _0807EEAC: lsls r0, 24 cmp r0, 0 bne _0807EED4 - bl GenerateRandomNumber + bl Random ldr r4, [r4] lsls r0, 16 lsrs r0, 16 @@ -13950,7 +13950,7 @@ _0807EED4: movs r0, 0 str r0, [r1, 0x64] _0807EEDA: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r2 @@ -13966,7 +13966,7 @@ _0807EEEC: bne _0807EF14 movs r0, 0x1 bl sub_8077288 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -13985,7 +13985,7 @@ _0807EF1A: b _0807F03A _0807EF24: bl sub_8153408 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r2 @@ -14032,7 +14032,7 @@ _0807EF7E: bne _0807F03A movs r0, 0x3 bl play_sound_effect - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -14044,11 +14044,11 @@ _0807EFA4: lsrs r0, 24 cmp r0, 0x1 bne _0807F03A - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _0807EFD8 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r1, [r0, 0x8] ldr r0, =sub_80773AC cmp r1, r0 @@ -14060,7 +14060,7 @@ _0807EFA4: _0807EFD8: bl sub_800AC34 _0807EFDC: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -14071,7 +14071,7 @@ _0807EFE4: b _0807F03A .pool _0807EFF0: - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _0807F028 @@ -14082,7 +14082,7 @@ _0807EFF0: bl sub_8077294 cmp r0, 0 beq _0807F03A - ldr r0, =gUnknown_03002700 + ldr r0, =gSoftResetDisabled movs r1, 0 strb r1, [r0] ldr r0, =c2_080543C4 @@ -14094,7 +14094,7 @@ _0807F028: ldrb r1, [r0] cmp r1, 0 bne _0807F03A - ldr r0, =gUnknown_03002700 + ldr r0, =gSoftResetDisabled strb r1, [r0] ldr r0, =c2_080543C4 bl SetMainCallback2 @@ -14141,13 +14141,13 @@ c2_080543C4: @ 807F068 ldr r0, [r4] bl Free str r5, [r4] - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0 beq _0807F0B6 bl sub_800E084 _0807F0B6: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r0, [r0, 0x8] bl SetMainCallback2 _0807F0BE: @@ -14221,11 +14221,11 @@ _0807F152: lsrs r0, 24 movs r1, 0x64 muls r0, r1 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty adds r0, r1 adds r1, r4, 0 adds r1, 0x43 - bl pokemon_getattr + bl GetMonData adds r0, r5, r0 lsls r0, 24 lsrs r5, r0, 24 @@ -14596,7 +14596,7 @@ _0807F45C: sub_807F464: @ 807F464 push {r4,r5,lr} sub sp, 0x4 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 @@ -14633,10 +14633,10 @@ _0807F4C0: adds r1, r2, r0 movs r0, 0x1 strb r0, [r1] - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_085EF6D2 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0 adds r1, r4, 0 movs r2, 0 @@ -14646,7 +14646,7 @@ _0807F4C0: _0807F4E8: movs r0, 0 bl sub_8077288 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -14660,17 +14660,17 @@ _0807F500: bne _0807F50A b _0807F70C _0807F50A: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r2 movs r5, 0 movs r1, 0x3 strb r1, [r0] - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r1, =gUnknown_082C8959 adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders movs r0, 0 adds r1, r4, 0 movs r2, 0 @@ -14706,7 +14706,7 @@ _0807F570: lsrs r1, r0, 24 cmp r1, 0 beq _0807F590 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -14718,7 +14718,7 @@ _0807F590: ldr r0, =gUnknown_020322A0 ldr r0, [r0] str r1, [r0, 0x64] - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r2 @@ -14728,7 +14728,7 @@ _0807F590: .pool _0807F5AC: bl sub_81533E0 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -14755,7 +14755,7 @@ _0807F5E0: lsls r0, 24 cmp r0, 0 bne _0807F608 - bl GenerateRandomNumber + bl Random ldr r4, [r4] lsls r0, 16 lsrs r0, 16 @@ -14771,7 +14771,7 @@ _0807F608: movs r0, 0 str r0, [r1, 0x64] _0807F60E: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r2 @@ -14787,7 +14787,7 @@ _0807F620: bne _0807F648 movs r0, 0x1 bl sub_8077288 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -14804,7 +14804,7 @@ _0807F64E: cmp r0, 0 beq _0807F70C bl sub_8153408 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r2 @@ -14843,7 +14843,7 @@ _0807F694: movs r2, 0 movs r3, 0x10 bl BeginNormalPaletteFade - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r1, 0x87 lsls r1, 3 adds r0, r1 @@ -14865,7 +14865,7 @@ _0807F6C4: bne _0807F70C movs r0, 0x3 bl sub_8077288 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r2 @@ -14877,7 +14877,7 @@ _0807F6F8: bl sub_8077294 cmp r0, 0 beq _0807F70C - ldr r0, =gUnknown_03002700 + ldr r0, =gSoftResetDisabled movs r1, 0 strb r1, [r0] ldr r0, =c2_080543C4 diff --git a/asm/trader.s b/asm/trader.s index 079aad825..a85f13b3d 100644 --- a/asm/trader.s +++ b/asm/trader.s @@ -8,7 +8,7 @@ thumb_func_start sub_81339F8 sub_81339F8: @ 81339F8 push {r4-r6,lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =0x00002e28 adds r5, r1, r0 @@ -28,7 +28,7 @@ _08133A12: lsls r1, r4, 2 adds r1, r6 ldr r1, [r1] - bl CopyString + bl StringCopy adds r1, r5, 0x1 adds r1, r4 ldr r0, =gUnknown_085B09F4 @@ -53,7 +53,7 @@ _08133A12: thumb_func_start sub_8133A60 sub_8133A60: @ 8133A60 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002e59 adds r0, r1 @@ -77,7 +77,7 @@ sub_8133A78: @ 8133A78 lsls r1, 3 ldr r0, =gTasks + 0x8 adds r7, r1, r0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r4, [r0] ldr r0, =0x00002e28 adds r0, r4 @@ -269,7 +269,7 @@ sub_8133C48: @ 8133C48 push {r4-r7,lr} lsls r0, 24 lsrs r7, r0, 24 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002e28 adds r6, r0, r1 @@ -305,20 +305,20 @@ _08133C90: lsls r4, 24 asrs r4, 24 strh r4, [r0] - ldr r5, =gUnknown_02021CC4 + ldr r5, =gStringVar1 movs r0, 0xB adds r1, r4, 0 muls r1, r0 adds r1, 0x5 adds r1, r6, r1 adds r0, r5, 0 - bl CopyString + bl StringCopy adds r0, r6, 0 adds r0, 0x32 adds r0, r4 ldrb r1, [r0] adds r0, r5, 0 - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString adds r0, r6, 0x1 adds r0, r4 ldrb r1, [r0] @@ -333,7 +333,7 @@ _08133CCA: thumb_func_start sub_8133CD8 sub_8133CD8: @ 8133CD8 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =gUnknown_020375F0 ldr r2, =0x00002e59 @@ -402,7 +402,7 @@ sub_8133D2C: @ 8133D2C negs r1, r1 cmp r0, r1 bne _08133D72 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r1, [r5] lsls r1, 5 adds r1, r4 @@ -446,18 +446,18 @@ sub_8133DA0: @ 8133DA0 adds r0, r1 ldrb r0, [r0] strh r0, [r5] - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldr r1, =gUnknown_020375E0 ldrh r1, [r1] lsls r1, 5 ldr r4, =gUnknown_085A5C09 adds r1, r4 - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 ldrh r1, [r5] lsls r1, 5 adds r1, r4 - bl CopyString + bl StringCopy b _08133E04 .pool _08133DFC: @@ -495,7 +495,7 @@ sub_8133E38: @ 8133E38 push {r4-r6,lr} mov r6, r8 push {r6} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r6, [r0] ldr r0, =0x00002e28 adds r5, r6, r0 @@ -512,10 +512,10 @@ sub_8133E38: @ 8133E38 muls r0, r1 adds r0, 0x5 adds r5, r0 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r0, r5, 0 - bl CopyString + bl StringCopy ldr r2, =0x00002e29 adds r0, r6, r2 ldrh r1, [r4] diff --git a/asm/trainer_card.s b/asm/trainer_card.s index 7a34f9136..e73381ae0 100644 --- a/asm/trainer_card.s +++ b/asm/trainer_card.s @@ -187,7 +187,7 @@ _080C2830: bl sub_80C4630 b _080C28D4 _080C2836: - ldr r0, =gUnknown_030030FC + ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] cmp r0, 0x1 bne _080C2852 @@ -279,7 +279,7 @@ _080C28E4: adds r0, r2 strb r5, [r0] _080C290A: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 @@ -340,7 +340,7 @@ _080C2986: b _080C2ACA .pool _080C299C: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -647,7 +647,7 @@ _080C2C78: sub_80C2C80: @ 80C2C80 push {lr} sub sp, 0x8 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 @@ -679,7 +679,7 @@ _080C2CA8: _080C2CD4: bl sub_80C334C bl sub_80C3414 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -730,7 +730,7 @@ _080C2D50: bl ResetAllObjectData bl ResetObjectPaletteAllocator bl ResetPaletteFade - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -743,7 +743,7 @@ _080C2D6A: .pool _080C2D74: bl sub_80C41D8 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -754,7 +754,7 @@ _080C2D88: b _080C2DBC _080C2D8E: bl sub_80C4330 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -765,7 +765,7 @@ _080C2DA0: b _080C2DC4 _080C2DA6: bl sub_80C3548 - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r0, 0x87 lsls r0, 3 adds r1, r0 @@ -779,7 +779,7 @@ _080C2DBC: cmp r0, 0x1 bne _080C2DDC _080C2DC4: - ldr r1, =gUnknown_030022C0 + ldr r1, =gMain movs r2, 0x87 lsls r2, 3 adds r1, r2 @@ -934,7 +934,7 @@ sub_80C2EC4: @ 80C2EC4 lsls r1, 24 lsrs r1, 24 mov r8, r1 - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r1, [r6] ldrb r0, [r1, 0x8] strb r0, [r5] @@ -993,7 +993,7 @@ _080C2F14: movs r0, 0x15 bl sav12_xor_get_clamped_above strh r0, [r5, 0x20] - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] movs r1, 0x92 lsls r1, 3 @@ -1019,10 +1019,10 @@ _080C2F74: lsrs r2, r0, 24 cmp r2, 0x3 bls _080C2F74 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r0, r7, 0 - bl CopyString + bl StringCopy mov r0, r8 cmp r0, 0x1 beq _080C3004 @@ -1098,7 +1098,7 @@ sub_80C3020: @ 80C3020 adds r1, r4, 0 adds r1, 0x60 strh r0, [r1] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000eba adds r0, r2 @@ -1159,7 +1159,7 @@ sub_80C30A4: @ 80C30A4 lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x3A] - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] ldr r2, =0x00000eba adds r1, r2 @@ -1716,20 +1716,20 @@ sub_80C3574: @ 80C3574 sub sp, 0x2C ldr r1, =gUnknown_085ECF71 add r0, sp, 0xC - bl CopyString + bl StringCopy adds r5, r0, 0 ldr r4, =gUnknown_02039CE8 ldr r1, [r4] ldr r0, =0x00000564 adds r1, r0 adds r0, r5, 0 - bl CopyString + bl StringCopy ldr r0, [r4] ldr r1, =0x00007caa adds r0, r1 ldrb r1, [r0] adds r0, r5, 0 - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString ldr r0, [r4] ldr r1, =0x0000052a adds r0, r1 @@ -1777,7 +1777,7 @@ sub_80C3608: @ 80C3608 sub sp, 0x2C ldr r1, =gUnknown_085ECF78 add r0, sp, 0xC - bl CopyString + bl StringCopy ldr r4, =gUnknown_02039CE8 ldr r1, [r4] ldr r2, =0x00000542 @@ -1785,7 +1785,7 @@ sub_80C3608: @ 80C3608 ldrh r1, [r1] movs r2, 0x2 movs r3, 0x5 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, [r4] ldr r1, =0x0000052a adds r0, r1 @@ -1865,7 +1865,7 @@ _080C36C4: movs r3, 0x39 bl box_print _080C36DE: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r4, =gUnknown_02039CE8 ldr r1, [r4] movs r2, 0xAB @@ -1874,11 +1874,11 @@ _080C36DE: ldr r1, [r1] movs r2, 0 movs r3, 0x6 - bl ConvertIntToDecimalString - ldr r5, =gUnknown_02021FC4 + bl ConvertIntToDecimalStringN + ldr r5, =gStringVar4 ldr r1, =gUnknown_085E969C adds r0, r5, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r0, [r4] ldr r1, =0x0000052b adds r0, r1 @@ -1906,7 +1906,7 @@ _080C3740: movs r0, 0x1 negs r0, r0 str r0, [sp, 0x4] - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 str r0, [sp, 0x8] movs r0, 0x1 movs r1, 0x1 @@ -1981,7 +1981,7 @@ _080C37DC: movs r3, 0x49 bl box_print _080C37F6: - ldr r5, =gUnknown_02021FC4 + ldr r5, =gStringVar4 ldr r4, =gUnknown_02039CE8 ldr r0, [r4] movs r1, 0xA8 @@ -1991,9 +1991,9 @@ _080C37F6: adds r0, r5, 0 movs r2, 0 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r1, =gUnknown_085ECF8E - bl CopyString + bl StringCopy ldr r0, [r4] ldr r1, =0x0000052b adds r0, r1 @@ -2021,7 +2021,7 @@ _080C3854: movs r0, 0x1 negs r0, r0 str r0, [sp, 0x4] - ldr r0, =gUnknown_02021FC4 + ldr r0, =gStringVar4 str r0, [sp, 0x8] movs r0, 0x1 movs r1, 0x1 @@ -2091,7 +2091,7 @@ _080C38E2: b _080C3914 .pool _080C390C: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrh r5, [r0, 0xE] ldrb r6, [r0, 0x10] @@ -2139,13 +2139,13 @@ _080C395C: movs r1, 0 adds r3, r4, 0 bl FillWindowPixelRect - ldr r2, =gUnknown_02021FC4 + ldr r2, =gStringVar4 mov r9, r2 mov r0, r9 adds r1, r5, 0 movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN lsls r2, r7, 24 lsrs r2, 24 ldr r0, =gUnknown_0856FB0C @@ -2183,7 +2183,7 @@ _080C395C: adds r1, r6, 0 movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN lsls r2, r7, 24 lsrs r2, 24 mov r0, r8 @@ -2312,27 +2312,27 @@ sub_80C3AF0: @ 80C3AF0 adds r0, 0x4D ldr r2, =0x00000564 adds r1, r2 - bl CopyString + bl StringCopy ldr r1, [r4] adds r0, r1, 0 adds r0, 0x4D ldr r2, =0x00007caa adds r1, r2 ldrb r1, [r1] - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString ldr r1, [r4] ldr r2, =0x0000052a adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0 beq _080C3B30 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, 0x4D - bl CopyString + bl StringCopy ldr r0, [r4] adds r0, 0x4D ldr r1, =gUnknown_085ECFA6 - bl ExpandStringRefs + bl StringExpandPlaceholders _080C3B30: pop {r4} pop {r0} @@ -2402,33 +2402,33 @@ sub_80C3BC4: @ 80C3BC4 ldrb r0, [r1, 0xB] cmp r0, 0 beq _080C3C0E - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r2, =0x0000053a adds r1, r2 ldrh r1, [r1] movs r2, 0x1 movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r0, =gUnknown_02021DC4 + bl ConvertIntToDecimalStringN + ldr r0, =gStringVar2 ldr r1, [r4] ldr r2, =0x0000053c adds r1, r2 ldrh r1, [r1] movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, =gUnknown_02021EC4 + bl ConvertIntToDecimalStringN + ldr r0, =gStringVar3 ldr r1, [r4] ldr r2, =0x0000053e adds r1, r2 ldrh r1, [r1] movs r2, 0x2 movs r3, 0x2 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, [r4] adds r0, 0x93 ldr r1, =gUnknown_0856FB4C - bl ExpandStringRefs + bl StringExpandPlaceholders _080C3C0E: pop {r4} pop {r0} @@ -2540,7 +2540,7 @@ sub_80C3CF4: @ 80C3CF4 lsls r1, 2 adds r1, r2 ldr r1, [r1] - bl CopyString + bl StringCopy ldr r1, [r4] ldr r2, =0x00000165 adds r0, r1, r2 @@ -2550,7 +2550,7 @@ sub_80C3CF4: @ 80C3CF4 ldrh r1, [r1] movs r2, 0 movs r3, 0x4 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r1, [r4] ldr r2, =0x000001ab adds r0, r1, r2 @@ -2559,7 +2559,7 @@ sub_80C3CF4: @ 80C3CF4 ldrh r1, [r1] movs r2, 0 movs r3, 0x4 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN _080C3D40: pop {r4} pop {r0} @@ -2575,19 +2575,19 @@ sub_80C3D60: @ 80C3D60 ldrb r0, [r1, 0xC] cmp r0, 0 beq _080C3D9A - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r2, =0x00000165 adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 ldr r1, [r5] ldr r2, =0x000001ab adds r1, r2 - bl CopyString - ldr r4, =gUnknown_02021FC4 + bl StringCopy + ldr r4, =gStringVar4 ldr r1, =gUnknown_085ECFED adds r0, r4, 0 - bl ExpandStringRefs + bl StringExpandPlaceholders ldr r1, [r5] adds r1, 0xD9 ldr r3, =gUnknown_0856FB0C @@ -2616,7 +2616,7 @@ sub_80C3DC0: @ 80C3DC0 ldrh r1, [r1] movs r2, 0x1 movs r3, 0x5 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN _080C3DDE: pop {r0} bx r0 @@ -2663,7 +2663,7 @@ sub_80C3E20: @ 80C3E20 adds r0, r2, r3 movs r2, 0x1 movs r3, 0x5 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN _080C3E48: pop {r0} bx r0 @@ -2716,7 +2716,7 @@ sub_80C3E98: @ 80C3E98 adds r0, r2, r3 movs r2, 0x1 movs r3, 0x5 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN _080C3EBE: pop {r0} bx r0 @@ -2765,16 +2765,16 @@ sub_80C3F14: @ 80C3F14 ldrh r0, [r1] cmp r0, 0 beq _080C3F46 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r1, [r1] movs r2, 0x1 movs r3, 0x5 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, [r4] ldr r1, =0x00000395 adds r0, r1 ldr r1, =gUnknown_085ED096 - bl ExpandStringRefs + bl StringExpandPlaceholders _080C3F46: pop {r4} pop {r0} @@ -2830,7 +2830,7 @@ sub_80C3FA4: @ 80C3FA4 ldrh r1, [r2] movs r2, 0x1 movs r3, 0x5 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN _080C3FCE: pop {r0} bx r0 @@ -2884,26 +2884,26 @@ _080C4044: ldrb r0, [r1, 0xD] cmp r0, 0 beq _080C40B6 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r2, =0x0000054c adds r1, r2 ldrh r1, [r1] movs r2, 0x1 movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r0, =gUnknown_02021DC4 + bl ConvertIntToDecimalStringN + ldr r0, =gStringVar2 ldr r1, [r4] ldr r2, =0x0000054e adds r1, r2 ldrh r1, [r1] movs r2, 0x1 movs r3, 0x4 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, [r4] ldr r1, =0x00000421 adds r0, r1 ldr r1, =gUnknown_085ED0E0 - bl ExpandStringRefs + bl StringExpandPlaceholders b _080C40B6 .pool _080C4094: @@ -2912,16 +2912,16 @@ _080C4094: ldrh r0, [r1] cmp r0, 0 beq _080C40B6 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r1, [r1] movs r2, 0x1 movs r3, 0x5 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, [r4] ldr r1, =0x00000421 adds r0, r1 ldr r1, =gUnknown_085ED0C8 - bl ExpandStringRefs + bl StringExpandPlaceholders _080C40B6: pop {r4} pop {r0} @@ -4610,7 +4610,7 @@ sub_80C4EE4: @ 80C4EE4 movs r1, 0 strb r1, [r0] ldr r2, [r4] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x12] strb r0, [r2, 0x6] @@ -4659,7 +4659,7 @@ sub_80C4F50: @ 80C4F50 ldr r1, [r0] cmp r1, 0 bne _080C4F7C - ldr r0, =gUnknown_82E9530 + ldr r0, =gGameVersion ldrb r1, [r0] subs r0, r1, 0x4 lsls r0, 24 @@ -4994,7 +4994,7 @@ _080C5232: adds r5, r2, 0 _080C5240: ldr r1, [r5] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000eb8 adds r0, r2 @@ -5921,7 +5921,7 @@ sub_80C5A48: @ 80C5A48 lsls r0, 24 lsrs r6, r0, 24 movs r5, 0 - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r1, [r2, 0x2C] movs r0, 0x40 ands r0, r1 @@ -6056,7 +6056,7 @@ _080C5B48: adds r0, r6, 0 bl DestroyTask _080C5B5E: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 @@ -6387,14 +6387,14 @@ _080C5DC2: movs r2, 0x5 movs r3, 0x4 bl box_print - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 ldr r5, =gUnknown_02039CEC ldr r0, [r5] ldrh r1, [r0, 0x6] adds r0, r4, 0 movs r2, 0 movs r3, 0x5 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN movs r0, 0x8 adds r1, r4, 0 movs r2, 0x5B @@ -7501,7 +7501,7 @@ _080C6800: bl sub_80C64CC b _080C68C8 _080C6806: - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r2, 0x2 adds r0, r2, 0 @@ -7789,7 +7789,7 @@ sub_80C6974: @ 80C6974 beq _080C6A40 b _080C6B7A _080C6A40: - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r2, [r4] movs r0, 0x5 ldrsb r0, [r2, r0] @@ -7854,7 +7854,7 @@ _080C6AB4: _080C6ACE: ldrh r7, [r1, 0x28] _080C6AD0: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r4, [r0, 0x2A] lsls r0, r7, 16 @@ -7883,7 +7883,7 @@ _080C6AF2: ldm r0!, {r2,r3,r6} stm r1!, {r2,r3,r6} mov r1, sp - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] adds r0, 0x4 @@ -7925,7 +7925,7 @@ _080C6B3E: negs r0, r0 ands r0, r2 strb r0, [r1, 0x5] - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 @@ -8353,7 +8353,7 @@ sub_80C6EAC: @ 80C6EAC str r0, [sp, 0x18] str r1, [sp, 0x1C] ldr r0, [sp, 0x20] - bl GetStringLength_Multibyte + bl StringLength_Multibyte lsls r0, 24 ldr r2, =0x00ffffff ldr r1, [sp, 0x18] diff --git a/asm/trainer_see.s b/asm/trainer_see.s index 3efae71aa..71941b44f 100644 --- a/asm/trainer_see.s +++ b/asm/trainer_see.s @@ -1175,7 +1175,7 @@ sub_80B44C8: @ 80B44C8 adds r0, r4, 0 adds r0, 0xA mov r1, sp - bl sub_806F684 + bl LoadWordFromTwoHalfwords movs r1, 0x16 ldrsh r0, [r4, r1] cmp r0, 0 @@ -1259,7 +1259,7 @@ sub_80B4578: @ 80B4578 adds r0, r1 adds r0, 0x2 adds r1, r4, 0 - bl sub_806F67C + bl StoreWordInTwoHalfwords pop {r4} pop {r0} bx r0 diff --git a/asm/trig.s b/asm/trig.s index b20fa3fb2..2eb9c4e88 100644 --- a/asm/trig.s +++ b/asm/trig.s @@ -5,9 +5,9 @@ .text - thumb_func_start sine + thumb_func_start Sin @ s16 sine(s16 t, s16 amplitude) -sine: @ 806F534 +Sin: @ 806F534 lsls r1, 16 asrs r1, 16 ldr r2, =gUnknown_08329F40 @@ -21,11 +21,11 @@ sine: @ 806F534 asrs r0, 16 bx lr .pool - thumb_func_end sine + thumb_func_end Sin - thumb_func_start cosine + thumb_func_start Cos @ s16 cosine(s16 t, s16 amplitude) -cosine: @ 806F550 +Cos: @ 806F550 lsls r1, 16 asrs r1, 16 ldr r2, =gUnknown_08329F40 @@ -40,11 +40,11 @@ cosine: @ 806F550 asrs r0, 16 bx lr .pool - thumb_func_end cosine + thumb_func_end Cos - thumb_func_start sine2 + thumb_func_start Sin2 @ s16 sine2(u16 angle) -sine2: @ 806F570 +Sin2: @ 806F570 push {r4,r5,lr} adds r5, r0, 0 lsls r5, 16 @@ -77,22 +77,22 @@ _0806F5AC: pop {r4,r5} pop {r1} bx r1 - thumb_func_end sine2 + thumb_func_end Sin2 - thumb_func_start cosine2 + thumb_func_start Cos2 @ s16 cosine2(u16 angle) -cosine2: @ 806F5B4 +Cos2: @ 806F5B4 push {lr} lsls r0, 16 movs r1, 0xB4 lsls r1, 15 adds r0, r1 lsrs r0, 16 - bl sine2 + bl Sin2 lsls r0, 16 asrs r0, 16 pop {r1} bx r1 - thumb_func_end cosine2 + thumb_func_end Cos2 .align 2, 0 @ Don't pad with nop. diff --git a/asm/truck_scene.s b/asm/truck_scene.s index db8458d09..7271ba2e4 100644 --- a/asm/truck_scene.s +++ b/asm/truck_scene.s @@ -65,7 +65,7 @@ sub_80FB0F8: @ 80FB0F8 ldrsh r0, [r5, r1] adds r0, 0x1E bl sub_80FB0DC - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r2, [r4] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] @@ -201,7 +201,7 @@ _080FB20C: ldrsh r0, [r7, r4] adds r0, 0x1E bl sub_80FB0DC - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr ldr r2, [r6] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] @@ -303,7 +303,7 @@ _080FB304: ldrsb r6, [r0, r6] adds r0, r6, 0 bl SetCameraPanning - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r0, [r5] ldrb r1, [r0, 0x5] ldrb r2, [r0, 0x4] @@ -553,7 +553,7 @@ sub_80FB540: @ 80FB540 lsrs r6, r0, 24 cmp r6, 0 bne _080FB58A - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] ldrb r1, [r0, 0x5] ldrb r2, [r0, 0x4] diff --git a/asm/tv.s b/asm/tv.s index 2de4f42ae..d738f8ca5 100644 --- a/asm/tv.s +++ b/asm/tv.s @@ -9,7 +9,7 @@ sub_80EBEE0: @ 80EBEE0 push {r4-r7,lr} movs r3, 0 - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr movs r5, 0 ldr r7, =0x000027ce _080EBEEA: @@ -55,7 +55,7 @@ _080EBF0A: special_0x44: @ 80EBF3C push {r4-r7,lr} movs r4, 0x5 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r0, [r1] movs r2, 0xA2 lsls r2, 6 @@ -81,7 +81,7 @@ _080EBF54: cmp r0, 0 bne _080EBF54 _080EBF70: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r4, 0 @@ -89,7 +89,7 @@ _080EBF70: lsls r0, 24 lsrs r5, r0, 24 adds r7, r5, 0 - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr _080EBF86: ldr r1, [r6] lsls r0, r5, 3 @@ -156,7 +156,7 @@ sub_80EBFF4: @ 80EBFF4 movs r0, 0xFF b _080EC03E _080EC006: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r3, =0x00002b90 adds r0, r2, r3 @@ -199,7 +199,7 @@ UpdateTVScreensOnMap: @ 80EC044 beq _080EC06A cmp r0, 0x2 beq _080EC0BE - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r0, [r0, 0x4] cmp r0, 0xD @@ -332,7 +332,7 @@ TurnOnTVScreen: @ 80EC14C thumb_func_start special_0x45 special_0x45: @ 80EC168 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =gUnknown_020375E0 ldrh r2, [r0] @@ -351,7 +351,7 @@ special_0x45: @ 80EC168 sub_80EC18C: @ 80EC18C push {r4,lr} movs r2, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r3, [r0] _080EC194: lsls r0, r2, 3 @@ -389,7 +389,7 @@ _080EC1CC: thumb_func_start special_0x4a special_0x4a: @ 80EC1D4 push {lr} - ldr r3, =gUnknown_03005D8C + ldr r3, =gSaveBlock1Ptr ldr r2, =gUnknown_020375E0 ldrh r1, [r2] lsls r0, r1, 3 @@ -426,7 +426,7 @@ GabbyAndTyNewGameInitData: @ 80EC21C mov r5, r9 mov r4, r8 push {r4-r6} - ldr r3, =gUnknown_03005D8C + ldr r3, =gSaveBlock1Ptr ldr r2, [r3] ldr r1, =0x00002ba4 adds r0, r2, r1 @@ -540,7 +540,7 @@ GabbyAndTyNewGameInitData: @ 80EC21C thumb_func_start GabbyAndTyBeforeInterview GabbyAndTyBeforeInterview: @ 80EC31C push {r4,lr} - ldr r3, =gUnknown_03005D8C + ldr r3, =gSaveBlock1Ptr ldr r2, [r3] ldr r0, =gUnknown_03005D10 mov r12, r0 @@ -665,7 +665,7 @@ _080EC416: strb r1, [r0] _080EC41E: bl TakeTVShowInSearchOfTrainersOffTheAir - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r4, =0x00002ba8 adds r0, r4 @@ -684,7 +684,7 @@ _080EC436: thumb_func_start GabbyAndTyAfterInterview GabbyAndTyAfterInterview: @ 80EC448 push {r4-r6,lr} - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r2, [r5] ldr r6, =0x00002bae adds r0, r2, r6 @@ -757,7 +757,7 @@ GabbyAndTyAfterInterview: @ 80EC448 thumb_func_start TakeTVShowInSearchOfTrainersOffTheAir TakeTVShowInSearchOfTrainersOffTheAir: @ 80EC4E8 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =0x00002bae adds r1, r0 @@ -773,7 +773,7 @@ TakeTVShowInSearchOfTrainersOffTheAir: @ 80EC4E8 thumb_func_start GabbyAndTyGetBattleNum GabbyAndTyGetBattleNum: @ 80EC504 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r2, =0x00002bad adds r1, r0, r2 @@ -794,7 +794,7 @@ _080EC522: thumb_func_start IsTVShowInSearchOfTrainersAiring IsTVShowInSearchOfTrainersAiring: @ 80EC530 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002bae adds r0, r1 @@ -808,7 +808,7 @@ IsTVShowInSearchOfTrainersAiring: @ 80EC530 thumb_func_start GabbyAndTyGetLastQuote GabbyAndTyGetLastQuote: @ 80EC548 push {r4,r5,lr} - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r0, [r5] ldr r2, =0x00002baa adds r1, r0, r2 @@ -816,7 +816,7 @@ GabbyAndTyGetLastQuote: @ 80EC548 ldr r4, =0x0000ffff cmp r0, r4 beq _080EC584 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r1, [r1] bl CopyEasyChatWord ldr r1, [r5] @@ -840,7 +840,7 @@ _080EC586: thumb_func_start GabbyAndTyGetLastBattleTrivia GabbyAndTyGetLastBattleTrivia: @ 80EC58C push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002baf adds r0, r1 @@ -1055,12 +1055,12 @@ _080EC75E: adds r0, r1 adds r1, r5, 0 adds r1, 0x2A - bl CompareString + bl StringCompare cmp r0, 0 bne _080EC776 b _080EC888 _080EC776: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000027cc adds r0, r1 @@ -1103,7 +1103,7 @@ _080EC7A8: beq _080EC888 _080EC7CA: movs r4, 0 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_030060BC movs r1, 0 ldrsb r1, [r0, r1] @@ -1126,7 +1126,7 @@ _080EC7CA: movs r0, 0x1 adds r3, r6, 0 adds r3, 0x13 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr mov r8, r1 adds r7, r6, 0x4 b _080EC84E @@ -1137,7 +1137,7 @@ _080EC81C: mov r12, r0 adds r3, r6, 0 adds r3, 0x13 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr mov r8, r1 adds r7, r6, 0x4 adds r1, r5, 0 @@ -1165,22 +1165,22 @@ _080EC84E: mov r0, r8 ldr r1, [r0] adds r0, r3, 0 - bl CopyString + bl StringCopy ldr r4, =gUnknown_03005D3A adds r0, r7, 0 adds r1, r4, 0 - bl CopyString + bl StringCopy adds r0, r7, 0 bl sub_81DB604 adds r5, r0, 0 adds r0, r7, 0 - bl StripExtendedControlCodes + bl StripExtCtrlCodes subs r4, 0x2A ldrh r0, [r4, 0x28] strh r0, [r6, 0x10] adds r0, r6, 0 bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r6, 0x2] strb r5, [r6, 0x3] @@ -1196,7 +1196,7 @@ _080EC888: thumb_func_start sub_80EC8A4 sub_80EC8A4: @ 80EC8A4 push {r4,lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =0x00002b2c adds r4, r1, r0 @@ -1268,7 +1268,7 @@ _080EC92E: cmp r0, 0x1 bne _080EC9B4 _080EC940: - ldr r7, =gUnknown_03005D8C + ldr r7, =gSaveBlock1Ptr ldr r0, [r7] ldr r6, =0x000027cc adds r0, r6 @@ -1314,12 +1314,12 @@ _080EC940: strb r0, [r4, 0x12] adds r0, r4, 0 adds r0, 0x13 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy adds r0, r4, 0 bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r4, 0x2] _080EC9B4: @@ -1381,7 +1381,7 @@ sub_80ECA38: @ 80ECA38 push {r4-r7,lr} mov r7, r8 push {r7} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr mov r8, r0 ldr r7, [r0] ldr r1, =0x00002b2c @@ -1404,9 +1404,9 @@ sub_80ECA38: @ 80ECA38 strb r0, [r4, 0x1] adds r0, r4, 0 adds r0, 0x14 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy ldr r0, =gUnknown_02039F2C ldrh r0, [r0] strb r0, [r4, 0x1C] @@ -1414,11 +1414,11 @@ sub_80ECA38: @ 80ECA38 ldrb r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r4, 0x12] ldrh r0, [r6, 0x2] strh r0, [r4, 0x2] @@ -1435,10 +1435,10 @@ sub_80ECA38: @ 80ECA38 adds r0, r4, 0x4 ldr r2, =0x00002b30 adds r1, r7, r2 - bl CopyString + bl StringCopy adds r0, r4, 0 bl sub_80ECA10 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r4, 0x1D] ldrb r0, [r6, 0x1E] @@ -1476,7 +1476,7 @@ sub_80ECB00: @ 80ECB00 lsls r3, 16 lsrs r3, 16 mov r8, r3 - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr ldr r0, [r6] ldr r5, =0x000027cc adds r0, r5 @@ -1508,10 +1508,10 @@ sub_80ECB00: @ 80ECB00 movs r5, 0x1 strb r5, [r4, 0x1] adds r0, r4, 0x4 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString - ldr r0, =gUnknown_02022FEC + bl StringCopy + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x40 ands r0, r1 @@ -1541,16 +1541,16 @@ _080ECBA4: ldr r6, =gUnknown_020229F0 adds r1, r5, r6 mov r0, sp - bl CopyString + bl StringCopy mov r0, sp - bl StripExtendedControlCodes + bl StripExtCtrlCodes adds r0, r4, 0 adds r0, 0xC mov r1, sp - bl CopyString + bl StringCopy adds r0, r4, 0 bl sub_80ECA10 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r4, 0x19] cmp r0, 0x1 @@ -1595,7 +1595,7 @@ sub_80ECC04: @ 80ECC04 lsls r0, 24 lsrs r0, 24 mov r9, r0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr mov r8, r0 ldr r0, [r0] ldr r7, =0x000027cc @@ -1635,17 +1635,17 @@ _080ECC68: strb r7, [r4, 0x1] adds r0, r4, 0 adds r0, 0xC - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy mov r0, sp mov r1, r10 - bl CopyString + bl StringCopy mov r0, sp - bl StripExtendedControlCodes + bl StripExtCtrlCodes adds r0, r4, 0x4 mov r1, sp - bl CopyString + bl StringCopy movs r0, 0x7 ands r5, r0 ldrb r1, [r4, 0x3] @@ -1664,7 +1664,7 @@ _080ECC68: strb r0, [r4, 0x2] adds r0, r4, 0 bl sub_80ECA10 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r4, 0x14] cmp r0, 0x1 @@ -1696,7 +1696,7 @@ _080ECCEE: sub_80ECD00: @ 80ECD00 push {r4-r6,lr} sub sp, 0x20 - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E4 ldrh r1, [r0] lsls r0, r1, 3 @@ -1713,9 +1713,9 @@ sub_80ECD00: @ 80ECD00 lsls r0, 1 strb r0, [r4, 0x16] adds r0, r4, 0x2 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy movs r0, 0xB strb r0, [r4] movs r5, 0x1 @@ -1724,18 +1724,18 @@ sub_80ECD00: @ 80ECD00 strb r0, [r4, 0xA] lsrs r0, 8 strb r0, [r4, 0xB] - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 mov r0, sp - bl CopyString + bl StringCopy mov r0, sp - bl StripExtendedControlCodes + bl StripExtCtrlCodes adds r0, r4, 0 adds r0, 0xC mov r1, sp - bl CopyString + bl StringCopy adds r0, r4, 0 bl sub_80ECA10 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r4, 0x17] cmp r0, 0x1 @@ -1764,7 +1764,7 @@ sub_80ECDA4: @ 80ECDA4 push {r4-r6,lr} lsls r0, 24 lsrs r6, r0, 24 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r0, [r5] ldr r4, =0x000027cc adds r0, r4 @@ -1799,7 +1799,7 @@ sub_80ECDF4: @ 80ECDF4 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002b2c adds r4, r0, r1 @@ -1827,7 +1827,7 @@ sub_80ECE34: @ 80ECE34 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002b2c adds r4, r0, r1 @@ -1855,7 +1855,7 @@ sub_80ECE74: @ 80ECE74 push {r4,r5,lr} lsls r0, 16 lsrs r5, r0, 16 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002b2c adds r4, r0, r1 @@ -1885,7 +1885,7 @@ sub_80ECEB4: @ 80ECEB4 lsrs r7, r0, 24 lsls r1, 24 lsrs r6, r1, 24 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r4, [r0] ldr r0, =0x00002b2c adds r5, r4, r0 @@ -1910,9 +1910,9 @@ sub_80ECEB4: @ 80ECEB4 adds r2, 0xD adds r1, r2 adds r0, r4, 0 - bl CopyString + bl StringCopy adds r0, r4, 0 - bl StripExtendedControlCodes + bl StripExtCtrlCodes strb r7, [r5, 0xC] adds r1, r6, 0x1 ldr r0, =gUnknown_02039F30 @@ -1924,7 +1924,7 @@ sub_80ECEB4: @ 80ECEB4 b _080ECF4A .pool _080ECF30: - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] cmp r0, 0x1 beq _080ECF48 @@ -1950,7 +1950,7 @@ _080ECF4C: thumb_func_start sub_80ECF5C sub_80ECF5C: @ 80ECF5C push {r4-r7,lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r6, [r0] ldr r0, =0x00002b2c adds r5, r6, r0 @@ -1973,14 +1973,14 @@ sub_80ECF5C: @ 80ECF5C strh r0, [r4, 0x2] adds r0, r4, 0 adds r0, 0x16 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy adds r0, r4, 0 adds r0, 0x8 ldr r2, =0x00002b34 adds r1, r6, r2 - bl CopyString + bl StringCopy ldrb r0, [r5, 0x13] lsls r0, 29 lsrs r0, 29 @@ -2017,7 +2017,7 @@ sub_80ECF5C: @ 80ECF5C strb r0, [r4, 0x13] adds r0, r4, 0 bl sub_80ECA10 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r4, 0x1E] cmp r0, 0x1 @@ -2032,7 +2032,7 @@ _080ECFFA: _080ED01C: strb r0, [r4, 0x1F] _080ED01E: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000027cc adds r0, r1 @@ -2050,7 +2050,7 @@ sub_80ED03C: @ 80ED03C push {r4-r6,lr} lsls r0, 16 lsrs r6, r0, 16 - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] ldr r1, =0x00002b2c adds r5, r0, r1 @@ -2089,7 +2089,7 @@ sub_80ED090: @ 80ED090 push {r7} lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r4, [r0] ldr r0, =0x00002b2c adds r7, r4, r0 @@ -2137,11 +2137,11 @@ sub_80ED090: @ 80ED090 ldrb r0, [r0] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r7, 0x2] mov r1, r8 ldrb r0, [r1] @@ -2151,15 +2151,15 @@ sub_80ED090: @ 80ED090 adds r4, r1 movs r1, 0x2 adds r2, r4, 0 - bl pokemon_getattr + bl GetMonData adds r0, r4, 0 - bl StripExtendedControlCodes + bl StripExtCtrlCodes mov r1, r8 ldrb r0, [r1] muls r0, r6 adds r0, r5 movs r1, 0x3 - bl pokemon_getattr + bl GetMonData strb r0, [r7, 0x1F] _080ED134: pop {r3} @@ -2173,7 +2173,7 @@ _080ED134: thumb_func_start sub_80ED164 sub_80ED164: @ 80ED164 push {r4-r6,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_030060BC movs r1, 0 ldrsb r1, [r0, r1] @@ -2189,15 +2189,15 @@ sub_80ED164: @ 80ED164 movs r0, 0x1 strb r0, [r6, 0x1] adds r0, r6, 0x2 - ldr r4, =gUnknown_03005D90 + ldr r4, =gSaveBlock2Ptr ldr r1, [r4] - bl CopyString + bl StringCopy adds r0, r6, 0 adds r0, 0xC ldr r1, [r4] ldr r2, =0x00000bd8 adds r1, r2 - bl CopyString + bl StringCopy ldr r1, [r4] ldr r2, =0x00000bd4 adds r0, r1, r2 @@ -2235,12 +2235,12 @@ _080ED1F6: strb r0, [r6, 0x1B] adds r0, r6, 0 bl sub_80ECA10 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r6, 0x1D] cmp r0, 0x1 beq _080ED21C - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r2, =0x00000beb adds r0, r2 @@ -2261,7 +2261,7 @@ _080ED21E: @ void SaveRecordedItemPurchasesForTVShow() SaveRecordedItemPurchasesForTVShow: @ 80ED238 push {r4-r7,lr} - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r0, [r5] ldrh r1, [r0, 0x4] ldr r0, =0x00003c1a @@ -2339,12 +2339,12 @@ _080ED2B6: strb r0, [r5, 0x2] adds r0, r5, 0 adds r0, 0x13 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy adds r0, r5, 0 bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r5, 0x3] _080ED2F2: @@ -2370,27 +2370,27 @@ sub_80ED320: @ 80ED320 ldrh r0, [r0] movs r7, 0x64 muls r0, r7 - ldr r6, =gUnknown_020244EC + ldr r6, =gPlayerParty adds r0, r6 - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 movs r1, 0x2 adds r2, r4, 0 - bl pokemon_getattr - ldr r1, =gUnknown_03005D90 + bl GetMonData + ldr r1, =gSaveBlock2Ptr mov r9, r1 ldr r0, [r1] - bl GetStringLength + bl StringLength lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 bls _080ED400 adds r0, r4, 0 - bl GetStringLength + bl StringLength lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 bls _080ED400 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_030060BC movs r1, 0 ldrsb r1, [r0, r1] @@ -2411,15 +2411,15 @@ sub_80ED320: @ 80ED320 adds r0, r6 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r4, 0x2] - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 bl __umodsi3 strb r0, [r4, 0x1A] - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 ands r0, r5 @@ -2431,7 +2431,7 @@ sub_80ED320: @ 80ED320 adds r0, 0xF mov r2, r9 ldr r1, [r2] - bl CopyString + bl StringCopy mov r1, r8 ldrh r0, [r1] muls r0, r7 @@ -2439,12 +2439,12 @@ sub_80ED320: @ 80ED320 adds r5, r4, 0x4 movs r1, 0x2 adds r2, r5, 0 - bl pokemon_getattr + bl GetMonData adds r0, r5, 0 - bl StripExtendedControlCodes + bl StripExtCtrlCodes adds r0, r4, 0 bl sub_80ECA10 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r4, 0x1E] mov r2, r8 @@ -2452,7 +2452,7 @@ sub_80ED320: @ 80ED320 muls r0, r7 adds r0, r6 movs r1, 0x3 - bl pokemon_getattr + bl GetMonData strb r0, [r4, 0x1F] _080ED400: pop {r3,r4} @@ -2467,7 +2467,7 @@ _080ED400: thumb_func_start StartMassOutbreak StartMassOutbreak: @ 80ED430 push {r4,r5,lr} - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r0, [r0] lsls r1, r0, 3 @@ -2549,7 +2549,7 @@ sub_80ED4DC: @ 80ED4DC ldrh r0, [r0] cmp r0, 0x1 beq _080ED532 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_030060BC movs r1, 0 ldrsb r1, [r0, r1] @@ -2590,7 +2590,7 @@ _080ED532: thumb_func_start sub_80ED548 sub_80ED548: @ 80ED548 push {r4,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_030060BC movs r1, 0 ldrsb r1, [r0, r1] @@ -2606,23 +2606,23 @@ sub_80ED548: @ 80ED548 strb r0, [r4, 0x1] adds r0, r4, 0 adds r0, 0x10 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy bl sub_8139688 lsls r0, 24 lsrs r0, 24 movs r1, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r4, 0x2] adds r0, r4, 0 bl sub_80ECA10 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r4, 0x18] pop {r4} @@ -2634,7 +2634,7 @@ sub_80ED548: @ 80ED548 thumb_func_start sub_80ED5B8 sub_80ED5B8: @ 80ED5B8 push {r4,r5,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_030060BC movs r1, 0 ldrsb r1, [r0, r1] @@ -2652,13 +2652,13 @@ sub_80ED5B8: @ 80ED5B8 strb r0, [r4, 0x1] adds r0, r4, 0 adds r0, 0x10 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy strh r5, [r4, 0x2] adds r0, r4, 0 bl sub_80ECA10 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r4, 0x18] pop {r4,r5} @@ -2672,7 +2672,7 @@ sub_80ED610: @ 80ED610 push {r4-r7,lr} mov r7, r8 push {r7} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_030060BC movs r1, 0 ldrsb r1, [r0, r1] @@ -2694,11 +2694,11 @@ sub_80ED610: @ 80ED610 lsrs r0, 24 movs r7, 0x64 muls r0, r7 - ldr r6, =gUnknown_020244EC + ldr r6, =gPlayerParty adds r0, r6 movs r1, 0x20 movs r2, 0 - bl pokemon_getattr + bl GetMonData lsrs r0, 4 movs r1, 0xF ands r0, r1 @@ -2716,9 +2716,9 @@ sub_80ED610: @ 80ED610 orrs r1, r0 strb r1, [r5, 0x4] adds r0, r5, 0x5 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy bl sub_8139688 lsls r0, 24 lsrs r0, 24 @@ -2728,9 +2728,9 @@ sub_80ED610: @ 80ED610 adds r4, 0x10 movs r1, 0x2 adds r2, r4, 0 - bl pokemon_getattr + bl GetMonData adds r0, r4, 0 - bl StripExtendedControlCodes + bl StripExtCtrlCodes bl sub_8139688 lsls r0, 24 lsrs r0, 24 @@ -2738,11 +2738,11 @@ sub_80ED610: @ 80ED610 adds r0, r6 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r5, 0x2] adds r0, r5, 0 bl sub_80ECA10 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r5, 0xD] cmp r0, 0x1 @@ -2753,7 +2753,7 @@ sub_80ED610: @ 80ED610 muls r0, r7 adds r0, r6 movs r1, 0x3 - bl pokemon_getattr + bl GetMonData cmp r0, 0x1 bne _080ED6F4 _080ED6D4: @@ -2767,7 +2767,7 @@ _080ED6F4: muls r0, r7 adds r0, r6 movs r1, 0x3 - bl pokemon_getattr + bl GetMonData _080ED706: strb r0, [r5, 0xE] pop {r3} @@ -2791,7 +2791,7 @@ sub_80ED718: @ 80ED718 cmp r0, 0 beq _080ED7E4 movs r1, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r3, =0x000027cc _080ED72E: @@ -2814,7 +2814,7 @@ _080ED72E: lsrs r5, r0, 24 cmp r5, 0 bne _080ED7E4 - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr ldr r0, [r6] ldr r1, =0x000027cc adds r0, r1 @@ -2827,7 +2827,7 @@ _080ED72E: negs r1, r1 cmp r0, r1 beq _080ED7E4 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x5 @@ -2878,7 +2878,7 @@ _080ED72E: strh r3, [r4, 0x16] adds r0, r4, 0 bl sub_80ECA10 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r4, 0x18] _080ED7E4: @@ -2891,7 +2891,7 @@ _080ED7E4: thumb_func_start EndMassOutbreak EndMassOutbreak: @ 80ED808 push {r4,r5,lr} - ldr r3, =gUnknown_03005D8C + ldr r3, =gSaveBlock1Ptr ldr r0, [r3] ldr r2, =0x00002b90 adds r1, r0, r2 @@ -2972,7 +2972,7 @@ sub_80ED8B4: @ 80ED8B4 push {r4-r7,lr} lsls r0, 16 lsrs r5, r0, 16 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r0, [r1] ldr r2, =0x00002b90 adds r0, r2 @@ -3028,7 +3028,7 @@ UpdateMassOutbreakTimeLeft: @ 80ED924 push {lr} lsls r0, 16 lsrs r2, r0, 16 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r3, =0x00002ba2 adds r1, r0, r3 @@ -3096,7 +3096,7 @@ _080ED99C: thumb_func_start sub_80ED9A8 sub_80ED9A8: @ 80ED9A8 push {r4-r6,lr} - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr ldr r0, [r6] ldr r5, =0x000027cc adds r0, r5 @@ -3139,12 +3139,12 @@ sub_80ED9A8: @ 80ED9A8 strh r0, [r4, 0x4] adds r0, r4, 0 adds r0, 0x13 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy adds r0, r4, 0 bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r4, 0x6] _080EDA18: @@ -3165,7 +3165,7 @@ sub_80EDA3C: @ 80EDA3C thumb_func_start sub_80EDA48 sub_80EDA48: @ 80EDA48 push {r4,lr} - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] ldr r2, =0x00002b2c adds r1, r0, r2 @@ -3194,7 +3194,7 @@ sub_80EDA80: @ 80EDA80 push {r4-r7,lr} mov r7, r8 push {r7} - ldr r7, =gUnknown_03005D8C + ldr r7, =gSaveBlock1Ptr ldr r0, [r7] ldr r1, =0x00002b2c adds r5, r0, r1 @@ -3250,12 +3250,12 @@ sub_80EDA80: @ 80EDA80 strb r0, [r4, 0xA] adds r0, r4, 0 adds r0, 0x13 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy adds r0, r4, 0 bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r4, 0xB] ldr r0, [r7] @@ -3277,7 +3277,7 @@ sub_80EDB44: @ 80EDB44 movs r0, 0x1A movs r1, 0x1 bl sub_80EF46C - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] ldr r1, =0x000027cc adds r0, r1 @@ -3373,17 +3373,17 @@ _080EDC1C: adds r6, 0x1 cmp r6, 0x6 bls _080EDBEA - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r1, [r0] ldr r2, =0x00000eb8 adds r0, r1, r2 ldrh r0, [r0] strh r0, [r4, 0x8] adds r0, r7, 0 - bl CopyString + bl StringCopy adds r0, r4, 0 bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r4, 0xC] _080EDC40: @@ -3397,7 +3397,7 @@ _080EDC40: sub_80EDC60: @ 80EDC60 push {r4-r7,lr} adds r5, r0, 0 - ldr r7, =gUnknown_03005D8C + ldr r7, =gSaveBlock1Ptr ldr r0, [r7] ldr r6, =0x000027cc adds r0, r6 @@ -3429,7 +3429,7 @@ sub_80EDC60: @ 80EDC60 movs r0, 0x1B strb r0, [r4] strb r1, [r4, 0x1] - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r0, [r1] ldrb r0, [r0, 0x8] strb r0, [r4, 0x8] @@ -3440,10 +3440,10 @@ sub_80EDC60: @ 80EDC60 adds r0, r4, 0 adds r0, 0x13 ldr r1, [r1] - bl CopyString + bl StringCopy adds r0, r4, 0 bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r4, 0x9] _080EDCCE: @@ -3456,7 +3456,7 @@ _080EDCCE: thumb_func_start sub_80EDCE8 sub_80EDCE8: @ 80EDCE8 push {r4-r6,lr} - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr ldr r0, [r6] ldr r5, =0x000027cc adds r0, r5 @@ -3498,12 +3498,12 @@ sub_80EDCE8: @ 80EDCE8 strh r0, [r4, 0x6] adds r0, r4, 0 adds r0, 0x13 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy adds r0, r4, 0 bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r4, 0x5] _080EDD56: @@ -3518,7 +3518,7 @@ sub_80EDD78: @ 80EDD78 push {r4-r6,lr} lsls r0, 16 lsrs r4, r0, 16 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000027cc adds r0, r1 @@ -3588,7 +3588,7 @@ _080EDE0C: _080EDE12: lsls r0, 16 lsrs r3, r0, 16 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_030060BC movs r1, 0 ldrsb r1, [r0, r1] @@ -3609,12 +3609,12 @@ _080EDE12: strb r5, [r4, 0x2] adds r0, r4, 0 adds r0, 0x13 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy adds r0, r4, 0 bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r4, 0x8] _080EDE54: @@ -3655,7 +3655,7 @@ sub_80EDE98: @ 80EDE98 mov r8, r0 movs r3, 0 ldr r6, =gUnknown_030060D0 - ldr r7, =gUnknown_03005D8C + ldr r7, =gSaveBlock1Ptr adds r2, r6, 0 movs r1, 0 _080EDEAC: @@ -3736,14 +3736,14 @@ _080EDF34: ldr r0, =gUnknown_030060D0 mov r9, r0 _080EDF42: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r5, 0 bl __modsi3 lsls r0, 24 lsrs r4, r0, 24 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r5, 0 @@ -3810,21 +3810,21 @@ _080EDFCA: movs r0, 0x64 adds r1, r7, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _080EE094 adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _080EE094 adds r0, r4, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData ldr r2, =gUnknown_030060E0 mov r3, r9 lsls r1, r3, 3 @@ -3832,12 +3832,12 @@ _080EDFCA: strb r0, [r6] adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData strh r0, [r6, 0x2] movs r5, 0 adds r0, r4, 0 movs r1, 0xD - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0 @@ -3848,7 +3848,7 @@ _080EDFCA: _080EE020: adds r0, r4, 0 movs r1, 0xE - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0 @@ -3862,7 +3862,7 @@ _080EE020: _080EE03C: adds r0, r4, 0 movs r1, 0xF - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0 @@ -3876,7 +3876,7 @@ _080EE03C: _080EE058: adds r0, r4, 0 movs r1, 0x10 - bl pokemon_getattr + bl GetMonData lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0 @@ -3888,7 +3888,7 @@ _080EE058: lsls r0, 24 lsrs r5, r0, 24 _080EE074: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r5, 0 @@ -3931,7 +3931,7 @@ _080EE0BE: bl __divsi3 mov r1, r10 strb r0, [r1, 0x2] - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 mov r1, r9 @@ -3961,7 +3961,7 @@ sub_80EE104: @ 80EE104 movs r0, 0x1F movs r1, 0x1 bl sub_80EF46C - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] ldr r1, =0x000027cc adds r0, r1 @@ -3989,16 +3989,16 @@ sub_80EE104: @ 80EE104 strb r1, [r4, 0x1] adds r0, r4, 0 adds r0, 0x13 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy adds r0, r4, 0 bl sub_80EDE98 adds r0, r4, 0 bl sub_80EDFB4 adds r0, r4, 0 bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r4, 0xC] _080EE168: @@ -4011,7 +4011,7 @@ _080EE168: thumb_func_start sub_80EE184 sub_80EE184: @ 80EE184 push {r4-r7,lr} - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr ldr r0, [r6] ldr r5, =0x000027cc adds r0, r5 @@ -4050,7 +4050,7 @@ _080EE1B6: movs r5, 0 ldr r6, =gUnknown_03005D10 ldr r3, =gUnknown_02037318 - ldr r7, =gUnknown_03005D90 + ldr r7, =gSaveBlock2Ptr adds r2, r6, 0 adds r2, 0x36 _080EE1DA: @@ -4078,7 +4078,7 @@ _080EE1FE: adds r0, r4, 0 adds r0, 0x13 ldr r1, [r7] - bl CopyString + bl StringCopy ldrh r0, [r6, 0x6] strh r0, [r4, 0xA] ldr r0, =gUnknown_0202433A @@ -4153,7 +4153,7 @@ _080EE2B2: _080EE2B6: adds r0, r4, 0 bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r4, 0xE] _080EE2C2: @@ -4166,7 +4166,7 @@ _080EE2C2: thumb_func_start sub_80EE2CC sub_80EE2CC: @ 80EE2CC push {r4-r6,lr} - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr ldr r0, [r6] ldr r5, =0x000027cc adds r0, r5 @@ -4200,9 +4200,9 @@ sub_80EE2CC: @ 80EE2CC strb r1, [r4, 0x1] adds r0, r4, 0 adds r0, 0x13 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy ldr r0, =gUnknown_020375E0 ldrb r1, [r0] movs r0, 0x4 @@ -4213,7 +4213,7 @@ sub_80EE2CC: @ 80EE2CC strh r0, [r4, 0x2] adds r0, r4, 0 bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r4, 0x5] _080EE33A: @@ -4244,7 +4244,7 @@ sub_80EE35C: @ 80EE35C lsls r3, 16 lsrs r3, 16 str r3, [sp] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr mov r8, r0 ldr r0, [r0] ldr r5, =0x000027cc @@ -4280,9 +4280,9 @@ sub_80EE35C: @ 80EE35C strb r1, [r4, 0x1] adds r0, r4, 0 adds r0, 0x13 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy mov r0, r10 strh r0, [r4, 0x4] mov r1, r9 @@ -4321,7 +4321,7 @@ _080EE408: strh r2, [r4, 0xE] adds r0, r4, 0 bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r4, 0x11] _080EE426: @@ -4346,7 +4346,7 @@ sub_80EE44C: @ 80EE44C mov r8, r0 lsls r1, 24 lsrs r7, r1, 24 - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr ldr r0, [r6] ldr r5, =0x000027cc adds r0, r5 @@ -4380,15 +4380,15 @@ sub_80EE44C: @ 80EE44C strb r1, [r4, 0x1] adds r0, r4, 0 adds r0, 0x13 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy mov r0, r8 strb r0, [r4, 0x2] strb r7, [r4, 0x3] adds r0, r4, 0 bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r4, 0x4] _080EE4BE: @@ -4409,7 +4409,7 @@ sub_80EE4DC: @ 80EE4DC lsls r1, 24 lsrs r1, 24 mov r8, r1 - ldr r7, =gUnknown_03005D8C + ldr r7, =gSaveBlock1Ptr ldr r0, [r7] ldr r5, =0x000027cc adds r0, r5 @@ -4443,16 +4443,16 @@ sub_80EE4DC: @ 80EE4DC strb r1, [r5, 0x1] adds r0, r5, 0 adds r0, 0x13 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy adds r4, r5, 0x4 adds r0, r6, 0 movs r1, 0x2 adds r2, r4, 0 - bl pokemon_getattr + bl GetMonData adds r0, r4, 0 - bl StripExtendedControlCodes + bl StripExtCtrlCodes adds r0, r6, 0 bl sub_80EE5A4 strb r0, [r5, 0x2] @@ -4461,14 +4461,14 @@ sub_80EE4DC: @ 80EE4DC strb r0, [r5, 0x3] adds r0, r5, 0 bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r5, 0xF] cmp r0, 0x1 beq _080EE578 adds r0, r6, 0 movs r1, 0x3 - bl pokemon_getattr + bl GetMonData cmp r0, 0x1 bne _080EE590 _080EE578: @@ -4478,7 +4478,7 @@ _080EE578: _080EE590: adds r0, r6, 0 movs r1, 0x3 - bl pokemon_getattr + bl GetMonData _080EE598: strb r0, [r5, 0x10] _080EE59A: @@ -4494,103 +4494,103 @@ sub_80EE5A4: @ 80EE5A4 push {r4,r5,lr} adds r5, r0, 0 movs r1, 0x32 - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 movs r1, 0x33 - bl pokemon_getattr + bl GetMonData adds r4, r0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 movs r1, 0x34 - bl pokemon_getattr + bl GetMonData adds r4, r0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 movs r1, 0x35 - bl pokemon_getattr + bl GetMonData adds r4, r0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 movs r1, 0x36 - bl pokemon_getattr + bl GetMonData adds r4, r0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 movs r1, 0x43 - bl pokemon_getattr + bl GetMonData adds r4, r0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 movs r1, 0x44 - bl pokemon_getattr + bl GetMonData adds r4, r0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 movs r1, 0x45 - bl pokemon_getattr + bl GetMonData adds r4, r0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 movs r1, 0x46 - bl pokemon_getattr + bl GetMonData adds r4, r0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 movs r1, 0x47 - bl pokemon_getattr + bl GetMonData adds r4, r0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 movs r1, 0x48 - bl pokemon_getattr + bl GetMonData adds r4, r0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 movs r1, 0x49 - bl pokemon_getattr + bl GetMonData adds r4, r0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 movs r1, 0x4A - bl pokemon_getattr + bl GetMonData adds r4, r0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 movs r1, 0x4B - bl pokemon_getattr + bl GetMonData adds r4, r0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 movs r1, 0x4C - bl pokemon_getattr + bl GetMonData adds r4, r0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 movs r1, 0x4D - bl pokemon_getattr + bl GetMonData adds r4, r0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 movs r1, 0x4E - bl pokemon_getattr + bl GetMonData adds r4, r0 lsls r4, 24 lsrs r4, 24 @@ -4697,7 +4697,7 @@ _080EE728: thumb_func_start sub_80EE72C sub_80EE72C: @ 80EE72C push {r4-r6,lr} - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r0, [r5] ldr r6, =0x000027cc adds r0, r6 @@ -4731,9 +4731,9 @@ sub_80EE72C: @ 80EE72C strb r1, [r4, 0x1] adds r0, r4, 0 adds r0, 0x13 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy ldr r0, [r5] ldr r2, =0x00002bb0 adds r1, r0, r2 @@ -4745,7 +4745,7 @@ sub_80EE72C: @ 80EE72C strh r0, [r4, 0x6] adds r0, r4, 0 bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r4, 0x8] _080EE79C: @@ -4758,7 +4758,7 @@ _080EE79C: thumb_func_start sub_80EE7C0 sub_80EE7C0: @ 80EE7C0 push {r4,lr} - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] ldr r1, =0x000027cc adds r0, r1 @@ -4804,7 +4804,7 @@ sub_80EE818: @ 80EE818 lsrs r0, 24 cmp r0, 0x1 bne _080EE870 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000027cc adds r7, r0, r1 @@ -4841,7 +4841,7 @@ _080EE866: cmp r6, 0x17 bls _080EE83C _080EE870: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000027cc adds r0, r1 @@ -4858,7 +4858,7 @@ _080EE870: b _080EE8C2 .pool _080EE89C: - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r0, [r5] ldr r4, =0x000027cc adds r0, r4 @@ -4887,7 +4887,7 @@ sub_80EE8C8: @ 80EE8C8 lsrs r6, r0, 16 lsls r1, 24 lsrs r4, r1, 24 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r0, [r5] ldr r1, =0x000027cc adds r0, r1 @@ -4917,9 +4917,9 @@ _080EE8F4: strb r1, [r7, 0x1] adds r0, r7, 0 adds r0, 0x13 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy strh r6, [r7, 0x2] strb r4, [r7, 0xD] subs r0, r4, 0x1 @@ -4949,69 +4949,69 @@ _080EE944: .4byte _080EE978 .4byte _080EE978 _080EE978: - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r7, 0x4] adds r0, r4, 0 adds r0, 0x64 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r7, 0x6] adds r4, 0xC8 adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r7, 0x8] b _080EEA46 .pool _080EE9A8: - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r7, 0x4] adds r0, r4, 0 adds r0, 0x64 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r7, 0x6] adds r0, r4, 0 adds r0, 0xC8 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r7, 0x8] movs r1, 0x96 lsls r1, 1 adds r0, r4, r1 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r7, 0xA] b _080EEA46 .pool _080EE9E8: - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r7, 0x4] adds r4, 0x64 adds r0, r4, 0 b _080EEA3C .pool _080EEA00: - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr mov r8, r2 - ldr r6, =gUnknown_03005D90 + ldr r6, =gSaveBlock2Ptr ldr r0, [r6] ldr r1, =0x00000caa adds r0, r1 @@ -5026,7 +5026,7 @@ _080EEA00: adds r0, r1 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r7, 0x4] ldr r0, [r6] ldr r2, =0x00000cac @@ -5041,12 +5041,12 @@ _080EEA00: _080EEA3C: movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData strh r0, [r7, 0x6] _080EEA46: adds r0, r7, 0 bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r7, 0xC] _080EEA52: @@ -5071,7 +5071,7 @@ sub_80EEA70: @ 80EEA70 bne _080EEA86 b _080EEB8C _080EEA86: - ldr r7, =gUnknown_03005D8C + ldr r7, =gSaveBlock1Ptr ldr r0, [r7] ldr r1, =0x000027cc adds r0, r1 @@ -5099,21 +5099,21 @@ _080EEA86: strb r1, [r5, 0x1] adds r0, r5, 0 adds r0, 0x13 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy ldr r0, =0x000040ec bl VarGet strh r0, [r5, 0x2] bl sub_80E980C - ldr r1, =gUnknown_02021CC4 + ldr r1, =gStringVar1 mov r0, sp - bl CopyString + bl StringCopy mov r0, sp - bl StripExtendedControlCodes + bl StripExtCtrlCodes adds r0, r5, 0x4 mov r1, sp - bl CopyString + bl StringCopy ldr r0, =0x000040ed bl VarGet strh r0, [r5, 0x10] @@ -5129,7 +5129,7 @@ _080EEA86: str r4, [r5, 0xC] adds r0, r5, 0 bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r5, 0x1B] cmp r0, 0x1 @@ -5231,7 +5231,7 @@ sub_80EEBF4: @ 80EEBF4 movs r0, 0x25 movs r1, 0x1 bl sub_80EF46C - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] ldr r1, =0x000027cc adds r0, r1 @@ -5259,9 +5259,9 @@ sub_80EEBF4: @ 80EEBF4 strb r1, [r4, 0x1] adds r0, r4, 0 adds r0, 0x13 - ldr r1, =gUnknown_03005D90 + ldr r1, =gSaveBlock2Ptr ldr r1, [r1] - bl CopyString + bl StringCopy strb r5, [r4, 0x4] ldr r1, =gUnknown_0858D0EC lsls r0, r5, 2 @@ -5271,7 +5271,7 @@ sub_80EEBF4: @ 80EEBF4 strh r0, [r4, 0x2] adds r0, r4, 0 bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 + ldr r0, =gGameLanguage ldrb r0, [r0] strb r0, [r4, 0x5] _080EEC60: @@ -5420,7 +5420,7 @@ sub_80EED88: @ 80EED88 lsls r0, 24 cmp r0, 0 beq _080EEE0C - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr ldr r0, [r6] ldr r7, =0x00002b50 adds r0, r7 @@ -5439,7 +5439,7 @@ sub_80EED88: @ 80EED88 lsrs r0, 24 cmp r0, 0x1 beq _080EEE0C - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -5532,7 +5532,7 @@ _080EEE60: sub_80EEE78: @ 80EEE78 push {r4,lr} lsls r0, 24 - ldr r3, =gUnknown_03005D8C + ldr r3, =gSaveBlock1Ptr ldr r1, [r3] lsrs r0, 22 adds r1, r0 @@ -5560,9 +5560,9 @@ sub_80EEE78: @ 80EEE78 sub_80EEEB8: @ 80EEEB8 push {r4-r7,lr} movs r2, 0 - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr _080EEEBE: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] lsls r1, r2, 2 adds r0, r1 @@ -5614,7 +5614,7 @@ _080EEF12: sub_80EEF20: @ 80EEF20 push {r4,lr} movs r2, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r3, [r0] _080EEF28: lsls r0, r2, 2 @@ -5663,7 +5663,7 @@ sub_80EEF6C: @ 80EEF6C b _080EF01A .pool _080EEF84: - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r0, [r5] lsls r4, r2, 2 adds r1, r0, r4 @@ -5704,10 +5704,10 @@ _080EEFD0: .pool _080EEFE8: ldrh r1, [r2] - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 movs r2, 0 movs r3, 0x1 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN ldr r0, [r5] adds r0, r4 ldr r1, =0x00002b51 @@ -5748,7 +5748,7 @@ _080EF044: b _080EF08C _080EF048: movs r2, 0 - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr _080EF04C: ldr r1, [r4] lsls r0, r2, 2 @@ -5797,7 +5797,7 @@ _080EF0A2: movs r0, 0x1 b _080EF0D6 _080EF0A6: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0, 0x4] movs r0, 0x80 @@ -5811,7 +5811,7 @@ _080EF0A6: b _080EF0D4 .pool _080EF0C8: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0, 0x4] ldr r0, =0x0000150d @@ -5837,7 +5837,7 @@ _080EF0EE: b _080EF112 _080EF0F2: movs r1, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r3, [r0] ldr r4, =0x00002b50 _080EF0FA: @@ -5868,7 +5868,7 @@ sub_80EF120: @ 80EF120 lsls r0, 16 lsrs r7, r0, 16 movs r6, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr mov r8, r0 _080EF130: mov r1, r8 @@ -5959,7 +5959,7 @@ _080EF1E0: ldr r0, [r0] ldr r1, =gUnknown_0858BAF0 ldr r1, [r1, 0x14] - bl CopyString + bl StringCopy b _080EF244 .pool _080EF1FC: @@ -5969,7 +5969,7 @@ _080EF1FC: ldr r0, [r0] ldr r1, =gUnknown_0858BAF0 ldr r1, [r1, 0x18] - bl CopyString + bl StringCopy b _080EF244 .pool _080EF218: @@ -5979,7 +5979,7 @@ _080EF218: ldr r0, [r0] ldr r1, =gUnknown_0858BAF0 ldr r1, [r1, 0x1C] - bl CopyString + bl StringCopy b _080EF244 .pool _080EF234: @@ -5989,7 +5989,7 @@ _080EF234: ldr r0, [r0] ldr r1, =gUnknown_0858BAF0 ldr r1, [r1, 0x20] - bl CopyString + bl StringCopy _080EF244: pop {r0} bx r0 @@ -6026,7 +6026,7 @@ _080EF280: ldr r0, [r0] ldr r1, =gUnknown_0858BAF0 ldr r1, [r1] - bl CopyString + bl StringCopy b _080EF300 .pool _080EF29C: @@ -6036,7 +6036,7 @@ _080EF29C: ldr r0, [r0] ldr r1, =gUnknown_0858BAF0 ldr r1, [r1, 0x4] - bl CopyString + bl StringCopy b _080EF300 .pool _080EF2B8: @@ -6046,7 +6046,7 @@ _080EF2B8: ldr r0, [r0] ldr r1, =gUnknown_0858BAF0 ldr r1, [r1, 0x8] - bl CopyString + bl StringCopy b _080EF300 .pool _080EF2D4: @@ -6056,7 +6056,7 @@ _080EF2D4: ldr r0, [r0] ldr r1, =gUnknown_0858BAF0 ldr r1, [r1, 0xC] - bl CopyString + bl StringCopy b _080EF300 .pool _080EF2F0: @@ -6066,7 +6066,7 @@ _080EF2F0: ldr r0, [r0] ldr r1, =gUnknown_0858BAF0 ldr r1, [r1, 0x10] - bl CopyString + bl StringCopy _080EF300: pop {r0} bx r0 @@ -6077,7 +6077,7 @@ _080EF300: @ void SetContestCategoryStringVarForInterview() SetContestCategoryStringVarForInterview: @ 80EF30C push {lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -6115,7 +6115,7 @@ sub_80EF340: @ 80EF340 lsrs r3, 24 adds r1, r5, 0 movs r2, 0 - bl ConvertIntToDecimalString + bl ConvertIntToDecimalStringN pop {r4,r5} pop {r0} bx r0 @@ -6265,7 +6265,7 @@ sub_80EF46C: @ 80EF46C lsls r1, 24 lsrs r1, 24 mov r9, r1 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r0, [r5] ldr r4, =0x000027cc adds r0, r4 @@ -6379,7 +6379,7 @@ sub_80EF550: @ 80EF550 lsls r0, 24 lsrs r6, r0, 24 movs r1, 0 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r4, =0x000027cc _080EF55C: ldr r3, [r5] @@ -6494,24 +6494,24 @@ sub_80EF64C: @ 80EF64C ldrh r0, [r0] cmp r0, 0 bne _080EF6A0 - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 bl sub_8139688 lsls r0, 24 lsrs r0, 24 movs r1, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData movs r1, 0xB muls r1, r0 ldr r0, =gSpeciesNames adds r1, r0 adds r0, r4, 0 - bl CopyString - ldr r2, =gUnknown_03005D8C + bl StringCopy + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_030060BC movs r1, 0 ldrsb r1, [r0, r1] @@ -6540,7 +6540,7 @@ sub_80EF6C4: @ 80EF6C4 ldrh r0, [r0] cmp r0, 0 bne _080EF6F0 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_030060BC movs r1, 0 ldrsb r1, [r0, r1] @@ -6568,35 +6568,35 @@ sub_80EF704: @ 80EF704 ldrh r0, [r0] cmp r0, 0 bne _080EF774 - ldr r6, =gUnknown_02021CC4 + ldr r6, =gStringVar1 bl sub_8139688 lsls r0, 24 lsrs r0, 24 movs r5, 0x64 muls r0, r5 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData movs r1, 0xB muls r1, r0 ldr r0, =gSpeciesNames adds r1, r0 adds r0, r6, 0 - bl CopyString + bl StringCopy bl sub_8139688 lsls r0, 24 lsrs r0, 24 muls r0, r5 adds r0, r4 - ldr r4, =gUnknown_02021DC4 + ldr r4, =gStringVar2 movs r1, 0x2 adds r2, r4, 0 - bl pokemon_getattr + bl GetMonData adds r0, r4, 0 - bl GetStringEnd_Limit7 - ldr r2, =gUnknown_03005D8C + bl StringGetEnd10 + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_030060BC movs r1, 0 ldrsb r1, [r0, r1] @@ -6643,7 +6643,7 @@ sub_80EF7B4: @ 80EF7B4 ldrh r0, [r0] cmp r0, 0 bne _080EF7E0 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_030060BC movs r1, 0 ldrsb r1, [r0, r1] @@ -6689,7 +6689,7 @@ sub_80EF80C: @ 80EF80C ldrh r0, [r0] cmp r0, 0 bne _080EF838 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_030060BC movs r1, 0 ldrsb r1, [r0, r1] @@ -6717,7 +6717,7 @@ sub_80EF84C: @ 80EF84C ldrh r0, [r0] cmp r0, 0 bne _080EF878 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_030060BC movs r1, 0 ldrsb r1, [r0, r1] @@ -6744,18 +6744,18 @@ sub_80EF88C: @ 80EF88C lsrs r0, 24 movs r1, 0x64 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r5, r1, r0 - ldr r6, =gUnknown_02021CC4 + ldr r6, =gStringVar1 adds r0, r5, 0 movs r1, 0x2 adds r2, r6, 0 - bl pokemon_getattr + bl GetMonData mov r4, sp adds r0, r5, 0 movs r1, 0x3 mov r2, sp - bl pokemon_getattr + bl GetMonData strb r0, [r4] lsls r0, 24 lsrs r0, 24 @@ -6764,13 +6764,13 @@ sub_80EF88C: @ 80EF88C adds r0, r5, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData movs r1, 0xB muls r0, r1 ldr r1, =gSpeciesNames adds r0, r1 adds r1, r6, 0 - bl CompareString + bl StringCompare cmp r0, 0 bne _080EF8EC movs r0, 0 @@ -6943,7 +6943,7 @@ sub_80EF9E8: @ 80EF9E8 muls r1, r5 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy adds r0, r5, 0 pop {r4,r5} pop {r1} @@ -6956,7 +6956,7 @@ sub_80EFA24: @ 80EFA24 push {r4-r6,lr} lsls r0, 16 lsrs r5, r0, 16 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 ldr r1, =0x0000019b @@ -7005,7 +7005,7 @@ _080EFA7E: thumb_func_start sub_80EFA88 sub_80EFA88: @ 80EFA88 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000027cc adds r0, r1 @@ -7103,7 +7103,7 @@ sub_80EFB38: @ 80EFB38 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 cmp r0, r4 @@ -7122,7 +7122,7 @@ _080EFB52: sub_80EFB58: @ 80EFB58 push {r4-r6,lr} adds r4, r0, 0 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x6 @@ -7148,7 +7148,7 @@ _080EFB84: adds r3, r4, 0x4 cmp r0, r6 beq _080EFB78 - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 adds r1, r3, r1 ldrh r1, [r1] bl CopyEasyChatWord @@ -7230,7 +7230,7 @@ _080EFC06: mov r4, r8 adds r4, 0xF adds r0, r4, 0 - bl GetStringLength + bl StringLength lsls r0, 16 lsrs r2, r0, 16 cmp r6, 0 @@ -7280,7 +7280,7 @@ _080EFC72: mov r4, r8 adds r4, 0x4 adds r0, r4, 0 - bl GetStringLength + bl StringLength lsls r0, 16 lsrs r2, r0, 16 cmp r6, 0 @@ -7325,14 +7325,14 @@ _080EFCC4: ldrb r1, [r5, 0x1F] _080EFCC8: mov r0, sp - bl StopMusicWhileStringIsPrinted + bl ConvertInternationalString b _080EFD30 _080EFCD0: movs r0, 0xB muls r4, r0 ldr r7, =gSpeciesNames adds r0, r4, r7 - bl GetStringLength + bl StringLength lsls r0, 16 lsrs r2, r0, 16 cmp r6, 0 @@ -7385,7 +7385,7 @@ _080EFD30: adds r1, r0 ldr r0, [r1] mov r1, sp - bl CopyString + bl StringCopy add sp, 0x10 pop {r3,r4} mov r8, r3 @@ -7400,7 +7400,7 @@ _080EFD30: sub_80EFD54: @ 80EFD54 push {r4,lr} movs r1, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r3, [r0] ldr r0, =gUnknown_020375E0 ldrh r2, [r0] @@ -7437,15 +7437,15 @@ sub_80EFD98: @ 80EFD98 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 movs r1, 0x2 adds r2, r4, 0 - bl pokemon_getattr - ldr r0, =gUnknown_02021EC4 + bl GetMonData + ldr r0, =gStringVar3 adds r1, r4, 0 - bl CompareString + bl StringCompare cmp r0, 0 beq _080EFDD4 bl sub_80ED320 @@ -7476,22 +7476,22 @@ sub_80EFDDC: @ 80EFDDC mov r1, r8 muls r1, r0 adds r0, r1, 0 - ldr r6, =gUnknown_020244EC + ldr r6, =gPlayerParty adds r0, r6 - ldr r2, =gUnknown_02021EC4 + ldr r2, =gStringVar3 movs r1, 0x2 - bl pokemon_getattr + bl GetMonData mov r1, r9 ldrh r0, [r1] mov r1, r8 muls r1, r0 adds r0, r1, 0 adds r0, r6 - ldr r1, =gUnknown_02021DC4 + ldr r1, =gStringVar2 mov r10, r1 movs r1, 0x2 mov r2, r10 - bl pokemon_getattr + bl GetMonData mov r1, r9 ldrh r0, [r1] mov r1, r8 @@ -7500,7 +7500,7 @@ sub_80EFDDC: @ 80EFDDC adds r0, r6 movs r1, 0xB movs r2, 0 - bl pokemon_getattr + bl GetMonData adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 @@ -7522,7 +7522,7 @@ sub_80EFDDC: @ 80EFDDC adds r0, r6 movs r1, 0 movs r2, 0 - bl pokemon_getattr + bl GetMonData str r0, [sp] ldr r0, =c2_080CC144 str r0, [sp, 0x4] @@ -7549,9 +7549,9 @@ c2_080CC144: @ 80EFE98 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 - ldr r2, =gUnknown_02021DC4 + ldr r2, =gStringVar2 movs r1, 0x2 bl pokemon_setattr bl c2_exit_to_overworld_1_continue_scripts_restart_music @@ -7572,10 +7572,10 @@ sub_80EFEC4: @ 80EFEC4 ldrb r1, [r1] bl get_pokemon_by_box_and_pos adds r6, r0, 0 - ldr r2, =gUnknown_02021EC4 + ldr r2, =gStringVar3 movs r1, 0x2 bl pokemon_getattr_encrypted - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 mov r8, r0 adds r0, r6, 0 movs r1, 0x2 @@ -7621,7 +7621,7 @@ sub_80EFF48: @ 80EFF48 ldrb r0, [r0] ldr r1, =gUnknown_020375F8 ldrb r1, [r1] - ldr r2, =gUnknown_02021DC4 + ldr r2, =gStringVar2 bl sub_80D1E90 bl c2_exit_to_overworld_1_continue_scripts_restart_music pop {r0} @@ -7636,14 +7636,14 @@ sub_80EFF6C: @ 80EFF6C ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 movs r1, 0x2 adds r2, r4, 0 - bl pokemon_getattr + bl GetMonData adds r0, r4, 0 - bl GetStringEnd_Limit7 + bl StringGetEnd10 pop {r4} pop {r0} bx r0 @@ -7659,11 +7659,11 @@ sub_80EFF9C: @ 80EFF9C ldrh r1, [r0] movs r0, 0x64 muls r0, r1 - ldr r1, =gUnknown_020244EC + ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x1 movs r2, 0 - bl pokemon_getattr + bl GetMonData cmp r4, r0 bne _080EFFD0 ldr r1, =gUnknown_020375F0 @@ -7724,7 +7724,7 @@ _080F001C: thumb_func_start sub_80F0020 sub_80F0020: @ 80F0020 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r2, [r0] ldrb r0, [r2, 0xD] lsls r0, 24 @@ -7743,13 +7743,13 @@ sub_80F0020: @ 80F0020 thumb_func_start CheckForBigMovieOrEmergencyNewsOnTV CheckForBigMovieOrEmergencyNewsOnTV: @ 80F0040 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] movs r0, 0x4 ldrsb r0, [r1, r0] cmp r0, 0x1 bne _080F0060 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 @@ -7795,13 +7795,13 @@ _080F009E: thumb_func_start GetMomOrDadStringForTVMessage GetMomOrDadStringForTVMessage: @ 80F00A4 push {r4,lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] movs r0, 0x4 ldrsb r0, [r1, r0] cmp r0, 0x1 bne _080F0104 - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 @@ -7810,9 +7810,9 @@ GetMomOrDadStringForTVMessage: @ 80F00A4 ldrsb r0, [r1, r0] cmp r0, 0 bne _080F0104 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EAD08 - bl CopyString + bl StringCopy ldr r0, =0x00004003 movs r1, 0x1 bl VarSet @@ -7823,9 +7823,9 @@ _080F00EC: ldrsb r0, [r1, r0] cmp r0, 0x2 bne _080F0104 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EAD08 - bl CopyString + bl StringCopy ldr r0, =0x00004003 movs r1, 0x1 bl VarSet @@ -7858,37 +7858,37 @@ _080F0104: cmp r0, 0 bne _080F0158 _080F0142: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EAD08 - bl CopyString + bl StringCopy b _080F01A8 .pool _080F0158: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EAD04 - bl CopyString + bl StringCopy b _080F01A8 .pool _080F016C: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x1 ands r0, r1 cmp r0, 0 beq _080F0198 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EAD08 - bl CopyString + bl StringCopy adds r0, r4, 0 movs r1, 0x1 bl VarSet b _080F01A8 .pool _080F0198: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EAD04 - bl CopyString + bl StringCopy adds r0, r4, 0 movs r1, 0x2 bl VarSet @@ -7905,7 +7905,7 @@ sub_80F01B8: @ 80F01B8 ldr r0, =0x000040bc movs r1, 0 bl VarSet - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrb r1, [r0, 0x5] ldrb r2, [r0, 0x4] @@ -8011,7 +8011,7 @@ _080F0290: beq _080F0304 b _080F031E _080F029A: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000027cc adds r0, r1 @@ -8027,7 +8027,7 @@ _080F029A: b _080F031E .pool _080F02C4: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =0x000027cc adds r1, r0 @@ -8040,7 +8040,7 @@ _080F02DC: movs r0, 0xE1 lsls r0, 2 adds r1, r5, r0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r3, =0x000027cc adds r2, r3 @@ -8058,14 +8058,14 @@ _080F0304: movs r3, 0xE1 lsls r3, 3 adds r2, r5, r3 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r3, [r0] ldr r4, =0x000027cc adds r3, r4 adds r0, r5, 0 bl sub_80F0358 _080F031E: - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r0, [r5] ldr r4, =0x000027cc adds r0, r4 @@ -8585,7 +8585,7 @@ sub_80F0708: @ 80F0708 movs r0, 0 mov r9, r0 _080F0716: - ldr r3, =gUnknown_03005D8C + ldr r3, =gSaveBlock1Ptr ldr r1, [r3] mov r4, r9 lsls r2, r4, 3 @@ -8952,7 +8952,7 @@ _080F0A48: .4byte _080F0A7C .4byte _080F0A7C _080F0A7C: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] mov r4, r9 adds r0, r7, r4 @@ -8966,7 +8966,7 @@ _080F0A7C: b _080F0AE2 .pool _080F0AA0: - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, [r2] mov r1, r9 adds r4, r7, r1 @@ -9016,7 +9016,7 @@ _080F0AF2: sub_80F0B00: @ 80F0B00 lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] lsls r1, r0, 3 adds r1, r0 @@ -9046,7 +9046,7 @@ sub_80F0B24: @ 80F0B24 asrs r2, r0, 24 cmp r2, 0 bne _080F0B56 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] lsls r0, r4, 3 adds r0, r4 @@ -9074,7 +9074,7 @@ sub_80F0B64: @ 80F0B64 movs r2, 0 ldr r4, =0x000027cd movs r3, 0 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr _080F0B7C: ldr r0, [r5] lsls r1, r2, 3 @@ -9108,7 +9108,7 @@ _080F0BA2: sub_80F0BB8: @ 80F0BB8 push {r4-r6,lr} movs r5, 0 - ldr r6, =gUnknown_03005D8C + ldr r6, =gSaveBlock1Ptr _080F0BBE: ldr r1, [r6] lsls r0, r5, 3 @@ -9146,7 +9146,7 @@ sub_80F0C04: @ 80F0C04 push {r4,r5,lr} movs r3, 0 movs r2, 0x5 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r4, [r0] ldr r5, =0x000027cc _080F0C10: @@ -9181,7 +9181,7 @@ _080F0C2E: bge _080F0C6E adds r5, r0, 0 _080F0C4A: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000027cc adds r0, r1 @@ -9248,7 +9248,7 @@ _080F0CC2: beq _080F0D28 b _080F0D3E _080F0CCC: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002b50 adds r0, r1 @@ -9262,7 +9262,7 @@ _080F0CCC: b _080F0D3E .pool _080F0CF0: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r0, =0x00002b50 adds r1, r0 @@ -9273,7 +9273,7 @@ _080F0CF0: _080F0D08: adds r1, r5, 0 adds r1, 0x40 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r0, =0x00002b50 adds r2, r0 @@ -9289,7 +9289,7 @@ _080F0D28: adds r1, 0x40 adds r2, r5, 0 adds r2, 0x80 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r3, [r0] ldr r0, =0x00002b50 adds r3, r0 @@ -9521,7 +9521,7 @@ sub_80F0EEC: @ 80F0EEC push {r4,lr} movs r4, 0 _080F0EF0: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] lsls r1, r4, 2 adds r0, r1 @@ -9555,7 +9555,7 @@ sub_80F0F24: @ 80F0F24 cmp r0, 0x1 beq _080F0F50 movs r2, 0 - ldr r5, =gUnknown_03005D8C + ldr r5, =gSaveBlock1Ptr ldr r4, =0x00002b51 movs r3, 0 _080F0F3C: @@ -10300,7 +10300,7 @@ _080F152C: thumb_func_start sub_80F153C sub_80F153C: @ 80F153C push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r0, =gUnknown_020375E0 ldrh r1, [r0] @@ -10475,7 +10475,7 @@ _080F16E6: thumb_func_start DoTVShowBravoTrainerPokemonProfile DoTVShowBravoTrainerPokemonProfile: @ 80F16EC push {r4,r5,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -10512,7 +10512,7 @@ _080F1734: .4byte _080F190C .4byte _080F193C _080F1758: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x16 ldrb r2, [r4, 0x1E] @@ -10534,7 +10534,7 @@ _080F1758: adds r0, r1 adds r1, r4, 0 adds r1, 0x8 - bl CompareString + bl StringCompare cmp r0, 0 bne _080F17A4 ldr r1, =gUnknown_0203A030 @@ -10547,14 +10547,14 @@ _080F17A4: b _080F1950 .pool _080F17B0: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r2, [r4, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 adds r1, r4, 0 adds r1, 0x8 ldrb r2, [r4, 0x1F] @@ -10567,7 +10567,7 @@ _080F17B0: b _080F194C .pool _080F17E8: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x16 ldrb r2, [r4, 0x1E] @@ -10587,12 +10587,12 @@ _080F180C: b _080F1950 .pool _080F1818: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x16 ldrb r2, [r4, 0x1E] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r1, [r4, 0x4] bl CopyEasyChatWord ldrb r1, [r4, 0x13] @@ -10606,12 +10606,12 @@ _080F1818: b _080F1950 .pool _080F184C: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x16 ldrb r2, [r4, 0x1E] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r1, [r4, 0x4] bl CopyEasyChatWord ldrb r1, [r4, 0x13] @@ -10625,7 +10625,7 @@ _080F184C: b _080F1950 .pool _080F1880: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x16 ldrb r2, [r4, 0x1E] @@ -10635,7 +10635,7 @@ _080F1880: lsrs r1, 29 movs r0, 0x1 bl CopyContestCategoryToStringVar - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldrh r1, [r4, 0x6] bl CopyEasyChatWord ldrh r0, [r4, 0x14] @@ -10651,21 +10651,21 @@ _080F18B8: b _080F1950 .pool _080F18C4: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r2, [r4, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 ldrh r2, [r4, 0x14] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 ldrh r1, [r4, 0x6] bl CopyEasyChatWord ldr r1, =gUnknown_0203A030 @@ -10673,29 +10673,29 @@ _080F18C4: b _080F1950 .pool _080F190C: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x16 ldrb r2, [r4, 0x1E] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r4, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy bl TVShowDone b _080F1952 .pool _080F193C: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r2, [r4, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy _080F194C: ldr r1, =gUnknown_0203A030 movs r0, 0x2 @@ -10716,7 +10716,7 @@ _080F1952: thumb_func_start DoTVShowBravoTrainerBattleTower DoTVShowBravoTrainerBattleTower: @ 80F1974 push {r4,r5,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -10760,17 +10760,17 @@ _080F19C0: .4byte _080F1B94 .4byte _080F1BCC _080F19FC: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0x2 ldrb r2, [r4, 0x1D] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r4, 0xA] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy ldrh r0, [r4, 0x16] cmp r0, 0x6 bls _080F1A34 @@ -10789,15 +10789,15 @@ _080F1A40: ldrb r0, [r4, 0x1A] cmp r0, 0x32 bne _080F1A58 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EAEB1 - bl CopyString + bl StringCopy b _080F1A60 .pool _080F1A58: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EAEB8 - bl CopyString + bl StringCopy _080F1A60: ldrh r1, [r4, 0x16] movs r0, 0x1 @@ -10817,7 +10817,7 @@ _080F1A84: b _080F1BEA .pool _080F1A90: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x1E] @@ -10833,33 +10833,33 @@ _080F1AA6: b _080F1B1C .pool _080F1AB4: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x1E] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r4, 0x14] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy b _080F1AA6 .pool _080F1AE0: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x1E] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r4, 0x14] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy ldrb r0, [r4, 0x1B] cmp r0, 0 bne _080F1B1C @@ -10876,14 +10876,14 @@ _080F1B1C: b _080F1BEA .pool _080F1B28: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x1E] b _080F1B54 .pool _080F1B38: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x1E] @@ -10894,7 +10894,7 @@ _080F1B48: strb r0, [r2] b _080F1BEA _080F1B4E: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0x2 ldrb r2, [r4, 0x1D] _080F1B54: @@ -10905,7 +10905,7 @@ _080F1B54: b _080F1BEA .pool _080F1B68: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r1, [r4, 0x18] bl CopyEasyChatWord ldrb r0, [r4, 0x1B] @@ -10923,14 +10923,14 @@ _080F1B88: b _080F1BEA .pool _080F1B94: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r1, [r4, 0x18] bl CopyEasyChatWord - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r4, 0x2 ldrb r2, [r4, 0x1D] bl sub_81DB5E8 - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x1E] @@ -10941,17 +10941,17 @@ _080F1B94: b _080F1BEA .pool _080F1BCC: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0x2 ldrb r2, [r4, 0x1D] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r4, 0xA] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy bl TVShowDone _080F1BEA: ldr r0, =gUnknown_0858D240 @@ -10968,7 +10968,7 @@ _080F1BEA: thumb_func_start DoTVShowTodaysSmartShopper DoTVShowTodaysSmartShopper: @ 80F1C0C push {r4-r6,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -11010,12 +11010,12 @@ _080F1C58: .4byte _080F1DD8 .4byte _080F1E1C _080F1C8C: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x3] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrb r1, [r5, 0x12] movs r2, 0 bl GetMapName @@ -11034,22 +11034,22 @@ _080F1CBC: b _080F1E2C .pool _080F1CC8: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x3] bl sub_81DB5E8 - ldr r4, =gUnknown_02021DC4 + ldr r4, =gStringVar2 ldrh r0, [r5, 0x6] bl itemid_get_item adds r1, r0, 0 adds r0, r4, 0 - bl CopyString + bl StringCopy ldrh r1, [r5, 0xC] movs r0, 0x2 bl sub_80EF340 ldr r4, =gUnknown_0203A030 - bl GenerateRandomNumber + bl Random ldrb r2, [r4] adds r2, 0x1 lsls r0, 16 @@ -11091,12 +11091,12 @@ _080F1D40: b _080F1E2C .pool _080F1D4C: - ldr r4, =gUnknown_02021DC4 + ldr r4, =gStringVar2 ldrh r0, [r5, 0x8] bl itemid_get_item adds r1, r0, 0 adds r0, r4, 0 - bl CopyString + bl StringCopy ldrh r1, [r5, 0xE] movs r0, 0x2 bl sub_80EF340 @@ -11109,12 +11109,12 @@ _080F1D4C: b _080F1E2C .pool _080F1D7C: - ldr r4, =gUnknown_02021DC4 + ldr r4, =gStringVar2 ldrh r0, [r5, 0xA] bl itemid_get_item adds r1, r0, 0 adds r0, r4, 0 - bl CopyString + bl StringCopy ldrh r1, [r5, 0x10] movs r0, 0x2 bl sub_80EF340 @@ -11152,17 +11152,17 @@ _080F1DD2: strb r0, [r2] b _080F1E2C _080F1DD8: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x3] bl sub_81DB5E8 - ldr r4, =gUnknown_02021DC4 + ldr r4, =gStringVar2 ldrh r0, [r5, 0x6] bl itemid_get_item adds r1, r0, 0 adds r0, r4, 0 - bl CopyString + bl StringCopy ldrb r0, [r5, 0x2] cmp r0, 0x1 bne _080F1E10 @@ -11179,7 +11179,7 @@ _080F1E10: b _080F1E2C .pool _080F1E1C: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x3] @@ -11201,7 +11201,7 @@ _080F1E2C: DoTVShowTheNameRaterShow: @ 80F1E48 push {r4-r6,lr} sub sp, 0x8 - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -11249,19 +11249,19 @@ _080F1E94: .4byte _080F20A4 .4byte _080F20F0 _080F1EE0: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0 adds r1, 0xF ldrb r2, [r5, 0x1E] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r5, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 adds r1, r5, 0x4 ldrb r2, [r5, 0x1F] bl sub_81DB5E8 @@ -11294,7 +11294,7 @@ _080F1F44: strb r0, [r2] b _080F20FE _080F1F4A: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0 adds r1, 0xF ldrb r2, [r5, 0x1E] @@ -11326,7 +11326,7 @@ _080F1F82: b _080F20FE .pool _080F1F90: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0x4 ldrb r2, [r5, 0x1F] bl sub_81DB5E8 @@ -11351,7 +11351,7 @@ _080F1F90: b _080F20FE .pool _080F1FCC: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0 adds r1, 0xF ldrb r2, [r5, 0x1E] @@ -11400,13 +11400,13 @@ _080F202C: movs r2, 0x2 movs r3, 0x1 bl sub_80EFBDC - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r5, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy ldrh r0, [r5, 0x2] str r0, [sp] str r5, [sp, 0x4] @@ -11450,13 +11450,13 @@ _080F20A4: movs r2, 0x2 movs r3, 0x1 bl sub_80EFBDC - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r5, 0x1C] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy ldrh r0, [r5, 0x1C] str r0, [sp] str r5, [sp, 0x4] @@ -11475,7 +11475,7 @@ _080F20EC: movs r6, 0x12 strb r6, [r2] _080F20F0: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0x4 ldrb r2, [r5, 0x1F] bl sub_81DB5E8 @@ -11496,7 +11496,7 @@ _080F20FE: thumb_func_start DoTVShowPokemonTodaySuccessfulCapture DoTVShowPokemonTodaySuccessfulCapture: @ 80F211C push {r4-r6,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -11537,19 +11537,19 @@ _080F2168: .4byte _080F2324 .4byte _080F2354 _080F2198: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x2] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r5, 0x10] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 adds r1, r5, 0x4 ldrb r2, [r5, 0x3] bl sub_81DB5E8 @@ -11572,12 +11572,12 @@ _080F21EC: strb r0, [r2] b _080F2358 _080F21F2: - ldr r4, =gUnknown_02021DC4 + ldr r4, =gStringVar2 ldrb r0, [r5, 0xF] bl itemid_get_item adds r1, r0, 0 adds r0, r4, 0 - bl CopyString + bl StringCopy ldrb r1, [r5, 0x12] movs r0, 0x2 bl sub_80EF340 @@ -11596,19 +11596,19 @@ _080F2220: b _080F2358 .pool _080F222C: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x2] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r5, 0x10] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 adds r1, r5, 0x4 ldrb r2, [r5, 0x3] bl sub_81DB5E8 @@ -11619,18 +11619,18 @@ _080F2264: strb r0, [r2] b _080F2358 _080F226A: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x2] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r5, 0x10] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy _080F2286: ldr r1, =gUnknown_0203A030 movs r0, 0x6 @@ -11638,24 +11638,24 @@ _080F2286: b _080F2358 .pool _080F22A0: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x2] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r5, 0x10] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 adds r1, r5, 0x4 ldrb r2, [r5, 0x3] bl sub_81DB5E8 ldr r4, =gUnknown_0203A030 - bl GenerateRandomNumber + bl Random ldrb r2, [r4] adds r2, 0x1 lsls r0, 16 @@ -11667,14 +11667,14 @@ _080F22A0: b _080F2358 .pool _080F22F4: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r1, [r5, 0x10] movs r4, 0xB muls r1, r4 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 adds r1, r5, 0x4 ldrb r2, [r5, 0x3] bl sub_81DB5E8 @@ -11684,14 +11684,14 @@ _080F22F4: b _080F233E .pool _080F2324: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r1, [r5, 0x10] movs r4, 0xB muls r1, r4 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 adds r1, r5, 0x4 ldrb r2, [r5, 0x3] bl sub_81DB5E8 @@ -11717,7 +11717,7 @@ _080F2358: thumb_func_start DoTVShowPokemonTodayFailedCapture DoTVShowPokemonTodayFailedCapture: @ 80F2370 push {r4,r5,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -11752,40 +11752,40 @@ _080F23B8: .4byte _080F24A0 .4byte _080F24BC _080F23D4: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x2] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r4, 0xC] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy ldr r1, =gUnknown_0203A030 movs r0, 0x1 strb r0, [r1] b _080F24C0 .pool _080F2408: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x2] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrb r1, [r4, 0x12] movs r2, 0 bl GetMapName - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldrh r2, [r4, 0xE] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy ldrb r0, [r4, 0x11] cmp r0, 0x1 bne _080F2450 @@ -11801,7 +11801,7 @@ _080F2450: b _080F24C0 .pool _080F245C: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x2] @@ -11809,7 +11809,7 @@ _080F245C: ldrb r1, [r4, 0x10] movs r0, 0x1 bl sub_80EF340 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -11829,7 +11829,7 @@ _080F2494: b _080F24C0 .pool _080F24A0: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x2] @@ -11856,7 +11856,7 @@ _080F24C0: thumb_func_start DoTVShowPokemonFanClubLetter DoTVShowPokemonFanClubLetter: @ 80F24D8 push {r4-r7,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -11937,25 +11937,25 @@ _080F2524: .4byte _080F26A6 .4byte _080F26CC _080F25F4: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0 adds r1, 0x10 ldrb r2, [r5, 0x18] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r5, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy ldr r1, =gUnknown_0203A030 movs r0, 0x32 strb r0, [r1] b _080F26F0 .pool _080F2628: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -11979,7 +11979,7 @@ _080F2654: strb r0, [r6] b _080F26F0 _080F265A: - bl GenerateRandomNumber + bl Random ldrb r4, [r6] adds r4, 0x1 lsls r0, 16 @@ -11998,7 +11998,7 @@ _080F2672: b _080F26F0 .pool _080F2684: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x1F @@ -12012,7 +12012,7 @@ _080F2684: bl TVShowDone b _080F26F0 _080F26A6: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 adds r1, r5, 0x4 adds r0, r4, 0 movs r2, 0x2 @@ -12026,7 +12026,7 @@ _080F26A6: b _080F26FC .pool _080F26CC: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 adds r1, r5, 0x4 adds r0, r4, 0 movs r2, 0x2 @@ -12055,7 +12055,7 @@ _080F26FC: thumb_func_start DoTVShowRecentHappenings DoTVShowRecentHappenings: @ 80F2708 push {r4-r7,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -12135,7 +12135,7 @@ _080F2754: .4byte _080F288C .4byte _080F2868 _080F2820: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0 adds r1, 0x10 ldrb r2, [r5, 0x18] @@ -12148,7 +12148,7 @@ _080F2820: b _080F288C .pool _080F2844: - bl GenerateRandomNumber + bl Random ldrb r4, [r7] adds r4, 0x1 lsls r0, 16 @@ -12166,7 +12166,7 @@ _080F2862: bl TVShowDone b _080F288C _080F2868: - ldr r4, =gUnknown_02021FC4 + ldr r4, =gStringVar4 adds r1, r5, 0x4 adds r0, r4, 0 movs r2, 0x2 @@ -12195,7 +12195,7 @@ _080F2898: thumb_func_start DoTVShowPokemonFanClubOpinions DoTVShowPokemonFanClubOpinions: @ 80F28A4 push {r4-r6,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -12223,18 +12223,18 @@ _080F28E8: beq _080F2968 b _080F297E _080F28EE: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0x5 ldrb r2, [r4, 0xD] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r4, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 adds r1, r4, 0 adds r1, 0x10 ldrb r2, [r4, 0xE] @@ -12246,18 +12246,18 @@ _080F28EE: b _080F297E .pool _080F2930: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0x5 ldrb r2, [r4, 0xD] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r4, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 ldrh r1, [r4, 0x1C] bl CopyEasyChatWord movs r0, 0x4 @@ -12265,11 +12265,11 @@ _080F2930: b _080F297E .pool _080F2968: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0x5 ldrb r2, [r4, 0xD] bl sub_81DB5E8 - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldrh r1, [r4, 0x1E] bl CopyEasyChatWord bl TVShowDone @@ -12293,7 +12293,7 @@ DoTVShowDummiedOut: @ 80F299C thumb_func_start DoTVShowPokemonNewsMassOutbreak DoTVShowPokemonNewsMassOutbreak: @ 80F29A0 push {r4,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -12303,17 +12303,17 @@ DoTVShowPokemonNewsMassOutbreak: @ 80F29A0 adds r0, r1 ldr r4, [r2] adds r4, r0 - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrb r1, [r4, 0x10] movs r2, 0 bl GetMapName - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r4, 0xC] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy bl TVShowDone bl StartMassOutbreak ldr r1, =gUnknown_0858D19C @@ -12332,7 +12332,7 @@ DoTVShowPokemonNewsMassOutbreak: @ 80F29A0 thumb_func_start DoTVShowPokemonContestLiveUpdates DoTVShowPokemonContestLiveUpdates: @ 80F2A10 push {r4-r7,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -12394,17 +12394,17 @@ _080F2A5C: .4byte _080F30E0 .4byte _080F30FC _080F2AE0: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrb r1, [r6, 0x1C] bl sub_818E868 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 adds r1, r6, 0 adds r1, 0x14 ldrb r2, [r6, 0x1D] @@ -12441,13 +12441,13 @@ _080F2B48: b _080F311C .pool _080F2B54: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy ldrb r1, [r6, 0xF] cmp r1, 0x8 bne _080F2B6C @@ -12485,13 +12485,13 @@ _080F2B9A: _080F2BA0: b _080F2D20 _080F2BA2: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy _080F2BB2: ldrb r1, [r6, 0xF] cmp r1, 0x8 @@ -12503,14 +12503,14 @@ _080F2BBA: b _080F2B88 .pool _080F2BC8: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 adds r1, r6, 0 adds r1, 0x14 ldrb r2, [r6, 0x1D] @@ -12535,41 +12535,41 @@ _080F2C08: .4byte _080F2C58 .4byte _080F2C6C _080F2C1C: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EB0E8 - bl CopyString + bl StringCopy b _080F2C74 .pool _080F2C30: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EB0ED - bl CopyString + bl StringCopy b _080F2C74 .pool _080F2C44: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EB0F4 - bl CopyString + bl StringCopy b _080F2C74 .pool _080F2C58: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EB0F9 - bl CopyString + bl StringCopy b _080F2C74 .pool _080F2C6C: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085EB0FF - bl CopyString + bl StringCopy _080F2C74: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy ldrb r1, [r6, 0xF] cmp r1, 0x8 beq _080F2CF0 @@ -12652,7 +12652,7 @@ _080F2D20: b _080F311C .pool _080F2D2C: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 @@ -12660,7 +12660,7 @@ _080F2D2C: b _080F2F72 .pool _080F2D40: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 @@ -12668,7 +12668,7 @@ _080F2D40: b _080F2F72 .pool _080F2D54: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 @@ -12676,13 +12676,13 @@ _080F2D54: b _080F2F72 .pool _080F2D68: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy ldrb r0, [r6, 0x1C] cmp r0, 0x4 bls _080F2D80 @@ -12732,7 +12732,7 @@ _080F2DDC: b _080F311C .pool _080F2DE8: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 @@ -12740,7 +12740,7 @@ _080F2DE8: b _080F2F72 .pool _080F2DFC: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 @@ -12748,7 +12748,7 @@ _080F2DFC: b _080F2F72 .pool _080F2E10: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 @@ -12756,7 +12756,7 @@ _080F2E10: b _080F2F72 .pool _080F2E24: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 @@ -12764,7 +12764,7 @@ _080F2E24: b _080F2F72 .pool _080F2E38: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 @@ -12772,13 +12772,13 @@ _080F2E38: b _080F2F72 .pool _080F2E4C: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy ldrb r0, [r6, 0x1C] cmp r0, 0x4 bls _080F2E64 @@ -12828,7 +12828,7 @@ _080F2EC0: b _080F311C .pool _080F2ECC: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 @@ -12836,7 +12836,7 @@ _080F2ECC: b _080F2F72 .pool _080F2EE0: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 @@ -12844,7 +12844,7 @@ _080F2EE0: b _080F2F72 .pool _080F2EF4: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 @@ -12852,7 +12852,7 @@ _080F2EF4: b _080F2F72 .pool _080F2F08: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 @@ -12860,7 +12860,7 @@ _080F2F08: b _080F2F72 .pool _080F2F1C: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 @@ -12868,7 +12868,7 @@ _080F2F1C: b _080F2F72 .pool _080F2F30: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 @@ -12876,7 +12876,7 @@ _080F2F30: b _080F2F72 .pool _080F2F44: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 @@ -12884,43 +12884,43 @@ _080F2F44: b _080F2F72 .pool _080F2F58: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 ldrh r2, [r6, 0x10] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames _080F2F72: adds r1, r2 - bl CopyString + bl StringCopy ldr r1, =gUnknown_0203A030 movs r0, 0x17 strb r0, [r1] b _080F311C .pool _080F2F94: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r1, [r6, 0x12] movs r5, 0xB muls r1, r5 ldr r4, =gSpeciesNames adds r1, r4 - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 adds r1, r6, 0x4 ldrb r2, [r6, 0x1E] bl sub_81DB5E8 - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldrh r1, [r6, 0x2] muls r1, r5 adds r1, r4 - bl CopyString + bl StringCopy ldrb r0, [r6, 0xC] cmp r0, 0x8 beq _080F3028 @@ -13001,27 +13001,27 @@ _080F3058: b _080F311C .pool _080F3064: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r2, [r6, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy b _080F30EA .pool _080F3080: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0x4 ldrb r2, [r6, 0x1E] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy b _080F30EA .pool _080F30A8: @@ -13029,23 +13029,23 @@ _080F30A8: strb r0, [r2] b _080F311C _080F30AE: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0 adds r1, 0x14 ldrb r2, [r6, 0x1D] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 b _080F30E2 .pool _080F30E0: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 _080F30E2: adds r1, r6, 0x4 ldrb r2, [r6, 0x1E] @@ -13057,18 +13057,18 @@ _080F30EA: b _080F311C .pool _080F30FC: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0 adds r1, 0x14 ldrb r2, [r6, 0x1D] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy bl TVShowDone _080F311C: ldr r0, =gUnknown_0858D27C @@ -13085,7 +13085,7 @@ _080F311C: thumb_func_start DoTVShowPokemonBattleUpdate DoTVShowPokemonBattleUpdate: @ 80F3140 push {r4,r5,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -13141,11 +13141,11 @@ _080F31C4: strb r0, [r2] b _080F3362 _080F31CA: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0x4 ldrb r2, [r4, 0x19] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x1A] @@ -13153,15 +13153,15 @@ _080F31CA: ldrb r0, [r4, 0x18] cmp r0, 0 bne _080F3200 - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldr r1, =gUnknown_085ECB64 - bl CopyString + bl StringCopy b _080F3208 .pool _080F3200: - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldr r1, =gUnknown_085ECB6B - bl CopyString + bl StringCopy _080F3208: ldr r1, =gUnknown_0203A030 movs r0, 0x2 @@ -13169,53 +13169,53 @@ _080F3208: b _080F3362 .pool _080F321C: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0x4 ldrb r2, [r4, 0x19] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r4, 0x16] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 ldrh r2, [r4, 0x14] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 - bl CopyString + bl StringCopy ldr r1, =gUnknown_0203A030 movs r0, 0x3 strb r0, [r1] b _080F3362 .pool _080F3268: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x1A] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r4, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy ldr r1, =gUnknown_0203A030 movs r0, 0x4 strb r0, [r1] b _080F3362 .pool _080F329C: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0x4 ldrb r2, [r4, 0x19] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x1A] @@ -13224,11 +13224,11 @@ _080F329C: b _080F3362 .pool _080F32C0: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0x4 ldrb r2, [r4, 0x19] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x1A] @@ -13239,46 +13239,46 @@ _080F32C0: b _080F3362 .pool _080F32EC: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0x4 ldrb r2, [r4, 0x19] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r4, 0x16] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 ldrh r2, [r4, 0x14] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 - bl CopyString + bl StringCopy ldr r1, =gUnknown_0203A030 movs r0, 0x7 strb r0, [r1] b _080F3362 .pool _080F3338: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0x4 ldrb r2, [r4, 0x19] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x1A] bl sub_81DB5E8 - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldrh r2, [r4, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy bl TVShowDone _080F3362: ldr r0, =gUnknown_0858D300 @@ -13295,7 +13295,7 @@ _080F3362: thumb_func_start DoTVShow3CheersForPokeblocks DoTVShow3CheersForPokeblocks: @ 80F3388 push {r4,r5,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -13329,7 +13329,7 @@ _080F33D0: .4byte _080F35F4 .4byte _080F3620 _080F33E8: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x14] @@ -13368,56 +13368,56 @@ _080F3430: .4byte _080F3480 .4byte _080F3494 _080F3444: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085ECB48 - bl CopyString + bl StringCopy b _080F349C .pool _080F3458: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085ECB4E - bl CopyString + bl StringCopy b _080F349C .pool _080F346C: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085ECB52 - bl CopyString + bl StringCopy b _080F349C .pool _080F3480: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085ECB58 - bl CopyString + bl StringCopy b _080F349C .pool _080F3494: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085ECB5F - bl CopyString + bl StringCopy _080F349C: ldrb r0, [r4, 0x2] cmp r0, 0x18 bls _080F34BC - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085ECB2A - bl CopyString + bl StringCopy b _080F34DC .pool _080F34BC: cmp r0, 0x16 bls _080F34D4 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085ECB20 - bl CopyString + bl StringCopy b _080F34DC .pool _080F34D4: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085ECB1B - bl CopyString + bl StringCopy _080F34DC: - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x14] @@ -13428,7 +13428,7 @@ _080F34DC: b _080F3624 .pool _080F3500: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0x4 ldrb r2, [r4, 0x15] b _080F3606 @@ -13453,56 +13453,56 @@ _080F3524: .4byte _080F3574 .4byte _080F3588 _080F3538: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085ECB48 - bl CopyString + bl StringCopy b _080F3590 .pool _080F354C: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085ECB4E - bl CopyString + bl StringCopy b _080F3590 .pool _080F3560: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085ECB52 - bl CopyString + bl StringCopy b _080F3590 .pool _080F3574: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085ECB58 - bl CopyString + bl StringCopy b _080F3590 .pool _080F3588: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldr r1, =gUnknown_085ECB5F - bl CopyString + bl StringCopy _080F3590: ldrb r0, [r4, 0x2] cmp r0, 0x10 bls _080F35B0 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085ECB34 - bl CopyString + bl StringCopy b _080F35D0 .pool _080F35B0: cmp r0, 0xD bls _080F35C8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085ECB3A - bl CopyString + bl StringCopy b _080F35D0 .pool _080F35C8: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085ECB3E - bl CopyString + bl StringCopy _080F35D0: - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x14] @@ -13513,11 +13513,11 @@ _080F35D0: b _080F3624 .pool _080F35F4: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0x4 ldrb r2, [r4, 0x15] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x14] @@ -13573,8 +13573,8 @@ _080F3668: .4byte _080F379C .4byte _080F37A2 _080F368C: - ldr r0, =gUnknown_02021CC4 - ldr r4, =gUnknown_03005D8C + ldr r0, =gStringVar1 + ldr r4, =gSaveBlock1Ptr ldr r1, [r4] ldr r2, =0x00002bac adds r1, r2 @@ -13603,7 +13603,7 @@ _080F36D4: strb r0, [r2] b _080F37EA _080F36DA: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002bae adds r0, r1 @@ -13645,8 +13645,8 @@ _080F3726: strb r0, [r2] b _080F37EA _080F372C: - ldr r0, =gUnknown_02021CC4 - ldr r4, =gUnknown_03005D8C + ldr r0, =gStringVar1 + ldr r4, =gSaveBlock1Ptr ldr r1, [r4] ldr r2, =0x00002ba4 adds r1, r2 @@ -13655,8 +13655,8 @@ _080F372C: muls r1, r6 ldr r5, =gSpeciesNames adds r1, r5 - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 ldr r1, [r4] ldr r2, =0x00002ba8 adds r1, r2 @@ -13665,15 +13665,15 @@ _080F372C: muls r1, r2 ldr r2, =gMoveNames adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 ldr r1, [r4] ldr r2, =0x00002ba6 adds r1, r2 ldrh r1, [r1] muls r1, r6 adds r1, r5 - bl CopyString + bl StringCopy ldr r1, =gUnknown_0203A030 movs r0, 0x8 strb r0, [r1] @@ -13684,14 +13684,14 @@ _080F379C: strb r0, [r2] b _080F37EA _080F37A2: - ldr r0, =gUnknown_02021CC4 - ldr r4, =gUnknown_03005D8C + ldr r0, =gStringVar1 + ldr r4, =gSaveBlock1Ptr ldr r1, [r4] ldr r2, =0x00002baa adds r1, r2 ldrh r1, [r1] bl CopyEasyChatWord - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, [r4] ldr r2, =0x00002ba4 adds r1, r2 @@ -13700,15 +13700,15 @@ _080F37A2: muls r1, r6 ldr r5, =gSpeciesNames adds r1, r5 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 ldr r1, [r4] ldr r2, =0x00002ba6 adds r1, r2 ldrh r1, [r1] muls r1, r6 adds r1, r5 - bl CopyString + bl StringCopy ldr r1, =gUnknown_020375F0 movs r0, 0x1 strh r0, [r1] @@ -13731,7 +13731,7 @@ _080F37EA: thumb_func_start DoTVShowPokemonAngler DoTVShowPokemonAngler: @ 80F3828 push {r4,r5,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -13766,18 +13766,18 @@ _080F3870: b _080F38E0 .pool _080F3880: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x6] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r4, 0x4] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy ldrb r1, [r4, 0x3] movs r0, 0x2 bl sub_80EF340 @@ -13785,18 +13785,18 @@ _080F3880: b _080F38E0 .pool _080F38B8: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x6] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r4, 0x4] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy ldrb r1, [r4, 0x2] movs r0, 0x2 bl sub_80EF340 @@ -13816,7 +13816,7 @@ _080F38E0: thumb_func_start DoTVShowTheWorldOfMasters DoTVShowTheWorldOfMasters: @ 80F3904 push {r4-r6,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -13844,7 +13844,7 @@ _080F3948: beq _080F3994 b _080F39BE _080F394E: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0xB] @@ -13860,34 +13860,34 @@ _080F394E: b _080F39BE .pool _080F3974: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r2, [r4, 0x8] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy movs r0, 0x2 strb r0, [r6] b _080F39BE .pool _080F3994: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0xB] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrb r1, [r4, 0xA] movs r2, 0 bl GetMapName - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldrh r2, [r4, 0x4] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy bl TVShowDone _080F39BE: ldr r0, =gUnknown_0858D3B8 @@ -13904,7 +13904,7 @@ _080F39BE: thumb_func_start DoTVShowTodaysRivalTrainer DoTVShowTodaysRivalTrainer: @ 80F39E4 push {r4,r5,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -13973,7 +13973,7 @@ _080F3A8C: strb r0, [r2] b _080F3BE8 _080F3A92: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0xC] @@ -13981,7 +13981,7 @@ _080F3A92: ldrh r1, [r4, 0x2] movs r0, 0x1 bl sub_80EF340 - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldrb r1, [r4, 0x7] movs r2, 0 bl GetMapName @@ -13992,7 +13992,7 @@ _080F3AB0: b _080F3B24 .pool _080F3AC0: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0xC] @@ -14003,7 +14003,7 @@ _080F3AC0: b _080F3AB0 .pool _080F3ADC: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0xC] @@ -14014,7 +14014,7 @@ _080F3ADC: b _080F3AB0 .pool _080F3AF8: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0xC] @@ -14113,7 +14113,7 @@ _080F3BCC: b _080F3BE8 .pool _080F3BD8: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0xC] @@ -14134,7 +14134,7 @@ _080F3BE8: thumb_func_start DoTVShowDewfordTrendWatcherNetwork DoTVShowDewfordTrendWatcherNetwork: @ 80F3C04 push {r4,r5,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -14169,10 +14169,10 @@ _080F3C4C: .4byte _080F3D0C .4byte _080F3D40 _080F3C68: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r1, [r4, 0x4] bl CopyEasyChatWord - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r1, [r4, 0x6] bl CopyEasyChatWord ldrb r0, [r4, 0x8] @@ -14190,13 +14190,13 @@ _080F3C94: b _080F3D54 .pool _080F3CA0: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r1, [r4, 0x4] bl CopyEasyChatWord - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r1, [r4, 0x6] bl CopyEasyChatWord - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x9] @@ -14207,10 +14207,10 @@ _080F3CA0: b _080F3D54 .pool _080F3CD4: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r1, [r4, 0x4] bl CopyEasyChatWord - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r1, [r4, 0x6] bl CopyEasyChatWord ldrb r0, [r4, 0x8] @@ -14228,13 +14228,13 @@ _080F3D00: b _080F3D54 .pool _080F3D0C: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r1, [r4, 0x4] bl CopyEasyChatWord - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r1, [r4, 0x6] bl CopyEasyChatWord - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x9] @@ -14245,10 +14245,10 @@ _080F3D0C: b _080F3D54 .pool _080F3D40: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r1, [r4, 0x4] bl CopyEasyChatWord - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r1, [r4, 0x6] bl CopyEasyChatWord bl TVShowDone @@ -14267,7 +14267,7 @@ _080F3D54: thumb_func_start DoTVShowHoennTreasureInvestigators DoTVShowHoennTreasureInvestigators: @ 80F3D74 push {r4-r7,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -14295,12 +14295,12 @@ _080F3DB8: beq _080F3E3C b _080F3E5C _080F3DBE: - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 ldrh r0, [r5, 0x2] bl itemid_get_item adds r1, r0, 0 adds r0, r4, 0 - bl CopyString + bl StringCopy ldrb r0, [r5, 0x4] cmp r0, 0x57 bne _080F3DFC @@ -14326,18 +14326,18 @@ _080F3DFC: strb r0, [r7] b _080F3E5C _080F3E02: - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 ldrh r0, [r5, 0x2] bl itemid_get_item adds r1, r0, 0 adds r0, r4, 0 - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x5] bl sub_81DB5E8 - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldrb r1, [r5, 0x4] movs r2, 0 bl GetMapName @@ -14345,13 +14345,13 @@ _080F3E02: b _080F3E5C .pool _080F3E3C: - ldr r4, =gUnknown_02021CC4 + ldr r4, =gStringVar1 ldrh r0, [r5, 0x2] bl itemid_get_item adds r1, r0, 0 adds r0, r4, 0 - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x5] @@ -14372,7 +14372,7 @@ _080F3E5C: thumb_func_start DoTVShowFindThatGamer DoTVShowFindThatGamer: @ 80F3E7C push {r4,r5,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -14404,7 +14404,7 @@ _080F3EC0: _080F3ECA: b _080F4008 _080F3ECC: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x8] @@ -14417,15 +14417,15 @@ _080F3ECC: b _080F3F04 .pool _080F3EE8: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085ECB0C - bl CopyString + bl StringCopy b _080F3F04 .pool _080F3EFC: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085ECB12 - bl CopyString + bl StringCopy _080F3F04: ldrb r1, [r4, 0x2] cmp r1, 0x1 @@ -14441,7 +14441,7 @@ _080F3F1C: b _080F4008 .pool _080F3F28: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x8] @@ -14454,15 +14454,15 @@ _080F3F28: b _080F3F60 .pool _080F3F44: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085ECB0C - bl CopyString + bl StringCopy b _080F3F60 .pool _080F3F58: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085ECB12 - bl CopyString + bl StringCopy _080F3F60: ldrh r1, [r4, 0x4] movs r0, 0x2 @@ -14471,7 +14471,7 @@ _080F3F60: b _080F4008 .pool _080F3F78: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x8] @@ -14484,15 +14484,15 @@ _080F3F78: b _080F3FB0 .pool _080F3F94: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085ECB0C - bl CopyString + bl StringCopy b _080F3FB0 .pool _080F3FA8: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085ECB12 - bl CopyString + bl StringCopy _080F3FB0: ldrh r1, [r4, 0x4] movs r0, 0x2 @@ -14503,7 +14503,7 @@ _080F3FB0: b _080F4008 .pool _080F3FCC: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x8] @@ -14516,15 +14516,15 @@ _080F3FCC: b _080F4004 .pool _080F3FE8: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085ECB12 - bl CopyString + bl StringCopy b _080F4004 .pool _080F3FFC: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085ECB0C - bl CopyString + bl StringCopy _080F4004: bl TVShowDone _080F4008: @@ -14542,7 +14542,7 @@ _080F4008: thumb_func_start DoTVShowBreakingNewsTV DoTVShowBreakingNewsTV: @ 80F4028 push {r4-r7,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -14595,19 +14595,19 @@ _080F40B4: strb r0, [r2] b _080F4344 _080F40BA: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0xE] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 ldrb r1, [r6, 0x4] movs r2, 0 bl GetMapName @@ -14617,23 +14617,23 @@ _080F40BA: b _080F4344 .pool _080F40FC: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0xE] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r1, [r6, 0x2] movs r5, 0xB muls r1, r5 ldr r4, =gSpeciesNames adds r1, r4 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 ldrh r1, [r6, 0xA] muls r1, r5 adds r1, r4 - bl CopyString + bl StringCopy ldr r1, =gUnknown_0203A030 movs r0, 0x3 strb r0, [r1] @@ -14643,24 +14643,24 @@ _080F4140: ldrh r1, [r6, 0x8] movs r0, 0 bl sub_80EF340 - ldr r4, =gUnknown_02021DC4 + ldr r4, =gStringVar2 ldrh r0, [r6, 0x6] bl itemid_get_item adds r1, r0, 0 adds r0, r4, 0 - bl CopyString + bl StringCopy ldr r1, =gUnknown_0203A030 movs r0, 0x4 strb r0, [r1] b _080F4344 .pool _080F4168: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0xE] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrb r1, [r6, 0x4] movs r2, 0 bl GetMapName @@ -14668,19 +14668,19 @@ _080F4168: b _080F4344 .pool _080F418C: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0xE] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 ldrb r1, [r6, 0x4] movs r2, 0 bl GetMapName @@ -14690,23 +14690,23 @@ _080F418C: b _080F4344 .pool _080F41D0: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0xE] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r1, [r6, 0x2] movs r5, 0xB muls r1, r5 ldr r4, =gSpeciesNames adds r1, r4 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 ldrh r1, [r6, 0xA] muls r1, r5 adds r1, r4 - bl CopyString + bl StringCopy ldrb r0, [r6, 0x5] cmp r0, 0x2 beq _080F423C @@ -14748,14 +14748,14 @@ _080F4248: b _080F4344 .pool _080F4254: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r2, [r6, 0xC] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 ldrh r2, [r6, 0xA] movs r1, 0xB muls r1, r2 @@ -14764,36 +14764,36 @@ _080F4254: b _080F42A8 .pool _080F4284: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0xE] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r1, [r6, 0x2] movs r5, 0xB muls r1, r5 ldr r4, =gSpeciesNames adds r1, r4 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 ldrh r1, [r6, 0xA] muls r1, r5 adds r1, r4 _080F42A8: - bl CopyString + bl StringCopy ldr r1, =gUnknown_0203A030 movs r0, 0x8 strb r0, [r1] b _080F4344 .pool _080F42C8: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0xE] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrb r1, [r6, 0x4] movs r2, 0 bl GetMapName @@ -14803,19 +14803,19 @@ _080F42C8: b _080F4344 .pool _080F42F4: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0xE] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r1, [r6, 0x2] movs r4, 0xB muls r1, r4 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 ldrb r1, [r6, 0x4] movs r2, 0 bl GetMapName @@ -14824,7 +14824,7 @@ _080F42F4: b _080F4344 .pool _080F4334: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0xE] @@ -14845,7 +14845,7 @@ _080F4344: thumb_func_start DoTVShowSecretBaseVisit DoTVShowSecretBaseVisit: @ 80F4360 push {r4-r6,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -14888,7 +14888,7 @@ _080F43AC: .4byte _080F4538 .4byte _080F4584 _080F43E4: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0xC] @@ -14908,12 +14908,12 @@ _080F4408: b _080F4588 .pool _080F4414: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrb r1, [r5, 0x4] lsls r1, 5 ldr r2, =gUnknown_085A5C09 adds r1, r2 - bl CopyString + bl StringCopy ldrb r0, [r5, 0x3] cmp r0, 0x1 bne _080F443C @@ -14929,12 +14929,12 @@ _080F443C: b _080F4588 .pool _080F4448: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrb r1, [r5, 0x5] lsls r1, 5 ldr r2, =gUnknown_085A5C09 adds r1, r2 - bl CopyString + bl StringCopy ldrb r1, [r5, 0x3] cmp r1, 0x3 beq _080F4484 @@ -14967,26 +14967,26 @@ _080F4490: b _080F4588 .pool _080F449C: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrb r1, [r5, 0x6] lsls r1, 5 ldr r4, =gUnknown_085A5C09 adds r1, r4 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 ldrb r1, [r5, 0x7] lsls r1, 5 adds r1, r4 b _080F44CA .pool _080F44C0: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrb r1, [r5, 0x6] lsls r1, 5 ldr r2, =gUnknown_085A5C09 adds r1, r2 _080F44CA: - bl CopyString + bl StringCopy ldr r1, =gUnknown_0203A030 movs r0, 0x8 strb r0, [r1] @@ -14997,7 +14997,7 @@ _080F44E4: strb r0, [r2] b _080F4588 _080F44EA: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0xC] @@ -15033,25 +15033,25 @@ _080F452C: b _080F4588 .pool _080F4538: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0xC] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r5, 0x8] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 ldrh r1, [r5, 0xA] movs r4, 0xD muls r1, r4 ldr r2, =gMoveNames adds r1, r2 - bl CopyString + bl StringCopy ldr r0, =gUnknown_0203A030 strb r4, [r0] b _080F4588 @@ -15073,7 +15073,7 @@ _080F4588: thumb_func_start DoTVShowPokemonLotterWinnerFlashReport DoTVShowPokemonLotterWinnerFlashReport: @ 80F45A0 push {r4-r6,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -15088,7 +15088,7 @@ DoTVShowPokemonLotterWinnerFlashReport: @ 80F45A0 strh r0, [r1] ldr r0, =gUnknown_0203A030 ldrb r6, [r0] - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x5] @@ -15096,38 +15096,38 @@ DoTVShowPokemonLotterWinnerFlashReport: @ 80F45A0 ldrb r0, [r5, 0x4] cmp r0, 0 bne _080F45FC - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085ECB72 - bl CopyString + bl StringCopy b _080F4634 .pool _080F45FC: cmp r0, 0x1 bne _080F4614 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085ECB7A - bl CopyString + bl StringCopy b _080F4634 .pool _080F4614: cmp r0, 0x2 bne _080F462C - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085ECB80 - bl CopyString + bl StringCopy b _080F4634 .pool _080F462C: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldr r1, =gUnknown_085ECB87 - bl CopyString + bl StringCopy _080F4634: - ldr r4, =gUnknown_02021EC4 + ldr r4, =gStringVar3 ldrh r0, [r5, 0x2] bl itemid_get_item adds r1, r0, 0 adds r0, r4, 0 - bl CopyString + bl StringCopy bl TVShowDone ldr r1, =gUnknown_0858D494 lsls r0, r6, 2 @@ -15143,7 +15143,7 @@ _080F4634: thumb_func_start DoTVShowThePokemonBattleSeminar DoTVShowThePokemonBattleSeminar: @ 80F466C push {r4-r7,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -15178,61 +15178,61 @@ _080F46B4: .4byte _080F4814 .4byte _080F4838 _080F46D0: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0x11] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r1, [r6, 0x6] movs r5, 0xB muls r1, r5 ldr r4, =gSpeciesNames adds r1, r4 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 ldrh r1, [r6, 0x4] muls r1, r5 adds r1, r4 - bl CopyString + bl StringCopy ldr r1, =gUnknown_0203A030 movs r0, 0x1 strb r0, [r1] b _080F4858 .pool _080F4714: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0x11] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x4] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 ldrh r2, [r6, 0x2] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 - bl CopyString + bl StringCopy ldr r1, =gUnknown_0203A030 movs r0, 0x2 strb r0, [r1] b _080F4858 .pool _080F4760: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r2, [r6, 0x6] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 - bl CopyString + bl StringCopy ldrb r1, [r6, 0x10] cmp r1, 0x2 beq _080F479C @@ -15264,47 +15264,47 @@ _080F47A8: b _080F4858 .pool _080F47B4: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r1, [r6, 0x8] movs r5, 0xD muls r1, r5 ldr r4, =gMoveNames adds r1, r4 - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 ldrh r1, [r6, 0xA] muls r1, r5 adds r1, r4 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 ldrh r1, [r6, 0xC] muls r1, r5 adds r1, r4 b _080F4820 .pool _080F47EC: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r1, [r6, 0x8] movs r5, 0xD muls r1, r5 ldr r4, =gMoveNames adds r1, r4 - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 ldrh r1, [r6, 0xA] muls r1, r5 adds r1, r4 b _080F4820 .pool _080F4814: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r2, [r6, 0x8] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 _080F4820: - bl CopyString + bl StringCopy _080F4824: ldr r1, =gUnknown_0203A030 movs r0, 0x6 @@ -15312,18 +15312,18 @@ _080F4824: b _080F4858 .pool _080F4838: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r1, [r6, 0xE] movs r5, 0xD muls r1, r5 ldr r4, =gMoveNames adds r1, r4 - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 ldrh r1, [r6, 0x2] muls r1, r5 adds r1, r4 - bl CopyString + bl StringCopy bl TVShowDone _080F4858: ldr r0, =gUnknown_0858D498 @@ -15340,7 +15340,7 @@ _080F4858: thumb_func_start DoTVShowTrainerFanClubSpecial DoTVShowTrainerFanClubSpecial: @ 80F487C push {r4,r5,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -15374,16 +15374,16 @@ _080F48C4: .4byte _080F4944 .4byte _080F4978 _080F48DC: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x18] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r4, 0x2 ldrb r2, [r4, 0x17] bl sub_81DB5E8 - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldrh r1, [r4, 0x14] bl CopyEasyChatWord ldrb r1, [r4, 0x16] @@ -15417,12 +15417,12 @@ _080F4938: b _080F499A .pool _080F4944: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x18] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r4, 0x2 ldrb r2, [r4, 0x17] bl sub_81DB5E8 @@ -15435,16 +15435,16 @@ _080F4944: b _080F499A .pool _080F4978: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x18] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r4, 0x2 ldrb r2, [r4, 0x17] bl sub_81DB5E8 - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldrh r1, [r4, 0x14] bl CopyEasyChatWord bl TVShowDone @@ -15463,7 +15463,7 @@ _080F499A: thumb_func_start DoTVShowTrainerFanClub DoTVShowTrainerFanClub: @ 80F49BC push {r4,r5,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -15504,7 +15504,7 @@ _080F4A08: .4byte _080F4B14 .4byte _080F4B1A _080F4A38: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x8] @@ -15606,15 +15606,15 @@ _080F4B14: strb r0, [r2] b _080F4B3A _080F4B1A: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x8] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 ldrh r1, [r4, 0x4] bl CopyEasyChatWord - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 ldrh r1, [r4, 0x6] bl CopyEasyChatWord bl TVShowDone @@ -15633,7 +15633,7 @@ _080F4B3A: thumb_func_start DoTVShowSpotTheCuties DoTVShowSpotTheCuties: @ 80F4B5C push {r4,r5,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -15677,12 +15677,12 @@ _080F4BA4: .4byte _080F4D64 .4byte _080F4D80 _080F4BE4: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0xF] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r4, 0x4 ldrb r2, [r4, 0x10] bl sub_81DB5E8 @@ -15709,12 +15709,12 @@ _080F4C24: b _080F4D84 .pool _080F4C30: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0xF] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r4, 0x4 ldrb r2, [r4, 0x10] bl sub_81DB5E8 @@ -15727,7 +15727,7 @@ _080F4C30: b _080F4D84 .pool _080F4C64: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r4, 0x4 ldrb r2, [r4, 0x10] bl sub_81DB5E8 @@ -15830,7 +15830,7 @@ _080F4D58: b _080F4D84 .pool _080F4D64: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r4, 0x4 ldrb r2, [r4, 0x10] bl sub_81DB5E8 @@ -15856,7 +15856,7 @@ _080F4D84: thumb_func_start DoTVShowPokemonNewsBattleFrontier DoTVShowPokemonNewsBattleFrontier: @ 80F4D9C push {r4-r7,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -15984,7 +15984,7 @@ _080F4EC8: strb r0, [r2] b _080F5014 _080F4ECE: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0xC] @@ -15998,7 +15998,7 @@ _080F4ECE: b _080F5014 .pool _080F4EF4: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0xC] @@ -16012,7 +16012,7 @@ _080F4EF4: b _080F5014 .pool _080F4F18: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0xC] @@ -16026,77 +16026,77 @@ _080F4F18: b _080F5014 .pool _080F4F3C: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r1, [r6, 0x4] movs r5, 0xB muls r1, r5 ldr r4, =gSpeciesNames adds r1, r4 - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 ldrh r1, [r6, 0x6] muls r1, r5 adds r1, r4 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 ldrh r1, [r6, 0x8] muls r1, r5 adds r1, r4 b _080F4FEC .pool _080F4F74: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r1, [r6, 0x4] movs r5, 0xB muls r1, r5 ldr r4, =gSpeciesNames adds r1, r4 - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 ldrh r1, [r6, 0x6] muls r1, r5 adds r1, r4 b _080F4FEC .pool _080F4F9C: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r1, [r6, 0x4] movs r5, 0xB muls r1, r5 ldr r4, =gSpeciesNames adds r1, r4 - bl CopyString - ldr r0, =gUnknown_02021DC4 + bl StringCopy + ldr r0, =gStringVar2 ldrh r1, [r6, 0x6] muls r1, r5 adds r1, r4 - bl CopyString - ldr r0, =gUnknown_02021EC4 + bl StringCopy + ldr r0, =gStringVar3 ldrh r1, [r6, 0x8] muls r1, r5 adds r1, r4 - bl CopyString + bl StringCopy ldr r1, =gUnknown_0203A030 movs r0, 0x11 strb r0, [r1] b _080F5014 .pool _080F4FE0: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrh r2, [r6, 0xA] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 _080F4FEC: - bl CopyString + bl StringCopy ldr r1, =gUnknown_0203A030 movs r0, 0x12 strb r0, [r1] b _080F5014 .pool _080F5004: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0xC] @@ -16117,7 +16117,7 @@ _080F5014: thumb_func_start DoTVShowWhatsNo1InHoennToday DoTVShowWhatsNo1InHoennToday: @ 80F5030 push {r4,r5,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -16154,7 +16154,7 @@ _080F5078: .4byte _080F5130 .4byte _080F5154 _080F509C: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x5] @@ -16220,7 +16220,7 @@ _080F5124: b _080F5164 .pool _080F5130: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x5] @@ -16234,7 +16234,7 @@ _080F5130: b _080F5164 .pool _080F5154: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x5] @@ -16325,7 +16325,7 @@ DoTVShowSecretBaseSecrets: @ 80F51EC mov r7, r9 mov r6, r8 push {r6,r7} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -16400,11 +16400,11 @@ _080F5240: .4byte _080F5526 .4byte _080F5526 _080F52F0: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0x4 ldrb r2, [r5, 0x1C] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x1B] @@ -16423,7 +16423,7 @@ _080F52F0: _080F5328: movs r0, 0x1 strb r0, [r5, 0x12] - bl GenerateRandomNumber + bl Random ldr r4, =gUnknown_0203A031 lsls r0, 16 lsrs r0, 16 @@ -16434,7 +16434,7 @@ _080F5328: b _080F542A .pool _080F5348: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x1B] @@ -16465,7 +16465,7 @@ _080F5384: movs r1, 0 b _080F542C _080F538A: - bl GenerateRandomNumber + bl Random ldr r7, =gUnknown_0203A031 lsls r0, 16 lsrs r0, 16 @@ -16490,7 +16490,7 @@ _080F53B2: b _080F542A .pool _080F53C4: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x1B] @@ -16513,7 +16513,7 @@ _080F53F0: ldr r2, =0x0000fffe mov r8, r2 _080F53F8: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r6, 0 @@ -16547,11 +16547,11 @@ _080F542C: b _080F552A .pool _080F5444: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0x4 ldrb r2, [r5, 0x1C] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x1B] @@ -16582,11 +16582,11 @@ _080F548C: b _080F552A .pool _080F5498: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0x4 ldrb r2, [r5, 0x1C] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x1B] @@ -16597,11 +16597,11 @@ _080F5498: b _080F552A .pool _080F54C4: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r5, 0x4 ldrb r2, [r5, 0x1C] bl sub_81DB5E8 - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x1B] @@ -16616,12 +16616,12 @@ _080F54EC: movs r0, 0x3 b _080F5528 _080F54F0: - ldr r4, =gUnknown_02021DC4 + ldr r4, =gStringVar2 ldrh r0, [r5, 0x10] bl itemid_get_item adds r1, r0, 0 adds r0, r4, 0 - bl CopyString + bl StringCopy ldr r1, =gUnknown_0203A030 ldrb r0, [r5, 0x12] strb r0, [r1] @@ -16663,7 +16663,7 @@ _080F552A: thumb_func_start DoTVShowSafariFanClub DoTVShowSafariFanClub: @ 80F5548 push {r4,r5,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -16720,7 +16720,7 @@ _080F55D6: strb r0, [r2] b _080F56BC _080F55DC: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x4] @@ -16756,7 +16756,7 @@ _080F5628: strb r0, [r2] b _080F56BC _080F562E: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x4] @@ -16770,7 +16770,7 @@ _080F562E: b _080F5674 .pool _080F5650: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x4] @@ -16804,7 +16804,7 @@ _080F5694: strb r0, [r2] b _080F56BC _080F569A: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x4] @@ -16831,7 +16831,7 @@ _080F56BC: thumb_func_start DoTVShowPokemonContestLiveUpdates2 DoTVShowPokemonContestLiveUpdates2: @ 80F56D4 push {r4-r6,lr} - ldr r2, =gUnknown_03005D8C + ldr r2, =gSaveBlock1Ptr ldr r0, =gUnknown_020375E0 ldrh r1, [r0] lsls r0, r1, 3 @@ -16859,7 +16859,7 @@ _080F5718: beq _080F574E b _080F575E _080F571E: - ldr r0, =gUnknown_02021CC4 + ldr r0, =gStringVar1 ldrb r1, [r4, 0xA] bl sub_818E868 ldrb r1, [r4, 0x16] @@ -16879,12 +16879,12 @@ _080F573E: strb r0, [r6] b _080F575E _080F5744: - ldr r0, =gUnknown_02021EC4 + ldr r0, =gStringVar3 adds r1, r4, 0x2 ldrb r2, [r4, 0x17] bl sub_81DB5E8 _080F574E: - ldr r0, =gUnknown_02021DC4 + ldr r0, =gStringVar2 adds r1, r4, 0 adds r1, 0xB ldrb r2, [r4, 0x18] @@ -16910,7 +16910,7 @@ TVShowDone: @ 80F577C ldr r1, =gUnknown_0203A030 movs r0, 0 strb r0, [r1] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] ldr r0, =gUnknown_020375E0 ldrh r1, [r0] diff --git a/asm/unknown_task.s b/asm/unknown_task.s new file mode 100644 index 000000000..0d9b6a1dd --- /dev/null +++ b/asm/unknown_task.s @@ -0,0 +1,593 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start remove_some_task +remove_some_task: @ 80B9FB8 + push {r4,lr} + ldr r4, =gUnknown_02039B28 + movs r0, 0 + strb r0, [r4, 0x15] + ldr r1, =0x040000b0 + ldrh r2, [r1, 0xA] + ldr r0, =0x0000c5ff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, =0x00007fff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + ldrb r0, [r4, 0x18] + cmp r0, 0xFF + beq _080B9FE2 + bl DestroyTask + movs r0, 0xFF + strb r0, [r4, 0x18] +_080B9FE2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end remove_some_task + + thumb_func_start dp12_8087EA4 +dp12_8087EA4: @ 80B9FF8 + push {r4,lr} + sub sp, 0x4 + mov r0, sp + movs r4, 0 + strh r4, [r0] + ldr r1, =gUnknown_02038C28 + ldr r2, =0x01000780 + bl CpuSet + ldr r0, =gUnknown_02039B28 + movs r1, 0 + str r1, [r0] + str r1, [r0, 0x4] + str r1, [r0, 0x8] + str r1, [r0, 0xC] + strb r4, [r0, 0x14] + strb r4, [r0, 0x15] + strb r4, [r0, 0x16] + strb r4, [r0, 0x17] + movs r1, 0xFF + strb r1, [r0, 0x18] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp12_8087EA4 + + thumb_func_start sub_80BA038 +sub_80BA038: @ 80BA038 + push {lr} + sub sp, 0xC + str r0, [sp] + str r1, [sp, 0x4] + str r2, [sp, 0x8] + ldr r0, =0xa2600001 + cmp r1, r0 + bne _080BA06C + ldr r0, =gUnknown_02039B28 + ldr r1, =gUnknown_02038C2A + str r1, [r0] + movs r2, 0xF0 + lsls r2, 3 + adds r1, r2 + str r1, [r0, 0x4] + ldr r1, =sub_80BA134 + b _080BA07C + .pool +_080BA06C: + ldr r0, =gUnknown_02039B28 + ldr r1, =gUnknown_02038C2C + str r1, [r0] + movs r2, 0xF0 + lsls r2, 3 + adds r1, r2 + str r1, [r0, 0x4] + ldr r1, =sub_80BA154 +_080BA07C: + str r1, [r0, 0x10] + adds r1, r0, 0 + ldr r0, [sp, 0x4] + str r0, [r1, 0xC] + ldr r0, [sp] + str r0, [r1, 0x8] + mov r0, sp + ldrb r0, [r0, 0x8] + strb r0, [r1, 0x15] + mov r0, sp + ldrb r0, [r0, 0x9] + strb r0, [r1, 0x16] + strb r0, [r1, 0x17] + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BA038 + + thumb_func_start sub_80BA0A8 +sub_80BA0A8: @ 80BA0A8 + push {r4,lr} + ldr r4, =gUnknown_02039B28 + ldrb r0, [r4, 0x15] + cmp r0, 0 + beq _080BA122 + cmp r0, 0x3 + bne _080BA0EC + movs r0, 0 + strb r0, [r4, 0x15] + ldr r1, =0x040000b0 + ldrh r2, [r1, 0xA] + ldr r0, =0x0000c5ff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, =0x00007fff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + ldr r1, =gUnknown_02039B44 + movs r0, 0x1 + strb r0, [r1] + b _080BA122 + .pool +_080BA0EC: + ldr r1, =0x040000b0 + ldrh r2, [r1, 0xA] + ldr r0, =0x0000c5ff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, =0x00007fff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + ldrb r0, [r4, 0x14] + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + str r0, [r1] + ldr r0, [r4, 0x8] + str r0, [r1, 0x4] + ldr r0, [r4, 0xC] + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + ldr r0, [r4, 0x10] + bl _call_via_r0 + ldrb r0, [r4, 0x14] + movs r1, 0x1 + eors r0, r1 + strb r0, [r4, 0x14] +_080BA122: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BA0A8 + + thumb_func_start sub_80BA134 +sub_80BA134: @ 80BA134 + ldr r0, =gUnknown_02039B28 + ldr r2, [r0, 0x8] + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + ldr r1, =gUnknown_02038C28 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + bx lr + .pool + thumb_func_end sub_80BA134 + + thumb_func_start sub_80BA154 +sub_80BA154: @ 80BA154 + ldr r0, =gUnknown_02039B28 + ldr r2, [r0, 0x8] + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + ldr r1, =gUnknown_02038C28 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + bx lr + .pool + thumb_func_end sub_80BA154 + + thumb_func_start task00_for_dp12 +task00_for_dp12: @ 80BA174 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r12, r0 + movs r6, 0 + ldr r0, =gUnknown_02039B44 + ldrb r0, [r0] + cmp r0, 0 + beq _080BA1A4 + mov r0, r12 + bl DestroyTask + ldr r1, =gUnknown_02039B28 + movs r0, 0xFF + strb r0, [r1, 0x18] + b _080BA324 + .pool +_080BA1A4: + ldr r1, =gTasks + mov r0, r12 + lsls r2, r0, 2 + adds r0, r2, r0 + lsls r0, 3 + adds r3, r0, r1 + movs r4, 0x16 + ldrsh r0, [r3, r4] + mov r10, r1 + mov r9, r2 + cmp r0, 0 + beq _080BA250 + movs r1, 0x14 + ldrsh r0, [r3, r1] + cmp r0, 0xE + bhi _080BA250 + lsls r0, 2 + ldr r1, =_080BA1D8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080BA1D8: + .4byte _080BA214 + .4byte _080BA250 + .4byte _080BA21C + .4byte _080BA250 + .4byte _080BA224 + .4byte _080BA250 + .4byte _080BA22C + .4byte _080BA250 + .4byte _080BA234 + .4byte _080BA250 + .4byte _080BA23C + .4byte _080BA250 + .4byte _080BA244 + .4byte _080BA250 + .4byte _080BA24C +_080BA214: + ldr r0, =gUnknown_02022E14 + b _080BA24E + .pool +_080BA21C: + ldr r0, =gUnknown_02022E16 + b _080BA24E + .pool +_080BA224: + ldr r0, =gUnknown_02022E18 + b _080BA24E + .pool +_080BA22C: + ldr r0, =gUnknown_02022E1A + b _080BA24E + .pool +_080BA234: + ldr r0, =gUnknown_02022E1C + b _080BA24E + .pool +_080BA23C: + ldr r0, =gUnknown_02022E1E + b _080BA24E + .pool +_080BA244: + ldr r0, =gUnknown_02022E20 + b _080BA24E + .pool +_080BA24C: + ldr r0, =gUnknown_02022E22 +_080BA24E: + ldrh r6, [r0] +_080BA250: + mov r0, r9 + add r0, r12 + lsls r0, 3 + mov r2, r10 + adds r1, r0, r2 + ldrh r2, [r1, 0x10] + movs r3, 0x10 + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _080BA2BC + subs r0, r2, 0x1 + strh r0, [r1, 0x10] + movs r4, 0xE + ldrsh r0, [r1, r4] + movs r3, 0xA0 + lsls r3, 1 + adds r2, r0, r3 + movs r4, 0x8 + ldrsh r3, [r1, r4] + movs r4, 0xA + ldrsh r0, [r1, r4] + cmp r3, r0 + bge _080BA324 + ldr r5, =gUnknown_02038C28 + ldr r0, =gUnknown_02039B28 + mov r8, r0 + adds r7, r1, 0 + lsls r0, r2, 1 + adds r4, r0, r5 +_080BA28A: + lsls r2, r3, 1 + mov r0, r8 + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + adds r2, r5 + ldrh r0, [r4] + adds r0, r6 + strh r0, [r2] + adds r4, 0x2 + adds r3, 0x1 + movs r1, 0xA + ldrsh r0, [r7, r1] + cmp r3, r0 + blt _080BA28A + b _080BA324 + .pool +_080BA2BC: + ldrh r0, [r1, 0x12] + strh r0, [r1, 0x10] + movs r2, 0xE + ldrsh r0, [r1, r2] + movs r3, 0xA0 + lsls r3, 1 + adds r2, r0, r3 + movs r4, 0x8 + ldrsh r3, [r1, r4] + movs r4, 0xA + ldrsh r0, [r1, r4] + cmp r3, r0 + bge _080BA304 + ldr r5, =gUnknown_02038C28 + adds r7, r1, 0 + lsls r0, r2, 1 + adds r4, r0, r5 + ldr r0, =gUnknown_02039B28 + mov r8, r0 +_080BA2E2: + lsls r2, r3, 1 + mov r0, r8 + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + adds r2, r5 + ldrh r0, [r4] + adds r0, r6 + strh r0, [r2] + adds r4, 0x2 + adds r3, 0x1 + movs r1, 0xA + ldrsh r0, [r7, r1] + cmp r3, r0 + blt _080BA2E2 +_080BA304: + mov r0, r9 + add r0, r12 + lsls r0, 3 + mov r3, r10 + adds r2, r0, r3 + ldrh r0, [r2, 0xE] + adds r0, 0x1 + strh r0, [r2, 0xE] + lsls r0, 16 + asrs r0, 16 + movs r4, 0xC + ldrsh r1, [r2, r4] + cmp r0, r1 + bne _080BA324 + movs r0, 0 + strh r0, [r2, 0xE] +_080BA324: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end task00_for_dp12 + + thumb_func_start sub_80BA33C +sub_80BA33C: @ 80BA33C + push {r4-r7,lr} + adds r6, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r4, r2, 24 + movs r1, 0 + movs r2, 0 + ldr r0, =gUnknown_08329F40 + mov r12, r0 +_080BA350: + lsls r0, r1, 1 + adds r3, r0, r6 + lsls r0, r2, 1 + add r0, r12 + movs r7, 0 + ldrsh r0, [r0, r7] + muls r0, r4 + cmp r0, 0 + bge _080BA364 + adds r0, 0xFF +_080BA364: + asrs r0, 8 + strh r0, [r3] + adds r0, r2, r5 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0xFF + bls _080BA350 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BA33C + + thumb_func_start sub_80BA384 +sub_80BA384: @ 80BA384 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + adds r5, r0, 0 + str r1, [sp, 0x10] + ldr r0, [sp, 0x40] + mov r8, r0 + ldr r1, [sp, 0x44] + mov r9, r1 + ldr r0, [sp, 0x48] + mov r10, r0 + lsls r5, 24 + lsrs r5, 24 + ldr r1, [sp, 0x10] + lsls r1, 24 + str r1, [sp, 0x14] + lsrs r0, r1, 24 + str r0, [sp, 0xC] + lsls r1, r2, 24 + lsrs r1, 24 + str r1, [sp, 0x18] + lsls r2, r3, 24 + lsrs r2, 24 + str r2, [sp, 0x1C] + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + mov r3, r9 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + bl dp12_8087EA4 + ldr r0, =0x04000010 + add r0, r9 + str r0, [sp] + ldr r0, =0xa2600001 + str r0, [sp, 0x4] + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x8] + mov r0, sp + movs r1, 0 + strb r1, [r0, 0x9] + ldr r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + bl sub_80BA038 + ldr r0, =task00_for_dp12 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gTasks + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r0 + strh r5, [r4, 0x8] + mov r3, sp + ldrh r3, [r3, 0xC] + strh r3, [r4, 0xA] + movs r0, 0x80 + lsls r0, 1 + ldr r1, [sp, 0x18] + bl __divsi3 + strh r0, [r4, 0xC] + movs r0, 0 + strh r0, [r4, 0xE] + mov r1, r8 + strh r1, [r4, 0x10] + strh r1, [r4, 0x12] + mov r3, r9 + strh r3, [r4, 0x14] + mov r0, r10 + strh r0, [r4, 0x16] + ldr r0, =gUnknown_02039B28 + strb r7, [r0, 0x18] + ldr r0, =gUnknown_02039B44 + movs r1, 0 + strb r1, [r0] + ldr r4, =gUnknown_02038EA8 + ldr r3, [sp, 0xC] + subs r6, r3, r5 + lsls r3, r6, 24 + lsrs r3, 24 + adds r0, r4, 0 + ldr r1, [sp, 0x18] + ldr r2, [sp, 0x1C] + bl sub_80BA33C + ldr r0, [sp, 0xC] + cmp r5, r0 + bge _080BA47E + ldr r1, =0xfffffd80 + adds r2, r4, r1 + lsls r1, r5, 1 + movs r3, 0xF0 + lsls r3, 3 + adds r0, r1, r3 + adds r3, r0, r2 + adds r1, r2 + adds r2, r4, 0 + adds r5, r6, 0 +_080BA46A: + ldrh r0, [r2] + strh r0, [r1] + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + adds r1, 0x2 + subs r5, 0x1 + cmp r5, 0 + bne _080BA46A +_080BA47E: + adds r0, r7, 0 + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80BA384 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_806F640.s b/asm/util.s similarity index 84% rename from asm/rom_806F640.s rename to asm/util.s index a15f33334..865e98937 100644 --- a/asm/rom_806F640.s +++ b/asm/util.s @@ -5,8 +5,8 @@ .text - thumb_func_start object_new_hidden_with_callback -object_new_hidden_with_callback: @ 806F640 + thumb_func_start CreateInvisibleSpriteWithCallback +CreateInvisibleSpriteWithCallback: @ 806F640 push {r4-r6,lr} adds r6, r0, 0 ldr r0, =gUnknown_0832A3A8 @@ -33,18 +33,18 @@ object_new_hidden_with_callback: @ 806F640 pop {r1} bx r1 .pool - thumb_func_end object_new_hidden_with_callback + thumb_func_end CreateInvisibleSpriteWithCallback - thumb_func_start sub_806F67C -sub_806F67C: @ 806F67C + thumb_func_start StoreWordInTwoHalfwords +StoreWordInTwoHalfwords: @ 806F67C strh r1, [r0] lsrs r1, 16 strh r1, [r0, 0x2] bx lr - thumb_func_end sub_806F67C + thumb_func_end StoreWordInTwoHalfwords - thumb_func_start sub_806F684 -sub_806F684: @ 806F684 + thumb_func_start LoadWordFromTwoHalfwords +LoadWordFromTwoHalfwords: @ 806F684 ldrh r2, [r0] movs r3, 0x2 ldrsh r0, [r0, r3] @@ -52,10 +52,10 @@ sub_806F684: @ 806F684 orrs r2, r0 str r2, [r1] bx lr - thumb_func_end sub_806F684 + thumb_func_end LoadWordFromTwoHalfwords - thumb_func_start sub_806F694 -sub_806F694: @ 806F694 + thumb_func_start SetBgAffineStruct +SetBgAffineStruct: @ 806F694 push {r4-r7,lr} mov r7, r8 push {r7} @@ -77,10 +77,10 @@ sub_806F694: @ 806F694 pop {r4-r7} pop {r0} bx r0 - thumb_func_end sub_806F694 + thumb_func_end SetBgAffineStruct - thumb_func_start sub_806F6C0 -sub_806F6C0: @ 806F6C0 + thumb_func_start DoBgAffineSet +DoBgAffineSet: @ 806F6C0 push {r4-r6,lr} mov r6, r8 push {r6} @@ -105,7 +105,7 @@ sub_806F6C0: @ 806F6C0 str r5, [sp, 0x8] str r6, [sp, 0xC] add r0, sp, 0x10 - bl sub_806F694 + bl SetBgAffineStruct add r0, sp, 0x10 mov r1, r8 movs r2, 0x1 @@ -116,10 +116,10 @@ sub_806F6C0: @ 806F6C0 pop {r4-r6} pop {r0} bx r0 - thumb_func_end sub_806F6C0 + thumb_func_end DoBgAffineSet - thumb_func_start rfu_MBOOT_CHILD_inheritanceLinkStatus -rfu_MBOOT_CHILD_inheritanceLinkStatus: @ 806F70C + thumb_func_start CopySpriteTiles +CopySpriteTiles: @ 806F70C push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -327,10 +327,10 @@ _0806F894: pop {r0} bx r0 .pool - thumb_func_end rfu_MBOOT_CHILD_inheritanceLinkStatus + thumb_func_end CopySpriteTiles - thumb_func_start sub_806F8A8 -sub_806F8A8: @ 806F8A8 + thumb_func_start CountTrailingZeroBits +CountTrailingZeroBits: @ 806F8A8 push {lr} adds r2, r0, 0 movs r1, 0 @@ -353,10 +353,10 @@ _0806F8BC: _0806F8CA: pop {r1} bx r1 - thumb_func_end sub_806F8A8 + thumb_func_end CountTrailingZeroBits - thumb_func_start sub_806F8D0 -sub_806F8D0: @ 806F8D0 + thumb_func_start CalcCRC16 +CalcCRC16: @ 806F8D0 push {r4-r7,lr} adds r7, r0, 0 adds r4, r1, 0 @@ -403,10 +403,10 @@ _0806F91C: pop {r4-r7} pop {r1} bx r1 - thumb_func_end sub_806F8D0 + thumb_func_end CalcCRC16 - thumb_func_start sub_806F928 -sub_806F928: @ 806F928 + thumb_func_start CalcCRC16WithTable +CalcCRC16WithTable: @ 806F928 push {r4-r6,lr} adds r5, r0, 0 adds r4, r1, 0 @@ -439,10 +439,10 @@ _0806F956: pop {r1} bx r1 .pool - thumb_func_end sub_806F928 + thumb_func_end CalcCRC16WithTable - thumb_func_start sub_806F96C -sub_806F96C: @ 806F96C + thumb_func_start CalcByteArraySum +CalcByteArraySum: @ 806F96C push {r4,lr} adds r4, r0, 0 movs r3, 0 @@ -461,6 +461,6 @@ _0806F984: pop {r4} pop {r1} bx r1 - thumb_func_end sub_806F96C + thumb_func_end CalcByteArraySum .align 2, 0 @ Don't pad with nop. diff --git a/asm/var.s b/asm/var.s deleted file mode 100644 index 04612534c..000000000 --- a/asm/var.s +++ /dev/null @@ -1,105 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start GetVarPointer -@ u16 *GetVarPointer(u16 varId) -GetVarPointer: @ 809D648 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - adds r2, r1, 0 - ldr r0, =0x00003fff - cmp r1, r0 - bhi _0809D660 - movs r0, 0 - b _0809D688 - .pool -_0809D660: - lsls r0, r1, 16 - cmp r0, 0 - bge _0809D67C - ldr r0, =gUnknown_081DBA0C - ldr r2, =0xffff8000 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - b _0809D688 - .pool -_0809D67C: - ldr r0, =gUnknown_03005D8C - lsls r1, r2, 1 - ldr r2, =0xffff939c - adds r1, r2 - ldr r0, [r0] - adds r0, r1 -_0809D688: - pop {r1} - bx r1 - .pool - thumb_func_end GetVarPointer - - thumb_func_start VarGet -@ u16 VarGet(u16 varId) -VarGet: @ 809D694 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl GetVarPointer - cmp r0, 0 - beq _0809D6A8 - ldrh r0, [r0] - b _0809D6AA -_0809D6A8: - adds r0, r4, 0 -_0809D6AA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end VarGet - - thumb_func_start VarSet -@ bool8 VarSet(u16 varId, u16 value) -VarSet: @ 809D6B0 - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - lsrs r4, r1, 16 - bl GetVarPointer - cmp r0, 0 - beq _0809D6C8 - strh r4, [r0] - movs r0, 0x1 - b _0809D6CA -_0809D6C8: - movs r0, 0 -_0809D6CA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end VarSet - - thumb_func_start VarGetFieldObjectGraphicsId -@ u8 VarGetFieldObjectGraphicsId(u8 index) -VarGetFieldObjectGraphicsId: @ 809D6D0 - push {lr} - lsls r0, 24 - lsrs r0, 8 - ldr r1, =0x40100000 - adds r0, r1 - lsrs r0, 16 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end VarGetFieldObjectGraphicsId - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/wallclock.s b/asm/wallclock.s index 77f5013e8..9ce2108f7 100644 --- a/asm/wallclock.s +++ b/asm/wallclock.s @@ -610,7 +610,7 @@ _08134D1C: adds r1, r0 adds r4, r1 strh r4, [r5, 0xA] - ldr r2, =gUnknown_030022C0 + ldr r2, =gMain ldrh r0, [r2, 0x2E] movs r3, 0x1 adds r1, r3, 0 @@ -812,7 +812,7 @@ c2_080111BC: @ 8134EE8 cmp r0, 0 bne _08134F02 bl FreeAllWindowBuffers - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r0, [r0, 0x8] bl SetMainCallback2 _08134F02: @@ -852,7 +852,7 @@ sub_8134F40: @ 8134F40 lsrs r4, r0, 24 adds r0, r4, 0 bl sub_8135130 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 @@ -909,7 +909,7 @@ sub_8134FB0: @ 8134FB0 ands r0, r1 cmp r0, 0 bne _08134FC6 - ldr r0, =gUnknown_030022C0 + ldr r0, =gMain ldr r0, [r0, 0x8] bl SetMainCallback2 _08134FC6: @@ -1197,7 +1197,7 @@ sub_81351AC: @ 81351AC ldrh r4, [r0, 0x8] adds r7, r4, 0 adds r0, r4, 0 - bl sine2 + bl Sin2 lsls r0, 16 asrs r0, 16 cmp r0, 0 @@ -1207,7 +1207,7 @@ _081351D4: lsls r0, 12 lsrs r5, r0, 16 adds r0, r4, 0 - bl cosine2 + bl Cos2 lsls r0, 16 asrs r0, 16 cmp r0, 0 @@ -1275,7 +1275,7 @@ sub_8135244: @ 8135244 ldrh r4, [r0, 0xA] adds r7, r4, 0 adds r0, r4, 0 - bl sine2 + bl Sin2 lsls r0, 16 asrs r0, 16 cmp r0, 0 @@ -1285,7 +1285,7 @@ _0813526C: lsls r0, 12 lsrs r5, r0, 16 adds r0, r4, 0 - bl cosine2 + bl Cos2 lsls r0, 16 asrs r0, 16 cmp r0, 0 @@ -1392,7 +1392,7 @@ _0813533A: strh r0, [r4, 0x30] _0813533C: ldrh r0, [r4, 0x30] - bl cosine2 + bl Cos2 lsls r0, 16 asrs r0, 16 lsls r1, r0, 4 @@ -1406,7 +1406,7 @@ _08135354: asrs r0, 12 strh r0, [r4, 0x24] ldrh r0, [r4, 0x30] - bl sine2 + bl Sin2 lsls r0, 16 asrs r0, 16 lsls r1, r0, 4 @@ -1479,7 +1479,7 @@ _081353DE: strh r0, [r4, 0x30] _081353E0: ldrh r0, [r4, 0x30] - bl cosine2 + bl Cos2 lsls r0, 16 asrs r0, 16 lsls r1, r0, 4 @@ -1493,7 +1493,7 @@ _081353F8: asrs r0, 12 strh r0, [r4, 0x24] ldrh r0, [r4, 0x30] - bl sine2 + bl Sin2 lsls r0, 16 asrs r0, 16 lsls r1, r0, 4 diff --git a/asm/weather.s b/asm/weather.s index 53e2d8398..eae277f59 100644 --- a/asm/weather.s +++ b/asm/weather.s @@ -4221,7 +4221,7 @@ _080AD200: sub_80AD204: @ 80AD204 push {r4-r7,lr} adds r5, r0, 0 - bl GenerateRandomNumber + bl Random movs r1, 0x36 ldrsh r2, [r5, r1] lsls r1, r2, 2 @@ -4267,7 +4267,7 @@ sub_80AD204: @ 80AD204 lsls r0, 7 strh r0, [r5, 0x2E] strh r7, [r5, 0x24] - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r6, r0, 0 @@ -4742,7 +4742,7 @@ _080AD680: adds r1, r4, r2 movs r0, 0x1 strb r0, [r1] - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r5, 0xB4 @@ -4784,7 +4784,7 @@ _080AD6E0: adds r0, r4, r1 movs r5, 0x1 strb r5, [r0] - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 ands r0, r5 @@ -4794,7 +4794,7 @@ _080AD6E0: b _080AD768 .pool _080AD70C: - bl GenerateRandomNumber + bl Random ldr r1, =gUnknown_0854C14C ldr r2, [r1] movs r1, 0x1 @@ -4826,7 +4826,7 @@ _080AD72A: movs r0, 0x14 bl sub_80AD9BC _080AD74E: - bl GenerateRandomNumber + bl Random ldr r1, =gUnknown_0854C14C ldr r4, [r1] lsls r0, 16 @@ -4872,7 +4872,7 @@ _080AD79E: lsls r0, 24 cmp r0, 0 beq _080AD7E8 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xF @@ -4917,7 +4917,7 @@ _080AD80C: b _080AD8F8 .pool _080AD834: - bl GenerateRandomNumber + bl Random ldr r1, =gUnknown_0854C14C ldr r2, [r1] lsls r0, 16 @@ -4950,7 +4950,7 @@ _080AD864: bl sub_80AD9BC movs r0, 0x13 bl sub_80ABC48 - bl GenerateRandomNumber + bl Random movs r1, 0xF ands r1, r0 adds r1, 0x1E @@ -5100,7 +5100,7 @@ sub_80AD9BC: @ 80AD9BC ldrb r0, [r5] cmp r0, 0 bne _080AD9EA - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r6, 0 @@ -5138,7 +5138,7 @@ sub_80AD9F8: @ 80AD9F8 lsls r0, 24 cmp r0, 0 bne _080ADA58 - bl GenerateRandomNumber + bl Random ands r4, r0 cmp r4, 0 beq _080ADA38 @@ -7506,7 +7506,7 @@ _080AED78: thumb_func_start sub_80AED7C sub_80AED7C: @ 80AED7C push {r4,r5,lr} - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r1, [r4] adds r1, 0x2E ldrb r5, [r1] @@ -7529,7 +7529,7 @@ sub_80AED7C: @ 80AED7C thumb_func_start sav1_get_weather_probably sav1_get_weather_probably: @ 80AEDAC - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] adds r0, 0x2E ldrb r0, [r0] @@ -7540,7 +7540,7 @@ sav1_get_weather_probably: @ 80AEDAC thumb_func_start sub_80AEDBC sub_80AEDBC: @ 80AEDBC push {r4,r5,lr} - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r0, [r4] adds r0, 0x2E ldrb r5, [r0] @@ -7762,7 +7762,7 @@ _080AEF94: _080AEF9C: ldr r1, =gUnknown_0854FE60 _080AEF9E: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] adds r0, 0x2F ldrb r0, [r0] @@ -7780,7 +7780,7 @@ _080AEFB6: thumb_func_start sub_80AEFBC sub_80AEFBC: @ 80AEFBC lsls r0, 16 - ldr r1, =gUnknown_03005D8C + ldr r1, =gSaveBlock1Ptr ldr r2, [r1] adds r2, 0x2F lsrs r0, 16 diff --git a/asm/wild_encounter.s b/asm/wild_encounter.s index 384ec038a..22c832755 100644 --- a/asm/wild_encounter.s +++ b/asm/wild_encounter.s @@ -121,7 +121,7 @@ sub_80B4984: @ 80B4984 push {r6,r7} sub sp, 0x10 movs r7, 0 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0, 0x4] movs r0, 0x88 @@ -164,7 +164,7 @@ _080B49D0: bgt _080B49E4 movs r7, 0x2 _080B49E4: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -179,7 +179,7 @@ _080B4A04: movs r0, 0x1 b _080B4A7C _080B4A08: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r3, =0x00002e6a adds r0, r3 @@ -276,7 +276,7 @@ sub_80B4AB8: @ 80B4AB8 thumb_func_start wild_pokemon_rand_grass wild_pokemon_rand_grass: @ 80B4AC8 push {lr} - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -383,7 +383,7 @@ _080B4B7E: thumb_func_start wild_pokemon_rand_water wild_pokemon_rand_water: @ 80B4B84 push {lr} - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -436,7 +436,7 @@ sub_80B4BD8: @ 80B4BD8 lsrs r4, r0, 24 adds r6, r4, 0 movs r5, 0 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -539,17 +539,17 @@ _080B4C8A: adds r4, 0x1 lsls r4, 24 lsrs r4, 24 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r4, 0 bl __modsi3 lsls r0, 24 lsrs r4, r0, 24 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5, 0 movs r1, 0x6 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _080B4CEA adds r0, r5, 0 @@ -563,7 +563,7 @@ _080B4C8A: cmp r0, 0x2E bne _080B4CEA _080B4CC8: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x1 @@ -605,7 +605,7 @@ _080B4D08: lsls r0, 2 adds r3, r0, r5 ldrb r1, [r3] - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r2, [r0] movs r0, 0x4 ldrsb r0, [r2, r0] @@ -661,7 +661,7 @@ sub_80B4D78: @ 80B4D78 bl GetSafariZoneFlag cmp r0, 0x1 bne _080B4E0E - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -694,7 +694,7 @@ _080B4DB8: bhi _080B4DE8 add r5, sp _080B4DC6: - bl GenerateRandomNumber + bl Random movs r1, 0x1 ands r1, r0 cmp r1, 0 @@ -732,10 +732,10 @@ _080B4DF2: cmp r5, 0x18 bls _080B4DF2 _080B4E0E: - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4, 0 movs r1, 0x6 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _080B4E4C adds r0, r4, 0 @@ -744,7 +744,7 @@ _080B4E0E: lsrs r0, 24 cmp r0, 0x1C bne _080B4E4C - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x1 @@ -753,14 +753,14 @@ _080B4E0E: bne _080B4E4C adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData b _080B4E54 .pool _080B4E48: ldrb r0, [r4] b _080B4E5E _080B4E4C: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 _080B4E54: @@ -804,10 +804,10 @@ _080B4E96: _080B4E98: cmp r2, 0 beq _080B4F28 - ldr r5, =gUnknown_020244EC + ldr r5, =gPlayerParty adds r0, r5, 0 movs r1, 0x6 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _080B4F28 adds r0, r5, 0 @@ -816,7 +816,7 @@ _080B4E98: lsrs r0, 24 cmp r0, 0x38 bne _080B4F28 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x3 @@ -826,13 +826,13 @@ _080B4E98: beq _080B4F28 adds r0, r5, 0 movs r1, 0xB - bl pokemon_getattr + bl GetMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0 - bl pokemon_getattr + bl GetMonData adds r1, r0, 0 adds r0, r4, 0 bl pokemon_species_get_gender_info @@ -849,7 +849,7 @@ _080B4F02: bl sub_80B4D78 lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty str r4, [sp] str r0, [sp, 0x4] movs r0, 0 @@ -865,7 +865,7 @@ _080B4F28: bl sub_80B4D78 lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_02024744 + ldr r1, =gEnemyParty str r0, [sp] adds r0, r1, 0 adds r1, r6, 0 @@ -1029,7 +1029,7 @@ SetUpMassOutbreakEncounter: @ 80B505C ands r0, r1 cmp r0, 0 beq _080B508C - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x00002b94 adds r0, r1 @@ -1042,7 +1042,7 @@ SetUpMassOutbreakEncounter: @ 80B505C b _080B50C6 .pool _080B508C: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r1, [r0] ldr r2, =0x00002b90 adds r0, r1, r2 @@ -1053,7 +1053,7 @@ _080B508C: bl sub_80B4E68 movs r4, 0 _080B50A2: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] lsls r1, r4, 1 ldr r2, =0x00002b98 @@ -1062,7 +1062,7 @@ _080B50A2: ldrh r1, [r0] lsls r2, r4, 24 lsrs r2, 24 - ldr r0, =gUnknown_02024744 + ldr r0, =gEnemyParty bl sub_80691F4 adds r0, r4, 0x1 lsls r0, 16 @@ -1080,7 +1080,7 @@ _080B50C6: thumb_func_start DoMassOutbreakEncounterTest DoMassOutbreakEncounterTest: @ 80B50DC push {r4,lr} - ldr r4, =gUnknown_03005D8C + ldr r4, =gSaveBlock1Ptr ldr r2, [r4] ldr r1, =0x00002b90 adds r0, r2, r1 @@ -1101,7 +1101,7 @@ DoMassOutbreakEncounterTest: @ 80B50DC ldrb r0, [r0] cmp r1, r0 bne _080B513C - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -1131,7 +1131,7 @@ DoWildEncounterRateDiceRoll: @ 80B5144 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0xB4 @@ -1179,10 +1179,10 @@ _080B519A: bl ApplyCleanseTagWildEncounterRateReduction cmp r4, 0 bne _080B5216 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4, 0 movs r1, 0x6 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _080B5216 adds r0, r4, 0 @@ -1219,7 +1219,7 @@ _080B51F2: _080B5200: cmp r0, 0x8 bne _080B5216 - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] adds r0, 0x2E ldrb r0, [r0] @@ -1254,7 +1254,7 @@ _080B5222: thumb_func_start DoGlobalWildEncounterDiceRoll DoGlobalWildEncounterDiceRoll: @ 80B523C push {lr} - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -1275,7 +1275,7 @@ _080B525A: thumb_func_start sub_80B5260 sub_80B5260: @ 80B5260 push {lr} - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldrh r1, [r0, 0x4] movs r0, 0xE0 @@ -1378,7 +1378,7 @@ _080B5330: beq _080B5338 b _080B54FE _080B5338: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000cb2 adds r0, r1 @@ -1556,7 +1556,7 @@ _080B5492: cmp r0, 0x1 bne _080B54E4 _080B54BA: - ldr r0, =gUnknown_03005D8C + ldr r0, =gSaveBlock1Ptr ldr r0, [r0] ldr r1, =0x000031dc adds r0, r1 @@ -1695,7 +1695,7 @@ _080B55E4: beq _080B55EC b _080B56F2 _080B55EC: - ldr r0, =gUnknown_03005D90 + ldr r0, =gSaveBlock2Ptr ldr r0, [r0] ldr r1, =0x00000cb2 adds r0, r1 @@ -1934,7 +1934,7 @@ _080B57E6: ldr r1, [r4, 0x4] b _080B5820 _080B57F4: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x64 @@ -2054,21 +2054,21 @@ _080B58E0: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x39 - bl pokemon_getattr + bl GetMonData cmp r0, 0 beq _080B5920 adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _080B5920 adds r0, r4, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r0, 24 cmp r6, r0 @@ -2097,10 +2097,10 @@ DoKeenEyeIntimidateWildEncounterTest: @ 80B5934 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4, 0 movs r1, 0x6 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _080B5988 adds r0, r4, 0 @@ -2114,7 +2114,7 @@ DoKeenEyeIntimidateWildEncounterTest: @ 80B5934 _080B595A: adds r0, r4, 0 movs r1, 0x38 - bl pokemon_getattr + bl GetMonData lsls r0, 24 lsrs r0, 24 cmp r0, 0x5 @@ -2122,7 +2122,7 @@ _080B595A: subs r0, 0x5 cmp r5, r0 bgt _080B5988 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x1 @@ -2223,7 +2223,7 @@ _080B5A1A: b _080B5A3C .pool _080B5A24: - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 adds r1, r4, 0 @@ -2257,10 +2257,10 @@ TryGetAbilityInfluencedWildMonIndex: @ 80B5A50 lsrs r6, r1, 24 lsls r2, 24 lsrs r5, r2, 24 - ldr r4, =gUnknown_020244EC + ldr r4, =gPlayerParty adds r0, r4, 0 movs r1, 0x6 - bl pokemon_getattr + bl GetMonData cmp r0, 0 bne _080B5AA4 adds r0, r4, 0 @@ -2269,7 +2269,7 @@ TryGetAbilityInfluencedWildMonIndex: @ 80B5A50 lsrs r0, 24 cmp r0, r5 bne _080B5AA4 - bl GenerateRandomNumber + bl Random lsls r0, 16 lsrs r0, 16 movs r1, 0x1 @@ -2333,9 +2333,9 @@ _080B5AE4: ApplyCleanseTagWildEncounterRateReduction: @ 80B5AF0 push {r4,lr} adds r4, r0, 0 - ldr r0, =gUnknown_020244EC + ldr r0, =gPlayerParty movs r1, 0xC - bl pokemon_getattr + bl GetMonData cmp r0, 0xBE bne _080B5B0C ldr r0, [r4] diff --git a/data/bard_music.s b/data/bard_music.s new file mode 100644 index 000000000..ba775dd83 --- /dev/null +++ b/data/bard_music.s @@ -0,0 +1,28 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_085F5490:: @ 85F5490 + .incbin "baserom.gba", 0x5f5490, 0x4 + +gUnknown_085F5494:: @ 85F5494 + .incbin "baserom.gba", 0x5f5494, 0x4d40 + +gUnknown_085FA1D4:: @ 85FA1D4 + .incbin "baserom.gba", 0x5fa1d4, 0x4 + +gUnknown_085FA1D8:: @ 85FA1D8 + .incbin "baserom.gba", 0x5fa1d8, 0xff90 + +gUnknown_0860A168:: @ 860A168 + .incbin "baserom.gba", 0x60a168, 0x1b8 + +gUnknown_0860A320:: @ 860A320 + .incbin "baserom.gba", 0x60a320, 0x8c + +gUnknown_0860A3AC:: @ 860A3AC + .incbin "baserom.gba", 0x60a3ac, 0x30 + +gUnknown_0860A3DC:: @ 860A3DC + .incbin "baserom.gba", 0x60a3dc, 0xd0 diff --git a/data/battle_anim_8170478.s b/data/battle_anim_8170478.s new file mode 100644 index 000000000..ef23d2e7b --- /dev/null +++ b/data/battle_anim_8170478.s @@ -0,0 +1,28 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_085E5088:: @ 85E5088 + .incbin "baserom.gba", 0x5e5088, 0xc + +gUnknown_085E5094:: @ 85E5094 + .incbin "baserom.gba", 0x5e5094, 0x60 + +gUnknown_085E50F4:: @ 85E50F4 + .incbin "baserom.gba", 0x5e50f4, 0xc0 + +gUnknown_085E51B4:: @ 85E51B4 + .incbin "baserom.gba", 0x5e51b4, 0xc + +gUnknown_085E51C0:: @ 85E51C0 + .incbin "baserom.gba", 0x5e51c0, 0x30 + +gUnknown_085E51F0:: @ 85E51F0 + .incbin "baserom.gba", 0x5e51f0, 0x60 + +gUnknown_085E5250:: @ 85E5250 + .incbin "baserom.gba", 0x5e5250, 0xc0 + +gUnknown_085E5310:: @ 85E5310 + .incbin "baserom.gba", 0x5e5310, 0x64 diff --git a/data/battle_message.s b/data/battle_message.s new file mode 100644 index 000000000..1d8fde5d6 --- /dev/null +++ b/data/battle_message.s @@ -0,0 +1,378 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + + .incbin "baserom.gba", 0x5c9b78, 0x8ac + +gUnknown_085CA424:: @ 85CA424 + .incbin "baserom.gba", 0x5ca424, 0x35 + +gUnknown_085CA459:: @ 85CA459 + .incbin "baserom.gba", 0x5ca459, 0xe48 + +gUnknown_085CB2A1:: @ 85CB2A1 + .incbin "baserom.gba", 0x5cb2a1, 0xe9 + +gUnknown_085CB38A:: @ 85CB38A + .incbin "baserom.gba", 0x5cb38a, 0x20 + +gUnknown_085CB3AA:: @ 85CB3AA + .incbin "baserom.gba", 0x5cb3aa, 0x120 + +gUnknown_085CB4CA:: @ 85CB4CA + .incbin "baserom.gba", 0x5cb4ca, 0x5a + +gUnknown_085CB524:: @ 85CB524 + .incbin "baserom.gba", 0x5cb524, 0x14 + +gUnknown_085CB538:: @ 85CB538 + .incbin "baserom.gba", 0x5cb538, 0x17 + +gUnknown_085CB54F:: @ 85CB54F + .incbin "baserom.gba", 0x5cb54f, 0x18 + +gUnknown_085CB567:: @ 85CB567 + .incbin "baserom.gba", 0x5cb567, 0x1a + +gUnknown_085CB581:: @ 85CB581 + .incbin "baserom.gba", 0x5cb581, 0x25 + +gUnknown_085CB5A6:: @ 85CB5A6 + .incbin "baserom.gba", 0x5cb5a6, 0x2c + +gUnknown_085CB5D2:: @ 85CB5D2 + .incbin "baserom.gba", 0x5cb5d2, 0xd + +gUnknown_085CB5DF:: @ 85CB5DF + .incbin "baserom.gba", 0x5cb5df, 0x44f + +gUnknown_085CBA2E:: @ 85CBA2E + .incbin "baserom.gba", 0x5cba2e, 0x119 + +gUnknown_085CBB47:: @ 85CBB47 + .incbin "baserom.gba", 0x5cbb47, 0x13 + +gUnknown_085CBB5A:: @ 85CBB5A + .incbin "baserom.gba", 0x5cbb5a, 0x13 + +gUnknown_085CBB6D:: @ 85CBB6D + .incbin "baserom.gba", 0x5cbb6d, 0x15 + +gUnknown_085CBB82:: @ 85CBB82 + .incbin "baserom.gba", 0x5cbb82, 0x1a + +gUnknown_085CBB9C:: @ 85CBB9C + .incbin "baserom.gba", 0x5cbb9c, 0x1d + +gUnknown_085CBBB9:: @ 85CBBB9 + .incbin "baserom.gba", 0x5cbbb9, 0x14 + +gUnknown_085CBBCD:: @ 85CBBCD + .incbin "baserom.gba", 0x5cbbcd, 0x1a + +gUnknown_085CBBE7:: @ 85CBBE7 + .incbin "baserom.gba", 0x5cbbe7, 0x13 + +gUnknown_085CBBFA:: @ 85CBBFA + .incbin "baserom.gba", 0x5cbbfa, 0x1a + +gUnknown_085CBC14:: @ 85CBC14 + .incbin "baserom.gba", 0x5cbc14, 0x13 + +gUnknown_085CBC27:: @ 85CBC27 + .incbin "baserom.gba", 0x5cbc27, 0x10 + +gUnknown_085CBC37:: @ 85CBC37 + .incbin "baserom.gba", 0x5cbc37, 0x17 + +gUnknown_085CBC4E:: @ 85CBC4E + .incbin "baserom.gba", 0x5cbc4e, 0x20 + +gUnknown_085CBC6E:: @ 85CBC6E + .incbin "baserom.gba", 0x5cbc6e, 0x10 + +gUnknown_085CBC7E:: @ 85CBC7E + .incbin "baserom.gba", 0x5cbc7e, 0x10 + +gUnknown_085CBC8E:: @ 85CBC8E + .incbin "baserom.gba", 0x5cbc8e, 0x8 + +gUnknown_085CBC96:: @ 85CBC96 + .incbin "baserom.gba", 0x5cbc96, 0xf + +gUnknown_085CBCA5:: @ 85CBCA5 + .incbin "baserom.gba", 0x5cbca5, 0x8 + +gUnknown_085CBCAD:: @ 85CBCAD + .incbin "baserom.gba", 0x5cbcad, 0xb + +gUnknown_085CBCB8:: @ 85CBCB8 + .incbin "baserom.gba", 0x5cbcb8, 0xf + +gUnknown_085CBCC7:: @ 85CBCC7 + .incbin "baserom.gba", 0x5cbcc7, 0x1e + +gUnknown_085CBCE5:: @ 85CBCE5 + .incbin "baserom.gba", 0x5cbce5, 0x18 + +gUnknown_085CBCFD:: @ 85CBCFD + .incbin "baserom.gba", 0x5cbcfd, 0x1e + +gUnknown_085CBD1B:: @ 85CBD1B + .incbin "baserom.gba", 0x5cbd1b, 0xf + +gUnknown_085CBD2A:: @ 85CBD2A + .incbin "baserom.gba", 0x5cbd2a, 0x13 + +gUnknown_085CBD3D:: @ 85CBD3D + .incbin "baserom.gba", 0x5cbd3d, 0x15 + +gUnknown_085CBD52:: @ 85CBD52 + .incbin "baserom.gba", 0x5cbd52, 0x13 + +gUnknown_085CBD65:: @ 85CBD65 + .incbin "baserom.gba", 0x5cbd65, 0x10 + +gUnknown_085CBD75:: @ 85CBD75 + .incbin "baserom.gba", 0x5cbd75, 0x10 + +gUnknown_085CBD85:: @ 85CBD85 + .incbin "baserom.gba", 0x5cbd85, 0x6 + +gUnknown_085CBD8B:: @ 85CBD8B + .incbin "baserom.gba", 0x5cbd8b, 0x6 + +gUnknown_085CBD91:: @ 85CBD91 + .incbin "baserom.gba", 0x5cbd91, 0x4 + +gUnknown_085CBD95:: @ 85CBD95 + .incbin "baserom.gba", 0x5cbd95, 0x5 + +gUnknown_085CBD9A:: @ 85CBD9A + .incbin "baserom.gba", 0x5cbd9a, 0x4 + +gUnknown_085CBD9E:: @ 85CBD9E + .incbin "baserom.gba", 0x5cbd9e, 0x5 + +gUnknown_085CBDA3:: @ 85CBDA3 + .incbin "baserom.gba", 0x5cbda3, 0x4 + +gUnknown_085CBDA7:: @ 85CBDA7 + .incbin "baserom.gba", 0x5cbda7, 0x5 + +gUnknown_085CBDAC:: @ 85CBDAC + .incbin "baserom.gba", 0x5cbdac, 0xb + +gUnknown_085CBDB7:: @ 85CBDB7 + .incbin "baserom.gba", 0x5cbdb7, 0x2 + +gUnknown_085CBDB9:: @ 85CBDB9 + .incbin "baserom.gba", 0x5cbdb9, 0x2 + +gUnknown_085CBDBB:: @ 85CBDBB + .incbin "baserom.gba", 0x5cbdbb, 0x2 + +gUnknown_085CBDBD:: @ 85CBDBD + .incbin "baserom.gba", 0x5cbdbd, 0x2 + +gUnknown_085CBDBF:: @ 85CBDBF + .incbin "baserom.gba", 0x5cbdbf, 0x41 + +gUnknown_085CBE00:: @ 85CBE00 + .incbin "baserom.gba", 0x5cbe00, 0x6c + +gUnknown_085CBE6C:: @ 85CBE6C + .incbin "baserom.gba", 0x5cbe6c, 0x1a9 + +gUnknown_085CC015:: @ 85CC015 + .incbin "baserom.gba", 0x5cc015, 0xa + +gUnknown_085CC01F:: @ 85CC01F + .incbin "baserom.gba", 0x5cc01f, 0x81 + +gUnknown_085CC0A0:: @ 85CC0A0 + .incbin "baserom.gba", 0x5cc0a0, 0xd + +gUnknown_085CC0AD:: @ 85CC0AD + .incbin "baserom.gba", 0x5cc0ad, 0x191 + +gUnknown_085CC23E:: @ 85CC23E + .incbin "baserom.gba", 0x5cc23e, 0x32 + +gUnknown_085CC270:: @ 85CC270 + .incbin "baserom.gba", 0x5cc270, 0x5c4 + +gUnknown_085CC834:: @ 85CC834 + .incbin "baserom.gba", 0x5cc834, 0x14e + +gUnknown_085CC982:: @ 85CC982 + .incbin "baserom.gba", 0x5cc982, 0xe + +gUnknown_085CC990:: @ 85CC990 + .incbin "baserom.gba", 0x5cc990, 0x16 + +gUnknown_085CC9A6:: @ 85CC9A6 + .incbin "baserom.gba", 0x5cc9a6, 0x2d + +gUnknown_085CC9D3:: @ 85CC9D3 + .incbin "baserom.gba", 0x5cc9d3, 0x1b + +gUnknown_085CC9EE:: @ 85CC9EE + .incbin "baserom.gba", 0x5cc9ee, 0x5 + +gUnknown_085CC9F3:: @ 85CC9F3 + .incbin "baserom.gba", 0x5cc9f3, 0x11 + +gUnknown_085CCA04:: @ 85CCA04 + .incbin "baserom.gba", 0x5cca04, 0x11 + +gUnknown_085CCA15:: @ 85CCA15 + .incbin "baserom.gba", 0x5cca15, 0x14 + +gUnknown_085CCA29:: @ 85CCA29 + .incbin "baserom.gba", 0x5cca29, 0x11 + +gUnknown_085CCA3A:: @ 85CCA3A + .incbin "baserom.gba", 0x5cca3a, 0x1a + +gUnknown_085CCA54:: @ 85CCA54 + .incbin "baserom.gba", 0x5cca54, 0x1b + +gUnknown_085CCA6F:: @ 85CCA6F + .incbin "baserom.gba", 0x5cca6f, 0x4 + +gUnknown_085CCA73:: @ 85CCA73 + .incbin "baserom.gba", 0x5cca73, 0x48 + +gUnknown_085CCABB:: @ 85CCABB + .incbin "baserom.gba", 0x5ccabb, 0xf + +gUnknown_085CCACA:: @ 85CCACA + .incbin "baserom.gba", 0x5ccaca, 0x62 + +gUnknown_085CCB2C:: @ 85CCB2C + .incbin "baserom.gba", 0x5ccb2c, 0x10 + +gUnknown_085CCB3C:: @ 85CCB3C + .incbin "baserom.gba", 0x5ccb3c, 0x3d + +gUnknown_085CCB79:: @ 85CCB79 + .incbin "baserom.gba", 0x5ccb79, 0x6 + +gUnknown_085CCB7F:: @ 85CCB7F + .incbin "baserom.gba", 0x5ccb7f, 0x3 + +gUnknown_085CCB82:: @ 85CCB82 + .incbin "baserom.gba", 0x5ccb82, 0x2 + +gUnknown_085CCB84:: @ 85CCB84 + .incbin "baserom.gba", 0x5ccb84, 0x2 + +gUnknown_085CCB86:: @ 85CCB86 + .incbin "baserom.gba", 0x5ccb86, 0x2 + +gUnknown_085CCB88:: @ 85CCB88 + .incbin "baserom.gba", 0x5ccb88, 0x4 + +gUnknown_085CCB8C:: @ 85CCB8C + .incbin "baserom.gba", 0x5ccb8c, 0x4 + +gUnknown_085CCB90:: @ 85CCB90 + .incbin "baserom.gba", 0x5ccb90, 0x8 + +gUnknown_085CCB98:: @ 85CCB98 + .incbin "baserom.gba", 0x5ccb98, 0x6 + +gUnknown_085CCB9E:: @ 85CCB9E + .incbin "baserom.gba", 0x5ccb9e, 0x7 + +gUnknown_085CCBA5:: @ 85CCBA5 + .incbin "baserom.gba", 0x5ccba5, 0x8 + +gUnknown_085CCBAD:: @ 85CCBAD + .incbin "baserom.gba", 0x5ccbad, 0x8 + +gUnknown_085CCBB5:: @ 85CCBB5 + .incbin "baserom.gba", 0x5ccbb5, 0x4 + +gUnknown_085CCBB9:: @ 85CCBB9 + .incbin "baserom.gba", 0x5ccbb9, 0x3 + +gUnknown_085CCBBC:: @ 85CCBBC + .incbin "baserom.gba", 0x5ccbbc, 0x132 + +gUnknown_085CCCEE:: @ 85CCCEE + .incbin "baserom.gba", 0x5cccee, 0x32 + +gUnknown_085CCD20:: @ 85CCD20 + .incbin "baserom.gba", 0x5ccd20, 0x92 + +gUnknown_085CCDB2:: @ 85CCDB2 + .incbin "baserom.gba", 0x5ccdb2, 0x3 + +gUnknown_085CCDB5:: @ 85CCDB5 + .incbin "baserom.gba", 0x5ccdb5, 0x3 + +gUnknown_085CCDB8:: @ 85CCDB8 + .incbin "baserom.gba", 0x5ccdb8, 0x3 + +gUnknown_085CCDBB:: @ 85CCDBB + .incbin "baserom.gba", 0x5ccdbb, 0x5 + +gUnknown_085CCDC0:: @ 85CCDC0 + .incbin "baserom.gba", 0x5ccdc0, 0x6 + +gUnknown_085CCDC6:: @ 85CCDC6 + .incbin "baserom.gba", 0x5ccdc6, 0x5 + +gUnknown_085CCDCB:: @ 85CCDCB + .incbin "baserom.gba", 0x5ccdcb, 0x13 + +gUnknown_085CCDDE:: @ 85CCDDE + .incbin "baserom.gba", 0x5ccdde, 0x26 + +gUnknown_085CCE04:: @ 85CCE04 + .incbin "baserom.gba", 0x5cce04, 0x13 + +gUnknown_085CCE17:: @ 85CCE17 + .incbin "baserom.gba", 0x5cce17, 0x21 + +gUnknown_085CCE38:: @ 85CCE38 + .incbin "baserom.gba", 0x5cce38, 0x1b + +gUnknown_085CCE53:: @ 85CCE53 + .incbin "baserom.gba", 0x5cce53, 0x375 + +gUnknown_085CD1C8:: @ 85CD1C8 + .incbin "baserom.gba", 0x5cd1c8, 0x84 + +gUnknown_085CD24C:: @ 85CD24C + .incbin "baserom.gba", 0x5cd24c, 0x1b + +gUnknown_085CD267:: @ 85CD267 + .incbin "baserom.gba", 0x5cd267, 0x28 + +gUnknown_085CD28F:: @ 85CD28F + .incbin "baserom.gba", 0x5cd28f, 0x3c + +gUnknown_085CD2CB:: @ 85CD2CB + .incbin "baserom.gba", 0x5cd2cb, 0x36 + +gUnknown_085CD301:: @ 85CD301 + .incbin "baserom.gba", 0x5cd301, 0x17 + +gUnknown_085CD318:: @ 85CD318 + .incbin "baserom.gba", 0x5cd318, 0x1e + +gUnknown_085CD336:: @ 85CD336 + .incbin "baserom.gba", 0x5cd336, 0xec + +gUnknown_085CD422:: @ 85CD422 + .incbin "baserom.gba", 0x5cd422, 0x23e + +gUnknown_085CD660:: @ 85CD660 + .incbin "baserom.gba", 0x5cd660, 0x8 + +gUnknown_085CD668:: @ 85CD668 + .incbin "baserom.gba", 0x5cd668, 0x4 diff --git a/data/berry_tag_screen.s b/data/berry_tag_screen.s new file mode 100644 index 000000000..d507dfb98 --- /dev/null +++ b/data/berry_tag_screen.s @@ -0,0 +1,23 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_085EFCF0:: @ 85EFCF0 + .incbin "baserom.gba", 0x5efcf0, 0x10 + +gUnknown_085EFD00:: @ 85EFD00 + .incbin "baserom.gba", 0x5efd00, 0x20 + +gUnknown_085EFD20:: @ 85EFD20 + .incbin "baserom.gba", 0x5efd20, 0x8 + +gUnknown_085EFD28:: @ 85EFD28 + .incbin "baserom.gba", 0x5efd28, 0x28 + +gBerryFirmnessStringPointers:: @ 85EFD50 + .4byte gBerryFirmnessString_VerySoft + .4byte gBerryFirmnessString_Soft + .4byte gBerryFirmnessString_Hard + .4byte gBerryFirmnessString_VeryHard + .4byte gBerryFirmnessString_SuperHard diff --git a/data/bg.s b/data/bg.s new file mode 100644 index 000000000..2881d4347 --- /dev/null +++ b/data/bg.s @@ -0,0 +1,7 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gZeroedBgControlStruct:: @ 82E9580 + .4byte 0 diff --git a/data/braille_puzzles.s b/data/braille_puzzles.s new file mode 100644 index 000000000..36ebefb4f --- /dev/null +++ b/data/braille_puzzles.s @@ -0,0 +1,7 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_085EFE74:: @ 85EFE74 + .incbin "baserom.gba", 0x5efe74, 0x48 diff --git a/data/cable_car.s b/data/cable_car.s new file mode 100644 index 000000000..5fe7568c0 --- /dev/null +++ b/data/cable_car.s @@ -0,0 +1,49 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_085CD66C:: @ 85CD66C + .incbin "baserom.gba", 0x5cd66c, 0x10 + +gUnknown_085CD67C:: @ 85CD67C + .incbin "baserom.gba", 0x5cd67c, 0x158 + +gUnknown_085CD7D4:: @ 85CD7D4 + .incbin "baserom.gba", 0x5cd7d4, 0x184 + +gUnknown_085CD958:: @ 85CD958 + .incbin "baserom.gba", 0x5cd958, 0x1c4 + +gUnknown_085CDB1C:: @ 85CDB1C + .incbin "baserom.gba", 0x5cdb1c, 0x14 + +gUnknown_085CDB30:: @ 85CDB30 + .incbin "baserom.gba", 0x5cdb30, 0x24 + +gUnknown_085CDB54:: @ 85CDB54 + .incbin "baserom.gba", 0x5cdb54, 0x20 + +gUnknown_085CDB74:: @ 85CDB74 + .incbin "baserom.gba", 0x5cdb74, 0x28 + +gUnknown_085CDB9C:: @ 85CDB9C + .incbin "baserom.gba", 0x5cdb9c, 0x30 + +gUnknown_085CDBCC:: @ 85CDBCC + .incbin "baserom.gba", 0x5cdbcc, 0x18 + +gUnknown_085CDBE4:: @ 85CDBE4 + .incbin "baserom.gba", 0x5cdbe4, 0x2 + +gUnknown_085CDBE6:: @ 85CDBE6 + .incbin "baserom.gba", 0x5cdbe6, 0x4 + +gUnknown_085CDBEA:: @ 85CDBEA + .incbin "baserom.gba", 0x5cdbea, 0x8 + +gUnknown_085CDBF2:: @ 85CDBF2 + .incbin "baserom.gba", 0x5cdbf2, 0x6 + +gUnknown_085CDBF8:: @ 85CDBF8 + .incbin "baserom.gba", 0x5cdbf8, 0x8 diff --git a/data/clear_save_data_screen.s b/data/clear_save_data_screen.s new file mode 100644 index 000000000..a566152be --- /dev/null +++ b/data/clear_save_data_screen.s @@ -0,0 +1,13 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_085F06C0:: @ 85F06C0 + .incbin "baserom.gba", 0x5f06c0, 0x8 + +gUnknown_085F06C8:: @ 85F06C8 + .incbin "baserom.gba", 0x5f06c8, 0x10 + +gUnknown_085F06D8:: @ 85F06D8 + .incbin "baserom.gba", 0x5f06d8, 0x8 diff --git a/data/contest_ai.s b/data/contest_ai.s new file mode 100644 index 000000000..724fbfbfc --- /dev/null +++ b/data/contest_ai.s @@ -0,0 +1,7 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_085CDD00:: @ 85CDD00 + .incbin "baserom.gba", 0x5cdd00, 0x220 diff --git a/data/credits.s b/data/credits.s new file mode 100644 index 000000000..63565a24f --- /dev/null +++ b/data/credits.s @@ -0,0 +1,52 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_085E56F0:: @ 85E56F0 + .incbin "baserom.gba", 0x5e56f0, 0x80 + +gUnknown_085E5770:: @ 85E5770 + .incbin "baserom.gba", 0x5e5770, 0x43c + +gUnknown_085E5BAC:: @ 85E5BAC + .incbin "baserom.gba", 0x5e5bac, 0xf + +gUnknown_085E5BBB:: @ 85E5BBB + .incbin "baserom.gba", 0x5e5bbb, 0xf + +gUnknown_085E5BCA:: @ 85E5BCA + .incbin "baserom.gba", 0x5e5bca, 0xf + +gUnknown_085E5BD9:: @ 85E5BD9 + .incbin "baserom.gba", 0x5e5bd9, 0xf + +gUnknown_085E5BE8:: @ 85E5BE8 + .incbin "baserom.gba", 0x5e5be8, 0xf0c + +gUnknown_085E6AF4:: @ 85E6AF4 + .incbin "baserom.gba", 0x5e6af4, 0x474 + +gUnknown_085E6F68:: @ 85E6F68 + .incbin "baserom.gba", 0x5e6f68, 0x4 + +gUnknown_085E6F6C:: @ 85E6F6C + .incbin "baserom.gba", 0x5e6f6c, 0x10 + +gUnknown_085E6F7C:: @ 85E6F7C + .incbin "baserom.gba", 0x5e6f7c, 0x54 + +gUnknown_085E6FD0:: @ 85E6FD0 + .incbin "baserom.gba", 0x5e6fd0, 0x40 + +gUnknown_085E7010:: @ 85E7010 + .incbin "baserom.gba", 0x5e7010, 0xc + +gUnknown_085E701C:: @ 85E701C + .incbin "baserom.gba", 0x5e701c, 0x10 + +gUnknown_085E702C:: @ 85E702C + .incbin "baserom.gba", 0x5e702c, 0x3c + +gUnknown_085E7068:: @ 85E7068 + .incbin "baserom.gba", 0x5e7068, 0x18 diff --git a/data/data2.s b/data/data2.s index fc4f1c009..24fe6536e 100644 --- a/data/data2.s +++ b/data/data2.s @@ -5,197 +5,6 @@ .section .rodata -gUnknown_82E9530:: @ 82E9530 - .byte 3 - -gUnknown_82E9531:: @ 82E9531 - .byte 2 - - .align 2 -@ compile time - .asciz "2005 02 21 11:10" - - .align 2 -gRomInterruptTable:: @ 82E9548 - .4byte VCountIntr - .4byte SerialIntr - .4byte Timer3Intr - .4byte HBlankIntr - .4byte VBlankIntr - .4byte DummyIntrHandler - .4byte DummyIntrHandler - .4byte DummyIntrHandler - .4byte DummyIntrHandler - .4byte DummyIntrHandler - .4byte DummyIntrHandler - .4byte DummyIntrHandler - .4byte DummyIntrHandler - .4byte DummyIntrHandler - -gZeroedBgControlStruct:: @ 82E9580 - .4byte 0 - -gDummyWindowTemplate:: @ 82E9584 - window_template -1, 0, 0, 0, 0, 0, 0 - -gFontHalfRowOffsets:: @ 82E958C - .byte 0x00,0x01,0x02,0x00,0x03,0x04,0x05,0x03,0x06,0x07,0x08,0x06,0x00,0x01,0x02,0x00 - .byte 0x09,0x0a,0x0b,0x09,0x0c,0x0d,0x0e,0x0c,0x0f,0x10,0x11,0x0f,0x09,0x0a,0x0b,0x09 - .byte 0x12,0x13,0x14,0x12,0x15,0x16,0x17,0x15,0x18,0x19,0x1a,0x18,0x12,0x13,0x14,0x12 - .byte 0x00,0x01,0x02,0x00,0x03,0x04,0x05,0x03,0x06,0x07,0x08,0x06,0x00,0x01,0x02,0x00 - .byte 0x1b,0x1c,0x1d,0x1b,0x1e,0x1f,0x20,0x1e,0x21,0x22,0x23,0x21,0x1b,0x1c,0x1d,0x1b - .byte 0x24,0x25,0x26,0x24,0x27,0x28,0x29,0x27,0x2a,0x2b,0x2c,0x2a,0x24,0x25,0x26,0x24 - .byte 0x2d,0x2e,0x2f,0x2d,0x30,0x31,0x32,0x30,0x33,0x34,0x35,0x33,0x2d,0x2e,0x2f,0x2d - .byte 0x1b,0x1c,0x1d,0x1b,0x1e,0x1f,0x20,0x1e,0x21,0x22,0x23,0x21,0x1b,0x1c,0x1d,0x1b - .byte 0x36,0x37,0x38,0x36,0x39,0x3a,0x3b,0x39,0x3c,0x3d,0x3e,0x3c,0x36,0x37,0x38,0x36 - .byte 0x3f,0x40,0x41,0x3f,0x42,0x43,0x44,0x42,0x45,0x46,0x47,0x45,0x3f,0x40,0x41,0x3f - .byte 0x48,0x49,0x4a,0x48,0x4b,0x4c,0x4d,0x4b,0x4e,0x4f,0x50,0x4e,0x48,0x49,0x4a,0x48 - .byte 0x36,0x37,0x38,0x36,0x39,0x3a,0x3b,0x39,0x3c,0x3d,0x3e,0x3c,0x36,0x37,0x38,0x36 - .byte 0x00,0x01,0x02,0x00,0x03,0x04,0x05,0x03,0x06,0x07,0x08,0x06,0x00,0x01,0x02,0x00 - .byte 0x09,0x0a,0x0b,0x09,0x0c,0x0d,0x0e,0x0c,0x0f,0x10,0x11,0x0f,0x09,0x0a,0x0b,0x09 - .byte 0x12,0x13,0x14,0x12,0x15,0x16,0x17,0x15,0x18,0x19,0x1a,0x18,0x12,0x13,0x14,0x12 - .byte 0x00,0x01,0x02,0x00,0x03,0x04,0x05,0x03,0x06,0x07,0x08,0x06,0x00,0x01,0x02,0x00 - -gDownArrowTiles:: @ 82E968C - .incbin "baserom.gba", 0x2e968c, 0xc0 - -gDarkDownArrowTiles:: @ 82E974C - .incbin "baserom.gba", 0x2e974c, 0xc0 - -@ Seemingly unreferenced data. It contains some kind of arrow graphics. - .incbin "baserom.gba", 0x2e980c, 0x500 - -gDownArrowYCoords:: @ 82E9D0C - .byte 0, 1, 2, 1 - -gWindowVerticalScrollSpeeds:: @ 82E9D10 - .byte 1, 2, 4, 0 - -gGlyphWidthFuncs:: @ 82E9D14 - glyph_width_func 0, GetGlyphWidthFont0+1 - glyph_width_func 1, GetGlyphWidthFont1+1 - glyph_width_func 2, GetGlyphWidthFont2+1 - glyph_width_func 3, GetGlyphWidthFont2+1 - glyph_width_func 4, GetGlyphWidthFont2+1 - glyph_width_func 5, GetGlyphWidthFont2+1 - glyph_width_func 6, GetGlyphWidthFont6+1 - glyph_width_func 7, GetGlyphWidthFont7+1 - glyph_width_func 8, GetGlyphWidthFont8+1 - -gKeypadIcons:: @ 82E9D5C - keypad_icon 0x0, 8, 12 - keypad_icon 0x1, 8, 12 - keypad_icon 0x2, 16, 12 - keypad_icon 0x4, 16, 12 - keypad_icon 0x6, 24, 12 - keypad_icon 0x9, 24, 12 - keypad_icon 0xC, 8, 12 - keypad_icon 0xD, 8, 12 - keypad_icon 0xE, 8, 12 - keypad_icon 0xF, 8, 12 - keypad_icon 0x20, 8, 12 - keypad_icon 0x21, 8, 12 - keypad_icon 0x22, 8, 12 - -gKeypadIconTiles:: @ 82E9D90 - .incbin "baserom.gba", 0x2e9d90, 0x800 - -gFontInfos:: @ 82EA590 - font_info Font0Func+1, 5, 12, 0, 0, 2, 3, 1 - font_info Font1Func+1, 6, 16, 0, 0, 2, 3, 1 - font_info Font2Func+1, 6, 14, 0, 0, 2, 3, 1 - font_info Font3Func+1, 6, 14, 0, 0, 2, 3, 1 - font_info Font4Func+1, 6, 14, 0, 0, 2, 3, 1 - font_info Font5Func+1, 6, 14, 0, 0, 2, 3, 1 - font_info Font6Func+1, 8, 16, 0, 8, 2, 3, 1 - font_info Font7Func+1, 5, 16, 0, 0, 2, 3, 1 - font_info Font8Func+1, 5, 8, 0, 0, 2, 3, 1 - font_info 0, 8, 8, 0, 0, 1, 15, 2 - -gMenuCursorDimensions:: @ 82EA608 - .byte 8, 12 - .byte 8, 15 - .byte 8, 14 - .byte 8, 14 - .byte 8, 14 - .byte 8, 14 - .byte 8, 16 - .byte 8, 15 - .byte 8, 8 - .byte 0, 0 - - .align 2 -gFont9JapaneseGlyphs:: @ 82EA61C - .incbin "data/graphics/fonts/font9.hwjpnfont" - -@ Unreferenced data. This also comes before the gpu_bg.s data in Ruby and seems -@ to be unreferenced there too. - .incbin "baserom.gba", 0x2ec61c, 0x18 - -gUnknown_082EC634:: @ 82EC634 - .incbin "baserom.gba", 0x2ec634, 0x18 - -gUnknown_082EC64C:: @ 82EC64C - .incbin "baserom.gba", 0x2ec64c, 0x44 - -@ off-screen and low priority relative to background -gDefaultOamAttributes:: @ 82EC690 - .2byte 160 @ Y - .2byte 304 @ X - .2byte 3 << 10 @ priority - - .align 2 -gDummyObjectImageAnim:: @ 82EC698 - obj_image_anim_end - - .align 2 -gDummyObjectImageAnimTable:: @ 82EC69C - .4byte gDummyObjectImageAnim - - .align 2 -gDummyObjectRotScalAnim:: @ 82EC6A0 - obj_rot_scal_anim_end - - .align 2 -gDummyObjectRotScalAnimTable:: @ 82EC6A8 - .4byte gDummyObjectRotScalAnim - -gUnknown_082EC6AC:: @ 82EC6AC - .incbin "baserom.gba", 0x2ec6ac, 0x18 - -gUnknown_082EC6C4:: @ 82EC6C4 - .incbin "baserom.gba", 0x2ec6c4, 0x8 - -gUnknown_082EC6CC:: @ 82EC6CC - .incbin "baserom.gba", 0x2ec6cc, 0x8 - -gUnknown_082EC6D4:: @ 82EC6D4 - .incbin "baserom.gba", 0x2ec6d4, 0x10 - -gUnknown_082EC6E4:: @ 82EC6E4 - .incbin "baserom.gba", 0x2ec6e4, 0x10 - -gUnknown_082EC6F4:: @ 82EC6F4 - .incbin "baserom.gba", 0x2ec6f4, 0x60 - -gUnknown_082EC754:: @ 82EC754 - .incbin "baserom.gba", 0x2ec754, 0x70 - -gUnknown_82EC7C4:: @ 82EC7C4 - .2byte 0x0100 - .2byte 0x0200 - .2byte 0x0400 - .2byte 0x0800 - -gUnknown_82EC7CC:: @ 82EC7CC - .2byte 0x0001 - .2byte 0x0002 - .2byte 0x0004 - .2byte 0x0008 - -@ 82EC7D4 - .include "data/string_util.inc" - .align 2 gUnknown_082EC86C:: @ 82EC86C .incbin "baserom.gba", 0x2ec86c, 0x20 @@ -1726,7 +1535,7 @@ gUnknown_08329F40:: @ 8329F40 gUnknown_0832A1C0:: @ 832A1C0 .incbin "baserom.gba", 0x32a1c0, 0x168 -gUnknown_0832A328:: @ 832A328 +gBitTable:: @ 832A328 .incbin "baserom.gba", 0x32a328, 0x80 gUnknown_0832A3A8:: @ 832A3A8 @@ -6678,5537 +6487,4 @@ gUnknown_085C9A53:: @ 85C9A53 .incbin "baserom.gba", 0x5c9a53, 0x41 gUnknown_085C9A94:: @ 85C9A94 - .incbin "baserom.gba", 0x5c9a94, 0x990 - -gUnknown_085CA424:: @ 85CA424 - .incbin "baserom.gba", 0x5ca424, 0x35 - -gUnknown_085CA459:: @ 85CA459 - .incbin "baserom.gba", 0x5ca459, 0xe48 - -gUnknown_085CB2A1:: @ 85CB2A1 - .incbin "baserom.gba", 0x5cb2a1, 0xe9 - -gUnknown_085CB38A:: @ 85CB38A - .incbin "baserom.gba", 0x5cb38a, 0x20 - -gUnknown_085CB3AA:: @ 85CB3AA - .incbin "baserom.gba", 0x5cb3aa, 0x120 - -gUnknown_085CB4CA:: @ 85CB4CA - .incbin "baserom.gba", 0x5cb4ca, 0x5a - -gUnknown_085CB524:: @ 85CB524 - .incbin "baserom.gba", 0x5cb524, 0x14 - -gUnknown_085CB538:: @ 85CB538 - .incbin "baserom.gba", 0x5cb538, 0x17 - -gUnknown_085CB54F:: @ 85CB54F - .incbin "baserom.gba", 0x5cb54f, 0x18 - -gUnknown_085CB567:: @ 85CB567 - .incbin "baserom.gba", 0x5cb567, 0x1a - -gUnknown_085CB581:: @ 85CB581 - .incbin "baserom.gba", 0x5cb581, 0x25 - -gUnknown_085CB5A6:: @ 85CB5A6 - .incbin "baserom.gba", 0x5cb5a6, 0x2c - -gUnknown_085CB5D2:: @ 85CB5D2 - .incbin "baserom.gba", 0x5cb5d2, 0xd - -gUnknown_085CB5DF:: @ 85CB5DF - .incbin "baserom.gba", 0x5cb5df, 0x44f - -gUnknown_085CBA2E:: @ 85CBA2E - .incbin "baserom.gba", 0x5cba2e, 0x119 - -gUnknown_085CBB47:: @ 85CBB47 - .incbin "baserom.gba", 0x5cbb47, 0x13 - -gUnknown_085CBB5A:: @ 85CBB5A - .incbin "baserom.gba", 0x5cbb5a, 0x13 - -gUnknown_085CBB6D:: @ 85CBB6D - .incbin "baserom.gba", 0x5cbb6d, 0x15 - -gUnknown_085CBB82:: @ 85CBB82 - .incbin "baserom.gba", 0x5cbb82, 0x1a - -gUnknown_085CBB9C:: @ 85CBB9C - .incbin "baserom.gba", 0x5cbb9c, 0x1d - -gUnknown_085CBBB9:: @ 85CBBB9 - .incbin "baserom.gba", 0x5cbbb9, 0x14 - -gUnknown_085CBBCD:: @ 85CBBCD - .incbin "baserom.gba", 0x5cbbcd, 0x1a - -gUnknown_085CBBE7:: @ 85CBBE7 - .incbin "baserom.gba", 0x5cbbe7, 0x13 - -gUnknown_085CBBFA:: @ 85CBBFA - .incbin "baserom.gba", 0x5cbbfa, 0x1a - -gUnknown_085CBC14:: @ 85CBC14 - .incbin "baserom.gba", 0x5cbc14, 0x13 - -gUnknown_085CBC27:: @ 85CBC27 - .incbin "baserom.gba", 0x5cbc27, 0x10 - -gUnknown_085CBC37:: @ 85CBC37 - .incbin "baserom.gba", 0x5cbc37, 0x17 - -gUnknown_085CBC4E:: @ 85CBC4E - .incbin "baserom.gba", 0x5cbc4e, 0x20 - -gUnknown_085CBC6E:: @ 85CBC6E - .incbin "baserom.gba", 0x5cbc6e, 0x10 - -gUnknown_085CBC7E:: @ 85CBC7E - .incbin "baserom.gba", 0x5cbc7e, 0x10 - -gUnknown_085CBC8E:: @ 85CBC8E - .incbin "baserom.gba", 0x5cbc8e, 0x8 - -gUnknown_085CBC96:: @ 85CBC96 - .incbin "baserom.gba", 0x5cbc96, 0xf - -gUnknown_085CBCA5:: @ 85CBCA5 - .incbin "baserom.gba", 0x5cbca5, 0x8 - -gUnknown_085CBCAD:: @ 85CBCAD - .incbin "baserom.gba", 0x5cbcad, 0xb - -gUnknown_085CBCB8:: @ 85CBCB8 - .incbin "baserom.gba", 0x5cbcb8, 0xf - -gUnknown_085CBCC7:: @ 85CBCC7 - .incbin "baserom.gba", 0x5cbcc7, 0x1e - -gUnknown_085CBCE5:: @ 85CBCE5 - .incbin "baserom.gba", 0x5cbce5, 0x18 - -gUnknown_085CBCFD:: @ 85CBCFD - .incbin "baserom.gba", 0x5cbcfd, 0x1e - -gUnknown_085CBD1B:: @ 85CBD1B - .incbin "baserom.gba", 0x5cbd1b, 0xf - -gUnknown_085CBD2A:: @ 85CBD2A - .incbin "baserom.gba", 0x5cbd2a, 0x13 - -gUnknown_085CBD3D:: @ 85CBD3D - .incbin "baserom.gba", 0x5cbd3d, 0x15 - -gUnknown_085CBD52:: @ 85CBD52 - .incbin "baserom.gba", 0x5cbd52, 0x13 - -gUnknown_085CBD65:: @ 85CBD65 - .incbin "baserom.gba", 0x5cbd65, 0x10 - -gUnknown_085CBD75:: @ 85CBD75 - .incbin "baserom.gba", 0x5cbd75, 0x10 - -gUnknown_085CBD85:: @ 85CBD85 - .incbin "baserom.gba", 0x5cbd85, 0x6 - -gUnknown_085CBD8B:: @ 85CBD8B - .incbin "baserom.gba", 0x5cbd8b, 0x6 - -gUnknown_085CBD91:: @ 85CBD91 - .incbin "baserom.gba", 0x5cbd91, 0x4 - -gUnknown_085CBD95:: @ 85CBD95 - .incbin "baserom.gba", 0x5cbd95, 0x5 - -gUnknown_085CBD9A:: @ 85CBD9A - .incbin "baserom.gba", 0x5cbd9a, 0x4 - -gUnknown_085CBD9E:: @ 85CBD9E - .incbin "baserom.gba", 0x5cbd9e, 0x5 - -gUnknown_085CBDA3:: @ 85CBDA3 - .incbin "baserom.gba", 0x5cbda3, 0x4 - -gUnknown_085CBDA7:: @ 85CBDA7 - .incbin "baserom.gba", 0x5cbda7, 0x5 - -gUnknown_085CBDAC:: @ 85CBDAC - .incbin "baserom.gba", 0x5cbdac, 0xb - -gUnknown_085CBDB7:: @ 85CBDB7 - .incbin "baserom.gba", 0x5cbdb7, 0x2 - -gUnknown_085CBDB9:: @ 85CBDB9 - .incbin "baserom.gba", 0x5cbdb9, 0x2 - -gUnknown_085CBDBB:: @ 85CBDBB - .incbin "baserom.gba", 0x5cbdbb, 0x2 - -gUnknown_085CBDBD:: @ 85CBDBD - .incbin "baserom.gba", 0x5cbdbd, 0x2 - -gUnknown_085CBDBF:: @ 85CBDBF - .incbin "baserom.gba", 0x5cbdbf, 0x41 - -gUnknown_085CBE00:: @ 85CBE00 - .incbin "baserom.gba", 0x5cbe00, 0x6c - -gUnknown_085CBE6C:: @ 85CBE6C - .incbin "baserom.gba", 0x5cbe6c, 0x1a9 - -gUnknown_085CC015:: @ 85CC015 - .incbin "baserom.gba", 0x5cc015, 0xa - -gUnknown_085CC01F:: @ 85CC01F - .incbin "baserom.gba", 0x5cc01f, 0x81 - -gUnknown_085CC0A0:: @ 85CC0A0 - .incbin "baserom.gba", 0x5cc0a0, 0xd - -gUnknown_085CC0AD:: @ 85CC0AD - .incbin "baserom.gba", 0x5cc0ad, 0x191 - -gUnknown_085CC23E:: @ 85CC23E - .incbin "baserom.gba", 0x5cc23e, 0x32 - -gUnknown_085CC270:: @ 85CC270 - .incbin "baserom.gba", 0x5cc270, 0x5c4 - -gUnknown_085CC834:: @ 85CC834 - .incbin "baserom.gba", 0x5cc834, 0x14e - -gUnknown_085CC982:: @ 85CC982 - .incbin "baserom.gba", 0x5cc982, 0xe - -gUnknown_085CC990:: @ 85CC990 - .incbin "baserom.gba", 0x5cc990, 0x16 - -gUnknown_085CC9A6:: @ 85CC9A6 - .incbin "baserom.gba", 0x5cc9a6, 0x2d - -gUnknown_085CC9D3:: @ 85CC9D3 - .incbin "baserom.gba", 0x5cc9d3, 0x1b - -gUnknown_085CC9EE:: @ 85CC9EE - .incbin "baserom.gba", 0x5cc9ee, 0x5 - -gUnknown_085CC9F3:: @ 85CC9F3 - .incbin "baserom.gba", 0x5cc9f3, 0x11 - -gUnknown_085CCA04:: @ 85CCA04 - .incbin "baserom.gba", 0x5cca04, 0x11 - -gUnknown_085CCA15:: @ 85CCA15 - .incbin "baserom.gba", 0x5cca15, 0x14 - -gUnknown_085CCA29:: @ 85CCA29 - .incbin "baserom.gba", 0x5cca29, 0x11 - -gUnknown_085CCA3A:: @ 85CCA3A - .incbin "baserom.gba", 0x5cca3a, 0x1a - -gUnknown_085CCA54:: @ 85CCA54 - .incbin "baserom.gba", 0x5cca54, 0x1b - -gUnknown_085CCA6F:: @ 85CCA6F - .incbin "baserom.gba", 0x5cca6f, 0x4 - -gUnknown_085CCA73:: @ 85CCA73 - .incbin "baserom.gba", 0x5cca73, 0x48 - -gUnknown_085CCABB:: @ 85CCABB - .incbin "baserom.gba", 0x5ccabb, 0xf - -gUnknown_085CCACA:: @ 85CCACA - .incbin "baserom.gba", 0x5ccaca, 0x62 - -gUnknown_085CCB2C:: @ 85CCB2C - .incbin "baserom.gba", 0x5ccb2c, 0x10 - -gUnknown_085CCB3C:: @ 85CCB3C - .incbin "baserom.gba", 0x5ccb3c, 0x3d - -gUnknown_085CCB79:: @ 85CCB79 - .incbin "baserom.gba", 0x5ccb79, 0x6 - -gUnknown_085CCB7F:: @ 85CCB7F - .incbin "baserom.gba", 0x5ccb7f, 0x3 - -gUnknown_085CCB82:: @ 85CCB82 - .incbin "baserom.gba", 0x5ccb82, 0x2 - -gUnknown_085CCB84:: @ 85CCB84 - .incbin "baserom.gba", 0x5ccb84, 0x2 - -gUnknown_085CCB86:: @ 85CCB86 - .incbin "baserom.gba", 0x5ccb86, 0x2 - -gUnknown_085CCB88:: @ 85CCB88 - .incbin "baserom.gba", 0x5ccb88, 0x4 - -gUnknown_085CCB8C:: @ 85CCB8C - .incbin "baserom.gba", 0x5ccb8c, 0x4 - -gUnknown_085CCB90:: @ 85CCB90 - .incbin "baserom.gba", 0x5ccb90, 0x8 - -gUnknown_085CCB98:: @ 85CCB98 - .incbin "baserom.gba", 0x5ccb98, 0x6 - -gUnknown_085CCB9E:: @ 85CCB9E - .incbin "baserom.gba", 0x5ccb9e, 0x7 - -gUnknown_085CCBA5:: @ 85CCBA5 - .incbin "baserom.gba", 0x5ccba5, 0x8 - -gUnknown_085CCBAD:: @ 85CCBAD - .incbin "baserom.gba", 0x5ccbad, 0x8 - -gUnknown_085CCBB5:: @ 85CCBB5 - .incbin "baserom.gba", 0x5ccbb5, 0x4 - -gUnknown_085CCBB9:: @ 85CCBB9 - .incbin "baserom.gba", 0x5ccbb9, 0x3 - -gUnknown_085CCBBC:: @ 85CCBBC - .incbin "baserom.gba", 0x5ccbbc, 0x132 - -gUnknown_085CCCEE:: @ 85CCCEE - .incbin "baserom.gba", 0x5cccee, 0x32 - -gUnknown_085CCD20:: @ 85CCD20 - .incbin "baserom.gba", 0x5ccd20, 0x92 - -gUnknown_085CCDB2:: @ 85CCDB2 - .incbin "baserom.gba", 0x5ccdb2, 0x3 - -gUnknown_085CCDB5:: @ 85CCDB5 - .incbin "baserom.gba", 0x5ccdb5, 0x3 - -gUnknown_085CCDB8:: @ 85CCDB8 - .incbin "baserom.gba", 0x5ccdb8, 0x3 - -gUnknown_085CCDBB:: @ 85CCDBB - .incbin "baserom.gba", 0x5ccdbb, 0x5 - -gUnknown_085CCDC0:: @ 85CCDC0 - .incbin "baserom.gba", 0x5ccdc0, 0x6 - -gUnknown_085CCDC6:: @ 85CCDC6 - .incbin "baserom.gba", 0x5ccdc6, 0x5 - -gUnknown_085CCDCB:: @ 85CCDCB - .incbin "baserom.gba", 0x5ccdcb, 0x13 - -gUnknown_085CCDDE:: @ 85CCDDE - .incbin "baserom.gba", 0x5ccdde, 0x26 - -gUnknown_085CCE04:: @ 85CCE04 - .incbin "baserom.gba", 0x5cce04, 0x13 - -gUnknown_085CCE17:: @ 85CCE17 - .incbin "baserom.gba", 0x5cce17, 0x21 - -gUnknown_085CCE38:: @ 85CCE38 - .incbin "baserom.gba", 0x5cce38, 0x1b - -gUnknown_085CCE53:: @ 85CCE53 - .incbin "baserom.gba", 0x5cce53, 0x375 - -gUnknown_085CD1C8:: @ 85CD1C8 - .incbin "baserom.gba", 0x5cd1c8, 0x84 - -gUnknown_085CD24C:: @ 85CD24C - .incbin "baserom.gba", 0x5cd24c, 0x1b - -gUnknown_085CD267:: @ 85CD267 - .incbin "baserom.gba", 0x5cd267, 0x28 - -gUnknown_085CD28F:: @ 85CD28F - .incbin "baserom.gba", 0x5cd28f, 0x3c - -gUnknown_085CD2CB:: @ 85CD2CB - .incbin "baserom.gba", 0x5cd2cb, 0x36 - -gUnknown_085CD301:: @ 85CD301 - .incbin "baserom.gba", 0x5cd301, 0x17 - -gUnknown_085CD318:: @ 85CD318 - .incbin "baserom.gba", 0x5cd318, 0x1e - -gUnknown_085CD336:: @ 85CD336 - .incbin "baserom.gba", 0x5cd336, 0xec - -gUnknown_085CD422:: @ 85CD422 - .incbin "baserom.gba", 0x5cd422, 0x23e - -gUnknown_085CD660:: @ 85CD660 - .incbin "baserom.gba", 0x5cd660, 0x8 - -gUnknown_085CD668:: @ 85CD668 - .incbin "baserom.gba", 0x5cd668, 0x4 - -gUnknown_085CD66C:: @ 85CD66C - .incbin "baserom.gba", 0x5cd66c, 0x10 - -gUnknown_085CD67C:: @ 85CD67C - .incbin "baserom.gba", 0x5cd67c, 0x158 - -gUnknown_085CD7D4:: @ 85CD7D4 - .incbin "baserom.gba", 0x5cd7d4, 0x184 - -gUnknown_085CD958:: @ 85CD958 - .incbin "baserom.gba", 0x5cd958, 0x1c4 - -gUnknown_085CDB1C:: @ 85CDB1C - .incbin "baserom.gba", 0x5cdb1c, 0x14 - -gUnknown_085CDB30:: @ 85CDB30 - .incbin "baserom.gba", 0x5cdb30, 0x24 - -gUnknown_085CDB54:: @ 85CDB54 - .incbin "baserom.gba", 0x5cdb54, 0x20 - -gUnknown_085CDB74:: @ 85CDB74 - .incbin "baserom.gba", 0x5cdb74, 0x28 - -gUnknown_085CDB9C:: @ 85CDB9C - .incbin "baserom.gba", 0x5cdb9c, 0x30 - -gUnknown_085CDBCC:: @ 85CDBCC - .incbin "baserom.gba", 0x5cdbcc, 0x18 - -gUnknown_085CDBE4:: @ 85CDBE4 - .incbin "baserom.gba", 0x5cdbe4, 0x2 - -gUnknown_085CDBE6:: @ 85CDBE6 - .incbin "baserom.gba", 0x5cdbe6, 0x4 - -gUnknown_085CDBEA:: @ 85CDBEA - .incbin "baserom.gba", 0x5cdbea, 0x8 - -gUnknown_085CDBF2:: @ 85CDBF2 - .incbin "baserom.gba", 0x5cdbf2, 0x6 - -gUnknown_085CDBF8:: @ 85CDBF8 - .incbin "baserom.gba", 0x5cdbf8, 0x8 - -gUnknown_085CDC00:: @ 85CDC00 - .incbin "baserom.gba", 0x5cdc00, 0x38 - -gUnknown_085CDC38:: @ 85CDC38 - .incbin "baserom.gba", 0x5cdc38, 0x6 - -gUnknown_085CDC3E:: @ 85CDC3E - .incbin "baserom.gba", 0x5cdc3e, 0x4 - -gUnknown_085CDC42:: @ 85CDC42 - .incbin "baserom.gba", 0x5cdc42, 0xa - -gUnknown_085CDC4C:: @ 85CDC4C - .incbin "baserom.gba", 0x5cdc4c, 0x8 - -gUnknown_085CDC54:: @ 85CDC54 - .incbin "baserom.gba", 0x5cdc54, 0xc - -gUnknown_085CDC60:: @ 85CDC60 - .incbin "baserom.gba", 0x5cdc60, 0xa - -gUnknown_085CDC6A:: @ 85CDC6A - .incbin "baserom.gba", 0x5cdc6a, 0x96 - -gUnknown_085CDD00:: @ 85CDD00 - .incbin "baserom.gba", 0x5cdd00, 0x220 - -gUnknown_085CDF20:: @ 85CDF20 - .incbin "baserom.gba", 0x5cdf20, 0x380 - -gUnknown_085CE2A0:: @ 85CE2A0 - .incbin "baserom.gba", 0x5ce2a0, 0xb0 - -gUnknown_085CE350:: @ 85CE350 - .incbin "baserom.gba", 0x5ce350, 0x38 - -gUnknown_085CE388:: @ 85CE388 - .incbin "baserom.gba", 0x5ce388, 0x18 - -gUnknown_085CE3A0:: @ 85CE3A0 - .incbin "baserom.gba", 0x5ce3a0, 0x18 - -gUnknown_085CE3B8:: @ 85CE3B8 - .incbin "baserom.gba", 0x5ce3b8, 0x28 - -gUnknown_085CE3E0:: @ 85CE3E0 - .incbin "baserom.gba", 0x5ce3e0, 0x50 - -gUnknown_085CE430:: @ 85CE430 - .incbin "baserom.gba", 0x5ce430, 0x30 - -gUnknown_085CE460:: @ 85CE460 - .incbin "baserom.gba", 0x5ce460, 0x2c - -gUnknown_085CE48C:: @ 85CE48C - .incbin "baserom.gba", 0x5ce48c, 0x18 - -gUnknown_085CE4A4:: @ 85CE4A4 - .incbin "baserom.gba", 0x5ce4a4, 0x4 - -gUnknown_085CE4A8:: @ 85CE4A8 - .incbin "baserom.gba", 0x5ce4a8, 0x8 - -gUnknown_085CE4B0:: @ 85CE4B0 - .incbin "baserom.gba", 0x5ce4b0, 0x140 - -gUnknown_085CE5F0:: @ 85CE5F0 - .incbin "baserom.gba", 0x5ce5f0, 0x15c - -gUnknown_085CE74C:: @ 85CE74C - .incbin "baserom.gba", 0x5ce74c, 0x20 - -gUnknown_085CE76C:: @ 85CE76C - .incbin "baserom.gba", 0x5ce76c, 0x18 - -gUnknown_085CE784:: @ 85CE784 - .incbin "baserom.gba", 0x5ce784, 0x68 - -gUnknown_085CE7EC:: @ 85CE7EC - .incbin "baserom.gba", 0x5ce7ec, 0x60 - -gUnknown_085CE84C:: @ 85CE84C - .incbin "baserom.gba", 0x5ce84c, 0x30 - -gUnknown_085CE87C:: @ 85CE87C - .incbin "baserom.gba", 0x5ce87c, 0x14c - -gUnknown_085CE9C8:: @ 85CE9C8 - .incbin "baserom.gba", 0x5ce9c8, 0x1e8 - -gUnknown_085CEBB0:: @ 85CEBB0 - .incbin "baserom.gba", 0x5cebb0, 0x8 - -gUnknown_085CEBB8:: @ 85CEBB8 - .incbin "baserom.gba", 0x5cebb8, 0x8 - -gUnknown_085CEBC0:: @ 85CEBC0 - .incbin "baserom.gba", 0x5cebc0, 0x10 - -gUnknown_085CEBD0:: @ 85CEBD0 - .incbin "baserom.gba", 0x5cebd0, 0x40 - -gUnknown_085CEC10:: @ 85CEC10 - .incbin "baserom.gba", 0x5cec10, 0x18 - -gUnknown_085CEC28:: @ 85CEC28 - .incbin "baserom.gba", 0x5cec28, 0x8 - -gUnknown_085CEC30:: @ 85CEC30 - .incbin "baserom.gba", 0x5cec30, 0x80 - -@ 85CECB0 - .include "data/battle_frontier/battle_frontier_held_items.inc" - -@ 85CED2E - .include "data/battle_frontier/battle_frontier_trainer_mons.inc" - -@ 85D5ACC - .include "data/battle_frontier/battle_frontier_trainers.inc" - -@ 85D97BC - .include "data/battle_frontier/battle_frontier_mons.inc" - -gUnknown_085DCEDC:: @ 85DCEDC - .incbin "baserom.gba", 0x5dcedc, 0x1e - -gUnknown_085DCEFA:: @ 85DCEFA - .incbin "baserom.gba", 0x5dcefa, 0x14 - -gUnknown_085DCF0E:: @ 85DCF0E - .incbin "baserom.gba", 0x5dcf0e, 0x1e - -gUnknown_085DCF2C:: @ 85DCF2C - .incbin "baserom.gba", 0x5dcf2c, 0x14 - -gUnknown_085DCF40:: @ 85DCF40 - .incbin "baserom.gba", 0x5dcf40, 0x5c0 - -gUnknown_085DD500:: @ 85DD500 - .incbin "baserom.gba", 0x5dd500, 0x190 - -gUnknown_085DD690:: @ 85DD690 - .incbin "baserom.gba", 0x5dd690, 0x40 - -gUnknown_085DD6D0:: @ 85DD6D0 - .incbin "baserom.gba", 0x5dd6d0, 0x5 - -gUnknown_085DD6D5:: @ 85DD6D5 - .incbin "baserom.gba", 0x5dd6d5, 0x7 - -gUnknown_085DD6DC:: @ 85DD6DC - .incbin "baserom.gba", 0x5dd6dc, 0x30 - -@ 85DD70C - .include "data/battle_frontier/slateport_battle_tent_trainer_mons.inc" - -@ 85DDA14 - .include "data/battle_frontier/slateport_battle_tent_trainers.inc" - -@ 85DE02C - .include "data/battle_frontier/slateport_battle_tent_mons.inc" - -@ 85DE48C - .include "data/battle_frontier/verdanturf_battle_tent_trainer_mons.inc" - -@ 85DE610 - .include "data/battle_frontier/verdanturf_battle_tent_trainers.inc" - -@ 85DEC28 - .include "data/battle_frontier/verdanturf_battle_tent_mons.inc" - -@ 85DEEF8 - .include "data/battle_frontier/fallarbor_battle_tent_trainer_mons.inc" - -@ 85DF084 - .include "data/battle_frontier/fallarbor_battle_tent_trainers.inc" - -@ 85DF69C - .include "data/battle_frontier/fallarbor_battle_tent_mons.inc" - -gUnknown_085DF96C:: @ 85DF96C - .incbin "baserom.gba", 0x5df96c, 0x40 - -gUnknown_085DF9AC:: @ 85DF9AC - .incbin "baserom.gba", 0x5df9ac, 0x20 - -gUnknown_085DF9CC:: @ 85DF9CC - .incbin "baserom.gba", 0x5df9cc, 0x20 - -gUnknown_085DF9EC:: @ 85DF9EC - .incbin "baserom.gba", 0x5df9ec, 0xa - -gUnknown_085DF9F6:: @ 85DF9F6 - .incbin "baserom.gba", 0x5df9f6, 0x4 - -gUnknown_085DF9FA:: @ 85DF9FA - .incbin "baserom.gba", 0x5df9fa, 0x20 - -gUnknown_085DFA1A:: @ 85DFA1A - .incbin "baserom.gba", 0x5dfa1a, 0x28 - -gUnknown_085DFA42:: @ 85DFA42 - .incbin "baserom.gba", 0x5dfa42, 0x4 - -gUnknown_085DFA46:: @ 85DFA46 - .incbin "baserom.gba", 0x5dfa46, 0xc - -gUnknown_085DFA52:: @ 85DFA52 - .incbin "baserom.gba", 0x5dfa52, 0xe - -gUnknown_085DFA60:: @ 85DFA60 - .incbin "baserom.gba", 0x5dfa60, 0x20 - -gUnknown_085DFA80:: @ 85DFA80 - .incbin "baserom.gba", 0x5dfa80, 0xe0 - -gUnknown_085DFB60:: @ 85DFB60 - .incbin "baserom.gba", 0x5dfb60, 0xac - -gUnknown_085DFC0C:: @ 85DFC0C - .incbin "baserom.gba", 0x5dfc0c, 0xa4 - -gUnknown_085DFCB0:: @ 85DFCB0 - .incbin "baserom.gba", 0x5dfcb0, 0x14 - -gUnknown_085DFCC4:: @ 85DFCC4 - .incbin "baserom.gba", 0x5dfcc4, 0x5 - -gUnknown_085DFCC9:: @ 85DFCC9 - .incbin "baserom.gba", 0x5dfcc9, 0x3 - -gUnknown_085DFCCC:: @ 85DFCCC - .incbin "baserom.gba", 0x5dfccc, 0x10 - -gUnknown_085DFCDC:: @ 85DFCDC - .incbin "baserom.gba", 0x5dfcdc, 0x20 - -gUnknown_085DFCFC:: @ 85DFCFC - .incbin "baserom.gba", 0x5dfcfc, 0x8 - -gUnknown_085DFD04:: @ 85DFD04 - .incbin "baserom.gba", 0x5dfd04, 0x14 - -gUnknown_085DFD18:: @ 85DFD18 - .incbin "baserom.gba", 0x5dfd18, 0x8 - -gUnknown_085DFD20:: @ 85DFD20 - .incbin "baserom.gba", 0x5dfd20, 0x8 - -gUnknown_085DFD28:: @ 85DFD28 - .incbin "baserom.gba", 0x5dfd28, 0x34 - -gUnknown_085DFD5C:: @ 85DFD5C - .incbin "baserom.gba", 0x5dfd5c, 0x44 - -gUnknown_085DFDA0:: @ 85DFDA0 - .incbin "baserom.gba", 0x5dfda0, 0x18 - -gUnknown_085DFDB8:: @ 85DFDB8 - .incbin "baserom.gba", 0x5dfdb8, 0x8 - -gUnknown_085DFDC0:: @ 85DFDC0 - .incbin "baserom.gba", 0x5dfdc0, 0xe4 - -gUnknown_085DFEA4:: @ 85DFEA4 - .incbin "baserom.gba", 0x5dfea4, 0x10 - -gUnknown_085DFEB4:: @ 85DFEB4 - .incbin "baserom.gba", 0x5dfeb4, 0x20 - -gUnknown_085DFED4:: @ 85DFED4 - .incbin "baserom.gba", 0x5dfed4, 0x4 - -gUnknown_085DFED8:: @ 85DFED8 - .incbin "baserom.gba", 0x5dfed8, 0x4 - -gUnknown_085DFEDC:: @ 85DFEDC - .incbin "baserom.gba", 0x5dfedc, 0x20 - -gUnknown_085DFEFC:: @ 85DFEFC - .incbin "baserom.gba", 0x5dfefc, 0x8 - -gUnknown_085DFF04:: @ 85DFF04 - .incbin "baserom.gba", 0x5dff04, 0x20 - -gUnknown_085DFF24:: @ 85DFF24 - .incbin "baserom.gba", 0x5dff24, 0x18 - -gUnknown_085DFF3C:: @ 85DFF3C - .incbin "baserom.gba", 0x5dff3c, 0x8 - -gUnknown_085DFF44:: @ 85DFF44 - .incbin "baserom.gba", 0x5dff44, 0x18 - -gUnknown_085DFF5C:: @ 85DFF5C - .incbin "baserom.gba", 0x5dff5c, 0x28 - -gUnknown_085DFF84:: @ 85DFF84 - .incbin "baserom.gba", 0x5dff84, 0x8 - -gUnknown_085DFF8C:: @ 85DFF8C - .incbin "baserom.gba", 0x5dff8c, 0x638 - -gUnknown_085E05C4:: @ 85E05C4 - .incbin "baserom.gba", 0x5e05c4, 0x200 - -gUnknown_085E07C4:: @ 85E07C4 - .incbin "baserom.gba", 0x5e07c4, 0x3b4 - -gUnknown_085E0B78:: @ 85E0B78 - .incbin "baserom.gba", 0x5e0b78, 0x334 - -gUnknown_085E0EAC:: @ 85E0EAC - .incbin "baserom.gba", 0x5e0eac, 0x2f0 - -gUnknown_085E119C:: @ 85E119C - .incbin "baserom.gba", 0x5e119c, 0x218 - -gUnknown_085E13B4:: @ 85E13B4 - .incbin "baserom.gba", 0x5e13b4, 0x2170 - -gUnknown_085E3524:: @ 85E3524 - .incbin "baserom.gba", 0x5e3524, 0x200 - -gUnknown_085E3724:: @ 85E3724 - .incbin "baserom.gba", 0x5e3724, 0x130 - -gUnknown_085E3854:: @ 85E3854 - .incbin "baserom.gba", 0x5e3854, 0x1220 - -gUnknown_085E4A74:: @ 85E4A74 - .incbin "baserom.gba", 0x5e4a74, 0x10 - -gUnknown_085E4A84:: @ 85E4A84 - .incbin "baserom.gba", 0x5e4a84, 0x34 - -gUnknown_085E4AB8:: @ 85E4AB8 - .incbin "baserom.gba", 0x5e4ab8, 0x18 - -gUnknown_085E4AD0:: @ 85E4AD0 - .incbin "baserom.gba", 0x5e4ad0, 0x18 - -gUnknown_085E4AE8:: @ 85E4AE8 - .incbin "baserom.gba", 0x5e4ae8, 0x20 - -gUnknown_085E4B08:: @ 85E4B08 - .incbin "baserom.gba", 0x5e4b08, 0x38 - -gUnknown_085E4B40:: @ 85E4B40 - .incbin "baserom.gba", 0x5e4b40, 0x64 - -gUnknown_085E4BA4:: @ 85E4BA4 - .incbin "baserom.gba", 0x5e4ba4, 0x38 - -gUnknown_085E4BDC:: @ 85E4BDC - .incbin "baserom.gba", 0x5e4bdc, 0x18 - -gUnknown_085E4BF4:: @ 85E4BF4 - .incbin "baserom.gba", 0x5e4bf4, 0x10 - -gUnknown_085E4C04:: @ 85E4C04 - .incbin "baserom.gba", 0x5e4c04, 0x48 - -gUnknown_085E4C4C:: @ 85E4C4C - .incbin "baserom.gba", 0x5e4c4c, 0x18 - -gUnknown_085E4C64:: @ 85E4C64 - .incbin "baserom.gba", 0x5e4c64, 0x24 - -gUnknown_085E4C88:: @ 85E4C88 - .incbin "baserom.gba", 0x5e4c88, 0x10 - -gUnknown_085E4C98:: @ 85E4C98 - .incbin "baserom.gba", 0x5e4c98, 0x10 - -gUnknown_085E4CA8:: @ 85E4CA8 - .incbin "baserom.gba", 0x5e4ca8, 0x6c - -gUnknown_085E4D14:: @ 85E4D14 - .incbin "baserom.gba", 0x5e4d14, 0x50 - -gUnknown_085E4D64:: @ 85E4D64 - .incbin "baserom.gba", 0x5e4d64, 0x60 - -gUnknown_085E4DC4:: @ 85E4DC4 - .incbin "baserom.gba", 0x5e4dc4, 0xd0 - -gUnknown_085E4E94:: @ 85E4E94 - .incbin "baserom.gba", 0x5e4e94, 0xb4 - -gUnknown_085E4F48:: @ 85E4F48 - .incbin "baserom.gba", 0x5e4f48, 0x14 - -gUnknown_085E4F5C:: @ 85E4F5C - .incbin "baserom.gba", 0x5e4f5c, 0x30 - -gUnknown_085E4F8C:: @ 85E4F8C - .incbin "baserom.gba", 0x5e4f8c, 0x18 - -gUnknown_085E4FA4:: @ 85E4FA4 - .incbin "baserom.gba", 0x5e4fa4, 0x20 - -gUnknown_085E4FC4:: @ 85E4FC4 - .incbin "baserom.gba", 0x5e4fc4, 0x18 - -gUnknown_085E4FDC:: @ 85E4FDC - .incbin "baserom.gba", 0x5e4fdc, 0x10 - -gUnknown_085E4FEC:: @ 85E4FEC - .incbin "baserom.gba", 0x5e4fec, 0x10 - -gUnknown_085E4FFC:: @ 85E4FFC - .incbin "baserom.gba", 0x5e4ffc, 0x34 - -gUnknown_085E5030:: @ 85E5030 - .incbin "baserom.gba", 0x5e5030, 0x18 - -gUnknown_085E5048:: @ 85E5048 - .incbin "baserom.gba", 0x5e5048, 0x10 - -gUnknown_085E5058:: @ 85E5058 - .incbin "baserom.gba", 0x5e5058, 0x10 - -gUnknown_085E5068:: @ 85E5068 - .incbin "baserom.gba", 0x5e5068, 0x8 - -gUnknown_085E5070:: @ 85E5070 - .incbin "baserom.gba", 0x5e5070, 0x18 - -gUnknown_085E5088:: @ 85E5088 - .incbin "baserom.gba", 0x5e5088, 0xc - -gUnknown_085E5094:: @ 85E5094 - .incbin "baserom.gba", 0x5e5094, 0x60 - -gUnknown_085E50F4:: @ 85E50F4 - .incbin "baserom.gba", 0x5e50f4, 0xc0 - -gUnknown_085E51B4:: @ 85E51B4 - .incbin "baserom.gba", 0x5e51b4, 0xc - -gUnknown_085E51C0:: @ 85E51C0 - .incbin "baserom.gba", 0x5e51c0, 0x30 - -gUnknown_085E51F0:: @ 85E51F0 - .incbin "baserom.gba", 0x5e51f0, 0x60 - -gUnknown_085E5250:: @ 85E5250 - .incbin "baserom.gba", 0x5e5250, 0xc0 - -gUnknown_085E5310:: @ 85E5310 - .incbin "baserom.gba", 0x5e5310, 0x64 - -gUnknown_085E5374:: @ 85E5374 - .incbin "baserom.gba", 0x5e5374, 0xc - -gUnknown_085E5380:: @ 85E5380 - .incbin "baserom.gba", 0x5e5380, 0x8 - -gUnknown_085E5388:: @ 85E5388 - .incbin "baserom.gba", 0x5e5388, 0x4 - -gUnknown_085E538C:: @ 85E538C - .incbin "baserom.gba", 0x5e538c, 0x8 - -gUnknown_085E5394:: @ 85E5394 - .incbin "baserom.gba", 0x5e5394, 0x10 - -gUnknown_085E53A4:: @ 85E53A4 - .incbin "baserom.gba", 0x5e53a4, 0x10 - -gUnknown_085E53B4:: @ 85E53B4 - .incbin "baserom.gba", 0x5e53b4, 0x6 - -gUnknown_085E53BA:: @ 85E53BA - .incbin "baserom.gba", 0x5e53ba, 0x2a - -gUnknown_085E53E4:: @ 85E53E4 - .incbin "baserom.gba", 0x5e53e4, 0x18 - -gUnknown_085E53FC:: @ 85E53FC - .incbin "baserom.gba", 0x5e53fc, 0xd4 - -gUnknown_085E54D0:: @ 85E54D0 - .incbin "baserom.gba", 0x5e54d0, 0x18 - -gUnknown_085E54E8:: @ 85E54E8 - .incbin "baserom.gba", 0x5e54e8, 0x20 - -gUnknown_085E5508:: @ 85E5508 - .incbin "baserom.gba", 0x5e5508, 0x1cc - -gUnknown_085E56D4:: @ 85E56D4 - .incbin "baserom.gba", 0x5e56d4, 0x1c - -gUnknown_085E56F0:: @ 85E56F0 - .incbin "baserom.gba", 0x5e56f0, 0x80 - -gUnknown_085E5770:: @ 85E5770 - .incbin "baserom.gba", 0x5e5770, 0x43c - -gUnknown_085E5BAC:: @ 85E5BAC - .incbin "baserom.gba", 0x5e5bac, 0xf - -gUnknown_085E5BBB:: @ 85E5BBB - .incbin "baserom.gba", 0x5e5bbb, 0xf - -gUnknown_085E5BCA:: @ 85E5BCA - .incbin "baserom.gba", 0x5e5bca, 0xf - -gUnknown_085E5BD9:: @ 85E5BD9 - .incbin "baserom.gba", 0x5e5bd9, 0xf - -gUnknown_085E5BE8:: @ 85E5BE8 - .incbin "baserom.gba", 0x5e5be8, 0xf0c - -gUnknown_085E6AF4:: @ 85E6AF4 - .incbin "baserom.gba", 0x5e6af4, 0x474 - -gUnknown_085E6F68:: @ 85E6F68 - .incbin "baserom.gba", 0x5e6f68, 0x4 - -gUnknown_085E6F6C:: @ 85E6F6C - .incbin "baserom.gba", 0x5e6f6c, 0x10 - -gUnknown_085E6F7C:: @ 85E6F7C - .incbin "baserom.gba", 0x5e6f7c, 0x54 - -gUnknown_085E6FD0:: @ 85E6FD0 - .incbin "baserom.gba", 0x5e6fd0, 0x40 - -gUnknown_085E7010:: @ 85E7010 - .incbin "baserom.gba", 0x5e7010, 0xc - -gUnknown_085E701C:: @ 85E701C - .incbin "baserom.gba", 0x5e701c, 0x10 - -gUnknown_085E702C:: @ 85E702C - .incbin "baserom.gba", 0x5e702c, 0x3c - -gUnknown_085E7068:: @ 85E7068 - .incbin "baserom.gba", 0x5e7068, 0x18 - -gUnknown_085E7080:: @ 85E7080 - .incbin "baserom.gba", 0x5e7080, 0x8 - -gUnknown_085E7088:: @ 85E7088 - .incbin "baserom.gba", 0x5e7088, 0x40 - -gUnknown_085E70C8:: @ 85E70C8 - .incbin "baserom.gba", 0x5e70c8, 0x73c - -gUnknown_085E7804:: @ 85E7804 - .incbin "baserom.gba", 0x5e7804, 0x9f8 - -gUnknown_085E81FC:: @ 85E81FC - .incbin "baserom.gba", 0x5e81fc, 0x8 - -gUnknown_085E8204:: @ 85E8204 - .incbin "baserom.gba", 0x5e8204, 0x10 - -gUnknown_085E8214:: @ 85E8214 - .incbin "baserom.gba", 0x5e8214, 0x4 - -gUnknown_085E8218:: @ 85E8218 - .incbin "baserom.gba", 0x5e8218, 0x1 - -gUnknown_085E8219:: @ 85E8219 - .incbin "baserom.gba", 0x5e8219, 0x1 - -gUnknown_085E821A:: @ 85E821A - .incbin "baserom.gba", 0x5e821a, 0xf - -gUnknown_085E8229:: @ 85E8229 - .incbin "baserom.gba", 0x5e8229, 0x8 - -gUnknown_085E8231:: @ 85E8231 - .incbin "baserom.gba", 0x5e8231, 0x5 - -gUnknown_085E8236:: @ 85E8236 - .incbin "baserom.gba", 0x5e8236, 0x6 - -gUnknown_085E823C:: @ 85E823C - .incbin "baserom.gba", 0x5e823c, 0x7 - -gUnknown_085E8243:: @ 85E8243 - .incbin "baserom.gba", 0x5e8243, 0x6 - -gUnknown_085E8249:: @ 85E8249 - .incbin "baserom.gba", 0x5e8249, 0x7 - -gUnknown_085E8250:: @ 85E8250 - .incbin "baserom.gba", 0x5e8250, 0x8 - -gUnknown_085E8258:: @ 85E8258 - .incbin "baserom.gba", 0x5e8258, 0x8 - -gUnknown_085E8260:: @ 85E8260 - .incbin "baserom.gba", 0x5e8260, 0x4 - -gUnknown_085E8264:: @ 85E8264 - .incbin "baserom.gba", 0x5e8264, 0x4 - -gUnknown_085E8268:: @ 85E8268 - .incbin "baserom.gba", 0x5e8268, 0x14 - -gUnknown_085E827C:: @ 85E827C - .incbin "baserom.gba", 0x5e827c, 0x9 - -gUnknown_085E8285:: @ 85E8285 - .incbin "baserom.gba", 0x5e8285, 0x9 - -gUnknown_085E828E:: @ 85E828E - .incbin "baserom.gba", 0x5e828e, 0x7 - -gUnknown_085E8295:: @ 85E8295 - .incbin "baserom.gba", 0x5e8295, 0xd - -gUnknown_085E82A2:: @ 85E82A2 - .incbin "baserom.gba", 0x5e82a2, 0xd - -gUnknown_085E82AF:: @ 85E82AF - .incbin "baserom.gba", 0x5e82af, 0xf - -gUnknown_085E82BE:: @ 85E82BE - .incbin "baserom.gba", 0x5e82be, 0x27 - -gUnknown_085E82E5:: @ 85E82E5 - .incbin "baserom.gba", 0x5e82e5, 0x43 - -gUnknown_085E8328:: @ 85E8328 - .incbin "baserom.gba", 0x5e8328, 0x9a - -gUnknown_085E83C2:: @ 85E83C2 - .incbin "baserom.gba", 0x5e83c2, 0x43 - -gUnknown_085E8405:: @ 85E8405 - .incbin "baserom.gba", 0x5e8405, 0x3b - -gUnknown_085E8440:: @ 85E8440 - .incbin "baserom.gba", 0x5e8440, 0x13 - -gUnknown_085E8453:: @ 85E8453 - .incbin "baserom.gba", 0x5e8453, 0x7b - -gUnknown_085E84CE:: @ 85E84CE - .incbin "baserom.gba", 0x5e84ce, 0x8e - -gUnknown_085E855C:: @ 85E855C - .incbin "baserom.gba", 0x5e855c, 0x18 - -gUnknown_085E8574:: @ 85E8574 - .incbin "baserom.gba", 0x5e8574, 0x14 - -gUnknown_085E8588:: @ 85E8588 - .incbin "baserom.gba", 0x5e8588, 0x10a - -gUnknown_085E8692:: @ 85E8692 - .incbin "baserom.gba", 0x5e8692, 0x26 - -gUnknown_085E86B8:: @ 85E86B8 - .incbin "baserom.gba", 0x5e86b8, 0xe - -gUnknown_085E86C6:: @ 85E86C6 - .incbin "baserom.gba", 0x5e86c6, 0xa - -gUnknown_085E86D0:: @ 85E86D0 - .incbin "baserom.gba", 0x5e86d0, 0x4b - -gUnknown_085E871B:: @ 85E871B - .incbin "baserom.gba", 0x5e871b, 0x8 - -gUnknown_085E8723:: @ 85E8723 - .incbin "baserom.gba", 0x5e8723, 0x12 - -gUnknown_085E8735:: @ 85E8735 - .incbin "baserom.gba", 0x5e8735, 0x20 - -gUnknown_085E8755:: @ 85E8755 - .incbin "baserom.gba", 0x5e8755, 0x3 - -gUnknown_085E8758:: @ 85E8758 - .incbin "baserom.gba", 0x5e8758, 0x3 - -gUnknown_085E875B:: @ 85E875B - .incbin "baserom.gba", 0x5e875b, 0x18 - -gUnknown_085E8773:: @ 85E8773 - .incbin "baserom.gba", 0x5e8773, 0x12 - -gUnknown_085E8785:: @ 85E8785 - .incbin "baserom.gba", 0x5e8785, 0x3b5 - -gUnknown_085E8B3A:: @ 85E8B3A - .incbin "baserom.gba", 0x5e8b3a, 0x4 - -gUnknown_085E8B3E:: @ 85E8B3E - .incbin "baserom.gba", 0x5e8b3e, 0x9e - -gUnknown_085E8BDC:: @ 85E8BDC - .incbin "baserom.gba", 0x5e8bdc, 0x24 - -gUnknown_085E8C00:: @ 85E8C00 - .incbin "baserom.gba", 0x5e8c00, 0x14 - -gUnknown_085E8C14:: @ 85E8C14 - .incbin "baserom.gba", 0x5e8c14, 0x22 - -gUnknown_085E8C36:: @ 85E8C36 - .incbin "baserom.gba", 0x5e8c36, 0x5 - -gUnknown_085E8C3B:: @ 85E8C3B - .incbin "baserom.gba", 0x5e8c3b, 0xd - -gUnknown_085E8C48:: @ 85E8C48 - .incbin "baserom.gba", 0x5e8c48, 0x5 - -gUnknown_085E8C4D:: @ 85E8C4D - .incbin "baserom.gba", 0x5e8c4d, 0x6 - -gUnknown_085E8C53:: @ 85E8C53 - .incbin "baserom.gba", 0x5e8c53, 0x3d - -gUnknown_085E8C90:: @ 85E8C90 - .incbin "baserom.gba", 0x5e8c90, 0x24 - -gUnknown_085E8CB4:: @ 85E8CB4 - .incbin "baserom.gba", 0x5e8cb4, 0x2f - -gUnknown_085E8CE3:: @ 85E8CE3 - .incbin "baserom.gba", 0x5e8ce3, 0xd - -gUnknown_085E8CF0:: @ 85E8CF0 - .incbin "baserom.gba", 0x5e8cf0, 0x7 - -gUnknown_085E8CF7:: @ 85E8CF7 - .incbin "baserom.gba", 0x5e8cf7, 0xc - -gUnknown_085E8D03:: @ 85E8D03 - .incbin "baserom.gba", 0x5e8d03, 0x23 - -gUnknown_085E8D26:: @ 85E8D26 - .incbin "baserom.gba", 0x5e8d26, 0xe - -gUnknown_085E8D34:: @ 85E8D34 - .incbin "baserom.gba", 0x5e8d34, 0x4 - -gUnknown_085E8D38:: @ 85E8D38 - .incbin "baserom.gba", 0x5e8d38, 0x6 - -gUnknown_085E8D3E:: @ 85E8D3E - .incbin "baserom.gba", 0x5e8d3e, 0x2 - -gUnknown_085E8D40:: @ 85E8D40 - .incbin "baserom.gba", 0x5e8d40, 0x2 - -gUnknown_085E8D42:: @ 85E8D42 - .incbin "baserom.gba", 0x5e8d42, 0x3 - -gUnknown_085E8D45:: @ 85E8D45 - .incbin "baserom.gba", 0x5e8d45, 0x4 - -gUnknown_085E8D49:: @ 85E8D49 - .incbin "baserom.gba", 0x5e8d49, 0x2 - -gUnknown_085E8D4B:: @ 85E8D4B - .incbin "baserom.gba", 0x5e8d4b, 0x2 - -gUnknown_085E8D4D:: @ 85E8D4D - .incbin "baserom.gba", 0x5e8d4d, 0x2 - -gUnknown_085E8D4F:: @ 85E8D4F - .incbin "baserom.gba", 0x5e8d4f, 0xa - -gUnknown_085E8D59:: @ 85E8D59 - .incbin "baserom.gba", 0x5e8d59, 0x5 - -gUnknown_085E8D5E:: @ 85E8D5E - .incbin "baserom.gba", 0x5e8d5e, 0x2 - -gUnknown_085E8D60:: @ 85E8D60 - .incbin "baserom.gba", 0x5e8d60, 0x2 - -gUnknown_085E8D62:: @ 85E8D62 - .incbin "baserom.gba", 0x5e8d62, 0x1e - -gUnknown_085E8D80:: @ 85E8D80 - .incbin "baserom.gba", 0x5e8d80, 0x20 - -gUnknown_085E8DA0:: @ 85E8DA0 - .incbin "baserom.gba", 0x5e8da0, 0xb - -gUnknown_085E8DAB:: @ 85E8DAB - .incbin "baserom.gba", 0x5e8dab, 0x9 - -gUnknown_085E8DB4:: @ 85E8DB4 - .incbin "baserom.gba", 0x5e8db4, 0xa - -gUnknown_085E8DBE:: @ 85E8DBE - .incbin "baserom.gba", 0x5e8dbe, 0x10 - -gUnknown_085E8DCE:: @ 85E8DCE - .incbin "baserom.gba", 0x5e8dce, 0x1b - -gUnknown_085E8DE9:: @ 85E8DE9 - .incbin "baserom.gba", 0x5e8de9, 0x15 - -gUnknown_085E8DFE:: @ 85E8DFE - .incbin "baserom.gba", 0x5e8dfe, 0x13 - -gUnknown_085E8E11:: @ 85E8E11 - .incbin "baserom.gba", 0x5e8e11, 0x16 - -gUnknown_085E8E27:: @ 85E8E27 - .incbin "baserom.gba", 0x5e8e27, 0x1b - -gUnknown_085E8E42:: @ 85E8E42 - .incbin "baserom.gba", 0x5e8e42, 0x18 - -gUnknown_085E8E5A:: @ 85E8E5A - .incbin "baserom.gba", 0x5e8e5a, 0x14 - -gUnknown_085E8E6E:: @ 85E8E6E - .incbin "baserom.gba", 0x5e8e6e, 0x20 - -gUnknown_085E8E8E:: @ 85E8E8E - .incbin "baserom.gba", 0x5e8e8e, 0x2b - -gUnknown_085E8EB9:: @ 85E8EB9 - .incbin "baserom.gba", 0x5e8eb9, 0x27 - -gUnknown_085E8EE0:: @ 85E8EE0 - .incbin "baserom.gba", 0x5e8ee0, 0x19 - -gUnknown_085E8EF9:: @ 85E8EF9 - .incbin "baserom.gba", 0x5e8ef9, 0x15 - -gUnknown_085E8F0E:: @ 85E8F0E - .incbin "baserom.gba", 0x5e8f0e, 0x23 - -gUnknown_085E8F31:: @ 85E8F31 - .incbin "baserom.gba", 0x5e8f31, 0x3d - -gUnknown_085E8F6E:: @ 85E8F6E - .incbin "baserom.gba", 0x5e8f6e, 0x25 - -gUnknown_085E8F93:: @ 85E8F93 - .incbin "baserom.gba", 0x5e8f93, 0x48 - -gUnknown_085E8FDB:: @ 85E8FDB - .incbin "baserom.gba", 0x5e8fdb, 0x27 - -gUnknown_085E9002:: @ 85E9002 - .incbin "baserom.gba", 0x5e9002, 0x24 - -gUnknown_085E9026:: @ 85E9026 - .incbin "baserom.gba", 0x5e9026, 0x11 - -gUnknown_085E9037:: @ 85E9037 - .incbin "baserom.gba", 0x5e9037, 0x10 - -gUnknown_085E9047:: @ 85E9047 - .incbin "baserom.gba", 0x5e9047, 0x11 - -gUnknown_085E9058:: @ 85E9058 - .incbin "baserom.gba", 0x5e9058, 0x28 - -gUnknown_085E9080:: @ 85E9080 - .incbin "baserom.gba", 0x5e9080, 0x12 - -gUnknown_085E9092:: @ 85E9092 - .incbin "baserom.gba", 0x5e9092, 0x34 - -gUnknown_085E90C6:: @ 85E90C6 - .incbin "baserom.gba", 0x5e90c6, 0x2e - -gUnknown_085E90F4:: @ 85E90F4 - .incbin "baserom.gba", 0x5e90f4, 0x31 - -gUnknown_085E9125:: @ 85E9125 - .incbin "baserom.gba", 0x5e9125, 0x13 - -gUnknown_085E9138:: @ 85E9138 - .incbin "baserom.gba", 0x5e9138, 0x48 - -gUnknown_085E9180:: @ 85E9180 - .incbin "baserom.gba", 0x5e9180, 0x30 - -gUnknown_085E91B0:: @ 85E91B0 - .incbin "baserom.gba", 0x5e91b0, 0x10 - -gUnknown_085E91C0:: @ 85E91C0 - .incbin "baserom.gba", 0x5e91c0, 0x3c - -gUnknown_085E91FC:: @ 85E91FC - .incbin "baserom.gba", 0x5e91fc, 0x14 - -gUnknown_085E9210:: @ 85E9210 - .incbin "baserom.gba", 0x5e9210, 0xa - -gUnknown_085E921A:: @ 85E921A - .incbin "baserom.gba", 0x5e921a, 0xb - -gUnknown_085E9225:: @ 85E9225 - .incbin "baserom.gba", 0x5e9225, 0x7 - -gUnknown_085E922C:: @ 85E922C - .incbin "baserom.gba", 0x5e922c, 0x7 - -gUnknown_085E9233:: @ 85E9233 - .incbin "baserom.gba", 0x5e9233, 0x7 - -@ 85E923A - .include "data/text/berry_firmness_strings.inc" - -gUnknown_085E9263:: @ 85E9263 - .incbin "baserom.gba", 0x5e9263, 0x8 - -gUnknown_085E926B:: @ 85E926B - .incbin "baserom.gba", 0x5e926b, 0xb2 - -gUnknown_085E931D:: @ 85E931D - .incbin "baserom.gba", 0x5e931d, 0x6 - -gUnknown_085E9323:: @ 85E9323 - .incbin "baserom.gba", 0x5e9323, 0x4 - -gUnknown_085E9327:: @ 85E9327 - .incbin "baserom.gba", 0x5e9327, 0x6 - -gUnknown_085E932D:: @ 85E932D - .incbin "baserom.gba", 0x5e932d, 0x7 - -gUnknown_085E9334:: @ 85E9334 - .incbin "baserom.gba", 0x5e9334, 0x10 - -gUnknown_085E9344:: @ 85E9344 - .incbin "baserom.gba", 0x5e9344, 0xb - -gUnknown_085E934F:: @ 85E934F - .incbin "baserom.gba", 0x5e934f, 0x4 - -gUnknown_085E9353:: @ 85E9353 - .incbin "baserom.gba", 0x5e9353, 0x14 - -gUnknown_085E9367:: @ 85E9367 - .incbin "baserom.gba", 0x5e9367, 0x18 - -gUnknown_085E937F:: @ 85E937F - .incbin "baserom.gba", 0x5e937f, 0x11 - -gUnknown_085E9390:: @ 85E9390 - .incbin "baserom.gba", 0x5e9390, 0x19 - -gUnknown_085E93A9:: @ 85E93A9 - .incbin "baserom.gba", 0x5e93a9, 0x2c - -gUnknown_085E93D5:: @ 85E93D5 - .incbin "baserom.gba", 0x5e93d5, 0xb - -gUnknown_085E93E0:: @ 85E93E0 - .incbin "baserom.gba", 0x5e93e0, 0xf - -gUnknown_085E93EF:: @ 85E93EF - .incbin "baserom.gba", 0x5e93ef, 0x28 - -gUnknown_085E9417:: @ 85E9417 - .incbin "baserom.gba", 0x5e9417, 0x28 - -gUnknown_085E943F:: @ 85E943F - .incbin "baserom.gba", 0x5e943f, 0x29 - -gUnknown_085E9468:: @ 85E9468 - .incbin "baserom.gba", 0x5e9468, 0x2b - -gUnknown_085E9493:: @ 85E9493 - .incbin "baserom.gba", 0x5e9493, 0x32 - -gUnknown_085E94C5:: @ 85E94C5 - .incbin "baserom.gba", 0x5e94c5, 0x22 - -gUnknown_085E94E7:: @ 85E94E7 - .incbin "baserom.gba", 0x5e94e7, 0x29 - -gUnknown_085E9510:: @ 85E9510 - .incbin "baserom.gba", 0x5e9510, 0x29 - -gUnknown_085E9539:: @ 85E9539 - .incbin "baserom.gba", 0x5e9539, 0x1f - -gUnknown_085E9558:: @ 85E9558 - .incbin "baserom.gba", 0x5e9558, 0x27 - -gUnknown_085E957F:: @ 85E957F - .incbin "baserom.gba", 0x5e957f, 0x1c - -gUnknown_085E959B:: @ 85E959B - .incbin "baserom.gba", 0x5e959b, 0x2c - -gUnknown_085E95C7:: @ 85E95C7 - .incbin "baserom.gba", 0x5e95c7, 0x23 - -gUnknown_085E95EA:: @ 85E95EA - .incbin "baserom.gba", 0x5e95ea, 0x25 - -gUnknown_085E960F:: @ 85E960F - .incbin "baserom.gba", 0x5e960f, 0x20 - -gUnknown_085E962F:: @ 85E962F - .incbin "baserom.gba", 0x5e962f, 0x25 - -gUnknown_085E9654:: @ 85E9654 - .incbin "baserom.gba", 0x5e9654, 0x23 - -gUnknown_085E9677:: @ 85E9677 - .incbin "baserom.gba", 0x5e9677, 0x25 - -gUnknown_085E969C:: @ 85E969C - .incbin "baserom.gba", 0x5e969c, 0x47 - -gUnknown_085E96E3:: @ 85E96E3 - .incbin "baserom.gba", 0x5e96e3, 0x3 - -gUnknown_085E96E6:: @ 85E96E6 - .incbin "baserom.gba", 0x5e96e6, 0x8 - -gUnknown_085E96EE:: @ 85E96EE - .incbin "baserom.gba", 0x5e96ee, 0x8 - -gUnknown_085E96F6:: @ 85E96F6 - .incbin "baserom.gba", 0x5e96f6, 0x1c - -gUnknown_085E9712:: @ 85E9712 - .incbin "baserom.gba", 0x5e9712, 0x26 - -gUnknown_085E9738:: @ 85E9738 - .incbin "baserom.gba", 0x5e9738, 0x1c - -gUnknown_085E9754:: @ 85E9754 - .incbin "baserom.gba", 0x5e9754, 0x1b - -gUnknown_085E976F:: @ 85E976F - .incbin "baserom.gba", 0x5e976f, 0x20 - -gUnknown_085E978F:: @ 85E978F - .incbin "baserom.gba", 0x5e978f, 0x23 - -gUnknown_085E97B2:: @ 85E97B2 - .incbin "baserom.gba", 0x5e97b2, 0x33 - -gUnknown_085E97E5:: @ 85E97E5 - .incbin "baserom.gba", 0x5e97e5, 0x17 - -gUnknown_085E97FC:: @ 85E97FC - .incbin "baserom.gba", 0x5e97fc, 0x34 - -gUnknown_085E9830:: @ 85E9830 - .incbin "baserom.gba", 0x5e9830, 0x25 - -gUnknown_085E9855:: @ 85E9855 - .incbin "baserom.gba", 0x5e9855, 0x22 - -gUnknown_085E9877:: @ 85E9877 - .incbin "baserom.gba", 0x5e9877, 0x20 - -gUnknown_085E9897:: @ 85E9897 - .incbin "baserom.gba", 0x5e9897, 0x1d - -gUnknown_085E98B4:: @ 85E98B4 - .incbin "baserom.gba", 0x5e98b4, 0x38 - -gUnknown_085E98EC:: @ 85E98EC - .incbin "baserom.gba", 0x5e98ec, 0x2f - -gUnknown_085E991B:: @ 85E991B - .incbin "baserom.gba", 0x5e991b, 0x1f - -gUnknown_085E993A:: @ 85E993A - .incbin "baserom.gba", 0x5e993a, 0x46 - -gUnknown_085E9980:: @ 85E9980 - .incbin "baserom.gba", 0x5e9980, 0x1d - -gUnknown_085E999D:: @ 85E999D - .incbin "baserom.gba", 0x5e999d, 0x1b - -gUnknown_085E99B8:: @ 85E99B8 - .incbin "baserom.gba", 0x5e99b8, 0x23 - -gUnknown_085E99DB:: @ 85E99DB - .incbin "baserom.gba", 0x5e99db, 0x2d - -gUnknown_085E9A08:: @ 85E9A08 - .incbin "baserom.gba", 0x5e9a08, 0x38 - -gUnknown_085E9A40:: @ 85E9A40 - .incbin "baserom.gba", 0x5e9a40, 0x29 - -gUnknown_085E9A69:: @ 85E9A69 - .incbin "baserom.gba", 0x5e9a69, 0x3c - -gUnknown_085E9AA5:: @ 85E9AA5 - .incbin "baserom.gba", 0x5e9aa5, 0xf - -gUnknown_085E9AB4:: @ 85E9AB4 - .incbin "baserom.gba", 0x5e9ab4, 0x35 - -gUnknown_085E9AE9:: @ 85E9AE9 - .incbin "baserom.gba", 0x5e9ae9, 0x74 - -gUnknown_085E9B5D:: @ 85E9B5D - .incbin "baserom.gba", 0x5e9b5d, 0x19 - -gUnknown_085E9B76:: @ 85E9B76 - .incbin "baserom.gba", 0x5e9b76, 0x20 - -gUnknown_085E9B96:: @ 85E9B96 - .incbin "baserom.gba", 0x5e9b96, 0x22 - -gUnknown_085E9BB8:: @ 85E9BB8 - .incbin "baserom.gba", 0x5e9bb8, 0x48 - -gUnknown_085E9C00:: @ 85E9C00 - .incbin "baserom.gba", 0x5e9c00, 0x17 - -gUnknown_085E9C17:: @ 85E9C17 - .incbin "baserom.gba", 0x5e9c17, 0x27 - -gUnknown_085E9C3E:: @ 85E9C3E - .incbin "baserom.gba", 0x5e9c3e, 0x21 - -gUnknown_085E9C5F:: @ 85E9C5F - .incbin "baserom.gba", 0x5e9c5f, 0x1d - -gUnknown_085E9C7C:: @ 85E9C7C - .incbin "baserom.gba", 0x5e9c7c, 0xe - -gUnknown_085E9C8A:: @ 85E9C8A - .incbin "baserom.gba", 0x5e9c8a, 0x18 - -gUnknown_085E9CA2:: @ 85E9CA2 - .incbin "baserom.gba", 0x5e9ca2, 0x15 - -gUnknown_085E9CB7:: @ 85E9CB7 - .incbin "baserom.gba", 0x5e9cb7, 0x29 - -gUnknown_085E9CE0:: @ 85E9CE0 - .incbin "baserom.gba", 0x5e9ce0, 0x15 - -gUnknown_085E9CF5:: @ 85E9CF5 - .incbin "baserom.gba", 0x5e9cf5, 0x15 - -gUnknown_085E9D0A:: @ 85E9D0A - .incbin "baserom.gba", 0x5e9d0a, 0x1b - -gUnknown_085E9D25:: @ 85E9D25 - .incbin "baserom.gba", 0x5e9d25, 0x20 - -gUnknown_085E9D45:: @ 85E9D45 - .incbin "baserom.gba", 0x5e9d45, 0x28 - -gUnknown_085E9D6D:: @ 85E9D6D - .incbin "baserom.gba", 0x5e9d6d, 0x23 - -gUnknown_085E9D90:: @ 85E9D90 - .incbin "baserom.gba", 0x5e9d90, 0x2e - -gUnknown_085E9DBE:: @ 85E9DBE - .incbin "baserom.gba", 0x5e9dbe, 0x23 - -gUnknown_085E9DE1:: @ 85E9DE1 - .incbin "baserom.gba", 0x5e9de1, 0x1f - -gUnknown_085E9E00:: @ 85E9E00 - .incbin "baserom.gba", 0x5e9e00, 0x14 - -gUnknown_085E9E14:: @ 85E9E14 - .incbin "baserom.gba", 0x5e9e14, 0x2da - -gUnknown_085EA0EE:: @ 85EA0EE - .incbin "baserom.gba", 0x5ea0ee, 0x22 - -gUnknown_085EA110:: @ 85EA110 - .incbin "baserom.gba", 0x5ea110, 0x16 - -gUnknown_085EA126:: @ 85EA126 - .incbin "baserom.gba", 0x5ea126, 0x13 - -gUnknown_085EA139:: @ 85EA139 - .incbin "baserom.gba", 0x5ea139, 0x1c - -gUnknown_085EA155:: @ 85EA155 - .incbin "baserom.gba", 0x5ea155, 0x16 - -gUnknown_085EA16B:: @ 85EA16B - .incbin "baserom.gba", 0x5ea16b, 0x2b - -gUnknown_085EA196:: @ 85EA196 - .incbin "baserom.gba", 0x5ea196, 0x34 - -gUnknown_085EA1CA:: @ 85EA1CA - .incbin "baserom.gba", 0x5ea1ca, 0x3 - -gUnknown_085EA1CD:: @ 85EA1CD - .incbin "baserom.gba", 0x5ea1cd, 0x1b - -gUnknown_085EA1E8:: @ 85EA1E8 - .incbin "baserom.gba", 0x5ea1e8, 0x28 - -gUnknown_085EA210:: @ 85EA210 - .incbin "baserom.gba", 0x5ea210, 0x24 - -gUnknown_085EA234:: @ 85EA234 - .incbin "baserom.gba", 0x5ea234, 0x108 - -gUnknown_085EA33C:: @ 85EA33C - .incbin "baserom.gba", 0x5ea33c, 0x7 - -gUnknown_085EA343:: @ 85EA343 - .incbin "baserom.gba", 0x5ea343, 0x8 - -gUnknown_085EA34B:: @ 85EA34B - .incbin "baserom.gba", 0x5ea34b, 0x8 - -gUnknown_085EA353:: @ 85EA353 - .incbin "baserom.gba", 0x5ea353, 0x8 - -gUnknown_085EA35B:: @ 85EA35B - .incbin "baserom.gba", 0x5ea35b, 0x6 - -gUnknown_085EA361:: @ 85EA361 - .incbin "baserom.gba", 0x5ea361, 0x4 - -gUnknown_085EA365:: @ 85EA365 - .incbin "baserom.gba", 0x5ea365, 0x4 - -gUnknown_085EA369:: @ 85EA369 - .incbin "baserom.gba", 0x5ea369, 0xf - -gUnknown_085EA378:: @ 85EA378 - .incbin "baserom.gba", 0x5ea378, 0x6 - -gUnknown_085EA37E:: @ 85EA37E - .incbin "baserom.gba", 0x5ea37e, 0x6 - -gUnknown_085EA384:: @ 85EA384 - .incbin "baserom.gba", 0x5ea384, 0x9 - -gUnknown_085EA38D:: @ 85EA38D - .incbin "baserom.gba", 0x5ea38d, 0x7 - -gUnknown_085EA394:: @ 85EA394 - .incbin "baserom.gba", 0x5ea394, 0x4 - -gUnknown_085EA398:: @ 85EA398 - .incbin "baserom.gba", 0x5ea398, 0x7 - -gUnknown_085EA39F:: @ 85EA39F - .incbin "baserom.gba", 0x5ea39f, 0xc - -gUnknown_085EA3AB:: @ 85EA3AB - .incbin "baserom.gba", 0x5ea3ab, 0x9 - -gUnknown_085EA3B4:: @ 85EA3B4 - .incbin "baserom.gba", 0x5ea3b4, 0xc - -gUnknown_085EA3C0:: @ 85EA3C0 - .incbin "baserom.gba", 0x5ea3c0, 0x8 - -gUnknown_085EA3C8:: @ 85EA3C8 - .incbin "baserom.gba", 0x5ea3c8, 0x7 - -gUnknown_085EA3CF:: @ 85EA3CF - .incbin "baserom.gba", 0x5ea3cf, 0xd - -gUnknown_085EA3DC:: @ 85EA3DC - .incbin "baserom.gba", 0x5ea3dc, 0xf - -gUnknown_085EA3EB:: @ 85EA3EB - .incbin "baserom.gba", 0x5ea3eb, 0xd - -gUnknown_085EA3F8:: @ 85EA3F8 - .incbin "baserom.gba", 0x5ea3f8, 0xe - -gUnknown_085EA406:: @ 85EA406 - .incbin "baserom.gba", 0x5ea406, 0x5 - -gUnknown_085EA40B:: @ 85EA40B - .incbin "baserom.gba", 0x5ea40b, 0x37 - -gUnknown_085EA442:: @ 85EA442 - .incbin "baserom.gba", 0x5ea442, 0x33 - -gUnknown_085EA475:: @ 85EA475 - .incbin "baserom.gba", 0x5ea475, 0x2d - -gUnknown_085EA4A2:: @ 85EA4A2 - .incbin "baserom.gba", 0x5ea4a2, 0x29 - -gUnknown_085EA4CB:: @ 85EA4CB - .incbin "baserom.gba", 0x5ea4cb, 0x21 - -gUnknown_085EA4EC:: @ 85EA4EC - .incbin "baserom.gba", 0x5ea4ec, 0x2a - -gUnknown_085EA516:: @ 85EA516 - .incbin "baserom.gba", 0x5ea516, 0x2e - -gUnknown_085EA544:: @ 85EA544 - .incbin "baserom.gba", 0x5ea544, 0x26 - -gUnknown_085EA56A:: @ 85EA56A - .incbin "baserom.gba", 0x5ea56a, 0x3e - -gUnknown_085EA5A8:: @ 85EA5A8 - .incbin "baserom.gba", 0x5ea5a8, 0x33 - -gUnknown_085EA5DB:: @ 85EA5DB - .incbin "baserom.gba", 0x5ea5db, 0x10 - -gUnknown_085EA5EB:: @ 85EA5EB - .incbin "baserom.gba", 0x5ea5eb, 0x2c - -gUnknown_085EA617:: @ 85EA617 - .incbin "baserom.gba", 0x5ea617, 0x30 - -gUnknown_085EA647:: @ 85EA647 - .incbin "baserom.gba", 0x5ea647, 0x31 - -gUnknown_085EA678:: @ 85EA678 - .incbin "baserom.gba", 0x5ea678, 0x33 - -gUnknown_085EA6AB:: @ 85EA6AB - .incbin "baserom.gba", 0x5ea6ab, 0x2c - -gUnknown_085EA6D7:: @ 85EA6D7 - .incbin "baserom.gba", 0x5ea6d7, 0x2b - -gUnknown_085EA702:: @ 85EA702 - .incbin "baserom.gba", 0x5ea702, 0x2d - -gUnknown_085EA72F:: @ 85EA72F - .incbin "baserom.gba", 0x5ea72f, 0x8 - -gUnknown_085EA737:: @ 85EA737 - .incbin "baserom.gba", 0x5ea737, 0x2b - -gUnknown_085EA762:: @ 85EA762 - .incbin "baserom.gba", 0x5ea762, 0x23 - -gUnknown_085EA785:: @ 85EA785 - .incbin "baserom.gba", 0x5ea785, 0x43 - -gUnknown_085EA7C8:: @ 85EA7C8 - .incbin "baserom.gba", 0x5ea7c8, 0x75 - -gUnknown_085EA83D:: @ 85EA83D - .incbin "baserom.gba", 0x5ea83d, 0x4e - -gUnknown_085EA88B:: @ 85EA88B - .incbin "baserom.gba", 0x5ea88b, 0x5 - -gUnknown_085EA890:: @ 85EA890 - .incbin "baserom.gba", 0x5ea890, 0x7 - -gUnknown_085EA897:: @ 85EA897 - .incbin "baserom.gba", 0x5ea897, 0xf - -gUnknown_085EA8A6:: @ 85EA8A6 - .incbin "baserom.gba", 0x5ea8a6, 0x19 - -gUnknown_085EA8BF:: @ 85EA8BF - .incbin "baserom.gba", 0x5ea8bf, 0x13 - -gUnknown_085EA8D2:: @ 85EA8D2 - .incbin "baserom.gba", 0x5ea8d2, 0x18 - -gUnknown_085EA8EA:: @ 85EA8EA - .incbin "baserom.gba", 0x5ea8ea, 0x47 - -gUnknown_085EA931:: @ 85EA931 - .incbin "baserom.gba", 0x5ea931, 0x7d - -gUnknown_085EA9AE:: @ 85EA9AE - .incbin "baserom.gba", 0x5ea9ae, 0x32 - -gUnknown_085EA9E0:: @ 85EA9E0 - .incbin "baserom.gba", 0x5ea9e0, 0x34 - -gUnknown_085EAA14:: @ 85EAA14 - .incbin "baserom.gba", 0x5eaa14, 0x29 - -gUnknown_085EAA3D:: @ 85EAA3D - .incbin "baserom.gba", 0x5eaa3d, 0x25 - -gUnknown_085EAA62:: @ 85EAA62 - .incbin "baserom.gba", 0x5eaa62, 0x1f - -gUnknown_085EAA81:: @ 85EAA81 - .incbin "baserom.gba", 0x5eaa81, 0x22 - -gUnknown_085EAAA3:: @ 85EAAA3 - .incbin "baserom.gba", 0x5eaaa3, 0x22 - -gUnknown_085EAAC5:: @ 85EAAC5 - .incbin "baserom.gba", 0x5eaac5, 0x27 - -gUnknown_085EAAEC:: @ 85EAAEC - .incbin "baserom.gba", 0x5eaaec, 0x62 - -gUnknown_085EAB4E:: @ 85EAB4E - .incbin "baserom.gba", 0x5eab4e, 0x15 - -gUnknown_085EAB63:: @ 85EAB63 - .incbin "baserom.gba", 0x5eab63, 0xe - -gUnknown_085EAB71:: @ 85EAB71 - .incbin "baserom.gba", 0x5eab71, 0x60 - -gUnknown_085EABD1:: @ 85EABD1 - .incbin "baserom.gba", 0x5eabd1, 0x16 - -gUnknown_085EABE7:: @ 85EABE7 - .incbin "baserom.gba", 0x5eabe7, 0x22 - -gUnknown_085EAC09:: @ 85EAC09 - .incbin "baserom.gba", 0x5eac09, 0x19 - -gUnknown_085EAC22:: @ 85EAC22 - .incbin "baserom.gba", 0x5eac22, 0x29 - -gUnknown_085EAC4B:: @ 85EAC4B - .incbin "baserom.gba", 0x5eac4b, 0x18 - -gUnknown_085EAC63:: @ 85EAC63 - .incbin "baserom.gba", 0x5eac63, 0x2a - -gUnknown_085EAC8D:: @ 85EAC8D - .incbin "baserom.gba", 0x5eac8d, 0x28 - -gUnknown_085EACB5:: @ 85EACB5 - .incbin "baserom.gba", 0x5eacb5, 0x13 - -gUnknown_085EACC8:: @ 85EACC8 - .incbin "baserom.gba", 0x5eacc8, 0x3c - -gUnknown_085EAD04:: @ 85EAD04 - .incbin "baserom.gba", 0x5ead04, 0x4 - -gUnknown_085EAD08:: @ 85EAD08 - .incbin "baserom.gba", 0x5ead08, 0x4 - -gUnknown_085EAD0C:: @ 85EAD0C - .incbin "baserom.gba", 0x5ead0c, 0x8 - -gUnknown_085EAD14:: @ 85EAD14 - .incbin "baserom.gba", 0x5ead14, 0x7 - -gUnknown_085EAD1B:: @ 85EAD1B - .incbin "baserom.gba", 0x5ead1b, 0x7 - -gUnknown_085EAD22:: @ 85EAD22 - .incbin "baserom.gba", 0x5ead22, 0x7 - -gUnknown_085EAD29:: @ 85EAD29 - .incbin "baserom.gba", 0x5ead29, 0x7 - -gUnknown_085EAD30:: @ 85EAD30 - .incbin "baserom.gba", 0x5ead30, 0x132 - -gUnknown_085EAE62:: @ 85EAE62 - .incbin "baserom.gba", 0x5eae62, 0x4 - -gUnknown_085EAE66:: @ 85EAE66 - .incbin "baserom.gba", 0x5eae66, 0x4b - -gUnknown_085EAEB1:: @ 85EAEB1 - .incbin "baserom.gba", 0x5eaeb1, 0x7 - -gUnknown_085EAEB8:: @ 85EAEB8 - .incbin "baserom.gba", 0x5eaeb8, 0x230 - -gUnknown_085EB0E8:: @ 85EB0E8 - .incbin "baserom.gba", 0x5eb0e8, 0x5 - -gUnknown_085EB0ED:: @ 85EB0ED - .incbin "baserom.gba", 0x5eb0ed, 0x7 - -gUnknown_085EB0F4:: @ 85EB0F4 - .incbin "baserom.gba", 0x5eb0f4, 0x5 - -gUnknown_085EB0F9:: @ 85EB0F9 - .incbin "baserom.gba", 0x5eb0f9, 0x6 - -gUnknown_085EB0FF:: @ 85EB0FF - .incbin "baserom.gba", 0x5eb0ff, 0x6a - -gUnknown_085EB169:: @ 85EB169 - .incbin "baserom.gba", 0x5eb169, 0xd - -gUnknown_085EB176:: @ 85EB176 - .incbin "baserom.gba", 0x5eb176, 0xd - -gUnknown_085EB183:: @ 85EB183 - .incbin "baserom.gba", 0x5eb183, 0x8 - -gUnknown_085EB18B:: @ 85EB18B - .incbin "baserom.gba", 0x5eb18b, 0xd - -gUnknown_085EB198:: @ 85EB198 - .incbin "baserom.gba", 0x5eb198, 0xc4 - -gUnknown_085EB25C:: @ 85EB25C - .incbin "baserom.gba", 0x5eb25c, 0x8 - -gUnknown_085EB264:: @ 85EB264 - .incbin "baserom.gba", 0x5eb264, 0x8 - -gUnknown_085EB26C:: @ 85EB26C - .incbin "baserom.gba", 0x5eb26c, 0x4 - -gUnknown_085EB270:: @ 85EB270 - .incbin "baserom.gba", 0x5eb270, 0x9 - -gUnknown_085EB279:: @ 85EB279 - .incbin "baserom.gba", 0x5eb279, 0x5 - -gUnknown_085EB27E:: @ 85EB27E - .incbin "baserom.gba", 0x5eb27e, 0x7 - -gUnknown_085EB285:: @ 85EB285 - .incbin "baserom.gba", 0x5eb285, 0x34a - -gUnknown_085EB5CF:: @ 85EB5CF - .incbin "baserom.gba", 0x5eb5cf, 0xb - -gUnknown_085EB5DA:: @ 85EB5DA - .incbin "baserom.gba", 0x5eb5da, 0xb - -gUnknown_085EB5E5:: @ 85EB5E5 - .incbin "baserom.gba", 0x5eb5e5, 0x9 - -gUnknown_085EB5EE:: @ 85EB5EE - .incbin "baserom.gba", 0x5eb5ee, 0xb - -gUnknown_085EB5F9:: @ 85EB5F9 - .incbin "baserom.gba", 0x5eb5f9, 0x8 - -gUnknown_085EB601:: @ 85EB601 - .incbin "baserom.gba", 0x5eb601, 0x9 - -gUnknown_085EB60A:: @ 85EB60A - .incbin "baserom.gba", 0x5eb60a, 0x4 - -gUnknown_085EB60E:: @ 85EB60E - .incbin "baserom.gba", 0x5eb60e, 0x97 - -gUnknown_085EB6A5:: @ 85EB6A5 - .incbin "baserom.gba", 0x5eb6a5, 0x8 - -gUnknown_085EB6AD:: @ 85EB6AD - .incbin "baserom.gba", 0x5eb6ad, 0x13d - -gUnknown_085EB7EA:: @ 85EB7EA - .incbin "baserom.gba", 0x5eb7ea, 0x49f - -gUnknown_085EBC89:: @ 85EBC89 - .incbin "baserom.gba", 0x5ebc89, 0x24 - -gUnknown_085EBCAD:: @ 85EBCAD - .incbin "baserom.gba", 0x5ebcad, 0x14 - -gUnknown_085EBCC1:: @ 85EBCC1 - .incbin "baserom.gba", 0x5ebcc1, 0x89 - -gUnknown_085EBD4A:: @ 85EBD4A - .incbin "baserom.gba", 0x5ebd4a, 0x115 - -gUnknown_085EBE5F:: @ 85EBE5F - .incbin "baserom.gba", 0x5ebe5f, 0xf - -gUnknown_085EBE6E:: @ 85EBE6E - .incbin "baserom.gba", 0x5ebe6e, 0x11f - -gUnknown_085EBF8D:: @ 85EBF8D - .incbin "baserom.gba", 0x5ebf8d, 0x8 - -gUnknown_085EBF95:: @ 85EBF95 - .incbin "baserom.gba", 0x5ebf95, 0x39 - -gUnknown_085EBFCE:: @ 85EBFCE - .incbin "baserom.gba", 0x5ebfce, 0x9 - -gUnknown_085EBFD7:: @ 85EBFD7 - .incbin "baserom.gba", 0x5ebfd7, 0x38 - -gUnknown_085EC00F:: @ 85EC00F - .incbin "baserom.gba", 0x5ec00f, 0x1a - -gUnknown_085EC029:: @ 85EC029 - .incbin "baserom.gba", 0x5ec029, 0x7 - -gUnknown_085EC030:: @ 85EC030 - .incbin "baserom.gba", 0x5ec030, 0x376 - -gUnknown_085EC3A6:: @ 85EC3A6 - .incbin "baserom.gba", 0x5ec3a6, 0xe - -gUnknown_085EC3B4:: @ 85EC3B4 - .incbin "baserom.gba", 0x5ec3b4, 0x5c - -gUnknown_085EC410:: @ 85EC410 - .incbin "baserom.gba", 0x5ec410, 0x1f - -gUnknown_085EC42F:: @ 85EC42F - .incbin "baserom.gba", 0x5ec42f, 0x9a - -gUnknown_085EC4C9:: @ 85EC4C9 - .incbin "baserom.gba", 0x5ec4c9, 0x20 - -gUnknown_085EC4E9:: @ 85EC4E9 - .incbin "baserom.gba", 0x5ec4e9, 0x37 - -gUnknown_085EC520:: @ 85EC520 - .incbin "baserom.gba", 0x5ec520, 0x152 - -gUnknown_085EC672:: @ 85EC672 - .incbin "baserom.gba", 0x5ec672, 0x16 - -gUnknown_085EC688:: @ 85EC688 - .incbin "baserom.gba", 0x5ec688, 0x20 - -gUnknown_085EC6A8:: @ 85EC6A8 - .incbin "baserom.gba", 0x5ec6a8, 0xa - -gUnknown_085EC6B2:: @ 85EC6B2 - .incbin "baserom.gba", 0x5ec6b2, 0x54 - -gUnknown_085EC706:: @ 85EC706 - .incbin "baserom.gba", 0x5ec706, 0x21 - -gUnknown_085EC727:: @ 85EC727 - .incbin "baserom.gba", 0x5ec727, 0x1c - -gUnknown_085EC743:: @ 85EC743 - .incbin "baserom.gba", 0x5ec743, 0xf - -gUnknown_085EC752:: @ 85EC752 - .incbin "baserom.gba", 0x5ec752, 0x13 - -gUnknown_085EC765:: @ 85EC765 - .incbin "baserom.gba", 0x5ec765, 0x3b - -gUnknown_085EC7A0:: @ 85EC7A0 - .incbin "baserom.gba", 0x5ec7a0, 0x41 - -gUnknown_085EC7E1:: @ 85EC7E1 - .incbin "baserom.gba", 0x5ec7e1, 0xe - -gUnknown_085EC7EF:: @ 85EC7EF - .incbin "baserom.gba", 0x5ec7ef, 0x11 - -gUnknown_085EC800:: @ 85EC800 - .incbin "baserom.gba", 0x5ec800, 0x16 - -gUnknown_085EC816:: @ 85EC816 - .incbin "baserom.gba", 0x5ec816, 0x59 - -gUnknown_085EC86F:: @ 85EC86F - .incbin "baserom.gba", 0x5ec86f, 0x65 - -gUnknown_085EC8D4:: @ 85EC8D4 - .incbin "baserom.gba", 0x5ec8d4, 0x43 - -gUnknown_085EC917:: @ 85EC917 - .incbin "baserom.gba", 0x5ec917, 0x38 - -gUnknown_085EC94F:: @ 85EC94F - .incbin "baserom.gba", 0x5ec94f, 0x53 - -gUnknown_085EC9A2:: @ 85EC9A2 - .incbin "baserom.gba", 0x5ec9a2, 0x30 - -gUnknown_085EC9D2:: @ 85EC9D2 - .incbin "baserom.gba", 0x5ec9d2, 0x6 - -gUnknown_085EC9D8:: @ 85EC9D8 - .incbin "baserom.gba", 0x5ec9d8, 0xc - -gUnknown_085EC9E4:: @ 85EC9E4 - .incbin "baserom.gba", 0x5ec9e4, 0x8 - -gUnknown_085EC9EC:: @ 85EC9EC - .incbin "baserom.gba", 0x5ec9ec, 0x21 - -gUnknown_085ECA0D:: @ 85ECA0D - .incbin "baserom.gba", 0x5eca0d, 0x15 - -gUnknown_085ECA22:: @ 85ECA22 - .incbin "baserom.gba", 0x5eca22, 0x16 - -gUnknown_085ECA38:: @ 85ECA38 - .incbin "baserom.gba", 0x5eca38, 0x17 - -gUnknown_085ECA4F:: @ 85ECA4F - .incbin "baserom.gba", 0x5eca4f, 0x3b - -gUnknown_085ECA8A:: @ 85ECA8A - .incbin "baserom.gba", 0x5eca8a, 0x10 - -gUnknown_085ECA9A:: @ 85ECA9A - .incbin "baserom.gba", 0x5eca9a, 0xd - -gUnknown_085ECAA7:: @ 85ECAA7 - .incbin "baserom.gba", 0x5ecaa7, 0x31 - -gUnknown_085ECAD8:: @ 85ECAD8 - .incbin "baserom.gba", 0x5ecad8, 0x34 - -gUnknown_085ECB0C:: @ 85ECB0C - .incbin "baserom.gba", 0x5ecb0c, 0x6 - -gUnknown_085ECB12:: @ 85ECB12 - .incbin "baserom.gba", 0x5ecb12, 0x9 - -gUnknown_085ECB1B:: @ 85ECB1B - .incbin "baserom.gba", 0x5ecb1b, 0x5 - -gUnknown_085ECB20:: @ 85ECB20 - .incbin "baserom.gba", 0x5ecb20, 0xa - -gUnknown_085ECB2A:: @ 85ECB2A - .incbin "baserom.gba", 0x5ecb2a, 0xa - -gUnknown_085ECB34:: @ 85ECB34 - .incbin "baserom.gba", 0x5ecb34, 0x6 - -gUnknown_085ECB3A:: @ 85ECB3A - .incbin "baserom.gba", 0x5ecb3a, 0x4 - -gUnknown_085ECB3E:: @ 85ECB3E - .incbin "baserom.gba", 0x5ecb3e, 0xa - -gUnknown_085ECB48:: @ 85ECB48 - .incbin "baserom.gba", 0x5ecb48, 0x6 - -gUnknown_085ECB4E:: @ 85ECB4E - .incbin "baserom.gba", 0x5ecb4e, 0x4 - -gUnknown_085ECB52:: @ 85ECB52 - .incbin "baserom.gba", 0x5ecb52, 0x6 - -gUnknown_085ECB58:: @ 85ECB58 - .incbin "baserom.gba", 0x5ecb58, 0x7 - -gUnknown_085ECB5F:: @ 85ECB5F - .incbin "baserom.gba", 0x5ecb5f, 0x5 - -gUnknown_085ECB64:: @ 85ECB64 - .incbin "baserom.gba", 0x5ecb64, 0x7 - -gUnknown_085ECB6B:: @ 85ECB6B - .incbin "baserom.gba", 0x5ecb6b, 0x7 - -gUnknown_085ECB72:: @ 85ECB72 - .incbin "baserom.gba", 0x5ecb72, 0x8 - -gUnknown_085ECB7A:: @ 85ECB7A - .incbin "baserom.gba", 0x5ecb7a, 0x6 - -gUnknown_085ECB80:: @ 85ECB80 - .incbin "baserom.gba", 0x5ecb80, 0x7 - -gUnknown_085ECB87:: @ 85ECB87 - .incbin "baserom.gba", 0x5ecb87, 0x3d6 - -gUnknown_085ECF5D:: @ 85ECF5D - .incbin "baserom.gba", 0x5ecf5d, 0xe - -gUnknown_085ECF6B:: @ 85ECF6B - .incbin "baserom.gba", 0x5ecf6b, 0x6 - -gUnknown_085ECF71:: @ 85ECF71 - .incbin "baserom.gba", 0x5ecf71, 0x7 - -gUnknown_085ECF78:: @ 85ECF78 - .incbin "baserom.gba", 0x5ecf78, 0x6 - -gUnknown_085ECF7E:: @ 85ECF7E - .incbin "baserom.gba", 0x5ecf7e, 0x8 - -gUnknown_085ECF86:: @ 85ECF86 - .incbin "baserom.gba", 0x5ecf86, 0x8 - -gUnknown_085ECF8E:: @ 85ECF8E - .incbin "baserom.gba", 0x5ecf8e, 0x1 - -gUnknown_085ECF8F:: @ 85ECF8F - .incbin "baserom.gba", 0x5ecf8f, 0xa - -gUnknown_085ECF99:: @ 85ECF99 - .incbin "baserom.gba", 0x5ecf99, 0xd - -gUnknown_085ECFA6:: @ 85ECFA6 - .incbin "baserom.gba", 0x5ecfa6, 0x12 - -gUnknown_085ECFB8:: @ 85ECFB8 - .incbin "baserom.gba", 0x5ecfb8, 0x35 - -gUnknown_085ECFED:: @ 85ECFED - .incbin "baserom.gba", 0x5ecfed, 0x23 - -gUnknown_085ED010:: @ 85ED010 - .incbin "baserom.gba", 0x5ed010, 0xf - -gUnknown_085ED01F:: @ 85ED01F - .incbin "baserom.gba", 0x5ed01f, 0x17 - -gUnknown_085ED036:: @ 85ED036 - .incbin "baserom.gba", 0x5ed036, 0xc - -gUnknown_085ED042:: @ 85ED042 - .incbin "baserom.gba", 0x5ed042, 0x43 - -gUnknown_085ED085:: @ 85ED085 - .incbin "baserom.gba", 0x5ed085, 0x11 - -gUnknown_085ED096:: @ 85ED096 - .incbin "baserom.gba", 0x5ed096, 0x9 - -gUnknown_085ED09F:: @ 85ED09F - .incbin "baserom.gba", 0x5ed09f, 0x17 - -gUnknown_085ED0B6:: @ 85ED0B6 - .incbin "baserom.gba", 0x5ed0b6, 0x12 - -gUnknown_085ED0C8:: @ 85ED0C8 - .incbin "baserom.gba", 0x5ed0c8, 0xb - -gUnknown_085ED0D3:: @ 85ED0D3 - .incbin "baserom.gba", 0x5ed0d3, 0xd - -gUnknown_085ED0E0:: @ 85ED0E0 - .incbin "baserom.gba", 0x5ed0e0, 0xb3 - -gUnknown_085ED193:: @ 85ED193 - .incbin "baserom.gba", 0x5ed193, 0x5 - -gUnknown_085ED198:: @ 85ED198 - .incbin "baserom.gba", 0x5ed198, 0x8 - -gUnknown_085ED1A0:: @ 85ED1A0 - .incbin "baserom.gba", 0x5ed1a0, 0x7 - -gUnknown_085ED1A7:: @ 85ED1A7 - .incbin "baserom.gba", 0x5ed1a7, 0x4 - -gUnknown_085ED1AB:: @ 85ED1AB - .incbin "baserom.gba", 0x5ed1ab, 0x7 - -gUnknown_085ED1B2:: @ 85ED1B2 - .incbin "baserom.gba", 0x5ed1b2, 0x3 - -gUnknown_085ED1B5:: @ 85ED1B5 - .incbin "baserom.gba", 0x5ed1b5, 0x3 - -gUnknown_085ED1B8:: @ 85ED1B8 - .incbin "baserom.gba", 0x5ed1b8, 0x18 - -gUnknown_085ED1D0:: @ 85ED1D0 - .incbin "baserom.gba", 0x5ed1d0, 0x19 - -gUnknown_085ED1E9:: @ 85ED1E9 - .incbin "baserom.gba", 0x5ed1e9, 0x11 - -gUnknown_085ED1FA:: @ 85ED1FA - .incbin "baserom.gba", 0x5ed1fa, 0xd - -gUnknown_085ED207:: @ 85ED207 - .incbin "baserom.gba", 0x5ed207, 0x17 - -gUnknown_085ED21E:: @ 85ED21E - .incbin "baserom.gba", 0x5ed21e, 0xa - -gUnknown_085ED228:: @ 85ED228 - .incbin "baserom.gba", 0x5ed228, 0x6 - -gUnknown_085ED22E:: @ 85ED22E - .incbin "baserom.gba", 0x5ed22e, 0x5 - -gUnknown_085ED233:: @ 85ED233 - .incbin "baserom.gba", 0x5ed233, 0x5 - -gUnknown_085ED238:: @ 85ED238 - .incbin "baserom.gba", 0x5ed238, 0x71 - -gUnknown_085ED2A9:: @ 85ED2A9 - .incbin "baserom.gba", 0x5ed2a9, 0x14 - -gUnknown_085ED2BD:: @ 85ED2BD - .incbin "baserom.gba", 0x5ed2bd, 0x152 - -gUnknown_085ED40F:: @ 85ED40F - .incbin "baserom.gba", 0x5ed40f, 0x6 - -gUnknown_085ED415:: @ 85ED415 - .incbin "baserom.gba", 0x5ed415, 0x8 - -gUnknown_085ED41D:: @ 85ED41D - .incbin "baserom.gba", 0x5ed41d, 0x6 - -gUnknown_085ED423:: @ 85ED423 - .incbin "baserom.gba", 0x5ed423, 0x7 - -gUnknown_085ED42A:: @ 85ED42A - .incbin "baserom.gba", 0x5ed42a, 0x6 - -gUnknown_085ED430:: @ 85ED430 - .incbin "baserom.gba", 0x5ed430, 0x4 - -gUnknown_085ED434:: @ 85ED434 - .incbin "baserom.gba", 0x5ed434, 0x6 - -gUnknown_085ED43A:: @ 85ED43A - .incbin "baserom.gba", 0x5ed43a, 0x6 - -gUnknown_085ED440:: @ 85ED440 - .incbin "baserom.gba", 0x5ed440, 0xa - -gUnknown_085ED44A:: @ 85ED44A - .incbin "baserom.gba", 0x5ed44a, 0x15b - -gUnknown_085ED5A5:: @ 85ED5A5 - .incbin "baserom.gba", 0x5ed5a5, 0x19 - -gUnknown_085ED5BE:: @ 85ED5BE - .incbin "baserom.gba", 0x5ed5be, 0x216 - -gUnknown_085ED7D4:: @ 85ED7D4 - .incbin "baserom.gba", 0x5ed7d4, 0xc - -gUnknown_085ED7E0:: @ 85ED7E0 - .incbin "baserom.gba", 0x5ed7e0, 0x28 - -gUnknown_085ED808:: @ 85ED808 - .incbin "baserom.gba", 0x5ed808, 0x8 - -gUnknown_085ED810:: @ 85ED810 - .incbin "baserom.gba", 0x5ed810, 0x10 - -gUnknown_085ED820:: @ 85ED820 - .incbin "baserom.gba", 0x5ed820, 0xc - -gUnknown_085ED82C:: @ 85ED82C - .incbin "baserom.gba", 0x5ed82c, 0x4 - -gUnknown_085ED830:: @ 85ED830 - .incbin "baserom.gba", 0x5ed830, 0x8 - -gUnknown_085ED838:: @ 85ED838 - .incbin "baserom.gba", 0x5ed838, 0x8 - -gUnknown_085ED840:: @ 85ED840 - .incbin "baserom.gba", 0x5ed840, 0x8 - -gUnknown_085ED848:: @ 85ED848 - .incbin "baserom.gba", 0x5ed848, 0x8 - -gUnknown_085ED850:: @ 85ED850 - .incbin "baserom.gba", 0x5ed850, 0xc - -gUnknown_085ED85C:: @ 85ED85C - .incbin "baserom.gba", 0x5ed85c, 0x4 - -gUnknown_085ED860:: @ 85ED860 - .incbin "baserom.gba", 0x5ed860, 0x18 - -gUnknown_085ED878:: @ 85ED878 - .incbin "baserom.gba", 0x5ed878, 0x58 - -gUnknown_085ED8D0:: @ 85ED8D0 - .incbin "baserom.gba", 0x5ed8d0, 0xc - -gUnknown_085ED8DC:: @ 85ED8DC - .incbin "baserom.gba", 0x5ed8dc, 0x18 - -gUnknown_085ED8F4:: @ 85ED8F4 - .incbin "baserom.gba", 0x5ed8f4, 0xb - -gUnknown_085ED8FF:: @ 85ED8FF - .incbin "baserom.gba", 0x5ed8ff, 0xf - -gUnknown_085ED90E:: @ 85ED90E - .incbin "baserom.gba", 0x5ed90e, 0xe - -gUnknown_085ED91C:: @ 85ED91C - .incbin "baserom.gba", 0x5ed91c, 0x3a7 - -gUnknown_085EDCC3:: @ 85EDCC3 - .incbin "baserom.gba", 0x5edcc3, 0x7 - -gUnknown_085EDCCA:: @ 85EDCCA - .incbin "baserom.gba", 0x5edcca, 0x5 - -gUnknown_085EDCCF:: @ 85EDCCF - .incbin "baserom.gba", 0x5edccf, 0x8 - -gUnknown_085EDCD7:: @ 85EDCD7 - .incbin "baserom.gba", 0x5edcd7, 0x7 - -gUnknown_085EDCDE:: @ 85EDCDE - .incbin "baserom.gba", 0x5edcde, 0x7 - -gUnknown_085EDCE5:: @ 85EDCE5 - .incbin "baserom.gba", 0x5edce5, 0x64 - -gUnknown_085EDD49:: @ 85EDD49 - .incbin "baserom.gba", 0x5edd49, 0x22 - -gUnknown_085EDD6B:: @ 85EDD6B - .incbin "baserom.gba", 0x5edd6b, 0x1b - -gUnknown_085EDD86:: @ 85EDD86 - .incbin "baserom.gba", 0x5edd86, 0x15 - -gUnknown_085EDD9B:: @ 85EDD9B - .incbin "baserom.gba", 0x5edd9b, 0x22 - -gUnknown_085EDDBD:: @ 85EDDBD - .incbin "baserom.gba", 0x5eddbd, 0x25 - -gUnknown_085EDDE2:: @ 85EDDE2 - .incbin "baserom.gba", 0x5edde2, 0x19 - -gUnknown_085EDDFB:: @ 85EDDFB - .incbin "baserom.gba", 0x5eddfb, 0x1d - -gUnknown_085EDE18:: @ 85EDE18 - .incbin "baserom.gba", 0x5ede18, 0x14 - -gUnknown_085EDE2C:: @ 85EDE2C - .incbin "baserom.gba", 0x5ede2c, 0x31 - -gUnknown_085EDE5D:: @ 85EDE5D - .incbin "baserom.gba", 0x5ede5d, 0x8 - -gUnknown_085EDE65:: @ 85EDE65 - .incbin "baserom.gba", 0x5ede65, 0x17 - -gUnknown_085EDE7C:: @ 85EDE7C - .incbin "baserom.gba", 0x5ede7c, 0x8 - -gUnknown_085EDE84:: @ 85EDE84 - .incbin "baserom.gba", 0x5ede84, 0x9 - -gUnknown_085EDE8D:: @ 85EDE8D - .incbin "baserom.gba", 0x5ede8d, 0x46 - -gUnknown_085EDED3:: @ 85EDED3 - .incbin "baserom.gba", 0x5eded3, 0x21 - -gUnknown_085EDEF4:: @ 85EDEF4 - .incbin "baserom.gba", 0x5edef4, 0x1d - -gUnknown_085EDF11:: @ 85EDF11 - .incbin "baserom.gba", 0x5edf11, 0x19 - -gUnknown_085EDF2A:: @ 85EDF2A - .incbin "baserom.gba", 0x5edf2a, 0x14 - -gUnknown_085EDF3E:: @ 85EDF3E - .incbin "baserom.gba", 0x5edf3e, 0x31 - -gUnknown_085EDF6F:: @ 85EDF6F - .incbin "baserom.gba", 0x5edf6f, 0x17 - -gUnknown_085EDF86:: @ 85EDF86 - .incbin "baserom.gba", 0x5edf86, 0x1a - -gUnknown_085EDFA0:: @ 85EDFA0 - .incbin "baserom.gba", 0x5edfa0, 0x4 - -gUnknown_085EDFA4:: @ 85EDFA4 - .incbin "baserom.gba", 0x5edfa4, 0x4 - -gUnknown_085EDFA8:: @ 85EDFA8 - .incbin "baserom.gba", 0x5edfa8, 0x4 - -gUnknown_085EDFAC:: @ 85EDFAC - .incbin "baserom.gba", 0x5edfac, 0x4 - -gUnknown_085EDFB0:: @ 85EDFB0 - .incbin "baserom.gba", 0x5edfb0, 0xf - -gUnknown_085EDFBF:: @ 85EDFBF - .incbin "baserom.gba", 0x5edfbf, 0xa - -gUnknown_085EDFC9:: @ 85EDFC9 - .incbin "baserom.gba", 0x5edfc9, 0xd - -gUnknown_085EDFD6:: @ 85EDFD6 - .incbin "baserom.gba", 0x5edfd6, 0x1f - -gUnknown_085EDFF5:: @ 85EDFF5 - .incbin "baserom.gba", 0x5edff5, 0x1f - -gUnknown_085EE014:: @ 85EE014 - .incbin "baserom.gba", 0x5ee014, 0x48 - -gUnknown_085EE05C:: @ 85EE05C - .incbin "baserom.gba", 0x5ee05c, 0xf - -gUnknown_085EE06B:: @ 85EE06B - .incbin "baserom.gba", 0x5ee06b, 0x2c - -gUnknown_085EE097:: @ 85EE097 - .incbin "baserom.gba", 0x5ee097, 0xc - -gUnknown_085EE0A3:: @ 85EE0A3 - .incbin "baserom.gba", 0x5ee0a3, 0x1c - -gUnknown_085EE0BF:: @ 85EE0BF - .incbin "baserom.gba", 0x5ee0bf, 0x1d - -gUnknown_085EE0DC:: @ 85EE0DC - .incbin "baserom.gba", 0x5ee0dc, 0x1e - -gUnknown_085EE0FA:: @ 85EE0FA - .incbin "baserom.gba", 0x5ee0fa, 0xd - -gUnknown_085EE107:: @ 85EE107 - .incbin "baserom.gba", 0x5ee107, 0x19 - -gUnknown_085EE120:: @ 85EE120 - .incbin "baserom.gba", 0x5ee120, 0xd - -gUnknown_085EE12D:: @ 85EE12D - .incbin "baserom.gba", 0x5ee12d, 0x2b - -gUnknown_085EE158:: @ 85EE158 - .incbin "baserom.gba", 0x5ee158, 0x20 - -gUnknown_085EE178:: @ 85EE178 - .incbin "baserom.gba", 0x5ee178, 0x20 - -gUnknown_085EE198:: @ 85EE198 - .incbin "baserom.gba", 0x5ee198, 0x1f - -gUnknown_085EE1B7:: @ 85EE1B7 - .incbin "baserom.gba", 0x5ee1b7, 0x24 - -gUnknown_085EE1DB:: @ 85EE1DB - .incbin "baserom.gba", 0x5ee1db, 0x23 - -gUnknown_085EE1FE:: @ 85EE1FE - .incbin "baserom.gba", 0x5ee1fe, 0x23 - -gUnknown_085EE221:: @ 85EE221 - .incbin "baserom.gba", 0x5ee221, 0x20 - -gUnknown_085EE241:: @ 85EE241 - .incbin "baserom.gba", 0x5ee241, 0x20 - -gUnknown_085EE261:: @ 85EE261 - .incbin "baserom.gba", 0x5ee261, 0x1b - -gUnknown_085EE27C:: @ 85EE27C - .incbin "baserom.gba", 0x5ee27c, 0x1c - -gUnknown_085EE298:: @ 85EE298 - .incbin "baserom.gba", 0x5ee298, 0x20 - -gUnknown_085EE2B8:: @ 85EE2B8 - .incbin "baserom.gba", 0x5ee2b8, 0x20 - -gUnknown_085EE2D8:: @ 85EE2D8 - .incbin "baserom.gba", 0x5ee2d8, 0x1a - -gUnknown_085EE2F2:: @ 85EE2F2 - .incbin "baserom.gba", 0x5ee2f2, 0x7 - -gUnknown_085EE2F9:: @ 85EE2F9 - .incbin "baserom.gba", 0x5ee2f9, 0x9 - -gUnknown_085EE302:: @ 85EE302 - .incbin "baserom.gba", 0x5ee302, 0xf - -gUnknown_085EE311:: @ 85EE311 - .incbin "baserom.gba", 0x5ee311, 0x8 - -gUnknown_085EE319:: @ 85EE319 - .incbin "baserom.gba", 0x5ee319, 0x7 - -gUnknown_085EE320:: @ 85EE320 - .incbin "baserom.gba", 0x5ee320, 0x6 - -gUnknown_085EE326:: @ 85EE326 - .incbin "baserom.gba", 0x5ee326, 0xc - -gUnknown_085EE332:: @ 85EE332 - .incbin "baserom.gba", 0x5ee332, 0x6 - -gUnknown_085EE338:: @ 85EE338 - .incbin "baserom.gba", 0x5ee338, 0x11 - -gUnknown_085EE349:: @ 85EE349 - .incbin "baserom.gba", 0x5ee349, 0x12 - -gUnknown_085EE35B:: @ 85EE35B - .incbin "baserom.gba", 0x5ee35b, 0x12 - -gUnknown_085EE36D:: @ 85EE36D - .incbin "baserom.gba", 0x5ee36d, 0x14 - -gUnknown_085EE381:: @ 85EE381 - .incbin "baserom.gba", 0x5ee381, 0x11 - -gUnknown_085EE392:: @ 85EE392 - .incbin "baserom.gba", 0x5ee392, 0xa - -gUnknown_085EE39C:: @ 85EE39C - .incbin "baserom.gba", 0x5ee39c, 0x88 - -gUnknown_085EE424:: @ 85EE424 - .incbin "baserom.gba", 0x5ee424, 0x9 - -gUnknown_085EE42D:: @ 85EE42D - .incbin "baserom.gba", 0x5ee42d, 0x22 - -gUnknown_085EE44F:: @ 85EE44F - .incbin "baserom.gba", 0x5ee44f, 0x24 - -gUnknown_085EE473:: @ 85EE473 - .incbin "baserom.gba", 0x5ee473, 0x1e - -gUnknown_085EE491:: @ 85EE491 - .incbin "baserom.gba", 0x5ee491, 0x7 - -gUnknown_085EE498:: @ 85EE498 - .incbin "baserom.gba", 0x5ee498, 0x2 - -gUnknown_085EE49A:: @ 85EE49A - .incbin "baserom.gba", 0x5ee49a, 0xa - -gUnknown_085EE4A4:: @ 85EE4A4 - .incbin "baserom.gba", 0x5ee4a4, 0x53 - -gUnknown_085EE4F7:: @ 85EE4F7 - .incbin "baserom.gba", 0x5ee4f7, 0x15 - -gUnknown_085EE50C:: @ 85EE50C - .incbin "baserom.gba", 0x5ee50c, 0x47 - -gUnknown_085EE553:: @ 85EE553 - .incbin "baserom.gba", 0x5ee553, 0x1f - -gUnknown_085EE572:: @ 85EE572 - .incbin "baserom.gba", 0x5ee572, 0x17 - -gUnknown_085EE589:: @ 85EE589 - .incbin "baserom.gba", 0x5ee589, 0x4b - -gUnknown_085EE5D4:: @ 85EE5D4 - .incbin "baserom.gba", 0x5ee5d4, 0xb - -gUnknown_085EE5DF:: @ 85EE5DF - .incbin "baserom.gba", 0x5ee5df, 0xa - -gUnknown_085EE5E9:: @ 85EE5E9 - .incbin "baserom.gba", 0x5ee5e9, 0xb - -gUnknown_085EE5F4:: @ 85EE5F4 - .incbin "baserom.gba", 0x5ee5f4, 0x9 - -gUnknown_085EE5FD:: @ 85EE5FD - .incbin "baserom.gba", 0x5ee5fd, 0xa - -gUnknown_085EE607:: @ 85EE607 - .incbin "baserom.gba", 0x5ee607, 0xc - -gUnknown_085EE613:: @ 85EE613 - .incbin "baserom.gba", 0x5ee613, 0xa - -gUnknown_085EE61D:: @ 85EE61D - .incbin "baserom.gba", 0x5ee61d, 0xb - -gUnknown_085EE628:: @ 85EE628 - .incbin "baserom.gba", 0x5ee628, 0xd - -gUnknown_085EE635:: @ 85EE635 - .incbin "baserom.gba", 0x5ee635, 0xb - -gUnknown_085EE640:: @ 85EE640 - .incbin "baserom.gba", 0x5ee640, 0x7 - -gUnknown_085EE647:: @ 85EE647 - .incbin "baserom.gba", 0x5ee647, 0xd - -gUnknown_085EE654:: @ 85EE654 - .incbin "baserom.gba", 0x5ee654, 0x9 - -gUnknown_085EE65D:: @ 85EE65D - .incbin "baserom.gba", 0x5ee65d, 0xa - -gUnknown_085EE667:: @ 85EE667 - .incbin "baserom.gba", 0x5ee667, 0x23 - -gUnknown_085EE68A:: @ 85EE68A - .incbin "baserom.gba", 0x5ee68a, 0x4 - -gUnknown_085EE68E:: @ 85EE68E - .incbin "baserom.gba", 0x5ee68e, 0x2 - -gUnknown_085EE690:: @ 85EE690 - .incbin "baserom.gba", 0x5ee690, 0x6f - -gUnknown_085EE6FF:: @ 85EE6FF - .incbin "baserom.gba", 0x5ee6ff, 0x17 - -gUnknown_085EE716:: @ 85EE716 - .incbin "baserom.gba", 0x5ee716, 0x4f - -gUnknown_085EE765:: @ 85EE765 - .incbin "baserom.gba", 0x5ee765, 0x23 - -gUnknown_085EE788:: @ 85EE788 - .incbin "baserom.gba", 0x5ee788, 0x37 - -gUnknown_085EE7BF:: @ 85EE7BF - .incbin "baserom.gba", 0x5ee7bf, 0xf - -gUnknown_085EE7CE:: @ 85EE7CE - .incbin "baserom.gba", 0x5ee7ce, 0x3c - -gUnknown_085EE80A:: @ 85EE80A - .incbin "baserom.gba", 0x5ee80a, 0x1d - -gUnknown_085EE827:: @ 85EE827 - .incbin "baserom.gba", 0x5ee827, 0x28 - -gUnknown_085EE84F:: @ 85EE84F - .incbin "baserom.gba", 0x5ee84f, 0x6 - -gUnknown_085EE855:: @ 85EE855 - .incbin "baserom.gba", 0x5ee855, 0x9 - -gUnknown_085EE85E:: @ 85EE85E - .incbin "baserom.gba", 0x5ee85e, 0x93 - -gUnknown_085EE8F1:: @ 85EE8F1 - .incbin "baserom.gba", 0x5ee8f1, 0x6 - -gUnknown_085EE8F7:: @ 85EE8F7 - .incbin "baserom.gba", 0x5ee8f7, 0xc - -gUnknown_085EE903:: @ 85EE903 - .incbin "baserom.gba", 0x5ee903, 0x1b - -gUnknown_085EE91E:: @ 85EE91E - .incbin "baserom.gba", 0x5ee91e, 0x15 - -gUnknown_085EE933:: @ 85EE933 - .incbin "baserom.gba", 0x5ee933, 0xf - -gUnknown_085EE942:: @ 85EE942 - .incbin "baserom.gba", 0x5ee942, 0x17 - -gUnknown_085EE959:: @ 85EE959 - .incbin "baserom.gba", 0x5ee959, 0xd - -gUnknown_085EE966:: @ 85EE966 - .incbin "baserom.gba", 0x5ee966, 0x11 - -gUnknown_085EE977:: @ 85EE977 - .incbin "baserom.gba", 0x5ee977, 0x16 - -@ 85EE98D - .include "data/text/easy_chat/easy_chat_group_names.inc" - -gUnknown_085EEA42:: @ 85EEA42 - .incbin "baserom.gba", 0x5eea42, 0x31 - -gUnknown_085EEA73:: @ 85EEA73 - .incbin "baserom.gba", 0x5eea73, 0x3 - -gUnknown_085EEA76:: @ 85EEA76 - .incbin "baserom.gba", 0x5eea76, 0x2 - -gUnknown_085EEA78:: @ 85EEA78 - .incbin "baserom.gba", 0x5eea78, 0x6 - -gUnknown_085EEA7E:: @ 85EEA7E - .incbin "baserom.gba", 0x5eea7e, 0x10 - -gUnknown_085EEA8E:: @ 85EEA8E - .incbin "baserom.gba", 0x5eea8e, 0x68 - -gUnknown_085EEAF6:: @ 85EEAF6 - .incbin "baserom.gba", 0x5eeaf6, 0x15 - -gUnknown_085EEB0B:: @ 85EEB0B - .incbin "baserom.gba", 0x5eeb0b, 0x73 - -gUnknown_085EEB7E:: @ 85EEB7E - .incbin "baserom.gba", 0x5eeb7e, 0x34 - -gUnknown_085EEBB2:: @ 85EEBB2 - .incbin "baserom.gba", 0x5eebb2, 0xf - -gUnknown_085EEBC1:: @ 85EEBC1 - .incbin "baserom.gba", 0x5eebc1, 0x1a - -gUnknown_085EEBDB:: @ 85EEBDB - .incbin "baserom.gba", 0x5eebdb, 0x1b - -gUnknown_085EEBF6:: @ 85EEBF6 - .incbin "baserom.gba", 0x5eebf6, 0x1a - -gUnknown_085EEC10:: @ 85EEC10 - .incbin "baserom.gba", 0x5eec10, 0x5 - -gUnknown_085EEC15:: @ 85EEC15 - .incbin "baserom.gba", 0x5eec15, 0x8 - -gUnknown_085EEC1D:: @ 85EEC1D - .incbin "baserom.gba", 0x5eec1d, 0x7 - -gUnknown_085EEC24:: @ 85EEC24 - .incbin "baserom.gba", 0x5eec24, 0x9 - -gUnknown_085EEC2D:: @ 85EEC2D - .incbin "baserom.gba", 0x5eec2d, 0x1c - -gUnknown_085EEC49:: @ 85EEC49 - .incbin "baserom.gba", 0x5eec49, 0x4 - -gUnknown_085EEC4D:: @ 85EEC4D - .incbin "baserom.gba", 0x5eec4d, 0x3 - -gUnknown_085EEC50:: @ 85EEC50 - .incbin "baserom.gba", 0x5eec50, 0x16 - -gUnknown_085EEC66:: @ 85EEC66 - .incbin "baserom.gba", 0x5eec66, 0xd - -gUnknown_085EEC73:: @ 85EEC73 - .incbin "baserom.gba", 0x5eec73, 0x18 - -gUnknown_085EEC8B:: @ 85EEC8B - .incbin "baserom.gba", 0x5eec8b, 0x1a - -gUnknown_085EECA5:: @ 85EECA5 - .incbin "baserom.gba", 0x5eeca5, 0x5 - -gUnknown_085EECAA:: @ 85EECAA - .incbin "baserom.gba", 0x5eecaa, 0x8 - -gUnknown_085EECB2:: @ 85EECB2 - .incbin "baserom.gba", 0x5eecb2, 0x9 - -gUnknown_085EECBB:: @ 85EECBB - .incbin "baserom.gba", 0x5eecbb, 0xf - -gUnknown_085EECCA:: @ 85EECCA - .incbin "baserom.gba", 0x5eecca, 0x4 - -gUnknown_085EECCE:: @ 85EECCE - .incbin "baserom.gba", 0x5eecce, 0x3 - -gUnknown_085EECD1:: @ 85EECD1 - .incbin "baserom.gba", 0x5eecd1, 0xc - -gUnknown_085EECDD:: @ 85EECDD - .incbin "baserom.gba", 0x5eecdd, 0x13 - -gUnknown_085EECF0:: @ 85EECF0 - .incbin "baserom.gba", 0x5eecf0, 0x1a - -gUnknown_085EED0A:: @ 85EED0A - .incbin "baserom.gba", 0x5eed0a, 0x1a - -gUnknown_085EED24:: @ 85EED24 - .incbin "baserom.gba", 0x5eed24, 0x2 - -gUnknown_085EED26:: @ 85EED26 - .incbin "baserom.gba", 0x5eed26, 0x7 - -gUnknown_085EED2D:: @ 85EED2D - .incbin "baserom.gba", 0x5eed2d, 0x7 - -gUnknown_085EED34:: @ 85EED34 - .incbin "baserom.gba", 0x5eed34, 0x8 - -gUnknown_085EED3C:: @ 85EED3C - .incbin "baserom.gba", 0x5eed3c, 0x1b4 - -gUnknown_085EEEF0:: @ 85EEEF0 - .incbin "baserom.gba", 0x5eeef0, 0x3c - -gUnknown_085EEF2C:: @ 85EEF2C - .incbin "baserom.gba", 0x5eef2c, 0x3c - -gUnknown_085EEF68:: @ 85EEF68 - .incbin "baserom.gba", 0x5eef68, 0x2c - -gUnknown_085EEF94:: @ 85EEF94 - .incbin "baserom.gba", 0x5eef94, 0x54 - -gUnknown_085EEFE8:: @ 85EEFE8 - .incbin "baserom.gba", 0x5eefe8, 0x10 - -gUnknown_085EEFF8:: @ 85EEFF8 - .incbin "baserom.gba", 0x5eeff8, 0x1c - -gUnknown_085EF014:: @ 85EF014 - .incbin "baserom.gba", 0x5ef014, 0x18 - -gUnknown_085EF02C:: @ 85EF02C - .incbin "baserom.gba", 0x5ef02c, 0x24 - -gUnknown_085EF050:: @ 85EF050 - .incbin "baserom.gba", 0x5ef050, 0x34 - -gUnknown_085EF084:: @ 85EF084 - .incbin "baserom.gba", 0x5ef084, 0x44 - -gUnknown_085EF0C8:: @ 85EF0C8 - .incbin "baserom.gba", 0x5ef0c8, 0x2c - -gUnknown_085EF0F4:: @ 85EF0F4 - .incbin "baserom.gba", 0x5ef0f4, 0x30 - -gUnknown_085EF124:: @ 85EF124 - .incbin "baserom.gba", 0x5ef124, 0x28 - -gUnknown_085EF14C:: @ 85EF14C - .incbin "baserom.gba", 0x5ef14c, 0x2c - -gUnknown_085EF178:: @ 85EF178 - .incbin "baserom.gba", 0x5ef178, 0x20 - -gUnknown_085EF198:: @ 85EF198 - .incbin "baserom.gba", 0x5ef198, 0x1c - -gUnknown_085EF1B4:: @ 85EF1B4 - .incbin "baserom.gba", 0x5ef1b4, 0x24 - -gUnknown_085EF1D8:: @ 85EF1D8 - .incbin "baserom.gba", 0x5ef1d8, 0x28 - -gUnknown_085EF200:: @ 85EF200 - .incbin "baserom.gba", 0x5ef200, 0x1c - -gUnknown_085EF21C:: @ 85EF21C - .incbin "baserom.gba", 0x5ef21c, 0x28 - -gUnknown_085EF244:: @ 85EF244 - .incbin "baserom.gba", 0x5ef244, 0x3c - -gUnknown_085EF280:: @ 85EF280 - .incbin "baserom.gba", 0x5ef280, 0x34 - -gUnknown_085EF2B4:: @ 85EF2B4 - .incbin "baserom.gba", 0x5ef2b4, 0x30 - -gUnknown_085EF2E4:: @ 85EF2E4 - .incbin "baserom.gba", 0x5ef2e4, 0x18 - -gUnknown_085EF2FC:: @ 85EF2FC - .incbin "baserom.gba", 0x5ef2fc, 0x34 - -gUnknown_085EF330:: @ 85EF330 - .incbin "baserom.gba", 0x5ef330, 0x30 - -gUnknown_085EF360:: @ 85EF360 - .incbin "baserom.gba", 0x5ef360, 0x1c - -gUnknown_085EF37C:: @ 85EF37C - .incbin "baserom.gba", 0x5ef37c, 0x20 - -gUnknown_085EF39C:: @ 85EF39C - .incbin "baserom.gba", 0x5ef39c, 0x28 - -gUnknown_085EF3C4:: @ 85EF3C4 - .incbin "baserom.gba", 0x5ef3c4, 0x2c - -gUnknown_085EF3F0:: @ 85EF3F0 - .incbin "baserom.gba", 0x5ef3f0, 0x20 - -gUnknown_085EF410:: @ 85EF410 - .incbin "baserom.gba", 0x5ef410, 0x1c - -gUnknown_085EF42C:: @ 85EF42C - .incbin "baserom.gba", 0x5ef42c, 0x34 - -gUnknown_085EF460:: @ 85EF460 - .incbin "baserom.gba", 0x5ef460, 0x34 - -gUnknown_085EF494:: @ 85EF494 - .incbin "baserom.gba", 0x5ef494, 0x30 - -gUnknown_085EF4C4:: @ 85EF4C4 - .incbin "baserom.gba", 0x5ef4c4, 0x2c - -gUnknown_085EF4F0:: @ 85EF4F0 - .incbin "baserom.gba", 0x5ef4f0, 0x30 - -gUnknown_085EF520:: @ 85EF520 - .incbin "baserom.gba", 0x5ef520, 0x3c - -gUnknown_085EF55C:: @ 85EF55C - .incbin "baserom.gba", 0x5ef55c, 0x28 - -gUnknown_085EF584:: @ 85EF584 - .incbin "baserom.gba", 0x5ef584, 0x38 - -gUnknown_085EF5BC:: @ 85EF5BC - .incbin "baserom.gba", 0x5ef5bc, 0x24 - -gUnknown_085EF5E0:: @ 85EF5E0 - .incbin "baserom.gba", 0x5ef5e0, 0x2c - -gUnknown_085EF60C:: @ 85EF60C - .incbin "baserom.gba", 0x5ef60c, 0x24 - -gUnknown_085EF630:: @ 85EF630 - .incbin "baserom.gba", 0x5ef630, 0x24 - -gUnknown_085EF654:: @ 85EF654 - .incbin "baserom.gba", 0x5ef654, 0x10 - -gUnknown_085EF664:: @ 85EF664 - .incbin "baserom.gba", 0x5ef664, 0x14 - -gUnknown_085EF678:: @ 85EF678 - .incbin "baserom.gba", 0x5ef678, 0x15 - -gUnknown_085EF68D:: @ 85EF68D - .incbin "baserom.gba", 0x5ef68d, 0x14 - -gUnknown_085EF6A1:: @ 85EF6A1 - .incbin "baserom.gba", 0x5ef6a1, 0x1c - -gUnknown_085EF6BD:: @ 85EF6BD - .incbin "baserom.gba", 0x5ef6bd, 0x15 - -gUnknown_085EF6D2:: @ 85EF6D2 - .incbin "baserom.gba", 0x5ef6d2, 0x17 - -gUnknown_085EF6E9:: @ 85EF6E9 - .incbin "baserom.gba", 0x5ef6e9, 0xf - -gUnknown_085EF6F8:: @ 85EF6F8 - .incbin "baserom.gba", 0x5ef6f8, 0x18 - -gUnknown_085EF710:: @ 85EF710 - .incbin "baserom.gba", 0x5ef710, 0x24 - -gUnknown_085EF734:: @ 85EF734 - .incbin "baserom.gba", 0x5ef734, 0x1c - -gUnknown_085EF750:: @ 85EF750 - .incbin "baserom.gba", 0x5ef750, 0x131 - -gUnknown_085EF881:: @ 85EF881 - .incbin "baserom.gba", 0x5ef881, 0x2 - -gUnknown_085EF883:: @ 85EF883 - .incbin "baserom.gba", 0x5ef883, 0x5 - -gUnknown_085EF888:: @ 85EF888 - .incbin "baserom.gba", 0x5ef888, 0x2 - -gUnknown_085EF88A:: @ 85EF88A - .incbin "baserom.gba", 0x5ef88a, 0xb - -gUnknown_085EF895:: @ 85EF895 - .incbin "baserom.gba", 0x5ef895, 0xe - -gUnknown_085EF8A3:: @ 85EF8A3 - .incbin "baserom.gba", 0x5ef8a3, 0x1f - -gUnknown_085EF8C2:: @ 85EF8C2 - .incbin "baserom.gba", 0x5ef8c2, 0x18 - -gUnknown_085EF8DA:: @ 85EF8DA - .incbin "baserom.gba", 0x5ef8da, 0xa - -gUnknown_085EF8E4:: @ 85EF8E4 - .incbin "baserom.gba", 0x5ef8e4, 0xf - -gUnknown_085EF8F3:: @ 85EF8F3 - .incbin "baserom.gba", 0x5ef8f3, 0x6d - -gUnknown_085EF960:: @ 85EF960 - .incbin "baserom.gba", 0x5ef960, 0x19 - -gUnknown_085EF979:: @ 85EF979 - .incbin "baserom.gba", 0x5ef979, 0x2d - -gUnknown_085EF9A6:: @ 85EF9A6 - .incbin "baserom.gba", 0x5ef9a6, 0x40 - -gUnknown_085EF9E6:: @ 85EF9E6 - .incbin "baserom.gba", 0x5ef9e6, 0x2a - -gUnknown_085EFA10:: @ 85EFA10 - .incbin "baserom.gba", 0x5efa10, 0x21 - -gUnknown_085EFA31:: @ 85EFA31 - .incbin "baserom.gba", 0x5efa31, 0xd - -gUnknown_085EFA3E:: @ 85EFA3E - .incbin "baserom.gba", 0x5efa3e, 0x14 - -gUnknown_085EFA52:: @ 85EFA52 - .incbin "baserom.gba", 0x5efa52, 0x4 - -gUnknown_085EFA56:: @ 85EFA56 - .incbin "baserom.gba", 0x5efa56, 0x7 - -gUnknown_085EFA5D:: @ 85EFA5D - .incbin "baserom.gba", 0x5efa5d, 0xa - -gUnknown_085EFA67:: @ 85EFA67 - .incbin "baserom.gba", 0x5efa67, 0x7 - -gUnknown_085EFA6E:: @ 85EFA6E - .incbin "baserom.gba", 0x5efa6e, 0x21 - -gUnknown_085EFA8F:: @ 85EFA8F - .incbin "baserom.gba", 0x5efa8f, 0x1b - -gUnknown_085EFAAA:: @ 85EFAAA - .incbin "baserom.gba", 0x5efaaa, 0x1c - -gUnknown_085EFAC6:: @ 85EFAC6 - .incbin "baserom.gba", 0x5efac6, 0x1a - -gUnknown_085EFAE0:: @ 85EFAE0 - .incbin "baserom.gba", 0x5efae0, 0x8 - -gUnknown_085EFAE8:: @ 85EFAE8 - .incbin "baserom.gba", 0x5efae8, 0xea - -gUnknown_085EFBD2:: @ 85EFBD2 - .incbin "baserom.gba", 0x5efbd2, 0x3a - -gUnknown_085EFC0C:: @ 85EFC0C - .incbin "baserom.gba", 0x5efc0c, 0x1b - -gUnknown_085EFC27:: @ 85EFC27 - .incbin "baserom.gba", 0x5efc27, 0xad - -gUnknown_085EFCD4:: @ 85EFCD4 - .incbin "baserom.gba", 0x5efcd4, 0xb - -gUnknown_085EFCDF:: @ 85EFCDF - .incbin "baserom.gba", 0x5efcdf, 0x6 - -gUnknown_085EFCE5:: @ 85EFCE5 - .incbin "baserom.gba", 0x5efce5, 0xb - -gUnknown_085EFCF0:: @ 85EFCF0 - .incbin "baserom.gba", 0x5efcf0, 0x10 - -gUnknown_085EFD00:: @ 85EFD00 - .incbin "baserom.gba", 0x5efd00, 0x20 - -gUnknown_085EFD20:: @ 85EFD20 - .incbin "baserom.gba", 0x5efd20, 0x8 - -gUnknown_085EFD28:: @ 85EFD28 - .incbin "baserom.gba", 0x5efd28, 0x28 - -gBerryFirmnessStringPointers:: @ 85EFD50 - .4byte gBerryFirmnessString_VerySoft - .4byte gBerryFirmnessString_Soft - .4byte gBerryFirmnessString_Hard - .4byte gBerryFirmnessString_VeryHard - .4byte gBerryFirmnessString_SuperHard - -gUnknown_085EFD64:: @ 85EFD64 - .incbin "baserom.gba", 0x5efd64, 0x4 - -gUnknown_085EFD68:: @ 85EFD68 - .incbin "baserom.gba", 0x5efd68, 0x18 - -gUnknown_085EFD80:: @ 85EFD80 - .incbin "baserom.gba", 0x5efd80, 0x8 - -gUnknown_085EFD88:: @ 85EFD88 - .incbin "baserom.gba", 0x5efd88, 0xc - -gUnknown_085EFD94:: @ 85EFD94 - .incbin "baserom.gba", 0x5efd94, 0x8 - -gUnknown_085EFD9C:: @ 85EFD9C - .incbin "baserom.gba", 0x5efd9c, 0x8 - -gUnknown_085EFDA4:: @ 85EFDA4 - .incbin "baserom.gba", 0x5efda4, 0x8 - -gUnknown_085EFDAC:: @ 85EFDAC - .incbin "baserom.gba", 0x5efdac, 0x18 - -gUnknown_085EFDC4:: @ 85EFDC4 - .incbin "baserom.gba", 0x5efdc4, 0x20 - -gUnknown_085EFDE4:: @ 85EFDE4 - .incbin "baserom.gba", 0x5efde4, 0x90 - -gUnknown_085EFE74:: @ 85EFE74 - .incbin "baserom.gba", 0x5efe74, 0x48 - -gUnknown_085EFEBC:: @ 85EFEBC - .incbin "baserom.gba", 0x5efebc, 0x32 - -gUnknown_085EFEEE:: @ 85EFEEE - .incbin "baserom.gba", 0x5efeee, 0x12 - -gUnknown_085EFF00:: @ 85EFF00 - .incbin "baserom.gba", 0x5eff00, 0x5fc - -gUnknown_085F04FC:: @ 85F04FC - .incbin "baserom.gba", 0x5f04fc, 0x54 - -gUnknown_085F0550:: @ 85F0550 - .incbin "baserom.gba", 0x5f0550, 0x8 - -gUnknown_085F0558:: @ 85F0558 - .incbin "baserom.gba", 0x5f0558, 0x10 - -gUnknown_085F0568:: @ 85F0568 - .incbin "baserom.gba", 0x5f0568, 0x48 - -gUnknown_085F05B0:: @ 85F05B0 - .incbin "baserom.gba", 0x5f05b0, 0xb4 - -gUnknown_085F0664:: @ 85F0664 - .incbin "baserom.gba", 0x5f0664, 0x4 - -gUnknown_085F0668:: @ 85F0668 - .incbin "baserom.gba", 0x5f0668, 0x4 - -gUnknown_085F066C:: @ 85F066C - .incbin "baserom.gba", 0x5f066c, 0x34 - -gUnknown_085F06A0:: @ 85F06A0 - .incbin "baserom.gba", 0x5f06a0, 0x8 - -gUnknown_085F06A8:: @ 85F06A8 - .incbin "baserom.gba", 0x5f06a8, 0x18 - -gUnknown_085F06C0:: @ 85F06C0 - .incbin "baserom.gba", 0x5f06c0, 0x8 - -gUnknown_085F06C8:: @ 85F06C8 - .incbin "baserom.gba", 0x5f06c8, 0x10 - -gUnknown_085F06D8:: @ 85F06D8 - .incbin "baserom.gba", 0x5f06d8, 0x8 - -gUnknown_085F06E0:: @ 85F06E0 - .incbin "baserom.gba", 0x5f06e0, 0x20 - -gUnknown_085F0700:: @ 85F0700 - .incbin "baserom.gba", 0x5f0700, 0x20 - -gUnknown_085F0720:: @ 85F0720 - .incbin "baserom.gba", 0x5f0720, 0x20 - -gUnknown_085F0740:: @ 85F0740 - .incbin "baserom.gba", 0x5f0740, 0x480 - -gUnknown_085F0BC0:: @ 85F0BC0 - .incbin "baserom.gba", 0x5f0bc0, 0x13c - -gUnknown_085F0CFC:: @ 85F0CFC - .incbin "baserom.gba", 0x5f0cfc, 0x60 - -gUnknown_085F0D5C:: @ 85F0D5C - .incbin "baserom.gba", 0x5f0d5c, 0x60 - -gUnknown_085F0DBC:: @ 85F0DBC - .incbin "baserom.gba", 0x5f0dbc, 0x5dc - -gUnknown_085F1398:: @ 85F1398 - .incbin "baserom.gba", 0x5f1398, 0x2d0 - -gUnknown_085F1668:: @ 85F1668 - .incbin "baserom.gba", 0x5f1668, 0x20 - -gUnknown_085F1688:: @ 85F1688 - .incbin "baserom.gba", 0x5f1688, 0x20 - -gUnknown_085F16A8:: @ 85F16A8 - .incbin "baserom.gba", 0x5f16a8, 0x13c - -gUnknown_085F17E4:: @ 85F17E4 - .incbin "baserom.gba", 0x5f17e4, 0x20 - -gUnknown_085F1804:: @ 85F1804 - .incbin "baserom.gba", 0x5f1804, 0x20 - -gUnknown_085F1824:: @ 85F1824 - .incbin "baserom.gba", 0x5f1824, 0x688 - -gUnknown_085F1EAC:: @ 85F1EAC - .incbin "baserom.gba", 0x5f1eac, 0x304 - -gUnknown_085F21B0:: @ 85F21B0 - .incbin "baserom.gba", 0x5f21b0, 0x16c - -gUnknown_085F231C:: @ 85F231C - .incbin "baserom.gba", 0x5f231c, 0x40 - -gUnknown_085F235C:: @ 85F235C - .incbin "baserom.gba", 0x5f235c, 0x1ec - -gUnknown_085F2548:: @ 85F2548 - .incbin "baserom.gba", 0x5f2548, 0x20 - -gUnknown_085F2568:: @ 85F2568 - .incbin "baserom.gba", 0x5f2568, 0x2ae4 - -gUnknown_085F504C:: @ 85F504C - .incbin "baserom.gba", 0x5f504c, 0x18 - -gUnknown_085F5064:: @ 85F5064 - .incbin "baserom.gba", 0x5f5064, 0x30 - -gUnknown_085F5094:: @ 85F5094 - .incbin "baserom.gba", 0x5f5094, 0x10 - -gUnknown_085F50A4:: @ 85F50A4 - .incbin "baserom.gba", 0x5f50a4, 0x48 - -gUnknown_085F50EC:: @ 85F50EC - .incbin "baserom.gba", 0x5f50ec, 0x28 - -gUnknown_085F5114:: @ 85F5114 - .incbin "baserom.gba", 0x5f5114, 0xc - -gUnknown_085F5120:: @ 85F5120 - .incbin "baserom.gba", 0x5f5120, 0x60 - -gUnknown_085F5180:: @ 85F5180 - .incbin "baserom.gba", 0x5f5180, 0x18 - -gUnknown_085F5198:: @ 85F5198 - .incbin "baserom.gba", 0x5f5198, 0x4 - -gUnknown_085F519C:: @ 85F519C - .incbin "baserom.gba", 0x5f519c, 0x50 - -gUnknown_085F51EC:: @ 85F51EC - .incbin "baserom.gba", 0x5f51ec, 0x18 - -gUnknown_085F5204:: @ 85F5204 - .incbin "baserom.gba", 0x5f5204, 0x38 - -gUnknown_085F523C:: @ 85F523C - .incbin "baserom.gba", 0x5f523c, 0x18 - -gUnknown_085F5254:: @ 85F5254 - .incbin "baserom.gba", 0x5f5254, 0x38 - -gUnknown_085F528C:: @ 85F528C - .incbin "baserom.gba", 0x5f528c, 0x18 - -gUnknown_085F52A4:: @ 85F52A4 - .incbin "baserom.gba", 0x5f52a4, 0x18 - -gUnknown_085F52BC:: @ 85F52BC - .incbin "baserom.gba", 0x5f52bc, 0x10 - -gUnknown_085F52CC:: @ 85F52CC - .incbin "baserom.gba", 0x5f52cc, 0x10 - -gUnknown_085F52DC:: @ 85F52DC - .incbin "baserom.gba", 0x5f52dc, 0x20 - -gUnknown_085F52FC:: @ 85F52FC - .incbin "baserom.gba", 0x5f52fc, 0x10 - -gUnknown_085F530C:: @ 85F530C - .incbin "baserom.gba", 0x5f530c, 0x28 - -gUnknown_085F5334:: @ 85F5334 - .incbin "baserom.gba", 0x5f5334, 0x10 - -gUnknown_085F5344:: @ 85F5344 - .incbin "baserom.gba", 0x5f5344, 0x10 - -gUnknown_085F5354:: @ 85F5354 - .incbin "baserom.gba", 0x5f5354, 0x30 - -gUnknown_085F5384:: @ 85F5384 - .incbin "baserom.gba", 0x5f5384, 0x28 - -gUnknown_085F53AC:: @ 85F53AC - .incbin "baserom.gba", 0x5f53ac, 0x10 - -gUnknown_085F53BC:: @ 85F53BC - .incbin "baserom.gba", 0x5f53bc, 0x50 - -gUnknown_085F540C:: @ 85F540C - .incbin "baserom.gba", 0x5f540c, 0x10 - -gUnknown_085F541C:: @ 85F541C - .incbin "baserom.gba", 0x5f541c, 0x24 - -gUnknown_085F5440:: @ 85F5440 - .incbin "baserom.gba", 0x5f5440, 0x18 - -gUnknown_085F5458:: @ 85F5458 - .incbin "baserom.gba", 0x5f5458, 0x38 - -gUnknown_085F5490:: @ 85F5490 - .incbin "baserom.gba", 0x5f5490, 0x4 - -gUnknown_085F5494:: @ 85F5494 - .incbin "baserom.gba", 0x5f5494, 0x4d40 - -gUnknown_085FA1D4:: @ 85FA1D4 - .incbin "baserom.gba", 0x5fa1d4, 0x4 - -gUnknown_085FA1D8:: @ 85FA1D8 - .incbin "baserom.gba", 0x5fa1d8, 0xff90 - -gUnknown_0860A168:: @ 860A168 - .incbin "baserom.gba", 0x60a168, 0x1b8 - -gUnknown_0860A320:: @ 860A320 - .incbin "baserom.gba", 0x60a320, 0x8c - -gUnknown_0860A3AC:: @ 860A3AC - .incbin "baserom.gba", 0x60a3ac, 0x30 - -gUnknown_0860A3DC:: @ 860A3DC - .incbin "baserom.gba", 0x60a3dc, 0xd0 - -gUnknown_0860A4AC:: @ 860A4AC - .incbin "baserom.gba", 0x60a4ac, 0x388 - -gUnknown_0860A834:: @ 860A834 - .incbin "baserom.gba", 0x60a834, 0x70 - -gUnknown_0860A8A4:: @ 860A8A4 - .incbin "baserom.gba", 0x60a8a4, 0x24 - -gUnknown_0860A8C8:: @ 860A8C8 - .incbin "baserom.gba", 0x60a8c8, 0x19c - -gUnknown_0860AA64:: @ 860AA64 - .incbin "baserom.gba", 0x60aa64, 0x1c - -gUnknown_0860AA80:: @ 860AA80 - .incbin "baserom.gba", 0x60aa80, 0x8 - -gUnknown_0860AA88:: @ 860AA88 - .incbin "baserom.gba", 0x60aa88, 0x25c - -gUnknown_0860ACE4:: @ 860ACE4 - .incbin "baserom.gba", 0x60ace4, 0x4b - -gUnknown_0860AD2F:: @ 860AD2F - .incbin "baserom.gba", 0x60ad2f, 0x39 - -gUnknown_0860AD68:: @ 860AD68 - .incbin "baserom.gba", 0x60ad68, 0x8 - -gUnknown_0860AD70:: @ 860AD70 - .incbin "baserom.gba", 0x60ad70, 0x1e - -gUnknown_0860AD8E:: @ 860AD8E - .incbin "baserom.gba", 0x60ad8e, 0x30 - -gUnknown_0860ADBE:: @ 860ADBE - .incbin "baserom.gba", 0x60adbe, 0xbe - -gUnknown_0860AE7C:: @ 860AE7C - .incbin "baserom.gba", 0x60ae7c, 0xc - -gUnknown_0860AE88:: @ 860AE88 - .incbin "baserom.gba", 0x60ae88, 0x8 - -gUnknown_0860AE90:: @ 860AE90 - .incbin "baserom.gba", 0x60ae90, 0xe4 - -gUnknown_0860AF74:: @ 860AF74 - .incbin "baserom.gba", 0x60af74, 0xe4 - -gUnknown_0860B058:: @ 860B058 - .incbin "baserom.gba", 0x60b058, 0xc - -gUnknown_0860B064:: @ 860B064 - .incbin "baserom.gba", 0x60b064, 0x8 - -gUnknown_0860B06C:: @ 860B06C - .incbin "baserom.gba", 0x60b06c, 0x8 - -gUnknown_0860B074:: @ 860B074 - .incbin "baserom.gba", 0x60b074, 0xa - -gUnknown_0860B07E:: @ 860B07E - .incbin "baserom.gba", 0x60b07e, 0x126 - -gUnknown_0860B1A4:: @ 860B1A4 - .incbin "baserom.gba", 0x60b1a4, 0x40 - -gUnknown_0860B1E4:: @ 860B1E4 - .incbin "baserom.gba", 0x60b1e4, 0x20 - -gUnknown_0860B204:: @ 860B204 - .incbin "baserom.gba", 0x60b204, 0x20 - -gUnknown_0860B224:: @ 860B224 - .incbin "baserom.gba", 0x60b224, 0xc8 - -gUnknown_0860B2EC:: @ 860B2EC - .incbin "baserom.gba", 0x60b2ec, 0x18 - -gUnknown_0860B304:: @ 860B304 - .incbin "baserom.gba", 0x60b304, 0xc - -gUnknown_0860B310:: @ 860B310 - .incbin "baserom.gba", 0x60b310, 0x14 - -gUnknown_0860B324:: @ 860B324 - .incbin "baserom.gba", 0x60b324, 0x14 - -gUnknown_0860B338:: @ 860B338 - .incbin "baserom.gba", 0x60b338, 0x14 - -gUnknown_0860B34C:: @ 860B34C - .incbin "baserom.gba", 0x60b34c, 0xc - -gUnknown_0860B358:: @ 860B358 - .incbin "baserom.gba", 0x60b358, 0x1630 - -gUnknown_0860C988:: @ 860C988 - .incbin "baserom.gba", 0x60c988, 0x269 - -gUnknown_0860CBF1:: @ 860CBF1 - .incbin "baserom.gba", 0x60cbf1, 0x283 - -gUnknown_0860CE74:: @ 860CE74 - .incbin "baserom.gba", 0x60ce74, 0x10 - -gUnknown_0860CE84:: @ 860CE84 - .incbin "baserom.gba", 0x60ce84, 0x10 - -gUnknown_0860CE94:: @ 860CE94 - .incbin "baserom.gba", 0x60ce94, 0x20 - -gUnknown_0860CEB4:: @ 860CEB4 - .incbin "baserom.gba", 0x60ceb4, 0x90 - -gUnknown_0860CF44:: @ 860CF44 - .incbin "baserom.gba", 0x60cf44, 0xc - -gUnknown_0860CF50:: @ 860CF50 - .incbin "baserom.gba", 0x60cf50, 0x58 - -gUnknown_0860CFA8:: @ 860CFA8 - .incbin "baserom.gba", 0x60cfa8, 0x30 - -gUnknown_0860CFD8:: @ 860CFD8 - .incbin "baserom.gba", 0x60cfd8, 0x30 - -gUnknown_0860D008:: @ 860D008 - .incbin "baserom.gba", 0x60d008, 0x48 - -gUnknown_0860D050:: @ 860D050 - .incbin "baserom.gba", 0x60d050, 0x18 - -gUnknown_0860D068:: @ 860D068 - .incbin "baserom.gba", 0x60d068, 0x18 - -gUnknown_0860D080:: @ 860D080 - .incbin "baserom.gba", 0x60d080, 0x10 - -gUnknown_0860D090:: @ 860D090 - .incbin "baserom.gba", 0x60d090, 0x5c - -gUnknown_0860D0EC:: @ 860D0EC - .incbin "baserom.gba", 0x60d0ec, 0x10 - -gUnknown_0860D0FC:: @ 860D0FC - .incbin "baserom.gba", 0x60d0fc, 0x10 - -gUnknown_0860D10C:: @ 860D10C - .incbin "baserom.gba", 0x60d10c, 0x40 - -gUnknown_0860D14C:: @ 860D14C - .incbin "baserom.gba", 0x60d14c, 0x10 - -gUnknown_0860D15C:: @ 860D15C - .incbin "baserom.gba", 0x60d15c, 0x40 - -gUnknown_0860D19C:: @ 860D19C - .incbin "baserom.gba", 0x60d19c, 0x4 - -gUnknown_0860D1A0:: @ 860D1A0 - .incbin "baserom.gba", 0x60d1a0, 0x20 - -gUnknown_0860D1C0:: @ 860D1C0 - .incbin "baserom.gba", 0x60d1c0, 0x10 - -gUnknown_0860D1D0:: @ 860D1D0 - .incbin "baserom.gba", 0x60d1d0, 0x44 - -gUnknown_0860D214:: @ 860D214 - .incbin "baserom.gba", 0x60d214, 0x80 - -gUnknown_0860D294:: @ 860D294 - .incbin "baserom.gba", 0x60d294, 0xac - -gUnknown_0860D340:: @ 860D340 - .incbin "baserom.gba", 0x60d340, 0x3 - -gUnknown_0860D343:: @ 860D343 - .incbin "baserom.gba", 0x60d343, 0x3 - -gUnknown_0860D346:: @ 860D346 - .incbin "baserom.gba", 0x60d346, 0x3 - -gUnknown_0860D349:: @ 860D349 - .incbin "baserom.gba", 0x60d349, 0x7 - -gUnknown_0860D350:: @ 860D350 - .incbin "baserom.gba", 0x60d350, 0x3c - -gUnknown_0860D38C:: @ 860D38C - .incbin "baserom.gba", 0x60d38c, 0x1c - -gUnknown_0860D3A8:: @ 860D3A8 - .incbin "baserom.gba", 0x60d3a8, 0x3 - -gUnknown_0860D3AB:: @ 860D3AB - .incbin "baserom.gba", 0x60d3ab, 0x3 - -gUnknown_0860D3AE:: @ 860D3AE - .incbin "baserom.gba", 0x60d3ae, 0x3 - -gUnknown_0860D3B1:: @ 860D3B1 - .incbin "baserom.gba", 0x60d3b1, 0x3 - -gUnknown_0860D3B4:: @ 860D3B4 - .incbin "baserom.gba", 0x60d3b4, 0x10 - -gUnknown_0860D3C4:: @ 860D3C4 - .incbin "baserom.gba", 0x60d3c4, 0x2 - -gUnknown_0860D3C6:: @ 860D3C6 - .incbin "baserom.gba", 0x60d3c6, 0x2b - -gUnknown_0860D3F1:: @ 860D3F1 - .incbin "baserom.gba", 0x60d3f1, 0x1 - -gUnknown_0860D3F2:: @ 860D3F2 - .incbin "baserom.gba", 0x60d3f2, 0x1f - -gUnknown_0860D411:: @ 860D411 - .incbin "baserom.gba", 0x60d411, 0x8ff - -gUnknown_0860DD10:: @ 860DD10 - .incbin "baserom.gba", 0x60dd10, 0x100 - -gUnknown_0860DE10:: @ 860DE10 - .incbin "baserom.gba", 0x60de10, 0x40 - -gUnknown_0860DE50:: @ 860DE50 - .incbin "baserom.gba", 0x60de50, 0x28 - -gUnknown_0860DE78:: @ 860DE78 - .incbin "baserom.gba", 0x60de78, 0xc - -gUnknown_0860DE84:: @ 860DE84 - .incbin "baserom.gba", 0x60de84, 0x14 - -gUnknown_0860DE98:: @ 860DE98 - .incbin "baserom.gba", 0x60de98, 0x10 - -gUnknown_0860DEA8:: @ 860DEA8 - .incbin "baserom.gba", 0x60dea8, 0x10 - -gUnknown_0860DEB8:: @ 860DEB8 - .incbin "baserom.gba", 0x60deb8, 0xb68 - -gUnknown_0860EA20:: @ 860EA20 - .incbin "baserom.gba", 0x60ea20, 0xc - -gUnknown_0860EA2C:: @ 860EA2C - .incbin "baserom.gba", 0x60ea2c, 0x8 - -gUnknown_0860EA34:: @ 860EA34 - .incbin "baserom.gba", 0x60ea34, 0x18 - -gUnknown_0860EA4C:: @ 860EA4C - .incbin "baserom.gba", 0x60ea4c, 0x20 - -gUnknown_0860EA6C:: @ 860EA6C - .incbin "baserom.gba", 0x60ea6c, 0x100 - -gUnknown_0860EB6C:: @ 860EB6C - .incbin "baserom.gba", 0x60eb6c, 0x20 - -gUnknown_0860EB8C:: @ 860EB8C - .incbin "baserom.gba", 0x60eb8c, 0x3e4 - -gUnknown_0860EF70:: @ 860EF70 - .incbin "baserom.gba", 0x60ef70, 0x8 - -gUnknown_0860EF78:: @ 860EF78 - .incbin "baserom.gba", 0x60ef78, 0x20 - -gUnknown_0860EF98:: @ 860EF98 - .incbin "baserom.gba", 0x60ef98, 0x8 - -gUnknown_0860EFA0:: @ 860EFA0 - .incbin "baserom.gba", 0x60efa0, 0xc - -gUnknown_0860EFAC:: @ 860EFAC - .incbin "baserom.gba", 0x60efac, 0x18 - -gUnknown_0860EFC4:: @ 860EFC4 - .incbin "baserom.gba", 0x60efc4, 0x30 - -gUnknown_0860EFF4:: @ 860EFF4 - .incbin "baserom.gba", 0x60eff4, 0x1c - -gUnknown_0860F010:: @ 860F010 - .incbin "baserom.gba", 0x60f010, 0x10 - -gUnknown_0860F020:: @ 860F020 - .incbin "baserom.gba", 0x60f020, 0x54 - -gUnknown_0860F074:: @ 860F074 - .incbin "baserom.gba", 0x60f074, 0x20 - -gUnknown_0860F094:: @ 860F094 - .incbin "baserom.gba", 0x60f094, 0x4 - -gUnknown_0860F098:: @ 860F098 - .incbin "baserom.gba", 0x60f098, 0x10 - -gUnknown_0860F0A8:: @ 860F0A8 - .incbin "baserom.gba", 0x60f0a8, 0x8 - -gUnknown_0860F0B0:: @ 860F0B0 - .incbin "baserom.gba", 0x60f0b0, 0x20 - -gUnknown_0860F0D0:: @ 860F0D0 - .incbin "baserom.gba", 0x60f0d0, 0x4 - -gUnknown_0860F0D4:: @ 860F0D4 - .incbin "baserom.gba", 0x60f0d4, 0x68 - -gUnknown_0860F13C:: @ 860F13C - .incbin "baserom.gba", 0x60f13c, 0x1100 - -gUnknown_0861023C:: @ 861023C - .incbin "baserom.gba", 0x61023c, 0x100 - -gUnknown_0861033C:: @ 861033C - .incbin "baserom.gba", 0x61033c, 0x60 - -gUnknown_0861039C:: @ 861039C - .incbin "baserom.gba", 0x61039c, 0x20 - -gUnknown_086103BC:: @ 86103BC - .incbin "baserom.gba", 0x6103bc, 0x28 - -gUnknown_086103E4:: @ 86103E4 - .incbin "baserom.gba", 0x6103e4, 0x10 - -gUnknown_086103F4:: @ 86103F4 - .incbin "baserom.gba", 0x6103f4, 0x28 - -gUnknown_0861041C:: @ 861041C - .incbin "baserom.gba", 0x61041c, 0xc - -gUnknown_08610428:: @ 8610428 - .incbin "baserom.gba", 0x610428, 0xc - -gUnknown_08610434:: @ 8610434 - .incbin "baserom.gba", 0x610434, 0x38 - -gUnknown_0861046C:: @ 861046C - .incbin "baserom.gba", 0x61046c, 0xa - -gUnknown_08610476:: @ 8610476 - .incbin "baserom.gba", 0x610476, 0x3 - -gUnknown_08610479:: @ 8610479 - .incbin "baserom.gba", 0x610479, 0x15f - -gUnknown_086105D8:: @ 86105D8 - .incbin "baserom.gba", 0x6105d8, 0x18 - -gUnknown_086105F0:: @ 86105F0 - .incbin "baserom.gba", 0x6105f0, 0x18 - -gUnknown_08610608:: @ 8610608 - .incbin "baserom.gba", 0x610608, 0x18 - -gUnknown_08610620:: @ 8610620 - .incbin "baserom.gba", 0x610620, 0x18 - -gUnknown_08610638:: @ 8610638 - .incbin "baserom.gba", 0x610638, 0x18 - -gUnknown_08610650:: @ 8610650 - .incbin "baserom.gba", 0x610650, 0x50 - -gUnknown_086106A0:: @ 86106A0 - .incbin "baserom.gba", 0x6106a0, 0x10 - -gUnknown_086106B0:: @ 86106B0 - .incbin "baserom.gba", 0x6106b0, 0x184 - -gUnknown_08610834:: @ 8610834 - .incbin "baserom.gba", 0x610834, 0x18 - -gUnknown_0861084C:: @ 861084C - .incbin "baserom.gba", 0x61084c, 0x18 - -gUnknown_08610864:: @ 8610864 - .incbin "baserom.gba", 0x610864, 0x18 - -gUnknown_0861087C:: @ 861087C - .incbin "baserom.gba", 0x61087c, 0x18 - -gUnknown_08610894:: @ 8610894 - .incbin "baserom.gba", 0x610894, 0x18 - -gUnknown_086108AC:: @ 86108AC - .incbin "baserom.gba", 0x6108ac, 0xc - -gUnknown_086108B8:: @ 86108B8 - .incbin "baserom.gba", 0x6108b8, 0x10 - -gUnknown_086108C8:: @ 86108C8 - .incbin "baserom.gba", 0x6108c8, 0x50 - -gUnknown_08610918:: @ 8610918 - .incbin "baserom.gba", 0x610918, 0xa - -gUnknown_08610922:: @ 8610922 - .incbin "baserom.gba", 0x610922, 0x3 - -gUnknown_08610925:: @ 8610925 - .incbin "baserom.gba", 0x610925, 0x3 - -gUnknown_08610928:: @ 8610928 - .incbin "baserom.gba", 0x610928, 0x20 - -gUnknown_08610948:: @ 8610948 - .incbin "baserom.gba", 0x610948, 0x28 - -gUnknown_08610970:: @ 8610970 - .incbin "baserom.gba", 0x610970, 0x34 - -gUnknown_086109A4:: @ 86109A4 - .incbin "baserom.gba", 0x6109a4, 0x16 - -gUnknown_086109BA:: @ 86109BA - .incbin "baserom.gba", 0x6109ba, 0x536 - -gUnknown_08610EF0:: @ 8610EF0 - .incbin "baserom.gba", 0x610ef0, 0x100 - -gUnknown_08610FF0:: @ 8610FF0 - .incbin "baserom.gba", 0x610ff0, 0x80 - -gUnknown_08611070:: @ 8611070 - .incbin "baserom.gba", 0x611070, 0x140 - -gUnknown_086111B0:: @ 86111B0 - .incbin "baserom.gba", 0x6111b0, 0x80 - -gUnknown_08611230:: @ 8611230 - .incbin "baserom.gba", 0x611230, 0x80 - -gUnknown_086112B0:: @ 86112B0 - .incbin "baserom.gba", 0x6112b0, 0x80 - -gUnknown_08611330:: @ 8611330 - .incbin "baserom.gba", 0x611330, 0x40 - -gUnknown_08611370:: @ 8611370 - .incbin "baserom.gba", 0x611370, 0x163 - -gUnknown_086114D3:: @ 86114D3 - .incbin "baserom.gba", 0x6114d3, 0xd - -gUnknown_086114E0:: @ 86114E0 - .incbin "baserom.gba", 0x6114e0, 0x68 - -gUnknown_08611548:: @ 8611548 - .incbin "baserom.gba", 0x611548, 0x8 - -gUnknown_08611550:: @ 8611550 - .incbin "baserom.gba", 0x611550, 0x1c - -gUnknown_0861156C:: @ 861156C - .incbin "baserom.gba", 0x61156c, 0xc - -gUnknown_08611578:: @ 8611578 - .incbin "baserom.gba", 0x611578, 0x33c - -gUnknown_086118B4:: @ 86118B4 - .incbin "baserom.gba", 0x6118b4, 0x348 - -gUnknown_08611BFC:: @ 8611BFC - .incbin "baserom.gba", 0x611bfc, 0x1c - -gUnknown_08611C18:: @ 8611C18 - .incbin "baserom.gba", 0x611c18, 0x5c - -gUnknown_08611C74:: @ 8611C74 - .incbin "baserom.gba", 0x611c74, 0x8 - -gUnknown_08611C7C:: @ 8611C7C - .incbin "baserom.gba", 0x611c7c, 0x8 - -gUnknown_08611C84:: @ 8611C84 - .incbin "baserom.gba", 0x611c84, 0x8 - -gUnknown_08611C8C:: @ 8611C8C - .incbin "baserom.gba", 0x611c8c, 0xe - -gUnknown_08611C9A:: @ 8611C9A - .incbin "baserom.gba", 0x611c9a, 0x16 - -gUnknown_08611CB0:: @ 8611CB0 - .incbin "baserom.gba", 0x611cb0, 0x50 - -gUnknown_08611D00:: @ 8611D00 - .incbin "baserom.gba", 0x611d00, 0x8 - -gUnknown_08611D08:: @ 8611D08 - .incbin "baserom.gba", 0x611d08, 0x28 - -gUnknown_08611D30:: @ 8611D30 - .incbin "baserom.gba", 0x611d30, 0x80 - -gUnknown_08611DB0:: @ 8611DB0 - .incbin "baserom.gba", 0x611db0, 0x8 - -gUnknown_08611DB8:: @ 8611DB8 - .incbin "baserom.gba", 0x611db8, 0x8 - -@ 8611DC0 - .include "data/battle_frontier/battle_arena_move_mind_ratings.inc" - - .align 2 -@ 8611F24 - .incbin "baserom.gba", 0x611f24, 0x38 - -gUnknown_08611F5C:: @ 8611F5C - .incbin "baserom.gba", 0x611f5c, 0x18 - -gUnknown_08611F74:: @ 8611F74 - .incbin "baserom.gba", 0x611f74, 0x10 - -gUnknown_08611F84:: @ 8611F84 - .incbin "baserom.gba", 0x611f84, 0x1c - -gUnknown_08611FA0:: @ 8611FA0 - .incbin "baserom.gba", 0x611fa0, 0xc - -gUnknown_08611FAC:: @ 8611FAC - .incbin "baserom.gba", 0x611fac, 0x14 - -@ 8611FC0 - .include "data/battle_frontier/battle_factory_style_move_lists.inc" - -gUnknown_08612120:: @ 8612120 - .incbin "baserom.gba", 0x612120, 0x44 - -gUnknown_08612164:: @ 8612164 - .incbin "baserom.gba", 0x612164, 0x10 - -gUnknown_08612174:: @ 8612174 - .incbin "baserom.gba", 0x612174, 0x10 - -gUnknown_08612184:: @ 8612184 - .incbin "baserom.gba", 0x612184, 0x10 - -gUnknown_08612194:: @ 8612194 - .incbin "baserom.gba", 0x612194, 0x180 - -gUnknown_08612314:: @ 8612314 - .incbin "baserom.gba", 0x612314, 0x8 - -gUnknown_0861231C:: @ 861231C - .incbin "baserom.gba", 0x61231c, 0xc8 - -gUnknown_086123E4:: @ 86123E4 - .incbin "baserom.gba", 0x6123e4, 0x1f8 - -gUnknown_086125DC:: @ 86125DC - .incbin "baserom.gba", 0x6125dc, 0x1c - -gUnknown_086125F8:: @ 86125F8 - .incbin "baserom.gba", 0x6125f8, 0x74 - -gUnknown_0861266C:: @ 861266C - .incbin "baserom.gba", 0x61266c, 0x9 - -gUnknown_08612675:: @ 8612675 - .incbin "baserom.gba", 0x612675, 0x13 - -gUnknown_08612688:: @ 8612688 - .incbin "baserom.gba", 0x612688, 0x8 - -gUnknown_08612690:: @ 8612690 - .incbin "baserom.gba", 0x612690, 0x8 - -gUnknown_08612698:: @ 8612698 - .incbin "baserom.gba", 0x612698, 0x4 - -gUnknown_0861269C:: @ 861269C - .incbin "baserom.gba", 0x61269c, 0x4 - -gUnknown_086126A0:: @ 86126A0 - .incbin "baserom.gba", 0x6126a0, 0x4 - -gUnknown_086126A4:: @ 86126A4 - .incbin "baserom.gba", 0x6126a4, 0x4 - -gUnknown_086126A8:: @ 86126A8 - .incbin "baserom.gba", 0x6126a8, 0x2 - -gUnknown_086126AA:: @ 86126AA - .incbin "baserom.gba", 0x6126aa, 0x2 - -gUnknown_086126AC:: @ 86126AC - .incbin "baserom.gba", 0x6126ac, 0x2 - -gUnknown_086126AE:: @ 86126AE - .incbin "baserom.gba", 0x6126ae, 0x2 - -@ 86126B0 - .include "data/battle_frontier/battle_pyramid_level_50_wild_mons.inc" - -@ 8612E80 - .include "data/battle_frontier/battle_pyramid_open_level_wild_mons.inc" - -gUnknown_08613650:: @ 8613650 - .incbin "baserom.gba", 0x613650, 0x5 - -gUnknown_08613655:: @ 8613655 - .incbin "baserom.gba", 0x613655, 0xfb - -gUnknown_08613750:: @ 8613750 - .incbin "baserom.gba", 0x613750, 0x44 - -gUnknown_08613794:: @ 8613794 - .incbin "baserom.gba", 0x613794, 0x8 - -gUnknown_0861379C:: @ 861379C - .incbin "baserom.gba", 0x61379c, 0x190 - -gUnknown_0861392C:: @ 861392C - .incbin "baserom.gba", 0x61392c, 0x190 - -gUnknown_08613ABC:: @ 8613ABC - .incbin "baserom.gba", 0x613abc, 0x7e - -gUnknown_08613B3A:: @ 8613B3A - .incbin "baserom.gba", 0x613b3a, 0xa - -gUnknown_08613B44:: @ 8613B44 - .incbin "baserom.gba", 0x613b44, 0xd8 - -gUnknown_08613C1C:: @ 8613C1C - .incbin "baserom.gba", 0x613c1c, 0x2a4 - -gUnknown_08613EC0:: @ 8613EC0 - .incbin "baserom.gba", 0x613ec0, 0x18 - -gUnknown_08613ED8:: @ 8613ED8 - .incbin "baserom.gba", 0x613ed8, 0x8 - -gUnknown_08613EE0:: @ 8613EE0 - .incbin "baserom.gba", 0x613ee0, 0x48 - -gUnknown_08613F28:: @ 8613F28 - .incbin "baserom.gba", 0x613f28, 0xc - -gUnknown_08613F34:: @ 8613F34 - .incbin "baserom.gba", 0x613f34, 0x12 - -gUnknown_08613F46:: @ 8613F46 - .incbin "baserom.gba", 0x613f46, 0x40 - -gUnknown_08613F86:: @ 8613F86 - .incbin "baserom.gba", 0x613f86, 0xa - -gUnknown_08613F90:: @ 8613F90 - .incbin "baserom.gba", 0x613f90, 0xc - -gUnknown_08613F9C:: @ 8613F9C - .incbin "baserom.gba", 0x613f9c, 0x18 - -gUnknown_08613FB4:: @ 8613FB4 - .incbin "baserom.gba", 0x613fb4, 0x78 - -gUnknown_0861402C:: @ 861402C - .incbin "baserom.gba", 0x61402c, 0x4 - -gUnknown_08614030:: @ 8614030 - .incbin "baserom.gba", 0x614030, 0x4 - -gUnknown_08614034:: @ 8614034 - .incbin "baserom.gba", 0x614034, 0x4 - -gUnknown_08614038:: @ 8614038 - .incbin "baserom.gba", 0x614038, 0x4 - -gUnknown_0861403C:: @ 861403C - .incbin "baserom.gba", 0x61403c, 0x6 - -gUnknown_08614042:: @ 8614042 - .incbin "baserom.gba", 0x614042, 0x2 - -gUnknown_08614044:: @ 8614044 - .incbin "baserom.gba", 0x614044, 0x2 - -gUnknown_08614046:: @ 8614046 - .incbin "baserom.gba", 0x614046, 0x1 - -gUnknown_08614047:: @ 8614047 - .incbin "baserom.gba", 0x614047, 0x4 - -gUnknown_0861404B:: @ 861404B - .incbin "baserom.gba", 0x61404b, 0x2 - -gUnknown_0861404D:: @ 861404D - .incbin "baserom.gba", 0x61404d, 0x2 - -gUnknown_0861404F:: @ 861404F - .incbin "baserom.gba", 0x61404f, 0x5 - -gUnknown_08614054:: @ 8614054 - .incbin "baserom.gba", 0x614054, 0x30 - -gUnknown_08614084:: @ 8614084 - .incbin "baserom.gba", 0x614084, 0x8 - -gUnknown_0861408C:: @ 861408C - .incbin "baserom.gba", 0x61408c, 0x8 - -gUnknown_08614094:: @ 8614094 - .incbin "baserom.gba", 0x614094, 0x10 - -gUnknown_086140A4:: @ 86140A4 - .incbin "baserom.gba", 0x6140a4, 0xc0 - -gUnknown_08614164:: @ 8614164 - .incbin "baserom.gba", 0x614164, 0x10 - -gUnknown_08614174:: @ 8614174 - .incbin "baserom.gba", 0x614174, 0x38 - -gUnknown_086141AC:: @ 86141AC - .incbin "baserom.gba", 0x6141ac, 0x50 - -gUnknown_086141FC:: @ 86141FC - .incbin "baserom.gba", 0x6141fc, 0x48 - -gUnknown_08614244:: @ 8614244 - .incbin "baserom.gba", 0x614244, 0x18 - -gUnknown_0861425C:: @ 861425C - .incbin "baserom.gba", 0x61425c, 0x4 - -gUnknown_08614260:: @ 8614260 - .incbin "baserom.gba", 0x614260, 0x4 - -gUnknown_08614264:: @ 8614264 - .incbin "baserom.gba", 0x614264, 0x4 - -gUnknown_08614268:: @ 8614268 - .incbin "baserom.gba", 0x614268, 0x4 - -gUnknown_0861426C:: @ 861426C - .incbin "baserom.gba", 0x61426c, 0x4 - -gUnknown_08614270:: @ 8614270 - .incbin "baserom.gba", 0x614270, 0x4 - -gUnknown_08614274:: @ 8614274 - .incbin "baserom.gba", 0x614274, 0x4 - -gUnknown_08614278:: @ 8614278 - .incbin "baserom.gba", 0x614278, 0x18 - -gUnknown_08614290:: @ 8614290 - .incbin "baserom.gba", 0x614290, 0x18 - -gUnknown_086142A8:: @ 86142A8 - .incbin "baserom.gba", 0x6142a8, 0x20 - -gUnknown_086142C8:: @ 86142C8 - .incbin "baserom.gba", 0x6142c8, 0x70 - -gUnknown_08614338:: @ 8614338 - .incbin "baserom.gba", 0x614338, 0x40 - -gUnknown_08614378:: @ 8614378 - .incbin "baserom.gba", 0x614378, 0x44 - -gUnknown_086143BC:: @ 86143BC - .incbin "baserom.gba", 0x6143bc, 0x4e - -gUnknown_0861440A:: @ 861440A - .incbin "baserom.gba", 0x61440a, 0x4 - -gUnknown_0861440E:: @ 861440E - .incbin "baserom.gba", 0x61440e, 0x2 - -@ 8614410 - .include "data/graphics/items/item_icon_table.inc" - -@ 8614FE0 - .incbin "baserom.gba", 0x614fe0, 0x14 - -gUnknown_08614FF4:: @ 8614FF4 - .incbin "baserom.gba", 0x614ff4, 0x18 - -gUnknown_0861500C:: @ 861500C - .incbin "baserom.gba", 0x61500c, 0x3c - -gUnknown_08615048:: @ 8615048 - .incbin "baserom.gba", 0x615048, 0x670 - -gUnknown_086156B8:: @ 86156B8 - .incbin "baserom.gba", 0x6156b8, 0x2c - -gUnknown_086156E4:: @ 86156E4 - .incbin "baserom.gba", 0x6156e4, 0x20 - -gUnknown_08615704:: @ 8615704 - .incbin "baserom.gba", 0x615704, 0xc0 - -gUnknown_086157C4:: @ 86157C4 - .incbin "baserom.gba", 0x6157c4, 0x1c - -gUnknown_086157E0:: @ 86157E0 - .incbin "baserom.gba", 0x6157e0, 0x1c - -gUnknown_086157FC:: @ 86157FC - .incbin "baserom.gba", 0x6157fc, 0x14 - -gUnknown_08615810:: @ 8615810 - .incbin "baserom.gba", 0x615810, 0x40 - -gUnknown_08615850:: @ 8615850 - .incbin "baserom.gba", 0x615850, 0x40 - -gUnknown_08615890:: @ 8615890 - .incbin "baserom.gba", 0x615890, 0x40 - -gUnknown_086158D0:: @ 86158D0 - .incbin "baserom.gba", 0x6158d0, 0x38 - -gUnknown_08615908:: @ 8615908 - .incbin "baserom.gba", 0x615908, 0x8 - -gUnknown_08615910:: @ 8615910 - .incbin "baserom.gba", 0x615910, 0x8 - -gUnknown_08615918:: @ 8615918 - .incbin "baserom.gba", 0x615918, 0x8 - -gUnknown_08615920:: @ 8615920 - .incbin "baserom.gba", 0x615920, 0x8 - -gUnknown_08615928:: @ 8615928 - .incbin "baserom.gba", 0x615928, 0x8 - -gUnknown_08615930:: @ 8615930 - .incbin "baserom.gba", 0x615930, 0x8 - -gUnknown_08615938:: @ 8615938 - .incbin "baserom.gba", 0x615938, 0x8 - -gUnknown_08615940:: @ 8615940 - .incbin "baserom.gba", 0x615940, 0x8 - -gUnknown_08615948:: @ 8615948 - .incbin "baserom.gba", 0x615948, 0x8 - -gUnknown_08615950:: @ 8615950 - .incbin "baserom.gba", 0x615950, 0x8 - -gUnknown_08615958:: @ 8615958 - .incbin "baserom.gba", 0x615958, 0x8 - -gUnknown_08615960:: @ 8615960 - .incbin "baserom.gba", 0x615960, 0x8 - -gUnknown_08615968:: @ 8615968 - .incbin "baserom.gba", 0x615968, 0x8 - -gUnknown_08615970:: @ 8615970 - .incbin "baserom.gba", 0x615970, 0x18 - -gUnknown_08615988:: @ 8615988 - .incbin "baserom.gba", 0x615988, 0x46 - -gUnknown_086159CE:: @ 86159CE - .incbin "baserom.gba", 0x6159ce, 0x46 - -gUnknown_08615A14:: @ 8615A14 - .incbin "baserom.gba", 0x615a14, 0x36 - -gUnknown_08615A4A:: @ 8615A4A - .incbin "baserom.gba", 0x615a4a, 0x36 - -gUnknown_08615A80:: @ 8615A80 - .incbin "baserom.gba", 0x615a80, 0x36 - -gUnknown_08615AB6:: @ 8615AB6 - .incbin "baserom.gba", 0x615ab6, 0x2 - -gUnknown_08615AB8:: @ 8615AB8 - .incbin "baserom.gba", 0x615ab8, 0x2 - -gUnknown_08615ABA:: @ 8615ABA - .incbin "baserom.gba", 0x615aba, 0x3 - -gUnknown_08615ABD:: @ 8615ABD - .incbin "baserom.gba", 0x615abd, 0x3 - -gUnknown_08615AC0:: @ 8615AC0 - .incbin "baserom.gba", 0x615ac0, 0x3 - -gUnknown_08615AC3:: @ 8615AC3 - .incbin "baserom.gba", 0x615ac3, 0x2 - -gUnknown_08615AC5:: @ 8615AC5 - .incbin "baserom.gba", 0x615ac5, 0x2 - -gUnknown_08615AC7:: @ 8615AC7 - .incbin "baserom.gba", 0x615ac7, 0x2 - -gUnknown_08615AC9:: @ 8615AC9 - .incbin "baserom.gba", 0x615ac9, 0x2 - -gUnknown_08615ACB:: @ 8615ACB - .incbin "baserom.gba", 0x615acb, 0x2 - -gUnknown_08615ACD:: @ 8615ACD - .incbin "baserom.gba", 0x615acd, 0x3 - -gUnknown_08615AD0:: @ 8615AD0 - .incbin "baserom.gba", 0x615ad0, 0x3 - -gUnknown_08615AD3:: @ 8615AD3 - .incbin "baserom.gba", 0x615ad3, 0x3 - -gUnknown_08615AD6:: @ 8615AD6 - .incbin "baserom.gba", 0x615ad6, 0x3 - -gUnknown_08615AD9:: @ 8615AD9 - .incbin "baserom.gba", 0x615ad9, 0x3 - -gUnknown_08615ADC:: @ 8615ADC - .incbin "baserom.gba", 0x615adc, 0x3 - -gUnknown_08615ADF:: @ 8615ADF - .incbin "baserom.gba", 0x615adf, 0x3 - -gUnknown_08615AE2:: @ 8615AE2 - .incbin "baserom.gba", 0x615ae2, 0x3 - -gUnknown_08615AE5:: @ 8615AE5 - .incbin "baserom.gba", 0x615ae5, 0x3 - -gUnknown_08615AE8:: @ 8615AE8 - .incbin "baserom.gba", 0x615ae8, 0x3 - -gUnknown_08615AEB:: @ 8615AEB - .incbin "baserom.gba", 0x615aeb, 0x3 - -gUnknown_08615AEE:: @ 8615AEE - .incbin "baserom.gba", 0x615aee, 0x3 - -gUnknown_08615AF1:: @ 8615AF1 - .incbin "baserom.gba", 0x615af1, 0x3 - -gUnknown_08615AF4:: @ 8615AF4 - .incbin "baserom.gba", 0x615af4, 0x6c - -gUnknown_08615B60:: @ 8615B60 - .incbin "baserom.gba", 0x615b60, 0xa8 - -gUnknown_08615C08:: @ 8615C08 - .incbin "baserom.gba", 0x615c08, 0x130 - -gUnknown_08615D38:: @ 8615D38 - .incbin "baserom.gba", 0x615d38, 0x38 - -gUnknown_08615D70:: @ 8615D70 - .incbin "baserom.gba", 0x615d70, 0xe - -gUnknown_08615D7E:: @ 8615D7E - .incbin "baserom.gba", 0x615d7e, 0x1e - -gUnknown_08615D9C:: @ 8615D9C - .incbin "baserom.gba", 0x615d9c, 0x70 - -gUnknown_08615E0C:: @ 8615E0C - .incbin "baserom.gba", 0x615e0c, 0xa4 - -gUnknown_08615EB0:: @ 8615EB0 - .incbin "baserom.gba", 0x615eb0, 0x8 - -gUnknown_08615EB8:: @ 8615EB8 - .incbin "baserom.gba", 0x615eb8, 0x8 - -gUnknown_08615EC0:: @ 8615EC0 - .incbin "baserom.gba", 0x615ec0, 0x38 - -gUnknown_08615EF8:: @ 8615EF8 - .incbin "baserom.gba", 0x615ef8, 0x8 - -gUnknown_08615F00:: @ 8615F00 - .incbin "baserom.gba", 0x615f00, 0x8 - -gUnknown_08615F08:: @ 8615F08 - .incbin "baserom.gba", 0x615f08, 0x68 - -gUnknown_08615F70:: @ 8615F70 - .incbin "baserom.gba", 0x615f70, 0x8 - -gUnknown_08615F78:: @ 8615F78 - .incbin "baserom.gba", 0x615f78, 0x80 - -gUnknown_08615FF8:: @ 8615FF8 - .incbin "baserom.gba", 0x615ff8, 0x8 - -gUnknown_08616000:: @ 8616000 - .incbin "baserom.gba", 0x616000, 0x8 - -gUnknown_08616008:: @ 8616008 - .incbin "baserom.gba", 0x616008, 0x18 - -gUnknown_08616020:: @ 8616020 - .incbin "baserom.gba", 0x616020, 0x20 - -gUnknown_08616040:: @ 8616040 - .incbin "baserom.gba", 0x616040, 0x74 - -gUnknown_086160B4:: @ 86160B4 - .incbin "baserom.gba", 0x6160b4, 0x20 - -gUnknown_086160D4:: @ 86160D4 - .incbin "baserom.gba", 0x6160d4, 0x4 - -gUnknown_086160D8:: @ 86160D8 - .incbin "baserom.gba", 0x6160d8, 0x1c - -gUnknown_086160F4:: @ 86160F4 - .incbin "baserom.gba", 0x6160f4, 0x4 - -gUnknown_086160F8:: @ 86160F8 - .incbin "baserom.gba", 0x6160f8, 0x28 - -gUnknown_08616120:: @ 8616120 - .incbin "baserom.gba", 0x616120, 0x4 - -gUnknown_08616124:: @ 8616124 - .incbin "baserom.gba", 0x616124, 0x4 - - .align 2 -gFont6BrailleGlyphs:: @ 8616128 - .incbin "data/graphics/fonts/font6.fwjpnfont" - -gUnknown_08617128:: @ 8617128 - .incbin "baserom.gba", 0x617128, 0x48 - -gUnknown_08617170:: @ 8617170 - .incbin "baserom.gba", 0x617170, 0x104 - -gUnknown_08617274:: @ 8617274 - .incbin "baserom.gba", 0x617274, 0x920 - -gUnknown_08617B94:: @ 8617B94 - .incbin "baserom.gba", 0x617b94, 0xb0 - -gUnknown_08617C44:: @ 8617C44 - .incbin "baserom.gba", 0x617c44, 0x120 - -gUnknown_08617D64:: @ 8617D64 - .incbin "baserom.gba", 0x617d64, 0x30 - -gUnknown_08617D94:: @ 8617D94 - .incbin "baserom.gba", 0x617d94, 0x10 - -gUnknown_08617DA4:: @ 8617DA4 - .incbin "baserom.gba", 0x617da4, 0x5c - -gUnknown_08617E00:: @ 8617E00 - .incbin "baserom.gba", 0x617e00, 0x18 - -gUnknown_08617E18:: @ 8617E18 - .incbin "baserom.gba", 0x617e18, 0x1c - -gUnknown_08617E34:: @ 8617E34 - .incbin "baserom.gba", 0x617e34, 0x2c - -gUnknown_08617E60:: @ 8617E60 - .incbin "baserom.gba", 0x617e60, 0x18 - -gUnknown_08617E78:: @ 8617E78 - .incbin "baserom.gba", 0x617e78, 0x15 - -gUnknown_08617E8D:: @ 8617E8D - .incbin "baserom.gba", 0x617e8d, 0xe - -gUnknown_08617E9B:: @ 8617E9B - .incbin "baserom.gba", 0x617e9b, 0x26d - -gUnknown_08618108:: @ 8618108 - .incbin "baserom.gba", 0x618108, 0x8 - -gUnknown_08618110:: @ 8618110 - .incbin "baserom.gba", 0x618110, 0x28 - -gUnknown_08618138:: @ 8618138 - .incbin "baserom.gba", 0x618138, 0x20 - -gUnknown_08618158:: @ 8618158 - .incbin "baserom.gba", 0x618158, 0x3 - -gUnknown_0861815B:: @ 861815B - .incbin "baserom.gba", 0x61815b, 0x5 - -gUnknown_08618160:: @ 8618160 - .incbin "baserom.gba", 0x618160, 0x18 - -gUnknown_08618178:: @ 8618178 - .incbin "baserom.gba", 0x618178, 0x49 - -@ 86181C1 - .include "data/text/move_descriptions.inc" - -@ 861CAAC - .include "data/text/nature_names.inc" - -gUnknown_0861CBB4:: @ 861CBB4 - .incbin "baserom.gba", 0x61cbb4, 0x38 - -gUnknown_0861CBEC:: @ 861CBEC - .incbin "baserom.gba", 0x61cbec, 0xc - -gUnknown_0861CBF8:: @ 861CBF8 - .incbin "baserom.gba", 0x61cbf8, 0xc - -gUnknown_0861CC04:: @ 861CC04 - .incbin "baserom.gba", 0x61cc04, 0xc - -gUnknown_0861CC10:: @ 861CC10 - .incbin "baserom.gba", 0x61cc10, 0xc - -gUnknown_0861CC1C:: @ 861CC1C - .incbin "baserom.gba", 0x61cc1c, 0x8 - -gUnknown_0861CC24:: @ 861CC24 - .incbin "baserom.gba", 0x61cc24, 0xa8 - -gUnknown_0861CCCC:: @ 861CCCC - .incbin "baserom.gba", 0x61cccc, 0x20 - -gUnknown_0861CCEC:: @ 861CCEC - .incbin "baserom.gba", 0x61ccec, 0x28 - -gUnknown_0861CD14:: @ 861CD14 - .incbin "baserom.gba", 0x61cd14, 0x18 - -gUnknown_0861CD2C:: @ 861CD2C - .incbin "baserom.gba", 0x61cd2c, 0xa7 - -gUnknown_0861CDD3:: @ 861CDD3 - .incbin "baserom.gba", 0x61cdd3, 0x81 - -gUnknown_0861CE54:: @ 861CE54 - .incbin "baserom.gba", 0x61ce54, 0x10 - -gUnknown_0861CE64:: @ 861CE64 - .incbin "baserom.gba", 0x61ce64, 0x10 - -gUnknown_0861CE74:: @ 861CE74 - .incbin "baserom.gba", 0x61ce74, 0x7 - -gUnknown_0861CE7B:: @ 861CE7B - .incbin "baserom.gba", 0x61ce7b, 0x7 - -gUnknown_0861CE82:: @ 861CE82 - .incbin "baserom.gba", 0x61ce82, 0xc - -gUnknown_0861CE8E:: @ 861CE8E - .incbin "baserom.gba", 0x61ce8e, 0x9 - -gUnknown_0861CE97:: @ 861CE97 - .incbin "baserom.gba", 0x61ce97, 0x125 - -gUnknown_0861CFBC:: @ 861CFBC - .incbin "baserom.gba", 0x61cfbc, 0x8 - -gUnknown_0861CFC4:: @ 861CFC4 - .incbin "baserom.gba", 0x61cfc4, 0x18 - -gUnknown_0861CFDC:: @ 861CFDC - .incbin "baserom.gba", 0x61cfdc, 0x98 - -gUnknown_0861D074:: @ 861D074 - .incbin "baserom.gba", 0x61d074, 0x8 - -gUnknown_0861D07C:: @ 861D07C - .incbin "baserom.gba", 0x61d07c, 0x8 - -gUnknown_0861D084:: @ 861D084 - .incbin "baserom.gba", 0x61d084, 0x74 - -gUnknown_0861D0F8:: @ 861D0F8 - .incbin "baserom.gba", 0x61d0f8, 0x8 - -gUnknown_0861D100:: @ 861D100 - .incbin "baserom.gba", 0x61d100, 0x8 - -gUnknown_0861D108:: @ 861D108 - .incbin "baserom.gba", 0x61d108, 0x18 - -gUnknown_0861D120:: @ 861D120 - .incbin "baserom.gba", 0x61d120, 0x20 - -gUnknown_0861D140:: @ 861D140 - .incbin "baserom.gba", 0x61d140, 0x60 - -gUnknown_0861D1A0:: @ 861D1A0 - .incbin "baserom.gba", 0x61d1a0, 0xd54 - -gUnknown_0861DEF4:: @ 861DEF4 - .incbin "baserom.gba", 0x61def4, 0x314 - -gUnknown_0861E208:: @ 861E208 - .incbin "baserom.gba", 0x61e208, 0xd5c - -gUnknown_0861EF64:: @ 861EF64 - .incbin "baserom.gba", 0x61ef64, 0x350 - -gUnknown_0861F2B4:: @ 861F2B4 - .incbin "baserom.gba", 0x61f2b4, 0xc - -gUnknown_0861F2C0:: @ 861F2C0 - .incbin "baserom.gba", 0x61f2c0, 0x18 - -gUnknown_0861F2D8:: @ 861F2D8 - .incbin "baserom.gba", 0x61f2d8, 0x30 - -gUnknown_0861F308:: @ 861F308 - .incbin "baserom.gba", 0x61f308, 0x4 - -gUnknown_0861F30C:: @ 861F30C - .incbin "baserom.gba", 0x61f30c, 0x2 - -gUnknown_0861F30E:: @ 861F30E - .incbin "baserom.gba", 0x61f30e, 0x2 - -gUnknown_0861F310:: @ 861F310 - .incbin "baserom.gba", 0x61f310, 0x4 - -gUnknown_0861F314:: @ 861F314 - .incbin "baserom.gba", 0x61f314, 0x8 - -gUnknown_0861F31C:: @ 861F31C - .incbin "baserom.gba", 0x61f31c, 0xc - -gUnknown_0861F328:: @ 861F328 - .incbin "baserom.gba", 0x61f328, 0x28 - -gUnknown_0861F350:: @ 861F350 - .incbin "baserom.gba", 0x61f350, 0x20 - -gUnknown_0861F370:: @ 861F370 - .incbin "baserom.gba", 0x61f370, 0x5c - -gUnknown_0861F3CC:: @ 861F3CC - .incbin "baserom.gba", 0x61f3cc, 0x8 - -gUnknown_0861F3D4:: @ 861F3D4 - .incbin "baserom.gba", 0x61f3d4, 0x18 - -gUnknown_0861F3EC:: @ 861F3EC - .incbin "baserom.gba", 0x61f3ec, 0x618 - -gUnknown_0861FA04:: @ 861FA04 - .incbin "baserom.gba", 0x61fa04, 0x4 - -gUnknown_0861FA08:: @ 861FA08 - .incbin "baserom.gba", 0x61fa08, 0x10 - -gUnknown_0861FA18:: @ 861FA18 - .incbin "baserom.gba", 0x61fa18, 0x30 - -gUnknown_0861FA48:: @ 861FA48 - .incbin "baserom.gba", 0x61fa48, 0x4 - -gUnknown_0861FA4C:: @ 861FA4C - .incbin "baserom.gba", 0x61fa4c, 0x8 - -gUnknown_0861FA54:: @ 861FA54 - .incbin "baserom.gba", 0x61fa54, 0x10 - -gUnknown_0861FA64:: @ 861FA64 - .incbin "baserom.gba", 0x61fa64, 0x8 - -gUnknown_0861FA6C:: @ 861FA6C - .incbin "baserom.gba", 0x61fa6c, 0x30 - -gUnknown_0861FA9C:: @ 861FA9C - .incbin "baserom.gba", 0x61fa9c, 0x68 - -gUnknown_0861FB04:: @ 861FB04 - .incbin "baserom.gba", 0x61fb04, 0x28 - -gUnknown_0861FB2C:: @ 861FB2C - .incbin "baserom.gba", 0x61fb2c, 0x18 - -gUnknown_0861FB44:: @ 861FB44 - .incbin "baserom.gba", 0x61fb44, 0xa0 - -gUnknown_0861FBE4:: @ 861FBE4 - .incbin "baserom.gba", 0x61fbe4, 0x4 - -gUnknown_0861FBE8:: @ 861FBE8 - .incbin "baserom.gba", 0x61fbe8, 0xc - -gUnknown_0861FBF4:: @ 861FBF4 - .incbin "baserom.gba", 0x61fbf4, 0x3 - -gUnknown_0861FBF7:: @ 861FBF7 - .incbin "baserom.gba", 0x61fbf7, 0x5 - -gUnknown_0861FBFC:: @ 861FBFC - .incbin "baserom.gba", 0x61fbfc, 0x8 - -gUnknown_0861FC04:: @ 861FC04 - .incbin "baserom.gba", 0x61fc04, 0x18 - -gUnknown_0861FC1C:: @ 861FC1C - .incbin "baserom.gba", 0x61fc1c, 0x20 - -gUnknown_0861FC3C:: @ 861FC3C - .incbin "baserom.gba", 0x61fc3c, 0x18 - -gUnknown_0861FC54:: @ 861FC54 - .incbin "baserom.gba", 0x61fc54, 0x5 - -gUnknown_0861FC59:: @ 861FC59 - .incbin "baserom.gba", 0x61fc59, 0x1f - -gUnknown_0861FC78:: @ 861FC78 - .incbin "baserom.gba", 0x61fc78, 0x2 - -gUnknown_0861FC7A:: @ 861FC7A - .incbin "baserom.gba", 0x61fc7a, 0xc - -gUnknown_0861FC86:: @ 861FC86 - .incbin "baserom.gba", 0x61fc86, 0x12 - -gUnknown_0861FC98:: @ 861FC98 - .incbin "baserom.gba", 0x61fc98, 0x14 - -gUnknown_0861FCAC:: @ 861FCAC - .incbin "baserom.gba", 0x61fcac, 0xa0 - -gUnknown_0861FD4C:: @ 861FD4C - .incbin "baserom.gba", 0x61fd4c, 0x20 - -gUnknown_0861FD6C:: @ 861FD6C - .incbin "baserom.gba", 0x61fd6c, 0x288 - -gUnknown_0861FFF4:: @ 861FFF4 - .incbin "baserom.gba", 0x61fff4, 0x1a0 - -gUnknown_08620194:: @ 8620194 - .incbin "baserom.gba", 0x620194, 0xc - -gUnknown_086201A0:: @ 86201A0 - .incbin "baserom.gba", 0x6201a0, 0x24 - -gUnknown_086201C4:: @ 86201C4 - .incbin "baserom.gba", 0x6201c4, 0x10 - -gUnknown_086201D4:: @ 86201D4 - .incbin "baserom.gba", 0x6201d4, 0x6c - -gUnknown_08620240:: @ 8620240 - .incbin "baserom.gba", 0x620240, 0x4 - -gUnknown_08620244:: @ 8620244 - .incbin "baserom.gba", 0x620244, 0x88 - -gUnknown_086202CC:: @ 86202CC - .incbin "baserom.gba", 0x6202cc, 0x8 - -gUnknown_086202D4:: @ 86202D4 - .incbin "baserom.gba", 0x6202d4, 0x38 - -gUnknown_0862030C:: @ 862030C - .incbin "baserom.gba", 0x62030c, 0x3 - -gUnknown_0862030F:: @ 862030F - .incbin "baserom.gba", 0x62030f, 0x3d - -gUnknown_0862034C:: @ 862034C - .incbin "baserom.gba", 0x62034c, 0x20 - -gUnknown_0862036C:: @ 862036C - .incbin "baserom.gba", 0x62036c, 0x18 - -gUnknown_08620384:: @ 8620384 - .incbin "baserom.gba", 0x620384, 0x1ca4 - -gUnknown_08622028:: @ 8622028 - .incbin "baserom.gba", 0x622028, 0x4e0 - -gUnknown_08622508:: @ 8622508 - .incbin "baserom.gba", 0x622508, 0x2 - -gUnknown_0862250A:: @ 862250A - .incbin "baserom.gba", 0x62250a, 0x6 - -gUnknown_08622510:: @ 8622510 - .incbin "baserom.gba", 0x622510, 0x20 - -gUnknown_08622530:: @ 8622530 - .incbin "baserom.gba", 0x622530, 0xa4 - -gUnknown_086225D4:: @ 86225D4 - .incbin "baserom.gba", 0x6225d4, 0x10c - -gUnknown_086226E0:: @ 86226E0 - .incbin "baserom.gba", 0x6226e0, 0x20 - -gUnknown_08622700:: @ 8622700 - .incbin "baserom.gba", 0x622700, 0x20 - -gUnknown_08622720:: @ 8622720 - .incbin "baserom.gba", 0x622720, 0x40 - -gUnknown_08622760:: @ 8622760 - .incbin "baserom.gba", 0x622760, 0x2c - -gUnknown_0862278C:: @ 862278C - .incbin "baserom.gba", 0x62278c, 0x8 - -gUnknown_08622794:: @ 8622794 - .incbin "baserom.gba", 0x622794, 0x4 - -gUnknown_08622798:: @ 8622798 - .incbin "baserom.gba", 0x622798, 0x40 - -gUnknown_086227D8:: @ 86227D8 - .incbin "baserom.gba", 0x6227d8, 0x8 - -gUnknown_086227E0:: @ 86227E0 - .incbin "baserom.gba", 0x6227e0, 0x8 - -gUnknown_086227E8:: @ 86227E8 - .incbin "baserom.gba", 0x6227e8, 0xc - -gUnknown_086227F4:: @ 86227F4 - .incbin "baserom.gba", 0x6227f4, 0x14 - -gUnknown_08622808:: @ 8622808 - .incbin "baserom.gba", 0x622808, 0x8 - -gUnknown_08622810:: @ 8622810 - .incbin "baserom.gba", 0x622810, 0x8 - -gUnknown_08622818:: @ 8622818 - .incbin "baserom.gba", 0x622818, 0x18 - -gUnknown_08622830:: @ 8622830 - .incbin "baserom.gba", 0x622830, 0x20 - -gUnknown_08622850:: @ 8622850 - .incbin "baserom.gba", 0x622850, 0x18 - -gUnknown_08622868:: @ 8622868 - .incbin "baserom.gba", 0x622868, 0x20 - -gUnknown_08622888:: @ 8622888 - .incbin "baserom.gba", 0x622888, 0x850 - -gUnknown_086230D8:: @ 86230D8 - .incbin "baserom.gba", 0x6230d8, 0xc - -gUnknown_086230E4:: @ 86230E4 - .incbin "baserom.gba", 0x6230e4, 0x14 - -gUnknown_086230F8:: @ 86230F8 - .incbin "baserom.gba", 0x6230f8, 0x8 - -gUnknown_08623100:: @ 8623100 - .incbin "baserom.gba", 0x623100, 0x10 - -gUnknown_08623110:: @ 8623110 - .incbin "baserom.gba", 0x623110, 0x8 - -gUnknown_08623118:: @ 8623118 - .incbin "baserom.gba", 0x623118, 0xb8 - -gUnknown_086231D0:: @ 86231D0 - .incbin "baserom.gba", 0x6231d0, 0x18 - -gUnknown_086231E8:: @ 86231E8 - .incbin "baserom.gba", 0x6231e8, 0x20 - -gUnknown_08623208:: @ 8623208 - .incbin "baserom.gba", 0x623208, 0x20 - -gUnknown_08623228:: @ 8623228 - .incbin "baserom.gba", 0x623228, 0x14 - -gUnknown_0862323C:: @ 862323C - .incbin "baserom.gba", 0x62323c, 0xfc - -gUnknown_08623338:: @ 8623338 - .incbin "baserom.gba", 0x623338, 0x20 - -gUnknown_08623358:: @ 8623358 - .incbin "baserom.gba", 0x623358, 0xc - -gUnknown_08623364:: @ 8623364 - .incbin "baserom.gba", 0x623364, 0x8 - -gUnknown_0862336C:: @ 862336C - .incbin "baserom.gba", 0x62336c, 0x8 - -gUnknown_08623374:: @ 8623374 - .incbin "baserom.gba", 0x623374, 0x8 - -gUnknown_0862337C:: @ 862337C - .incbin "baserom.gba", 0x62337c, 0x8 - -gUnknown_08623384:: @ 8623384 - .incbin "baserom.gba", 0x623384, 0x1c - -gUnknown_086233A0:: @ 86233A0 - .incbin "baserom.gba", 0x6233a0, 0x14 - -gUnknown_086233B4:: @ 86233B4 - .incbin "baserom.gba", 0x6233b4, 0x10 - -gUnknown_086233C4:: @ 86233C4 - .incbin "baserom.gba", 0x6233c4, 0x20 - -gUnknown_086233E4:: @ 86233E4 - .incbin "baserom.gba", 0x6233e4, 0xc8 - -gUnknown_086234AC:: @ 86234AC - .incbin "baserom.gba", 0x6234ac, 0xc4 - -gUnknown_08623570:: @ 8623570 - .incbin "baserom.gba", 0x623570, 0x20 - -gUnknown_08623590:: @ 8623590 - .incbin "baserom.gba", 0x623590, 0x4 - -gUnknown_08623594:: @ 8623594 - .incbin "baserom.gba", 0x623594, 0x4 - -gUnknown_08623598:: @ 8623598 - .incbin "baserom.gba", 0x623598, 0x1c - -gUnknown_086235B4:: @ 86235B4 - .incbin "baserom.gba", 0x6235b4, 0x8 - -gUnknown_086235BC:: @ 86235BC - .incbin "baserom.gba", 0x6235bc, 0xc - -gUnknown_086235C8:: @ 86235C8 - .incbin "baserom.gba", 0x6235c8, 0xc - -gUnknown_086235D4:: @ 86235D4 - .incbin "baserom.gba", 0x6235d4, 0x4 - -gUnknown_086235D8:: @ 86235D8 - .incbin "baserom.gba", 0x6235d8, 0xc - -gUnknown_086235E4:: @ 86235E4 - .incbin "baserom.gba", 0x6235e4, 0x20 - -gUnknown_08623604:: @ 8623604 - .incbin "baserom.gba", 0x623604, 0xc8 - -gUnknown_086236CC:: @ 86236CC - .incbin "baserom.gba", 0x6236cc, 0xc4 - -gUnknown_08623790:: @ 8623790 - .incbin "baserom.gba", 0x623790, 0x20 - -gUnknown_086237B0:: @ 86237B0 - .incbin "baserom.gba", 0x6237b0, 0x4 - -gUnknown_086237B4:: @ 86237B4 - .incbin "baserom.gba", 0x6237b4, 0x4 - -gUnknown_086237B8:: @ 86237B8 - .incbin "baserom.gba", 0x6237b8, 0x1c - -gUnknown_086237D4:: @ 86237D4 - .incbin "baserom.gba", 0x6237d4, 0x8 - -gUnknown_086237DC:: @ 86237DC - .incbin "baserom.gba", 0x6237dc, 0xc - -gUnknown_086237E8:: @ 86237E8 - .incbin "baserom.gba", 0x6237e8, 0xc - -gUnknown_086237F4:: @ 86237F4 - .incbin "baserom.gba", 0x6237f4, 0x4 - -gUnknown_086237F8:: @ 86237F8 - .incbin "baserom.gba", 0x6237f8, 0x44 - -@ 862383C - .include "data/text/ribbon_descriptions.inc" - -@ 8623A74 - .include "data/text/gift_ribbon_descriptions.inc" - -gUnknown_08623FF8:: @ 8623FF8 - .incbin "baserom.gba", 0x623ff8, 0xa0 - -gUnknown_08624098:: @ 8624098 - .incbin "baserom.gba", 0x624098, 0x20 - -gUnknown_086240B8:: @ 86240B8 - .incbin "baserom.gba", 0x6240b8, 0xae0 - -gUnknown_08624B98:: @ 8624B98 - .incbin "baserom.gba", 0x624b98, 0x8 - -gUnknown_08624BA0:: @ 8624BA0 - .incbin "baserom.gba", 0x624ba0, 0x18 - -gUnknown_08624BB8:: @ 8624BB8 - .incbin "baserom.gba", 0x624bb8, 0x8 - -gUnknown_08624BC0:: @ 8624BC0 - .incbin "baserom.gba", 0x624bc0, 0x4 - -gUnknown_08624BC4:: @ 8624BC4 - .incbin "baserom.gba", 0x624bc4, 0x8 - -gUnknown_08624BCC:: @ 8624BCC - .incbin "baserom.gba", 0x624bcc, 0xc - -gUnknown_08624BD8:: @ 8624BD8 - .incbin "baserom.gba", 0x624bd8, 0xc - -gUnknown_08624BE4:: @ 8624BE4 - .incbin "baserom.gba", 0x624be4, 0x4 - -gUnknown_08624BE8:: @ 8624BE8 - .incbin "baserom.gba", 0x624be8, 0x10 - -gUnknown_08624BF8:: @ 8624BF8 - .incbin "baserom.gba", 0x624bf8, 0x80 - -gUnknown_08624C78:: @ 8624C78 - .incbin "baserom.gba", 0x624c78, 0x8 - -gUnknown_08624C80:: @ 8624C80 - .incbin "baserom.gba", 0x624c80, 0x84 - -gUnknown_08624D04:: @ 8624D04 - .incbin "baserom.gba", 0x624d04, 0x5a4 - -gUnknown_086252A8:: @ 86252A8 - .incbin "baserom.gba", 0x6252a8, 0x54 - -gUnknown_086252FC:: @ 86252FC - .incbin "baserom.gba", 0x6252fc, 0x14 - -gUnknown_08625310:: @ 8625310 - .incbin "baserom.gba", 0x625310, 0x14 - -gUnknown_08625324:: @ 8625324 - .incbin "baserom.gba", 0x625324, 0x14 - -gUnknown_08625338:: @ 8625338 - .incbin "baserom.gba", 0x625338, 0x14 - -gUnknown_0862534C:: @ 862534C - .incbin "baserom.gba", 0x62534c, 0x14 - -gUnknown_08625360:: @ 8625360 - .incbin "baserom.gba", 0x625360, 0x14 - -gUnknown_08625374:: @ 8625374 - .incbin "baserom.gba", 0x625374, 0x14 - -gUnknown_08625388:: @ 8625388 - .incbin "baserom.gba", 0x625388, 0x60 - -gUnknown_086253E8:: @ 86253E8 - .incbin "baserom.gba", 0x6253e8, 0x18 - -gUnknown_08625400:: @ 8625400 - .incbin "baserom.gba", 0x625400, 0x3 - -gUnknown_08625403:: @ 8625403 - .incbin "baserom.gba", 0x625403, 0x1 - -gUnknown_08625404:: @ 8625404 - .incbin "baserom.gba", 0x625404, 0xc - -gUnknown_08625410:: @ 8625410 - .incbin "baserom.gba", 0x625410, 0x100 - -gUnknown_08625510:: @ 8625510 - .incbin "baserom.gba", 0x625510, 0x30 - -gUnknown_08625540:: @ 8625540 - .incbin "baserom.gba", 0x625540, 0x8 - -gUnknown_08625548:: @ 8625548 - .incbin "baserom.gba", 0x625548, 0x500 - -gUnknown_08625A48:: @ 8625A48 - .incbin "baserom.gba", 0x625a48, 0x8 - -gUnknown_08625A50:: @ 8625A50 - .incbin "baserom.gba", 0x625a50, 0x18 - -gUnknown_08625A68:: @ 8625A68 - .incbin "baserom.gba", 0x625a68, 0x8 - -gUnknown_08625A70:: @ 8625A70 - .incbin "baserom.gba", 0x625a70, 0x20 - -gUnknown_08625A90:: @ 8625A90 - .incbin "baserom.gba", 0x625a90, 0x18 - -gUnknown_08625AA8:: @ 8625AA8 - .incbin "baserom.gba", 0x625aa8, 0x18 - -gUnknown_08625AC0:: @ 8625AC0 - .incbin "baserom.gba", 0x625ac0, 0x8 - -gUnknown_08625AC8:: @ 8625AC8 - .incbin "baserom.gba", 0x625ac8, 0x4c - -gUnknown_08625B14:: @ 8625B14 - .incbin "baserom.gba", 0x625b14, 0x18 - -gUnknown_08625B2C:: @ 8625B2C - .incbin "baserom.gba", 0x625b2c, 0x28 - -gUnknown_08625B54:: @ 8625B54 - .incbin "baserom.gba", 0x625b54, 0x18 - -gUnknown_08625B6C:: @ 8625B6C - .incbin "baserom.gba", 0x625b6c, 0x520 - -gUnknown_0862608C:: @ 862608C - .incbin "baserom.gba", 0x62608c, 0x2 - -gUnknown_0862608E:: @ 862608E - .incbin "baserom.gba", 0x62608e, 0x4326 - -gUnknown_0862A3B4:: @ 862A3B4 - .incbin "baserom.gba", 0x62a3b4, 0x218 - -gUnknown_0862A5CC:: @ 862A5CC - .incbin "baserom.gba", 0x62a5cc, 0x8 - -gUnknown_0862A5D4:: @ 862A5D4 - .incbin "baserom.gba", 0x62a5d4, 0x20 - -gUnknown_0862A5F4:: @ 862A5F4 - .incbin "baserom.gba", 0x62a5f4, 0x4 - -gUnknown_0862A5F8:: @ 862A5F8 - .incbin "baserom.gba", 0x62a5f8, 0x20 - -gUnknown_0862A618:: @ 862A618 - .incbin "baserom.gba", 0x62a618, 0x48 - -gUnknown_0862A660:: @ 862A660 - .incbin "baserom.gba", 0x62a660, 0x10 - -gUnknown_0862A670:: @ 862A670 - .incbin "baserom.gba", 0x62a670, 0x18 - -gUnknown_0862A688:: @ 862A688 - .incbin "baserom.gba", 0x62a688, 0x10 - -gUnknown_0862A698:: @ 862A698 - .incbin "baserom.gba", 0x62a698, 0x8 - -gUnknown_0862A6A0:: @ 862A6A0 - .incbin "baserom.gba", 0x62a6a0, 0x8c - -gUnknown_0862A72C:: @ 862A72C - .incbin "baserom.gba", 0x62a72c, 0x24 - -gUnknown_0862A750:: @ 862A750 - .incbin "baserom.gba", 0x62a750, 0x24 - -gUnknown_0862A774:: @ 862A774 - .incbin "baserom.gba", 0x62a774, 0xa8 - -gUnknown_0862A81C:: @ 862A81C - .incbin "baserom.gba", 0x62a81c, 0x30 - -gUnknown_0862A84C:: @ 862A84C - .incbin "baserom.gba", 0x62a84c, 0x18 - -gUnknown_0862A864:: @ 862A864 - .incbin "baserom.gba", 0x62a864, 0x18 - -gUnknown_0862A87C:: @ 862A87C - .incbin "baserom.gba", 0x62a87c, 0xc - -gUnknown_0862A888:: @ 862A888 - .incbin "baserom.gba", 0x62a888, 0x3c - -gUnknown_0862A8C4:: @ 862A8C4 - .incbin "baserom.gba", 0x62a8c4, 0x8 - -gUnknown_0862A8CC:: @ 862A8CC - .incbin "baserom.gba", 0x62a8cc, 0x8 - -gUnknown_0862A8D4:: @ 862A8D4 - .incbin "baserom.gba", 0x62a8d4, 0x24 - -gUnknown_0862A8F8:: @ 862A8F8 - .incbin "baserom.gba", 0x62a8f8, 0x8 - -gUnknown_0862A900:: @ 862A900 - .incbin "baserom.gba", 0x62a900, 0x24 - -gUnknown_0862A924:: @ 862A924 - .incbin "baserom.gba", 0x62a924, 0x8 - -gUnknown_0862A92C:: @ 862A92C - .incbin "baserom.gba", 0x62a92c, 0xa8 - -gUnknown_0862A9D4:: @ 862A9D4 - .incbin "baserom.gba", 0x62a9d4, 0x8 - -gUnknown_0862A9DC:: @ 862A9DC - .incbin "baserom.gba", 0x62a9dc, 0x8 - -gUnknown_0862A9E4:: @ 862A9E4 - .incbin "baserom.gba", 0x62a9e4, 0x30 - -gUnknown_0862AA14:: @ 862AA14 - .incbin "baserom.gba", 0x62aa14, 0x8 - -gUnknown_0862AA1C:: @ 862AA1C - .incbin "baserom.gba", 0x62aa1c, 0x18 - -gUnknown_0862AA34:: @ 862AA34 - .incbin "baserom.gba", 0x62aa34, 0x8 - -gUnknown_0862AA3C:: @ 862AA3C - .incbin "baserom.gba", 0x62aa3c, 0x18 - -gUnknown_0862AA54:: @ 862AA54 - .incbin "baserom.gba", 0x62aa54, 0x3c - -gUnknown_0862AA90:: @ 862AA90 - .incbin "baserom.gba", 0x62aa90, 0x8 - -gUnknown_0862AA98:: @ 862AA98 - .incbin "baserom.gba", 0x62aa98, 0x8 - -gUnknown_0862AAA0:: @ 862AAA0 - .incbin "baserom.gba", 0x62aaa0, 0x18 - -gUnknown_0862AAB8:: @ 862AAB8 - .incbin "baserom.gba", 0x62aab8, 0x14 - -gUnknown_0862AACC:: @ 862AACC - .incbin "baserom.gba", 0x62aacc, 0x30 - -gUnknown_0862AAFC:: @ 862AAFC - .incbin "baserom.gba", 0x62aafc, 0x8 - -gUnknown_0862AB04:: @ 862AB04 - .incbin "baserom.gba", 0x62ab04, 0x8 - -gUnknown_0862AB0C:: @ 862AB0C - .incbin "baserom.gba", 0x62ab0c, 0x8 - -gUnknown_0862AB14:: @ 862AB14 - .incbin "baserom.gba", 0x62ab14, 0x18 - -gUnknown_0862AB2C:: @ 862AB2C - .incbin "baserom.gba", 0x62ab2c, 0x18 - -gUnknown_0862AB44:: @ 862AB44 - .incbin "baserom.gba", 0x62ab44, 0xe4 - -gUnknown_0862AC28:: @ 862AC28 - .incbin "baserom.gba", 0x62ac28, 0x8 - -gUnknown_0862AC30:: @ 862AC30 - .incbin "baserom.gba", 0x62ac30, 0x8 - -gUnknown_0862AC38:: @ 862AC38 - .incbin "baserom.gba", 0x62ac38, 0x8 - -gUnknown_0862AC40:: @ 862AC40 - .incbin "baserom.gba", 0x62ac40, 0x8 - -gUnknown_0862AC48:: @ 862AC48 - .incbin "baserom.gba", 0x62ac48, 0x8 - -gUnknown_0862AC50:: @ 862AC50 - .incbin "baserom.gba", 0x62ac50, 0x8 - -gUnknown_0862AC58:: @ 862AC58 - .incbin "baserom.gba", 0x62ac58, 0x8 - -gUnknown_0862AC60:: @ 862AC60 - .incbin "baserom.gba", 0x62ac60, 0x8 - -gUnknown_0862AC68:: @ 862AC68 - .incbin "baserom.gba", 0x62ac68, 0x8 - -gUnknown_0862AC70:: @ 862AC70 - .incbin "baserom.gba", 0x62ac70, 0x8 - -gUnknown_0862AC78:: @ 862AC78 - .incbin "baserom.gba", 0x62ac78, 0x18 - -gUnknown_0862AC90:: @ 862AC90 - .incbin "baserom.gba", 0x62ac90, 0x18 - -gUnknown_0862ACA8:: @ 862ACA8 - .incbin "baserom.gba", 0x62aca8, 0x18 - -gUnknown_0862ACC0:: @ 862ACC0 - .incbin "baserom.gba", 0x62acc0, 0x18 - -gUnknown_0862ACD8:: @ 862ACD8 - .incbin "baserom.gba", 0x62acd8, 0x18 - -gUnknown_0862ACF0:: @ 862ACF0 - .incbin "baserom.gba", 0x62acf0, 0x18 - -gUnknown_0862AD08:: @ 862AD08 - .incbin "baserom.gba", 0x62ad08, 0xc - -gUnknown_0862AD14:: @ 862AD14 - .incbin "baserom.gba", 0x62ad14, 0x20 - -gUnknown_0862AD34:: @ 862AD34 - .incbin "baserom.gba", 0x62ad34, 0x10 - -gUnknown_0862AD44:: @ 862AD44 - .incbin "baserom.gba", 0x62ad44, 0x10 - -gUnknown_0862AD54:: @ 862AD54 - .incbin "baserom.gba", 0x62ad54, 0x1dc - -gUnknown_0862AF30:: @ 862AF30 - .incbin "baserom.gba", 0x62af30, 0x60c - -gUnknown_0862B53C:: @ 862B53C - .incbin "baserom.gba", 0x62b53c, 0x1e8 - -gUnknown_0862B724:: @ 862B724 - .incbin "baserom.gba", 0x62b724, 0x8 - -gUnknown_0862B72C:: @ 862B72C - .incbin "baserom.gba", 0x62b72c, 0x2c - -gUnknown_0862B758:: @ 862B758 - .incbin "baserom.gba", 0x62b758, 0x18 - -gUnknown_0862B770:: @ 862B770 - .incbin "baserom.gba", 0x62b770, 0x14 - -gUnknown_0862B784:: @ 862B784 - .incbin "baserom.gba", 0x62b784, 0x14 - -gUnknown_0862B798:: @ 862B798 - .incbin "baserom.gba", 0x62b798, 0x14 - -gUnknown_0862B7AC:: @ 862B7AC - .incbin "baserom.gba", 0x62b7ac, 0x14 - -gUnknown_0862B7C0:: @ 862B7C0 - .incbin "baserom.gba", 0x62b7c0, 0x14 - -gUnknown_0862B7D4:: @ 862B7D4 - .incbin "baserom.gba", 0x62b7d4, 0x14 - -gUnknown_0862B7E8:: @ 862B7E8 - .incbin "baserom.gba", 0x62b7e8, 0x14 - -gUnknown_0862B7FC:: @ 862B7FC - .incbin "baserom.gba", 0x62b7fc, 0x2e8 - - .align 2 -gFont8LatinGlyphs:: @ 862BAE4 - .incbin "data/graphics/fonts/font8.latfont" - -gFont8LatinGlyphWidths:: @ 8633AE4 - .include "data/graphics/fonts/font8_latin_widths.inc" - - .align 2 -gFont0LatinGlyphs:: @ 8633CE4 - .incbin "data/graphics/fonts/font0.latfont" - -gFont0LatinGlyphWidths:: @ 863BCE4 - .include "data/graphics/fonts/font0_latin_widths.inc" - - .align 2 -gFont7LatinGlyphs:: @ 863BEE4 - .incbin "data/graphics/fonts/font7.latfont" - -gFont7LatinGlyphWidths:: @ 8643EE4 - .include "data/graphics/fonts/font7_latin_widths.inc" - - .align 2 -gFont2LatinGlyphs:: @ 86440E4 - .incbin "data/graphics/fonts/font2.latfont" - -gFont2LatinGlyphWidths:: @ 864C0E4 - .include "data/graphics/fonts/font2_latin_widths.inc" - - .align 2 -gFont1LatinGlyphs:: @ 864C2E4 - .incbin "data/graphics/fonts/font1.latfont" - -gFont1LatinGlyphWidths:: @ 86542E4 - .include "data/graphics/fonts/font1_latin_widths.inc" - - .align 2 -gFont0JapaneseGlyphs:: @ 86544E4 - .incbin "data/graphics/fonts/font0.hwjpnfont" - - .align 2 -gFont1JapaneseGlyphs:: @ 86584E4 - .incbin "data/graphics/fonts/font1.hwjpnfont" - - .align 2 -gUnusedJapaneseFireRedLeafGreenMaleFontGlyphs:: @ 865C4E4 - .incbin "data/graphics/fonts/unused_frlg_male.fwjpnfont" - -gUnusedJapaneseFireRedLeafGreenMaleFontGlyphWidths:: @ 86644E4 - .include "data/graphics/fonts/unused_japanese_frlg_male_font_widths.inc" - - .align 2 -gUnusedJapaneseFireRedLeafGreenFemaleFontGlyphs:: @ 86646E4 - .incbin "data/graphics/fonts/unused_frlg_female.fwjpnfont" - -gUnusedJapaneseFireRedLeafGreenFemaleFontGlyphWidths:: @ 866C6E4 - .include "data/graphics/fonts/unused_japanese_frlg_female_font_widths.inc" - - .align 2 -gFont2JapaneseGlyphs:: @ 866C8E4 - .incbin "data/graphics/fonts/font2.fwjpnfont" - -gFont2JapaneseGlyphWidths:: @ 86748E4 - .include "data/graphics/fonts/font2_japanese_widths.inc" - -gUnknown_08674AE4:: @ 8674AE4 - .incbin "baserom.gba", 0x674ae4, 0x32 - -gUnknown_08674B16:: @ 8674B16 - .incbin "baserom.gba", 0x674b16, 0x2c - -gUnknown_08674B42:: @ 8674B42 - .incbin "baserom.gba", 0x674b42, 0x28 - -gUnknown_08674B6A:: @ 8674B6A - .incbin "baserom.gba", 0x674b6a, 0x34 - -gUnknown_08674B9E:: @ 8674B9E - .incbin "baserom.gba", 0x674b9e, 0x36 - -gUnknown_08674BD4:: @ 8674BD4 - .incbin "baserom.gba", 0x674bd4, 0x1c - -gUnknown_08674BF0:: @ 8674BF0 - .incbin "baserom.gba", 0x674bf0, 0x12 - -gUnknown_08674C02:: @ 8674C02 - .incbin "baserom.gba", 0x674c02, 0x2f - -gUnknown_08674C31:: @ 8674C31 - .incbin "baserom.gba", 0x674c31, 0x55 - -gUnknown_08674C86:: @ 8674C86 - .incbin "baserom.gba", 0x674c86, 0xd5a + .incbin "baserom.gba", 0x5c9a94, 0xe4 diff --git a/data/data_860A4AC.s b/data/data_860A4AC.s new file mode 100644 index 000000000..22ce61689 --- /dev/null +++ b/data/data_860A4AC.s @@ -0,0 +1,1983 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_0860A4AC:: @ 860A4AC + .incbin "baserom.gba", 0x60a4ac, 0x388 + +gUnknown_0860A834:: @ 860A834 + .incbin "baserom.gba", 0x60a834, 0x70 + +gUnknown_0860A8A4:: @ 860A8A4 + .incbin "baserom.gba", 0x60a8a4, 0x24 + +gUnknown_0860A8C8:: @ 860A8C8 + .incbin "baserom.gba", 0x60a8c8, 0x19c + +gUnknown_0860AA64:: @ 860AA64 + .incbin "baserom.gba", 0x60aa64, 0x1c + +gUnknown_0860AA80:: @ 860AA80 + .incbin "baserom.gba", 0x60aa80, 0x8 + +gUnknown_0860AA88:: @ 860AA88 + .incbin "baserom.gba", 0x60aa88, 0x25c + +gUnknown_0860ACE4:: @ 860ACE4 + .incbin "baserom.gba", 0x60ace4, 0x4b + +gUnknown_0860AD2F:: @ 860AD2F + .incbin "baserom.gba", 0x60ad2f, 0x39 + +gUnknown_0860AD68:: @ 860AD68 + .incbin "baserom.gba", 0x60ad68, 0x8 + +gUnknown_0860AD70:: @ 860AD70 + .incbin "baserom.gba", 0x60ad70, 0x1e + +gUnknown_0860AD8E:: @ 860AD8E + .incbin "baserom.gba", 0x60ad8e, 0x30 + +gUnknown_0860ADBE:: @ 860ADBE + .incbin "baserom.gba", 0x60adbe, 0xbe + +gUnknown_0860AE7C:: @ 860AE7C + .incbin "baserom.gba", 0x60ae7c, 0xc + +gUnknown_0860AE88:: @ 860AE88 + .incbin "baserom.gba", 0x60ae88, 0x8 + +gUnknown_0860AE90:: @ 860AE90 + .incbin "baserom.gba", 0x60ae90, 0xe4 + +gUnknown_0860AF74:: @ 860AF74 + .incbin "baserom.gba", 0x60af74, 0xe4 + +gUnknown_0860B058:: @ 860B058 + .incbin "baserom.gba", 0x60b058, 0xc + +gUnknown_0860B064:: @ 860B064 + .incbin "baserom.gba", 0x60b064, 0x8 + +gUnknown_0860B06C:: @ 860B06C + .incbin "baserom.gba", 0x60b06c, 0x8 + +gUnknown_0860B074:: @ 860B074 + .incbin "baserom.gba", 0x60b074, 0xa + +gUnknown_0860B07E:: @ 860B07E + .incbin "baserom.gba", 0x60b07e, 0x126 + +gUnknown_0860B1A4:: @ 860B1A4 + .incbin "baserom.gba", 0x60b1a4, 0x40 + +gUnknown_0860B1E4:: @ 860B1E4 + .incbin "baserom.gba", 0x60b1e4, 0x20 + +gUnknown_0860B204:: @ 860B204 + .incbin "baserom.gba", 0x60b204, 0x20 + +gUnknown_0860B224:: @ 860B224 + .incbin "baserom.gba", 0x60b224, 0xc8 + +gUnknown_0860B2EC:: @ 860B2EC + .incbin "baserom.gba", 0x60b2ec, 0x18 + +gUnknown_0860B304:: @ 860B304 + .incbin "baserom.gba", 0x60b304, 0xc + +gUnknown_0860B310:: @ 860B310 + .incbin "baserom.gba", 0x60b310, 0x14 + +gUnknown_0860B324:: @ 860B324 + .incbin "baserom.gba", 0x60b324, 0x14 + +gUnknown_0860B338:: @ 860B338 + .incbin "baserom.gba", 0x60b338, 0x14 + +gUnknown_0860B34C:: @ 860B34C + .incbin "baserom.gba", 0x60b34c, 0xc + +gUnknown_0860B358:: @ 860B358 + .incbin "baserom.gba", 0x60b358, 0x1630 + +gUnknown_0860C988:: @ 860C988 + .incbin "baserom.gba", 0x60c988, 0x269 + +gUnknown_0860CBF1:: @ 860CBF1 + .incbin "baserom.gba", 0x60cbf1, 0x283 + +gUnknown_0860CE74:: @ 860CE74 + .incbin "baserom.gba", 0x60ce74, 0x10 + +gUnknown_0860CE84:: @ 860CE84 + .incbin "baserom.gba", 0x60ce84, 0x10 + +gUnknown_0860CE94:: @ 860CE94 + .incbin "baserom.gba", 0x60ce94, 0x20 + +gUnknown_0860CEB4:: @ 860CEB4 + .incbin "baserom.gba", 0x60ceb4, 0x90 + +gUnknown_0860CF44:: @ 860CF44 + .incbin "baserom.gba", 0x60cf44, 0xc + +gUnknown_0860CF50:: @ 860CF50 + .incbin "baserom.gba", 0x60cf50, 0x58 + +gUnknown_0860CFA8:: @ 860CFA8 + .incbin "baserom.gba", 0x60cfa8, 0x30 + +gUnknown_0860CFD8:: @ 860CFD8 + .incbin "baserom.gba", 0x60cfd8, 0x30 + +gUnknown_0860D008:: @ 860D008 + .incbin "baserom.gba", 0x60d008, 0x48 + +gUnknown_0860D050:: @ 860D050 + .incbin "baserom.gba", 0x60d050, 0x18 + +gUnknown_0860D068:: @ 860D068 + .incbin "baserom.gba", 0x60d068, 0x18 + +gUnknown_0860D080:: @ 860D080 + .incbin "baserom.gba", 0x60d080, 0x10 + +gUnknown_0860D090:: @ 860D090 + .incbin "baserom.gba", 0x60d090, 0x5c + +gUnknown_0860D0EC:: @ 860D0EC + .incbin "baserom.gba", 0x60d0ec, 0x10 + +gUnknown_0860D0FC:: @ 860D0FC + .incbin "baserom.gba", 0x60d0fc, 0x10 + +gUnknown_0860D10C:: @ 860D10C + .incbin "baserom.gba", 0x60d10c, 0x40 + +gUnknown_0860D14C:: @ 860D14C + .incbin "baserom.gba", 0x60d14c, 0x10 + +gUnknown_0860D15C:: @ 860D15C + .incbin "baserom.gba", 0x60d15c, 0x40 + +gUnknown_0860D19C:: @ 860D19C + .incbin "baserom.gba", 0x60d19c, 0x4 + +gUnknown_0860D1A0:: @ 860D1A0 + .incbin "baserom.gba", 0x60d1a0, 0x20 + +gUnknown_0860D1C0:: @ 860D1C0 + .incbin "baserom.gba", 0x60d1c0, 0x10 + +gUnknown_0860D1D0:: @ 860D1D0 + .incbin "baserom.gba", 0x60d1d0, 0x44 + +gUnknown_0860D214:: @ 860D214 + .incbin "baserom.gba", 0x60d214, 0x80 + +gUnknown_0860D294:: @ 860D294 + .incbin "baserom.gba", 0x60d294, 0xac + +gUnknown_0860D340:: @ 860D340 + .incbin "baserom.gba", 0x60d340, 0x3 + +gUnknown_0860D343:: @ 860D343 + .incbin "baserom.gba", 0x60d343, 0x3 + +gUnknown_0860D346:: @ 860D346 + .incbin "baserom.gba", 0x60d346, 0x3 + +gUnknown_0860D349:: @ 860D349 + .incbin "baserom.gba", 0x60d349, 0x7 + +gUnknown_0860D350:: @ 860D350 + .incbin "baserom.gba", 0x60d350, 0x3c + +gUnknown_0860D38C:: @ 860D38C + .incbin "baserom.gba", 0x60d38c, 0x1c + +gUnknown_0860D3A8:: @ 860D3A8 + .incbin "baserom.gba", 0x60d3a8, 0x3 + +gUnknown_0860D3AB:: @ 860D3AB + .incbin "baserom.gba", 0x60d3ab, 0x3 + +gUnknown_0860D3AE:: @ 860D3AE + .incbin "baserom.gba", 0x60d3ae, 0x3 + +gUnknown_0860D3B1:: @ 860D3B1 + .incbin "baserom.gba", 0x60d3b1, 0x3 + +gUnknown_0860D3B4:: @ 860D3B4 + .incbin "baserom.gba", 0x60d3b4, 0x10 + +gUnknown_0860D3C4:: @ 860D3C4 + .incbin "baserom.gba", 0x60d3c4, 0x2 + +gUnknown_0860D3C6:: @ 860D3C6 + .incbin "baserom.gba", 0x60d3c6, 0x2b + +gUnknown_0860D3F1:: @ 860D3F1 + .incbin "baserom.gba", 0x60d3f1, 0x1 + +gUnknown_0860D3F2:: @ 860D3F2 + .incbin "baserom.gba", 0x60d3f2, 0x1f + +gUnknown_0860D411:: @ 860D411 + .incbin "baserom.gba", 0x60d411, 0x8ff + +gUnknown_0860DD10:: @ 860DD10 + .incbin "baserom.gba", 0x60dd10, 0x100 + +gUnknown_0860DE10:: @ 860DE10 + .incbin "baserom.gba", 0x60de10, 0x40 + +gUnknown_0860DE50:: @ 860DE50 + .incbin "baserom.gba", 0x60de50, 0x28 + +gUnknown_0860DE78:: @ 860DE78 + .incbin "baserom.gba", 0x60de78, 0xc + +gUnknown_0860DE84:: @ 860DE84 + .incbin "baserom.gba", 0x60de84, 0x14 + +gUnknown_0860DE98:: @ 860DE98 + .incbin "baserom.gba", 0x60de98, 0x10 + +gUnknown_0860DEA8:: @ 860DEA8 + .incbin "baserom.gba", 0x60dea8, 0x10 + +gUnknown_0860DEB8:: @ 860DEB8 + .incbin "baserom.gba", 0x60deb8, 0xb68 + +gUnknown_0860EA20:: @ 860EA20 + .incbin "baserom.gba", 0x60ea20, 0xc + +gUnknown_0860EA2C:: @ 860EA2C + .incbin "baserom.gba", 0x60ea2c, 0x8 + +gUnknown_0860EA34:: @ 860EA34 + .incbin "baserom.gba", 0x60ea34, 0x18 + +gUnknown_0860EA4C:: @ 860EA4C + .incbin "baserom.gba", 0x60ea4c, 0x20 + +gUnknown_0860EA6C:: @ 860EA6C + .incbin "baserom.gba", 0x60ea6c, 0x100 + +gUnknown_0860EB6C:: @ 860EB6C + .incbin "baserom.gba", 0x60eb6c, 0x20 + +gUnknown_0860EB8C:: @ 860EB8C + .incbin "baserom.gba", 0x60eb8c, 0x3e4 + +gUnknown_0860EF70:: @ 860EF70 + .incbin "baserom.gba", 0x60ef70, 0x8 + +gUnknown_0860EF78:: @ 860EF78 + .incbin "baserom.gba", 0x60ef78, 0x20 + +gUnknown_0860EF98:: @ 860EF98 + .incbin "baserom.gba", 0x60ef98, 0x8 + +gUnknown_0860EFA0:: @ 860EFA0 + .incbin "baserom.gba", 0x60efa0, 0xc + +gUnknown_0860EFAC:: @ 860EFAC + .incbin "baserom.gba", 0x60efac, 0x18 + +gUnknown_0860EFC4:: @ 860EFC4 + .incbin "baserom.gba", 0x60efc4, 0x30 + +gUnknown_0860EFF4:: @ 860EFF4 + .incbin "baserom.gba", 0x60eff4, 0x1c + +gUnknown_0860F010:: @ 860F010 + .incbin "baserom.gba", 0x60f010, 0x10 + +gUnknown_0860F020:: @ 860F020 + .incbin "baserom.gba", 0x60f020, 0x54 + +gUnknown_0860F074:: @ 860F074 + .incbin "baserom.gba", 0x60f074, 0x20 + +gUnknown_0860F094:: @ 860F094 + .incbin "baserom.gba", 0x60f094, 0x4 + +gUnknown_0860F098:: @ 860F098 + .incbin "baserom.gba", 0x60f098, 0x10 + +gUnknown_0860F0A8:: @ 860F0A8 + .incbin "baserom.gba", 0x60f0a8, 0x8 + +gUnknown_0860F0B0:: @ 860F0B0 + .incbin "baserom.gba", 0x60f0b0, 0x20 + +gUnknown_0860F0D0:: @ 860F0D0 + .incbin "baserom.gba", 0x60f0d0, 0x4 + +gUnknown_0860F0D4:: @ 860F0D4 + .incbin "baserom.gba", 0x60f0d4, 0x68 + +gUnknown_0860F13C:: @ 860F13C + .incbin "baserom.gba", 0x60f13c, 0x1100 + +gUnknown_0861023C:: @ 861023C + .incbin "baserom.gba", 0x61023c, 0x100 + +gUnknown_0861033C:: @ 861033C + .incbin "baserom.gba", 0x61033c, 0x60 + +gUnknown_0861039C:: @ 861039C + .incbin "baserom.gba", 0x61039c, 0x20 + +gUnknown_086103BC:: @ 86103BC + .incbin "baserom.gba", 0x6103bc, 0x28 + +gUnknown_086103E4:: @ 86103E4 + .incbin "baserom.gba", 0x6103e4, 0x10 + +gUnknown_086103F4:: @ 86103F4 + .incbin "baserom.gba", 0x6103f4, 0x28 + +gUnknown_0861041C:: @ 861041C + .incbin "baserom.gba", 0x61041c, 0xc + +gUnknown_08610428:: @ 8610428 + .incbin "baserom.gba", 0x610428, 0xc + +gUnknown_08610434:: @ 8610434 + .incbin "baserom.gba", 0x610434, 0x38 + +gUnknown_0861046C:: @ 861046C + .incbin "baserom.gba", 0x61046c, 0xa + +gUnknown_08610476:: @ 8610476 + .incbin "baserom.gba", 0x610476, 0x3 + +gUnknown_08610479:: @ 8610479 + .incbin "baserom.gba", 0x610479, 0x15f + +gUnknown_086105D8:: @ 86105D8 + .incbin "baserom.gba", 0x6105d8, 0x18 + +gUnknown_086105F0:: @ 86105F0 + .incbin "baserom.gba", 0x6105f0, 0x18 + +gUnknown_08610608:: @ 8610608 + .incbin "baserom.gba", 0x610608, 0x18 + +gUnknown_08610620:: @ 8610620 + .incbin "baserom.gba", 0x610620, 0x18 + +gUnknown_08610638:: @ 8610638 + .incbin "baserom.gba", 0x610638, 0x18 + +gUnknown_08610650:: @ 8610650 + .incbin "baserom.gba", 0x610650, 0x50 + +gUnknown_086106A0:: @ 86106A0 + .incbin "baserom.gba", 0x6106a0, 0x10 + +gUnknown_086106B0:: @ 86106B0 + .incbin "baserom.gba", 0x6106b0, 0x184 + +gUnknown_08610834:: @ 8610834 + .incbin "baserom.gba", 0x610834, 0x18 + +gUnknown_0861084C:: @ 861084C + .incbin "baserom.gba", 0x61084c, 0x18 + +gUnknown_08610864:: @ 8610864 + .incbin "baserom.gba", 0x610864, 0x18 + +gUnknown_0861087C:: @ 861087C + .incbin "baserom.gba", 0x61087c, 0x18 + +gUnknown_08610894:: @ 8610894 + .incbin "baserom.gba", 0x610894, 0x18 + +gUnknown_086108AC:: @ 86108AC + .incbin "baserom.gba", 0x6108ac, 0xc + +gUnknown_086108B8:: @ 86108B8 + .incbin "baserom.gba", 0x6108b8, 0x10 + +gUnknown_086108C8:: @ 86108C8 + .incbin "baserom.gba", 0x6108c8, 0x50 + +gUnknown_08610918:: @ 8610918 + .incbin "baserom.gba", 0x610918, 0xa + +gUnknown_08610922:: @ 8610922 + .incbin "baserom.gba", 0x610922, 0x3 + +gUnknown_08610925:: @ 8610925 + .incbin "baserom.gba", 0x610925, 0x3 + +gUnknown_08610928:: @ 8610928 + .incbin "baserom.gba", 0x610928, 0x20 + +gUnknown_08610948:: @ 8610948 + .incbin "baserom.gba", 0x610948, 0x28 + +gUnknown_08610970:: @ 8610970 + .incbin "baserom.gba", 0x610970, 0x34 + +gUnknown_086109A4:: @ 86109A4 + .incbin "baserom.gba", 0x6109a4, 0x16 + +gUnknown_086109BA:: @ 86109BA + .incbin "baserom.gba", 0x6109ba, 0x536 + +gUnknown_08610EF0:: @ 8610EF0 + .incbin "baserom.gba", 0x610ef0, 0x100 + +gUnknown_08610FF0:: @ 8610FF0 + .incbin "baserom.gba", 0x610ff0, 0x80 + +gUnknown_08611070:: @ 8611070 + .incbin "baserom.gba", 0x611070, 0x140 + +gUnknown_086111B0:: @ 86111B0 + .incbin "baserom.gba", 0x6111b0, 0x80 + +gUnknown_08611230:: @ 8611230 + .incbin "baserom.gba", 0x611230, 0x80 + +gUnknown_086112B0:: @ 86112B0 + .incbin "baserom.gba", 0x6112b0, 0x80 + +gUnknown_08611330:: @ 8611330 + .incbin "baserom.gba", 0x611330, 0x40 + +gUnknown_08611370:: @ 8611370 + .incbin "baserom.gba", 0x611370, 0x163 + +gUnknown_086114D3:: @ 86114D3 + .incbin "baserom.gba", 0x6114d3, 0xd + +gUnknown_086114E0:: @ 86114E0 + .incbin "baserom.gba", 0x6114e0, 0x68 + +gUnknown_08611548:: @ 8611548 + .incbin "baserom.gba", 0x611548, 0x8 + +gUnknown_08611550:: @ 8611550 + .incbin "baserom.gba", 0x611550, 0x1c + +gUnknown_0861156C:: @ 861156C + .incbin "baserom.gba", 0x61156c, 0xc + +gUnknown_08611578:: @ 8611578 + .incbin "baserom.gba", 0x611578, 0x33c + +gUnknown_086118B4:: @ 86118B4 + .incbin "baserom.gba", 0x6118b4, 0x348 + +gUnknown_08611BFC:: @ 8611BFC + .incbin "baserom.gba", 0x611bfc, 0x1c + +gUnknown_08611C18:: @ 8611C18 + .incbin "baserom.gba", 0x611c18, 0x5c + +gUnknown_08611C74:: @ 8611C74 + .incbin "baserom.gba", 0x611c74, 0x8 + +gUnknown_08611C7C:: @ 8611C7C + .incbin "baserom.gba", 0x611c7c, 0x8 + +gUnknown_08611C84:: @ 8611C84 + .incbin "baserom.gba", 0x611c84, 0x8 + +gUnknown_08611C8C:: @ 8611C8C + .incbin "baserom.gba", 0x611c8c, 0xe + +gUnknown_08611C9A:: @ 8611C9A + .incbin "baserom.gba", 0x611c9a, 0x16 + +gUnknown_08611CB0:: @ 8611CB0 + .incbin "baserom.gba", 0x611cb0, 0x50 + +gUnknown_08611D00:: @ 8611D00 + .incbin "baserom.gba", 0x611d00, 0x8 + +gUnknown_08611D08:: @ 8611D08 + .incbin "baserom.gba", 0x611d08, 0x28 + +gUnknown_08611D30:: @ 8611D30 + .incbin "baserom.gba", 0x611d30, 0x80 + +gUnknown_08611DB0:: @ 8611DB0 + .incbin "baserom.gba", 0x611db0, 0x8 + +gUnknown_08611DB8:: @ 8611DB8 + .incbin "baserom.gba", 0x611db8, 0x8 + +@ 8611DC0 + .include "data/battle_frontier/battle_arena_move_mind_ratings.inc" + + .align 2 +@ 8611F24 + .incbin "baserom.gba", 0x611f24, 0x38 + +gUnknown_08611F5C:: @ 8611F5C + .incbin "baserom.gba", 0x611f5c, 0x18 + +gUnknown_08611F74:: @ 8611F74 + .incbin "baserom.gba", 0x611f74, 0x10 + +gUnknown_08611F84:: @ 8611F84 + .incbin "baserom.gba", 0x611f84, 0x1c + +gUnknown_08611FA0:: @ 8611FA0 + .incbin "baserom.gba", 0x611fa0, 0xc + +gUnknown_08611FAC:: @ 8611FAC + .incbin "baserom.gba", 0x611fac, 0x14 + +@ 8611FC0 + .include "data/battle_frontier/battle_factory_style_move_lists.inc" + +gUnknown_08612120:: @ 8612120 + .incbin "baserom.gba", 0x612120, 0x44 + +gUnknown_08612164:: @ 8612164 + .incbin "baserom.gba", 0x612164, 0x10 + +gUnknown_08612174:: @ 8612174 + .incbin "baserom.gba", 0x612174, 0x10 + +gUnknown_08612184:: @ 8612184 + .incbin "baserom.gba", 0x612184, 0x10 + +gUnknown_08612194:: @ 8612194 + .incbin "baserom.gba", 0x612194, 0x180 + +gUnknown_08612314:: @ 8612314 + .incbin "baserom.gba", 0x612314, 0x8 + +gUnknown_0861231C:: @ 861231C + .incbin "baserom.gba", 0x61231c, 0xc8 + +gUnknown_086123E4:: @ 86123E4 + .incbin "baserom.gba", 0x6123e4, 0x1f8 + +gUnknown_086125DC:: @ 86125DC + .incbin "baserom.gba", 0x6125dc, 0x1c + +gUnknown_086125F8:: @ 86125F8 + .incbin "baserom.gba", 0x6125f8, 0x74 + +gUnknown_0861266C:: @ 861266C + .incbin "baserom.gba", 0x61266c, 0x9 + +gUnknown_08612675:: @ 8612675 + .incbin "baserom.gba", 0x612675, 0x13 + +gUnknown_08612688:: @ 8612688 + .incbin "baserom.gba", 0x612688, 0x8 + +gUnknown_08612690:: @ 8612690 + .incbin "baserom.gba", 0x612690, 0x8 + +gUnknown_08612698:: @ 8612698 + .incbin "baserom.gba", 0x612698, 0x4 + +gUnknown_0861269C:: @ 861269C + .incbin "baserom.gba", 0x61269c, 0x4 + +gUnknown_086126A0:: @ 86126A0 + .incbin "baserom.gba", 0x6126a0, 0x4 + +gUnknown_086126A4:: @ 86126A4 + .incbin "baserom.gba", 0x6126a4, 0x4 + +gUnknown_086126A8:: @ 86126A8 + .incbin "baserom.gba", 0x6126a8, 0x2 + +gUnknown_086126AA:: @ 86126AA + .incbin "baserom.gba", 0x6126aa, 0x2 + +gUnknown_086126AC:: @ 86126AC + .incbin "baserom.gba", 0x6126ac, 0x2 + +gUnknown_086126AE:: @ 86126AE + .incbin "baserom.gba", 0x6126ae, 0x2 + +@ 86126B0 + .include "data/battle_frontier/battle_pyramid_level_50_wild_mons.inc" + +@ 8612E80 + .include "data/battle_frontier/battle_pyramid_open_level_wild_mons.inc" + +gUnknown_08613650:: @ 8613650 + .incbin "baserom.gba", 0x613650, 0x5 + +gUnknown_08613655:: @ 8613655 + .incbin "baserom.gba", 0x613655, 0xfb + +gUnknown_08613750:: @ 8613750 + .incbin "baserom.gba", 0x613750, 0x44 + +gUnknown_08613794:: @ 8613794 + .incbin "baserom.gba", 0x613794, 0x8 + +gUnknown_0861379C:: @ 861379C + .incbin "baserom.gba", 0x61379c, 0x190 + +gUnknown_0861392C:: @ 861392C + .incbin "baserom.gba", 0x61392c, 0x190 + +gUnknown_08613ABC:: @ 8613ABC + .incbin "baserom.gba", 0x613abc, 0x7e + +gUnknown_08613B3A:: @ 8613B3A + .incbin "baserom.gba", 0x613b3a, 0xa + +gUnknown_08613B44:: @ 8613B44 + .incbin "baserom.gba", 0x613b44, 0xd8 + +gUnknown_08613C1C:: @ 8613C1C + .incbin "baserom.gba", 0x613c1c, 0x2a4 + +gUnknown_08613EC0:: @ 8613EC0 + .incbin "baserom.gba", 0x613ec0, 0x18 + +gUnknown_08613ED8:: @ 8613ED8 + .incbin "baserom.gba", 0x613ed8, 0x8 + +gUnknown_08613EE0:: @ 8613EE0 + .incbin "baserom.gba", 0x613ee0, 0x48 + +gUnknown_08613F28:: @ 8613F28 + .incbin "baserom.gba", 0x613f28, 0xc + +gUnknown_08613F34:: @ 8613F34 + .incbin "baserom.gba", 0x613f34, 0x12 + +gUnknown_08613F46:: @ 8613F46 + .incbin "baserom.gba", 0x613f46, 0x40 + +gUnknown_08613F86:: @ 8613F86 + .incbin "baserom.gba", 0x613f86, 0xa + +gUnknown_08613F90:: @ 8613F90 + .incbin "baserom.gba", 0x613f90, 0xc + +gUnknown_08613F9C:: @ 8613F9C + .incbin "baserom.gba", 0x613f9c, 0x18 + +gUnknown_08613FB4:: @ 8613FB4 + .incbin "baserom.gba", 0x613fb4, 0x78 + +gUnknown_0861402C:: @ 861402C + .incbin "baserom.gba", 0x61402c, 0x4 + +gUnknown_08614030:: @ 8614030 + .incbin "baserom.gba", 0x614030, 0x4 + +gUnknown_08614034:: @ 8614034 + .incbin "baserom.gba", 0x614034, 0x4 + +gUnknown_08614038:: @ 8614038 + .incbin "baserom.gba", 0x614038, 0x4 + +gUnknown_0861403C:: @ 861403C + .incbin "baserom.gba", 0x61403c, 0x6 + +gUnknown_08614042:: @ 8614042 + .incbin "baserom.gba", 0x614042, 0x2 + +gUnknown_08614044:: @ 8614044 + .incbin "baserom.gba", 0x614044, 0x2 + +gUnknown_08614046:: @ 8614046 + .incbin "baserom.gba", 0x614046, 0x1 + +gUnknown_08614047:: @ 8614047 + .incbin "baserom.gba", 0x614047, 0x4 + +gUnknown_0861404B:: @ 861404B + .incbin "baserom.gba", 0x61404b, 0x2 + +gUnknown_0861404D:: @ 861404D + .incbin "baserom.gba", 0x61404d, 0x2 + +gUnknown_0861404F:: @ 861404F + .incbin "baserom.gba", 0x61404f, 0x5 + +gUnknown_08614054:: @ 8614054 + .incbin "baserom.gba", 0x614054, 0x30 + +gUnknown_08614084:: @ 8614084 + .incbin "baserom.gba", 0x614084, 0x8 + +gUnknown_0861408C:: @ 861408C + .incbin "baserom.gba", 0x61408c, 0x8 + +gUnknown_08614094:: @ 8614094 + .incbin "baserom.gba", 0x614094, 0x10 + +gUnknown_086140A4:: @ 86140A4 + .incbin "baserom.gba", 0x6140a4, 0xc0 + +gUnknown_08614164:: @ 8614164 + .incbin "baserom.gba", 0x614164, 0x10 + +gUnknown_08614174:: @ 8614174 + .incbin "baserom.gba", 0x614174, 0x38 + +gUnknown_086141AC:: @ 86141AC + .incbin "baserom.gba", 0x6141ac, 0x50 + +gUnknown_086141FC:: @ 86141FC + .incbin "baserom.gba", 0x6141fc, 0x48 + +gUnknown_08614244:: @ 8614244 + .incbin "baserom.gba", 0x614244, 0x18 + +gUnknown_0861425C:: @ 861425C + .incbin "baserom.gba", 0x61425c, 0x4 + +gUnknown_08614260:: @ 8614260 + .incbin "baserom.gba", 0x614260, 0x4 + +gUnknown_08614264:: @ 8614264 + .incbin "baserom.gba", 0x614264, 0x4 + +gUnknown_08614268:: @ 8614268 + .incbin "baserom.gba", 0x614268, 0x4 + +gUnknown_0861426C:: @ 861426C + .incbin "baserom.gba", 0x61426c, 0x4 + +gUnknown_08614270:: @ 8614270 + .incbin "baserom.gba", 0x614270, 0x4 + +gUnknown_08614274:: @ 8614274 + .incbin "baserom.gba", 0x614274, 0x4 + +gUnknown_08614278:: @ 8614278 + .incbin "baserom.gba", 0x614278, 0x18 + +gUnknown_08614290:: @ 8614290 + .incbin "baserom.gba", 0x614290, 0x18 + +gUnknown_086142A8:: @ 86142A8 + .incbin "baserom.gba", 0x6142a8, 0x20 + +gUnknown_086142C8:: @ 86142C8 + .incbin "baserom.gba", 0x6142c8, 0x70 + +gUnknown_08614338:: @ 8614338 + .incbin "baserom.gba", 0x614338, 0x40 + +gUnknown_08614378:: @ 8614378 + .incbin "baserom.gba", 0x614378, 0x44 + +gUnknown_086143BC:: @ 86143BC + .incbin "baserom.gba", 0x6143bc, 0x4e + +gUnknown_0861440A:: @ 861440A + .incbin "baserom.gba", 0x61440a, 0x4 + +gUnknown_0861440E:: @ 861440E + .incbin "baserom.gba", 0x61440e, 0x2 + +@ 8614410 + .include "data/graphics/items/item_icon_table.inc" + +@ 8614FE0 + .incbin "baserom.gba", 0x614fe0, 0x14 + +gUnknown_08614FF4:: @ 8614FF4 + .incbin "baserom.gba", 0x614ff4, 0x18 + +gUnknown_0861500C:: @ 861500C + .incbin "baserom.gba", 0x61500c, 0x3c + +gUnknown_08615048:: @ 8615048 + .incbin "baserom.gba", 0x615048, 0x670 + +gUnknown_086156B8:: @ 86156B8 + .incbin "baserom.gba", 0x6156b8, 0x2c + +gUnknown_086156E4:: @ 86156E4 + .incbin "baserom.gba", 0x6156e4, 0x20 + +gUnknown_08615704:: @ 8615704 + .incbin "baserom.gba", 0x615704, 0xc0 + +gUnknown_086157C4:: @ 86157C4 + .incbin "baserom.gba", 0x6157c4, 0x1c + +gUnknown_086157E0:: @ 86157E0 + .incbin "baserom.gba", 0x6157e0, 0x1c + +gUnknown_086157FC:: @ 86157FC + .incbin "baserom.gba", 0x6157fc, 0x14 + +gUnknown_08615810:: @ 8615810 + .incbin "baserom.gba", 0x615810, 0x40 + +gUnknown_08615850:: @ 8615850 + .incbin "baserom.gba", 0x615850, 0x40 + +gUnknown_08615890:: @ 8615890 + .incbin "baserom.gba", 0x615890, 0x40 + +gUnknown_086158D0:: @ 86158D0 + .incbin "baserom.gba", 0x6158d0, 0x38 + +gUnknown_08615908:: @ 8615908 + .incbin "baserom.gba", 0x615908, 0x8 + +gUnknown_08615910:: @ 8615910 + .incbin "baserom.gba", 0x615910, 0x8 + +gUnknown_08615918:: @ 8615918 + .incbin "baserom.gba", 0x615918, 0x8 + +gUnknown_08615920:: @ 8615920 + .incbin "baserom.gba", 0x615920, 0x8 + +gUnknown_08615928:: @ 8615928 + .incbin "baserom.gba", 0x615928, 0x8 + +gUnknown_08615930:: @ 8615930 + .incbin "baserom.gba", 0x615930, 0x8 + +gUnknown_08615938:: @ 8615938 + .incbin "baserom.gba", 0x615938, 0x8 + +gUnknown_08615940:: @ 8615940 + .incbin "baserom.gba", 0x615940, 0x8 + +gUnknown_08615948:: @ 8615948 + .incbin "baserom.gba", 0x615948, 0x8 + +gUnknown_08615950:: @ 8615950 + .incbin "baserom.gba", 0x615950, 0x8 + +gUnknown_08615958:: @ 8615958 + .incbin "baserom.gba", 0x615958, 0x8 + +gUnknown_08615960:: @ 8615960 + .incbin "baserom.gba", 0x615960, 0x8 + +gUnknown_08615968:: @ 8615968 + .incbin "baserom.gba", 0x615968, 0x8 + +gUnknown_08615970:: @ 8615970 + .incbin "baserom.gba", 0x615970, 0x18 + +gUnknown_08615988:: @ 8615988 + .incbin "baserom.gba", 0x615988, 0x46 + +gUnknown_086159CE:: @ 86159CE + .incbin "baserom.gba", 0x6159ce, 0x46 + +gUnknown_08615A14:: @ 8615A14 + .incbin "baserom.gba", 0x615a14, 0x36 + +gUnknown_08615A4A:: @ 8615A4A + .incbin "baserom.gba", 0x615a4a, 0x36 + +gUnknown_08615A80:: @ 8615A80 + .incbin "baserom.gba", 0x615a80, 0x36 + +gUnknown_08615AB6:: @ 8615AB6 + .incbin "baserom.gba", 0x615ab6, 0x2 + +gUnknown_08615AB8:: @ 8615AB8 + .incbin "baserom.gba", 0x615ab8, 0x2 + +gUnknown_08615ABA:: @ 8615ABA + .incbin "baserom.gba", 0x615aba, 0x3 + +gUnknown_08615ABD:: @ 8615ABD + .incbin "baserom.gba", 0x615abd, 0x3 + +gUnknown_08615AC0:: @ 8615AC0 + .incbin "baserom.gba", 0x615ac0, 0x3 + +gUnknown_08615AC3:: @ 8615AC3 + .incbin "baserom.gba", 0x615ac3, 0x2 + +gUnknown_08615AC5:: @ 8615AC5 + .incbin "baserom.gba", 0x615ac5, 0x2 + +gUnknown_08615AC7:: @ 8615AC7 + .incbin "baserom.gba", 0x615ac7, 0x2 + +gUnknown_08615AC9:: @ 8615AC9 + .incbin "baserom.gba", 0x615ac9, 0x2 + +gUnknown_08615ACB:: @ 8615ACB + .incbin "baserom.gba", 0x615acb, 0x2 + +gUnknown_08615ACD:: @ 8615ACD + .incbin "baserom.gba", 0x615acd, 0x3 + +gUnknown_08615AD0:: @ 8615AD0 + .incbin "baserom.gba", 0x615ad0, 0x3 + +gUnknown_08615AD3:: @ 8615AD3 + .incbin "baserom.gba", 0x615ad3, 0x3 + +gUnknown_08615AD6:: @ 8615AD6 + .incbin "baserom.gba", 0x615ad6, 0x3 + +gUnknown_08615AD9:: @ 8615AD9 + .incbin "baserom.gba", 0x615ad9, 0x3 + +gUnknown_08615ADC:: @ 8615ADC + .incbin "baserom.gba", 0x615adc, 0x3 + +gUnknown_08615ADF:: @ 8615ADF + .incbin "baserom.gba", 0x615adf, 0x3 + +gUnknown_08615AE2:: @ 8615AE2 + .incbin "baserom.gba", 0x615ae2, 0x3 + +gUnknown_08615AE5:: @ 8615AE5 + .incbin "baserom.gba", 0x615ae5, 0x3 + +gUnknown_08615AE8:: @ 8615AE8 + .incbin "baserom.gba", 0x615ae8, 0x3 + +gUnknown_08615AEB:: @ 8615AEB + .incbin "baserom.gba", 0x615aeb, 0x3 + +gUnknown_08615AEE:: @ 8615AEE + .incbin "baserom.gba", 0x615aee, 0x3 + +gUnknown_08615AF1:: @ 8615AF1 + .incbin "baserom.gba", 0x615af1, 0x3 + +gUnknown_08615AF4:: @ 8615AF4 + .incbin "baserom.gba", 0x615af4, 0x6c + +gUnknown_08615B60:: @ 8615B60 + .incbin "baserom.gba", 0x615b60, 0xa8 + +gUnknown_08615C08:: @ 8615C08 + .incbin "baserom.gba", 0x615c08, 0x130 + +gUnknown_08615D38:: @ 8615D38 + .incbin "baserom.gba", 0x615d38, 0x38 + +gUnknown_08615D70:: @ 8615D70 + .incbin "baserom.gba", 0x615d70, 0xe + +gUnknown_08615D7E:: @ 8615D7E + .incbin "baserom.gba", 0x615d7e, 0x1e + +gUnknown_08615D9C:: @ 8615D9C + .incbin "baserom.gba", 0x615d9c, 0x70 + +gUnknown_08615E0C:: @ 8615E0C + .incbin "baserom.gba", 0x615e0c, 0xa4 + +gUnknown_08615EB0:: @ 8615EB0 + .incbin "baserom.gba", 0x615eb0, 0x8 + +gUnknown_08615EB8:: @ 8615EB8 + .incbin "baserom.gba", 0x615eb8, 0x8 + +gUnknown_08615EC0:: @ 8615EC0 + .incbin "baserom.gba", 0x615ec0, 0x38 + +gUnknown_08615EF8:: @ 8615EF8 + .incbin "baserom.gba", 0x615ef8, 0x8 + +gUnknown_08615F00:: @ 8615F00 + .incbin "baserom.gba", 0x615f00, 0x8 + +gUnknown_08615F08:: @ 8615F08 + .incbin "baserom.gba", 0x615f08, 0x68 + +gUnknown_08615F70:: @ 8615F70 + .incbin "baserom.gba", 0x615f70, 0x8 + +gUnknown_08615F78:: @ 8615F78 + .incbin "baserom.gba", 0x615f78, 0x80 + +gUnknown_08615FF8:: @ 8615FF8 + .incbin "baserom.gba", 0x615ff8, 0x8 + +gUnknown_08616000:: @ 8616000 + .incbin "baserom.gba", 0x616000, 0x8 + +gUnknown_08616008:: @ 8616008 + .incbin "baserom.gba", 0x616008, 0x18 + +gUnknown_08616020:: @ 8616020 + .incbin "baserom.gba", 0x616020, 0x20 + +gUnknown_08616040:: @ 8616040 + .incbin "baserom.gba", 0x616040, 0x74 + +gUnknown_086160B4:: @ 86160B4 + .incbin "baserom.gba", 0x6160b4, 0x20 + +gUnknown_086160D4:: @ 86160D4 + .incbin "baserom.gba", 0x6160d4, 0x4 + +gUnknown_086160D8:: @ 86160D8 + .incbin "baserom.gba", 0x6160d8, 0x1c + +gUnknown_086160F4:: @ 86160F4 + .incbin "baserom.gba", 0x6160f4, 0x4 + +gUnknown_086160F8:: @ 86160F8 + .incbin "baserom.gba", 0x6160f8, 0x28 + +gUnknown_08616120:: @ 8616120 + .incbin "baserom.gba", 0x616120, 0x4 + +gUnknown_08616124:: @ 8616124 + .incbin "baserom.gba", 0x616124, 0x4 + + .align 2 +gFont6BrailleGlyphs:: @ 8616128 + .incbin "data/graphics/fonts/font6.fwjpnfont" + +gUnknown_08617128:: @ 8617128 + .incbin "baserom.gba", 0x617128, 0x48 + +gUnknown_08617170:: @ 8617170 + .incbin "baserom.gba", 0x617170, 0x104 + +gUnknown_08617274:: @ 8617274 + .incbin "baserom.gba", 0x617274, 0x920 + +gUnknown_08617B94:: @ 8617B94 + .incbin "baserom.gba", 0x617b94, 0xb0 + +gUnknown_08617C44:: @ 8617C44 + .incbin "baserom.gba", 0x617c44, 0x120 + +gUnknown_08617D64:: @ 8617D64 + .incbin "baserom.gba", 0x617d64, 0x30 + +gUnknown_08617D94:: @ 8617D94 + .incbin "baserom.gba", 0x617d94, 0x10 + +gUnknown_08617DA4:: @ 8617DA4 + .incbin "baserom.gba", 0x617da4, 0x5c + +gUnknown_08617E00:: @ 8617E00 + .incbin "baserom.gba", 0x617e00, 0x18 + +gUnknown_08617E18:: @ 8617E18 + .incbin "baserom.gba", 0x617e18, 0x1c + +gUnknown_08617E34:: @ 8617E34 + .incbin "baserom.gba", 0x617e34, 0x2c + +gUnknown_08617E60:: @ 8617E60 + .incbin "baserom.gba", 0x617e60, 0x18 + +gUnknown_08617E78:: @ 8617E78 + .incbin "baserom.gba", 0x617e78, 0x15 + +gUnknown_08617E8D:: @ 8617E8D + .incbin "baserom.gba", 0x617e8d, 0xe + +gUnknown_08617E9B:: @ 8617E9B + .incbin "baserom.gba", 0x617e9b, 0x26d + +gUnknown_08618108:: @ 8618108 + .incbin "baserom.gba", 0x618108, 0x8 + +gUnknown_08618110:: @ 8618110 + .incbin "baserom.gba", 0x618110, 0x28 + +gUnknown_08618138:: @ 8618138 + .incbin "baserom.gba", 0x618138, 0x20 + +gUnknown_08618158:: @ 8618158 + .incbin "baserom.gba", 0x618158, 0x3 + +gUnknown_0861815B:: @ 861815B + .incbin "baserom.gba", 0x61815b, 0x5 + +gUnknown_08618160:: @ 8618160 + .incbin "baserom.gba", 0x618160, 0x18 + +gUnknown_08618178:: @ 8618178 + .incbin "baserom.gba", 0x618178, 0x49 + +@ 86181C1 + .include "data/text/move_descriptions.inc" + +@ 861CAAC + .include "data/text/nature_names.inc" + +gUnknown_0861CBB4:: @ 861CBB4 + .incbin "baserom.gba", 0x61cbb4, 0x38 + +gUnknown_0861CBEC:: @ 861CBEC + .incbin "baserom.gba", 0x61cbec, 0xc + +gUnknown_0861CBF8:: @ 861CBF8 + .incbin "baserom.gba", 0x61cbf8, 0xc + +gUnknown_0861CC04:: @ 861CC04 + .incbin "baserom.gba", 0x61cc04, 0xc + +gUnknown_0861CC10:: @ 861CC10 + .incbin "baserom.gba", 0x61cc10, 0xc + +gUnknown_0861CC1C:: @ 861CC1C + .incbin "baserom.gba", 0x61cc1c, 0x8 + +gUnknown_0861CC24:: @ 861CC24 + .incbin "baserom.gba", 0x61cc24, 0xa8 + +gUnknown_0861CCCC:: @ 861CCCC + .incbin "baserom.gba", 0x61cccc, 0x20 + +gUnknown_0861CCEC:: @ 861CCEC + .incbin "baserom.gba", 0x61ccec, 0x28 + +gUnknown_0861CD14:: @ 861CD14 + .incbin "baserom.gba", 0x61cd14, 0x18 + +gUnknown_0861CD2C:: @ 861CD2C + .incbin "baserom.gba", 0x61cd2c, 0xa7 + +gUnknown_0861CDD3:: @ 861CDD3 + .incbin "baserom.gba", 0x61cdd3, 0x81 + +gUnknown_0861CE54:: @ 861CE54 + .incbin "baserom.gba", 0x61ce54, 0x10 + +gUnknown_0861CE64:: @ 861CE64 + .incbin "baserom.gba", 0x61ce64, 0x10 + +gUnknown_0861CE74:: @ 861CE74 + .incbin "baserom.gba", 0x61ce74, 0x7 + +gUnknown_0861CE7B:: @ 861CE7B + .incbin "baserom.gba", 0x61ce7b, 0x7 + +gUnknown_0861CE82:: @ 861CE82 + .incbin "baserom.gba", 0x61ce82, 0xc + +gUnknown_0861CE8E:: @ 861CE8E + .incbin "baserom.gba", 0x61ce8e, 0x9 + +gUnknown_0861CE97:: @ 861CE97 + .incbin "baserom.gba", 0x61ce97, 0x125 + +gUnknown_0861CFBC:: @ 861CFBC + .incbin "baserom.gba", 0x61cfbc, 0x8 + +gUnknown_0861CFC4:: @ 861CFC4 + .incbin "baserom.gba", 0x61cfc4, 0x18 + +gUnknown_0861CFDC:: @ 861CFDC + .incbin "baserom.gba", 0x61cfdc, 0x98 + +gUnknown_0861D074:: @ 861D074 + .incbin "baserom.gba", 0x61d074, 0x8 + +gUnknown_0861D07C:: @ 861D07C + .incbin "baserom.gba", 0x61d07c, 0x8 + +gUnknown_0861D084:: @ 861D084 + .incbin "baserom.gba", 0x61d084, 0x74 + +gUnknown_0861D0F8:: @ 861D0F8 + .incbin "baserom.gba", 0x61d0f8, 0x8 + +gUnknown_0861D100:: @ 861D100 + .incbin "baserom.gba", 0x61d100, 0x8 + +gUnknown_0861D108:: @ 861D108 + .incbin "baserom.gba", 0x61d108, 0x18 + +gUnknown_0861D120:: @ 861D120 + .incbin "baserom.gba", 0x61d120, 0x20 + +gUnknown_0861D140:: @ 861D140 + .incbin "baserom.gba", 0x61d140, 0x60 + +gUnknown_0861D1A0:: @ 861D1A0 + .incbin "baserom.gba", 0x61d1a0, 0xd54 + +gUnknown_0861DEF4:: @ 861DEF4 + .incbin "baserom.gba", 0x61def4, 0x314 + +gUnknown_0861E208:: @ 861E208 + .incbin "baserom.gba", 0x61e208, 0xd5c + +gUnknown_0861EF64:: @ 861EF64 + .incbin "baserom.gba", 0x61ef64, 0x350 + +gUnknown_0861F2B4:: @ 861F2B4 + .incbin "baserom.gba", 0x61f2b4, 0xc + +gUnknown_0861F2C0:: @ 861F2C0 + .incbin "baserom.gba", 0x61f2c0, 0x18 + +gUnknown_0861F2D8:: @ 861F2D8 + .incbin "baserom.gba", 0x61f2d8, 0x30 + +gUnknown_0861F308:: @ 861F308 + .incbin "baserom.gba", 0x61f308, 0x4 + +gUnknown_0861F30C:: @ 861F30C + .incbin "baserom.gba", 0x61f30c, 0x2 + +gUnknown_0861F30E:: @ 861F30E + .incbin "baserom.gba", 0x61f30e, 0x2 + +gUnknown_0861F310:: @ 861F310 + .incbin "baserom.gba", 0x61f310, 0x4 + +gUnknown_0861F314:: @ 861F314 + .incbin "baserom.gba", 0x61f314, 0x8 + +gUnknown_0861F31C:: @ 861F31C + .incbin "baserom.gba", 0x61f31c, 0xc + +gUnknown_0861F328:: @ 861F328 + .incbin "baserom.gba", 0x61f328, 0x28 + +gUnknown_0861F350:: @ 861F350 + .incbin "baserom.gba", 0x61f350, 0x20 + +gUnknown_0861F370:: @ 861F370 + .incbin "baserom.gba", 0x61f370, 0x5c + +gUnknown_0861F3CC:: @ 861F3CC + .incbin "baserom.gba", 0x61f3cc, 0x8 + +gUnknown_0861F3D4:: @ 861F3D4 + .incbin "baserom.gba", 0x61f3d4, 0x18 + +gUnknown_0861F3EC:: @ 861F3EC + .incbin "baserom.gba", 0x61f3ec, 0x618 + +gUnknown_0861FA04:: @ 861FA04 + .incbin "baserom.gba", 0x61fa04, 0x4 + +gUnknown_0861FA08:: @ 861FA08 + .incbin "baserom.gba", 0x61fa08, 0x10 + +gUnknown_0861FA18:: @ 861FA18 + .incbin "baserom.gba", 0x61fa18, 0x30 + +gUnknown_0861FA48:: @ 861FA48 + .incbin "baserom.gba", 0x61fa48, 0x4 + +gUnknown_0861FA4C:: @ 861FA4C + .incbin "baserom.gba", 0x61fa4c, 0x8 + +gUnknown_0861FA54:: @ 861FA54 + .incbin "baserom.gba", 0x61fa54, 0x10 + +gUnknown_0861FA64:: @ 861FA64 + .incbin "baserom.gba", 0x61fa64, 0x8 + +gUnknown_0861FA6C:: @ 861FA6C + .incbin "baserom.gba", 0x61fa6c, 0x30 + +gUnknown_0861FA9C:: @ 861FA9C + .incbin "baserom.gba", 0x61fa9c, 0x68 + +gUnknown_0861FB04:: @ 861FB04 + .incbin "baserom.gba", 0x61fb04, 0x28 + +gUnknown_0861FB2C:: @ 861FB2C + .incbin "baserom.gba", 0x61fb2c, 0x18 + +gUnknown_0861FB44:: @ 861FB44 + .incbin "baserom.gba", 0x61fb44, 0xa0 + +gUnknown_0861FBE4:: @ 861FBE4 + .incbin "baserom.gba", 0x61fbe4, 0x4 + +gUnknown_0861FBE8:: @ 861FBE8 + .incbin "baserom.gba", 0x61fbe8, 0xc + +gUnknown_0861FBF4:: @ 861FBF4 + .incbin "baserom.gba", 0x61fbf4, 0x3 + +gUnknown_0861FBF7:: @ 861FBF7 + .incbin "baserom.gba", 0x61fbf7, 0x5 + +gUnknown_0861FBFC:: @ 861FBFC + .incbin "baserom.gba", 0x61fbfc, 0x8 + +gUnknown_0861FC04:: @ 861FC04 + .incbin "baserom.gba", 0x61fc04, 0x18 + +gUnknown_0861FC1C:: @ 861FC1C + .incbin "baserom.gba", 0x61fc1c, 0x20 + +gUnknown_0861FC3C:: @ 861FC3C + .incbin "baserom.gba", 0x61fc3c, 0x18 + +gUnknown_0861FC54:: @ 861FC54 + .incbin "baserom.gba", 0x61fc54, 0x5 + +gUnknown_0861FC59:: @ 861FC59 + .incbin "baserom.gba", 0x61fc59, 0x1f + +gUnknown_0861FC78:: @ 861FC78 + .incbin "baserom.gba", 0x61fc78, 0x2 + +gUnknown_0861FC7A:: @ 861FC7A + .incbin "baserom.gba", 0x61fc7a, 0xc + +gUnknown_0861FC86:: @ 861FC86 + .incbin "baserom.gba", 0x61fc86, 0x12 + +gUnknown_0861FC98:: @ 861FC98 + .incbin "baserom.gba", 0x61fc98, 0x14 + +gUnknown_0861FCAC:: @ 861FCAC + .incbin "baserom.gba", 0x61fcac, 0xa0 + +gUnknown_0861FD4C:: @ 861FD4C + .incbin "baserom.gba", 0x61fd4c, 0x20 + +gUnknown_0861FD6C:: @ 861FD6C + .incbin "baserom.gba", 0x61fd6c, 0x288 + +gUnknown_0861FFF4:: @ 861FFF4 + .incbin "baserom.gba", 0x61fff4, 0x1a0 + +gUnknown_08620194:: @ 8620194 + .incbin "baserom.gba", 0x620194, 0xc + +gUnknown_086201A0:: @ 86201A0 + .incbin "baserom.gba", 0x6201a0, 0x24 + +gUnknown_086201C4:: @ 86201C4 + .incbin "baserom.gba", 0x6201c4, 0x10 + +gUnknown_086201D4:: @ 86201D4 + .incbin "baserom.gba", 0x6201d4, 0x6c + +gUnknown_08620240:: @ 8620240 + .incbin "baserom.gba", 0x620240, 0x4 + +gUnknown_08620244:: @ 8620244 + .incbin "baserom.gba", 0x620244, 0x88 + +gUnknown_086202CC:: @ 86202CC + .incbin "baserom.gba", 0x6202cc, 0x8 + +gUnknown_086202D4:: @ 86202D4 + .incbin "baserom.gba", 0x6202d4, 0x38 + +gUnknown_0862030C:: @ 862030C + .incbin "baserom.gba", 0x62030c, 0x3 + +gUnknown_0862030F:: @ 862030F + .incbin "baserom.gba", 0x62030f, 0x3d + +gUnknown_0862034C:: @ 862034C + .incbin "baserom.gba", 0x62034c, 0x20 + +gUnknown_0862036C:: @ 862036C + .incbin "baserom.gba", 0x62036c, 0x18 + +gUnknown_08620384:: @ 8620384 + .incbin "baserom.gba", 0x620384, 0x1ca4 + +gUnknown_08622028:: @ 8622028 + .incbin "baserom.gba", 0x622028, 0x4e0 + +gUnknown_08622508:: @ 8622508 + .incbin "baserom.gba", 0x622508, 0x2 + +gUnknown_0862250A:: @ 862250A + .incbin "baserom.gba", 0x62250a, 0x6 + +gUnknown_08622510:: @ 8622510 + .incbin "baserom.gba", 0x622510, 0x20 + +gUnknown_08622530:: @ 8622530 + .incbin "baserom.gba", 0x622530, 0xa4 + +gUnknown_086225D4:: @ 86225D4 + .incbin "baserom.gba", 0x6225d4, 0x10c + +gUnknown_086226E0:: @ 86226E0 + .incbin "baserom.gba", 0x6226e0, 0x20 + +gUnknown_08622700:: @ 8622700 + .incbin "baserom.gba", 0x622700, 0x20 + +gUnknown_08622720:: @ 8622720 + .incbin "baserom.gba", 0x622720, 0x40 + +gUnknown_08622760:: @ 8622760 + .incbin "baserom.gba", 0x622760, 0x2c + +gUnknown_0862278C:: @ 862278C + .incbin "baserom.gba", 0x62278c, 0x8 + +gUnknown_08622794:: @ 8622794 + .incbin "baserom.gba", 0x622794, 0x4 + +gUnknown_08622798:: @ 8622798 + .incbin "baserom.gba", 0x622798, 0x40 + +gUnknown_086227D8:: @ 86227D8 + .incbin "baserom.gba", 0x6227d8, 0x8 + +gUnknown_086227E0:: @ 86227E0 + .incbin "baserom.gba", 0x6227e0, 0x8 + +gUnknown_086227E8:: @ 86227E8 + .incbin "baserom.gba", 0x6227e8, 0xc + +gUnknown_086227F4:: @ 86227F4 + .incbin "baserom.gba", 0x6227f4, 0x14 + +gUnknown_08622808:: @ 8622808 + .incbin "baserom.gba", 0x622808, 0x8 + +gUnknown_08622810:: @ 8622810 + .incbin "baserom.gba", 0x622810, 0x8 + +gUnknown_08622818:: @ 8622818 + .incbin "baserom.gba", 0x622818, 0x18 + +gUnknown_08622830:: @ 8622830 + .incbin "baserom.gba", 0x622830, 0x20 + +gUnknown_08622850:: @ 8622850 + .incbin "baserom.gba", 0x622850, 0x18 + +gUnknown_08622868:: @ 8622868 + .incbin "baserom.gba", 0x622868, 0x20 + +gUnknown_08622888:: @ 8622888 + .incbin "baserom.gba", 0x622888, 0x850 + +gUnknown_086230D8:: @ 86230D8 + .incbin "baserom.gba", 0x6230d8, 0xc + +gUnknown_086230E4:: @ 86230E4 + .incbin "baserom.gba", 0x6230e4, 0x14 + +gUnknown_086230F8:: @ 86230F8 + .incbin "baserom.gba", 0x6230f8, 0x8 + +gUnknown_08623100:: @ 8623100 + .incbin "baserom.gba", 0x623100, 0x10 + +gUnknown_08623110:: @ 8623110 + .incbin "baserom.gba", 0x623110, 0x8 + +gUnknown_08623118:: @ 8623118 + .incbin "baserom.gba", 0x623118, 0xb8 + +gUnknown_086231D0:: @ 86231D0 + .incbin "baserom.gba", 0x6231d0, 0x18 + +gUnknown_086231E8:: @ 86231E8 + .incbin "baserom.gba", 0x6231e8, 0x20 + +gUnknown_08623208:: @ 8623208 + .incbin "baserom.gba", 0x623208, 0x20 + +gUnknown_08623228:: @ 8623228 + .incbin "baserom.gba", 0x623228, 0x14 + +gUnknown_0862323C:: @ 862323C + .incbin "baserom.gba", 0x62323c, 0xfc + +gUnknown_08623338:: @ 8623338 + .incbin "baserom.gba", 0x623338, 0x20 + +gUnknown_08623358:: @ 8623358 + .incbin "baserom.gba", 0x623358, 0xc + +gUnknown_08623364:: @ 8623364 + .incbin "baserom.gba", 0x623364, 0x8 + +gUnknown_0862336C:: @ 862336C + .incbin "baserom.gba", 0x62336c, 0x8 + +gUnknown_08623374:: @ 8623374 + .incbin "baserom.gba", 0x623374, 0x8 + +gUnknown_0862337C:: @ 862337C + .incbin "baserom.gba", 0x62337c, 0x8 + +gUnknown_08623384:: @ 8623384 + .incbin "baserom.gba", 0x623384, 0x1c + +gUnknown_086233A0:: @ 86233A0 + .incbin "baserom.gba", 0x6233a0, 0x14 + +gUnknown_086233B4:: @ 86233B4 + .incbin "baserom.gba", 0x6233b4, 0x10 + +gUnknown_086233C4:: @ 86233C4 + .incbin "baserom.gba", 0x6233c4, 0x20 + +gUnknown_086233E4:: @ 86233E4 + .incbin "baserom.gba", 0x6233e4, 0xc8 + +gUnknown_086234AC:: @ 86234AC + .incbin "baserom.gba", 0x6234ac, 0xc4 + +gUnknown_08623570:: @ 8623570 + .incbin "baserom.gba", 0x623570, 0x20 + +gUnknown_08623590:: @ 8623590 + .incbin "baserom.gba", 0x623590, 0x4 + +gUnknown_08623594:: @ 8623594 + .incbin "baserom.gba", 0x623594, 0x4 + +gUnknown_08623598:: @ 8623598 + .incbin "baserom.gba", 0x623598, 0x1c + +gUnknown_086235B4:: @ 86235B4 + .incbin "baserom.gba", 0x6235b4, 0x8 + +gUnknown_086235BC:: @ 86235BC + .incbin "baserom.gba", 0x6235bc, 0xc + +gUnknown_086235C8:: @ 86235C8 + .incbin "baserom.gba", 0x6235c8, 0xc + +gUnknown_086235D4:: @ 86235D4 + .incbin "baserom.gba", 0x6235d4, 0x4 + +gUnknown_086235D8:: @ 86235D8 + .incbin "baserom.gba", 0x6235d8, 0xc + +gUnknown_086235E4:: @ 86235E4 + .incbin "baserom.gba", 0x6235e4, 0x20 + +gUnknown_08623604:: @ 8623604 + .incbin "baserom.gba", 0x623604, 0xc8 + +gUnknown_086236CC:: @ 86236CC + .incbin "baserom.gba", 0x6236cc, 0xc4 + +gUnknown_08623790:: @ 8623790 + .incbin "baserom.gba", 0x623790, 0x20 + +gUnknown_086237B0:: @ 86237B0 + .incbin "baserom.gba", 0x6237b0, 0x4 + +gUnknown_086237B4:: @ 86237B4 + .incbin "baserom.gba", 0x6237b4, 0x4 + +gUnknown_086237B8:: @ 86237B8 + .incbin "baserom.gba", 0x6237b8, 0x1c + +gUnknown_086237D4:: @ 86237D4 + .incbin "baserom.gba", 0x6237d4, 0x8 + +gUnknown_086237DC:: @ 86237DC + .incbin "baserom.gba", 0x6237dc, 0xc + +gUnknown_086237E8:: @ 86237E8 + .incbin "baserom.gba", 0x6237e8, 0xc + +gUnknown_086237F4:: @ 86237F4 + .incbin "baserom.gba", 0x6237f4, 0x4 + +gUnknown_086237F8:: @ 86237F8 + .incbin "baserom.gba", 0x6237f8, 0x44 + +@ 862383C + .include "data/text/ribbon_descriptions.inc" + +@ 8623A74 + .include "data/text/gift_ribbon_descriptions.inc" + +gUnknown_08623FF8:: @ 8623FF8 + .incbin "baserom.gba", 0x623ff8, 0xa0 + +gUnknown_08624098:: @ 8624098 + .incbin "baserom.gba", 0x624098, 0x20 + +gUnknown_086240B8:: @ 86240B8 + .incbin "baserom.gba", 0x6240b8, 0xae0 + +gUnknown_08624B98:: @ 8624B98 + .incbin "baserom.gba", 0x624b98, 0x8 + +gUnknown_08624BA0:: @ 8624BA0 + .incbin "baserom.gba", 0x624ba0, 0x18 + +gUnknown_08624BB8:: @ 8624BB8 + .incbin "baserom.gba", 0x624bb8, 0x8 + +gUnknown_08624BC0:: @ 8624BC0 + .incbin "baserom.gba", 0x624bc0, 0x4 + +gUnknown_08624BC4:: @ 8624BC4 + .incbin "baserom.gba", 0x624bc4, 0x8 + +gUnknown_08624BCC:: @ 8624BCC + .incbin "baserom.gba", 0x624bcc, 0xc + +gUnknown_08624BD8:: @ 8624BD8 + .incbin "baserom.gba", 0x624bd8, 0xc + +gUnknown_08624BE4:: @ 8624BE4 + .incbin "baserom.gba", 0x624be4, 0x4 + +gUnknown_08624BE8:: @ 8624BE8 + .incbin "baserom.gba", 0x624be8, 0x10 + +gUnknown_08624BF8:: @ 8624BF8 + .incbin "baserom.gba", 0x624bf8, 0x80 + +gUnknown_08624C78:: @ 8624C78 + .incbin "baserom.gba", 0x624c78, 0x8 + +gUnknown_08624C80:: @ 8624C80 + .incbin "baserom.gba", 0x624c80, 0x84 + +gUnknown_08624D04:: @ 8624D04 + .incbin "baserom.gba", 0x624d04, 0x5a4 + +gUnknown_086252A8:: @ 86252A8 + .incbin "baserom.gba", 0x6252a8, 0x54 + +gUnknown_086252FC:: @ 86252FC + .incbin "baserom.gba", 0x6252fc, 0x14 + +gUnknown_08625310:: @ 8625310 + .incbin "baserom.gba", 0x625310, 0x14 + +gUnknown_08625324:: @ 8625324 + .incbin "baserom.gba", 0x625324, 0x14 + +gUnknown_08625338:: @ 8625338 + .incbin "baserom.gba", 0x625338, 0x14 + +gUnknown_0862534C:: @ 862534C + .incbin "baserom.gba", 0x62534c, 0x14 + +gUnknown_08625360:: @ 8625360 + .incbin "baserom.gba", 0x625360, 0x14 + +gUnknown_08625374:: @ 8625374 + .incbin "baserom.gba", 0x625374, 0x14 + +gUnknown_08625388:: @ 8625388 + .incbin "baserom.gba", 0x625388, 0x60 + +gUnknown_086253E8:: @ 86253E8 + .incbin "baserom.gba", 0x6253e8, 0x18 + +gUnknown_08625400:: @ 8625400 + .incbin "baserom.gba", 0x625400, 0x3 + +gUnknown_08625403:: @ 8625403 + .incbin "baserom.gba", 0x625403, 0x1 + +gUnknown_08625404:: @ 8625404 + .incbin "baserom.gba", 0x625404, 0xc + +gUnknown_08625410:: @ 8625410 + .incbin "baserom.gba", 0x625410, 0x100 + +gUnknown_08625510:: @ 8625510 + .incbin "baserom.gba", 0x625510, 0x30 + +gUnknown_08625540:: @ 8625540 + .incbin "baserom.gba", 0x625540, 0x8 + +gUnknown_08625548:: @ 8625548 + .incbin "baserom.gba", 0x625548, 0x500 + +gUnknown_08625A48:: @ 8625A48 + .incbin "baserom.gba", 0x625a48, 0x8 + +gUnknown_08625A50:: @ 8625A50 + .incbin "baserom.gba", 0x625a50, 0x18 + +gUnknown_08625A68:: @ 8625A68 + .incbin "baserom.gba", 0x625a68, 0x8 + +gUnknown_08625A70:: @ 8625A70 + .incbin "baserom.gba", 0x625a70, 0x20 + +gUnknown_08625A90:: @ 8625A90 + .incbin "baserom.gba", 0x625a90, 0x18 + +gUnknown_08625AA8:: @ 8625AA8 + .incbin "baserom.gba", 0x625aa8, 0x18 + +gUnknown_08625AC0:: @ 8625AC0 + .incbin "baserom.gba", 0x625ac0, 0x8 + +gUnknown_08625AC8:: @ 8625AC8 + .incbin "baserom.gba", 0x625ac8, 0x4c + +gUnknown_08625B14:: @ 8625B14 + .incbin "baserom.gba", 0x625b14, 0x18 + +gUnknown_08625B2C:: @ 8625B2C + .incbin "baserom.gba", 0x625b2c, 0x28 + +gUnknown_08625B54:: @ 8625B54 + .incbin "baserom.gba", 0x625b54, 0x18 + +gUnknown_08625B6C:: @ 8625B6C + .incbin "baserom.gba", 0x625b6c, 0x520 + +gUnknown_0862608C:: @ 862608C + .incbin "baserom.gba", 0x62608c, 0x2 + +gUnknown_0862608E:: @ 862608E + .incbin "baserom.gba", 0x62608e, 0x4326 + +gUnknown_0862A3B4:: @ 862A3B4 + .incbin "baserom.gba", 0x62a3b4, 0x218 + +gUnknown_0862A5CC:: @ 862A5CC + .incbin "baserom.gba", 0x62a5cc, 0x8 + +gUnknown_0862A5D4:: @ 862A5D4 + .incbin "baserom.gba", 0x62a5d4, 0x20 + +gUnknown_0862A5F4:: @ 862A5F4 + .incbin "baserom.gba", 0x62a5f4, 0x4 + +gUnknown_0862A5F8:: @ 862A5F8 + .incbin "baserom.gba", 0x62a5f8, 0x20 + +gUnknown_0862A618:: @ 862A618 + .incbin "baserom.gba", 0x62a618, 0x48 + +gUnknown_0862A660:: @ 862A660 + .incbin "baserom.gba", 0x62a660, 0x10 + +gUnknown_0862A670:: @ 862A670 + .incbin "baserom.gba", 0x62a670, 0x18 + +gUnknown_0862A688:: @ 862A688 + .incbin "baserom.gba", 0x62a688, 0x10 + +gUnknown_0862A698:: @ 862A698 + .incbin "baserom.gba", 0x62a698, 0x8 + +gUnknown_0862A6A0:: @ 862A6A0 + .incbin "baserom.gba", 0x62a6a0, 0x8c + +gUnknown_0862A72C:: @ 862A72C + .incbin "baserom.gba", 0x62a72c, 0x24 + +gUnknown_0862A750:: @ 862A750 + .incbin "baserom.gba", 0x62a750, 0x24 + +gUnknown_0862A774:: @ 862A774 + .incbin "baserom.gba", 0x62a774, 0xa8 + +gUnknown_0862A81C:: @ 862A81C + .incbin "baserom.gba", 0x62a81c, 0x30 + +gUnknown_0862A84C:: @ 862A84C + .incbin "baserom.gba", 0x62a84c, 0x18 + +gUnknown_0862A864:: @ 862A864 + .incbin "baserom.gba", 0x62a864, 0x18 + +gUnknown_0862A87C:: @ 862A87C + .incbin "baserom.gba", 0x62a87c, 0xc + +gUnknown_0862A888:: @ 862A888 + .incbin "baserom.gba", 0x62a888, 0x3c + +gUnknown_0862A8C4:: @ 862A8C4 + .incbin "baserom.gba", 0x62a8c4, 0x8 + +gUnknown_0862A8CC:: @ 862A8CC + .incbin "baserom.gba", 0x62a8cc, 0x8 + +gUnknown_0862A8D4:: @ 862A8D4 + .incbin "baserom.gba", 0x62a8d4, 0x24 + +gUnknown_0862A8F8:: @ 862A8F8 + .incbin "baserom.gba", 0x62a8f8, 0x8 + +gUnknown_0862A900:: @ 862A900 + .incbin "baserom.gba", 0x62a900, 0x24 + +gUnknown_0862A924:: @ 862A924 + .incbin "baserom.gba", 0x62a924, 0x8 + +gUnknown_0862A92C:: @ 862A92C + .incbin "baserom.gba", 0x62a92c, 0xa8 + +gUnknown_0862A9D4:: @ 862A9D4 + .incbin "baserom.gba", 0x62a9d4, 0x8 + +gUnknown_0862A9DC:: @ 862A9DC + .incbin "baserom.gba", 0x62a9dc, 0x8 + +gUnknown_0862A9E4:: @ 862A9E4 + .incbin "baserom.gba", 0x62a9e4, 0x30 + +gUnknown_0862AA14:: @ 862AA14 + .incbin "baserom.gba", 0x62aa14, 0x8 + +gUnknown_0862AA1C:: @ 862AA1C + .incbin "baserom.gba", 0x62aa1c, 0x18 + +gUnknown_0862AA34:: @ 862AA34 + .incbin "baserom.gba", 0x62aa34, 0x8 + +gUnknown_0862AA3C:: @ 862AA3C + .incbin "baserom.gba", 0x62aa3c, 0x18 + +gUnknown_0862AA54:: @ 862AA54 + .incbin "baserom.gba", 0x62aa54, 0x3c + +gUnknown_0862AA90:: @ 862AA90 + .incbin "baserom.gba", 0x62aa90, 0x8 + +gUnknown_0862AA98:: @ 862AA98 + .incbin "baserom.gba", 0x62aa98, 0x8 + +gUnknown_0862AAA0:: @ 862AAA0 + .incbin "baserom.gba", 0x62aaa0, 0x18 + +gUnknown_0862AAB8:: @ 862AAB8 + .incbin "baserom.gba", 0x62aab8, 0x14 + +gUnknown_0862AACC:: @ 862AACC + .incbin "baserom.gba", 0x62aacc, 0x30 + +gUnknown_0862AAFC:: @ 862AAFC + .incbin "baserom.gba", 0x62aafc, 0x8 + +gUnknown_0862AB04:: @ 862AB04 + .incbin "baserom.gba", 0x62ab04, 0x8 + +gUnknown_0862AB0C:: @ 862AB0C + .incbin "baserom.gba", 0x62ab0c, 0x8 + +gUnknown_0862AB14:: @ 862AB14 + .incbin "baserom.gba", 0x62ab14, 0x18 + +gUnknown_0862AB2C:: @ 862AB2C + .incbin "baserom.gba", 0x62ab2c, 0x18 + +gUnknown_0862AB44:: @ 862AB44 + .incbin "baserom.gba", 0x62ab44, 0xe4 + +gUnknown_0862AC28:: @ 862AC28 + .incbin "baserom.gba", 0x62ac28, 0x8 + +gUnknown_0862AC30:: @ 862AC30 + .incbin "baserom.gba", 0x62ac30, 0x8 + +gUnknown_0862AC38:: @ 862AC38 + .incbin "baserom.gba", 0x62ac38, 0x8 + +gUnknown_0862AC40:: @ 862AC40 + .incbin "baserom.gba", 0x62ac40, 0x8 + +gUnknown_0862AC48:: @ 862AC48 + .incbin "baserom.gba", 0x62ac48, 0x8 + +gUnknown_0862AC50:: @ 862AC50 + .incbin "baserom.gba", 0x62ac50, 0x8 + +gUnknown_0862AC58:: @ 862AC58 + .incbin "baserom.gba", 0x62ac58, 0x8 + +gUnknown_0862AC60:: @ 862AC60 + .incbin "baserom.gba", 0x62ac60, 0x8 + +gUnknown_0862AC68:: @ 862AC68 + .incbin "baserom.gba", 0x62ac68, 0x8 + +gUnknown_0862AC70:: @ 862AC70 + .incbin "baserom.gba", 0x62ac70, 0x8 + +gUnknown_0862AC78:: @ 862AC78 + .incbin "baserom.gba", 0x62ac78, 0x18 + +gUnknown_0862AC90:: @ 862AC90 + .incbin "baserom.gba", 0x62ac90, 0x18 + +gUnknown_0862ACA8:: @ 862ACA8 + .incbin "baserom.gba", 0x62aca8, 0x18 + +gUnknown_0862ACC0:: @ 862ACC0 + .incbin "baserom.gba", 0x62acc0, 0x18 + +gUnknown_0862ACD8:: @ 862ACD8 + .incbin "baserom.gba", 0x62acd8, 0x18 + +gUnknown_0862ACF0:: @ 862ACF0 + .incbin "baserom.gba", 0x62acf0, 0x18 + +gUnknown_0862AD08:: @ 862AD08 + .incbin "baserom.gba", 0x62ad08, 0xc + +gUnknown_0862AD14:: @ 862AD14 + .incbin "baserom.gba", 0x62ad14, 0x20 + +gUnknown_0862AD34:: @ 862AD34 + .incbin "baserom.gba", 0x62ad34, 0x10 + +gUnknown_0862AD44:: @ 862AD44 + .incbin "baserom.gba", 0x62ad44, 0x10 + +gUnknown_0862AD54:: @ 862AD54 + .incbin "baserom.gba", 0x62ad54, 0x1dc + +gUnknown_0862AF30:: @ 862AF30 + .incbin "baserom.gba", 0x62af30, 0x60c + +gUnknown_0862B53C:: @ 862B53C + .incbin "baserom.gba", 0x62b53c, 0x1e8 + +gUnknown_0862B724:: @ 862B724 + .incbin "baserom.gba", 0x62b724, 0x8 + +gUnknown_0862B72C:: @ 862B72C + .incbin "baserom.gba", 0x62b72c, 0x2c + +gUnknown_0862B758:: @ 862B758 + .incbin "baserom.gba", 0x62b758, 0x18 + +gUnknown_0862B770:: @ 862B770 + .incbin "baserom.gba", 0x62b770, 0x14 + +gUnknown_0862B784:: @ 862B784 + .incbin "baserom.gba", 0x62b784, 0x14 + +gUnknown_0862B798:: @ 862B798 + .incbin "baserom.gba", 0x62b798, 0x14 + +gUnknown_0862B7AC:: @ 862B7AC + .incbin "baserom.gba", 0x62b7ac, 0x14 + +gUnknown_0862B7C0:: @ 862B7C0 + .incbin "baserom.gba", 0x62b7c0, 0x14 + +gUnknown_0862B7D4:: @ 862B7D4 + .incbin "baserom.gba", 0x62b7d4, 0x14 + +gUnknown_0862B7E8:: @ 862B7E8 + .incbin "baserom.gba", 0x62b7e8, 0x14 + +gUnknown_0862B7FC:: @ 862B7FC + .incbin "baserom.gba", 0x62b7fc, 0x2e8 diff --git a/data/diploma.s b/data/diploma.s new file mode 100644 index 000000000..43a3d9c70 --- /dev/null +++ b/data/diploma.s @@ -0,0 +1,22 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_085E7088:: @ 85E7088 + .incbin "baserom.gba", 0x5e7088, 0x40 + +gUnknown_085E70C8:: @ 85E70C8 + .incbin "baserom.gba", 0x5e70c8, 0x73c + +gUnknown_085E7804:: @ 85E7804 + .incbin "baserom.gba", 0x5e7804, 0x9f8 + +gUnknown_085E81FC:: @ 85E81FC + .incbin "baserom.gba", 0x5e81fc, 0x8 + +gUnknown_085E8204:: @ 85E8204 + .incbin "baserom.gba", 0x5e8204, 0x10 + +gUnknown_085E8214:: @ 85E8214 + .incbin "baserom.gba", 0x5e8214, 0x4 diff --git a/data/evolution_graphics.s b/data/evolution_graphics.s new file mode 100644 index 000000000..c357efb12 --- /dev/null +++ b/data/evolution_graphics.s @@ -0,0 +1,18 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + + .incbin "baserom.gba", 0x5f53c4, 0x48 + +gUnknown_085F540C:: @ 85F540C + .incbin "baserom.gba", 0x5f540c, 0x10 + +gUnknown_085F541C:: @ 85F541C + .incbin "baserom.gba", 0x5f541c, 0x24 + +gUnknown_085F5440:: @ 85F5440 + .incbin "baserom.gba", 0x5f5440, 0x18 + +gUnknown_085F5458:: @ 85F5458 + .incbin "baserom.gba", 0x5f5458, 0x38 diff --git a/data/field_effect_helpers.s b/data/field_effect_helpers.s new file mode 100644 index 000000000..97086af0d --- /dev/null +++ b/data/field_effect_helpers.s @@ -0,0 +1,25 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_085CDC38:: @ 85CDC38 + .incbin "baserom.gba", 0x5cdc38, 0x6 + +gUnknown_085CDC3E:: @ 85CDC3E + .incbin "baserom.gba", 0x5cdc3e, 0x4 + +gUnknown_085CDC42:: @ 85CDC42 + .incbin "baserom.gba", 0x5cdc42, 0xa + +gUnknown_085CDC4C:: @ 85CDC4C + .incbin "baserom.gba", 0x5cdc4c, 0x8 + +gUnknown_085CDC54:: @ 85CDC54 + .incbin "baserom.gba", 0x5cdc54, 0xc + +gUnknown_085CDC60:: @ 85CDC60 + .incbin "baserom.gba", 0x5cdc60, 0xa + +gUnknown_085CDC6A:: @ 85CDC6A + .incbin "baserom.gba", 0x5cdc6a, 0x96 diff --git a/data/field_region_map.s b/data/field_region_map.s new file mode 100644 index 000000000..2ddc65739 --- /dev/null +++ b/data/field_region_map.s @@ -0,0 +1,10 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_085E5068:: @ 85E5068 + .incbin "baserom.gba", 0x5e5068, 0x8 + +gUnknown_085E5070:: @ 85E5070 + .incbin "baserom.gba", 0x5e5070, 0x18 diff --git a/data/fonts.s b/data/fonts.s new file mode 100644 index 000000000..1904eb4df --- /dev/null +++ b/data/fonts.s @@ -0,0 +1,68 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + + .align 2 +gFont8LatinGlyphs:: @ 862BAE4 + .incbin "data/graphics/fonts/font8.latfont" + +gFont8LatinGlyphWidths:: @ 8633AE4 + .include "data/graphics/fonts/font8_latin_widths.inc" + + .align 2 +gFont0LatinGlyphs:: @ 8633CE4 + .incbin "data/graphics/fonts/font0.latfont" + +gFont0LatinGlyphWidths:: @ 863BCE4 + .include "data/graphics/fonts/font0_latin_widths.inc" + + .align 2 +gFont7LatinGlyphs:: @ 863BEE4 + .incbin "data/graphics/fonts/font7.latfont" + +gFont7LatinGlyphWidths:: @ 8643EE4 + .include "data/graphics/fonts/font7_latin_widths.inc" + + .align 2 +gFont2LatinGlyphs:: @ 86440E4 + .incbin "data/graphics/fonts/font2.latfont" + +gFont2LatinGlyphWidths:: @ 864C0E4 + .include "data/graphics/fonts/font2_latin_widths.inc" + + .align 2 +gFont1LatinGlyphs:: @ 864C2E4 + .incbin "data/graphics/fonts/font1.latfont" + +gFont1LatinGlyphWidths:: @ 86542E4 + .include "data/graphics/fonts/font1_latin_widths.inc" + + .align 2 +gFont0JapaneseGlyphs:: @ 86544E4 + .incbin "data/graphics/fonts/font0.hwjpnfont" + + .align 2 +gFont1JapaneseGlyphs:: @ 86584E4 + .incbin "data/graphics/fonts/font1.hwjpnfont" + + .align 2 +gUnusedJapaneseFireRedLeafGreenMaleFontGlyphs:: @ 865C4E4 + .incbin "data/graphics/fonts/unused_frlg_male.fwjpnfont" + +gUnusedJapaneseFireRedLeafGreenMaleFontGlyphWidths:: @ 86644E4 + .include "data/graphics/fonts/unused_japanese_frlg_male_font_widths.inc" + + .align 2 +gUnusedJapaneseFireRedLeafGreenFemaleFontGlyphs:: @ 86646E4 + .incbin "data/graphics/fonts/unused_frlg_female.fwjpnfont" + +gUnusedJapaneseFireRedLeafGreenFemaleFontGlyphWidths:: @ 866C6E4 + .include "data/graphics/fonts/unused_japanese_frlg_female_font_widths.inc" + + .align 2 +gFont2JapaneseGlyphs:: @ 866C8E4 + .incbin "data/graphics/fonts/font2.fwjpnfont" + +gFont2JapaneseGlyphWidths:: @ 86748E4 + .include "data/graphics/fonts/font2_japanese_widths.inc" diff --git a/data/hall_of_fame.s b/data/hall_of_fame.s new file mode 100644 index 000000000..2678d96a6 --- /dev/null +++ b/data/hall_of_fame.s @@ -0,0 +1,46 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_085E5374:: @ 85E5374 + .incbin "baserom.gba", 0x5e5374, 0xc + +gUnknown_085E5380:: @ 85E5380 + .incbin "baserom.gba", 0x5e5380, 0x8 + +gUnknown_085E5388:: @ 85E5388 + .incbin "baserom.gba", 0x5e5388, 0x4 + +gUnknown_085E538C:: @ 85E538C + .incbin "baserom.gba", 0x5e538c, 0x8 + +gUnknown_085E5394:: @ 85E5394 + .incbin "baserom.gba", 0x5e5394, 0x10 + +gUnknown_085E53A4:: @ 85E53A4 + .incbin "baserom.gba", 0x5e53a4, 0x10 + +gUnknown_085E53B4:: @ 85E53B4 + .incbin "baserom.gba", 0x5e53b4, 0x6 + +gUnknown_085E53BA:: @ 85E53BA + .incbin "baserom.gba", 0x5e53ba, 0x2a + +gUnknown_085E53E4:: @ 85E53E4 + .incbin "baserom.gba", 0x5e53e4, 0x18 + +gUnknown_085E53FC:: @ 85E53FC + .incbin "baserom.gba", 0x5e53fc, 0xd4 + +gUnknown_085E54D0:: @ 85E54D0 + .incbin "baserom.gba", 0x5e54d0, 0x18 + +gUnknown_085E54E8:: @ 85E54E8 + .incbin "baserom.gba", 0x5e54e8, 0x20 + +gUnknown_085E5508:: @ 85E5508 + .incbin "baserom.gba", 0x5e5508, 0x1cc + +gUnknown_085E56D4:: @ 85E56D4 + .incbin "baserom.gba", 0x5e56d4, 0x1c diff --git a/data/intro.s b/data/intro.s new file mode 100644 index 000000000..552799951 --- /dev/null +++ b/data/intro.s @@ -0,0 +1,124 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_085E05C4:: @ 85E05C4 + .incbin "baserom.gba", 0x5e05c4, 0x200 + +gUnknown_085E07C4:: @ 85E07C4 + .incbin "baserom.gba", 0x5e07c4, 0x3b4 + +gUnknown_085E0B78:: @ 85E0B78 + .incbin "baserom.gba", 0x5e0b78, 0x334 + +gUnknown_085E0EAC:: @ 85E0EAC + .incbin "baserom.gba", 0x5e0eac, 0x2f0 + +gUnknown_085E119C:: @ 85E119C + .incbin "baserom.gba", 0x5e119c, 0x218 + +gUnknown_085E13B4:: @ 85E13B4 + .incbin "baserom.gba", 0x5e13b4, 0x2170 + +gUnknown_085E3524:: @ 85E3524 + .incbin "baserom.gba", 0x5e3524, 0x200 + +gUnknown_085E3724:: @ 85E3724 + .incbin "baserom.gba", 0x5e3724, 0x130 + +gUnknown_085E3854:: @ 85E3854 + .incbin "baserom.gba", 0x5e3854, 0x1220 + +gUnknown_085E4A74:: @ 85E4A74 + .incbin "baserom.gba", 0x5e4a74, 0x10 + +gUnknown_085E4A84:: @ 85E4A84 + .incbin "baserom.gba", 0x5e4a84, 0x34 + +gUnknown_085E4AB8:: @ 85E4AB8 + .incbin "baserom.gba", 0x5e4ab8, 0x18 + +gUnknown_085E4AD0:: @ 85E4AD0 + .incbin "baserom.gba", 0x5e4ad0, 0x18 + +gUnknown_085E4AE8:: @ 85E4AE8 + .incbin "baserom.gba", 0x5e4ae8, 0x20 + +gUnknown_085E4B08:: @ 85E4B08 + .incbin "baserom.gba", 0x5e4b08, 0x38 + +gUnknown_085E4B40:: @ 85E4B40 + .incbin "baserom.gba", 0x5e4b40, 0x64 + +gUnknown_085E4BA4:: @ 85E4BA4 + .incbin "baserom.gba", 0x5e4ba4, 0x38 + +gUnknown_085E4BDC:: @ 85E4BDC + .incbin "baserom.gba", 0x5e4bdc, 0x18 + +gUnknown_085E4BF4:: @ 85E4BF4 + .incbin "baserom.gba", 0x5e4bf4, 0x10 + +gUnknown_085E4C04:: @ 85E4C04 + .incbin "baserom.gba", 0x5e4c04, 0x48 + +gUnknown_085E4C4C:: @ 85E4C4C + .incbin "baserom.gba", 0x5e4c4c, 0x18 + +gUnknown_085E4C64:: @ 85E4C64 + .incbin "baserom.gba", 0x5e4c64, 0x24 + +gUnknown_085E4C88:: @ 85E4C88 + .incbin "baserom.gba", 0x5e4c88, 0x10 + +gUnknown_085E4C98:: @ 85E4C98 + .incbin "baserom.gba", 0x5e4c98, 0x10 + +gUnknown_085E4CA8:: @ 85E4CA8 + .incbin "baserom.gba", 0x5e4ca8, 0x6c + +gUnknown_085E4D14:: @ 85E4D14 + .incbin "baserom.gba", 0x5e4d14, 0x50 + +gUnknown_085E4D64:: @ 85E4D64 + .incbin "baserom.gba", 0x5e4d64, 0x60 + +gUnknown_085E4DC4:: @ 85E4DC4 + .incbin "baserom.gba", 0x5e4dc4, 0xd0 + +gUnknown_085E4E94:: @ 85E4E94 + .incbin "baserom.gba", 0x5e4e94, 0xb4 + +gUnknown_085E4F48:: @ 85E4F48 + .incbin "baserom.gba", 0x5e4f48, 0x14 + +gUnknown_085E4F5C:: @ 85E4F5C + .incbin "baserom.gba", 0x5e4f5c, 0x30 + +gUnknown_085E4F8C:: @ 85E4F8C + .incbin "baserom.gba", 0x5e4f8c, 0x18 + +gUnknown_085E4FA4:: @ 85E4FA4 + .incbin "baserom.gba", 0x5e4fa4, 0x20 + +gUnknown_085E4FC4:: @ 85E4FC4 + .incbin "baserom.gba", 0x5e4fc4, 0x18 + +gUnknown_085E4FDC:: @ 85E4FDC + .incbin "baserom.gba", 0x5e4fdc, 0x10 + +gUnknown_085E4FEC:: @ 85E4FEC + .incbin "baserom.gba", 0x5e4fec, 0x10 + +gUnknown_085E4FFC:: @ 85E4FFC + .incbin "baserom.gba", 0x5e4ffc, 0x34 + +gUnknown_085E5030:: @ 85E5030 + .incbin "baserom.gba", 0x5e5030, 0x18 + +gUnknown_085E5048:: @ 85E5048 + .incbin "baserom.gba", 0x5e5048, 0x10 + +gUnknown_085E5058:: @ 85E5058 + .incbin "baserom.gba", 0x5e5058, 0x10 diff --git a/data/intro_credits_graphics.s b/data/intro_credits_graphics.s new file mode 100644 index 000000000..a1a0eb460 --- /dev/null +++ b/data/intro_credits_graphics.s @@ -0,0 +1,148 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_085F06E0:: @ 85F06E0 + .incbin "baserom.gba", 0x5f06e0, 0x20 + +gUnknown_085F0700:: @ 85F0700 + .incbin "baserom.gba", 0x5f0700, 0x20 + +gUnknown_085F0720:: @ 85F0720 + .incbin "baserom.gba", 0x5f0720, 0x20 + +gUnknown_085F0740:: @ 85F0740 + .incbin "baserom.gba", 0x5f0740, 0x480 + +gUnknown_085F0BC0:: @ 85F0BC0 + .incbin "baserom.gba", 0x5f0bc0, 0x13c + +gUnknown_085F0CFC:: @ 85F0CFC + .incbin "baserom.gba", 0x5f0cfc, 0x60 + +gUnknown_085F0D5C:: @ 85F0D5C + .incbin "baserom.gba", 0x5f0d5c, 0x60 + +gUnknown_085F0DBC:: @ 85F0DBC + .incbin "baserom.gba", 0x5f0dbc, 0x5dc + +gUnknown_085F1398:: @ 85F1398 + .incbin "baserom.gba", 0x5f1398, 0x2d0 + +gUnknown_085F1668:: @ 85F1668 + .incbin "baserom.gba", 0x5f1668, 0x20 + +gUnknown_085F1688:: @ 85F1688 + .incbin "baserom.gba", 0x5f1688, 0x20 + +gUnknown_085F16A8:: @ 85F16A8 + .incbin "baserom.gba", 0x5f16a8, 0x13c + +gUnknown_085F17E4:: @ 85F17E4 + .incbin "baserom.gba", 0x5f17e4, 0x20 + +gUnknown_085F1804:: @ 85F1804 + .incbin "baserom.gba", 0x5f1804, 0x20 + +gUnknown_085F1824:: @ 85F1824 + .incbin "baserom.gba", 0x5f1824, 0x688 + +gUnknown_085F1EAC:: @ 85F1EAC + .incbin "baserom.gba", 0x5f1eac, 0x304 + +gUnknown_085F21B0:: @ 85F21B0 + .incbin "baserom.gba", 0x5f21b0, 0x16c + +gUnknown_085F231C:: @ 85F231C + .incbin "baserom.gba", 0x5f231c, 0x40 + +gUnknown_085F235C:: @ 85F235C + .incbin "baserom.gba", 0x5f235c, 0x1ec + +gUnknown_085F2548:: @ 85F2548 + .incbin "baserom.gba", 0x5f2548, 0x20 + +gUnknown_085F2568:: @ 85F2568 + .incbin "baserom.gba", 0x5f2568, 0x2ae4 + +gUnknown_085F504C:: @ 85F504C + .incbin "baserom.gba", 0x5f504c, 0x18 + +gUnknown_085F5064:: @ 85F5064 + .incbin "baserom.gba", 0x5f5064, 0x30 + +gUnknown_085F5094:: @ 85F5094 + .incbin "baserom.gba", 0x5f5094, 0x10 + +gUnknown_085F50A4:: @ 85F50A4 + .incbin "baserom.gba", 0x5f50a4, 0x48 + +gUnknown_085F50EC:: @ 85F50EC + .incbin "baserom.gba", 0x5f50ec, 0x28 + +gUnknown_085F5114:: @ 85F5114 + .incbin "baserom.gba", 0x5f5114, 0xc + +gUnknown_085F5120:: @ 85F5120 + .incbin "baserom.gba", 0x5f5120, 0x60 + +gUnknown_085F5180:: @ 85F5180 + .incbin "baserom.gba", 0x5f5180, 0x18 + +gUnknown_085F5198:: @ 85F5198 + .incbin "baserom.gba", 0x5f5198, 0x4 + +gUnknown_085F519C:: @ 85F519C + .incbin "baserom.gba", 0x5f519c, 0x50 + +gUnknown_085F51EC:: @ 85F51EC + .incbin "baserom.gba", 0x5f51ec, 0x18 + +gUnknown_085F5204:: @ 85F5204 + .incbin "baserom.gba", 0x5f5204, 0x38 + +gUnknown_085F523C:: @ 85F523C + .incbin "baserom.gba", 0x5f523c, 0x18 + +gUnknown_085F5254:: @ 85F5254 + .incbin "baserom.gba", 0x5f5254, 0x38 + +gUnknown_085F528C:: @ 85F528C + .incbin "baserom.gba", 0x5f528c, 0x18 + +gUnknown_085F52A4:: @ 85F52A4 + .incbin "baserom.gba", 0x5f52a4, 0x18 + +gUnknown_085F52BC:: @ 85F52BC + .incbin "baserom.gba", 0x5f52bc, 0x10 + +gUnknown_085F52CC:: @ 85F52CC + .incbin "baserom.gba", 0x5f52cc, 0x10 + +gUnknown_085F52DC:: @ 85F52DC + .incbin "baserom.gba", 0x5f52dc, 0x20 + +gUnknown_085F52FC:: @ 85F52FC + .incbin "baserom.gba", 0x5f52fc, 0x10 + +gUnknown_085F530C:: @ 85F530C + .incbin "baserom.gba", 0x5f530c, 0x28 + +gUnknown_085F5334:: @ 85F5334 + .incbin "baserom.gba", 0x5f5334, 0x10 + +gUnknown_085F5344:: @ 85F5344 + .incbin "baserom.gba", 0x5f5344, 0x10 + +gUnknown_085F5354:: @ 85F5354 + .incbin "baserom.gba", 0x5f5354, 0x30 + +gUnknown_085F5384:: @ 85F5384 + .incbin "baserom.gba", 0x5f5384, 0x28 + +gUnknown_085F53AC:: @ 85F53AC + .incbin "baserom.gba", 0x5f53ac, 0x10 + +gUnknown_085F53BC:: @ 85F53BC + .incbin "baserom.gba", 0x5f53bc, 0x8 diff --git a/data/lottery_corner.s b/data/lottery_corner.s new file mode 100644 index 000000000..498e0f692 --- /dev/null +++ b/data/lottery_corner.s @@ -0,0 +1,7 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_085E7080:: @ 85E7080 + .incbin "baserom.gba", 0x5e7080, 0x8 diff --git a/data/mystery_event_menu.s b/data/mystery_event_menu.s new file mode 100644 index 000000000..1dbe2d580 --- /dev/null +++ b/data/mystery_event_menu.s @@ -0,0 +1,10 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_085EFD64:: @ 85EFD64 + .incbin "baserom.gba", 0x5efd64, 0x4 + +gUnknown_085EFD68:: @ 85EFD68 + .incbin "baserom.gba", 0x5efd68, 0x18 diff --git a/data/mystery_event_msg.s b/data/mystery_event_msg.s new file mode 100644 index 000000000..60de34b81 --- /dev/null +++ b/data/mystery_event_msg.s @@ -0,0 +1,34 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_08674AE4:: @ 8674AE4 + .incbin "baserom.gba", 0x674ae4, 0x32 + +gUnknown_08674B16:: @ 8674B16 + .incbin "baserom.gba", 0x674b16, 0x2c + +gUnknown_08674B42:: @ 8674B42 + .incbin "baserom.gba", 0x674b42, 0x28 + +gUnknown_08674B6A:: @ 8674B6A + .incbin "baserom.gba", 0x674b6a, 0x34 + +gUnknown_08674B9E:: @ 8674B9E + .incbin "baserom.gba", 0x674b9e, 0x36 + +gUnknown_08674BD4:: @ 8674BD4 + .incbin "baserom.gba", 0x674bd4, 0x1c + +gUnknown_08674BF0:: @ 8674BF0 + .incbin "baserom.gba", 0x674bf0, 0x12 + +gUnknown_08674C02:: @ 8674C02 + .incbin "baserom.gba", 0x674c02, 0x2f + +gUnknown_08674C31:: @ 8674C31 + .incbin "baserom.gba", 0x674c31, 0x55 + +gUnknown_08674C86:: @ 8674C86 + .incbin "baserom.gba", 0x674c86, 0xd5a diff --git a/data/player_pc.s b/data/player_pc.s new file mode 100644 index 000000000..1a4f62b4f --- /dev/null +++ b/data/player_pc.s @@ -0,0 +1,43 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_085DFEA4:: @ 85DFEA4 + .incbin "baserom.gba", 0x5dfea4, 0x10 + +gUnknown_085DFEB4:: @ 85DFEB4 + .incbin "baserom.gba", 0x5dfeb4, 0x20 + +gUnknown_085DFED4:: @ 85DFED4 + .incbin "baserom.gba", 0x5dfed4, 0x4 + +gUnknown_085DFED8:: @ 85DFED8 + .incbin "baserom.gba", 0x5dfed8, 0x4 + +gUnknown_085DFEDC:: @ 85DFEDC + .incbin "baserom.gba", 0x5dfedc, 0x20 + +gUnknown_085DFEFC:: @ 85DFEFC + .incbin "baserom.gba", 0x5dfefc, 0x8 + +gUnknown_085DFF04:: @ 85DFF04 + .incbin "baserom.gba", 0x5dff04, 0x20 + +gUnknown_085DFF24:: @ 85DFF24 + .incbin "baserom.gba", 0x5dff24, 0x18 + +gUnknown_085DFF3C:: @ 85DFF3C + .incbin "baserom.gba", 0x5dff3c, 0x8 + +gUnknown_085DFF44:: @ 85DFF44 + .incbin "baserom.gba", 0x5dff44, 0x18 + +gUnknown_085DFF5C:: @ 85DFF5C + .incbin "baserom.gba", 0x5dff5c, 0x28 + +gUnknown_085DFF84:: @ 85DFF84 + .incbin "baserom.gba", 0x5dff84, 0x8 + +gUnknown_085DFF8C:: @ 85DFF8C + .incbin "baserom.gba", 0x5dff8c, 0x638 diff --git a/data/pokeblock_feed.s b/data/pokeblock_feed.s new file mode 100644 index 000000000..b4d3d192d --- /dev/null +++ b/data/pokeblock_feed.s @@ -0,0 +1,43 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_085EFEBC:: @ 85EFEBC + .incbin "baserom.gba", 0x5efebc, 0x32 + +gUnknown_085EFEEE:: @ 85EFEEE + .incbin "baserom.gba", 0x5efeee, 0x12 + +gUnknown_085EFF00:: @ 85EFF00 + .incbin "baserom.gba", 0x5eff00, 0x5fc + +gUnknown_085F04FC:: @ 85F04FC + .incbin "baserom.gba", 0x5f04fc, 0x54 + +gUnknown_085F0550:: @ 85F0550 + .incbin "baserom.gba", 0x5f0550, 0x8 + +gUnknown_085F0558:: @ 85F0558 + .incbin "baserom.gba", 0x5f0558, 0x10 + +gUnknown_085F0568:: @ 85F0568 + .incbin "baserom.gba", 0x5f0568, 0x48 + +gUnknown_085F05B0:: @ 85F05B0 + .incbin "baserom.gba", 0x5f05b0, 0xb4 + +gUnknown_085F0664:: @ 85F0664 + .incbin "baserom.gba", 0x5f0664, 0x4 + +gUnknown_085F0668:: @ 85F0668 + .incbin "baserom.gba", 0x5f0668, 0x4 + +gUnknown_085F066C:: @ 85F066C + .incbin "baserom.gba", 0x5f066c, 0x34 + +gUnknown_085F06A0:: @ 85F06A0 + .incbin "baserom.gba", 0x5f06a0, 0x8 + +gUnknown_085F06A8:: @ 85F06A8 + .incbin "baserom.gba", 0x5f06a8, 0x18 diff --git a/data/rom_8158B30.s b/data/rom_8158B30.s new file mode 100644 index 000000000..db4329c10 --- /dev/null +++ b/data/rom_8158B30.s @@ -0,0 +1,241 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_085CDF20:: @ 85CDF20 + .incbin "baserom.gba", 0x5cdf20, 0x380 + +gUnknown_085CE2A0:: @ 85CE2A0 + .incbin "baserom.gba", 0x5ce2a0, 0xb0 + +gUnknown_085CE350:: @ 85CE350 + .incbin "baserom.gba", 0x5ce350, 0x38 + +gUnknown_085CE388:: @ 85CE388 + .incbin "baserom.gba", 0x5ce388, 0x18 + +gUnknown_085CE3A0:: @ 85CE3A0 + .incbin "baserom.gba", 0x5ce3a0, 0x18 + +gUnknown_085CE3B8:: @ 85CE3B8 + .incbin "baserom.gba", 0x5ce3b8, 0x28 + +gUnknown_085CE3E0:: @ 85CE3E0 + .incbin "baserom.gba", 0x5ce3e0, 0x50 + +gUnknown_085CE430:: @ 85CE430 + .incbin "baserom.gba", 0x5ce430, 0x30 + +gUnknown_085CE460:: @ 85CE460 + .incbin "baserom.gba", 0x5ce460, 0x2c + +gUnknown_085CE48C:: @ 85CE48C + .incbin "baserom.gba", 0x5ce48c, 0x18 + +gUnknown_085CE4A4:: @ 85CE4A4 + .incbin "baserom.gba", 0x5ce4a4, 0x4 + +gUnknown_085CE4A8:: @ 85CE4A8 + .incbin "baserom.gba", 0x5ce4a8, 0x8 + +gUnknown_085CE4B0:: @ 85CE4B0 + .incbin "baserom.gba", 0x5ce4b0, 0x140 + +gUnknown_085CE5F0:: @ 85CE5F0 + .incbin "baserom.gba", 0x5ce5f0, 0x15c + +gUnknown_085CE74C:: @ 85CE74C + .incbin "baserom.gba", 0x5ce74c, 0x20 + +gUnknown_085CE76C:: @ 85CE76C + .incbin "baserom.gba", 0x5ce76c, 0x18 + +gUnknown_085CE784:: @ 85CE784 + .incbin "baserom.gba", 0x5ce784, 0x68 + +gUnknown_085CE7EC:: @ 85CE7EC + .incbin "baserom.gba", 0x5ce7ec, 0x60 + +gUnknown_085CE84C:: @ 85CE84C + .incbin "baserom.gba", 0x5ce84c, 0x30 + +gUnknown_085CE87C:: @ 85CE87C + .incbin "baserom.gba", 0x5ce87c, 0x14c + +gUnknown_085CE9C8:: @ 85CE9C8 + .incbin "baserom.gba", 0x5ce9c8, 0x1e8 + +gUnknown_085CEBB0:: @ 85CEBB0 + .incbin "baserom.gba", 0x5cebb0, 0x8 + +gUnknown_085CEBB8:: @ 85CEBB8 + .incbin "baserom.gba", 0x5cebb8, 0x8 + +gUnknown_085CEBC0:: @ 85CEBC0 + .incbin "baserom.gba", 0x5cebc0, 0x10 + +gUnknown_085CEBD0:: @ 85CEBD0 + .incbin "baserom.gba", 0x5cebd0, 0x40 + +gUnknown_085CEC10:: @ 85CEC10 + .incbin "baserom.gba", 0x5cec10, 0x18 + +gUnknown_085CEC28:: @ 85CEC28 + .incbin "baserom.gba", 0x5cec28, 0x8 + +gUnknown_085CEC30:: @ 85CEC30 + .incbin "baserom.gba", 0x5cec30, 0x80 + +@ 85CECB0 + .include "data/battle_frontier/battle_frontier_held_items.inc" + +@ 85CED2E + .include "data/battle_frontier/battle_frontier_trainer_mons.inc" + +@ 85D5ACC + .include "data/battle_frontier/battle_frontier_trainers.inc" + +@ 85D97BC + .include "data/battle_frontier/battle_frontier_mons.inc" + +gUnknown_085DCEDC:: @ 85DCEDC + .incbin "baserom.gba", 0x5dcedc, 0x1e + +gUnknown_085DCEFA:: @ 85DCEFA + .incbin "baserom.gba", 0x5dcefa, 0x14 + +gUnknown_085DCF0E:: @ 85DCF0E + .incbin "baserom.gba", 0x5dcf0e, 0x1e + +gUnknown_085DCF2C:: @ 85DCF2C + .incbin "baserom.gba", 0x5dcf2c, 0x14 + +gUnknown_085DCF40:: @ 85DCF40 + .incbin "baserom.gba", 0x5dcf40, 0x5c0 + +gUnknown_085DD500:: @ 85DD500 + .incbin "baserom.gba", 0x5dd500, 0x190 + +gUnknown_085DD690:: @ 85DD690 + .incbin "baserom.gba", 0x5dd690, 0x40 + +gUnknown_085DD6D0:: @ 85DD6D0 + .incbin "baserom.gba", 0x5dd6d0, 0x5 + +gUnknown_085DD6D5:: @ 85DD6D5 + .incbin "baserom.gba", 0x5dd6d5, 0x7 + +gUnknown_085DD6DC:: @ 85DD6DC + .incbin "baserom.gba", 0x5dd6dc, 0x30 + +@ 85DD70C + .include "data/battle_frontier/slateport_battle_tent_trainer_mons.inc" + +@ 85DDA14 + .include "data/battle_frontier/slateport_battle_tent_trainers.inc" + +@ 85DE02C + .include "data/battle_frontier/slateport_battle_tent_mons.inc" + +@ 85DE48C + .include "data/battle_frontier/verdanturf_battle_tent_trainer_mons.inc" + +@ 85DE610 + .include "data/battle_frontier/verdanturf_battle_tent_trainers.inc" + +@ 85DEC28 + .include "data/battle_frontier/verdanturf_battle_tent_mons.inc" + +@ 85DEEF8 + .include "data/battle_frontier/fallarbor_battle_tent_trainer_mons.inc" + +@ 85DF084 + .include "data/battle_frontier/fallarbor_battle_tent_trainers.inc" + +@ 85DF69C + .include "data/battle_frontier/fallarbor_battle_tent_mons.inc" + +gUnknown_085DF96C:: @ 85DF96C + .incbin "baserom.gba", 0x5df96c, 0x40 + +gUnknown_085DF9AC:: @ 85DF9AC + .incbin "baserom.gba", 0x5df9ac, 0x20 + +gUnknown_085DF9CC:: @ 85DF9CC + .incbin "baserom.gba", 0x5df9cc, 0x20 + +gUnknown_085DF9EC:: @ 85DF9EC + .incbin "baserom.gba", 0x5df9ec, 0xa + +gUnknown_085DF9F6:: @ 85DF9F6 + .incbin "baserom.gba", 0x5df9f6, 0x4 + +gUnknown_085DF9FA:: @ 85DF9FA + .incbin "baserom.gba", 0x5df9fa, 0x20 + +gUnknown_085DFA1A:: @ 85DFA1A + .incbin "baserom.gba", 0x5dfa1a, 0x28 + +gUnknown_085DFA42:: @ 85DFA42 + .incbin "baserom.gba", 0x5dfa42, 0x4 + +gUnknown_085DFA46:: @ 85DFA46 + .incbin "baserom.gba", 0x5dfa46, 0xc + +gUnknown_085DFA52:: @ 85DFA52 + .incbin "baserom.gba", 0x5dfa52, 0xe + +gUnknown_085DFA60:: @ 85DFA60 + .incbin "baserom.gba", 0x5dfa60, 0x20 + +gUnknown_085DFA80:: @ 85DFA80 + .incbin "baserom.gba", 0x5dfa80, 0xe0 + +gUnknown_085DFB60:: @ 85DFB60 + .incbin "baserom.gba", 0x5dfb60, 0xac + +gUnknown_085DFC0C:: @ 85DFC0C + .incbin "baserom.gba", 0x5dfc0c, 0xa4 + +gUnknown_085DFCB0:: @ 85DFCB0 + .incbin "baserom.gba", 0x5dfcb0, 0x14 + +gUnknown_085DFCC4:: @ 85DFCC4 + .incbin "baserom.gba", 0x5dfcc4, 0x5 + +gUnknown_085DFCC9:: @ 85DFCC9 + .incbin "baserom.gba", 0x5dfcc9, 0x3 + +gUnknown_085DFCCC:: @ 85DFCCC + .incbin "baserom.gba", 0x5dfccc, 0x10 + +gUnknown_085DFCDC:: @ 85DFCDC + .incbin "baserom.gba", 0x5dfcdc, 0x20 + +gUnknown_085DFCFC:: @ 85DFCFC + .incbin "baserom.gba", 0x5dfcfc, 0x8 + +gUnknown_085DFD04:: @ 85DFD04 + .incbin "baserom.gba", 0x5dfd04, 0x14 + +gUnknown_085DFD18:: @ 85DFD18 + .incbin "baserom.gba", 0x5dfd18, 0x8 + +gUnknown_085DFD20:: @ 85DFD20 + .incbin "baserom.gba", 0x5dfd20, 0x8 + +gUnknown_085DFD28:: @ 85DFD28 + .incbin "baserom.gba", 0x5dfd28, 0x34 + +gUnknown_085DFD5C:: @ 85DFD5C + .incbin "baserom.gba", 0x5dfd5c, 0x44 + +gUnknown_085DFDA0:: @ 85DFDA0 + .incbin "baserom.gba", 0x5dfda0, 0x18 + +gUnknown_085DFDB8:: @ 85DFDB8 + .incbin "baserom.gba", 0x5dfdb8, 0x8 + +gUnknown_085DFDC0:: @ 85DFDC0 + .incbin "baserom.gba", 0x5dfdc0, 0xe4 diff --git a/data/save.s b/data/save.s new file mode 100644 index 000000000..760773e88 --- /dev/null +++ b/data/save.s @@ -0,0 +1,7 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_085CDC00:: @ 85CDC00 + .incbin "baserom.gba", 0x5cdc00, 0x38 diff --git a/data/save_failed_screen.s b/data/save_failed_screen.s new file mode 100644 index 000000000..446eee2d2 --- /dev/null +++ b/data/save_failed_screen.s @@ -0,0 +1,28 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_085EFD80:: @ 85EFD80 + .incbin "baserom.gba", 0x5efd80, 0x8 + +gUnknown_085EFD88:: @ 85EFD88 + .incbin "baserom.gba", 0x5efd88, 0xc + +gUnknown_085EFD94:: @ 85EFD94 + .incbin "baserom.gba", 0x5efd94, 0x8 + +gUnknown_085EFD9C:: @ 85EFD9C + .incbin "baserom.gba", 0x5efd9c, 0x8 + +gUnknown_085EFDA4:: @ 85EFDA4 + .incbin "baserom.gba", 0x5efda4, 0x8 + +gUnknown_085EFDAC:: @ 85EFDAC + .incbin "baserom.gba", 0x5efdac, 0x18 + +gUnknown_085EFDC4:: @ 85EFDC4 + .incbin "baserom.gba", 0x5efdc4, 0x20 + +gUnknown_085EFDE4:: @ 85EFDE4 + .incbin "baserom.gba", 0x5efde4, 0x90 diff --git a/data/sprite.s b/data/sprite.s new file mode 100644 index 000000000..59308d286 --- /dev/null +++ b/data/sprite.s @@ -0,0 +1,68 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +@ Unreferenced data. Also unreferenced in Ruby. + .incbin "baserom.gba", 0x2ec61c, 0x18 + +gUnknown_082EC634:: @ 82EC634 + .incbin "baserom.gba", 0x2ec634, 0x18 + +gUnknown_082EC64C:: @ 82EC64C + .incbin "baserom.gba", 0x2ec64c, 0x44 + +@ off-screen and low priority relative to background +gDefaultOamAttributes:: @ 82EC690 + .2byte 160 @ Y + .2byte 304 @ X + .2byte 3 << 10 @ priority + + .align 2 +gDummyObjectImageAnim:: @ 82EC698 + obj_image_anim_end + + .align 2 +gDummyObjectImageAnimTable:: @ 82EC69C + .4byte gDummyObjectImageAnim + + .align 2 +gDummyObjectRotScalAnim:: @ 82EC6A0 + obj_rot_scal_anim_end + + .align 2 +gDummyObjectRotScalAnimTable:: @ 82EC6A8 + .4byte gDummyObjectRotScalAnim + +gUnknown_082EC6AC:: @ 82EC6AC + .incbin "baserom.gba", 0x2ec6ac, 0x18 + +gUnknown_082EC6C4:: @ 82EC6C4 + .incbin "baserom.gba", 0x2ec6c4, 0x8 + +gUnknown_082EC6CC:: @ 82EC6CC + .incbin "baserom.gba", 0x2ec6cc, 0x8 + +gUnknown_082EC6D4:: @ 82EC6D4 + .incbin "baserom.gba", 0x2ec6d4, 0x10 + +gUnknown_082EC6E4:: @ 82EC6E4 + .incbin "baserom.gba", 0x2ec6e4, 0x10 + +gUnknown_082EC6F4:: @ 82EC6F4 + .incbin "baserom.gba", 0x2ec6f4, 0x60 + +gUnknown_082EC754:: @ 82EC754 + .incbin "baserom.gba", 0x2ec754, 0x70 + +gUnknown_82EC7C4:: @ 82EC7C4 + .2byte 0x0100 + .2byte 0x0200 + .2byte 0x0400 + .2byte 0x0800 + +gUnknown_82EC7CC:: @ 82EC7CC + .2byte 0x0001 + .2byte 0x0002 + .2byte 0x0004 + .2byte 0x0008 diff --git a/data/string_util.inc b/data/string_util.inc deleted file mode 100644 index be783d2c0..000000000 --- a/data/string_util.inc +++ /dev/null @@ -1,65 +0,0 @@ -gDigits:: @ 82EC7D4 - .string "0123456789ABCDEF" - - .align 2 -gPowersOfTen:: @ 82EC7E4 - .4byte 1 - .4byte 10 - .4byte 100 - .4byte 1000 - .4byte 10000 - .4byte 100000 - .4byte 1000000 - .4byte 10000000 - .4byte 100000000 - .4byte 1000000000 - -gUnknown_082EC80C:: @ 82EC80C - .incbin "baserom.gba", 0x2ec80c, 0x4 - -gUnknown_082EC810:: @ 82EC810 - .incbin "baserom.gba", 0x2ec810, 0x8 - - .align 2 -gStringRefFunctionTable:: @ 82EC818 - .4byte StringRef_GetPossiblyUnusedStringVar - .4byte StringRef_GetPlayerName - .4byte StringRef_GetStringVar1 - .4byte StringRef_GetStringVar2 - .4byte StringRef_GetStringVar3 - .4byte StringRef_GetDummiedOutGenderDependentString - .4byte StringRef_GetRivalName - .4byte StringRef_GetEmeraldString - .4byte StringRef_GetAquaString - .4byte StringRef_GetMagmaString - .4byte StringRef_GetArchieString - .4byte StringRef_GetMaxieString - .4byte StringRef_GetKyogreString - .4byte StringRef_GetGroudonString - -gExtendedControlCodeLengths:: @ 82EC850 - .byte 1 - .byte 2 - .byte 2 - .byte 2 - .byte 4 - .byte 2 - .byte 2 - .byte 1 - .byte 2 - .byte 1 - .byte 1 - .byte 3 - .byte 2 - .byte 2 - .byte 2 - .byte 1 - .byte 3 - .byte 2 - .byte 2 - .byte 2 - .byte 2 - .byte 1 - .byte 1 - .byte 1 - .byte 1 diff --git a/data/strings.s b/data/strings.s new file mode 100644 index 000000000..300796c0f --- /dev/null +++ b/data/strings.s @@ -0,0 +1,2209 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gExpandedPlaceholder_Empty:: @ 85E8218 + .string "$" + +gExpandedPlaceholder_Kun:: @ 85E8219 + .string "$" + +gExpandedPlaceholder_Chan:: @ 85E821A + .string "$" + +gExpandedPlaceholder_Sapphire:: @ 85E821B + .string "SAPPHIRE$" + +gExpandedPlaceholder_Ruby:: @ 85E8224 + .string "RUBY$" + +gExpandedPlaceholder_Emerald:: @ 85E8229 + .string "EMERALD$" + +gExpandedPlaceholder_Aqua:: @ 85E8231 + .string "AQUA$" + +gExpandedPlaceholder_Magma:: @ 85E8236 + .string "MAGMA$" + +gExpandedPlaceholder_Archie:: @ 85E823C + .string "ARCHIE$" + +gExpandedPlaceholder_Maxie:: @ 85E8243 + .string "MAXIE$" + +gExpandedPlaceholder_Kyogre:: @ 85E8249 + .string "KYOGRE$" + +gExpandedPlaceholder_Groudon:: @ 85E8250 + .string "GROUDON$" + +gExpandedPlaceholder_Brendan:: @ 85E8258 + .string "BRENDAN$" + +gExpandedPlaceholder_May:: @ 85E8260 + .string "MAY$" + +gUnknown_085E8264:: @ 85E8264 + .incbin "baserom.gba", 0x5e8264, 0x4 + +gUnknown_085E8268:: @ 85E8268 + .incbin "baserom.gba", 0x5e8268, 0x14 + +gUnknown_085E827C:: @ 85E827C + .incbin "baserom.gba", 0x5e827c, 0x9 + +gUnknown_085E8285:: @ 85E8285 + .incbin "baserom.gba", 0x5e8285, 0x9 + +gUnknown_085E828E:: @ 85E828E + .incbin "baserom.gba", 0x5e828e, 0x7 + +gUnknown_085E8295:: @ 85E8295 + .incbin "baserom.gba", 0x5e8295, 0xd + +gUnknown_085E82A2:: @ 85E82A2 + .incbin "baserom.gba", 0x5e82a2, 0xd + +gUnknown_085E82AF:: @ 85E82AF + .incbin "baserom.gba", 0x5e82af, 0xf + +gUnknown_085E82BE:: @ 85E82BE + .incbin "baserom.gba", 0x5e82be, 0x27 + +gUnknown_085E82E5:: @ 85E82E5 + .incbin "baserom.gba", 0x5e82e5, 0x43 + +gUnknown_085E8328:: @ 85E8328 + .incbin "baserom.gba", 0x5e8328, 0x9a + +gUnknown_085E83C2:: @ 85E83C2 + .incbin "baserom.gba", 0x5e83c2, 0x43 + +gUnknown_085E8405:: @ 85E8405 + .incbin "baserom.gba", 0x5e8405, 0x3b + +gUnknown_085E8440:: @ 85E8440 + .incbin "baserom.gba", 0x5e8440, 0x13 + +gUnknown_085E8453:: @ 85E8453 + .incbin "baserom.gba", 0x5e8453, 0x7b + +gUnknown_085E84CE:: @ 85E84CE + .incbin "baserom.gba", 0x5e84ce, 0x8e + +gUnknown_085E855C:: @ 85E855C + .incbin "baserom.gba", 0x5e855c, 0x18 + +gUnknown_085E8574:: @ 85E8574 + .incbin "baserom.gba", 0x5e8574, 0x14 + +gUnknown_085E8588:: @ 85E8588 + .incbin "baserom.gba", 0x5e8588, 0x10a + +gUnknown_085E8692:: @ 85E8692 + .incbin "baserom.gba", 0x5e8692, 0x26 + +gUnknown_085E86B8:: @ 85E86B8 + .incbin "baserom.gba", 0x5e86b8, 0xe + +gUnknown_085E86C6:: @ 85E86C6 + .incbin "baserom.gba", 0x5e86c6, 0xa + +gUnknown_085E86D0:: @ 85E86D0 + .incbin "baserom.gba", 0x5e86d0, 0x4b + +gUnknown_085E871B:: @ 85E871B + .incbin "baserom.gba", 0x5e871b, 0x8 + +gUnknown_085E8723:: @ 85E8723 + .incbin "baserom.gba", 0x5e8723, 0x12 + +gUnknown_085E8735:: @ 85E8735 + .incbin "baserom.gba", 0x5e8735, 0x20 + +gUnknown_085E8755:: @ 85E8755 + .incbin "baserom.gba", 0x5e8755, 0x3 + +gUnknown_085E8758:: @ 85E8758 + .incbin "baserom.gba", 0x5e8758, 0x3 + +gUnknown_085E875B:: @ 85E875B + .incbin "baserom.gba", 0x5e875b, 0x18 + +gUnknown_085E8773:: @ 85E8773 + .incbin "baserom.gba", 0x5e8773, 0x12 + +gUnknown_085E8785:: @ 85E8785 + .incbin "baserom.gba", 0x5e8785, 0x3b5 + +gUnknown_085E8B3A:: @ 85E8B3A + .incbin "baserom.gba", 0x5e8b3a, 0x4 + +gUnknown_085E8B3E:: @ 85E8B3E + .incbin "baserom.gba", 0x5e8b3e, 0x9e + +gUnknown_085E8BDC:: @ 85E8BDC + .incbin "baserom.gba", 0x5e8bdc, 0x24 + +gUnknown_085E8C00:: @ 85E8C00 + .incbin "baserom.gba", 0x5e8c00, 0x14 + +gUnknown_085E8C14:: @ 85E8C14 + .incbin "baserom.gba", 0x5e8c14, 0x22 + +gUnknown_085E8C36:: @ 85E8C36 + .incbin "baserom.gba", 0x5e8c36, 0x5 + +gUnknown_085E8C3B:: @ 85E8C3B + .incbin "baserom.gba", 0x5e8c3b, 0xd + +gUnknown_085E8C48:: @ 85E8C48 + .incbin "baserom.gba", 0x5e8c48, 0x5 + +gUnknown_085E8C4D:: @ 85E8C4D + .incbin "baserom.gba", 0x5e8c4d, 0x6 + +gUnknown_085E8C53:: @ 85E8C53 + .incbin "baserom.gba", 0x5e8c53, 0x3d + +gUnknown_085E8C90:: @ 85E8C90 + .incbin "baserom.gba", 0x5e8c90, 0x24 + +gUnknown_085E8CB4:: @ 85E8CB4 + .incbin "baserom.gba", 0x5e8cb4, 0x2f + +gUnknown_085E8CE3:: @ 85E8CE3 + .incbin "baserom.gba", 0x5e8ce3, 0xd + +gUnknown_085E8CF0:: @ 85E8CF0 + .incbin "baserom.gba", 0x5e8cf0, 0x7 + +gUnknown_085E8CF7:: @ 85E8CF7 + .incbin "baserom.gba", 0x5e8cf7, 0xc + +gUnknown_085E8D03:: @ 85E8D03 + .incbin "baserom.gba", 0x5e8d03, 0x23 + +gUnknown_085E8D26:: @ 85E8D26 + .incbin "baserom.gba", 0x5e8d26, 0xe + +gUnknown_085E8D34:: @ 85E8D34 + .incbin "baserom.gba", 0x5e8d34, 0x4 + +gUnknown_085E8D38:: @ 85E8D38 + .incbin "baserom.gba", 0x5e8d38, 0x6 + +gUnknown_085E8D3E:: @ 85E8D3E + .incbin "baserom.gba", 0x5e8d3e, 0x2 + +gUnknown_085E8D40:: @ 85E8D40 + .incbin "baserom.gba", 0x5e8d40, 0x2 + +gUnknown_085E8D42:: @ 85E8D42 + .incbin "baserom.gba", 0x5e8d42, 0x3 + +gUnknown_085E8D45:: @ 85E8D45 + .incbin "baserom.gba", 0x5e8d45, 0x4 + +gUnknown_085E8D49:: @ 85E8D49 + .incbin "baserom.gba", 0x5e8d49, 0x2 + +gUnknown_085E8D4B:: @ 85E8D4B + .incbin "baserom.gba", 0x5e8d4b, 0x2 + +gUnknown_085E8D4D:: @ 85E8D4D + .incbin "baserom.gba", 0x5e8d4d, 0x2 + +gUnknown_085E8D4F:: @ 85E8D4F + .incbin "baserom.gba", 0x5e8d4f, 0xa + +gUnknown_085E8D59:: @ 85E8D59 + .incbin "baserom.gba", 0x5e8d59, 0x5 + +gUnknown_085E8D5E:: @ 85E8D5E + .incbin "baserom.gba", 0x5e8d5e, 0x2 + +gUnknown_085E8D60:: @ 85E8D60 + .incbin "baserom.gba", 0x5e8d60, 0x2 + +gUnknown_085E8D62:: @ 85E8D62 + .incbin "baserom.gba", 0x5e8d62, 0x1e + +gUnknown_085E8D80:: @ 85E8D80 + .incbin "baserom.gba", 0x5e8d80, 0x20 + +gUnknown_085E8DA0:: @ 85E8DA0 + .incbin "baserom.gba", 0x5e8da0, 0xb + +gUnknown_085E8DAB:: @ 85E8DAB + .incbin "baserom.gba", 0x5e8dab, 0x9 + +gUnknown_085E8DB4:: @ 85E8DB4 + .incbin "baserom.gba", 0x5e8db4, 0xa + +gUnknown_085E8DBE:: @ 85E8DBE + .incbin "baserom.gba", 0x5e8dbe, 0x10 + +gUnknown_085E8DCE:: @ 85E8DCE + .incbin "baserom.gba", 0x5e8dce, 0x1b + +gUnknown_085E8DE9:: @ 85E8DE9 + .incbin "baserom.gba", 0x5e8de9, 0x15 + +gUnknown_085E8DFE:: @ 85E8DFE + .incbin "baserom.gba", 0x5e8dfe, 0x13 + +gUnknown_085E8E11:: @ 85E8E11 + .incbin "baserom.gba", 0x5e8e11, 0x16 + +gUnknown_085E8E27:: @ 85E8E27 + .incbin "baserom.gba", 0x5e8e27, 0x1b + +gUnknown_085E8E42:: @ 85E8E42 + .incbin "baserom.gba", 0x5e8e42, 0x18 + +gUnknown_085E8E5A:: @ 85E8E5A + .incbin "baserom.gba", 0x5e8e5a, 0x14 + +gUnknown_085E8E6E:: @ 85E8E6E + .incbin "baserom.gba", 0x5e8e6e, 0x20 + +gUnknown_085E8E8E:: @ 85E8E8E + .incbin "baserom.gba", 0x5e8e8e, 0x2b + +gUnknown_085E8EB9:: @ 85E8EB9 + .incbin "baserom.gba", 0x5e8eb9, 0x27 + +gUnknown_085E8EE0:: @ 85E8EE0 + .incbin "baserom.gba", 0x5e8ee0, 0x19 + +gUnknown_085E8EF9:: @ 85E8EF9 + .incbin "baserom.gba", 0x5e8ef9, 0x15 + +gUnknown_085E8F0E:: @ 85E8F0E + .incbin "baserom.gba", 0x5e8f0e, 0x23 + +gUnknown_085E8F31:: @ 85E8F31 + .incbin "baserom.gba", 0x5e8f31, 0x3d + +gUnknown_085E8F6E:: @ 85E8F6E + .incbin "baserom.gba", 0x5e8f6e, 0x25 + +gUnknown_085E8F93:: @ 85E8F93 + .incbin "baserom.gba", 0x5e8f93, 0x48 + +gUnknown_085E8FDB:: @ 85E8FDB + .incbin "baserom.gba", 0x5e8fdb, 0x27 + +gUnknown_085E9002:: @ 85E9002 + .incbin "baserom.gba", 0x5e9002, 0x24 + +gUnknown_085E9026:: @ 85E9026 + .incbin "baserom.gba", 0x5e9026, 0x11 + +gUnknown_085E9037:: @ 85E9037 + .incbin "baserom.gba", 0x5e9037, 0x10 + +gUnknown_085E9047:: @ 85E9047 + .incbin "baserom.gba", 0x5e9047, 0x11 + +gUnknown_085E9058:: @ 85E9058 + .incbin "baserom.gba", 0x5e9058, 0x28 + +gUnknown_085E9080:: @ 85E9080 + .incbin "baserom.gba", 0x5e9080, 0x12 + +gUnknown_085E9092:: @ 85E9092 + .incbin "baserom.gba", 0x5e9092, 0x34 + +gUnknown_085E90C6:: @ 85E90C6 + .incbin "baserom.gba", 0x5e90c6, 0x2e + +gUnknown_085E90F4:: @ 85E90F4 + .incbin "baserom.gba", 0x5e90f4, 0x31 + +gUnknown_085E9125:: @ 85E9125 + .incbin "baserom.gba", 0x5e9125, 0x13 + +gUnknown_085E9138:: @ 85E9138 + .incbin "baserom.gba", 0x5e9138, 0x48 + +gUnknown_085E9180:: @ 85E9180 + .incbin "baserom.gba", 0x5e9180, 0x30 + +gUnknown_085E91B0:: @ 85E91B0 + .incbin "baserom.gba", 0x5e91b0, 0x10 + +gUnknown_085E91C0:: @ 85E91C0 + .incbin "baserom.gba", 0x5e91c0, 0x3c + +gUnknown_085E91FC:: @ 85E91FC + .incbin "baserom.gba", 0x5e91fc, 0x14 + +gUnknown_085E9210:: @ 85E9210 + .incbin "baserom.gba", 0x5e9210, 0xa + +gUnknown_085E921A:: @ 85E921A + .incbin "baserom.gba", 0x5e921a, 0xb + +gUnknown_085E9225:: @ 85E9225 + .incbin "baserom.gba", 0x5e9225, 0x7 + +gUnknown_085E922C:: @ 85E922C + .incbin "baserom.gba", 0x5e922c, 0x7 + +gUnknown_085E9233:: @ 85E9233 + .incbin "baserom.gba", 0x5e9233, 0x7 + +@ 85E923A + .include "data/text/berry_firmness_strings.inc" + +gUnknown_085E9263:: @ 85E9263 + .incbin "baserom.gba", 0x5e9263, 0x8 + +gUnknown_085E926B:: @ 85E926B + .incbin "baserom.gba", 0x5e926b, 0xb2 + +gUnknown_085E931D:: @ 85E931D + .incbin "baserom.gba", 0x5e931d, 0x6 + +gUnknown_085E9323:: @ 85E9323 + .incbin "baserom.gba", 0x5e9323, 0x4 + +gUnknown_085E9327:: @ 85E9327 + .incbin "baserom.gba", 0x5e9327, 0x6 + +gUnknown_085E932D:: @ 85E932D + .incbin "baserom.gba", 0x5e932d, 0x7 + +gUnknown_085E9334:: @ 85E9334 + .incbin "baserom.gba", 0x5e9334, 0x10 + +gUnknown_085E9344:: @ 85E9344 + .incbin "baserom.gba", 0x5e9344, 0xb + +gUnknown_085E934F:: @ 85E934F + .incbin "baserom.gba", 0x5e934f, 0x4 + +gUnknown_085E9353:: @ 85E9353 + .incbin "baserom.gba", 0x5e9353, 0x14 + +gUnknown_085E9367:: @ 85E9367 + .incbin "baserom.gba", 0x5e9367, 0x18 + +gUnknown_085E937F:: @ 85E937F + .incbin "baserom.gba", 0x5e937f, 0x11 + +gUnknown_085E9390:: @ 85E9390 + .incbin "baserom.gba", 0x5e9390, 0x19 + +gUnknown_085E93A9:: @ 85E93A9 + .incbin "baserom.gba", 0x5e93a9, 0x2c + +gUnknown_085E93D5:: @ 85E93D5 + .incbin "baserom.gba", 0x5e93d5, 0xb + +gUnknown_085E93E0:: @ 85E93E0 + .incbin "baserom.gba", 0x5e93e0, 0xf + +gUnknown_085E93EF:: @ 85E93EF + .incbin "baserom.gba", 0x5e93ef, 0x28 + +gUnknown_085E9417:: @ 85E9417 + .incbin "baserom.gba", 0x5e9417, 0x28 + +gUnknown_085E943F:: @ 85E943F + .incbin "baserom.gba", 0x5e943f, 0x29 + +gUnknown_085E9468:: @ 85E9468 + .incbin "baserom.gba", 0x5e9468, 0x2b + +gUnknown_085E9493:: @ 85E9493 + .incbin "baserom.gba", 0x5e9493, 0x32 + +gUnknown_085E94C5:: @ 85E94C5 + .incbin "baserom.gba", 0x5e94c5, 0x22 + +gUnknown_085E94E7:: @ 85E94E7 + .incbin "baserom.gba", 0x5e94e7, 0x29 + +gUnknown_085E9510:: @ 85E9510 + .incbin "baserom.gba", 0x5e9510, 0x29 + +gUnknown_085E9539:: @ 85E9539 + .incbin "baserom.gba", 0x5e9539, 0x1f + +gUnknown_085E9558:: @ 85E9558 + .incbin "baserom.gba", 0x5e9558, 0x27 + +gUnknown_085E957F:: @ 85E957F + .incbin "baserom.gba", 0x5e957f, 0x1c + +gUnknown_085E959B:: @ 85E959B + .incbin "baserom.gba", 0x5e959b, 0x2c + +gUnknown_085E95C7:: @ 85E95C7 + .incbin "baserom.gba", 0x5e95c7, 0x23 + +gUnknown_085E95EA:: @ 85E95EA + .incbin "baserom.gba", 0x5e95ea, 0x25 + +gUnknown_085E960F:: @ 85E960F + .incbin "baserom.gba", 0x5e960f, 0x20 + +gUnknown_085E962F:: @ 85E962F + .incbin "baserom.gba", 0x5e962f, 0x25 + +gUnknown_085E9654:: @ 85E9654 + .incbin "baserom.gba", 0x5e9654, 0x23 + +gUnknown_085E9677:: @ 85E9677 + .incbin "baserom.gba", 0x5e9677, 0x25 + +gUnknown_085E969C:: @ 85E969C + .incbin "baserom.gba", 0x5e969c, 0x47 + +gUnknown_085E96E3:: @ 85E96E3 + .incbin "baserom.gba", 0x5e96e3, 0x3 + +gUnknown_085E96E6:: @ 85E96E6 + .incbin "baserom.gba", 0x5e96e6, 0x8 + +gUnknown_085E96EE:: @ 85E96EE + .incbin "baserom.gba", 0x5e96ee, 0x8 + +gUnknown_085E96F6:: @ 85E96F6 + .incbin "baserom.gba", 0x5e96f6, 0x1c + +gUnknown_085E9712:: @ 85E9712 + .incbin "baserom.gba", 0x5e9712, 0x26 + +gUnknown_085E9738:: @ 85E9738 + .incbin "baserom.gba", 0x5e9738, 0x1c + +gUnknown_085E9754:: @ 85E9754 + .incbin "baserom.gba", 0x5e9754, 0x1b + +gUnknown_085E976F:: @ 85E976F + .incbin "baserom.gba", 0x5e976f, 0x20 + +gUnknown_085E978F:: @ 85E978F + .incbin "baserom.gba", 0x5e978f, 0x23 + +gUnknown_085E97B2:: @ 85E97B2 + .incbin "baserom.gba", 0x5e97b2, 0x33 + +gUnknown_085E97E5:: @ 85E97E5 + .incbin "baserom.gba", 0x5e97e5, 0x17 + +gUnknown_085E97FC:: @ 85E97FC + .incbin "baserom.gba", 0x5e97fc, 0x34 + +gUnknown_085E9830:: @ 85E9830 + .incbin "baserom.gba", 0x5e9830, 0x25 + +gUnknown_085E9855:: @ 85E9855 + .incbin "baserom.gba", 0x5e9855, 0x22 + +gUnknown_085E9877:: @ 85E9877 + .incbin "baserom.gba", 0x5e9877, 0x20 + +gUnknown_085E9897:: @ 85E9897 + .incbin "baserom.gba", 0x5e9897, 0x1d + +gUnknown_085E98B4:: @ 85E98B4 + .incbin "baserom.gba", 0x5e98b4, 0x38 + +gUnknown_085E98EC:: @ 85E98EC + .incbin "baserom.gba", 0x5e98ec, 0x2f + +gUnknown_085E991B:: @ 85E991B + .incbin "baserom.gba", 0x5e991b, 0x1f + +gUnknown_085E993A:: @ 85E993A + .incbin "baserom.gba", 0x5e993a, 0x46 + +gUnknown_085E9980:: @ 85E9980 + .incbin "baserom.gba", 0x5e9980, 0x1d + +gUnknown_085E999D:: @ 85E999D + .incbin "baserom.gba", 0x5e999d, 0x1b + +gUnknown_085E99B8:: @ 85E99B8 + .incbin "baserom.gba", 0x5e99b8, 0x23 + +gUnknown_085E99DB:: @ 85E99DB + .incbin "baserom.gba", 0x5e99db, 0x2d + +gUnknown_085E9A08:: @ 85E9A08 + .incbin "baserom.gba", 0x5e9a08, 0x38 + +gUnknown_085E9A40:: @ 85E9A40 + .incbin "baserom.gba", 0x5e9a40, 0x29 + +gUnknown_085E9A69:: @ 85E9A69 + .incbin "baserom.gba", 0x5e9a69, 0x3c + +gUnknown_085E9AA5:: @ 85E9AA5 + .incbin "baserom.gba", 0x5e9aa5, 0xf + +gUnknown_085E9AB4:: @ 85E9AB4 + .incbin "baserom.gba", 0x5e9ab4, 0x35 + +gUnknown_085E9AE9:: @ 85E9AE9 + .incbin "baserom.gba", 0x5e9ae9, 0x74 + +gUnknown_085E9B5D:: @ 85E9B5D + .incbin "baserom.gba", 0x5e9b5d, 0x19 + +gUnknown_085E9B76:: @ 85E9B76 + .incbin "baserom.gba", 0x5e9b76, 0x20 + +gUnknown_085E9B96:: @ 85E9B96 + .incbin "baserom.gba", 0x5e9b96, 0x22 + +gUnknown_085E9BB8:: @ 85E9BB8 + .incbin "baserom.gba", 0x5e9bb8, 0x48 + +gUnknown_085E9C00:: @ 85E9C00 + .incbin "baserom.gba", 0x5e9c00, 0x17 + +gUnknown_085E9C17:: @ 85E9C17 + .incbin "baserom.gba", 0x5e9c17, 0x27 + +gUnknown_085E9C3E:: @ 85E9C3E + .incbin "baserom.gba", 0x5e9c3e, 0x21 + +gUnknown_085E9C5F:: @ 85E9C5F + .incbin "baserom.gba", 0x5e9c5f, 0x1d + +gUnknown_085E9C7C:: @ 85E9C7C + .incbin "baserom.gba", 0x5e9c7c, 0xe + +gUnknown_085E9C8A:: @ 85E9C8A + .incbin "baserom.gba", 0x5e9c8a, 0x18 + +gUnknown_085E9CA2:: @ 85E9CA2 + .incbin "baserom.gba", 0x5e9ca2, 0x15 + +gUnknown_085E9CB7:: @ 85E9CB7 + .incbin "baserom.gba", 0x5e9cb7, 0x29 + +gUnknown_085E9CE0:: @ 85E9CE0 + .incbin "baserom.gba", 0x5e9ce0, 0x15 + +gUnknown_085E9CF5:: @ 85E9CF5 + .incbin "baserom.gba", 0x5e9cf5, 0x15 + +gUnknown_085E9D0A:: @ 85E9D0A + .incbin "baserom.gba", 0x5e9d0a, 0x1b + +gUnknown_085E9D25:: @ 85E9D25 + .incbin "baserom.gba", 0x5e9d25, 0x20 + +gUnknown_085E9D45:: @ 85E9D45 + .incbin "baserom.gba", 0x5e9d45, 0x28 + +gUnknown_085E9D6D:: @ 85E9D6D + .incbin "baserom.gba", 0x5e9d6d, 0x23 + +gUnknown_085E9D90:: @ 85E9D90 + .incbin "baserom.gba", 0x5e9d90, 0x2e + +gUnknown_085E9DBE:: @ 85E9DBE + .incbin "baserom.gba", 0x5e9dbe, 0x23 + +gUnknown_085E9DE1:: @ 85E9DE1 + .incbin "baserom.gba", 0x5e9de1, 0x1f + +gUnknown_085E9E00:: @ 85E9E00 + .incbin "baserom.gba", 0x5e9e00, 0x14 + +gUnknown_085E9E14:: @ 85E9E14 + .incbin "baserom.gba", 0x5e9e14, 0x2da + +gUnknown_085EA0EE:: @ 85EA0EE + .incbin "baserom.gba", 0x5ea0ee, 0x22 + +gUnknown_085EA110:: @ 85EA110 + .incbin "baserom.gba", 0x5ea110, 0x16 + +gUnknown_085EA126:: @ 85EA126 + .incbin "baserom.gba", 0x5ea126, 0x13 + +gUnknown_085EA139:: @ 85EA139 + .incbin "baserom.gba", 0x5ea139, 0x1c + +gUnknown_085EA155:: @ 85EA155 + .incbin "baserom.gba", 0x5ea155, 0x16 + +gUnknown_085EA16B:: @ 85EA16B + .incbin "baserom.gba", 0x5ea16b, 0x2b + +gUnknown_085EA196:: @ 85EA196 + .incbin "baserom.gba", 0x5ea196, 0x34 + +gUnknown_085EA1CA:: @ 85EA1CA + .incbin "baserom.gba", 0x5ea1ca, 0x3 + +gUnknown_085EA1CD:: @ 85EA1CD + .incbin "baserom.gba", 0x5ea1cd, 0x1b + +gUnknown_085EA1E8:: @ 85EA1E8 + .incbin "baserom.gba", 0x5ea1e8, 0x28 + +gUnknown_085EA210:: @ 85EA210 + .incbin "baserom.gba", 0x5ea210, 0x24 + +gUnknown_085EA234:: @ 85EA234 + .incbin "baserom.gba", 0x5ea234, 0x108 + +gUnknown_085EA33C:: @ 85EA33C + .incbin "baserom.gba", 0x5ea33c, 0x7 + +gUnknown_085EA343:: @ 85EA343 + .incbin "baserom.gba", 0x5ea343, 0x8 + +gUnknown_085EA34B:: @ 85EA34B + .incbin "baserom.gba", 0x5ea34b, 0x8 + +gUnknown_085EA353:: @ 85EA353 + .incbin "baserom.gba", 0x5ea353, 0x8 + +gUnknown_085EA35B:: @ 85EA35B + .incbin "baserom.gba", 0x5ea35b, 0x6 + +gUnknown_085EA361:: @ 85EA361 + .incbin "baserom.gba", 0x5ea361, 0x4 + +gUnknown_085EA365:: @ 85EA365 + .incbin "baserom.gba", 0x5ea365, 0x4 + +gUnknown_085EA369:: @ 85EA369 + .incbin "baserom.gba", 0x5ea369, 0xf + +gUnknown_085EA378:: @ 85EA378 + .incbin "baserom.gba", 0x5ea378, 0x6 + +gUnknown_085EA37E:: @ 85EA37E + .incbin "baserom.gba", 0x5ea37e, 0x6 + +gUnknown_085EA384:: @ 85EA384 + .incbin "baserom.gba", 0x5ea384, 0x9 + +gUnknown_085EA38D:: @ 85EA38D + .incbin "baserom.gba", 0x5ea38d, 0x7 + +gUnknown_085EA394:: @ 85EA394 + .incbin "baserom.gba", 0x5ea394, 0x4 + +gUnknown_085EA398:: @ 85EA398 + .incbin "baserom.gba", 0x5ea398, 0x7 + +gUnknown_085EA39F:: @ 85EA39F + .incbin "baserom.gba", 0x5ea39f, 0xc + +gUnknown_085EA3AB:: @ 85EA3AB + .incbin "baserom.gba", 0x5ea3ab, 0x9 + +gUnknown_085EA3B4:: @ 85EA3B4 + .incbin "baserom.gba", 0x5ea3b4, 0xc + +gUnknown_085EA3C0:: @ 85EA3C0 + .incbin "baserom.gba", 0x5ea3c0, 0x8 + +gUnknown_085EA3C8:: @ 85EA3C8 + .incbin "baserom.gba", 0x5ea3c8, 0x7 + +gUnknown_085EA3CF:: @ 85EA3CF + .incbin "baserom.gba", 0x5ea3cf, 0xd + +gUnknown_085EA3DC:: @ 85EA3DC + .incbin "baserom.gba", 0x5ea3dc, 0xf + +gUnknown_085EA3EB:: @ 85EA3EB + .incbin "baserom.gba", 0x5ea3eb, 0xd + +gUnknown_085EA3F8:: @ 85EA3F8 + .incbin "baserom.gba", 0x5ea3f8, 0xe + +gUnknown_085EA406:: @ 85EA406 + .incbin "baserom.gba", 0x5ea406, 0x5 + +gUnknown_085EA40B:: @ 85EA40B + .incbin "baserom.gba", 0x5ea40b, 0x37 + +gUnknown_085EA442:: @ 85EA442 + .incbin "baserom.gba", 0x5ea442, 0x33 + +gUnknown_085EA475:: @ 85EA475 + .incbin "baserom.gba", 0x5ea475, 0x2d + +gUnknown_085EA4A2:: @ 85EA4A2 + .incbin "baserom.gba", 0x5ea4a2, 0x29 + +gUnknown_085EA4CB:: @ 85EA4CB + .incbin "baserom.gba", 0x5ea4cb, 0x21 + +gUnknown_085EA4EC:: @ 85EA4EC + .incbin "baserom.gba", 0x5ea4ec, 0x2a + +gUnknown_085EA516:: @ 85EA516 + .incbin "baserom.gba", 0x5ea516, 0x2e + +gUnknown_085EA544:: @ 85EA544 + .incbin "baserom.gba", 0x5ea544, 0x26 + +gUnknown_085EA56A:: @ 85EA56A + .incbin "baserom.gba", 0x5ea56a, 0x3e + +gUnknown_085EA5A8:: @ 85EA5A8 + .incbin "baserom.gba", 0x5ea5a8, 0x33 + +gUnknown_085EA5DB:: @ 85EA5DB + .incbin "baserom.gba", 0x5ea5db, 0x10 + +gUnknown_085EA5EB:: @ 85EA5EB + .incbin "baserom.gba", 0x5ea5eb, 0x2c + +gUnknown_085EA617:: @ 85EA617 + .incbin "baserom.gba", 0x5ea617, 0x30 + +gUnknown_085EA647:: @ 85EA647 + .incbin "baserom.gba", 0x5ea647, 0x31 + +gUnknown_085EA678:: @ 85EA678 + .incbin "baserom.gba", 0x5ea678, 0x33 + +gUnknown_085EA6AB:: @ 85EA6AB + .incbin "baserom.gba", 0x5ea6ab, 0x2c + +gUnknown_085EA6D7:: @ 85EA6D7 + .incbin "baserom.gba", 0x5ea6d7, 0x2b + +gUnknown_085EA702:: @ 85EA702 + .incbin "baserom.gba", 0x5ea702, 0x2d + +gUnknown_085EA72F:: @ 85EA72F + .incbin "baserom.gba", 0x5ea72f, 0x8 + +gUnknown_085EA737:: @ 85EA737 + .incbin "baserom.gba", 0x5ea737, 0x2b + +gUnknown_085EA762:: @ 85EA762 + .incbin "baserom.gba", 0x5ea762, 0x23 + +gUnknown_085EA785:: @ 85EA785 + .incbin "baserom.gba", 0x5ea785, 0x43 + +gUnknown_085EA7C8:: @ 85EA7C8 + .incbin "baserom.gba", 0x5ea7c8, 0x75 + +gUnknown_085EA83D:: @ 85EA83D + .incbin "baserom.gba", 0x5ea83d, 0x4e + +gUnknown_085EA88B:: @ 85EA88B + .incbin "baserom.gba", 0x5ea88b, 0x5 + +gUnknown_085EA890:: @ 85EA890 + .incbin "baserom.gba", 0x5ea890, 0x7 + +gUnknown_085EA897:: @ 85EA897 + .incbin "baserom.gba", 0x5ea897, 0xf + +gUnknown_085EA8A6:: @ 85EA8A6 + .incbin "baserom.gba", 0x5ea8a6, 0x19 + +gUnknown_085EA8BF:: @ 85EA8BF + .incbin "baserom.gba", 0x5ea8bf, 0x13 + +gUnknown_085EA8D2:: @ 85EA8D2 + .incbin "baserom.gba", 0x5ea8d2, 0x18 + +gUnknown_085EA8EA:: @ 85EA8EA + .incbin "baserom.gba", 0x5ea8ea, 0x47 + +gUnknown_085EA931:: @ 85EA931 + .incbin "baserom.gba", 0x5ea931, 0x7d + +gUnknown_085EA9AE:: @ 85EA9AE + .incbin "baserom.gba", 0x5ea9ae, 0x32 + +gUnknown_085EA9E0:: @ 85EA9E0 + .incbin "baserom.gba", 0x5ea9e0, 0x34 + +gUnknown_085EAA14:: @ 85EAA14 + .incbin "baserom.gba", 0x5eaa14, 0x29 + +gUnknown_085EAA3D:: @ 85EAA3D + .incbin "baserom.gba", 0x5eaa3d, 0x25 + +gUnknown_085EAA62:: @ 85EAA62 + .incbin "baserom.gba", 0x5eaa62, 0x1f + +gUnknown_085EAA81:: @ 85EAA81 + .incbin "baserom.gba", 0x5eaa81, 0x22 + +gUnknown_085EAAA3:: @ 85EAAA3 + .incbin "baserom.gba", 0x5eaaa3, 0x22 + +gUnknown_085EAAC5:: @ 85EAAC5 + .incbin "baserom.gba", 0x5eaac5, 0x27 + +gUnknown_085EAAEC:: @ 85EAAEC + .incbin "baserom.gba", 0x5eaaec, 0x62 + +gUnknown_085EAB4E:: @ 85EAB4E + .incbin "baserom.gba", 0x5eab4e, 0x15 + +gUnknown_085EAB63:: @ 85EAB63 + .incbin "baserom.gba", 0x5eab63, 0xe + +gUnknown_085EAB71:: @ 85EAB71 + .incbin "baserom.gba", 0x5eab71, 0x60 + +gUnknown_085EABD1:: @ 85EABD1 + .incbin "baserom.gba", 0x5eabd1, 0x16 + +gUnknown_085EABE7:: @ 85EABE7 + .incbin "baserom.gba", 0x5eabe7, 0x22 + +gUnknown_085EAC09:: @ 85EAC09 + .incbin "baserom.gba", 0x5eac09, 0x19 + +gUnknown_085EAC22:: @ 85EAC22 + .incbin "baserom.gba", 0x5eac22, 0x29 + +gUnknown_085EAC4B:: @ 85EAC4B + .incbin "baserom.gba", 0x5eac4b, 0x18 + +gUnknown_085EAC63:: @ 85EAC63 + .incbin "baserom.gba", 0x5eac63, 0x2a + +gUnknown_085EAC8D:: @ 85EAC8D + .incbin "baserom.gba", 0x5eac8d, 0x28 + +gUnknown_085EACB5:: @ 85EACB5 + .incbin "baserom.gba", 0x5eacb5, 0x13 + +gUnknown_085EACC8:: @ 85EACC8 + .incbin "baserom.gba", 0x5eacc8, 0x3c + +gUnknown_085EAD04:: @ 85EAD04 + .incbin "baserom.gba", 0x5ead04, 0x4 + +gUnknown_085EAD08:: @ 85EAD08 + .incbin "baserom.gba", 0x5ead08, 0x4 + +gUnknown_085EAD0C:: @ 85EAD0C + .incbin "baserom.gba", 0x5ead0c, 0x8 + +gUnknown_085EAD14:: @ 85EAD14 + .incbin "baserom.gba", 0x5ead14, 0x7 + +gUnknown_085EAD1B:: @ 85EAD1B + .incbin "baserom.gba", 0x5ead1b, 0x7 + +gUnknown_085EAD22:: @ 85EAD22 + .incbin "baserom.gba", 0x5ead22, 0x7 + +gUnknown_085EAD29:: @ 85EAD29 + .incbin "baserom.gba", 0x5ead29, 0x7 + +gUnknown_085EAD30:: @ 85EAD30 + .incbin "baserom.gba", 0x5ead30, 0x132 + +gUnknown_085EAE62:: @ 85EAE62 + .incbin "baserom.gba", 0x5eae62, 0x4 + +gUnknown_085EAE66:: @ 85EAE66 + .incbin "baserom.gba", 0x5eae66, 0x4b + +gUnknown_085EAEB1:: @ 85EAEB1 + .incbin "baserom.gba", 0x5eaeb1, 0x7 + +gUnknown_085EAEB8:: @ 85EAEB8 + .incbin "baserom.gba", 0x5eaeb8, 0x230 + +gUnknown_085EB0E8:: @ 85EB0E8 + .incbin "baserom.gba", 0x5eb0e8, 0x5 + +gUnknown_085EB0ED:: @ 85EB0ED + .incbin "baserom.gba", 0x5eb0ed, 0x7 + +gUnknown_085EB0F4:: @ 85EB0F4 + .incbin "baserom.gba", 0x5eb0f4, 0x5 + +gUnknown_085EB0F9:: @ 85EB0F9 + .incbin "baserom.gba", 0x5eb0f9, 0x6 + +gUnknown_085EB0FF:: @ 85EB0FF + .incbin "baserom.gba", 0x5eb0ff, 0x6a + +gUnknown_085EB169:: @ 85EB169 + .incbin "baserom.gba", 0x5eb169, 0xd + +gUnknown_085EB176:: @ 85EB176 + .incbin "baserom.gba", 0x5eb176, 0xd + +gUnknown_085EB183:: @ 85EB183 + .incbin "baserom.gba", 0x5eb183, 0x8 + +gUnknown_085EB18B:: @ 85EB18B + .incbin "baserom.gba", 0x5eb18b, 0xd + +gUnknown_085EB198:: @ 85EB198 + .incbin "baserom.gba", 0x5eb198, 0xc4 + +gUnknown_085EB25C:: @ 85EB25C + .incbin "baserom.gba", 0x5eb25c, 0x8 + +gUnknown_085EB264:: @ 85EB264 + .incbin "baserom.gba", 0x5eb264, 0x8 + +gUnknown_085EB26C:: @ 85EB26C + .incbin "baserom.gba", 0x5eb26c, 0x4 + +gUnknown_085EB270:: @ 85EB270 + .incbin "baserom.gba", 0x5eb270, 0x9 + +gUnknown_085EB279:: @ 85EB279 + .incbin "baserom.gba", 0x5eb279, 0x5 + +gUnknown_085EB27E:: @ 85EB27E + .incbin "baserom.gba", 0x5eb27e, 0x7 + +gUnknown_085EB285:: @ 85EB285 + .incbin "baserom.gba", 0x5eb285, 0x34a + +gUnknown_085EB5CF:: @ 85EB5CF + .incbin "baserom.gba", 0x5eb5cf, 0xb + +gUnknown_085EB5DA:: @ 85EB5DA + .incbin "baserom.gba", 0x5eb5da, 0xb + +gUnknown_085EB5E5:: @ 85EB5E5 + .incbin "baserom.gba", 0x5eb5e5, 0x9 + +gUnknown_085EB5EE:: @ 85EB5EE + .incbin "baserom.gba", 0x5eb5ee, 0xb + +gUnknown_085EB5F9:: @ 85EB5F9 + .incbin "baserom.gba", 0x5eb5f9, 0x8 + +gUnknown_085EB601:: @ 85EB601 + .incbin "baserom.gba", 0x5eb601, 0x9 + +gUnknown_085EB60A:: @ 85EB60A + .incbin "baserom.gba", 0x5eb60a, 0x4 + +gUnknown_085EB60E:: @ 85EB60E + .incbin "baserom.gba", 0x5eb60e, 0x97 + +gUnknown_085EB6A5:: @ 85EB6A5 + .incbin "baserom.gba", 0x5eb6a5, 0x8 + +gUnknown_085EB6AD:: @ 85EB6AD + .incbin "baserom.gba", 0x5eb6ad, 0x13d + +gUnknown_085EB7EA:: @ 85EB7EA + .incbin "baserom.gba", 0x5eb7ea, 0x49f + +gUnknown_085EBC89:: @ 85EBC89 + .incbin "baserom.gba", 0x5ebc89, 0x24 + +gUnknown_085EBCAD:: @ 85EBCAD + .incbin "baserom.gba", 0x5ebcad, 0x14 + +gUnknown_085EBCC1:: @ 85EBCC1 + .incbin "baserom.gba", 0x5ebcc1, 0x89 + +gUnknown_085EBD4A:: @ 85EBD4A + .incbin "baserom.gba", 0x5ebd4a, 0x115 + +gUnknown_085EBE5F:: @ 85EBE5F + .incbin "baserom.gba", 0x5ebe5f, 0xf + +gUnknown_085EBE6E:: @ 85EBE6E + .incbin "baserom.gba", 0x5ebe6e, 0x11f + +gUnknown_085EBF8D:: @ 85EBF8D + .incbin "baserom.gba", 0x5ebf8d, 0x8 + +gUnknown_085EBF95:: @ 85EBF95 + .incbin "baserom.gba", 0x5ebf95, 0x39 + +gUnknown_085EBFCE:: @ 85EBFCE + .incbin "baserom.gba", 0x5ebfce, 0x9 + +gUnknown_085EBFD7:: @ 85EBFD7 + .incbin "baserom.gba", 0x5ebfd7, 0x38 + +gUnknown_085EC00F:: @ 85EC00F + .incbin "baserom.gba", 0x5ec00f, 0x1a + +gUnknown_085EC029:: @ 85EC029 + .incbin "baserom.gba", 0x5ec029, 0x7 + +gUnknown_085EC030:: @ 85EC030 + .incbin "baserom.gba", 0x5ec030, 0x376 + +gUnknown_085EC3A6:: @ 85EC3A6 + .incbin "baserom.gba", 0x5ec3a6, 0xe + +gUnknown_085EC3B4:: @ 85EC3B4 + .incbin "baserom.gba", 0x5ec3b4, 0x5c + +gUnknown_085EC410:: @ 85EC410 + .incbin "baserom.gba", 0x5ec410, 0x1f + +gUnknown_085EC42F:: @ 85EC42F + .incbin "baserom.gba", 0x5ec42f, 0x9a + +gUnknown_085EC4C9:: @ 85EC4C9 + .incbin "baserom.gba", 0x5ec4c9, 0x20 + +gUnknown_085EC4E9:: @ 85EC4E9 + .incbin "baserom.gba", 0x5ec4e9, 0x37 + +gUnknown_085EC520:: @ 85EC520 + .incbin "baserom.gba", 0x5ec520, 0x152 + +gUnknown_085EC672:: @ 85EC672 + .incbin "baserom.gba", 0x5ec672, 0x16 + +gUnknown_085EC688:: @ 85EC688 + .incbin "baserom.gba", 0x5ec688, 0x20 + +gUnknown_085EC6A8:: @ 85EC6A8 + .incbin "baserom.gba", 0x5ec6a8, 0xa + +gUnknown_085EC6B2:: @ 85EC6B2 + .incbin "baserom.gba", 0x5ec6b2, 0x54 + +gUnknown_085EC706:: @ 85EC706 + .incbin "baserom.gba", 0x5ec706, 0x21 + +gUnknown_085EC727:: @ 85EC727 + .incbin "baserom.gba", 0x5ec727, 0x1c + +gUnknown_085EC743:: @ 85EC743 + .incbin "baserom.gba", 0x5ec743, 0xf + +gUnknown_085EC752:: @ 85EC752 + .incbin "baserom.gba", 0x5ec752, 0x13 + +gUnknown_085EC765:: @ 85EC765 + .incbin "baserom.gba", 0x5ec765, 0x3b + +gUnknown_085EC7A0:: @ 85EC7A0 + .incbin "baserom.gba", 0x5ec7a0, 0x41 + +gUnknown_085EC7E1:: @ 85EC7E1 + .incbin "baserom.gba", 0x5ec7e1, 0xe + +gUnknown_085EC7EF:: @ 85EC7EF + .incbin "baserom.gba", 0x5ec7ef, 0x11 + +gUnknown_085EC800:: @ 85EC800 + .incbin "baserom.gba", 0x5ec800, 0x16 + +gUnknown_085EC816:: @ 85EC816 + .incbin "baserom.gba", 0x5ec816, 0x59 + +gUnknown_085EC86F:: @ 85EC86F + .incbin "baserom.gba", 0x5ec86f, 0x65 + +gUnknown_085EC8D4:: @ 85EC8D4 + .incbin "baserom.gba", 0x5ec8d4, 0x43 + +gUnknown_085EC917:: @ 85EC917 + .incbin "baserom.gba", 0x5ec917, 0x38 + +gUnknown_085EC94F:: @ 85EC94F + .incbin "baserom.gba", 0x5ec94f, 0x53 + +gUnknown_085EC9A2:: @ 85EC9A2 + .incbin "baserom.gba", 0x5ec9a2, 0x30 + +gUnknown_085EC9D2:: @ 85EC9D2 + .incbin "baserom.gba", 0x5ec9d2, 0x6 + +gUnknown_085EC9D8:: @ 85EC9D8 + .incbin "baserom.gba", 0x5ec9d8, 0xc + +gUnknown_085EC9E4:: @ 85EC9E4 + .incbin "baserom.gba", 0x5ec9e4, 0x8 + +gUnknown_085EC9EC:: @ 85EC9EC + .incbin "baserom.gba", 0x5ec9ec, 0x21 + +gUnknown_085ECA0D:: @ 85ECA0D + .incbin "baserom.gba", 0x5eca0d, 0x15 + +gUnknown_085ECA22:: @ 85ECA22 + .incbin "baserom.gba", 0x5eca22, 0x16 + +gUnknown_085ECA38:: @ 85ECA38 + .incbin "baserom.gba", 0x5eca38, 0x17 + +gUnknown_085ECA4F:: @ 85ECA4F + .incbin "baserom.gba", 0x5eca4f, 0x3b + +gUnknown_085ECA8A:: @ 85ECA8A + .incbin "baserom.gba", 0x5eca8a, 0x10 + +gUnknown_085ECA9A:: @ 85ECA9A + .incbin "baserom.gba", 0x5eca9a, 0xd + +gUnknown_085ECAA7:: @ 85ECAA7 + .incbin "baserom.gba", 0x5ecaa7, 0x31 + +gUnknown_085ECAD8:: @ 85ECAD8 + .incbin "baserom.gba", 0x5ecad8, 0x34 + +gUnknown_085ECB0C:: @ 85ECB0C + .incbin "baserom.gba", 0x5ecb0c, 0x6 + +gUnknown_085ECB12:: @ 85ECB12 + .incbin "baserom.gba", 0x5ecb12, 0x9 + +gUnknown_085ECB1B:: @ 85ECB1B + .incbin "baserom.gba", 0x5ecb1b, 0x5 + +gUnknown_085ECB20:: @ 85ECB20 + .incbin "baserom.gba", 0x5ecb20, 0xa + +gUnknown_085ECB2A:: @ 85ECB2A + .incbin "baserom.gba", 0x5ecb2a, 0xa + +gUnknown_085ECB34:: @ 85ECB34 + .incbin "baserom.gba", 0x5ecb34, 0x6 + +gUnknown_085ECB3A:: @ 85ECB3A + .incbin "baserom.gba", 0x5ecb3a, 0x4 + +gUnknown_085ECB3E:: @ 85ECB3E + .incbin "baserom.gba", 0x5ecb3e, 0xa + +gUnknown_085ECB48:: @ 85ECB48 + .incbin "baserom.gba", 0x5ecb48, 0x6 + +gUnknown_085ECB4E:: @ 85ECB4E + .incbin "baserom.gba", 0x5ecb4e, 0x4 + +gUnknown_085ECB52:: @ 85ECB52 + .incbin "baserom.gba", 0x5ecb52, 0x6 + +gUnknown_085ECB58:: @ 85ECB58 + .incbin "baserom.gba", 0x5ecb58, 0x7 + +gUnknown_085ECB5F:: @ 85ECB5F + .incbin "baserom.gba", 0x5ecb5f, 0x5 + +gUnknown_085ECB64:: @ 85ECB64 + .incbin "baserom.gba", 0x5ecb64, 0x7 + +gUnknown_085ECB6B:: @ 85ECB6B + .incbin "baserom.gba", 0x5ecb6b, 0x7 + +gUnknown_085ECB72:: @ 85ECB72 + .incbin "baserom.gba", 0x5ecb72, 0x8 + +gUnknown_085ECB7A:: @ 85ECB7A + .incbin "baserom.gba", 0x5ecb7a, 0x6 + +gUnknown_085ECB80:: @ 85ECB80 + .incbin "baserom.gba", 0x5ecb80, 0x7 + +gUnknown_085ECB87:: @ 85ECB87 + .incbin "baserom.gba", 0x5ecb87, 0x3d6 + +gUnknown_085ECF5D:: @ 85ECF5D + .incbin "baserom.gba", 0x5ecf5d, 0xe + +gUnknown_085ECF6B:: @ 85ECF6B + .incbin "baserom.gba", 0x5ecf6b, 0x6 + +gUnknown_085ECF71:: @ 85ECF71 + .incbin "baserom.gba", 0x5ecf71, 0x7 + +gUnknown_085ECF78:: @ 85ECF78 + .incbin "baserom.gba", 0x5ecf78, 0x6 + +gUnknown_085ECF7E:: @ 85ECF7E + .incbin "baserom.gba", 0x5ecf7e, 0x8 + +gUnknown_085ECF86:: @ 85ECF86 + .incbin "baserom.gba", 0x5ecf86, 0x8 + +gUnknown_085ECF8E:: @ 85ECF8E + .incbin "baserom.gba", 0x5ecf8e, 0x1 + +gUnknown_085ECF8F:: @ 85ECF8F + .incbin "baserom.gba", 0x5ecf8f, 0xa + +gUnknown_085ECF99:: @ 85ECF99 + .incbin "baserom.gba", 0x5ecf99, 0xd + +gUnknown_085ECFA6:: @ 85ECFA6 + .incbin "baserom.gba", 0x5ecfa6, 0x12 + +gUnknown_085ECFB8:: @ 85ECFB8 + .incbin "baserom.gba", 0x5ecfb8, 0x35 + +gUnknown_085ECFED:: @ 85ECFED + .incbin "baserom.gba", 0x5ecfed, 0x23 + +gUnknown_085ED010:: @ 85ED010 + .incbin "baserom.gba", 0x5ed010, 0xf + +gUnknown_085ED01F:: @ 85ED01F + .incbin "baserom.gba", 0x5ed01f, 0x17 + +gUnknown_085ED036:: @ 85ED036 + .incbin "baserom.gba", 0x5ed036, 0xc + +gUnknown_085ED042:: @ 85ED042 + .incbin "baserom.gba", 0x5ed042, 0x43 + +gUnknown_085ED085:: @ 85ED085 + .incbin "baserom.gba", 0x5ed085, 0x11 + +gUnknown_085ED096:: @ 85ED096 + .incbin "baserom.gba", 0x5ed096, 0x9 + +gUnknown_085ED09F:: @ 85ED09F + .incbin "baserom.gba", 0x5ed09f, 0x17 + +gUnknown_085ED0B6:: @ 85ED0B6 + .incbin "baserom.gba", 0x5ed0b6, 0x12 + +gUnknown_085ED0C8:: @ 85ED0C8 + .incbin "baserom.gba", 0x5ed0c8, 0xb + +gUnknown_085ED0D3:: @ 85ED0D3 + .incbin "baserom.gba", 0x5ed0d3, 0xd + +gUnknown_085ED0E0:: @ 85ED0E0 + .incbin "baserom.gba", 0x5ed0e0, 0xb3 + +gUnknown_085ED193:: @ 85ED193 + .incbin "baserom.gba", 0x5ed193, 0x5 + +gUnknown_085ED198:: @ 85ED198 + .incbin "baserom.gba", 0x5ed198, 0x8 + +gUnknown_085ED1A0:: @ 85ED1A0 + .incbin "baserom.gba", 0x5ed1a0, 0x7 + +gUnknown_085ED1A7:: @ 85ED1A7 + .incbin "baserom.gba", 0x5ed1a7, 0x4 + +gUnknown_085ED1AB:: @ 85ED1AB + .incbin "baserom.gba", 0x5ed1ab, 0x7 + +gUnknown_085ED1B2:: @ 85ED1B2 + .incbin "baserom.gba", 0x5ed1b2, 0x3 + +gUnknown_085ED1B5:: @ 85ED1B5 + .incbin "baserom.gba", 0x5ed1b5, 0x3 + +gUnknown_085ED1B8:: @ 85ED1B8 + .incbin "baserom.gba", 0x5ed1b8, 0x18 + +gUnknown_085ED1D0:: @ 85ED1D0 + .incbin "baserom.gba", 0x5ed1d0, 0x19 + +gUnknown_085ED1E9:: @ 85ED1E9 + .incbin "baserom.gba", 0x5ed1e9, 0x11 + +gUnknown_085ED1FA:: @ 85ED1FA + .incbin "baserom.gba", 0x5ed1fa, 0xd + +gUnknown_085ED207:: @ 85ED207 + .incbin "baserom.gba", 0x5ed207, 0x17 + +gUnknown_085ED21E:: @ 85ED21E + .incbin "baserom.gba", 0x5ed21e, 0xa + +gUnknown_085ED228:: @ 85ED228 + .incbin "baserom.gba", 0x5ed228, 0x6 + +gUnknown_085ED22E:: @ 85ED22E + .incbin "baserom.gba", 0x5ed22e, 0x5 + +gUnknown_085ED233:: @ 85ED233 + .incbin "baserom.gba", 0x5ed233, 0x5 + +gUnknown_085ED238:: @ 85ED238 + .incbin "baserom.gba", 0x5ed238, 0x71 + +gUnknown_085ED2A9:: @ 85ED2A9 + .incbin "baserom.gba", 0x5ed2a9, 0x14 + +gUnknown_085ED2BD:: @ 85ED2BD + .incbin "baserom.gba", 0x5ed2bd, 0x152 + +gUnknown_085ED40F:: @ 85ED40F + .incbin "baserom.gba", 0x5ed40f, 0x6 + +gUnknown_085ED415:: @ 85ED415 + .incbin "baserom.gba", 0x5ed415, 0x8 + +gUnknown_085ED41D:: @ 85ED41D + .incbin "baserom.gba", 0x5ed41d, 0x6 + +gUnknown_085ED423:: @ 85ED423 + .incbin "baserom.gba", 0x5ed423, 0x7 + +gUnknown_085ED42A:: @ 85ED42A + .incbin "baserom.gba", 0x5ed42a, 0x6 + +gUnknown_085ED430:: @ 85ED430 + .incbin "baserom.gba", 0x5ed430, 0x4 + +gUnknown_085ED434:: @ 85ED434 + .incbin "baserom.gba", 0x5ed434, 0x6 + +gUnknown_085ED43A:: @ 85ED43A + .incbin "baserom.gba", 0x5ed43a, 0x6 + +gUnknown_085ED440:: @ 85ED440 + .incbin "baserom.gba", 0x5ed440, 0xa + +gUnknown_085ED44A:: @ 85ED44A + .incbin "baserom.gba", 0x5ed44a, 0x15b + +gUnknown_085ED5A5:: @ 85ED5A5 + .incbin "baserom.gba", 0x5ed5a5, 0x19 + +gUnknown_085ED5BE:: @ 85ED5BE + .incbin "baserom.gba", 0x5ed5be, 0x216 + +gUnknown_085ED7D4:: @ 85ED7D4 + .incbin "baserom.gba", 0x5ed7d4, 0xc + +gUnknown_085ED7E0:: @ 85ED7E0 + .incbin "baserom.gba", 0x5ed7e0, 0x28 + +gUnknown_085ED808:: @ 85ED808 + .incbin "baserom.gba", 0x5ed808, 0x8 + +gUnknown_085ED810:: @ 85ED810 + .incbin "baserom.gba", 0x5ed810, 0x10 + +gUnknown_085ED820:: @ 85ED820 + .incbin "baserom.gba", 0x5ed820, 0xc + +gUnknown_085ED82C:: @ 85ED82C + .incbin "baserom.gba", 0x5ed82c, 0x4 + +gUnknown_085ED830:: @ 85ED830 + .incbin "baserom.gba", 0x5ed830, 0x8 + +gUnknown_085ED838:: @ 85ED838 + .incbin "baserom.gba", 0x5ed838, 0x8 + +gUnknown_085ED840:: @ 85ED840 + .incbin "baserom.gba", 0x5ed840, 0x8 + +gUnknown_085ED848:: @ 85ED848 + .incbin "baserom.gba", 0x5ed848, 0x8 + +gUnknown_085ED850:: @ 85ED850 + .incbin "baserom.gba", 0x5ed850, 0xc + +gUnknown_085ED85C:: @ 85ED85C + .incbin "baserom.gba", 0x5ed85c, 0x4 + +gUnknown_085ED860:: @ 85ED860 + .incbin "baserom.gba", 0x5ed860, 0x18 + +gUnknown_085ED878:: @ 85ED878 + .incbin "baserom.gba", 0x5ed878, 0x58 + +gUnknown_085ED8D0:: @ 85ED8D0 + .incbin "baserom.gba", 0x5ed8d0, 0xc + +gUnknown_085ED8DC:: @ 85ED8DC + .incbin "baserom.gba", 0x5ed8dc, 0x18 + +gUnknown_085ED8F4:: @ 85ED8F4 + .incbin "baserom.gba", 0x5ed8f4, 0xb + +gUnknown_085ED8FF:: @ 85ED8FF + .incbin "baserom.gba", 0x5ed8ff, 0xf + +gUnknown_085ED90E:: @ 85ED90E + .incbin "baserom.gba", 0x5ed90e, 0xe + +gUnknown_085ED91C:: @ 85ED91C + .incbin "baserom.gba", 0x5ed91c, 0x3a7 + +gUnknown_085EDCC3:: @ 85EDCC3 + .incbin "baserom.gba", 0x5edcc3, 0x7 + +gUnknown_085EDCCA:: @ 85EDCCA + .incbin "baserom.gba", 0x5edcca, 0x5 + +gUnknown_085EDCCF:: @ 85EDCCF + .incbin "baserom.gba", 0x5edccf, 0x8 + +gUnknown_085EDCD7:: @ 85EDCD7 + .incbin "baserom.gba", 0x5edcd7, 0x7 + +gUnknown_085EDCDE:: @ 85EDCDE + .incbin "baserom.gba", 0x5edcde, 0x7 + +gUnknown_085EDCE5:: @ 85EDCE5 + .incbin "baserom.gba", 0x5edce5, 0x64 + +gUnknown_085EDD49:: @ 85EDD49 + .incbin "baserom.gba", 0x5edd49, 0x22 + +gUnknown_085EDD6B:: @ 85EDD6B + .incbin "baserom.gba", 0x5edd6b, 0x1b + +gUnknown_085EDD86:: @ 85EDD86 + .incbin "baserom.gba", 0x5edd86, 0x15 + +gUnknown_085EDD9B:: @ 85EDD9B + .incbin "baserom.gba", 0x5edd9b, 0x22 + +gUnknown_085EDDBD:: @ 85EDDBD + .incbin "baserom.gba", 0x5eddbd, 0x25 + +gUnknown_085EDDE2:: @ 85EDDE2 + .incbin "baserom.gba", 0x5edde2, 0x19 + +gUnknown_085EDDFB:: @ 85EDDFB + .incbin "baserom.gba", 0x5eddfb, 0x1d + +gUnknown_085EDE18:: @ 85EDE18 + .incbin "baserom.gba", 0x5ede18, 0x14 + +gUnknown_085EDE2C:: @ 85EDE2C + .incbin "baserom.gba", 0x5ede2c, 0x31 + +gUnknown_085EDE5D:: @ 85EDE5D + .incbin "baserom.gba", 0x5ede5d, 0x8 + +gUnknown_085EDE65:: @ 85EDE65 + .incbin "baserom.gba", 0x5ede65, 0x17 + +gUnknown_085EDE7C:: @ 85EDE7C + .incbin "baserom.gba", 0x5ede7c, 0x8 + +gUnknown_085EDE84:: @ 85EDE84 + .incbin "baserom.gba", 0x5ede84, 0x9 + +gUnknown_085EDE8D:: @ 85EDE8D + .incbin "baserom.gba", 0x5ede8d, 0x46 + +gUnknown_085EDED3:: @ 85EDED3 + .incbin "baserom.gba", 0x5eded3, 0x21 + +gUnknown_085EDEF4:: @ 85EDEF4 + .incbin "baserom.gba", 0x5edef4, 0x1d + +gUnknown_085EDF11:: @ 85EDF11 + .incbin "baserom.gba", 0x5edf11, 0x19 + +gUnknown_085EDF2A:: @ 85EDF2A + .incbin "baserom.gba", 0x5edf2a, 0x14 + +gUnknown_085EDF3E:: @ 85EDF3E + .incbin "baserom.gba", 0x5edf3e, 0x31 + +gUnknown_085EDF6F:: @ 85EDF6F + .incbin "baserom.gba", 0x5edf6f, 0x17 + +gUnknown_085EDF86:: @ 85EDF86 + .incbin "baserom.gba", 0x5edf86, 0x1a + +gUnknown_085EDFA0:: @ 85EDFA0 + .incbin "baserom.gba", 0x5edfa0, 0x4 + +gUnknown_085EDFA4:: @ 85EDFA4 + .incbin "baserom.gba", 0x5edfa4, 0x4 + +gUnknown_085EDFA8:: @ 85EDFA8 + .incbin "baserom.gba", 0x5edfa8, 0x4 + +gUnknown_085EDFAC:: @ 85EDFAC + .incbin "baserom.gba", 0x5edfac, 0x4 + +gUnknown_085EDFB0:: @ 85EDFB0 + .incbin "baserom.gba", 0x5edfb0, 0xf + +gUnknown_085EDFBF:: @ 85EDFBF + .incbin "baserom.gba", 0x5edfbf, 0xa + +gUnknown_085EDFC9:: @ 85EDFC9 + .incbin "baserom.gba", 0x5edfc9, 0xd + +gUnknown_085EDFD6:: @ 85EDFD6 + .incbin "baserom.gba", 0x5edfd6, 0x1f + +gUnknown_085EDFF5:: @ 85EDFF5 + .incbin "baserom.gba", 0x5edff5, 0x1f + +gUnknown_085EE014:: @ 85EE014 + .incbin "baserom.gba", 0x5ee014, 0x48 + +gUnknown_085EE05C:: @ 85EE05C + .incbin "baserom.gba", 0x5ee05c, 0xf + +gUnknown_085EE06B:: @ 85EE06B + .incbin "baserom.gba", 0x5ee06b, 0x2c + +gUnknown_085EE097:: @ 85EE097 + .incbin "baserom.gba", 0x5ee097, 0xc + +gUnknown_085EE0A3:: @ 85EE0A3 + .incbin "baserom.gba", 0x5ee0a3, 0x1c + +gUnknown_085EE0BF:: @ 85EE0BF + .incbin "baserom.gba", 0x5ee0bf, 0x1d + +gUnknown_085EE0DC:: @ 85EE0DC + .incbin "baserom.gba", 0x5ee0dc, 0x1e + +gUnknown_085EE0FA:: @ 85EE0FA + .incbin "baserom.gba", 0x5ee0fa, 0xd + +gUnknown_085EE107:: @ 85EE107 + .incbin "baserom.gba", 0x5ee107, 0x19 + +gUnknown_085EE120:: @ 85EE120 + .incbin "baserom.gba", 0x5ee120, 0xd + +gUnknown_085EE12D:: @ 85EE12D + .incbin "baserom.gba", 0x5ee12d, 0x2b + +gUnknown_085EE158:: @ 85EE158 + .incbin "baserom.gba", 0x5ee158, 0x20 + +gUnknown_085EE178:: @ 85EE178 + .incbin "baserom.gba", 0x5ee178, 0x20 + +gUnknown_085EE198:: @ 85EE198 + .incbin "baserom.gba", 0x5ee198, 0x1f + +gUnknown_085EE1B7:: @ 85EE1B7 + .incbin "baserom.gba", 0x5ee1b7, 0x24 + +gUnknown_085EE1DB:: @ 85EE1DB + .incbin "baserom.gba", 0x5ee1db, 0x23 + +gUnknown_085EE1FE:: @ 85EE1FE + .incbin "baserom.gba", 0x5ee1fe, 0x23 + +gUnknown_085EE221:: @ 85EE221 + .incbin "baserom.gba", 0x5ee221, 0x20 + +gUnknown_085EE241:: @ 85EE241 + .incbin "baserom.gba", 0x5ee241, 0x20 + +gUnknown_085EE261:: @ 85EE261 + .incbin "baserom.gba", 0x5ee261, 0x1b + +gUnknown_085EE27C:: @ 85EE27C + .incbin "baserom.gba", 0x5ee27c, 0x1c + +gUnknown_085EE298:: @ 85EE298 + .incbin "baserom.gba", 0x5ee298, 0x20 + +gUnknown_085EE2B8:: @ 85EE2B8 + .incbin "baserom.gba", 0x5ee2b8, 0x20 + +gUnknown_085EE2D8:: @ 85EE2D8 + .incbin "baserom.gba", 0x5ee2d8, 0x1a + +gUnknown_085EE2F2:: @ 85EE2F2 + .incbin "baserom.gba", 0x5ee2f2, 0x7 + +gUnknown_085EE2F9:: @ 85EE2F9 + .incbin "baserom.gba", 0x5ee2f9, 0x9 + +gUnknown_085EE302:: @ 85EE302 + .incbin "baserom.gba", 0x5ee302, 0xf + +gUnknown_085EE311:: @ 85EE311 + .incbin "baserom.gba", 0x5ee311, 0x8 + +gUnknown_085EE319:: @ 85EE319 + .incbin "baserom.gba", 0x5ee319, 0x7 + +gUnknown_085EE320:: @ 85EE320 + .incbin "baserom.gba", 0x5ee320, 0x6 + +gUnknown_085EE326:: @ 85EE326 + .incbin "baserom.gba", 0x5ee326, 0xc + +gUnknown_085EE332:: @ 85EE332 + .incbin "baserom.gba", 0x5ee332, 0x6 + +gUnknown_085EE338:: @ 85EE338 + .incbin "baserom.gba", 0x5ee338, 0x11 + +gUnknown_085EE349:: @ 85EE349 + .incbin "baserom.gba", 0x5ee349, 0x12 + +gUnknown_085EE35B:: @ 85EE35B + .incbin "baserom.gba", 0x5ee35b, 0x12 + +gUnknown_085EE36D:: @ 85EE36D + .incbin "baserom.gba", 0x5ee36d, 0x14 + +gUnknown_085EE381:: @ 85EE381 + .incbin "baserom.gba", 0x5ee381, 0x11 + +gUnknown_085EE392:: @ 85EE392 + .incbin "baserom.gba", 0x5ee392, 0xa + +gUnknown_085EE39C:: @ 85EE39C + .incbin "baserom.gba", 0x5ee39c, 0x88 + +gUnknown_085EE424:: @ 85EE424 + .incbin "baserom.gba", 0x5ee424, 0x9 + +gUnknown_085EE42D:: @ 85EE42D + .incbin "baserom.gba", 0x5ee42d, 0x22 + +gUnknown_085EE44F:: @ 85EE44F + .incbin "baserom.gba", 0x5ee44f, 0x24 + +gUnknown_085EE473:: @ 85EE473 + .incbin "baserom.gba", 0x5ee473, 0x1e + +gUnknown_085EE491:: @ 85EE491 + .incbin "baserom.gba", 0x5ee491, 0x7 + +gUnknown_085EE498:: @ 85EE498 + .incbin "baserom.gba", 0x5ee498, 0x2 + +gUnknown_085EE49A:: @ 85EE49A + .incbin "baserom.gba", 0x5ee49a, 0xa + +gUnknown_085EE4A4:: @ 85EE4A4 + .incbin "baserom.gba", 0x5ee4a4, 0x53 + +gUnknown_085EE4F7:: @ 85EE4F7 + .incbin "baserom.gba", 0x5ee4f7, 0x15 + +gUnknown_085EE50C:: @ 85EE50C + .incbin "baserom.gba", 0x5ee50c, 0x47 + +gUnknown_085EE553:: @ 85EE553 + .incbin "baserom.gba", 0x5ee553, 0x1f + +gUnknown_085EE572:: @ 85EE572 + .incbin "baserom.gba", 0x5ee572, 0x17 + +gUnknown_085EE589:: @ 85EE589 + .incbin "baserom.gba", 0x5ee589, 0x4b + +gUnknown_085EE5D4:: @ 85EE5D4 + .incbin "baserom.gba", 0x5ee5d4, 0xb + +gUnknown_085EE5DF:: @ 85EE5DF + .incbin "baserom.gba", 0x5ee5df, 0xa + +gUnknown_085EE5E9:: @ 85EE5E9 + .incbin "baserom.gba", 0x5ee5e9, 0xb + +gUnknown_085EE5F4:: @ 85EE5F4 + .incbin "baserom.gba", 0x5ee5f4, 0x9 + +gUnknown_085EE5FD:: @ 85EE5FD + .incbin "baserom.gba", 0x5ee5fd, 0xa + +gUnknown_085EE607:: @ 85EE607 + .incbin "baserom.gba", 0x5ee607, 0xc + +gUnknown_085EE613:: @ 85EE613 + .incbin "baserom.gba", 0x5ee613, 0xa + +gUnknown_085EE61D:: @ 85EE61D + .incbin "baserom.gba", 0x5ee61d, 0xb + +gUnknown_085EE628:: @ 85EE628 + .incbin "baserom.gba", 0x5ee628, 0xd + +gUnknown_085EE635:: @ 85EE635 + .incbin "baserom.gba", 0x5ee635, 0xb + +gUnknown_085EE640:: @ 85EE640 + .incbin "baserom.gba", 0x5ee640, 0x7 + +gUnknown_085EE647:: @ 85EE647 + .incbin "baserom.gba", 0x5ee647, 0xd + +gUnknown_085EE654:: @ 85EE654 + .incbin "baserom.gba", 0x5ee654, 0x9 + +gUnknown_085EE65D:: @ 85EE65D + .incbin "baserom.gba", 0x5ee65d, 0xa + +gUnknown_085EE667:: @ 85EE667 + .incbin "baserom.gba", 0x5ee667, 0x23 + +gUnknown_085EE68A:: @ 85EE68A + .incbin "baserom.gba", 0x5ee68a, 0x4 + +gUnknown_085EE68E:: @ 85EE68E + .incbin "baserom.gba", 0x5ee68e, 0x2 + +gUnknown_085EE690:: @ 85EE690 + .incbin "baserom.gba", 0x5ee690, 0x6f + +gUnknown_085EE6FF:: @ 85EE6FF + .incbin "baserom.gba", 0x5ee6ff, 0x17 + +gUnknown_085EE716:: @ 85EE716 + .incbin "baserom.gba", 0x5ee716, 0x4f + +gUnknown_085EE765:: @ 85EE765 + .incbin "baserom.gba", 0x5ee765, 0x23 + +gUnknown_085EE788:: @ 85EE788 + .incbin "baserom.gba", 0x5ee788, 0x37 + +gUnknown_085EE7BF:: @ 85EE7BF + .incbin "baserom.gba", 0x5ee7bf, 0xf + +gUnknown_085EE7CE:: @ 85EE7CE + .incbin "baserom.gba", 0x5ee7ce, 0x3c + +gUnknown_085EE80A:: @ 85EE80A + .incbin "baserom.gba", 0x5ee80a, 0x1d + +gUnknown_085EE827:: @ 85EE827 + .incbin "baserom.gba", 0x5ee827, 0x28 + +gUnknown_085EE84F:: @ 85EE84F + .incbin "baserom.gba", 0x5ee84f, 0x6 + +gUnknown_085EE855:: @ 85EE855 + .incbin "baserom.gba", 0x5ee855, 0x9 + +gUnknown_085EE85E:: @ 85EE85E + .incbin "baserom.gba", 0x5ee85e, 0x93 + +gUnknown_085EE8F1:: @ 85EE8F1 + .incbin "baserom.gba", 0x5ee8f1, 0x6 + +gUnknown_085EE8F7:: @ 85EE8F7 + .incbin "baserom.gba", 0x5ee8f7, 0xc + +gUnknown_085EE903:: @ 85EE903 + .incbin "baserom.gba", 0x5ee903, 0x1b + +gUnknown_085EE91E:: @ 85EE91E + .incbin "baserom.gba", 0x5ee91e, 0x15 + +gUnknown_085EE933:: @ 85EE933 + .incbin "baserom.gba", 0x5ee933, 0xf + +gUnknown_085EE942:: @ 85EE942 + .incbin "baserom.gba", 0x5ee942, 0x17 + +gUnknown_085EE959:: @ 85EE959 + .incbin "baserom.gba", 0x5ee959, 0xd + +gUnknown_085EE966:: @ 85EE966 + .incbin "baserom.gba", 0x5ee966, 0x11 + +gUnknown_085EE977:: @ 85EE977 + .incbin "baserom.gba", 0x5ee977, 0x16 + +@ 85EE98D + .include "data/text/easy_chat/easy_chat_group_names.inc" + +gUnknown_085EEA42:: @ 85EEA42 + .incbin "baserom.gba", 0x5eea42, 0x31 + +gUnknown_085EEA73:: @ 85EEA73 + .incbin "baserom.gba", 0x5eea73, 0x3 + +gUnknown_085EEA76:: @ 85EEA76 + .incbin "baserom.gba", 0x5eea76, 0x2 + +gUnknown_085EEA78:: @ 85EEA78 + .incbin "baserom.gba", 0x5eea78, 0x6 + +gUnknown_085EEA7E:: @ 85EEA7E + .incbin "baserom.gba", 0x5eea7e, 0x10 + +gUnknown_085EEA8E:: @ 85EEA8E + .incbin "baserom.gba", 0x5eea8e, 0x68 + +gUnknown_085EEAF6:: @ 85EEAF6 + .incbin "baserom.gba", 0x5eeaf6, 0x15 + +gUnknown_085EEB0B:: @ 85EEB0B + .incbin "baserom.gba", 0x5eeb0b, 0x73 + +gUnknown_085EEB7E:: @ 85EEB7E + .incbin "baserom.gba", 0x5eeb7e, 0x34 + +gUnknown_085EEBB2:: @ 85EEBB2 + .incbin "baserom.gba", 0x5eebb2, 0xf + +gUnknown_085EEBC1:: @ 85EEBC1 + .incbin "baserom.gba", 0x5eebc1, 0x1a + +gUnknown_085EEBDB:: @ 85EEBDB + .incbin "baserom.gba", 0x5eebdb, 0x1b + +gUnknown_085EEBF6:: @ 85EEBF6 + .incbin "baserom.gba", 0x5eebf6, 0x1a + +gUnknown_085EEC10:: @ 85EEC10 + .incbin "baserom.gba", 0x5eec10, 0x5 + +gUnknown_085EEC15:: @ 85EEC15 + .incbin "baserom.gba", 0x5eec15, 0x8 + +gUnknown_085EEC1D:: @ 85EEC1D + .incbin "baserom.gba", 0x5eec1d, 0x7 + +gUnknown_085EEC24:: @ 85EEC24 + .incbin "baserom.gba", 0x5eec24, 0x9 + +gUnknown_085EEC2D:: @ 85EEC2D + .incbin "baserom.gba", 0x5eec2d, 0x1c + +gUnknown_085EEC49:: @ 85EEC49 + .incbin "baserom.gba", 0x5eec49, 0x4 + +gUnknown_085EEC4D:: @ 85EEC4D + .incbin "baserom.gba", 0x5eec4d, 0x3 + +gUnknown_085EEC50:: @ 85EEC50 + .incbin "baserom.gba", 0x5eec50, 0x16 + +gUnknown_085EEC66:: @ 85EEC66 + .incbin "baserom.gba", 0x5eec66, 0xd + +gUnknown_085EEC73:: @ 85EEC73 + .incbin "baserom.gba", 0x5eec73, 0x18 + +gUnknown_085EEC8B:: @ 85EEC8B + .incbin "baserom.gba", 0x5eec8b, 0x1a + +gUnknown_085EECA5:: @ 85EECA5 + .incbin "baserom.gba", 0x5eeca5, 0x5 + +gUnknown_085EECAA:: @ 85EECAA + .incbin "baserom.gba", 0x5eecaa, 0x8 + +gUnknown_085EECB2:: @ 85EECB2 + .incbin "baserom.gba", 0x5eecb2, 0x9 + +gUnknown_085EECBB:: @ 85EECBB + .incbin "baserom.gba", 0x5eecbb, 0xf + +gUnknown_085EECCA:: @ 85EECCA + .incbin "baserom.gba", 0x5eecca, 0x4 + +gUnknown_085EECCE:: @ 85EECCE + .incbin "baserom.gba", 0x5eecce, 0x3 + +gUnknown_085EECD1:: @ 85EECD1 + .incbin "baserom.gba", 0x5eecd1, 0xc + +gUnknown_085EECDD:: @ 85EECDD + .incbin "baserom.gba", 0x5eecdd, 0x13 + +gUnknown_085EECF0:: @ 85EECF0 + .incbin "baserom.gba", 0x5eecf0, 0x1a + +gUnknown_085EED0A:: @ 85EED0A + .incbin "baserom.gba", 0x5eed0a, 0x1a + +gUnknown_085EED24:: @ 85EED24 + .incbin "baserom.gba", 0x5eed24, 0x2 + +gUnknown_085EED26:: @ 85EED26 + .incbin "baserom.gba", 0x5eed26, 0x7 + +gUnknown_085EED2D:: @ 85EED2D + .incbin "baserom.gba", 0x5eed2d, 0x7 + +gUnknown_085EED34:: @ 85EED34 + .incbin "baserom.gba", 0x5eed34, 0x8 + +gUnknown_085EED3C:: @ 85EED3C + .incbin "baserom.gba", 0x5eed3c, 0x1b4 + +gUnknown_085EEEF0:: @ 85EEEF0 + .incbin "baserom.gba", 0x5eeef0, 0x3c + +gUnknown_085EEF2C:: @ 85EEF2C + .incbin "baserom.gba", 0x5eef2c, 0x3c + +gUnknown_085EEF68:: @ 85EEF68 + .incbin "baserom.gba", 0x5eef68, 0x2c + +gUnknown_085EEF94:: @ 85EEF94 + .incbin "baserom.gba", 0x5eef94, 0x54 + +gUnknown_085EEFE8:: @ 85EEFE8 + .incbin "baserom.gba", 0x5eefe8, 0x10 + +gUnknown_085EEFF8:: @ 85EEFF8 + .incbin "baserom.gba", 0x5eeff8, 0x1c + +gUnknown_085EF014:: @ 85EF014 + .incbin "baserom.gba", 0x5ef014, 0x18 + +gUnknown_085EF02C:: @ 85EF02C + .incbin "baserom.gba", 0x5ef02c, 0x24 + +gUnknown_085EF050:: @ 85EF050 + .incbin "baserom.gba", 0x5ef050, 0x34 + +gUnknown_085EF084:: @ 85EF084 + .incbin "baserom.gba", 0x5ef084, 0x44 + +gUnknown_085EF0C8:: @ 85EF0C8 + .incbin "baserom.gba", 0x5ef0c8, 0x2c + +gUnknown_085EF0F4:: @ 85EF0F4 + .incbin "baserom.gba", 0x5ef0f4, 0x30 + +gUnknown_085EF124:: @ 85EF124 + .incbin "baserom.gba", 0x5ef124, 0x28 + +gUnknown_085EF14C:: @ 85EF14C + .incbin "baserom.gba", 0x5ef14c, 0x2c + +gUnknown_085EF178:: @ 85EF178 + .incbin "baserom.gba", 0x5ef178, 0x20 + +gUnknown_085EF198:: @ 85EF198 + .incbin "baserom.gba", 0x5ef198, 0x1c + +gUnknown_085EF1B4:: @ 85EF1B4 + .incbin "baserom.gba", 0x5ef1b4, 0x24 + +gUnknown_085EF1D8:: @ 85EF1D8 + .incbin "baserom.gba", 0x5ef1d8, 0x28 + +gUnknown_085EF200:: @ 85EF200 + .incbin "baserom.gba", 0x5ef200, 0x1c + +gUnknown_085EF21C:: @ 85EF21C + .incbin "baserom.gba", 0x5ef21c, 0x28 + +gUnknown_085EF244:: @ 85EF244 + .incbin "baserom.gba", 0x5ef244, 0x3c + +gUnknown_085EF280:: @ 85EF280 + .incbin "baserom.gba", 0x5ef280, 0x34 + +gUnknown_085EF2B4:: @ 85EF2B4 + .incbin "baserom.gba", 0x5ef2b4, 0x30 + +gUnknown_085EF2E4:: @ 85EF2E4 + .incbin "baserom.gba", 0x5ef2e4, 0x18 + +gUnknown_085EF2FC:: @ 85EF2FC + .incbin "baserom.gba", 0x5ef2fc, 0x34 + +gUnknown_085EF330:: @ 85EF330 + .incbin "baserom.gba", 0x5ef330, 0x30 + +gUnknown_085EF360:: @ 85EF360 + .incbin "baserom.gba", 0x5ef360, 0x1c + +gUnknown_085EF37C:: @ 85EF37C + .incbin "baserom.gba", 0x5ef37c, 0x20 + +gUnknown_085EF39C:: @ 85EF39C + .incbin "baserom.gba", 0x5ef39c, 0x28 + +gUnknown_085EF3C4:: @ 85EF3C4 + .incbin "baserom.gba", 0x5ef3c4, 0x2c + +gUnknown_085EF3F0:: @ 85EF3F0 + .incbin "baserom.gba", 0x5ef3f0, 0x20 + +gUnknown_085EF410:: @ 85EF410 + .incbin "baserom.gba", 0x5ef410, 0x1c + +gUnknown_085EF42C:: @ 85EF42C + .incbin "baserom.gba", 0x5ef42c, 0x34 + +gUnknown_085EF460:: @ 85EF460 + .incbin "baserom.gba", 0x5ef460, 0x34 + +gUnknown_085EF494:: @ 85EF494 + .incbin "baserom.gba", 0x5ef494, 0x30 + +gUnknown_085EF4C4:: @ 85EF4C4 + .incbin "baserom.gba", 0x5ef4c4, 0x2c + +gUnknown_085EF4F0:: @ 85EF4F0 + .incbin "baserom.gba", 0x5ef4f0, 0x30 + +gUnknown_085EF520:: @ 85EF520 + .incbin "baserom.gba", 0x5ef520, 0x3c + +gUnknown_085EF55C:: @ 85EF55C + .incbin "baserom.gba", 0x5ef55c, 0x28 + +gUnknown_085EF584:: @ 85EF584 + .incbin "baserom.gba", 0x5ef584, 0x38 + +gUnknown_085EF5BC:: @ 85EF5BC + .incbin "baserom.gba", 0x5ef5bc, 0x24 + +gUnknown_085EF5E0:: @ 85EF5E0 + .incbin "baserom.gba", 0x5ef5e0, 0x2c + +gUnknown_085EF60C:: @ 85EF60C + .incbin "baserom.gba", 0x5ef60c, 0x24 + +gUnknown_085EF630:: @ 85EF630 + .incbin "baserom.gba", 0x5ef630, 0x24 + +gUnknown_085EF654:: @ 85EF654 + .incbin "baserom.gba", 0x5ef654, 0x10 + +gUnknown_085EF664:: @ 85EF664 + .incbin "baserom.gba", 0x5ef664, 0x14 + +gUnknown_085EF678:: @ 85EF678 + .incbin "baserom.gba", 0x5ef678, 0x15 + +gUnknown_085EF68D:: @ 85EF68D + .incbin "baserom.gba", 0x5ef68d, 0x14 + +gUnknown_085EF6A1:: @ 85EF6A1 + .incbin "baserom.gba", 0x5ef6a1, 0x1c + +gUnknown_085EF6BD:: @ 85EF6BD + .incbin "baserom.gba", 0x5ef6bd, 0x15 + +gUnknown_085EF6D2:: @ 85EF6D2 + .incbin "baserom.gba", 0x5ef6d2, 0x17 + +gUnknown_085EF6E9:: @ 85EF6E9 + .incbin "baserom.gba", 0x5ef6e9, 0xf + +gUnknown_085EF6F8:: @ 85EF6F8 + .incbin "baserom.gba", 0x5ef6f8, 0x18 + +gUnknown_085EF710:: @ 85EF710 + .incbin "baserom.gba", 0x5ef710, 0x24 + +gUnknown_085EF734:: @ 85EF734 + .incbin "baserom.gba", 0x5ef734, 0x1c + +gUnknown_085EF750:: @ 85EF750 + .incbin "baserom.gba", 0x5ef750, 0x131 + +gUnknown_085EF881:: @ 85EF881 + .incbin "baserom.gba", 0x5ef881, 0x2 + +gUnknown_085EF883:: @ 85EF883 + .incbin "baserom.gba", 0x5ef883, 0x5 + +gUnknown_085EF888:: @ 85EF888 + .incbin "baserom.gba", 0x5ef888, 0x2 + +gUnknown_085EF88A:: @ 85EF88A + .incbin "baserom.gba", 0x5ef88a, 0xb + +gUnknown_085EF895:: @ 85EF895 + .incbin "baserom.gba", 0x5ef895, 0xe + +gUnknown_085EF8A3:: @ 85EF8A3 + .incbin "baserom.gba", 0x5ef8a3, 0x1f + +gUnknown_085EF8C2:: @ 85EF8C2 + .incbin "baserom.gba", 0x5ef8c2, 0x18 + +gUnknown_085EF8DA:: @ 85EF8DA + .incbin "baserom.gba", 0x5ef8da, 0xa + +gUnknown_085EF8E4:: @ 85EF8E4 + .incbin "baserom.gba", 0x5ef8e4, 0xf + +gUnknown_085EF8F3:: @ 85EF8F3 + .incbin "baserom.gba", 0x5ef8f3, 0x6d + +gUnknown_085EF960:: @ 85EF960 + .incbin "baserom.gba", 0x5ef960, 0x19 + +gUnknown_085EF979:: @ 85EF979 + .incbin "baserom.gba", 0x5ef979, 0x2d + +gUnknown_085EF9A6:: @ 85EF9A6 + .incbin "baserom.gba", 0x5ef9a6, 0x40 + +gUnknown_085EF9E6:: @ 85EF9E6 + .incbin "baserom.gba", 0x5ef9e6, 0x2a + +gUnknown_085EFA10:: @ 85EFA10 + .incbin "baserom.gba", 0x5efa10, 0x21 + +gUnknown_085EFA31:: @ 85EFA31 + .incbin "baserom.gba", 0x5efa31, 0xd + +gUnknown_085EFA3E:: @ 85EFA3E + .incbin "baserom.gba", 0x5efa3e, 0x14 + +gUnknown_085EFA52:: @ 85EFA52 + .incbin "baserom.gba", 0x5efa52, 0x4 + +gUnknown_085EFA56:: @ 85EFA56 + .incbin "baserom.gba", 0x5efa56, 0x7 + +gUnknown_085EFA5D:: @ 85EFA5D + .incbin "baserom.gba", 0x5efa5d, 0xa + +gUnknown_085EFA67:: @ 85EFA67 + .incbin "baserom.gba", 0x5efa67, 0x7 + +gUnknown_085EFA6E:: @ 85EFA6E + .incbin "baserom.gba", 0x5efa6e, 0x21 + +gUnknown_085EFA8F:: @ 85EFA8F + .incbin "baserom.gba", 0x5efa8f, 0x1b + +gUnknown_085EFAAA:: @ 85EFAAA + .incbin "baserom.gba", 0x5efaaa, 0x1c + +gUnknown_085EFAC6:: @ 85EFAC6 + .incbin "baserom.gba", 0x5efac6, 0x1a + +gUnknown_085EFAE0:: @ 85EFAE0 + .incbin "baserom.gba", 0x5efae0, 0x8 + +gUnknown_085EFAE8:: @ 85EFAE8 + .incbin "baserom.gba", 0x5efae8, 0xea + +gUnknown_085EFBD2:: @ 85EFBD2 + .incbin "baserom.gba", 0x5efbd2, 0x3a + +gUnknown_085EFC0C:: @ 85EFC0C + .incbin "baserom.gba", 0x5efc0c, 0x1b + +gUnknown_085EFC27:: @ 85EFC27 + .incbin "baserom.gba", 0x5efc27, 0xad + +gUnknown_085EFCD4:: @ 85EFCD4 + .incbin "baserom.gba", 0x5efcd4, 0xb + +gUnknown_085EFCDF:: @ 85EFCDF + .incbin "baserom.gba", 0x5efcdf, 0x6 + +gUnknown_085EFCE5:: @ 85EFCE5 + .incbin "baserom.gba", 0x5efce5, 0xb diff --git a/data/text.s b/data/text.s new file mode 100644 index 000000000..e5d48fe4e --- /dev/null +++ b/data/text.s @@ -0,0 +1,94 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gFontHalfRowOffsets:: @ 82E958C + .byte 0x00,0x01,0x02,0x00,0x03,0x04,0x05,0x03,0x06,0x07,0x08,0x06,0x00,0x01,0x02,0x00 + .byte 0x09,0x0a,0x0b,0x09,0x0c,0x0d,0x0e,0x0c,0x0f,0x10,0x11,0x0f,0x09,0x0a,0x0b,0x09 + .byte 0x12,0x13,0x14,0x12,0x15,0x16,0x17,0x15,0x18,0x19,0x1a,0x18,0x12,0x13,0x14,0x12 + .byte 0x00,0x01,0x02,0x00,0x03,0x04,0x05,0x03,0x06,0x07,0x08,0x06,0x00,0x01,0x02,0x00 + .byte 0x1b,0x1c,0x1d,0x1b,0x1e,0x1f,0x20,0x1e,0x21,0x22,0x23,0x21,0x1b,0x1c,0x1d,0x1b + .byte 0x24,0x25,0x26,0x24,0x27,0x28,0x29,0x27,0x2a,0x2b,0x2c,0x2a,0x24,0x25,0x26,0x24 + .byte 0x2d,0x2e,0x2f,0x2d,0x30,0x31,0x32,0x30,0x33,0x34,0x35,0x33,0x2d,0x2e,0x2f,0x2d + .byte 0x1b,0x1c,0x1d,0x1b,0x1e,0x1f,0x20,0x1e,0x21,0x22,0x23,0x21,0x1b,0x1c,0x1d,0x1b + .byte 0x36,0x37,0x38,0x36,0x39,0x3a,0x3b,0x39,0x3c,0x3d,0x3e,0x3c,0x36,0x37,0x38,0x36 + .byte 0x3f,0x40,0x41,0x3f,0x42,0x43,0x44,0x42,0x45,0x46,0x47,0x45,0x3f,0x40,0x41,0x3f + .byte 0x48,0x49,0x4a,0x48,0x4b,0x4c,0x4d,0x4b,0x4e,0x4f,0x50,0x4e,0x48,0x49,0x4a,0x48 + .byte 0x36,0x37,0x38,0x36,0x39,0x3a,0x3b,0x39,0x3c,0x3d,0x3e,0x3c,0x36,0x37,0x38,0x36 + .byte 0x00,0x01,0x02,0x00,0x03,0x04,0x05,0x03,0x06,0x07,0x08,0x06,0x00,0x01,0x02,0x00 + .byte 0x09,0x0a,0x0b,0x09,0x0c,0x0d,0x0e,0x0c,0x0f,0x10,0x11,0x0f,0x09,0x0a,0x0b,0x09 + .byte 0x12,0x13,0x14,0x12,0x15,0x16,0x17,0x15,0x18,0x19,0x1a,0x18,0x12,0x13,0x14,0x12 + .byte 0x00,0x01,0x02,0x00,0x03,0x04,0x05,0x03,0x06,0x07,0x08,0x06,0x00,0x01,0x02,0x00 + +gDownArrowTiles:: @ 82E968C + .incbin "baserom.gba", 0x2e968c, 0xc0 + +gDarkDownArrowTiles:: @ 82E974C + .incbin "baserom.gba", 0x2e974c, 0xc0 + +@ Seemingly unreferenced data. It contains some kind of arrow graphics. + .incbin "baserom.gba", 0x2e980c, 0x500 + +gDownArrowYCoords:: @ 82E9D0C + .byte 0, 1, 2, 1 + +gWindowVerticalScrollSpeeds:: @ 82E9D10 + .byte 1, 2, 4, 0 + +gGlyphWidthFuncs:: @ 82E9D14 + glyph_width_func 0, GetGlyphWidthFont0+1 + glyph_width_func 1, GetGlyphWidthFont1+1 + glyph_width_func 2, GetGlyphWidthFont2+1 + glyph_width_func 3, GetGlyphWidthFont2+1 + glyph_width_func 4, GetGlyphWidthFont2+1 + glyph_width_func 5, GetGlyphWidthFont2+1 + glyph_width_func 6, GetGlyphWidthFont6+1 + glyph_width_func 7, GetGlyphWidthFont7+1 + glyph_width_func 8, GetGlyphWidthFont8+1 + +gKeypadIcons:: @ 82E9D5C + keypad_icon 0x0, 8, 12 + keypad_icon 0x1, 8, 12 + keypad_icon 0x2, 16, 12 + keypad_icon 0x4, 16, 12 + keypad_icon 0x6, 24, 12 + keypad_icon 0x9, 24, 12 + keypad_icon 0xC, 8, 12 + keypad_icon 0xD, 8, 12 + keypad_icon 0xE, 8, 12 + keypad_icon 0xF, 8, 12 + keypad_icon 0x20, 8, 12 + keypad_icon 0x21, 8, 12 + keypad_icon 0x22, 8, 12 + +gKeypadIconTiles:: @ 82E9D90 + .incbin "baserom.gba", 0x2e9d90, 0x800 + +gFontInfos:: @ 82EA590 + font_info Font0Func+1, 5, 12, 0, 0, 2, 3, 1 + font_info Font1Func+1, 6, 16, 0, 0, 2, 3, 1 + font_info Font2Func+1, 6, 14, 0, 0, 2, 3, 1 + font_info Font3Func+1, 6, 14, 0, 0, 2, 3, 1 + font_info Font4Func+1, 6, 14, 0, 0, 2, 3, 1 + font_info Font5Func+1, 6, 14, 0, 0, 2, 3, 1 + font_info Font6Func+1, 8, 16, 0, 8, 2, 3, 1 + font_info Font7Func+1, 5, 16, 0, 0, 2, 3, 1 + font_info Font8Func+1, 5, 8, 0, 0, 2, 3, 1 + font_info 0, 8, 8, 0, 0, 1, 15, 2 + +gMenuCursorDimensions:: @ 82EA608 + .byte 8, 12 + .byte 8, 15 + .byte 8, 14 + .byte 8, 14 + .byte 8, 14 + .byte 8, 14 + .byte 8, 16 + .byte 8, 15 + .byte 8, 8 + .byte 0, 0 + + .align 2 +gFont9JapaneseGlyphs:: @ 82EA61C + .incbin "data/graphics/fonts/font9.hwjpnfont" diff --git a/data/window.s b/data/window.s new file mode 100644 index 000000000..204152b3e --- /dev/null +++ b/data/window.s @@ -0,0 +1,7 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gDummyWindowTemplate:: @ 82E9584 + window_template -1, 0, 0, 0, 0, 0, 0 diff --git a/include/abilities.h b/include/abilities.h new file mode 100644 index 000000000..4c47025f8 --- /dev/null +++ b/include/abilities.h @@ -0,0 +1,81 @@ +enum +{ + ABILITY_NONE, + ABILITY_STENCH, + ABILITY_DRIZZLE, + ABILITY_SPEED_BOOST, + ABILITY_BATTLE_ARMOR, + ABILITY_STURDY, + ABILITY_DAMP, + ABILITY_LIMBER, + ABILITY_SAND_VEIL, + ABILITY_STATIC, + ABILITY_VOLT_ABSORB, + ABILITY_WATER_ABSORB, + ABILITY_OBLIVIOUS, + ABILITY_CLOUD_NINE, + ABILITY_COMPOUND_EYES, + ABILITY_INSOMNIA, + ABILITY_COLOR_CHANGE, + ABILITY_IMMUNITY, + ABILITY_FLASH_FIRE, + ABILITY_SHIELD_DUST, + ABILITY_OWN_TEMPO, + ABILITY_SUCTION_CUPS, + ABILITY_INTIMIDATE, + ABILITY_SHADOW_TAG, + ABILITY_ROUGH_SKIN, + ABILITY_WONDER_GUARD, + ABILITY_LEVITATE, + ABILITY_EFFECT_SPORE, + ABILITY_SYNCHRONIZE, + ABILITY_CLEAR_BODY, + ABILITY_NATURAL_CURE, + ABILITY_LIGHTNING_ROD, + ABILITY_SERENE_GRACE, + ABILITY_SWIFT_SWIM, + ABILITY_CHLOROPHYLL, + ABILITY_ILLUMINATE, + ABILITY_TRACE, + ABILITY_HUGE_POWER, + ABILITY_POISON_POINT, + ABILITY_INNER_FOCUS, + ABILITY_MAGMA_ARMOR, + ABILITY_WATER_VEIL, + ABILITY_MAGNET_PULL, + ABILITY_SOUNDPROOF, + ABILITY_RAIN_DISH, + ABILITY_SAND_STREAM, + ABILITY_PRESSURE, + ABILITY_THICK_FAT, + ABILITY_EARLY_BIRD, + ABILITY_FLAME_BODY, + ABILITY_RUN_AWAY, + ABILITY_KEEN_EYE, + ABILITY_HYPER_CUTTER, + ABILITY_PICKUP, + ABILITY_TRUANT, + ABILITY_HUSTLE, + ABILITY_CUTE_CHARM, + ABILITY_PLUS, + ABILITY_MINUS, + ABILITY_FORECAST, + ABILITY_STICKY_HOLD, + ABILITY_SHED_SKIN, + ABILITY_GUTS, + ABILITY_MARVEL_SCALE, + ABILITY_LIQUID_OOZE, + ABILITY_OVERGROW, + ABILITY_BLAZE, + ABILITY_TORRENT, + ABILITY_SWARM, + ABILITY_ROCK_HEAD, + ABILITY_DROUGHT, + ABILITY_ARENA_TRAP, + ABILITY_VITAL_SPIRIT, + ABILITY_WHITE_SMOKE, + ABILITY_PURE_POWER, + ABILITY_SHELL_ARMOR, + ABILITY_CACOPHONY, + ABILITY_AIR_LOCK +}; \ No newline at end of file diff --git a/include/battle.h b/include/battle.h new file mode 100644 index 000000000..fa42a7b53 --- /dev/null +++ b/include/battle.h @@ -0,0 +1,24 @@ +#define BATTLE_TYPE_DOUBLE 0x0001 +#define BATTLE_TYPE_LINK 0x0002 +#define BATTLE_TYPE_WILD 0x0004 +#define BATTLE_TYPE_TRAINER 0x0008 +#define BATTLE_TYPE_FIRST_BATTLE 0x0010 +#define BATTLE_TYPE_20 0x0020 +#define BATTLE_TYPE_40 0x0040 +#define BATTLE_TYPE_SAFARI 0x0080 +#define BATTLE_TYPE_BATTLE_TOWER 0x0100 +#define BATTLE_TYPE_WALLY_TUTORIAL 0x0200 +#define BATTLE_TYPE_ROAMER 0x0400 +#define BATTLE_TYPE_EREADER_TRAINER 0x0800 +#define BATTLE_TYPE_KYOGRE_GROUDON 0x1000 +#define BATTLE_TYPE_LEGENDARY 0x2000 +#define BATTLE_TYPE_REGI 0x4000 + +#define AI_ACTION_UNK1 0x0001 +#define AI_ACTION_UNK2 0x0002 +#define AI_ACTION_UNK3 0x0004 +#define AI_ACTION_UNK4 0x0008 +#define AI_ACTION_UNK5 0x0010 +#define AI_ACTION_UNK6 0x0020 +#define AI_ACTION_UNK7 0x0040 +#define AI_ACTION_UNK8 0x0080 \ No newline at end of file diff --git a/include/gba/gba.h b/include/gba/gba.h index 26342cf88..42ae3cdde 100644 --- a/include/gba/gba.h +++ b/include/gba/gba.h @@ -4,6 +4,7 @@ #include "gba/defines.h" #include "gba/io_reg.h" #include "gba/types.h" +#include "gba/multiboot.h" #include "gba/syscall.h" #include "gba/macro.h" diff --git a/include/gba/io_reg.h b/include/gba/io_reg.h index 0be92fa60..5234e5b6c 100644 --- a/include/gba/io_reg.h +++ b/include/gba/io_reg.h @@ -577,6 +577,8 @@ #define TIMER_ENABLE 0x80 // serial +#define SIO_ID 0x0030 // Communication ID + #define SIO_8BIT_MODE 0x0000 // Normal 8-bit communication mode #define SIO_32BIT_MODE 0x1000 // Normal 32-bit communication mode #define SIO_MULTI_MODE 0x2000 // Multi-player communication mode @@ -589,6 +591,7 @@ #define SIO_MULTI_SI 0x0004 // Multi-player communication SI terminal #define SIO_MULTI_SD 0x0008 // SD terminal +#define SIO_MULTI_BUSY 0x0080 #define SIO_ERROR 0x0040 // Detect error #define SIO_START 0x0080 // Start transfer diff --git a/include/gba/macro.h b/include/gba/macro.h index 62d3e73fa..230fb4383 100644 --- a/include/gba/macro.h +++ b/include/gba/macro.h @@ -25,6 +25,8 @@ CPU_FAST_SET_SRC_FIXED | ((size)/(32/8) & 0x1FFFFF)); \ } +#define CpuFastFill16(value, dest, size) CpuFastFill(((value) << 16) | (value), (dest), (size)) + #define CpuFastCopy(src, dest, size) CpuFastSet(src, dest, ((size)/(32/8) & 0x1FFFFF)) #define DmaSet(dmaNum, src, dest, control) \ diff --git a/include/gba/multiboot.h b/include/gba/multiboot.h new file mode 100644 index 000000000..e88b43a19 --- /dev/null +++ b/include/gba/multiboot.h @@ -0,0 +1,55 @@ +#ifndef GUARD_GBA_MULTIBOOT_H +#define GUARD_GBA_MULTIBOOT_H + +#define MULTIBOOT_NCHILD 3 // Maximum number of slaves +#define MULTIBOOT_HEADER_SIZE 0xc0 // Header size +#define MULTIBOOT_SEND_SIZE_MIN 0x100 // Minimum transmission size +#define MULTIBOOT_SEND_SIZE_MAX 0x40000 // Maximum transmission size + +struct MultiBootParam +{ + u32 system_work[5]; + u8 handshake_data; + u8 padding; + u16 handshake_timeout; + u8 probe_count; + u8 client_data[MULTIBOOT_NCHILD]; + u8 palette_data; + u8 response_bit; + u8 client_bit; + u8 reserved1; + u8 *boot_srcp; + u8 *boot_endp; + u8 *masterp; + u8 *reserved2[MULTIBOOT_NCHILD]; + u32 system_work2[4]; + u8 sendflag; + u8 probe_target_bit; + u8 check_wait; + u8 server_type; +}; + +#define MULTIBOOT_ERROR_04 0x04 +#define MULTIBOOT_ERROR_08 0x08 +#define MULTIBOOT_ERROR_0c 0x0c +#define MULTIBOOT_ERROR_40 0x40 +#define MULTIBOOT_ERROR_44 0x44 +#define MULTIBOOT_ERROR_48 0x48 +#define MULTIBOOT_ERROR_4c 0x4c +#define MULTIBOOT_ERROR_80 0x80 +#define MULTIBOOT_ERROR_84 0x84 +#define MULTIBOOT_ERROR_88 0x88 +#define MULTIBOOT_ERROR_8c 0x8c +#define MULTIBOOT_ERROR_NO_PROBE_TARGET 0x50 +#define MULTIBOOT_ERROR_NO_DLREADY 0x60 +#define MULTIBOOT_ERROR_BOOT_FAILURE 0x70 +#define MULTIBOOT_ERROR_HANDSHAKE_FAILURE 0x71 + +#define MULTIBOOT_CONNECTION_CHECK_WAIT 15 + +#define MULTIBOOT_SERVER_TYPE_NORMAL 0 +#define MULTIBOOT_SERVER_TYPE_QUICK 1 + +#define MULTIBOOT_HANDSHAKE_TIMEOUT 400 + +#endif // GUARD_GBA_MULTIBOOT_H diff --git a/include/gba/syscall.h b/include/gba/syscall.h index 3f41abba1..deddec5ba 100644 --- a/include/gba/syscall.h +++ b/include/gba/syscall.h @@ -17,6 +17,10 @@ void RegisterRamReset(u32 resetFlags); void VBlankIntrWait(void); +u16 Sqrt(u32 num); + +u16 ArcTan2(s16 x, s16 y); + #define CPU_SET_SRC_FIXED 0x01000000 #define CPU_SET_16BIT 0x00000000 #define CPU_SET_32BIT 0x04000000 @@ -27,6 +31,18 @@ void CpuSet(const void *src, void *dest, u32 control); void CpuFastSet(const void *src, void *dest, u32 control); +void BgAffineSet(struct BgAffineSrcData *src, struct BgAffineDstData *dest, s32 count); + void ObjAffineSet(struct ObjAffineSrcData *src, void *dest, s32 count, s32 offset); +void LZ77UnCompWram(const void *src, void *dest); + +void LZ77UnCompVram(const void *src, void *dest); + +void RLUnCompWram(const void *src, void *dest); + +void RLUnCompVram(const void *src, void *dest); + +int MultiBoot(struct MultiBootParam *mp); + #endif // GUARD_GBA_SYSCALL_H diff --git a/include/gba/types.h b/include/gba/types.h index be7390d5a..fd8a20a4c 100644 --- a/include/gba/types.h +++ b/include/gba/types.h @@ -74,6 +74,27 @@ struct OamData #define ST_OAM_H_RECTANGLE 1 #define ST_OAM_V_RECTANGLE 2 +struct BgAffineSrcData +{ + s32 texX; + s32 texY; + s16 scrX; + s16 scrY; + s16 sx; + s16 sy; + u16 alpha; +}; + +struct BgAffineDstData +{ + s16 pa; + s16 pb; + s16 pc; + s16 pd; + s32 dx; + s32 dy; +}; + struct ObjAffineSrcData { s16 xScale; diff --git a/include/global.h b/include/global.h index 0047fcbdb..b7038025b 100644 --- a/include/global.h +++ b/include/global.h @@ -3,4 +3,97 @@ #include "gba/gba.h" +// Prevent cross-jump optimization. +#define BLOCK_CROSS_JUMP asm(""); + +// to help in decompiling +#define asm_comment(x) asm volatile("@ -- " x " -- ") + +#define ARRAY_COUNT(array) (sizeof(array) / sizeof((array)[0])) + +#define POKEMON_NAME_LENGTH 10 +#define OT_NAME_LENGTH 7 + +extern u8 gStringVar1[]; +extern u8 gStringVar2[]; +extern u8 gStringVar3[]; +extern u8 gStringVar4[]; + +enum +{ + VERSION_SAPPHIRE = 1, + VERSION_RUBY = 2, + VERSION_EMERALD = 3, +}; + +enum LanguageId { + LANGUAGE_JAPANESE = 1, + LANGUAGE_ENGLISH = 2, + LANGUAGE_GERMAN = 5, +}; + +#define GAME_LANGUAGE (LANGUAGE_ENGLISH) + +enum +{ + MALE, + FEMALE +}; + +enum +{ + OPTIONS_BUTTON_MODE_NORMAL, + OPTIONS_BUTTON_MODE_LR, + OPTIONS_BUTTON_MODE_L_EQUALS_A +}; + +enum +{ + OPTIONS_TEXT_SPEED_SLOW, + OPTIONS_TEXT_SPEED_MID, + OPTIONS_TEXT_SPEED_FAST +}; + +enum +{ + OPTIONS_SOUND_MONO, + OPTIONS_SOUND_STEREO +}; + +enum +{ + OPTIONS_BATTLE_STYLE_SHIFT, + OPTIONS_BATTLE_STYLE_SET +}; + +enum +{ + BAG_ITEMS = 1, + BAG_POKEBALLS, + BAG_TMsHMs, + BAG_BERRIES, + BAG_KEYITEMS +}; + +struct SaveBlock2 +{ + /*0x00*/ u8 playerName[8]; + /*0x08*/ u8 playerGender; // MALE, FEMALE + /*0x09*/ u8 specialSaveWarp; + /*0x0A*/ u8 playerTrainerId[4]; + /*0x0E*/ u16 playTimeHours; + /*0x10*/ u8 playTimeMinutes; + /*0x11*/ u8 playTimeSeconds; + /*0x12*/ u8 playTimeVBlanks; + /*0x13*/ u8 optionsButtonMode; // OPTIONS_BUTTON_MODE_[NORMAL/LR/L_EQUALS_A] + /*0x14*/ u16 optionsTextSpeed:3; // OPTIONS_TEXT_SPEED_[SLOW/MID/FAST] + u16 optionsWindowFrameType:5; // Specifies one of the 20 decorative borders for text boxes + u16 optionsSound:1; // OPTIONS_SOUND_[MONO/STEREO] + u16 optionsBattleStyle:1; // OPTIONS_BATTLE_STYLE_[SHIFT/SET] + u16 optionsBattleSceneOff:1; // whether battle animations are disabled + u16 regionMapZoom:1; // whether the map is zoomed in +}; + +extern struct SaveBlock2 *gSaveBlock2Ptr; + #endif // GUARD_GLOBAL_H diff --git a/include/main.h b/include/main.h new file mode 100644 index 000000000..e5460b3bf --- /dev/null +++ b/include/main.h @@ -0,0 +1,63 @@ +#ifndef GUARD_MAIN_H +#define GUARD_MAIN_H + +#include "global.h" + +typedef void (*MainCallback)(void); +typedef void (*IntrCallback)(void); +typedef void (*IntrFunc)(void); + +struct Main +{ + /*0x000*/ MainCallback callback1; + /*0x004*/ MainCallback callback2; + + /*0x008*/ MainCallback savedCallback; + + /*0x00C*/ IntrCallback vblankCallback; + /*0x010*/ IntrCallback hblankCallback; + /*0x014*/ IntrCallback vcountCallback; + /*0x018*/ IntrCallback serialCallback; + + /*0x01C*/ vu16 intrCheck; + + /*0x020*/ u32 vblankCounter1; + /*0x024*/ u32 vblankCounter2; + + /*0x028*/ u16 heldKeysRaw; // held keys without L=A remapping + /*0x02A*/ u16 newKeysRaw; // newly pressed keys without L=A remapping + /*0x02C*/ u16 heldKeys; // held keys with L=A remapping + /*0x02E*/ u16 newKeys; // newly pressed keys with L=A remapping + /*0x030*/ u16 newAndRepeatedKeys; // newly pressed keys plus key repeat + /*0x032*/ u16 keyRepeatCounter; // counts down to 0, triggering key repeat + /*0x034*/ bool16 watchedKeysPressed; // whether one of the watched keys was pressed + /*0x036*/ u16 watchedKeysMask; // bit mask for watched keys + + /*0x038*/ struct OamData oamBuffer[128]; + + /*0x438*/ u8 state; + + /*0x439*/ u8 oamLoadDisabled:1; + /*0x439*/ u8 inBattle:1; +}; + +extern u8 gUnknown_3001764; +extern struct Main gMain; +extern bool8 gSoftResetDisabled; +extern bool8 gLinkVSyncDisabled; + +extern const u8 gGameVersion; +extern const u8 gGameLanguage; + +void AgbMain(void); +void SetMainCallback2(MainCallback callback); +void InitKeys(void); +void SetVBlankCallback(IntrCallback callback); +void SetHBlankCallback(IntrCallback callback); +void SetVCountCallback(IntrCallback callback); +void SetSerialCallback(IntrCallback callback); +void InitFlashTimer(void); +void DoSoftReset(void); +void ClearPokemonCrySongs(void); + +#endif // GUARD_MAIN_H diff --git a/include/multiboot.h b/include/multiboot.h new file mode 100644 index 000000000..950c853d0 --- /dev/null +++ b/include/multiboot.h @@ -0,0 +1,21 @@ +#ifndef GUARD_MULTIBOOT_H +#define GUARD_MULTIBOOT_H + +#define MULTIBOOT_MASTER_INFO 0x62 +#define MULTIBOOT_CLIENT_INFO 0x72 +#define MULTIBOOT_MASTER_START_PROBE 0x61 +#define MULTIBOOT_MASTER_REQUEST_DLREADY 0x63 +#define MULTIBOOT_CLIENT_DLREADY 0x73 +#define MULTIBOOT_MASTER_START_DL 0x64 +#define MULTIBOOT_MASTER_REQUEST_CRC 0x65 +#define MULTIBOOT_CLIENT_CALC_CRC 0x74 +#define MULTIBOOT_CLIENT_CRCREADY 0x75 +#define MULTIBOOT_MASTER_VERIFY_CRC 0x66 + +void MultiBootInit(struct MultiBootParam *mp); +int MultiBootMain(struct MultiBootParam *mp); +void MultiBootStartProbe(struct MultiBootParam *mp); +void MultiBootStartMaster(struct MultiBootParam *mp, u8 *srcp, int length, u8 palette_color, s8 palette_speed); +int MultiBootCheckComplete(struct MultiBootParam *mp); + +#endif // GUARD_MULTIBOOT_H diff --git a/include/pokemon.h b/include/pokemon.h new file mode 100644 index 000000000..b3381a4b0 --- /dev/null +++ b/include/pokemon.h @@ -0,0 +1,311 @@ +#define MON_DATA_PERSONALITY 0 +#define MON_DATA_OT_ID 1 +#define MON_DATA_NICKNAME 2 +#define MON_DATA_LANGUAGE 3 +#define MON_DATA_SANITY_BIT1 4 +#define MON_DATA_SANITY_BIT2 5 +#define MON_DATA_SANITY_BIT3 6 +#define MON_DATA_OT_NAME 7 +#define MON_DATA_MARKINGS 8 +#define MON_DATA_CHECKSUM 9 +#define MON_DATA_10 10 +#define MON_DATA_SPECIES 11 +#define MON_DATA_HELD_ITEM 12 +#define MON_DATA_MOVE1 13 +#define MON_DATA_MOVE2 14 +#define MON_DATA_MOVE3 15 +#define MON_DATA_MOVE4 16 +#define MON_DATA_PP1 17 +#define MON_DATA_PP2 18 +#define MON_DATA_PP3 19 +#define MON_DATA_PP4 20 +#define MON_DATA_PP_BONUSES 21 +#define MON_DATA_COOL 22 +#define MON_DATA_BEAUTY 23 +#define MON_DATA_CUTE 24 +#define MON_DATA_EXP 25 +#define MON_DATA_HP_EV 26 +#define MON_DATA_ATK_EV 27 +#define MON_DATA_DEF_EV 28 +#define MON_DATA_SPD_EV 29 +#define MON_DATA_SPATK_EV 30 +#define MON_DATA_SPDEF_EV 31 +#define MON_DATA_FRIENDSHIP 32 +#define MON_DATA_SMART 33 +#define MON_DATA_POKERUS 34 +#define MON_DATA_MET_LOCATION 35 +#define MON_DATA_MET_LEVEL 36 +#define MON_DATA_MET_GAME 37 +#define MON_DATA_POKEBALL 38 +#define MON_DATA_HP_IV 39 +#define MON_DATA_ATK_IV 40 +#define MON_DATA_DEF_IV 41 +#define MON_DATA_SPD_IV 42 +#define MON_DATA_SPATK_IV 43 +#define MON_DATA_SPDEF_IV 44 +#define MON_DATA_IS_EGG 45 +#define MON_DATA_ALT_ABILITY 46 +#define MON_DATA_TOUGH 47 +#define MON_DATA_SHEEN 48 +#define MON_DATA_OT_GENDER 49 +#define MON_DATA_COOL_RIBBON 50 +#define MON_DATA_BEAUTY_RIBBON 51 +#define MON_DATA_CUTE_RIBBON 52 +#define MON_DATA_SMART_RIBBON 53 +#define MON_DATA_TOUGH_RIBBON 54 +#define MON_DATA_STATUS 55 +#define MON_DATA_LEVEL 56 +#define MON_DATA_HP 57 +#define MON_DATA_MAX_HP 58 +#define MON_DATA_ATK 59 +#define MON_DATA_DEF 60 +#define MON_DATA_SPD 61 +#define MON_DATA_SPATK 62 +#define MON_DATA_SPDEF 63 +#define MON_DATA_64 64 +#define MON_DATA_SPECIES2 65 +#define MON_DATA_IVS 66 +#define MON_DATA_CHAMPION_RIBBON 67 +#define MON_DATA_WINNING_RIBBON 68 +#define MON_DATA_VICTORY_RIBBON 69 +#define MON_DATA_ARTIST_RIBBON 70 +#define MON_DATA_EFFORT_RIBBON 71 +#define MON_DATA_GIFT_RIBBON_1 72 +#define MON_DATA_GIFT_RIBBON_2 73 +#define MON_DATA_GIFT_RIBBON_3 74 +#define MON_DATA_GIFT_RIBBON_4 75 +#define MON_DATA_GIFT_RIBBON_5 76 +#define MON_DATA_GIFT_RIBBON_6 77 +#define MON_DATA_GIFT_RIBBON_7 78 +#define MON_DATA_FATEFUL_ENCOUNTER 79 +#define MON_DATA_KNOWN_MOVES 80 +#define MON_DATA_RIBBON_COUNT 81 +#define MON_DATA_RIBBONS 82 +#define MON_DATA_83 83 +#define MON_DATA_ATK2 84 +#define MON_DATA_DEF2 85 +#define MON_DATA_SPD2 86 +#define MON_DATA_SPATK2 87 +#define MON_DATA_SPDEF2 88 + +#define MON_MALE 0x00 +#define MON_FEMALE 0xFE +#define MON_GENDERLESS 0xFF + +#define TYPE_NORMAL 0x00 +#define TYPE_FIGHTING 0x01 +#define TYPE_FLYING 0x02 +#define TYPE_POISON 0x03 +#define TYPE_GROUND 0x04 +#define TYPE_ROCK 0x05 +#define TYPE_BUG 0x06 +#define TYPE_GHOST 0x07 +#define TYPE_STEEL 0x08 +#define TYPE_MYSTERY 0x09 +#define TYPE_FIRE 0x0a +#define TYPE_WATER 0x0b +#define TYPE_GRASS 0x0c +#define TYPE_ELECTRIC 0x0d +#define TYPE_PSYCHIC 0x0e +#define TYPE_ICE 0x0f +#define TYPE_DRAGON 0x10 +#define TYPE_DARK 0x11 + +enum { + NATURE_HARDY, + NATURE_LONELY, + NATURE_BRAVE, + NATURE_ADAMANT, + NATURE_NAUGHTY, + NATURE_BOLD, + NATURE_DOCILE, + NATURE_RELAXED, + NATURE_IMPISH, + NATURE_LAX, + NATURE_TIMID, + NATURE_HASTY, + NATURE_SERIOUS, + NATURE_JOLLY, + NATURE_NAIVE, + NATURE_MODEST, + NATURE_MILD, + NATURE_QUIET, + NATURE_BASHFUL, + NATURE_RASH, + NATURE_CALM, + NATURE_GENTLE, + NATURE_SASSY, + NATURE_CAREFUL, + NATURE_QUIRKY, +}; + +struct PokemonSubstruct0 +{ + u16 species; + u16 heldItem; + u32 experience; + u8 ppBonuses; + u8 friendship; +}; + +struct PokemonSubstruct1 +{ + u16 moves[4]; + u8 pp[4]; +}; + +struct PokemonSubstruct2 +{ + u8 hpEV; + u8 attackEV; + u8 defenseEV; + u8 speedEV; + u8 spAttackEV; + u8 spDefenseEV; + u8 cool; + u8 beauty; + u8 cute; + u8 smart; + u8 tough; + u8 sheen; +}; + +struct PokemonSubstruct3 +{ + /* 0x00 */ u8 pokerus; + /* 0x01 */ u8 metLocation; + + /* 0x02 */ u16 metLevel:7; + /* 0x02 */ u16 metGame:4; + /* 0x03 */ u16 pokeball:4; + /* 0x03 */ u16 otGender:1; + + /* 0x04 */ u32 hpIV:5; + /* 0x04 */ u32 attackIV:5; + /* 0x05 */ u32 defenseIV:5; + /* 0x05 */ u32 speedIV:5; + /* 0x05 */ u32 spAttackIV:5; + /* 0x06 */ u32 spDefenseIV:5; + /* 0x07 */ u32 isEgg:1; + /* 0x07 */ u32 altAbility:1; + + /* 0x08 */ u32 coolRibbon:3; + /* 0x08 */ u32 beautyRibbon:3; + /* 0x08 */ u32 cuteRibbon:3; + /* 0x09 */ u32 smartRibbon:3; + /* 0x09 */ u32 toughRibbon:3; + /* 0x09 */ u32 championRibbon:1; + /* 0x0A */ u32 winningRibbon:1; + /* 0x0A */ u32 victoryRibbon:1; + /* 0x0A */ u32 artistRibbon:1; + /* 0x0A */ u32 effortRibbon:1; + /* 0x0A */ u32 giftRibbon1:1; + /* 0x0A */ u32 giftRibbon2:1; + /* 0x0A */ u32 giftRibbon3:1; + /* 0x0A */ u32 giftRibbon4:1; + /* 0x0B */ u32 giftRibbon5:1; + /* 0x0B */ u32 giftRibbon6:1; + /* 0x0B */ u32 giftRibbon7:1; + /* 0x0B */ u32 fatefulEncounter:5; // unused in Ruby/Sapphire, but the high bit must be set for Mew/Deoxys to obey in FR/LG/Emerald +}; + +union PokemonSubstruct +{ + struct PokemonSubstruct0 type0; + struct PokemonSubstruct1 type1; + struct PokemonSubstruct2 type2; + struct PokemonSubstruct3 type3; + u16 raw[6]; +}; + +struct BoxPokemon +{ + u32 personality; + u32 otId; + u8 nickname[POKEMON_NAME_LENGTH]; + u8 language; + u8 isBadEgg:1; + u8 hasSpecies:1; + u8 isEgg:1; + u8 unused:5; + u8 otName[OT_NAME_LENGTH]; + u8 markings; + u16 checksum; + u16 unknown; + + union + { + u32 raw[12]; + union PokemonSubstruct substructs[4]; + } secure; +}; + +struct Pokemon +{ + struct BoxPokemon box; + u32 status; + u8 level; + u8 pokerus; + u16 hp; + u16 maxHP; + u16 attack; + u16 defense; + u16 speed; + u16 spAttack; + u16 spDefense; +}; + +extern struct Pokemon gPlayerParty[6]; +extern struct Pokemon gEnemyParty[6]; + +struct BaseStats +{ + /* 0x00 */ u8 baseHP; + /* 0x01 */ u8 baseAttack; + /* 0x02 */ u8 baseDefense; + /* 0x03 */ u8 baseSpeed; + /* 0x04 */ u8 baseSpAttack; + /* 0x05 */ u8 baseSpDefense; + /* 0x06 */ u8 type1; + /* 0x07 */ u8 type2; + /* 0x08 */ u8 catchRate; + /* 0x09 */ u8 expYield; + /* 0x0A */ u16 evYield_HP:2; + /* 0x0A */ u16 evYield_Attack:2; + /* 0x0A */ u16 evYield_Defense:2; + /* 0x0A */ u16 evYield_Speed:2; + /* 0x0B */ u16 evYield_SpAttack:2; + /* 0x0B */ u16 evYield_SpDefense:2; + /* 0x0C */ u16 item1; + /* 0x0E */ u16 item2; + /* 0x10 */ u8 genderRatio; + /* 0x11 */ u8 eggCycles; + /* 0x12 */ u8 friendship; + /* 0x13 */ u8 growthRate; + /* 0x14 */ u8 eggGroup1; + /* 0x15 */ u8 eggGroup2; + /* 0x16 */ u8 ability1; + /* 0x17 */ u8 ability2; + /* 0x18 */ u8 safariZoneFleeRate; + /* 0x19 */ u8 bodyColor; +}; + +struct BattleMove +{ + u8 effect; + u8 power; + u8 type; + u8 accuracy; + u8 pp; + u8 secondaryEffectChance; + u8 target; + u8 priority; + u32 flags; +}; + +// These are full type signatures for GetMonData() and GetBoxMonData(), +// but they are not used since some code erroneously omits the third arg. +// u32 GetMonData(struct Pokemon *mon, s32 field, u8 *data); +u32 GetMonData(); + +u8 pokemon_species_get_gender_info(u16 species, u32 personality); \ No newline at end of file diff --git a/include/rng.h b/include/rng.h new file mode 100644 index 000000000..ae98e575f --- /dev/null +++ b/include/rng.h @@ -0,0 +1,18 @@ +#ifndef GUARD_RNG_H +#define GUARD_RNG_H + +extern u32 gRngValue; +extern u32 gRng2Value; + +//Returns a 16-bit pseudorandom number +u16 Random(void); +u16 Random2(void); + +//Returns a 32-bit pseudorandom number +#define Random32() (Random() | (Random() << 16)) + +//Sets the initial seed value of the pseudorandom number generator +void SeedRng(u16 seed); +void SeedRng2(u16 seed); + +#endif // GUARD_RNG_H diff --git a/include/siirtc.h b/include/siirtc.h new file mode 100644 index 000000000..5864f95b8 --- /dev/null +++ b/include/siirtc.h @@ -0,0 +1,54 @@ +#ifndef GUARD_RTC_H +#define GUARD_RTC_H + +#include "gba/gba.h" + +#define SIIRTCINFO_INTFE 0x01 // frequency interrupt enable +#define SIIRTCINFO_INTME 0x02 // per-minute interrupt enable +#define SIIRTCINFO_INTAE 0x04 // alarm interrupt enable +#define SIIRTCINFO_24HOUR 0x40 // 0: 12-hour mode, 1: 24-hour mode +#define SIIRTCINFO_POWER 0x80 // power on or power failure occurred + +enum +{ + MONTH_JAN = 1, + MONTH_FEB, + MONTH_MAR, + MONTH_APR, + MONTH_MAY, + MONTH_JUN, + MONTH_JUL, + MONTH_AUG, + MONTH_SEP, + MONTH_OCT, + MONTH_NOV, + MONTH_DEC +}; + +struct SiiRtcInfo +{ + u8 year; + u8 month; + u8 day; + u8 dayOfWeek; + u8 hour; + u8 minute; + u8 second; + u8 status; + u8 alarmHour; + u8 alarmMinute; +}; + +void SiiRtcUnprotect(); +void SiiRtcProtect(); +u8 SiiRtcProbe(); +bool8 SiiRtcReset(); +bool8 SiiRtcGetStatus(struct SiiRtcInfo *rtc); +bool8 SiiRtcSetStatus(struct SiiRtcInfo *rtc); +bool8 SiiRtcGetDateTime(struct SiiRtcInfo *rtc); +bool8 SiiRtcSetDateTime(struct SiiRtcInfo *rtc); +bool8 SiiRtcGetTime(struct SiiRtcInfo *rtc); +bool8 SiiRtcSetTime(struct SiiRtcInfo *rtc); +bool8 SiiRtcSetAlarm(struct SiiRtcInfo *rtc); + +#endif // GUARD_RTC_H diff --git a/include/species.h b/include/species.h new file mode 100644 index 000000000..5cce48ad6 --- /dev/null +++ b/include/species.h @@ -0,0 +1,445 @@ +enum { + SPECIES_NONE, // 0x000 + SPECIES_BULBASAUR, // 0x001 + SPECIES_IVYSAUR, // 0x002 + SPECIES_VENUSAUR, // 0x003 + SPECIES_CHARMANDER, // 0x004 + SPECIES_CHARMELEON, // 0x005 + SPECIES_CHARIZARD, // 0x006 + SPECIES_SQUIRTLE, // 0x007 + SPECIES_WARTORTLE, // 0x008 + SPECIES_BLASTOISE, // 0x009 + SPECIES_CATERPIE, // 0x00a + SPECIES_METAPOD, // 0x00b + SPECIES_BUTTERFREE, // 0x00c + SPECIES_WEEDLE, // 0x00d + SPECIES_KAKUNA, // 0x00e + SPECIES_BEEDRILL, // 0x00f + SPECIES_PIDGEY, // 0x010 + SPECIES_PIDGEOTTO, // 0x011 + SPECIES_PIDGEOT, // 0x012 + SPECIES_RATTATA, // 0x013 + SPECIES_RATICATE, // 0x014 + SPECIES_SPEAROW, // 0x015 + SPECIES_FEAROW, // 0x016 + SPECIES_EKANS, // 0x017 + SPECIES_ARBOK, // 0x018 + SPECIES_PIKACHU, // 0x019 + SPECIES_RAICHU, // 0x01a + SPECIES_SANDSHREW, // 0x01b + SPECIES_SANDSLASH, // 0x01c + SPECIES_NIDORAN_F, // 0x01d + SPECIES_NIDORINA, // 0x01e + SPECIES_NIDOQUEEN, // 0x01f + SPECIES_NIDORAN_M, // 0x020 + SPECIES_NIDORINO, // 0x021 + SPECIES_NIDOKING, // 0x022 + SPECIES_CLEFAIRY, // 0x023 + SPECIES_CLEFABLE, // 0x024 + SPECIES_VULPIX, // 0x025 + SPECIES_NINETALES, // 0x026 + SPECIES_JIGGLYPUFF, // 0x027 + SPECIES_WIGGLYTUFF, // 0x028 + SPECIES_ZUBAT, // 0x029 + SPECIES_GOLBAT, // 0x02a + SPECIES_ODDISH, // 0x02b + SPECIES_GLOOM, // 0x02c + SPECIES_VILEPLUME, // 0x02d + SPECIES_PARAS, // 0x02e + SPECIES_PARASECT, // 0x02f + SPECIES_VENONAT, // 0x030 + SPECIES_VENOMOTH, // 0x031 + SPECIES_DIGLETT, // 0x032 + SPECIES_DUGTRIO, // 0x033 + SPECIES_MEOWTH, // 0x034 + SPECIES_PERSIAN, // 0x035 + SPECIES_PSYDUCK, // 0x036 + SPECIES_GOLDUCK, // 0x037 + SPECIES_MANKEY, // 0x038 + SPECIES_PRIMEAPE, // 0x039 + SPECIES_GROWLITHE, // 0x03a + SPECIES_ARCANINE, // 0x03b + SPECIES_POLIWAG, // 0x03c + SPECIES_POLIWHIRL, // 0x03d + SPECIES_POLIWRATH, // 0x03e + SPECIES_ABRA, // 0x03f + SPECIES_KADABRA, // 0x040 + SPECIES_ALAKAZAM, // 0x041 + SPECIES_MACHOP, // 0x042 + SPECIES_MACHOKE, // 0x043 + SPECIES_MACHAMP, // 0x044 + SPECIES_BELLSPROUT, // 0x045 + SPECIES_WEEPINBELL, // 0x046 + SPECIES_VICTREEBEL, // 0x047 + SPECIES_TENTACOOL, // 0x048 + SPECIES_TENTACRUEL, // 0x049 + SPECIES_GEODUDE, // 0x04a + SPECIES_GRAVELER, // 0x04b + SPECIES_GOLEM, // 0x04c + SPECIES_PONYTA, // 0x04d + SPECIES_RAPIDASH, // 0x04e + SPECIES_SLOWPOKE, // 0x04f + SPECIES_SLOWBRO, // 0x050 + SPECIES_MAGNEMITE, // 0x051 + SPECIES_MAGNETON, // 0x052 + SPECIES_FARFETCHD, // 0x053 + SPECIES_DODUO, // 0x054 + SPECIES_DODRIO, // 0x055 + SPECIES_SEEL, // 0x056 + SPECIES_DEWGONG, // 0x057 + SPECIES_GRIMER, // 0x058 + SPECIES_MUK, // 0x059 + SPECIES_SHELLDER, // 0x05a + SPECIES_CLOYSTER, // 0x05b + SPECIES_GASTLY, // 0x05c + SPECIES_HAUNTER, // 0x05d + SPECIES_GENGAR, // 0x05e + SPECIES_ONIX, // 0x05f + SPECIES_DROWZEE, // 0x060 + SPECIES_HYPNO, // 0x061 + SPECIES_KRABBY, // 0x062 + SPECIES_KINGLER, // 0x063 + SPECIES_VOLTORB, // 0x064 + SPECIES_ELECTRODE, // 0x065 + SPECIES_EXEGGCUTE, // 0x066 + SPECIES_EXEGGUTOR, // 0x067 + SPECIES_CUBONE, // 0x068 + SPECIES_MAROWAK, // 0x069 + SPECIES_HITMONLEE, // 0x06a + SPECIES_HITMONCHAN, // 0x06b + SPECIES_LICKITUNG, // 0x06c + SPECIES_KOFFING, // 0x06d + SPECIES_WEEZING, // 0x06e + SPECIES_RHYHORN, // 0x06f + SPECIES_RHYDON, // 0x070 + SPECIES_CHANSEY, // 0x071 + SPECIES_TANGELA, // 0x072 + SPECIES_KANGASKHAN, // 0x073 + SPECIES_HORSEA, // 0x074 + SPECIES_SEADRA, // 0x075 + SPECIES_GOLDEEN, // 0x076 + SPECIES_SEAKING, // 0x077 + SPECIES_STARYU, // 0x078 + SPECIES_STARMIE, // 0x079 + SPECIES_MR_MIME, // 0x07a + SPECIES_SCYTHER, // 0x07b + SPECIES_JYNX, // 0x07c + SPECIES_ELECTABUZZ, // 0x07d + SPECIES_MAGMAR, // 0x07e + SPECIES_PINSIR, // 0x07f + SPECIES_TAUROS, // 0x080 + SPECIES_MAGIKARP, // 0x081 + SPECIES_GYARADOS, // 0x082 + SPECIES_LAPRAS, // 0x083 + SPECIES_DITTO, // 0x084 + SPECIES_EEVEE, // 0x085 + SPECIES_VAPOREON, // 0x086 + SPECIES_JOLTEON, // 0x087 + SPECIES_FLAREON, // 0x088 + SPECIES_PORYGON, // 0x089 + SPECIES_OMANYTE, // 0x08a + SPECIES_OMASTAR, // 0x08b + SPECIES_KABUTO, // 0x08c + SPECIES_KABUTOPS, // 0x08d + SPECIES_AERODACTYL, // 0x08e + SPECIES_SNORLAX, // 0x08f + SPECIES_ARTICUNO, // 0x090 + SPECIES_ZAPDOS, // 0x091 + SPECIES_MOLTRES, // 0x092 + SPECIES_DRATINI, // 0x093 + SPECIES_DRAGONAIR, // 0x094 + SPECIES_DRAGONITE, // 0x095 + SPECIES_MEWTWO, // 0x096 + SPECIES_MEW, // 0x097 + SPECIES_CHIKORITA, // 0x098 + SPECIES_BAYLEEF, // 0x099 + SPECIES_MEGANIUM, // 0x09a + SPECIES_CYNDAQUIL, // 0x09b + SPECIES_QUILAVA, // 0x09c + SPECIES_TYPHLOSION, // 0x09d + SPECIES_TOTODILE, // 0x09e + SPECIES_CROCONAW, // 0x09f + SPECIES_FERALIGATR, // 0x0a0 + SPECIES_SENTRET, // 0x0a1 + SPECIES_FURRET, // 0x0a2 + SPECIES_HOOTHOOT, // 0x0a3 + SPECIES_NOCTOWL, // 0x0a4 + SPECIES_LEDYBA, // 0x0a5 + SPECIES_LEDIAN, // 0x0a6 + SPECIES_SPINARAK, // 0x0a7 + SPECIES_ARIADOS, // 0x0a8 + SPECIES_CROBAT, // 0x0a9 + SPECIES_CHINCHOU, // 0x0aa + SPECIES_LANTURN, // 0x0ab + SPECIES_PICHU, // 0x0ac + SPECIES_CLEFFA, // 0x0ad + SPECIES_IGGLYBUFF, // 0x0ae + SPECIES_TOGEPI, // 0x0af + SPECIES_TOGETIC, // 0x0b0 + SPECIES_NATU, // 0x0b1 + SPECIES_XATU, // 0x0b2 + SPECIES_MAREEP, // 0x0b3 + SPECIES_FLAAFFY, // 0x0b4 + SPECIES_AMPHAROS, // 0x0b5 + SPECIES_BELLOSSOM, // 0x0b6 + SPECIES_MARILL, // 0x0b7 + SPECIES_AZUMARILL, // 0x0b8 + SPECIES_SUDOWOODO, // 0x0b9 + SPECIES_POLITOED, // 0x0ba + SPECIES_HOPPIP, // 0x0bb + SPECIES_SKIPLOOM, // 0x0bc + SPECIES_JUMPLUFF, // 0x0bd + SPECIES_AIPOM, // 0x0be + SPECIES_SUNKERN, // 0x0bf + SPECIES_SUNFLORA, // 0x0c0 + SPECIES_YANMA, // 0x0c1 + SPECIES_WOOPER, // 0x0c2 + SPECIES_QUAGSIRE, // 0x0c3 + SPECIES_ESPEON, // 0x0c4 + SPECIES_UMBREON, // 0x0c5 + SPECIES_MURKROW, // 0x0c6 + SPECIES_SLOWKING, // 0x0c7 + SPECIES_MISDREAVUS, // 0x0c8 + SPECIES_UNOWN, // 0x0c9 + SPECIES_WOBBUFFET, // 0x0ca + SPECIES_GIRAFARIG, // 0x0cb + SPECIES_PINECO, // 0x0cc + SPECIES_FORRETRESS, // 0x0cd + SPECIES_DUNSPARCE, // 0x0ce + SPECIES_GLIGAR, // 0x0cf + SPECIES_STEELIX, // 0x0d0 + SPECIES_SNUBBULL, // 0x0d1 + SPECIES_GRANBULL, // 0x0d2 + SPECIES_QWILFISH, // 0x0d3 + SPECIES_SCIZOR, // 0x0d4 + SPECIES_SHUCKLE, // 0x0d5 + SPECIES_HERACROSS, // 0x0d6 + SPECIES_SNEASEL, // 0x0d7 + SPECIES_TEDDIURSA, // 0x0d8 + SPECIES_URSARING, // 0x0d9 + SPECIES_SLUGMA, // 0x0da + SPECIES_MAGCARGO, // 0x0db + SPECIES_SWINUB, // 0x0dc + SPECIES_PILOSWINE, // 0x0dd + SPECIES_CORSOLA, // 0x0de + SPECIES_REMORAID, // 0x0df + SPECIES_OCTILLERY, // 0x0e0 + SPECIES_DELIBIRD, // 0x0e1 + SPECIES_MANTINE, // 0x0e2 + SPECIES_SKARMORY, // 0x0e3 + SPECIES_HOUNDOUR, // 0x0e4 + SPECIES_HOUNDOOM, // 0x0e5 + SPECIES_KINGDRA, // 0x0e6 + SPECIES_PHANPY, // 0x0e7 + SPECIES_DONPHAN, // 0x0e8 + SPECIES_PORYGON2, // 0x0e9 + SPECIES_STANTLER, // 0x0ea + SPECIES_SMEARGLE, // 0x0eb + SPECIES_TYROGUE, // 0x0ec + SPECIES_HITMONTOP, // 0x0ed + SPECIES_SMOOCHUM, // 0x0ee + SPECIES_ELEKID, // 0x0ef + SPECIES_MAGBY, // 0x0f0 + SPECIES_MILTANK, // 0x0f1 + SPECIES_BLISSEY, // 0x0f2 + SPECIES_RAIKOU, // 0x0f3 + SPECIES_ENTEI, // 0x0f4 + SPECIES_SUICUNE, // 0x0f5 + SPECIES_LARVITAR, // 0x0f6 + SPECIES_PUPITAR, // 0x0f7 + SPECIES_TYRANITAR, // 0x0f8 + SPECIES_LUGIA, // 0x0f9 + SPECIES_HO_OH, // 0x0fa + SPECIES_CELEBI, // 0x0fb + + SPECIES_OLD_UNOWN_B, + SPECIES_OLD_UNOWN_C, + SPECIES_OLD_UNOWN_D, + SPECIES_OLD_UNOWN_E, + SPECIES_OLD_UNOWN_F, + SPECIES_OLD_UNOWN_G, + SPECIES_OLD_UNOWN_H, + SPECIES_OLD_UNOWN_I, + SPECIES_OLD_UNOWN_J, + SPECIES_OLD_UNOWN_K, + SPECIES_OLD_UNOWN_L, + SPECIES_OLD_UNOWN_M, + SPECIES_OLD_UNOWN_N, + SPECIES_OLD_UNOWN_O, + SPECIES_OLD_UNOWN_P, + SPECIES_OLD_UNOWN_Q, + SPECIES_OLD_UNOWN_R, + SPECIES_OLD_UNOWN_S, + SPECIES_OLD_UNOWN_T, + SPECIES_OLD_UNOWN_U, + SPECIES_OLD_UNOWN_V, + SPECIES_OLD_UNOWN_W, + SPECIES_OLD_UNOWN_X, + SPECIES_OLD_UNOWN_Y, + SPECIES_OLD_UNOWN_Z, + + SPECIES_TREECKO, // 0x115 + SPECIES_GROVYLE, // 0x116 + SPECIES_SCEPTILE, // 0x117 + SPECIES_TORCHIC, // 0x118 + SPECIES_COMBUSKEN, // 0x119 + SPECIES_BLAZIKEN, // 0x11a + SPECIES_MUDKIP, // 0x11b + SPECIES_MARSHTOMP, // 0x11c + SPECIES_SWAMPERT, // 0x11d + SPECIES_POOCHYENA, // 0x11e + SPECIES_MIGHTYENA, // 0x11f + SPECIES_ZIGZAGOON, // 0x120 + SPECIES_LINOONE, // 0x121 + SPECIES_WURMPLE, // 0x122 + SPECIES_SILCOON, // 0x123 + SPECIES_BEAUTIFLY, // 0x124 + SPECIES_CASCOON, // 0x125 + SPECIES_DUSTOX, // 0x126 + SPECIES_LOTAD, // 0x127 + SPECIES_LOMBRE, // 0x128 + SPECIES_LUDICOLO, // 0x129 + SPECIES_SEEDOT, // 0x12a + SPECIES_NUZLEAF, // 0x12b + SPECIES_SHIFTRY, // 0x12c + SPECIES_NINCADA, // 0x12d + SPECIES_NINJASK, // 0x12e + SPECIES_SHEDINJA, // 0x12f + SPECIES_TAILLOW, // 0x130 + SPECIES_SWELLOW, // 0x131 + SPECIES_SHROOMISH, // 0x132 + SPECIES_BRELOOM, // 0x133 + SPECIES_SPINDA, // 0x134 + SPECIES_WINGULL, // 0x135 + SPECIES_PELIPPER, // 0x136 + SPECIES_SURSKIT, // 0x137 + SPECIES_MASQUERAIN, // 0x138 + SPECIES_WAILMER, // 0x139 + SPECIES_WAILORD, // 0x13a + SPECIES_SKITTY, // 0x13b + SPECIES_DELCATTY, // 0x13c + SPECIES_KECLEON, // 0x13d + SPECIES_BALTOY, // 0x13e + SPECIES_CLAYDOL, // 0x13f + SPECIES_NOSEPASS, // 0x140 + SPECIES_TORKOAL, // 0x141 + SPECIES_SABLEYE, // 0x142 + SPECIES_BARBOACH, // 0x143 + SPECIES_WHISCASH, // 0x144 + SPECIES_LUVDISC, // 0x145 + SPECIES_CORPHISH, // 0x146 + SPECIES_CRAWDAUNT, // 0x147 + SPECIES_FEEBAS, // 0x148 + SPECIES_MILOTIC, // 0x149 + SPECIES_CARVANHA, // 0x14a + SPECIES_SHARPEDO, // 0x14b + SPECIES_TRAPINCH, // 0x14c + SPECIES_VIBRAVA, // 0x14d + SPECIES_FLYGON, // 0x14e + SPECIES_MAKUHITA, // 0x14f + SPECIES_HARIYAMA, // 0x150 + SPECIES_ELECTRIKE, // 0x151 + SPECIES_MANECTRIC, // 0x152 + SPECIES_NUMEL, // 0x153 + SPECIES_CAMERUPT, // 0x154 + SPECIES_SPHEAL, // 0x155 + SPECIES_SEALEO, // 0x156 + SPECIES_WALREIN, // 0x157 + SPECIES_CACNEA, // 0x158 + SPECIES_CACTURNE, // 0x159 + SPECIES_SNORUNT, // 0x15a + SPECIES_GLALIE, // 0x15b + SPECIES_LUNATONE, // 0x15c + SPECIES_SOLROCK, // 0x15d + SPECIES_AZURILL, // 0x15e + SPECIES_SPOINK, // 0x15f + SPECIES_GRUMPIG, // 0x160 + SPECIES_PLUSLE, // 0x161 + SPECIES_MINUN, // 0x162 + SPECIES_MAWILE, // 0x163 + SPECIES_MEDITITE, // 0x164 + SPECIES_MEDICHAM, // 0x165 + SPECIES_SWABLU, // 0x166 + SPECIES_ALTARIA, // 0x167 + SPECIES_WYNAUT, // 0x168 + SPECIES_DUSKULL, // 0x169 + SPECIES_DUSCLOPS, // 0x16a + SPECIES_ROSELIA, // 0x16b + SPECIES_SLAKOTH, // 0x16c + SPECIES_VIGOROTH, // 0x16d + SPECIES_SLAKING, // 0x16e + SPECIES_GULPIN, // 0x16f + SPECIES_SWALOT, // 0x170 + SPECIES_TROPIUS, // 0x171 + SPECIES_WHISMUR, // 0x172 + SPECIES_LOUDRED, // 0x173 + SPECIES_EXPLOUD, // 0x174 + SPECIES_CLAMPERL, // 0x175 + SPECIES_HUNTAIL, // 0x176 + SPECIES_GOREBYSS, // 0x177 + SPECIES_ABSOL, // 0x178 + SPECIES_SHUPPET, // 0x179 + SPECIES_BANETTE, // 0x17a + SPECIES_SEVIPER, // 0x17b + SPECIES_ZANGOOSE, // 0x17c + SPECIES_RELICANTH, // 0x17d + SPECIES_ARON, // 0x17e + SPECIES_LAIRON, // 0x17f + SPECIES_AGGRON, // 0x180 + SPECIES_CASTFORM, // 0x181 + SPECIES_VOLBEAT, // 0x182 + SPECIES_ILLUMISE, // 0x183 + SPECIES_LILEEP, // 0x184 + SPECIES_CRADILY, // 0x185 + SPECIES_ANORITH, // 0x186 + SPECIES_ARMALDO, // 0x187 + SPECIES_RALTS, // 0x188 + SPECIES_KIRLIA, // 0x189 + SPECIES_GARDEVOIR, // 0x18a + SPECIES_BAGON, // 0x18b + SPECIES_SHELGON, // 0x18c + SPECIES_SALAMENCE, // 0x18d + SPECIES_BELDUM, // 0x18e + SPECIES_METANG, // 0x18f + SPECIES_METAGROSS, // 0x190 + SPECIES_REGIROCK, // 0x191 + SPECIES_REGICE, // 0x192 + SPECIES_REGISTEEL, // 0x193 + SPECIES_KYOGRE, // 0x194 + SPECIES_GROUDON, // 0x195 + SPECIES_RAYQUAZA, // 0x196 + SPECIES_LATIAS, // 0x197 + SPECIES_LATIOS, // 0x198 + SPECIES_JIRACHI, // 0x199 + SPECIES_DEOXYS, // 0x19a + SPECIES_CHIMECHO, // 0x19b + SPECIES_EGG, // 0x19c + + SPECIES_UNOWN_B, + SPECIES_UNOWN_C, + SPECIES_UNOWN_D, + SPECIES_UNOWN_E, + SPECIES_UNOWN_F, + SPECIES_UNOWN_G, + SPECIES_UNOWN_H, + SPECIES_UNOWN_I, + SPECIES_UNOWN_J, + SPECIES_UNOWN_K, + SPECIES_UNOWN_L, + SPECIES_UNOWN_M, + SPECIES_UNOWN_N, + SPECIES_UNOWN_O, + SPECIES_UNOWN_P, + SPECIES_UNOWN_Q, + SPECIES_UNOWN_R, + SPECIES_UNOWN_S, + SPECIES_UNOWN_T, + SPECIES_UNOWN_U, + SPECIES_UNOWN_V, + SPECIES_UNOWN_W, + SPECIES_UNOWN_X, + SPECIES_UNOWN_Y, + SPECIES_UNOWN_Z, + SPECIES_UNOWN_EMARK, + SPECIES_UNOWN_QMARK, +}; \ No newline at end of file diff --git a/include/string_util.h b/include/string_util.h new file mode 100644 index 000000000..382f52251 --- /dev/null +++ b/include/string_util.h @@ -0,0 +1,42 @@ +#ifndef GUARD_STRING_UTIL_H +#define GUARD_STRING_UTIL_H + +enum StringConvertMode +{ + STR_CONV_MODE_LEFT_ALIGN, + STR_CONV_MODE_RIGHT_ALIGN, + STR_CONV_MODE_LEADING_ZEROS +}; + +u8 *StringCopy10(u8 *dest, const u8 *src); +u8 *StringGetEnd10(u8 *str); +u8 *StringCopy7(u8 *dest, const u8 *src); +u8 *StringCopy(u8 *dest, const u8 *src); +u8 *StringAppend(u8 *dest, const u8 *src); +u8 *StringCopyN(u8 *dest, const u8 *src, u8 n); +u8 *StringAppendN(u8 *dest, const u8 *src, u8 n); +u16 StringLength(const u8 *str); +s32 StringCompare(const u8 *str1, const u8 *str2); +s32 StringCompareN(const u8 *str1, const u8 *str2, u32 n); +bool8 IsStringLengthAtLeast(const u8 *str, s32 n); +u8 *ConvertIntToDecimalStringN(u8 *dest, s32 value, enum StringConvertMode mode, u8 n); +u8 *ConvertUIntToDecimalStringN(u8 *dest, u32 value, enum StringConvertMode mode, u8 n); +u8 *ConvertIntToHexStringN(u8 *dest, s32 value, enum StringConvertMode mode, u8 n); +u8 *StringExpandPlaceholders(u8 *dest, const u8 *src); +u8 *StringBraille(u8 *dest, const u8 *src); +u8 *GetExpandedPlaceholder(u32 id); +u8 *StringFill(u8 *dest, u8 c, u16 n); +u8 *StringCopyPadded(u8 *dest, const u8 *src, u8 c, u16 n); +u8 *StringFillWithTerminator(u8 *dest, u16 n); +u8 *StringCopyN_Multibyte(u8 *dest, u8 *src, u32 n); +u32 StringLength_Multibyte(u8 *str); +u8 *WriteColorChangeControlCode(u8 *dest, u32 colorType, u8 color); +bool32 sub_8009228(u8 *str); +bool32 sub_800924C(u8 *str, s32 n); +u8 GetExtCtrlCodeLength(u8 code); +static const u8 *SkipExtCtrlCode(const u8 *s); +s32 StringCompareWithoutExtCtrlCodes(const u8 *str1, const u8 *str2); +void ConvertInternationalString(u8 *s, u8 language); +void StripExtCtrlCodes(u8 *str); + +#endif // GUARD_STRING_UTIL_H diff --git a/include/text.h b/include/text.h new file mode 100644 index 000000000..98d8406b5 --- /dev/null +++ b/include/text.h @@ -0,0 +1,14 @@ +#ifndef GUARD_TEXT_H +#define GUARD_TEXT_H + +#define CHAR_SPACE 0x00 +#define CHAR_QUESTION_MARK 0xAC +#define CHAR_HYPHEN 0xAE +#define CHAR_CURRENCY 0xB7 +#define CHAR_COLON 0xF0 +#define EXT_CTRL_CODE_BEGIN 0xFC // extended control code +#define PLACEHOLDER_BEGIN 0xFD // string placeholder +#define CHAR_NEWLINE 0xFE +#define EOS 0xFF // end of string + +#endif // GUARD_TEXT_H diff --git a/ld_script.txt b/ld_script.txt index 1fdc52525..517395530 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -9,6 +9,8 @@ SECTIONS { ewram (NOLOAD) : ALIGN(4) { + gHeap = .; + . = 0x20000; @@ -39,16 +41,16 @@ SECTIONS { ALIGN(4) { asm/crt0.o(.text); - asm/main.o(.text); + src/main.o(.text); src/malloc.o(.text); - asm/dma3_manager.o(.text); + src/dma3_manager.o(.text); src/gpu_regs.o(.text); asm/bg.o(.text); asm/blit.o(.text); asm/window.o(.text); asm/text.o(.text); asm/sprite.o(.text); - asm/string_util.o(.text); + src/string_util.o(.text); asm/link.o(.text); asm/rtc.o(.text); asm/main_menu.o(.text); @@ -58,10 +60,10 @@ SECTIONS { asm/pokemon_1.o(.text); asm/calculate_base_damage.o(.text); asm/pokemon_2.o(.text); - asm/rom_806BD04.o(.text); + asm/pokemon_3.o(.text); asm/trig.o(.text); - asm/rng.o(.text); - asm/rom_806F640.o(.text); + src/rng.o(.text); + asm/util.o(.text); src/blend_palette.o(.text); asm/daycare.o(.text); asm/egg_hatch.o(.text); @@ -85,16 +87,18 @@ SECTIONS { asm/text_window.o(.text); asm/script.o(.text); asm/scrcmd.o(.text); - asm/rom_809BEDC.o(.text); - asm/var.o(.text); - asm/flag.o(.text); - asm/rom_809D7BC.o(.text); + asm/field_control_avatar.o(.text); + asm/event_data.o(.text); + asm/coord_event_weather.o(.text); + asm/field_tasks.o(.text); + asm/clock.o(.text); asm/reset_rtc_screen.o(.text); asm/start_menu.o(.text); asm/tileset.o(.text); src/palette.o(.text); asm/sound.o(.text); - asm/rom_80A3934.o(.text); + asm/battle_anim.o(.text); + asm/rom_80A5C6C.o(.text); src/task.o(.text); asm/rom5.o(.text); asm/title_screen.o(.text); @@ -106,7 +110,7 @@ SECTIONS { asm/fldeff_emotion.o(.text); asm/wild_encounter.o(.text); asm/field_effect.o(.text); - asm/rom_80B5E6C.o(.text); + asm/unknown_task.o(.text); asm/option_menu.o(.text); asm/pokedex.o(.text); asm/trainer_card.o(.text); @@ -147,7 +151,7 @@ SECTIONS { asm/decoration.o(.text); asm/slot_machine.o(.text); asm/contest_painting.o(.text); - asm/battle_ai.o(.text); + src/battle_ai.o(.text); asm/trader.o(.text); asm/starter_choose.o(.text); asm/wallclock.o(.text); @@ -176,18 +180,27 @@ SECTIONS { asm/rom_8158B30.o(.text); asm/player_pc.o(.text); asm/intro.o(.text); - asm/rom_816F318.o(.text); + asm/rom_81700F8.o(.text); + asm/field_region_map.o(.text); + asm/battle_anim_8170478.o(.text); + asm/hall_of_fame.o(.text); + asm/credits.o(.text); asm/lottery_corner.o(.text); asm/diploma.o(.text); asm/berry_tag_screen.o(.text); asm/mystery_event_menu.o(.text); asm/save_failed_screen.o(.text); - asm/rom_81795E8.o(.text); + asm/braille_puzzles.o(.text); + asm/pokeblock_feed.o(.text); asm/clear_save_data_screen.o(.text); - asm/rom_817B064.o(.text); + asm/intro_credits_graphics.o(.text); + asm/evolution_graphics.o(.text); + asm/bard_music.o(.text); + asm/fldeff_teleport.o(.text); + asm/rom_817C95C.o(.text); asm/front_pic_anim.o(.text); asm/rom_8184DA4.o(.text); - asm/multiboot.o(.text); + src/multiboot.o(.text); asm/rom_81BAD84.o(.text); } =0 @@ -215,7 +228,7 @@ SECTIONS { src/agb_flash.o(.text); src/agb_flash_1m.o(.text); src/agb_flash_mx.o(.text); - asm/librtc.o(.text); + src/siirtc.o(.text); asm/librfu.o(.text); asm/libagbsyscall.o(.text); tools/agbcc/lib/libgcc.a:_call_via_rX.o(.text); @@ -239,7 +252,40 @@ SECTIONS { .rodata : ALIGN(4) { + src/main.o(.rodata); + data/bg.o(.rodata); + data/window.o(.rodata); + data/text.o(.rodata); + data/sprite.o(.rodata); + src/string_util.o(.rodata); data/data2.o(.rodata); + data/battle_message.o(.rodata); + data/cable_car.o(.rodata); + data/save.o(.rodata); + data/field_effect_helpers.o(.rodata); + data/contest_ai.o(.rodata); + data/rom_8158B30.o(.rodata); + data/player_pc.o(.rodata); + data/intro.o(.rodata); + data/field_region_map.o(.rodata); + data/battle_anim_8170478.o(.rodata); + data/hall_of_fame.o(.rodata); + data/credits.o(.rodata); + data/lottery_corner.o(.rodata); + data/diploma.o(.rodata); + data/strings.o(.rodata); + data/berry_tag_screen.o(.rodata); + data/mystery_event_menu.o(.rodata); + data/save_failed_screen.o(.rodata); + data/braille_puzzles.o(.rodata); + data/pokeblock_feed.o(.rodata); + data/clear_save_data_screen.o(.rodata); + data/intro_credits_graphics.o(.rodata); + data/evolution_graphics.o(.rodata); + data/bard_music.o(.rodata); + data/data_860A4AC.o(.rodata); + data/fonts.o(.rodata); + data/mystery_event_msg.o(.rodata); src/m4a_tables.o(.rodata); data/sound_data.o(.rodata); } =0 @@ -251,7 +297,7 @@ SECTIONS { src/agb_flash_1m.o(.rodata); src/agb_flash_mx.o(.rodata); src/agb_flash_le.o(.rodata); - data/librtc_rodata.o(.rodata); + src/siirtc.o(.rodata); data/librfu_rodata.o(.rodata); tools/agbcc/lib/libgcc.a:_divdi3.o(.rodata); tools/agbcc/lib/libgcc.a:_udivdi3.o(.rodata); diff --git a/src/battle_ai.c b/src/battle_ai.c new file mode 100644 index 000000000..8f3b7cf1e --- /dev/null +++ b/src/battle_ai.c @@ -0,0 +1,2838 @@ +#include "global.h" +#include "pokemon.h" +#include "battle.h" +#include "species.h" +#include "abilities.h" + +#define AIScriptRead32(ptr) ((ptr)[0] | (ptr)[1] << 8 | (ptr)[2] << 16 | (ptr)[3] << 24) +#define AIScriptRead16(ptr) ((ptr)[0] | (ptr)[1] << 8) +#define AIScriptRead8(ptr) ((ptr)[0]) +#define AIScriptReadPtr(ptr) (u8*) AIScriptRead32(ptr) + +#define AI_THINKING_STRUCT ((struct AI_ThinkingStruct *)(gUnknown_020244A8->ai)) +#define UNK_2016A00_STRUCT ((struct UnknownStruct2 *)(gUnknown_020244A8->unk18)) +#define UNK_2016C00_STRUCT ((struct UnknownStruct4 *)(gUnknown_020244A8->unk1C)) +#define UNK_BATTLE_STRUCT ((struct UnknownStruct1 *)(gUnknown_020244A8)) + +#define AI_ACTION_UNK1 0x0001 +#define AI_ACTION_UNK2 0x0002 +#define AI_ACTION_UNK3 0x0004 +#define AI_ACTION_UNK4 0x0008 +#define AI_ACTION_UNK5 0x0010 +#define AI_ACTION_UNK6 0x0020 +#define AI_ACTION_UNK7 0x0040 +#define AI_ACTION_UNK8 0x0080 + +enum +{ + TARGET, + USER +}; + +// AI states +enum +{ + AIState_SettingUp, + AIState_Processing, + AIState_FinishedProcessing, + AIState_DoNotProcess +}; + +//Copied from pokeruby -- hopefully the same +struct Trainer +{ + /*0x00*/ u8 partyFlags; + /*0x01*/ u8 trainerClass; + /*0x02*/ u8 encounterMusic:7; + /*0x02*/ u8 gender:1; + /*0x03*/ u8 trainerPic; + /*0x04*/ u8 trainerName[12]; + /*0x10*/ u16 items[4]; + /*0x18*/ bool8 doubleBattle; + /*0x1C*/ u32 aiFlags; + /*0x20*/ u8 partySize; + /*0x24*/ void *party; +}; + +#define POKEMON_NAME_LENGTH 10 + +struct BattlePokemon +{ + /* 0x00 */ u16 species; + /* 0x02 */ u16 attack; + /* 0x04 */ u16 defense; + /* 0x06 */ u16 speed; + /* 0x08 */ u16 spAttack; + /* 0x0A */ u16 spDefense; + /* 0x0C */ u16 moves[4]; + /* 0x14 */ u32 hpIV:5; + /* 0x14 */ u32 attackIV:5; + /* 0x15 */ u32 defenseIV:5; + /* 0x15 */ u32 speedIV:5; + /* 0x16 */ u32 spAttackIV:5; + /* 0x17 */ u32 spDefenseIV:5; + /* 0x17 */ u32 isEgg:1; + /* 0x17 */ u32 altAbility:1; + /* 0x18 */ s8 statStages[8]; + /* 0x20 */ u8 ability; + /* 0x21 */ u8 type1; + /* 0x22 */ u8 type2; + /* 0x23 */ u8 unknown; + /* 0x24 */ u8 pp[4]; + /* 0x28 */ u16 hp; + /* 0x2A */ u8 level; + /* 0x2B */ u8 friendship; + /* 0x2C */ u16 maxHP; + /* 0x2E */ u16 item; + /* 0x30 */ u8 nickname[POKEMON_NAME_LENGTH + 1]; + /* 0x3B */ u8 ppBonuses; + /* 0x3C */ u8 otName[8]; + /* 0x44 */ u32 experience; + /* 0x48 */ u32 personality; + /* 0x4C */ u32 status1; + /* 0x50 */ u32 status2; + /* 0x54 */ u32 otId; +}; + +//size should be 0x1C +struct AI_ThinkingStruct +{ + u8 aiState; + u8 movesetIndex; + u16 moveConsidered; + s8 score[4]; + u32 funcResult; + u32 aiFlags; + u8 aiAction; + u8 aiLogicId; + u8 filler12[6]; + u8 unk18[4]; +}; + +//size should be 0x54 +struct UnknownStruct2 +{ + u16 unk0[2][8]; + u8 unk20[2]; + u8 filler20[0x1E]; + u8 unk40[4]; + u8 unk44[4]; + u16 unk48[4]; + u8 unk50; +}; + +struct UnknownStruct4 +{ + u8 *ptr[8]; + u8 unk20; +}; + +struct SimpleUnknownStruct +{ + u32 unkArray[4]; // unknown size +}; + +struct UnknownStruct1 +{ + u8 unk0; + u8 filler1[0x3]; + struct SimpleUnknownStruct *unk4; + u8 filler8[0xC]; + struct AI_ThinkingStruct *ai; + struct UnknownStruct2 *unk18; + struct UnknownStruct4 *unk1C; +}; + +struct UnknownStruct5 +{ + u8 filler0[0x3]; + u16 unk4; + u16 unk6; + u8 unk8; + u8 unk9; + u8 fillerA[0x9]; + u8 taunt:4; + u8 unkC:4; + u8 fillerD[0x2]; + u8 unk16; + u8 filler17[0x4]; +}; + +extern struct UnknownStruct5 gUnknown_020242BC[]; + +/* +gAIScriptPtr is a pointer to the next battle AI cmd command to read. +when a command finishes processing, gAIScriptPtr is incremented by +the number of bytes that the current command had reserved for arguments +in order to read the next command correctly. refer to battle_ai_scripts.s for the +AI scripts. +*/ +extern u8 *gAIScriptPtr; + +extern u32 gBattleTypeFlags; +extern u8 gUnknown_02024064; +extern struct BattlePokemon gBattleMons[]; +extern u16 gUnknown_020241EA; +extern u8 gEnemyMonIndex; +extern u8 gUnknown_02024210; +extern u16 gUnknown_02024248[]; +extern u8 *gUnknown_0202449C; +extern struct UnknownStruct1 *gUnknown_020244A8; +extern u16 gUnknown_02038BCA; +extern u16 gUnknown_02038BCC; +extern u8 gPlayerMonIndex; +extern struct Trainer gTrainers[]; +extern const u32 gBitTable[]; +extern u8 *gUnknown_082DBEF8[]; +extern u32 gUnknown_020242AC[]; +extern u16 gUnknown_0202428E[]; +extern struct BattleMove gBattleMoves[]; +extern u8 gUnknown_03005D10[]; +extern u8 gUnknown_0202406E[][2]; +extern struct BaseStats gBaseStats[]; +extern u16 gUnknown_02024400; +extern u8 gUnknown_02024474[]; +extern u8 gBattleMoveFlags; +extern int gBattleMoveDamage; +extern u8 gCritMultiplier; +extern u16 gBattleWeather; + +extern u8 battle_get_per_side_status(u8); +extern u8 b_first_side(u8, u8, u8); +extern u8 battle_get_side_with_given_state(u8); +extern void move_effectiveness_something(u16, u8, u8); +extern u8 itemid_get_x12(); +extern void b_mc_stack_push(u8 *); +extern bool8 b_mc_stack_pop_cursor(void); +extern void sub_8046E7C(u8, u8); + +typedef void (*BattleAICmdFunc)(void); + +extern const BattleAICmdFunc gUnknown_085B083C[]; + +extern u8 sub_803FECC(); +extern u16 Random(); +extern u8 battle_side_get_owner(); +extern u32 sub_8186438(); +extern u32 sub_81A6FB4(); + +void BattleAI_SetupAIData(u8 a); +u8 BattleAI_GetAIActionToUse(void); +u8 sub_8130CF4(void); +void sub_8131074(void); +void BattleAI_DoAIProcessing(void); + +void BattleAI_HandleItemUseBeforeAISetup(u8 a) +{ + s32 i; + u8 *data = (u8 *)gUnknown_020244A8->unk18; + + for (i = 0; (u32)i < 0x54; i++) + data[i] = 0; + if ((gBattleTypeFlags & 0x0A7F098A) == 8) + { + for (i = 0; i < 4; i++) + { + if (gTrainers[gUnknown_02038BCA].items[i] != 0) + { + gUnknown_020244A8->unk18->unk48[gUnknown_020244A8->unk18->unk50] = gTrainers[gUnknown_02038BCA].items[i]; + gUnknown_020244A8->unk18->unk50++; + } + } + } + + BattleAI_SetupAIData(a); +} + +void BattleAI_SetupAIData(u8 a) +{ + s32 i; + u8 *data = (u8 *)AI_THINKING_STRUCT; + u8 r6; + + // clear AI data. + for (i = 0; (u32)i < sizeof(struct AI_ThinkingStruct); i++) + data[i] = 0; + + // conditional score reset, unlike Ruby. + for (i = 0; i < 4; i++) + { + if (a & 1) + AI_THINKING_STRUCT->score[i] = 100; + else + AI_THINKING_STRUCT->score[i] = 0; + a >>= 1; + } + + r6 = sub_803FECC(gUnknown_02024064, 0, 0xFF); + + for (i = 0; i < 4; i++) + { + if (gBitTable[i] & r6) + AI_THINKING_STRUCT->score[i] = 0; + + AI_THINKING_STRUCT->unk18[i] = 100 - (Random() % 16); + } + gUnknown_020244A8->unk1C->unk20 = 0; + gPlayerMonIndex = gUnknown_02024064; + if (gBattleTypeFlags & 1) + { + gEnemyMonIndex = (Random() & 2) + ((u32)battle_side_get_owner(gUnknown_02024064) ^ 1); + if (gUnknown_02024210 & gBitTable[gEnemyMonIndex]) + gEnemyMonIndex ^= 2; + } + else + { + //_08130A60 + gEnemyMonIndex = gPlayerMonIndex ^ 1; + } + //_08130A68 + if (gBattleTypeFlags & 0x1000000) + AI_THINKING_STRUCT->aiFlags = sub_8186438(); + else if (gBattleTypeFlags & 0x80) + AI_THINKING_STRUCT->aiFlags = 0x40000000; + else if (gBattleTypeFlags & 0x400) + AI_THINKING_STRUCT->aiFlags = 0x20000000; + else if (gBattleTypeFlags & 0x10) + AI_THINKING_STRUCT->aiFlags = 0x80000000; + else if (gBattleTypeFlags & 0x80000) + AI_THINKING_STRUCT->aiFlags = sub_81A6FB4(); + else if (gBattleTypeFlags & 0x0C3F0900) + AI_THINKING_STRUCT->aiFlags = 7; + else if (gBattleTypeFlags & 0x8000) + AI_THINKING_STRUCT->aiFlags = gTrainers[gUnknown_02038BCA].aiFlags | gTrainers[gUnknown_02038BCC].aiFlags; + else + AI_THINKING_STRUCT->aiFlags = gTrainers[gUnknown_02038BCA].aiFlags; + if (gBattleTypeFlags & 1) + AI_THINKING_STRUCT->aiFlags |= 0x80; +} + +u8 sub_8130BA4(void) +{ + u16 r4 = gUnknown_020241EA; + u8 ret; + + if (!(gBattleTypeFlags & 1)) + ret = BattleAI_GetAIActionToUse(); + else + ret = sub_8130CF4(); + + gUnknown_020241EA = r4; + return ret; +} + +u8 BattleAI_GetAIActionToUse(void) +{ + u8 currentMoveArray[4]; + u8 consideredMoveArray[4]; + u8 numOfBestMoves; + s32 i; + + sub_8131074(); + + while (AI_THINKING_STRUCT->aiFlags != 0) + { + if (AI_THINKING_STRUCT->aiFlags & 1) + { + AI_THINKING_STRUCT->aiState = AIState_SettingUp; + BattleAI_DoAIProcessing(); + } + AI_THINKING_STRUCT->aiFlags >>= 1; + AI_THINKING_STRUCT->aiLogicId++; + AI_THINKING_STRUCT->movesetIndex = 0; + } + + // special flags for safari watch/flee. + if (AI_THINKING_STRUCT->aiAction & 2) + return 4; + if (AI_THINKING_STRUCT->aiAction & 4) + return 5; + + numOfBestMoves = 1; + currentMoveArray[0] = AI_THINKING_STRUCT->score[0]; + consideredMoveArray[0] = 0; + + for (i = 1; i < 4; i++) + { + if (gBattleMons[gPlayerMonIndex].moves[i] != 0) // emerald adds an extra move ID check for some reason. + { + // in ruby, the order of these if statements are reversed. + if (currentMoveArray[0] == AI_THINKING_STRUCT->score[i]) + { + currentMoveArray[numOfBestMoves] = AI_THINKING_STRUCT->score[i]; + consideredMoveArray[numOfBestMoves++] = i; + } + if (currentMoveArray[0] < AI_THINKING_STRUCT->score[i]) + { + numOfBestMoves = 1; + currentMoveArray[0] = AI_THINKING_STRUCT->score[i]; + consideredMoveArray[0] = i; + } + } + } + return consideredMoveArray[Random() % numOfBestMoves]; +} + +#ifdef NONMATCHING +u8 sub_8130CF4(void) +{ + s32 i; + s32 j; + //s32 r4_2; + #define r4_2 r4 + s32 r5; + s16 r5_2; + s32 r4; + s16 sp0[4]; + s8 sp8[4]; + s8 spC[4]; + u8 sp10[4]; // definitely unsigned + u8 sp14[4]; + //u8 *sp1C = spC; + //u8 *sp18 = sp8; + //u8 *sp20 = spC; + + for (i = 0; i < 4; i++) //_08130D14 + { + if (i == gPlayerMonIndex || gBattleMons[i].hp == 0) + { + //_08130D2E + spC[i] = -1; + sp0[i] = -1; + } + //_08130D48 + else + { + if (gBattleTypeFlags & 0x20000) + BattleAI_SetupAIData(gUnknown_0202449C[0x92] >> 4); + else + BattleAI_SetupAIData(0xF); + //_08130D76 + gEnemyMonIndex = i; + if ((i & 1) != (gPlayerMonIndex & 1)) + sub_8131074(); + //_08130D90 + AI_THINKING_STRUCT->unk11 = 0; + AI_THINKING_STRUCT->unk1 = 0; + r4 = AI_THINKING_STRUCT->aiFlags; + while (r4 != 0) + { + if (r4 & 1) + { + AI_THINKING_STRUCT->aiState = AIState_SettingUp; + BattleAI_DoAIProcessing(); + } + r4 >>= 1; + AI_THINKING_STRUCT->unk11++; + AI_THINKING_STRUCT->unk1 = 0; + } + //_08130DD8 + if (AI_THINKING_STRUCT->unk10 & 2) + spC[i] = 4; + else if (AI_THINKING_STRUCT->unk10 & 4) + spC[i] = 5; + else + { + //_08130E10 + sp10[0] = AI_THINKING_STRUCT->score[0]; + sp14[0] = 0; + r5 = 1; + for (j = 1; j < 4; j++) + { + if (gBattleMons[gPlayerMonIndex].moves[j] != 0) + { + if (sp10[0] == AI_THINKING_STRUCT->score[j]) + { + sp10[r5] = AI_THINKING_STRUCT->score[j]; + sp14[r5] = j; + r5++; + } + if (sp10[0] < AI_THINKING_STRUCT->score[j]) + { + sp10[0] = AI_THINKING_STRUCT->score[j]; + sp14[0] = j; + r5 = 1; + } + } + //_08130E72 + } + spC[i] = sp14[Random() % r5]; + //asm("":::"r3"); + sp0[i] = sp10[0]; + if (i == (gPlayerMonIndex ^ 2) && sp0[i] < 100) + sp0[i] = -1; + } + } + //_08130EAE + } + + //#define i r5 + + //_08130EC4 + r5_2 = sp0[0]; + sp8[0] = 0; + r4_2 = 1; + for (i = 1; i < 4; i++) + { + //_08130EDA + if (r5_2 == sp0[i]) + { + sp8[r4_2] = i; + r4_2++; + } + //_08130EEE + if (r5_2 < sp0[i]) + { + r5_2 = sp0[i]; + sp8[0] = i; + r4_2 = 1; + } + } + gEnemyMonIndex = sp8[Random() % r4_2]; + return spC[gEnemyMonIndex]; +} +#else +__attribute__((naked)) +u8 sub_8130CF4(void) +{ + asm(".syntax unified\n\ + push {r4-r7,lr}\n\ + mov r7, r10\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5-r7}\n\ + sub sp, 0x24\n\ + movs r0, 0\n\ + mov r8, r0\n\ + mov r1, sp\n\ + adds r1, 0xC\n\ + str r1, [sp, 0x1C]\n\ + mov r2, sp\n\ + adds r2, 0x8\n\ + str r2, [sp, 0x18]\n\ + str r1, [sp, 0x20]\n\ + mov r10, sp\n\ +_08130D14:\n\ + ldr r0, =gPlayerMonIndex\n\ + ldrb r0, [r0]\n\ + cmp r8, r0\n\ + beq _08130D2E\n\ + movs r0, 0x58\n\ + mov r7, r8\n\ + muls r7, r0\n\ + adds r0, r7, 0\n\ + ldr r1, =gBattleMons\n\ + adds r0, r1\n\ + ldrh r0, [r0, 0x28]\n\ + cmp r0, 0\n\ + bne _08130D48\n\ +_08130D2E:\n\ + movs r0, 0xFF\n\ + ldr r2, [sp, 0x20]\n\ + strb r0, [r2]\n\ + ldr r0, =0x0000ffff\n\ + mov r7, r10\n\ + strh r0, [r7]\n\ + b _08130EAE\n\ + .pool\n\ +_08130D48:\n\ + ldr r0, =gBattleTypeFlags\n\ + ldr r0, [r0]\n\ + movs r1, 0x80\n\ + lsls r1, 10\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _08130D70\n\ + ldr r0, =gUnknown_0202449C\n\ + ldr r0, [r0]\n\ + adds r0, 0x92\n\ + ldrb r0, [r0]\n\ + lsrs r0, 4\n\ + bl BattleAI_SetupAIData\n\ + b _08130D76\n\ + .pool\n\ +_08130D70:\n\ + movs r0, 0xF\n\ + bl BattleAI_SetupAIData\n\ +_08130D76:\n\ + ldr r0, =gEnemyMonIndex\n\ + mov r1, r8\n\ + strb r1, [r0]\n\ + movs r1, 0x1\n\ + mov r2, r8\n\ + ands r2, r1\n\ + ldr r0, =gPlayerMonIndex\n\ + ldrb r0, [r0]\n\ + ands r1, r0\n\ + cmp r2, r1\n\ + beq _08130D90\n\ + bl sub_8131074\n\ +_08130D90:\n\ + ldr r2, =gUnknown_020244A8\n\ + ldr r0, [r2]\n\ + ldr r0, [r0, 0x14]\n\ + movs r1, 0\n\ + strb r1, [r0, 0x11]\n\ + ldr r0, [r2]\n\ + ldr r0, [r0, 0x14]\n\ + strb r1, [r0, 0x1]\n\ + ldr r0, [r2]\n\ + ldr r0, [r0, 0x14]\n\ + ldr r4, [r0, 0xC]\n\ + mov r9, r2\n\ + cmp r4, 0\n\ + beq _08130DD8\n\ + mov r5, r9\n\ + movs r6, 0\n\ +_08130DB0:\n\ + movs r0, 0x1\n\ + ands r0, r4\n\ + cmp r0, 0\n\ + beq _08130DC2\n\ + ldr r0, [r5]\n\ + ldr r0, [r0, 0x14]\n\ + strb r6, [r0]\n\ + bl BattleAI_DoAIProcessing\n\ +_08130DC2:\n\ + asrs r4, 1\n\ + ldr r0, [r5]\n\ + ldr r1, [r0, 0x14]\n\ + ldrb r0, [r1, 0x11]\n\ + adds r0, 0x1\n\ + strb r0, [r1, 0x11]\n\ + ldr r0, [r5]\n\ + ldr r0, [r0, 0x14]\n\ + strb r6, [r0, 0x1]\n\ + cmp r4, 0\n\ + bne _08130DB0\n\ +_08130DD8:\n\ + mov r2, r9\n\ + ldr r0, [r2]\n\ + ldr r3, [r0, 0x14]\n\ + ldrb r1, [r3, 0x10]\n\ + movs r0, 0x2\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _08130DFC\n\ + movs r0, 0x4\n\ + ldr r7, [sp, 0x20]\n\ + strb r0, [r7]\n\ + b _08130EAE\n\ + .pool\n\ +_08130DFC:\n\ + movs r0, 0x4\n\ + ands r0, r1\n\ + lsls r0, 24\n\ + lsrs r2, r0, 24\n\ + cmp r2, 0\n\ + beq _08130E10\n\ + movs r0, 0x5\n\ + ldr r1, [sp, 0x20]\n\ + strb r0, [r1]\n\ + b _08130EAE\n\ +_08130E10:\n\ + add r1, sp, 0x10\n\ + ldrb r0, [r3, 0x4]\n\ + strb r0, [r1]\n\ + add r0, sp, 0x14\n\ + strb r2, [r0]\n\ + movs r5, 0x1\n\ + movs r3, 0x1\n\ + adds r6, r1, 0\n\ + ldr r0, =gPlayerMonIndex\n\ + ldrb r1, [r0]\n\ + movs r0, 0x58\n\ + muls r0, r1\n\ + ldr r2, =gUnknown_02024090\n\ + adds r0, r2\n\ + adds r4, r0, 0x2\n\ + add r7, sp, 0x14\n\ +_08130E30:\n\ + ldrh r0, [r4]\n\ + cmp r0, 0\n\ + beq _08130E72\n\ + ldrb r1, [r6]\n\ + mov r2, r9\n\ + ldr r0, [r2]\n\ + ldr r0, [r0, 0x14]\n\ + adds r0, 0x4\n\ + adds r2, r0, r3\n\ + movs r0, 0\n\ + ldrsb r0, [r2, r0]\n\ + cmp r1, r0\n\ + bne _08130E56\n\ + adds r0, r6, r5\n\ + ldrb r1, [r2]\n\ + strb r1, [r0]\n\ + adds r0, r7, r5\n\ + strb r3, [r0]\n\ + adds r5, 0x1\n\ +_08130E56:\n\ + ldrb r1, [r6]\n\ + mov r2, r9\n\ + ldr r0, [r2]\n\ + ldr r0, [r0, 0x14]\n\ + adds r0, 0x4\n\ + adds r2, r0, r3\n\ + movs r0, 0\n\ + ldrsb r0, [r2, r0]\n\ + cmp r1, r0\n\ + bge _08130E72\n\ + ldrb r0, [r2]\n\ + strb r0, [r6]\n\ + strb r3, [r7]\n\ + movs r5, 0x1\n\ +_08130E72:\n\ + adds r4, 0x2\n\ + adds r3, 0x1\n\ + cmp r3, 0x3\n\ + ble _08130E30\n\ + bl Random\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + adds r1, r5, 0\n\ + bl __modsi3\n\ + add r0, sp\n\ + adds r0, 0x14\n\ + ldrb r0, [r0]\n\ + ldr r7, [sp, 0x20]\n\ + strb r0, [r7]\n\ + ldrb r2, [r6]\n\ + mov r0, r10\n\ + strh r2, [r0]\n\ + ldr r0, =gPlayerMonIndex\n\ + ldrb r1, [r0]\n\ + movs r0, 0x2\n\ + eors r0, r1\n\ + cmp r8, r0\n\ + bne _08130EAE\n\ + cmp r2, 0x63\n\ + bgt _08130EAE\n\ + ldr r0, =0x0000ffff\n\ + mov r1, r10\n\ + strh r0, [r1]\n\ +_08130EAE:\n\ + ldr r2, [sp, 0x20]\n\ + adds r2, 0x1\n\ + str r2, [sp, 0x20]\n\ + movs r7, 0x2\n\ + add r10, r7\n\ + movs r0, 0x1\n\ + add r8, r0\n\ + mov r1, r8\n\ + cmp r1, 0x3\n\ + bgt _08130EC4\n\ + b _08130D14\n\ +_08130EC4:\n\ + mov r0, sp\n\ + ldrh r5, [r0]\n\ + movs r0, 0\n\ + ldr r2, [sp, 0x18]\n\ + strb r0, [r2]\n\ + movs r4, 0x1\n\ + mov r8, r4\n\ + ldr r6, =gEnemyMonIndex\n\ + ldr r3, [sp, 0x18]\n\ + mov r1, sp\n\ + adds r1, 0x2\n\ +_08130EDA:\n\ + lsls r0, r5, 16\n\ + asrs r2, r0, 16\n\ + movs r7, 0\n\ + ldrsh r0, [r1, r7]\n\ + cmp r2, r0\n\ + bne _08130EEE\n\ + adds r0, r3, r4\n\ + mov r7, r8\n\ + strb r7, [r0]\n\ + adds r4, 0x1\n\ +_08130EEE:\n\ + movs r7, 0\n\ + ldrsh r0, [r1, r7]\n\ + cmp r2, r0\n\ + bge _08130EFE\n\ + ldrh r5, [r1]\n\ + mov r0, r8\n\ + strb r0, [r3]\n\ + movs r4, 0x1\n\ +_08130EFE:\n\ + adds r1, 0x2\n\ + movs r2, 0x1\n\ + add r8, r2\n\ + mov r7, r8\n\ + cmp r7, 0x3\n\ + ble _08130EDA\n\ + bl Random\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + adds r1, r4, 0\n\ + bl __modsi3\n\ + ldr r1, [sp, 0x18]\n\ + adds r0, r1, r0\n\ + ldrb r0, [r0]\n\ + strb r0, [r6]\n\ + ldrb r0, [r6]\n\ + ldr r2, [sp, 0x1C]\n\ + adds r0, r2, r0\n\ + ldrb r0, [r0]\n\ + add sp, 0x24\n\ + pop {r3-r5}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + mov r10, r5\n\ + pop {r4-r7}\n\ + pop {r1}\n\ + bx r1\n\ + .pool\n\ + .syntax divided\n"); +} +#endif + +void BattleAI_DoAIProcessing(void) +{ + while (AI_THINKING_STRUCT->aiState != AIState_FinishedProcessing) + { + switch (AI_THINKING_STRUCT->aiState) + { + case AIState_DoNotProcess: //Needed to match. + break; + case AIState_SettingUp: + gAIScriptPtr = gUnknown_082DBEF8[AI_THINKING_STRUCT->aiLogicId]; // set AI ptr to logic ID. + if (gBattleMons[gPlayerMonIndex].pp[AI_THINKING_STRUCT->movesetIndex] == 0) + { + AI_THINKING_STRUCT->moveConsidered = 0; + } + else + { + AI_THINKING_STRUCT->moveConsidered = gBattleMons[gPlayerMonIndex].moves[AI_THINKING_STRUCT->movesetIndex]; + } + AI_THINKING_STRUCT->aiState++; + break; + case AIState_Processing: + if (AI_THINKING_STRUCT->moveConsidered != 0) + gUnknown_085B083C[*gAIScriptPtr](); // run AI command. + else + { + AI_THINKING_STRUCT->score[AI_THINKING_STRUCT->movesetIndex] = 0; + AI_THINKING_STRUCT->aiAction |= 1; + } + if (AI_THINKING_STRUCT->aiAction & 1) + { + AI_THINKING_STRUCT->movesetIndex++; + + if (AI_THINKING_STRUCT->movesetIndex < 4 && !(AI_THINKING_STRUCT->aiAction & 8)) + AI_THINKING_STRUCT->aiState = AIState_SettingUp; + else + AI_THINKING_STRUCT->aiState++; + + AI_THINKING_STRUCT->aiAction &= 0xFE; + } + break; + } + } +} + +void sub_8131074(void) +{ + s32 i; + + for (i = 0; i < 4; i++) + { + if (gUnknown_020244A8->unk18->unk0[gEnemyMonIndex][i] == gUnknown_02024248[gEnemyMonIndex]) + break; + if (gUnknown_020244A8->unk18->unk0[gEnemyMonIndex][i] != gUnknown_02024248[gEnemyMonIndex] //HACK: This redundant condition is a hack to make the asm match. + && gUnknown_020244A8->unk18->unk0[gEnemyMonIndex][i] == 0) + { + gUnknown_020244A8->unk18->unk0[gEnemyMonIndex][i] = gUnknown_02024248[gEnemyMonIndex]; + break; + } + } +} + +void sub_81310F0(u8 a) +{ + s32 i; + + for (i = 0; i < 4; i++) + gUnknown_020244A8->unk18->unk0[a][i] = 0; +} + +void b_history__record_ability_usage_of_player(u8 a, u8 b) +{ + gUnknown_020244A8->unk18->unk40[a] = b; +} + +void sub_8131130(u8 a) +{ + gUnknown_020244A8->unk18->unk40[a] = 0; +} + +void b_history__record_item_x12_of_player(u8 a, u8 b) +{ + gUnknown_020244A8->unk18->unk44[a] = b; +} + +void sub_8131160(u8 a) +{ + gUnknown_020244A8->unk18->unk44[a] = 0; +} + +static void BattleAICmd_if_random_less_than(void) +{ + u16 random = Random(); + + if (random % 256 < gAIScriptPtr[1]) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); + else + gAIScriptPtr += 6; +} + +static void BattleAICmd_if_random_greater_than(void) +{ + u16 random = Random(); + + if (random % 256 > gAIScriptPtr[1]) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); + else + gAIScriptPtr += 6; +} + +static void BattleAICmd_if_random_equal(void) +{ + u16 random = Random(); + + if (random % 256 == gAIScriptPtr[1]) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); + else + gAIScriptPtr += 6; +} + +static void BattleAICmd_if_random_not_equal(void) +{ + u16 random = Random(); + + if (random % 256 != gAIScriptPtr[1]) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); + else + gAIScriptPtr += 6; +} + +static void BattleAICmd_score(void) +{ + AI_THINKING_STRUCT->score[AI_THINKING_STRUCT->movesetIndex] += gAIScriptPtr[1]; // add the result to the array of the move consider's score. + + if (AI_THINKING_STRUCT->score[AI_THINKING_STRUCT->movesetIndex] < 0) // if the score is negative, flatten it to 0. + AI_THINKING_STRUCT->score[AI_THINKING_STRUCT->movesetIndex] = 0; + + gAIScriptPtr += 2; // AI return. +} + +static void BattleAICmd_if_hp_less_than(void) +{ + u16 index; + + if (gAIScriptPtr[1] == USER) + index = gPlayerMonIndex; + else + index = gEnemyMonIndex; + + if ((u32)(100 * gBattleMons[index].hp / gBattleMons[index].maxHP) < gAIScriptPtr[2]) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 3); + else + gAIScriptPtr += 7; +} + +static void BattleAICmd_if_hp_more_than(void) +{ + u16 index; + + if (gAIScriptPtr[1] == USER) + index = gPlayerMonIndex; + else + index = gEnemyMonIndex; + + if ((u32)(100 * gBattleMons[index].hp / gBattleMons[index].maxHP) > gAIScriptPtr[2]) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 3); + else + gAIScriptPtr += 7; +} + +static void BattleAICmd_if_hp_equal(void) +{ + u16 index; + + if (gAIScriptPtr[1] == USER) + index = gPlayerMonIndex; + else + index = gEnemyMonIndex; + + if ((u32)(100 * gBattleMons[index].hp / gBattleMons[index].maxHP) == gAIScriptPtr[2]) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 3); + else + gAIScriptPtr += 7; +} + +static void BattleAICmd_if_hp_not_equal(void) +{ + u16 index; + + if (gAIScriptPtr[1] == USER) + index = gPlayerMonIndex; + else + index = gEnemyMonIndex; + + if ((u32)(100 * gBattleMons[index].hp / gBattleMons[index].maxHP) != gAIScriptPtr[2]) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 3); + else + gAIScriptPtr += 7; +} + +static void BattleAICmd_if_status(void) +{ + u16 index; + u32 arg; + + if (gAIScriptPtr[1] == USER) + index = gPlayerMonIndex; + else + index = gEnemyMonIndex; + + arg = AIScriptRead32(gAIScriptPtr + 2); + + if ((gBattleMons[index].status1 & arg) != 0) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 6); + else + gAIScriptPtr += 10; +} + +static void BattleAICmd_if_not_status(void) +{ + u16 index; + u32 arg; + + if (gAIScriptPtr[1] == USER) + index = gPlayerMonIndex; + else + index = gEnemyMonIndex; + + arg = AIScriptRead32(gAIScriptPtr + 2); + + if ((gBattleMons[index].status1 & arg) == 0) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 6); + else + gAIScriptPtr += 10; +} + +static void BattleAICmd_if_status2(void) +{ + u16 index; + u32 arg; + + if (gAIScriptPtr[1] == USER) + index = gPlayerMonIndex; + else + index = gEnemyMonIndex; + + arg = AIScriptRead32(gAIScriptPtr + 2); + + if ((gBattleMons[index].status2 & arg) != 0) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 6); + else + gAIScriptPtr += 10; +} + +static void BattleAICmd_if_not_status2(void) +{ + u16 index; + u32 arg; + + if (gAIScriptPtr[1] == USER) + index = gPlayerMonIndex; + else + index = gEnemyMonIndex; + + arg = AIScriptRead32(gAIScriptPtr + 2); + + if ((gBattleMons[index].status2 & arg) == 0) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 6); + else + gAIScriptPtr += 10; +} + +static void BattleAICmd_if_status3(void) +{ + u16 index; + u32 arg; + + if (gAIScriptPtr[1] == USER) + index = gPlayerMonIndex; + else + index = gEnemyMonIndex; + + arg = AIScriptRead32(gAIScriptPtr + 2); + + if ((gUnknown_020242AC[index] & arg) != 0) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 6); + else + gAIScriptPtr += 10; +} + +static void BattleAICmd_if_not_status3(void) +{ + u16 index; + u32 arg; + + if (gAIScriptPtr[1] == USER) + index = gPlayerMonIndex; + else + index = gEnemyMonIndex; + + arg = AIScriptRead32(gAIScriptPtr + 2); + + if ((gUnknown_020242AC[index] & arg) == 0) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 6); + else + gAIScriptPtr += 10; +} + +static void BattleAICmd_if_status4(void) +{ + u16 index; + u32 arg1, arg2; + + if (gAIScriptPtr[1] == USER) + index = gPlayerMonIndex; + else + index = gEnemyMonIndex; + + arg1 = battle_get_per_side_status(index) & 1; + arg2 = AIScriptRead32(gAIScriptPtr + 2); + + if ((gUnknown_0202428E[arg1] & arg2) != 0) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 6); + else + gAIScriptPtr += 10; +} + +static void BattleAICmd_if_not_status4(void) +{ + u16 index; + u32 arg1, arg2; + + if (gAIScriptPtr[1] == USER) + index = gPlayerMonIndex; + else + index = gEnemyMonIndex; + + arg1 = battle_get_per_side_status(index) & 1; + arg2 = AIScriptRead32(gAIScriptPtr + 2); + + if ((gUnknown_0202428E[arg1] & arg2) == 0) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 6); + else + gAIScriptPtr += 10; +} + +static void BattleAICmd_if_less_than(void) +{ + if (AI_THINKING_STRUCT->funcResult < gAIScriptPtr[1]) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); + else + gAIScriptPtr += 6; +} + +static void BattleAICmd_if_more_than(void) +{ + if (AI_THINKING_STRUCT->funcResult > gAIScriptPtr[1]) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); + else + gAIScriptPtr += 6; +} + +static void BattleAICmd_if_equal(void) +{ + if (AI_THINKING_STRUCT->funcResult == gAIScriptPtr[1]) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); + else + gAIScriptPtr += 6; +} + +static void BattleAICmd_if_not_equal(void) +{ + if (AI_THINKING_STRUCT->funcResult != gAIScriptPtr[1]) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); + else + gAIScriptPtr += 6; +} + +static void BattleAICmd_if_less_than_32(void) +{ + u8 *temp = AIScriptReadPtr(gAIScriptPtr + 1); + + if (AI_THINKING_STRUCT->funcResult < *temp) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 5); + else + gAIScriptPtr += 9; +} + +static void BattleAICmd_if_more_than_32(void) +{ + u8 *temp = AIScriptReadPtr(gAIScriptPtr + 1); + + if (AI_THINKING_STRUCT->funcResult > *temp) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 5); + else + gAIScriptPtr += 9; +} + +static void BattleAICmd_if_equal_32(void) +{ + u8 *temp = AIScriptReadPtr(gAIScriptPtr + 1); + + if (AI_THINKING_STRUCT->funcResult == *temp) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 5); + else + gAIScriptPtr += 9; +} + +static void BattleAICmd_if_not_equal_32(void) +{ + u8 *temp = AIScriptReadPtr(gAIScriptPtr + 1); + + if (AI_THINKING_STRUCT->funcResult != *temp) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 5); + else + gAIScriptPtr += 9; +} + +static void BattleAICmd_if_move(void) +{ + u16 move = AIScriptRead16(gAIScriptPtr + 1); + + if (AI_THINKING_STRUCT->moveConsidered == move) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 3); + else + gAIScriptPtr += 7; +} + +static void BattleAICmd_if_not_move(void) +{ + u16 move = AIScriptRead16(gAIScriptPtr + 1); + + if (AI_THINKING_STRUCT->moveConsidered != move) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 3); + else + gAIScriptPtr += 7; +} + +static void BattleAICmd_if_in_bytes(void) +{ + u8 *ptr = AIScriptReadPtr(gAIScriptPtr + 1); + + while (*ptr != 0xFF) + { + if (AI_THINKING_STRUCT->funcResult == *ptr) + { + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 5); + return; + } + ptr++; + } + gAIScriptPtr += 9; +} + +static void BattleAICmd_if_not_in_bytes(void) +{ + u8 *ptr = AIScriptReadPtr(gAIScriptPtr + 1); + + while (*ptr != 0xFF) + { + if (AI_THINKING_STRUCT->funcResult == *ptr) + { + gAIScriptPtr += 9; + return; + } + ptr++; + } + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 5); +} + +static void BattleAICmd_if_in_words(void) +{ + u16 *ptr = (u16 *)AIScriptReadPtr(gAIScriptPtr + 1); + + while (*ptr != 0xFFFF) + { + if (AI_THINKING_STRUCT->funcResult == *ptr) + { + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 5); + return; + } + ptr++; + } + gAIScriptPtr += 9; +} + +static void BattleAICmd_if_not_in_words(void) +{ + u16 *ptr = (u16 *)AIScriptReadPtr(gAIScriptPtr + 1); + + while (*ptr != 0xFFFF) + { + if (AI_THINKING_STRUCT->funcResult == *ptr) + { + gAIScriptPtr += 9; + return; + } + ptr++; + } + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 5); +} + +static void BattleAICmd_if_user_can_damage(void) +{ + s32 i; + + for (i = 0; i < 4; i++) + { + if (gBattleMons[gPlayerMonIndex].moves[i] != 0 + && gBattleMoves[gBattleMons[gPlayerMonIndex].moves[i]].power != 0) + break; + } + if (i == 4) + gAIScriptPtr += 5; + else + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 1); +} + +static void BattleAICmd_if_user_cant_damage(void) +{ + s32 i; + + for (i = 0; i < 4; i++) + { + if (gBattleMons[gPlayerMonIndex].moves[i] != 0 + && gBattleMoves[gBattleMons[gPlayerMonIndex].moves[i]].power != 0) + break; + } + if (i != 4) + gAIScriptPtr += 5; + else + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 1); +} + +static void BattleAICmd_get_turn_count(void) +{ + AI_THINKING_STRUCT->funcResult = gUnknown_03005D10[19]; + gAIScriptPtr += 1; +} + +static void BattleAICmd_get_type(void) +{ + u8 typeVar = gAIScriptPtr[1]; + + switch (typeVar) + { + case 1: // player primary type + AI_THINKING_STRUCT->funcResult = gBattleMons[gPlayerMonIndex].type1; + break; + case 0: // enemy primary type + AI_THINKING_STRUCT->funcResult = gBattleMons[gEnemyMonIndex].type1; + break; + case 3: // player secondary type + AI_THINKING_STRUCT->funcResult = gBattleMons[gPlayerMonIndex].type2; + break; + case 2: // enemy secondary type + AI_THINKING_STRUCT->funcResult = gBattleMons[gEnemyMonIndex].type2; + break; + case 4: // type of move being pointed to + AI_THINKING_STRUCT->funcResult = gBattleMoves[AI_THINKING_STRUCT->moveConsidered].type; + break; + } + gAIScriptPtr += 2; +} + +// util for double battles? whats this doing in the middle of the battle AI macros? +u8 sub_8131E70(u8 index) +{ + switch (index) + { + case 1: + return gPlayerMonIndex; + case 0: + default: + return gEnemyMonIndex; + case 3: + return gPlayerMonIndex ^ 2; + case 2: + return gEnemyMonIndex ^ 2; + } +} + +static void BattleAICmd_unk_5F(void) +{ + u8 index = sub_8131E70(gAIScriptPtr[1]); + + if(gBattleMons[index].type1 == gAIScriptPtr[2] || gBattleMons[index].type2 == gAIScriptPtr[2]) + { + AI_THINKING_STRUCT->funcResult = 1; + } + else + { + AI_THINKING_STRUCT->funcResult = 0; + } + + gAIScriptPtr += 3; +} + +static void BattleAICmd_get_move_power(void) +{ + AI_THINKING_STRUCT->funcResult = gBattleMoves[AI_THINKING_STRUCT->moveConsidered].power; + gAIScriptPtr += 1; +} + +__attribute__((naked)) // not even going to try. if it doesnt match in ruby, it wont match in emerald (yet). +static void BattleAICmd_is_most_powerful_move(void) +{ + asm(".syntax unified\n\ + push {r4-r7,lr}\n\ + mov r7, r10\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5-r7}\n\ + sub sp, 0x14\n\ + movs r3, 0\n\ + ldr r0, =gUnknown_085B09C8\n\ + ldrh r1, [r0]\n\ + ldr r5, =0x0000ffff\n\ + ldr r6, =gBattleMoves\n\ + ldr r2, =gUnknown_020244A8\n\ + cmp r1, r5\n\ + beq _08131F86\n\ + ldr r0, [r2]\n\ + ldr r0, [r0, 0x14]\n\ + ldrh r1, [r0, 0x2]\n\ + lsls r0, r1, 1\n\ + adds r0, r1\n\ + lsls r0, 2\n\ + adds r0, r6\n\ + ldrb r4, [r0]\n\ + ldr r1, =gUnknown_085B09C8\n\ +_08131F76:\n\ + ldrh r0, [r1]\n\ + cmp r4, r0\n\ + beq _08131F86\n\ + adds r1, 0x2\n\ + adds r3, 0x1\n\ + ldrh r0, [r1]\n\ + cmp r0, r5\n\ + bne _08131F76\n\ +_08131F86:\n\ + ldr r0, [r2]\n\ + ldr r0, [r0, 0x14]\n\ + ldrh r1, [r0, 0x2]\n\ + lsls r0, r1, 1\n\ + adds r0, r1\n\ + lsls r0, 2\n\ + adds r0, r6\n\ + ldrb r0, [r0, 0x1]\n\ + cmp r0, 0x1\n\ + bhi _08131F9C\n\ + b _08132126\n\ +_08131F9C:\n\ + lsls r0, r3, 1\n\ + ldr r1, =gUnknown_085B09C8\n\ + adds r0, r1\n\ + ldrh r3, [r0]\n\ + ldr r0, =0x0000ffff\n\ + cmp r3, r0\n\ + beq _08131FAC\n\ + b _08132126\n\ +_08131FAC:\n\ + ldr r0, =gUnknown_02024400\n\ + movs r1, 0\n\ + strh r1, [r0]\n\ + ldr r0, =gUnknown_0202449C\n\ + ldr r0, [r0]\n\ + strb r1, [r0, 0x13]\n\ + ldr r0, =gUnknown_02024474\n\ + movs r2, 0x1\n\ + strb r2, [r0, 0xE]\n\ + ldr r0, =gBattleMoveFlags\n\ + strb r1, [r0]\n\ + ldr r0, =gCritMultiplier\n\ + strb r2, [r0]\n\ + movs r6, 0\n\ + mov r9, r3\n\ + ldr r2, =gUnknown_085B09C8\n\ + ldrh r2, [r2]\n\ + str r2, [sp, 0x10]\n\ +_08131FD0:\n\ + movs r3, 0\n\ + ldr r5, =gBattleMons\n\ + lsls r4, r6, 1\n\ + ldr r7, =gPlayerMonIndex\n\ + lsls r0, r6, 2\n\ + mov r8, r0\n\ + adds r1, r6, 0x1\n\ + mov r10, r1\n\ + ldr r2, [sp, 0x10]\n\ + cmp r2, r9\n\ + beq _08132014\n\ + ldr r2, =gBattleMoves\n\ + ldrb r1, [r7]\n\ + movs r0, 0x58\n\ + muls r0, r1\n\ + adds r0, r4, r0\n\ + adds r1, r5, 0\n\ + adds r1, 0xC\n\ + adds r0, r1\n\ + ldrh r1, [r0]\n\ + lsls r0, r1, 1\n\ + adds r0, r1\n\ + lsls r0, 2\n\ + adds r0, r2\n\ + ldrb r2, [r0]\n\ + ldr r1, =gUnknown_085B09C8\n\ +_08132004:\n\ + ldrh r0, [r1]\n\ + cmp r2, r0\n\ + beq _08132014\n\ + adds r1, 0x2\n\ + adds r3, 0x1\n\ + ldrh r0, [r1]\n\ + cmp r0, r9\n\ + bne _08132004\n\ +_08132014:\n\ + ldrb r1, [r7]\n\ + movs r0, 0x58\n\ + muls r0, r1\n\ + adds r0, r4, r0\n\ + adds r1, r5, 0\n\ + adds r1, 0xC\n\ + adds r1, r0, r1\n\ + ldrh r0, [r1]\n\ + cmp r0, 0\n\ + beq _081320C0\n\ + lsls r0, r3, 1\n\ + ldr r2, =gUnknown_085B09C8\n\ + adds r0, r2\n\ + ldrh r0, [r0]\n\ + cmp r0, r9\n\ + bne _081320C0\n\ + ldr r0, =gBattleMoves\n\ + ldrh r2, [r1]\n\ + lsls r1, r2, 1\n\ + adds r1, r2\n\ + lsls r1, 2\n\ + adds r1, r0\n\ + ldrb r0, [r1, 0x1]\n\ + cmp r0, 0x1\n\ + bls _081320C0\n\ + ldr r5, =gUnknown_020241EA\n\ + strh r2, [r5]\n\ + ldrb r0, [r7]\n\ + ldr r4, =gEnemyMonIndex\n\ + ldrb r1, [r4]\n\ + bl sub_8046E7C\n\ + ldrh r0, [r5]\n\ + ldrb r1, [r7]\n\ + ldrb r2, [r4]\n\ + bl move_effectiveness_something\n\ + mov r4, sp\n\ + add r4, r8\n\ + ldr r2, =gBattleMoveDamage\n\ + ldr r0, =gUnknown_020244A8\n\ + ldr r0, [r0]\n\ + ldr r0, [r0, 0x14]\n\ + adds r0, 0x18\n\ + adds r0, r6\n\ + ldrb r1, [r0]\n\ + ldr r0, [r2]\n\ + muls r0, r1\n\ + movs r1, 0x64\n\ + bl __divsi3\n\ + str r0, [r4]\n\ + cmp r0, 0\n\ + bne _081320C8\n\ + movs r0, 0x1\n\ + str r0, [r4]\n\ + b _081320C8\n\ + .pool\n\ +_081320C0:\n\ + mov r1, sp\n\ + add r1, r8\n\ + movs r0, 0\n\ + str r0, [r1]\n\ +_081320C8:\n\ + mov r6, r10\n\ + cmp r6, 0x3\n\ + bgt _081320D0\n\ + b _08131FD0\n\ +_081320D0:\n\ + movs r6, 0\n\ + ldr r2, =gUnknown_020244A8\n\ + ldr r0, [r2]\n\ + ldr r0, [r0, 0x14]\n\ + ldrb r0, [r0, 0x1]\n\ + lsls r0, 2\n\ + add r0, sp\n\ + ldr r1, [sp]\n\ + ldr r0, [r0]\n\ + ldr r5, =gAIScriptPtr\n\ + cmp r1, r0\n\ + bgt _08132106\n\ + adds r4, r2, 0\n\ + mov r3, sp\n\ +_081320EC:\n\ + adds r3, 0x4\n\ + adds r6, 0x1\n\ + cmp r6, 0x3\n\ + bgt _08132106\n\ + ldr r0, [r4]\n\ + ldr r0, [r0, 0x14]\n\ + ldrb r0, [r0, 0x1]\n\ + lsls r0, 2\n\ + add r0, sp\n\ + ldr r1, [r3]\n\ + ldr r0, [r0]\n\ + cmp r1, r0\n\ + ble _081320EC\n\ +_08132106:\n\ + cmp r6, 0x4\n\ + bne _0813211C\n\ + ldr r0, [r2]\n\ + ldr r1, [r0, 0x14]\n\ + movs r0, 0x2\n\ + str r0, [r1, 0x8]\n\ + b _08132130\n\ + .pool\n\ +_0813211C:\n\ + ldr r0, [r2]\n\ + ldr r1, [r0, 0x14]\n\ + movs r0, 0x1\n\ + str r0, [r1, 0x8]\n\ + b _08132130\n\ +_08132126:\n\ + ldr r0, [r2]\n\ + ldr r1, [r0, 0x14]\n\ + movs r0, 0\n\ + str r0, [r1, 0x8]\n\ + ldr r5, =gAIScriptPtr\n\ +_08132130:\n\ + ldr r0, [r5]\n\ + adds r0, 0x1\n\ + str r0, [r5]\n\ + add sp, 0x14\n\ + pop {r3-r5}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + mov r10, r5\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .pool\n\ + .syntax divided"); +} + +static void BattleAICmd_get_move(void) +{ + if (gAIScriptPtr[1] == USER) + AI_THINKING_STRUCT->funcResult = gUnknown_02024248[gPlayerMonIndex]; + else + AI_THINKING_STRUCT->funcResult = gUnknown_02024248[gEnemyMonIndex]; + + gAIScriptPtr += 2; +} + +static void BattleAICmd_if_arg_equal(void) +{ + if (gAIScriptPtr[1] == AI_THINKING_STRUCT->funcResult) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); + else + gAIScriptPtr += 6; +} + +static void BattleAICmd_if_arg_not_equal(void) +{ + if (gAIScriptPtr[1] != AI_THINKING_STRUCT->funcResult) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); + else + gAIScriptPtr += 6; +} + +static void BattleAICmd_if_would_go_first(void) +{ + if (b_first_side(gPlayerMonIndex, gEnemyMonIndex, 1) == gAIScriptPtr[1]) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); + else + gAIScriptPtr += 6; +} + +static void BattleAICmd_if_would_not_go_first(void) +{ + if (b_first_side(gPlayerMonIndex, gEnemyMonIndex, 1) != gAIScriptPtr[1]) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); + else + gAIScriptPtr += 6; +} + +static void BattleAICmd_nullsub_2A(void) +{ +} + +static void BattleAICmd_nullsub_2B(void) +{ +} + +static void BattleAICmd_count_alive_pokemon(void) +{ + u8 index; + u8 var, var2; + struct Pokemon *party; + int i; + + AI_THINKING_STRUCT->funcResult = 0; + + if (gAIScriptPtr[1] == USER) + index = gPlayerMonIndex; + else + index = gEnemyMonIndex; + + if (battle_side_get_owner(index) == 0) + party = gPlayerParty; + else + party = gEnemyParty; + + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + { + u32 status; + var = gUnknown_0202406E[index][0]; + status = battle_get_per_side_status(index) ^ 2; + var2 = gUnknown_0202406E[battle_get_side_with_given_state(status)][0]; + } + else + { + var = gUnknown_0202406E[index][0]; + var2 = gUnknown_0202406E[index][0]; + } + + for (i = 0; i < 6; i++) + { + if (i != var && i != var2 + && GetMonData(&party[i], MON_DATA_HP) != 0 + && GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE + && GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG) + { + AI_THINKING_STRUCT->funcResult++; + } + } + + gAIScriptPtr += 2; +} + +static void BattleAICmd_get_considered_move(void) +{ + AI_THINKING_STRUCT->funcResult = AI_THINKING_STRUCT->moveConsidered; + gAIScriptPtr += 1; +} + +static void BattleAICmd_get_considered_move_effect(void) +{ + AI_THINKING_STRUCT->funcResult = gBattleMoves[AI_THINKING_STRUCT->moveConsidered].effect; + gAIScriptPtr += 1; +} + +static void BattleAICmd_get_ability(void) +{ + u8 index; + + if (gAIScriptPtr[1] == USER) + index = gPlayerMonIndex; + else + index = gEnemyMonIndex; + + if(gUnknown_02024064 != index) + { + if(UNK_2016A00_STRUCT->unk40[index] != 0) + { + AI_THINKING_STRUCT->funcResult = UNK_2016A00_STRUCT->unk40[index]; + gAIScriptPtr += 2; + return; + } + + // abilities that prevent fleeing. + if (gBattleMons[index].ability == ABILITY_SHADOW_TAG + || gBattleMons[index].ability == ABILITY_MAGNET_PULL + || gBattleMons[index].ability == ABILITY_ARENA_TRAP) + { + AI_THINKING_STRUCT->funcResult = gBattleMons[index].ability; + gAIScriptPtr += 2; + return; + } + + if (gBaseStats[gBattleMons[index].species].ability1 != ABILITY_NONE) + { + if (gBaseStats[gBattleMons[index].species].ability2 != ABILITY_NONE) + { + // AI has no knowledge of opponent, so it guesses which ability. + if(Random() & 1) + { + AI_THINKING_STRUCT->funcResult = gBaseStats[gBattleMons[index].species].ability1; + } + else + { + AI_THINKING_STRUCT->funcResult = gBaseStats[gBattleMons[index].species].ability2; + } + } + else + { + AI_THINKING_STRUCT->funcResult = gBaseStats[gBattleMons[index].species].ability1; // it's definitely ability 1. + } + } + else + { + AI_THINKING_STRUCT->funcResult = gBaseStats[gBattleMons[index].species].ability2; // AI cant actually reach this part since every mon has at least 1 ability. + } + } + else + { + // The AI knows its own ability. + AI_THINKING_STRUCT->funcResult = gBattleMons[index].ability; + } + gAIScriptPtr += 2; +} + +#ifdef NONMATCHING +static void tai60_unk(void) +{ + u8 index = sub_8131E70(gAIScriptPtr[1]); + u8 arg2 = gAIScriptPtr[2]; + u8 var; + + if(gAIScriptPtr[1] == 0 || gAIScriptPtr[1] == 2) + { + // _0813253A + if(UNK_2016A00_STRUCT->unk40[index] != 0) + { + var = UNK_2016A00_STRUCT->unk40[index]; + AI_THINKING_STRUCT->funcResult = var; + } + else + { + // _0813255C + if (gBattleMons[index].ability == ABILITY_SHADOW_TAG + || gBattleMons[index].ability == ABILITY_MAGNET_PULL + || gBattleMons[index].ability == ABILITY_ARENA_TRAP) + { + var = gBattleMons[index].ability; + } + else + { + // _08132588 + if (gBaseStats[gBattleMons[index].species].ability1 != ABILITY_NONE) + { + if (gBaseStats[gBattleMons[index].species].ability2 != ABILITY_NONE) + { + if(gBaseStats[gBattleMons[index].species].ability1 != arg2 && gBaseStats[gBattleMons[index].species].ability2 != arg2) + { + var = 2; + } + else + { + var = gBaseStats[gBattleMons[index].species].ability1; + } + } + else + { + // _081325B4 + var = gBaseStats[gBattleMons[index].species].ability1; + } + } + else + { + // _081325B8 + var = gBaseStats[gBattleMons[index].species].ability2; + } + } + } + } + else + { + // _081325BC + var = gBattleMons[index].ability; + } + + // _081325CA + if(var == ABILITY_NONE) + { + AI_THINKING_STRUCT->funcResult = 2; + } + else if(var == arg2) + { + AI_THINKING_STRUCT->funcResult = 1; + } + else + { + AI_THINKING_STRUCT->funcResult = 0; + } + gAIScriptPtr += 3; +} +#else +__attribute__((naked)) +static void tai60_unk(void) +{ + asm(".syntax unified\n\ + push {r4-r6,lr}\n\ + ldr r4, =gAIScriptPtr\n\ + ldr r0, [r4]\n\ + ldrb r0, [r0, 0x1]\n\ + bl sub_8131E70\n\ + lsls r0, 24\n\ + lsrs r5, r0, 24\n\ + ldr r0, [r4]\n\ + ldrb r3, [r0, 0x2]\n\ + ldrb r0, [r0, 0x1]\n\ + cmp r0, 0\n\ + beq _0813253A\n\ + cmp r0, 0x2\n\ + bne _081325BC\n\ +_0813253A:\n\ + ldr r0, =gUnknown_020244A8\n\ + ldr r4, [r0]\n\ + ldr r1, [r4, 0x18]\n\ + adds r1, 0x40\n\ + adds r2, r1, r5\n\ + ldrb r1, [r2]\n\ + adds r6, r0, 0\n\ + cmp r1, 0\n\ + beq _0813255C\n\ + adds r3, r1, 0\n\ + ldr r0, [r4, 0x14]\n\ + str r3, [r0, 0x8]\n\ + b _081325CA\n\ + .pool\n\ +_0813255C:\n\ + ldr r1, =gBattleMons\n\ + movs r0, 0x58\n\ + muls r0, r5\n\ + adds r4, r0, r1\n\ + adds r0, r4, 0\n\ + adds r0, 0x20\n\ + ldrb r0, [r0]\n\ + cmp r0, 0x17\n\ + beq _08132576\n\ + cmp r0, 0x2A\n\ + beq _08132576\n\ + cmp r0, 0x47\n\ + bne _08132588\n\ +_08132576:\n\ + movs r0, 0x58\n\ + muls r0, r5\n\ + adds r0, r1\n\ + adds r0, 0x20\n\ + ldrb r3, [r0]\n\ + b _081325CA\n\ + .pool\n\ +_08132588:\n\ + ldr r2, =gBaseStats\n\ + ldrh r1, [r4]\n\ + lsls r0, r1, 3\n\ + subs r0, r1\n\ + lsls r0, 2\n\ + adds r1, r0, r2\n\ + ldrb r4, [r1, 0x16]\n\ + cmp r4, 0\n\ + beq _081325B8\n\ + ldrb r2, [r1, 0x17]\n\ + cmp r2, 0\n\ + beq _081325B4\n\ + adds r0, r3, 0\n\ + cmp r4, r0\n\ + beq _081325CE\n\ + cmp r2, r0\n\ + beq _081325CE\n\ + adds r3, r4, 0\n\ + b _081325CA\n\ + .pool\n\ +_081325B4:\n\ + ldrb r3, [r1, 0x16]\n\ + b _081325CA\n\ +_081325B8:\n\ + ldrb r3, [r1, 0x17]\n\ + b _081325CA\n\ +_081325BC:\n\ + ldr r1, =gBattleMons\n\ + movs r0, 0x58\n\ + muls r0, r5\n\ + adds r0, r1\n\ + adds r0, 0x20\n\ + ldrb r3, [r0]\n\ + ldr r6, =gUnknown_020244A8\n\ +_081325CA:\n\ + cmp r3, 0\n\ + bne _081325E8\n\ +_081325CE:\n\ + ldr r0, [r6]\n\ + ldr r1, [r0, 0x14]\n\ + movs r0, 0x2\n\ + str r0, [r1, 0x8]\n\ + ldr r2, =gAIScriptPtr\n\ + b _08132608\n\ + .pool\n\ +_081325E8:\n\ + ldr r0, =gAIScriptPtr\n\ + ldr r1, [r0]\n\ + adds r2, r0, 0\n\ + ldrb r1, [r1, 0x2]\n\ + cmp r3, r1\n\ + bne _08132600\n\ + ldr r0, [r6]\n\ + ldr r1, [r0, 0x14]\n\ + movs r0, 0x1\n\ + b _08132606\n\ + .pool\n\ +_08132600:\n\ + ldr r0, [r6]\n\ + ldr r1, [r0, 0x14]\n\ + movs r0, 0\n\ +_08132606:\n\ + str r0, [r1, 0x8]\n\ +_08132608:\n\ + ldr r0, [r2]\n\ + adds r0, 0x3\n\ + str r0, [r2]\n\ + pop {r4-r6}\n\ + pop {r0}\n\ + bx r0\n\ + .pool\n\ + .syntax divided"); +} +#endif + +static void BattleAICmd_get_highest_possible_damage(void) +{ + s32 i; + + gUnknown_02024400 = 0; + gUnknown_0202449C[0x13] = 0; + gUnknown_02024474[0xE] = 1; + gBattleMoveFlags = 0; + gCritMultiplier = 1; + AI_THINKING_STRUCT->funcResult = 0; + + for (i = 0; i < 4; i++) + { + gBattleMoveDamage = 40; + gUnknown_020241EA = gBattleMons[gPlayerMonIndex].moves[i]; + + if (gUnknown_020241EA) + { + move_effectiveness_something(gUnknown_020241EA, gPlayerMonIndex, gEnemyMonIndex); + + // reduce by 1/3. + if (gBattleMoveDamage == 120) + gBattleMoveDamage = 80; + if (gBattleMoveDamage == 240) + gBattleMoveDamage = 160; + if (gBattleMoveDamage == 30) + gBattleMoveDamage = 20; + if (gBattleMoveDamage == 15) + gBattleMoveDamage = 10; + + if (gBattleMoveFlags & 8) // if it's a status move, it wont do anything. + gBattleMoveDamage = 0; + + if (AI_THINKING_STRUCT->funcResult < gBattleMoveDamage) + AI_THINKING_STRUCT->funcResult = gBattleMoveDamage; + } + } + gAIScriptPtr += 1; +} + +static void BattleAICmd_if_damage_bonus(void) +{ + u8 damageVar; + + gUnknown_02024400 = 0; + gUnknown_0202449C[0x13] = 0; + gUnknown_02024474[0xE] = 1; + gBattleMoveFlags = 0; + gCritMultiplier = 1; + + gBattleMoveDamage = 40; + gUnknown_020241EA = AI_THINKING_STRUCT->moveConsidered; + + move_effectiveness_something(gUnknown_020241EA, gPlayerMonIndex, gEnemyMonIndex); + + if (gBattleMoveDamage == 120) + gBattleMoveDamage = 80; + if (gBattleMoveDamage == 240) + gBattleMoveDamage = 160; + if (gBattleMoveDamage == 30) + gBattleMoveDamage = 20; + if (gBattleMoveDamage == 15) + gBattleMoveDamage = 10; + + if (gBattleMoveFlags & 8) + gBattleMoveDamage = 0; + + // store gBattleMoveDamage in a u8 variable because gAIScriptPtr[1] is a u8. + damageVar = gBattleMoveDamage; + + if (damageVar == gAIScriptPtr[1]) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); + else + gAIScriptPtr += 6; +} + +static void BattleAICmd_nullsub_32(void) +{ +} + +static void BattleAICmd_nullsub_33(void) +{ +} + +static void BattleAICmd_if_status_in_party(void) +{ + struct Pokemon *party; + int i; + u32 statusToCompareTo; + u8 index; + + switch(gAIScriptPtr[1]) + { + case 1: + index = gPlayerMonIndex; + break; + default: + index = gEnemyMonIndex; + break; + } + + party = (battle_side_get_owner(index) == 0) ? gPlayerParty : gEnemyParty; + + statusToCompareTo = AIScriptRead32(gAIScriptPtr + 2); + + for (i = 0; i < 6; i++) + { + u16 species = GetMonData(&party[i], MON_DATA_SPECIES); + u16 hp = GetMonData(&party[i], MON_DATA_HP); + u32 status = GetMonData(&party[i], MON_DATA_STATUS); + + if (species != SPECIES_NONE && species != SPECIES_EGG && hp != 0 && status == statusToCompareTo) + { + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 6); + return; + } + } + + gAIScriptPtr += 10; +} + +static void BattleAICmd_if_status_not_in_party(void) +{ + struct Pokemon *party; + int i; + u32 statusToCompareTo; + u8 index; + + switch(gAIScriptPtr[1]) + { + case 1: + index = gPlayerMonIndex; + break; + default: + index = gEnemyMonIndex; + break; + } + + party = (battle_side_get_owner(index) == 0) ? gPlayerParty : gEnemyParty; + + statusToCompareTo = AIScriptRead32(gAIScriptPtr + 2); + + for (i = 0; i < 6; i++) + { + u16 species = GetMonData(&party[i], MON_DATA_SPECIES); + u16 hp = GetMonData(&party[i], MON_DATA_HP); + u32 status = GetMonData(&party[i], MON_DATA_STATUS); + + if (species != SPECIES_NONE && species != SPECIES_EGG && hp != 0 && status == statusToCompareTo) + { + gAIScriptPtr += 10; // still bugged in Emerald + } + } + + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 6); +} + +static void BattleAICmd_get_weather(void) +{ + if (gBattleWeather & 7) + AI_THINKING_STRUCT->funcResult = 1; + if (gBattleWeather & 0x18) + AI_THINKING_STRUCT->funcResult = 2; + if (gBattleWeather & 0x60) + AI_THINKING_STRUCT->funcResult = 0; + if (gBattleWeather & 0x80) + AI_THINKING_STRUCT->funcResult = 3; + + gAIScriptPtr += 1; +} + +static void BattleAICmd_if_effect(void) +{ + if (gBattleMoves[AI_THINKING_STRUCT->moveConsidered].effect == gAIScriptPtr[1]) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); + else + gAIScriptPtr += 6; +} + +static void BattleAICmd_if_not_effect(void) +{ + if (gBattleMoves[AI_THINKING_STRUCT->moveConsidered].effect != gAIScriptPtr[1]) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); + else + gAIScriptPtr += 6; +} + +static void BattleAICmd_if_stat_level_less_than(void) +{ + u32 party; + + if (gAIScriptPtr[1] == USER) + party = gPlayerMonIndex; + else + party = gEnemyMonIndex; + + if (gBattleMons[party].statStages[gAIScriptPtr[2]] < gAIScriptPtr[3]) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 4); + else + gAIScriptPtr += 8; +} + +static void BattleAICmd_if_stat_level_more_than(void) +{ + u32 party; + + if (gAIScriptPtr[1] == USER) + party = gPlayerMonIndex; + else + party = gEnemyMonIndex; + + if (gBattleMons[party].statStages[gAIScriptPtr[2]] > gAIScriptPtr[3]) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 4); + else + gAIScriptPtr += 8; +} + +static void BattleAICmd_if_stat_level_equal(void) +{ + u32 party; + + if (gAIScriptPtr[1] == USER) + party = gPlayerMonIndex; + else + party = gEnemyMonIndex; + + if (gBattleMons[party].statStages[gAIScriptPtr[2]] == gAIScriptPtr[3]) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 4); + else + gAIScriptPtr += 8; +} + +static void BattleAICmd_if_stat_level_not_equal(void) +{ + u32 party; + + if (gAIScriptPtr[1] == USER) + party = gPlayerMonIndex; + else + party = gEnemyMonIndex; + + if (gBattleMons[party].statStages[gAIScriptPtr[2]] != gAIScriptPtr[3]) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 4); + else + gAIScriptPtr += 8; +} + +static void BattleAICmd_if_can_faint(void) +{ + if (gBattleMoves[AI_THINKING_STRUCT->moveConsidered].power < 2) + { + gAIScriptPtr += 5; + return; + } + + gUnknown_02024400 = 0; + gUnknown_0202449C[0x13] = 0; + gUnknown_02024474[0xE] = 1; + gBattleMoveFlags = 0; + gCritMultiplier = 1; + gUnknown_020241EA = AI_THINKING_STRUCT->moveConsidered; + sub_8046E7C(gPlayerMonIndex, gEnemyMonIndex); + move_effectiveness_something(gUnknown_020241EA, gPlayerMonIndex, gEnemyMonIndex); + + gBattleMoveDamage = gBattleMoveDamage * AI_THINKING_STRUCT->unk18[AI_THINKING_STRUCT->movesetIndex] / 100; + + // moves always do at least 1 damage. + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + + if (gBattleMons[gEnemyMonIndex].hp <= gBattleMoveDamage) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 1); + else + gAIScriptPtr += 5; +} + +static void BattleAICmd_if_cant_faint(void) +{ + if (gBattleMoves[AI_THINKING_STRUCT->moveConsidered].power < 2) + { + gAIScriptPtr += 5; + return; + } + + gUnknown_02024400 = 0; + gUnknown_0202449C[0x13] = 0; + gUnknown_02024474[0xE] = 1; + gBattleMoveFlags = 0; + gCritMultiplier = 1; + gUnknown_020241EA = AI_THINKING_STRUCT->moveConsidered; + sub_8046E7C(gPlayerMonIndex, gEnemyMonIndex); + move_effectiveness_something(gUnknown_020241EA, gPlayerMonIndex, gEnemyMonIndex); + + gBattleMoveDamage = gBattleMoveDamage * AI_THINKING_STRUCT->unk18[AI_THINKING_STRUCT->movesetIndex] / 100; + + // this macro is missing the damage 0 = 1 assumption. + + if (gBattleMons[gEnemyMonIndex].hp > gBattleMoveDamage) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 1); + else + gAIScriptPtr += 5; +} + +static void BattleAICmd_if_has_move(void) +{ + int i; + u16 *temp_ptr = (u16 *)(gAIScriptPtr + 2); + + switch(gAIScriptPtr[1]) + { + case 1: + // _08132E42 + for (i = 0; i < 4; i++) + { + if (gBattleMons[gPlayerMonIndex].moves[i] == *temp_ptr) + break; + } + if (i == 4) + { + gAIScriptPtr += 8; + return; + } + else + { + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 4); + return; + } + case 3: // new to Emerald + if(gBattleMons[gPlayerMonIndex ^ 2].hp == 0) + { + gAIScriptPtr += 8; + return; + } + else + { + for (i = 0; i < 4; i++) + { + if (gBattleMons[gPlayerMonIndex ^ 2].moves[i] == *temp_ptr) + break; + } + } + if (i == 4) + { + gAIScriptPtr += 8; + return; + } + else + { + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 4); + return; + } + case 0: + case 2: + for (i = 0; i < 4; i++) + { + if (UNK_2016A00_STRUCT->unk0[gEnemyMonIndex][i] == *temp_ptr) + break; + } + if (i == 4) + { + gAIScriptPtr += 8; + return; + } + else + { + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 4); + return; + } + } +} + +static void BattleAICmd_if_dont_have_move(void) +{ + int i; + u16 *temp_ptr = (u16 *)(gAIScriptPtr + 2); + + switch(gAIScriptPtr[1]) + { + case 1: + case 3: // if_dont_have_move does not have the seperate 3 case check in Emerald unlike if_has_move. + for (i = 0; i < 4; i++) + { + if (gBattleMons[gPlayerMonIndex].moves[i] == *temp_ptr) + break; + } + if (i != 4) + { + gAIScriptPtr += 8; + return; + } + else + { + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 4); + return; + } + case 0: + case 2: + for (i = 0; i < 4; i++) + { + if (UNK_2016A00_STRUCT->unk0[gEnemyMonIndex][i] == *temp_ptr) + break; + } + if (i != 4) + { + gAIScriptPtr += 8; + return; + } + else + { + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 4); + return; + } + } +} + +static void BattleAICmd_if_move_effect(void) +{ + int i; + + switch (gAIScriptPtr[1]) + { + case 1: + case 3: // _08133044 + for(i = 0; i < 4; i++) + { + if(gBattleMons[gPlayerMonIndex].moves[i] != 0 && gBattleMoves[gBattleMons[gPlayerMonIndex].moves[i]].effect == gAIScriptPtr[2]) + break; + } + if (i == 4) + gAIScriptPtr += 7; + else + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 3); + break; + case 0: + case 2: // _08133090 + for (i = 0; i < 4; i++) + { + if (gBattleMons[gPlayerMonIndex].moves[i] != 0 && gBattleMoves[UNK_2016A00_STRUCT->unk0[gEnemyMonIndex][i]].effect == gAIScriptPtr[2]) + break; + } + if (i == 4) + gAIScriptPtr += 7; + else + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 3); + break; + } +} + +static void BattleAICmd_if_not_move_effect(void) +{ + int i; + + switch (gAIScriptPtr[1]) + { + case 1: + case 3: // _0813313C + for(i = 0; i < 4; i++) + { + if(gBattleMons[gPlayerMonIndex].moves[i] != 0 && gBattleMoves[gBattleMons[gPlayerMonIndex].moves[i]].effect == gAIScriptPtr[2]) + break; + } + if (i != 4) + gAIScriptPtr += 7; + else + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 3); + break; + case 0: + case 2: // _08133188 + for (i = 0; i < 4; i++) + { + if (UNK_2016A00_STRUCT->unk0[gEnemyMonIndex][i] && gBattleMoves[UNK_2016A00_STRUCT->unk0[gEnemyMonIndex][i]].effect == gAIScriptPtr[2]) + break; + } + if (i != 4) + gAIScriptPtr += 7; + else + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 3); + break; + } +} + +static void BattleAICmd_if_last_move_did_damage(void) +{ + u8 index; + + if (gAIScriptPtr[1] == USER) + index = gPlayerMonIndex; + else + index = gEnemyMonIndex; + + if (gAIScriptPtr[2] == 0) + { + if (gUnknown_020242BC[index].unk4 == 0) + { + gAIScriptPtr += 7; + return; + } + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 3); + return; + } + else if (gAIScriptPtr[2] != 1) // ignore the macro if its not 0 or 1. + { + gAIScriptPtr += 7; + return; + } + else if (gUnknown_020242BC[index].unk6 != 0) + { + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 3); + return; + } + gAIScriptPtr += 7; +} + +static void BattleAICmd_if_encored(void) +{ + switch (gAIScriptPtr[1]) + { + case 0: // _08109348 + if (gUnknown_020242BC[gUnknown_02024064].unk4 == AI_THINKING_STRUCT->moveConsidered) + { + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); + return; + } + gAIScriptPtr += 6; + return; + case 1: // _08109370 + if (gUnknown_020242BC[gUnknown_02024064].unk6 == AI_THINKING_STRUCT->moveConsidered) + { + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); + return; + } + gAIScriptPtr += 6; + return; + default: + gAIScriptPtr += 6; + return; + } +} + +static void BattleAICmd_flee(void) +{ + AI_THINKING_STRUCT->aiAction |= (AI_ACTION_UNK1 | AI_ACTION_UNK2 | AI_ACTION_UNK4); // what matters is UNK2 being enabled. +} + +static void BattleAICmd_if_random_100(void) +{ + u8 safariFleeRate = gUnknown_0202449C[0x7B] * 5; // safari flee rate, from 0-20 + + if ((u8)(Random() % 100) < safariFleeRate) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 1); + else + gAIScriptPtr += 5; +} + +static void BattleAICmd_watch(void) +{ + AI_THINKING_STRUCT->aiAction |= (AI_ACTION_UNK1 | AI_ACTION_UNK3 | AI_ACTION_UNK4); // what matters is UNK3 being enabled. +} + +static void BattleAICmd_get_hold_effect(void) +{ + u8 index; + u16 status; + + if (gAIScriptPtr[1] == USER) + index = gPlayerMonIndex; + else + index = gEnemyMonIndex; + + if (gUnknown_02024064 != index) + { + AI_THINKING_STRUCT->funcResult = itemid_get_x12(UNK_2016A00_STRUCT->unk44[index]); + } + else + AI_THINKING_STRUCT->funcResult = itemid_get_x12(gBattleMons[index].item); + + gAIScriptPtr += 2; +} + +static void tai62_unk(void) +{ + u8 index = sub_8131E70(gAIScriptPtr[1]); + u16 item; + u8 var1, var2; + + if((index & 1) == (gPlayerMonIndex & 1)) + item = gBattleMons[index].item; + else + item = UNK_2016A00_STRUCT->unk44[index]; + + // strange way of loading a 16-bit argument from the AI command. + var2 = gAIScriptPtr[2]; + var1 = gAIScriptPtr[3]; + + if((var1 | var2) == item) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 4); + else + gAIScriptPtr += 8; +} + +static void BattleAICmd_get_gender(void) +{ + u8 index; + + if (gAIScriptPtr[1] == USER) + index = gPlayerMonIndex; + else + index = gEnemyMonIndex; + + AI_THINKING_STRUCT->funcResult = pokemon_species_get_gender_info(gBattleMons[index].species, gBattleMons[index].personality); + + gAIScriptPtr += 2; +} + +static void BattleAICmd_is_first_turn(void) +{ + u8 index; + + if (gAIScriptPtr[1] == USER) + index = gPlayerMonIndex; + else + index = gEnemyMonIndex; + + AI_THINKING_STRUCT->funcResult = gUnknown_020242BC[index].unk16; + + gAIScriptPtr += 2; +} + +static void BattleAICmd_get_stockpile_count(void) +{ + u8 index; + + if (gAIScriptPtr[1] == USER) + index = gPlayerMonIndex; + else + index = gEnemyMonIndex; + + AI_THINKING_STRUCT->funcResult = gUnknown_020242BC[index].unk9; + + gAIScriptPtr += 2; +} + +static void BattleAICmd_is_double_battle(void) +{ + AI_THINKING_STRUCT->funcResult = gBattleTypeFlags & BATTLE_TYPE_DOUBLE; + + gAIScriptPtr += 1; +} + +static void BattleAICmd_get_item(void) +{ + u8 index; + + if (gAIScriptPtr[1] == USER) + index = gPlayerMonIndex; + else + index = gEnemyMonIndex; + + // this hack and a half matches. whatever. i dont care. someone else fix this mess later. PS: still cant fix this. + AI_THINKING_STRUCT->funcResult = gUnknown_0202449C[0xB8 + (index * 2)]; + + gAIScriptPtr += 2; +} + +static void BattleAICmd_get_move_type_from_result(void) +{ + AI_THINKING_STRUCT->funcResult = gBattleMoves[AI_THINKING_STRUCT->funcResult].type; + + gAIScriptPtr += 1; +} + +static void BattleAICmd_get_move_power_from_result(void) +{ + AI_THINKING_STRUCT->funcResult = gBattleMoves[AI_THINKING_STRUCT->funcResult].power; + + gAIScriptPtr += 1; +} + +static void BattleAICmd_get_move_effect_from_result(void) +{ + AI_THINKING_STRUCT->funcResult = gBattleMoves[AI_THINKING_STRUCT->funcResult].effect; + + gAIScriptPtr += 1; +} + +static void BattleAICmd_get_protect_count(void) +{ + u8 index; + + if (gAIScriptPtr[1] == USER) + index = gPlayerMonIndex; + else + index = gEnemyMonIndex; + + AI_THINKING_STRUCT->funcResult = gUnknown_020242BC[index].unk8; + + gAIScriptPtr += 2; +} + +static void BattleAICmd_nullsub_52(void) +{ +} + +static void BattleAICmd_nullsub_53(void) +{ +} + +static void BattleAICmd_nullsub_54(void) +{ +} + +static void BattleAICmd_nullsub_55(void) +{ +} + +static void BattleAICmd_nullsub_56(void) +{ +} + +static void BattleAICmd_nullsub_57(void) +{ +} + +static void BattleAICmd_call(void) +{ + b_mc_stack_push(gAIScriptPtr + 5); + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 1); +} + +static void BattleAICmd_jump(void) +{ + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 1); +} + +static void BattleAICmd_end(void) +{ + if (b_mc_stack_pop_cursor() == 0) + AI_THINKING_STRUCT->aiAction |= AI_ACTION_UNK1; +} + +static void BattleAICmd_if_level_cond(void) +{ + switch (gAIScriptPtr[1]) + { + case 0: // greater than + if (gBattleMons[gPlayerMonIndex].level > gBattleMons[gEnemyMonIndex].level) + { + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); + return; + } + gAIScriptPtr += 6; + return; + case 1: // less than + if (gBattleMons[gPlayerMonIndex].level < gBattleMons[gEnemyMonIndex].level) + { + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); + return; + } + gAIScriptPtr += 6; + return; + case 2: // equal + if (gBattleMons[gPlayerMonIndex].level == gBattleMons[gEnemyMonIndex].level) + { + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); + return; + } + gAIScriptPtr += 6; + return; + } +} + +static void BattleAICmd_if_taunted(void) +{ + if (gUnknown_020242BC[gEnemyMonIndex].taunt != 0) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 1); + else + gAIScriptPtr += 5; +} + +static void BattleAICmd_if_not_taunted(void) +{ + if (gUnknown_020242BC[gEnemyMonIndex].taunt == 0) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 1); + else + gAIScriptPtr += 5; +} + +static void tai5E_unk(void) +{ + if((gPlayerMonIndex & 1) == (gEnemyMonIndex & 1)) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 1); + else + gAIScriptPtr += 5; +} + +static void tai61_unk(void) +{ + u8 index = sub_8131E70(gAIScriptPtr[1]); + + if(UNK_BATTLE_STRUCT->unk4->unkArray[index] & 1) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); + else + gAIScriptPtr += 6; +} + +void b_mc_stack_push(u8 *var) +{ + UNK_2016C00_STRUCT->ptr[UNK_2016C00_STRUCT->unk20++] = var; +} + +void b_mc_stack_push_cursor(void) +{ + UNK_2016C00_STRUCT->ptr[UNK_2016C00_STRUCT->unk20++] = gAIScriptPtr; +} + +bool8 b_mc_stack_pop_cursor(void) +{ + if (UNK_2016C00_STRUCT->unk20 != 0) + { + --UNK_2016C00_STRUCT->unk20; + gAIScriptPtr = UNK_2016C00_STRUCT->ptr[UNK_2016C00_STRUCT->unk20]; + return TRUE; + } + else + return FALSE; +} diff --git a/src/dma3_manager.c b/src/dma3_manager.c new file mode 100644 index 000000000..cd080a172 --- /dev/null +++ b/src/dma3_manager.c @@ -0,0 +1,528 @@ +#include "global.h" + +extern u8 gDma3ManagerLocked; +extern u8 gDma3RequestCursor; + +// size is 0x10 +struct DmaRequestsStruct +{ + /* 0x00 */ u8 *src; + /* 0x04 */ u8 *dest; + /* 0x08 */ u16 size; + /* 0x0A */ u16 mode; + /* 0x0C */ u32 value; +}; + +extern struct DmaRequestsStruct gDma3Requests[128]; + +void ClearDma3Requests(void) +{ + int i; + + gDma3ManagerLocked = TRUE; + gDma3RequestCursor = FALSE; + + for(i = 0; i < (u8)ARRAY_COUNT(gDma3Requests); i++) + { + gDma3Requests[i].size = 0; + gDma3Requests[i].src = 0; + gDma3Requests[i].dest = 0; + } + + gDma3ManagerLocked = FALSE; +} + +#ifdef NONMATCHING +void ProcessDma3Requests(void) +{ + // NOTE: the fillerA member of the DMA struct is actually u32 value; + // NOTE: gUnknown_0300001C is just a pointer inside the gDma3Requests structure, not a true symbol; feel free to remove + u16 total_size; + + if (gDma3ManagerLocked) + return; + + total_size = 0; + + // as long as there are DMA requests to process (unless size or vblank is an issue), do not exit + while (gDma3Requests[gDma3RequestCursor].size) + { + total_size += gDma3Requests[gDma3RequestCursor].size; + + if (total_size > 0xA000) + return; // don't do too much at once + + if (REG_VCOUNT > 224) + return;// we're about to leave vblank, stop + + switch (gDma3Requests[gDma3RequestCursor].mode) + { + case 1: // regular 32-bit copy + // _08000C8C + if(gDma3Requests[gDma3RequestCursor].size <= 0x1000) + { + DmaCopy32(3, gDma3Requests[gDma3RequestCursor].src, gDma3Requests[gDma3RequestCursor].dest, gDma3Requests[gDma3RequestCursor].size); + break; + } + while (gDma3Requests[gDma3RequestCursor].size > 0x1000) + { + DmaCopy32(3, gDma3Requests[gDma3RequestCursor].src, gDma3Requests[gDma3RequestCursor].dest, 0x1000); + gDma3Requests[gDma3RequestCursor].src += 0x1000; + gDma3Requests[gDma3RequestCursor].dest += 0x1000; + gDma3Requests[gDma3RequestCursor].size -= 0x1000; + } + DmaCopy32(3, gDma3Requests[gDma3RequestCursor].src, gDma3Requests[gDma3RequestCursor].dest, gDma3Requests[gDma3RequestCursor].size); + break; + case 2: // repeat a single 32-bit value across RAM + // _08000CD0 + while (gDma3Requests[gDma3RequestCursor].size > 0x1000) + { + DmaFill32(3, gDma3Requests[gDma3RequestCursor].value, gDma3Requests[gDma3RequestCursor].dest, 0x1000); + gDma3Requests[gDma3RequestCursor].dest += 0x1000; + gDma3Requests[gDma3RequestCursor].size -= 0x1000; + } + DmaFill32(3, gDma3Requests[gDma3RequestCursor].value, gDma3Requests[gDma3RequestCursor].dest, gDma3Requests[gDma3RequestCursor].size); + break; + case 3: // regular 16-bit copy + // _08000D3C + while (gDma3Requests[gDma3RequestCursor].size > 0x1000) + { + DmaCopy16(3, gDma3Requests[gDma3RequestCursor].src, gDma3Requests[gDma3RequestCursor].dest, 0x1000); + gDma3Requests[gDma3RequestCursor].src += 0x1000; + gDma3Requests[gDma3RequestCursor].dest += 0x1000; + gDma3Requests[gDma3RequestCursor].size -= 0x1000; + } + DmaCopy16(3, gDma3Requests[gDma3RequestCursor].src, gDma3Requests[gDma3RequestCursor].dest, gDma3Requests[gDma3RequestCursor].size); + break; + case 4: // repeat a single 16-bit value across RAM + // _08000D88 + while (gDma3Requests[gDma3RequestCursor].size > 0x1000) + { + DmaFill16(3, gDma3Requests[gDma3RequestCursor].value, gDma3Requests[gDma3RequestCursor].dest, 0x1000); + gDma3Requests[gDma3RequestCursor].dest += 0x1000; + gDma3Requests[gDma3RequestCursor].size -= 0x1000; + } + DmaFill16(3, gDma3Requests[gDma3RequestCursor].value, gDma3Requests[gDma3RequestCursor].dest, gDma3Requests[gDma3RequestCursor].size); + break; + } + gDma3Requests[gDma3RequestCursor].src = 0; + gDma3Requests[gDma3RequestCursor].dest = 0; + gDma3Requests[gDma3RequestCursor].size = 0; + gDma3Requests[gDma3RequestCursor].mode = 0; + gDma3Requests[gDma3RequestCursor].value = 0; + gDma3RequestCursor++; + + if (gDma3RequestCursor >= 128) // loop back to the first DMA request + gDma3RequestCursor = 0; + } +} +#else +__attribute__((naked)) +void ProcessDma3Requests(void) +{ + asm(".syntax unified\n\ + push {r4-r7,lr}\n\ + mov r7, r10\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5-r7}\n\ + sub sp, 0xC\n\ + ldr r0, =gDma3ManagerLocked\n\ + ldrb r0, [r0]\n\ + cmp r0, 0\n\ + beq _08000C06\n\ + b _08000E46\n\ +_08000C06:\n\ + movs r0, 0\n\ + str r0, [sp, 0x8]\n\ + ldr r1, =gDma3Requests\n\ + ldr r2, =gDma3RequestCursor\n\ + ldrb r0, [r2]\n\ + lsls r0, 4\n\ + adds r0, r1\n\ + ldrh r0, [r0, 0x8]\n\ + mov r12, r2\n\ + cmp r0, 0\n\ + bne _08000C1E\n\ + b _08000E46\n\ +_08000C1E:\n\ + mov r8, r1\n\ + adds r1, 0x4\n\ + mov r10, r1\n\ + movs r6, 0x80\n\ + lsls r6, 5\n\ + ldr r7, =0x040000D4 @REG_DMA3\n\ + movs r2, 0\n\ + mov r9, r2\n\ +_08000C2E:\n\ + mov r3, r12 @ gDma3RequestCursor\n\ + ldrb r0, [r3]\n\ + lsls r5, r0, 4\n\ + mov r0, r8 @ gDma3Requests\n\ + adds r1, r5, r0 @ gDma3Requests[gDma3RequestCursor]\n\ + ldrh r0, [r1, 0x8] @ gDma3Requests[gDma3RequestCursor].size\n\ + ldr r2, [sp, 0x8]\n\ + adds r0, r2, r0\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + str r0, [sp, 0x8]\n\ + movs r0, 0xA0\n\ + lsls r0, 8\n\ + ldr r3, [sp, 0x8]\n\ + cmp r3, r0\n\ + bls _08000C50\n\ + b _08000E46\n\ +_08000C50:\n\ + ldr r0, =0x04000006 @REG_VCOUNT\n\ + ldrb r0, [r0]\n\ + cmp r0, 0xE0\n\ + bls _08000C5A\n\ + b _08000E46\n\ +_08000C5A:\n\ + ldrh r0, [r1, 0xA]\n\ + cmp r0, 0x2\n\ + beq _08000CD0\n\ + cmp r0, 0x2\n\ + bgt _08000C80\n\ + cmp r0, 0x1\n\ + beq _08000C8C\n\ + b _08000DF0\n\ + .pool\n\ +_08000C80:\n\ + cmp r0, 0x3\n\ + beq _08000D3C\n\ + cmp r0, 0x4\n\ + bne _08000C8A\n\ + b _08000D88\n\ +_08000C8A:\n\ + b _08000DF0\n\ +_08000C8C:\n\ + ldr r3, [r1]\n\ + mov r2, r10\n\ + adds r0, r5, r2\n\ + ldr r2, [r0]\n\ + ldrh r1, [r1, 0x8]\n\ + cmp r1, r6\n\ + bhi _08000CA6\n\ + str r3, [r7]\n\ + str r2, [r7, 0x4]\n\ + lsrs r0, r1, 2\n\ + movs r1, 0x84\n\ + lsls r1, 24\n\ + b _08000DAA\n\ +_08000CA6:\n\ + ldr r4, =0x040000D4 @REG_DMA3\n\ + str r3, [r4]\n\ + str r2, [r4, 0x4]\n\ + ldr r0, =0x84000400\n\ + str r0, [r4, 0x8]\n\ + ldr r0, [r4, 0x8]\n\ + adds r3, r6\n\ + adds r2, r6\n\ + subs r1, r6\n\ + cmp r1, r6\n\ + bhi _08000CA6\n\ + str r3, [r4]\n\ + str r2, [r4, 0x4]\n\ + lsrs r0, r1, 2\n\ + movs r1, 0x84\n\ + lsls r1, 24\n\ + b _08000D76\n\ + .pool\n\ +_08000CD0:\n\ + mov r3, r10\n\ + adds r0, r5, r3\n\ + ldr r4, [r0]\n\ + ldrh r1, [r1, 0x8]\n\ + cmp r1, r6\n\ + bhi _08000CF4\n\ + mov r0, r8\n\ + adds r0, 0xC\n\ + adds r0, r5, r0\n\ + ldr r0, [r0]\n\ + str r0, [sp]\n\ + mov r5, sp\n\ + str r5, [r7]\n\ + str r4, [r7, 0x4]\n\ + lsrs r0, r1, 2\n\ + movs r1, 0x85\n\ + lsls r1, 24\n\ + b _08000DAA\n\ +_08000CF4:\n\ + mov r2, r12\n\ + ldrb r0, [r2]\n\ + lsls r0, 4\n\ + mov r5, r8\n\ + adds r5, 0xC\n\ + adds r0, r5\n\ + ldr r0, [r0]\n\ + str r0, [sp]\n\ + ldr r3, =0x040000D4 @REG_DMA3\n\ + mov r0, sp\n\ + str r0, [r3]\n\ + str r4, [r3, 0x4]\n\ + ldr r0, =0x85000400\n\ + str r0, [r3, 0x8]\n\ + ldr r0, [r3, 0x8]\n\ + adds r4, r6\n\ + subs r1, r6\n\ + cmp r1, r6\n\ + bhi _08000CF4\n\ + ldrb r0, [r2]\n\ + lsls r0, 4\n\ + adds r0, r5\n\ + ldr r0, [r0]\n\ + str r0, [sp]\n\ + mov r2, sp\n\ + str r2, [r3]\n\ + str r4, [r3, 0x4]\n\ + lsrs r0, r1, 2\n\ + movs r1, 0x85\n\ + lsls r1, 24\n\ + b _08000DEA\n\ + .pool\n\ +_08000D3C:\n\ + ldr r3, [r1]\n\ + mov r2, r10\n\ + adds r0, r5, r2\n\ + ldr r2, [r0]\n\ + ldrh r1, [r1, 0x8]\n\ + cmp r1, r6\n\ + bhi _08000D56\n\ + str r3, [r7]\n\ + str r2, [r7, 0x4]\n\ + lsrs r0, r1, 1\n\ + movs r1, 0x80\n\ + lsls r1, 24\n\ + b _08000DAA\n\ +_08000D56:\n\ + ldr r4, =0x040000D4 @REG_DMA3\n\ + str r3, [r4]\n\ + str r2, [r4, 0x4]\n\ + ldr r0, =0x80000800\n\ + str r0, [r4, 0x8]\n\ + ldr r0, [r4, 0x8]\n\ + adds r3, r6\n\ + adds r2, r6\n\ + subs r1, r6\n\ + cmp r1, r6\n\ + bhi _08000D56\n\ + str r3, [r4]\n\ + str r2, [r4, 0x4]\n\ + lsrs r0, r1, 1\n\ + movs r1, 0x80\n\ + lsls r1, 24\n\ +_08000D76:\n\ + orrs r0, r1\n\ + str r0, [r4, 0x8]\n\ + ldr r0, [r4, 0x8]\n\ + b _08000DF0\n\ + .pool\n\ +_08000D88:\n\ + mov r3, r10\n\ + adds r0, r5, r3\n\ + ldr r2, [r0]\n\ + ldrh r4, [r1, 0x8]\n\ + add r1, sp, 0x4\n\ + cmp r4, r6\n\ + bhi _08000DB2\n\ + mov r0, r8\n\ + adds r0, 0xC\n\ + adds r0, r5, r0\n\ + ldr r0, [r0]\n\ + strh r0, [r1]\n\ + str r1, [r7]\n\ + str r2, [r7, 0x4]\n\ + lsrs r0, r4, 1\n\ + movs r1, 0x81\n\ + lsls r1, 24\n\ +_08000DAA:\n\ + orrs r0, r1\n\ + str r0, [r7, 0x8]\n\ + ldr r0, [r7, 0x8]\n\ + b _08000DF0\n\ +_08000DB2:\n\ + mov r5, r12\n\ + ldrb r0, [r5]\n\ + lsls r0, 4\n\ + ldr r3, =gUnknown_0300001C\n\ + adds r0, r3\n\ + ldr r0, [r0]\n\ + strh r0, [r1]\n\ + ldr r3, =0x040000D4 @REG_DMA3\n\ + str r1, [r3]\n\ + str r2, [r3, 0x4]\n\ + ldr r0, =0x81000800\n\ + str r0, [r3, 0x8]\n\ + ldr r0, [r3, 0x8]\n\ + adds r2, r6\n\ + subs r4, r6\n\ + cmp r4, r6\n\ + bhi _08000DB2\n\ + ldrb r0, [r5]\n\ + lsls r0, 4\n\ + ldr r5, =gUnknown_0300001C\n\ + adds r0, r5\n\ + ldr r0, [r0]\n\ + strh r0, [r1]\n\ + str r1, [r3]\n\ + str r2, [r3, 0x4]\n\ + lsrs r0, r4, 1\n\ + movs r1, 0x81\n\ + lsls r1, 24\n\ +_08000DEA:\n\ + orrs r0, r1\n\ + str r0, [r3, 0x8]\n\ + ldr r0, [r3, 0x8]\n\ +_08000DF0:\n\ + ldr r1, =gDma3Requests\n\ + mov r3, r12\n\ + ldrb r0, [r3]\n\ + lsls r0, 4\n\ + adds r0, r1\n\ + mov r2, r9\n\ + str r2, [r0]\n\ + ldrb r0, [r3]\n\ + lsls r0, 4\n\ + add r0, r10\n\ + str r2, [r0]\n\ + ldrb r0, [r3]\n\ + lsls r0, 4\n\ + adds r0, r1\n\ + movs r4, 0\n\ + strh r2, [r0, 0x8]\n\ + ldrb r0, [r3]\n\ + lsls r0, 4\n\ + adds r0, r1\n\ + mov r5, r9\n\ + strh r5, [r0, 0xA]\n\ + ldrb r0, [r3]\n\ + lsls r0, 4\n\ + adds r1, 0xC\n\ + adds r0, r1\n\ + mov r1, r9\n\ + str r1, [r0]\n\ + ldrb r0, [r3]\n\ + adds r0, 0x1\n\ + strb r0, [r3]\n\ + lsls r0, 24\n\ + cmp r0, 0\n\ + bge _08000E34\n\ + strb r4, [r3]\n\ +_08000E34:\n\ + mov r2, r12\n\ + ldrb r0, [r2]\n\ + lsls r0, 4\n\ + ldr r3, =gDma3Requests\n\ + adds r0, r3\n\ + ldrh r0, [r0, 0x8]\n\ + cmp r0, 0\n\ + beq _08000E46\n\ + b _08000C2E\n\ +_08000E46:\n\ + add sp, 0xC\n\ + pop {r3-r5}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + mov r10, r5\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .pool\n\ + .syntax divided"); +} +#endif + +int RequestDma3Copy(void *src, void *dest, u16 size, u8 mode) +{ + int cursor; + int var = 0; + + gDma3ManagerLocked = 1; + + cursor = gDma3RequestCursor; + while(1) + { + if(!gDma3Requests[cursor].size) // an empty copy was found and the current cursor will be returned. + { + gDma3Requests[cursor].src = src; + gDma3Requests[cursor].dest = dest; + gDma3Requests[cursor].size = size; + + if(mode == 1) + gDma3Requests[cursor].mode = mode; + else + gDma3Requests[cursor].mode = 3; + + gDma3ManagerLocked = FALSE; + return (s16)cursor; + } + if(++cursor >= 0x80) // loop back to start. + { + cursor = 0; + } + if(++var >= 0x80) // max checks were made. all resulted in failure. + { + break; + } + } + gDma3ManagerLocked = FALSE; + return -1; +} + +int RequestDma3Fill(s32 value, void *dest, u16 size, u8 mode) +{ + int cursor; + int var = 0; + + cursor = gDma3RequestCursor; + gDma3ManagerLocked = 1; + + while(1) + { + if(!gDma3Requests[cursor].size) + { + gDma3Requests[cursor].dest = dest; + gDma3Requests[cursor].size = size; + gDma3Requests[cursor].mode = mode; + gDma3Requests[cursor].value = value; + + if(mode == 1) + gDma3Requests[cursor].mode = 2; + else + gDma3Requests[cursor].mode = 4; + + gDma3ManagerLocked = FALSE; + return (s16)cursor; + } + if(++cursor >= 0x80) // loop back to start. + { + cursor = 0; + } + if(++var >= 0x80) // max checks were made. all resulted in failure. + { + break; + } + } + gDma3ManagerLocked = FALSE; + return -1; +} + +int CheckForSpaceForDma3Request(s16 index) +{ + int current = 0; + + if (index == -1) + { + for (; current < 0x80; current ++) + if (gDma3Requests[current].size) + return -1; + + return 0; + } + + if (gDma3Requests[index].size) + return -1; + + return 0; +} diff --git a/src/main.c b/src/main.c new file mode 100644 index 000000000..a88c378eb --- /dev/null +++ b/src/main.c @@ -0,0 +1,418 @@ +#include "global.h" +#include "main.h" +#include "gba/flash_internal.h" +#include "gba/m4a_internal.h" + +extern u16 GetGpuReg(u8); +extern void SetGpuReg(u8, u16); +extern void LinkVSync(void); +extern void sub_800E174(void); +extern void sub_800B9B8(void); + +extern struct SoundInfo gSoundInfo; +extern u32 gFlashMemoryPresent; +extern u32 IntrMain[]; +extern u8 gHeap[]; +extern struct SaveBlock2 gUnknown_02024A54; +extern char *gUnknown_03005D94; +extern char gUnknown_02029808[]; +extern u32 gBattleTypeFlags; +extern u8 gUnknown_03002748; +extern u32 *gUnknown_0203CF5C; + +void Timer3Intr(void); +bool8 HandleLinkConnection(void); +void c2_copyright_1(void); + +static void VBlankIntr(void); +static void HBlankIntr(void); +static void VCountIntr(void); +static void SerialIntr(void); +static void IntrDummy(void); + +const u8 gGameVersion = VERSION_EMERALD; + +const u8 gGameLanguage = GAME_LANGUAGE; // English + +const char BuildDateTime[] = "2005 02 21 11:10"; + +const IntrFunc gIntrTableTemplate[] = +{ + VCountIntr, // V-count interrupt + SerialIntr, // Serial interrupt + Timer3Intr, // Timer 3 interrupt + HBlankIntr, // H-blank interrupt + VBlankIntr, // V-blank interrupt + IntrDummy, // Timer 0 interrupt + IntrDummy, // Timer 1 interrupt + IntrDummy, // Timer 2 interrupt + IntrDummy, // DMA 0 interrupt + IntrDummy, // DMA 1 interrupt + IntrDummy, // DMA 2 interrupt + IntrDummy, // DMA 3 interrupt + IntrDummy, // Key interrupt + IntrDummy, // Game Pak interrupt +}; + +#define INTR_COUNT ((int)(sizeof(gIntrTableTemplate)/sizeof(IntrFunc))) + +extern u16 gUnknown_03000000; + +extern u16 gKeyRepeatStartDelay; +extern u8 gUnknown_030022B4; +extern struct Main gMain; +extern u16 gKeyRepeatContinueDelay; +extern u8 gSoftResetDisabled; +extern IntrFunc gIntrTable[INTR_COUNT]; +extern bool8 gLinkVSyncDisabled; +extern u32 IntrMain_Buffer[0x200]; +extern u8 gPcmDmaCounter; + +extern u16 gTrainerId; + +EWRAM_DATA void (**gFlashTimerIntrFunc)(void) = NULL; + +static void UpdateLinkAndCallCallbacks(void); +static void InitMainCallbacks(void); +static void CallCallbacks(void); +static void SeedRngWithRtc(void); +static void ReadKeys(void); +void InitIntrHandlers(void); +static void WaitForVBlank(void); + +#define B_START_SELECT (B_BUTTON | START_BUTTON | SELECT_BUTTON) + +void AgbMain() +{ + RegisterRamReset(RESET_ALL); + *(vu16 *)BG_PLTT = 0x7FFF; + InitGpuRegManager(); + REG_WAITCNT = WAITCNT_PREFETCH_ENABLE | WAITCNT_WS0_S_1 | WAITCNT_WS0_N_3; + InitKeys(); + InitIntrHandlers(); + m4aSoundInit(); + EnableVCountIntrAtLine150(); + sub_800E6D0(); + RtcInit(); + CheckForFlashMemory(); + InitMainCallbacks(); + InitMapMusic(); + ClearDma3Requests(); + ResetBgs(); + SetDefaultFontsPointer(); + InitHeap(gHeap, 0x1C000); + + gSoftResetDisabled = FALSE; + + if (gFlashMemoryPresent != TRUE) + SetMainCallback2(NULL); + + gUnknown_030022B4 = 0; + gUnknown_03000000 = 0xFC0; + + for (;;) + { + ReadKeys(); + + if (gSoftResetDisabled == FALSE + && (gMain.heldKeysRaw & A_BUTTON) + && (gMain.heldKeysRaw & B_START_SELECT) == B_START_SELECT) + { + rfu_REQ_stopMode(); + rfu_waitREQComplete(); + DoSoftReset(); + } + + if (sub_8087634() == 1) + { + gUnknown_030022B4 = 1; + UpdateLinkAndCallCallbacks(); + gUnknown_030022B4 = 0; + } + else + { + gUnknown_030022B4 = 0; + UpdateLinkAndCallCallbacks(); + + if (sub_80875C8() == 1) + { + gMain.newKeys = 0; + ClearObjectCopyRequests(); + gUnknown_030022B4 = 1; + UpdateLinkAndCallCallbacks(); + gUnknown_030022B4 = 0; + } + } + + PlayTimeCounter_Update(); + MapMusicMain(); + WaitForVBlank(); + } +} + +static void UpdateLinkAndCallCallbacks(void) +{ + if (!HandleLinkConnection()) + CallCallbacks(); +} + +static void InitMainCallbacks(void) +{ + gMain.vblankCounter1 = 0; + gUnknown_0203CF5C = NULL; + gMain.vblankCounter2 = 0; + gMain.callback1 = NULL; + SetMainCallback2(c2_copyright_1); + gSaveBlock2Ptr = &gUnknown_02024A54; + gUnknown_03005D94 = gUnknown_02029808; +} + +static void CallCallbacks(void) +{ + if (gMain.callback1) + gMain.callback1(); + + if (gMain.callback2) + gMain.callback2(); +} + +void SetMainCallback2(MainCallback callback) +{ + gMain.callback2 = callback; + gMain.state = 0; +} + +void StartTimer1(void) +{ + REG_TM1CNT_H = 0x80; +} + +void SeedRngAndSetTrainerId(void) +{ + u16 val = REG_TM1CNT_L; + SeedRng(val); + REG_TM1CNT_H = 0; + gTrainerId = val; +} + +u16 GetTrainerId(void) +{ + return gTrainerId; +} + +void EnableVCountIntrAtLine150(void) +{ + u16 gpuReg = (GetGpuReg(REG_OFFSET_DISPSTAT) & 0xFF) | (150 << 8); + SetGpuReg(REG_OFFSET_DISPSTAT, gpuReg | DISPSTAT_VCOUNT_INTR); + EnableInterrupts(INTR_FLAG_VCOUNT); +} + +void InitKeys(void) +{ + gKeyRepeatContinueDelay = 5; + gKeyRepeatStartDelay = 40; + + gMain.heldKeys = 0; + gMain.newKeys = 0; + gMain.newAndRepeatedKeys = 0; + gMain.heldKeysRaw = 0; + gMain.newKeysRaw = 0; +} + +static void ReadKeys(void) +{ + u16 keyInput = REG_KEYINPUT ^ KEYS_MASK; + gMain.newKeysRaw = keyInput & ~gMain.heldKeysRaw; + gMain.newKeys = gMain.newKeysRaw; + gMain.newAndRepeatedKeys = gMain.newKeysRaw; + + // BUG: Key repeat won't work when pressing L using L=A button mode + // because it compares the raw key input with the remapped held keys. + // Note that newAndRepeatedKeys is never remapped either. + + if (keyInput != 0 && gMain.heldKeys == keyInput) + { + gMain.keyRepeatCounter--; + + if (gMain.keyRepeatCounter == 0) + { + gMain.newAndRepeatedKeys = keyInput; + gMain.keyRepeatCounter = gKeyRepeatContinueDelay; + } + } + else + { + // If there is no input or the input has changed, reset the counter. + gMain.keyRepeatCounter = gKeyRepeatStartDelay; + } + + gMain.heldKeysRaw = keyInput; + gMain.heldKeys = gMain.heldKeysRaw; + + // Remap L to A if the L=A option is enabled. + if (gSaveBlock2Ptr->optionsButtonMode == 2) + { + if (gMain.newKeys & L_BUTTON) + gMain.newKeys |= A_BUTTON; + + if (gMain.heldKeys & L_BUTTON) + gMain.heldKeys |= A_BUTTON; + } + + if (gMain.newKeys & gMain.watchedKeysMask) + gMain.watchedKeysPressed = TRUE; +} + +void InitIntrHandlers(void) +{ + int i; + + for (i = 0; i < INTR_COUNT; i++) + gIntrTable[i] = gIntrTableTemplate[i]; + + DmaCopy32(3, IntrMain, IntrMain_Buffer, sizeof(IntrMain_Buffer)); + + INTR_VECTOR = IntrMain_Buffer; + + SetVBlankCallback(NULL); + SetHBlankCallback(NULL); + SetSerialCallback(NULL); + + REG_IME = 1; + + EnableInterrupts(0x1); +} + +void SetVBlankCallback(IntrCallback callback) +{ + gMain.vblankCallback = callback; +} + +void SetHBlankCallback(IntrCallback callback) +{ + gMain.hblankCallback = callback; +} + +void SetVCountCallback(IntrCallback callback) +{ + gMain.vcountCallback = callback; +} + +void RestoreSerialTimer3IntrHandlers(void) +{ + gIntrTable[1] = SerialIntr; + gIntrTable[2] = Timer3Intr; +} + +void SetSerialCallback(IntrCallback callback) +{ + gMain.serialCallback = callback; +} + +extern void CopyBufferedValuesToGpuRegs(void); +extern void ProcessDma3Requests(void); + +static void VBlankIntr(void) +{ + if (gLinkVSyncDisabled != FALSE) + LinkVSync(); + else if (gUnknown_03002748 == FALSE) + sub_800B9B8(); + + gMain.vblankCounter1++; + + if (gUnknown_0203CF5C && *gUnknown_0203CF5C < 0xFFFFFFFF) + (*gUnknown_0203CF5C)++; + + if (gMain.vblankCallback) + gMain.vblankCallback(); + + gMain.vblankCounter2++; + + CopyBufferedValuesToGpuRegs(); + ProcessDma3Requests(); + + gPcmDmaCounter = gSoundInfo.pcmDmaCounter; + + m4aSoundMain(); + sub_8033648(); + + if (!gMain.inBattle || (gBattleTypeFlags & 0x013F0102) == 0) + Random(); + + sub_800E174(); + + INTR_CHECK |= INTR_FLAG_VBLANK; + gMain.intrCheck |= INTR_FLAG_VBLANK; +} + +void StartFlashMemoryTimer(void) +{ + SetFlashTimerIntr(2, gIntrTable + 0x7); +} + +static void HBlankIntr(void) +{ + if (gMain.hblankCallback) + gMain.hblankCallback(); + + INTR_CHECK |= INTR_FLAG_HBLANK; + gMain.intrCheck |= INTR_FLAG_HBLANK; +} + +static void VCountIntr(void) +{ + if (gMain.vcountCallback) + gMain.vcountCallback(); + + m4aSoundVSync(); + INTR_CHECK |= INTR_FLAG_VCOUNT; + gMain.intrCheck |= INTR_FLAG_VCOUNT; +} + +static void SerialIntr(void) +{ + if (gMain.serialCallback) + gMain.serialCallback(); + + INTR_CHECK |= INTR_FLAG_SERIAL; + gMain.intrCheck |= INTR_FLAG_SERIAL; +} + +static void IntrDummy(void) +{} + +static void WaitForVBlank(void) +{ + gMain.intrCheck &= ~INTR_FLAG_VBLANK; + + while (!(gMain.intrCheck & INTR_FLAG_VBLANK)) + ; +} + +void sub_80008DC(u32 *var) +{ + gUnknown_0203CF5C = var; +} + +void sub_80008E8(void) +{ + gUnknown_0203CF5C = NULL; +} + +void DoSoftReset(void) +{ + REG_IME = 0; + m4aSoundVSyncOff(); + remove_some_task(); + DmaStop(1); + DmaStop(2); + DmaStop(3); + SiiRtcProtect(); + SoftReset(RESET_ALL); +} + +void ClearPokemonCrySongs(void) +{ + CpuFill16(0, gPokemonCrySongs, MAX_POKEMON_CRIES * sizeof(struct PokemonCrySong)); +} diff --git a/src/multiboot.c b/src/multiboot.c new file mode 100644 index 000000000..80291ff46 --- /dev/null +++ b/src/multiboot.c @@ -0,0 +1,470 @@ +#include "gba/gba.h" +#include "multiboot.h" + +static u16 MultiBoot_required_data[MULTIBOOT_NCHILD]; + +static int MultiBootSend(struct MultiBootParam *mp, u16 data); +static int MultiBootHandShake(struct MultiBootParam *mp); +static void MultiBootWaitCycles(u32 cycles); +static void MultiBootWaitSendDone(void); + +void MultiBootInit(struct MultiBootParam *mp) +{ + mp->client_bit = 0; + mp->probe_count = 0; + mp->response_bit = 0; + + mp->check_wait = MULTIBOOT_CONNECTION_CHECK_WAIT; + mp->sendflag = 0; + + mp->handshake_timeout = 0; + + REG_RCNT = 0; + REG_SIOCNT = SIO_MULTI_MODE | SIO_115200_BPS; + REG_SIODATA8 = 0; +} + +int MultiBootMain(struct MultiBootParam *mp) +{ + int i; + int j; + int k; + + if (MultiBootCheckComplete(mp)) + { + return 0; + } + + if (mp->check_wait > MULTIBOOT_CONNECTION_CHECK_WAIT) + { + mp->check_wait--; + return 0; + } + +output_burst: + if (mp->sendflag) + { + mp->sendflag = 0; + + i = REG_SIOCNT & (SIO_MULTI_BUSY | SIO_ERROR | SIO_ID | SIO_MULTI_SD | SIO_MULTI_SI); + if (i != SIO_MULTI_SD) + { + MultiBootInit(mp); + return i ^ SIO_MULTI_SD; + } + } + + if (mp->probe_count >= 0xe0) + { + i = MultiBootHandShake(mp); + if (i) + { + return i; + } + + if (mp->server_type == MULTIBOOT_SERVER_TYPE_QUICK + && mp->probe_count > 0xe1 + && MultiBootCheckComplete(mp) == 0) + { + MultiBootWaitSendDone(); + goto output_burst; + } + + if (MultiBootCheckComplete(mp) == 0) + { + if (mp->handshake_timeout == 0) + { + MultiBootInit(mp); + return MULTIBOOT_ERROR_HANDSHAKE_FAILURE; + } + mp->handshake_timeout--; + } + + return 0; + } + + switch (mp->probe_count) + { + case 0: + k = 0x0e; + for (i = MULTIBOOT_NCHILD; i != 0; i--) + { + if (*(vu16 *)(REG_ADDR_SIOMULTI0 + i * 2) != 0xffff) + { + break; + } + k >>= 1; + } + + k &= 0x0e; + mp->response_bit = k; + + for (i = MULTIBOOT_NCHILD; i != 0; i--) + { + j = *(vu16 *)(REG_ADDR_SIOMULTI0 + i * 2); + if (mp->client_bit & (1 << i)) + { + if (j != ((MULTIBOOT_CLIENT_INFO << 8) | (1 << i))) + { + k = 0; + break; + } + } + } + + mp->client_bit &= k; + + if (k == 0) + { + mp->check_wait = MULTIBOOT_CONNECTION_CHECK_WAIT; + } + + if (mp->check_wait) + { + mp->check_wait--; + } + else + { + if (mp->response_bit != mp->client_bit) + { + MultiBootStartProbe(mp); + goto case_1; + } + } + + output_master_info: + return MultiBootSend(mp, (MULTIBOOT_MASTER_INFO << 8) | mp->client_bit); + + case_1: + case 1: + mp->probe_target_bit = 0; + for (i = MULTIBOOT_NCHILD; i != 0; i--) + { + j = *(vu16 *)(REG_ADDR_SIOMULTI0 + i * 2); + if ((j >> 8) == MULTIBOOT_CLIENT_INFO) + { + MultiBoot_required_data[i - 1] = j; + j &= 0xff; + if (j == (1 << i)) + { + mp->probe_target_bit |= j; + } + } + } + + if (mp->response_bit != mp->probe_target_bit) + { + goto output_master_info; + } + + mp->probe_count = 2; + return MultiBootSend(mp, (MULTIBOOT_MASTER_START_PROBE << 8) | mp->probe_target_bit); + + case 2: + for (i = MULTIBOOT_NCHILD; i != 0; i--) + { + if (mp->probe_target_bit & (1 << i)) + { + j = *(vu16 *)(REG_ADDR_SIOMULTI0 + i * 2); + if (j != MultiBoot_required_data[i - 1]) + { + mp->probe_target_bit ^= 1 << i; + } + } + } + goto output_header; + + case 0xd0: + k = 1; + for (i = MULTIBOOT_NCHILD; i != 0; i--) + { + j = *(vu16 *)(REG_ADDR_SIOMULTI0 + i * 2); + mp->client_data[i - 1] = j; + if (mp->probe_target_bit & (1 << i)) + { + if ((j >> 8) != MULTIBOOT_CLIENT_INFO + && (j >> 8) != MULTIBOOT_CLIENT_DLREADY) + { + MultiBootInit(mp); + return MULTIBOOT_ERROR_NO_DLREADY; + } + if (j == MultiBoot_required_data[i - 1]) + { + k = 0; + } + } + } + + if (k == 0) + { + return MultiBootSend(mp, (MULTIBOOT_MASTER_REQUEST_DLREADY << 8) | mp->palette_data); + } + + mp->probe_count = 0xd1; + + k = 0x11; + for (i = MULTIBOOT_NCHILD; i != 0; i--) + { + k += mp->client_data[i - 1]; + } + mp->handshake_data = k; + return MultiBootSend(mp, (MULTIBOOT_MASTER_START_DL << 8) | (k & 0xff)); + + case 0xd1: + for (i = MULTIBOOT_NCHILD; i != 0; i--) + { + j = *(vu16 *)(REG_ADDR_SIOMULTI0 + i * 2); + if (mp->probe_target_bit & (1 << i)) + { + if ((j >> 8) != MULTIBOOT_CLIENT_DLREADY) + { + MultiBootInit(mp); + return MULTIBOOT_ERROR_NO_DLREADY; + } + } + } + + i = MultiBoot(mp); + + if (i == 0) + { + mp->probe_count = 0xe0; + mp->handshake_timeout = MULTIBOOT_HANDSHAKE_TIMEOUT; + return 0; + } + MultiBootInit(mp); + mp->check_wait = MULTIBOOT_CONNECTION_CHECK_WAIT * 2; + return MULTIBOOT_ERROR_BOOT_FAILURE; + + default: + for (i = MULTIBOOT_NCHILD; i != 0; i--) + { + if (mp->probe_target_bit & (1 << i)) + { + j = *(vu16 *)(REG_ADDR_SIOMULTI0 + i * 2); + if ((j >> 8) != (MULTIBOOT_MASTER_START_PROBE + 1 - (mp->probe_count >> 1)) + || ((j & 0xff) != (1 << i))) + { + mp->probe_target_bit ^= 1 << i; + } + } + } + + if (mp->probe_count == 0xc4) + { + mp->client_bit = mp->probe_target_bit & 0x0e; + mp->probe_count = 0; + goto output_master_info; + } + + output_header: + if (mp->probe_target_bit == 0) + { + MultiBootInit(mp); + return MULTIBOOT_ERROR_NO_PROBE_TARGET; + } + + mp->probe_count += 2; + if (mp->probe_count == 0xc4) + { + goto output_master_info; + } + i = MultiBootSend(mp, + (mp->masterp[mp->probe_count - 4 + 1] << 8) + | mp->masterp[mp->probe_count - 4]); + + if (i) + { + return i; + } + if (mp->server_type == MULTIBOOT_SERVER_TYPE_QUICK) + { + MultiBootWaitSendDone(); + goto output_burst; + } + return 0; + } +} + +static int MultiBootSend(struct MultiBootParam *mp, u16 data) +{ + int i; + + i = REG_SIOCNT & (SIO_MULTI_BUSY | SIO_MULTI_SD | SIO_MULTI_SI); + if (i != SIO_MULTI_SD) + { + MultiBootInit(mp); + return i ^ SIO_MULTI_SD; + } + + REG_SIODATA8 = data; + REG_SIOCNT = SIO_MULTI_MODE | SIO_START | SIO_115200_BPS; + + mp->sendflag = 1; + return 0; +} + +void MultiBootStartProbe(struct MultiBootParam *mp) +{ + if (mp->probe_count != 0) + { + MultiBootInit(mp); + return; + } + mp->check_wait = 0; + mp->client_bit = 0; + mp->probe_count = 1; +} + +void MultiBootStartMaster(struct MultiBootParam *mp, u8 *srcp, int length, u8 palette_color, s8 palette_speed) +{ + int i = 0; + + if (mp->probe_count != 0 + || mp->client_bit == 0 + || mp->check_wait != 0) + { + MultiBootInit(mp); + return; + } + + mp->boot_srcp = srcp; + length = (length + 15) & ~15; + if (length < MULTIBOOT_SEND_SIZE_MIN || length > MULTIBOOT_SEND_SIZE_MAX) + { + MultiBootInit(mp); + return; + } + + mp->boot_endp = srcp + length; + + switch (palette_speed) + { + case -4: + case -3: + case -2: + case -1: + i = (palette_color << 3) | (3 - palette_speed); + break; + case 0: + i = 0x38 | palette_color; + break; + case 1: + case 2: + case 3: + case 4: + i = (palette_color << 3) | (palette_speed - 1); + break; + } + + mp->palette_data = ((i & 0x3f) << 1) | 0x81; + mp->probe_count = 0xd0; +} + +int MultiBootCheckComplete(struct MultiBootParam *mp) +{ + if (mp->probe_count == 0xe9) + { + return 1; + } + + return 0; +} + +static int MultiBootHandShake(struct MultiBootParam *mp) +{ + int i, j; + +#define send_data (mp->system_work[0]) +#define must_data (mp->system_work[1]) + + switch (mp->probe_count) + { + case_0xe0: + case 0xe0: + mp->probe_count = 0xe1; + must_data = 0x0000; + send_data = 0x100000; + return MultiBootSend(mp, 0x0000); + + default: + for (i = MULTIBOOT_NCHILD; i != 0; i--) + { + j = *(vu16 *)(REG_ADDR_SIOMULTI0 + i * 2); + if ((mp->client_bit & (1 << i)) + && j != must_data) + { + goto case_0xe0; + } + } + mp->probe_count++; + must_data = send_data & 0xffff; + if (send_data == 0x0000) + { + must_data = mp->masterp[0xac] | (mp->masterp[0xad] << 8); + send_data = must_data << 5; + } + send_data >>= 5; + output_common: + return MultiBootSend(mp, send_data); + + case 0xe7: + case 0xe8: + for (i = MULTIBOOT_NCHILD; i != 0; i--) + { + j = *(vu16 *)(REG_ADDR_SIOMULTI0 + i * 2); + if ((mp->client_bit & (1 << i)) && j != must_data) + { + MultiBootInit(mp); + return MULTIBOOT_ERROR_HANDSHAKE_FAILURE; + } + } + + mp->probe_count++; + if (mp->probe_count == 0xe9) + { + return 0; + } + + send_data = mp->masterp[0xae] | (mp->masterp[0xaf] << 8); + must_data = send_data; + goto output_common; + } + +#undef send_data +#undef must_data +} + +static void MultiBootWaitCycles(u32 cycles) +{ + asm("mov r2, pc"); + asm("lsr r2, #24"); + asm("mov r1, #12"); + asm("cmp r2, #0x02"); + asm("beq MultiBootWaitCyclesLoop"); + + asm("mov r1, #13"); + asm("cmp r2, #0x08"); + asm("beq MultiBootWaitCyclesLoop"); + + asm("mov r1, #4"); + + asm("MultiBootWaitCyclesLoop:"); + asm("sub r0, r1"); + asm("bgt MultiBootWaitCyclesLoop"); +} + +static void MultiBootWaitSendDone(void) +{ + int i; + + for (i = 0; i < 31069; i++) + { + if ((REG_SIOCNT & SIO_START) == 0) + { + break; + } + } + + MultiBootWaitCycles(600); +} diff --git a/src/rng.c b/src/rng.c new file mode 100644 index 000000000..6f4f2ce55 --- /dev/null +++ b/src/rng.c @@ -0,0 +1,35 @@ +#include "global.h" +#include "rng.h" + +// The number 1103515245 comes from the example implementation of rand and srand +// in the ISO C standard. + +extern u32 gRngValue; +extern u32 gRng2Value; + +EWRAM_DATA static u8 sUnknown = 0; +EWRAM_DATA static u32 sRandCount = 0; + +u16 Random() +{ + gRngValue = 1103515245 * gRngValue + 24691; + sRandCount++; + return gRngValue >> 16; +} + +void SeedRng(u16 seed) +{ + gRngValue = seed; + sUnknown = 0; +} + +void SeedRng2(u16 seed) +{ + gRng2Value = seed; +} + +u16 Random2(void) +{ + gRng2Value = 1103515245 * gRng2Value + 24691; + return gRng2Value >> 16; +} diff --git a/src/siirtc.c b/src/siirtc.c new file mode 100644 index 000000000..965a068f1 --- /dev/null +++ b/src/siirtc.c @@ -0,0 +1,432 @@ +// Ruby/Sapphire/Emerald cartridges contain a Seiko Instruments Inc. (SII) +// S-3511A real-time clock (RTC). This library ("SIIRTC_V001") is for +// communicating with the RTC. + +#include "gba/gba.h" +#include "siirtc.h" + +#define STATUS_INTFE 0x02 // frequency interrupt enable +#define STATUS_INTME 0x08 // per-minute interrupt enable +#define STATUS_INTAE 0x20 // alarm interrupt enable +#define STATUS_24HOUR 0x40 // 0: 12-hour mode, 1: 24-hour mode +#define STATUS_POWER 0x80 // power on or power failure occurred + +#define TEST_MODE 0x80 // flag in the "second" byte + +#define ALARM_AM 0x00 +#define ALARM_PM 0x80 + +#define OFFSET_YEAR offsetof(struct SiiRtcInfo, year) +#define OFFSET_MONTH offsetof(struct SiiRtcInfo, month) +#define OFFSET_DAY offsetof(struct SiiRtcInfo, day) +#define OFFSET_DAY_OF_WEEK offsetof(struct SiiRtcInfo, dayOfWeek) +#define OFFSET_HOUR offsetof(struct SiiRtcInfo, hour) +#define OFFSET_MINUTE offsetof(struct SiiRtcInfo, minute) +#define OFFSET_SECOND offsetof(struct SiiRtcInfo, second) +#define OFFSET_STATUS offsetof(struct SiiRtcInfo, status) +#define OFFSET_ALARM_HOUR offsetof(struct SiiRtcInfo, alarmHour) +#define OFFSET_ALARM_MINUTE offsetof(struct SiiRtcInfo, alarmMinute) + +#define INFO_BUF(info, index) (*((u8 *)(info) + (index))) + +#define DATETIME_BUF(info, index) INFO_BUF(info, OFFSET_YEAR + index) +#define DATETIME_BUF_LEN (OFFSET_SECOND - OFFSET_YEAR + 1) + +#define TIME_BUF(info, index) INFO_BUF(info, OFFSET_HOUR + index) +#define TIME_BUF_LEN (OFFSET_SECOND - OFFSET_HOUR + 1) + +#define WR 0 // command for writing data +#define RD 1 // command for reading data + +#define CMD(n) (0x60 | (n << 1)) + +#define CMD_RESET CMD(0) +#define CMD_STATUS CMD(1) +#define CMD_DATETIME CMD(2) +#define CMD_TIME CMD(3) +#define CMD_ALARM CMD(4) + +#define GPIO_PORT_DATA (*(vu16 *)0x80000C4) +#define GPIO_PORT_DIRECTION (*(vu16 *)0x80000C6) +#define GPIO_PORT_READ_ENABLE (*(vu16 *)0x80000C8) + +extern vu16 GPIOPortDirection; + +static u16 sDummy; // unused variable +static bool8 sLocked; + +static int WriteCommand(u8 value); +static int WriteData(u8 value); +static u8 ReadData(); +static void EnableGpioPortRead(); +static void DisableGpioPortRead(); + +static const char AgbLibRtcVersion[] = "SIIRTC_V001"; + +void SiiRtcUnprotect() +{ + EnableGpioPortRead(); + sLocked = FALSE; +} + +void SiiRtcProtect() +{ + DisableGpioPortRead(); + sLocked = TRUE; +} + +u8 SiiRtcProbe() +{ + u8 errorCode; + struct SiiRtcInfo rtc; + + if (!SiiRtcGetStatus(&rtc)) + return 0; + + errorCode = 0; + + if ((rtc.status & (SIIRTCINFO_POWER | SIIRTCINFO_24HOUR)) == SIIRTCINFO_POWER + || (rtc.status & (SIIRTCINFO_POWER | SIIRTCINFO_24HOUR)) == 0) + { + // The RTC is in 12-hour mode. Reset it and switch to 24-hour mode. + + // Note that the conditions are redundant and equivalent to simply + // "(rtc.status & SIIRTCINFO_24HOUR) == 0". It's possible that this + // was also intended to handle resetting the clock after power failure + // but a mistake was made. + + if (!SiiRtcReset()) + return 0; + + errorCode++; + } + + SiiRtcGetTime(&rtc); + + if (rtc.second & TEST_MODE) + { + // The RTC is in test mode. Reset it to leave test mode. + + if (!SiiRtcReset()) + return (errorCode << 4) & 0xF0; + + errorCode++; + } + + return (errorCode << 4) | 1; +} + +bool8 SiiRtcReset() +{ + u8 result; + struct SiiRtcInfo rtc; + + if (sLocked == TRUE) + return FALSE; + + sLocked = TRUE; + + GPIO_PORT_DATA = 1; + GPIO_PORT_DATA = 5; + + GPIO_PORT_DIRECTION = 7; + + WriteCommand(CMD_RESET | WR); + + GPIO_PORT_DATA = 1; + GPIO_PORT_DATA = 1; + + sLocked = FALSE; + + rtc.status = SIIRTCINFO_24HOUR; + + result = SiiRtcSetStatus(&rtc); + + return result; +} + +bool8 SiiRtcGetStatus(struct SiiRtcInfo *rtc) +{ + u8 statusData; + + if (sLocked == TRUE) + return FALSE; + + sLocked = TRUE; + + GPIO_PORT_DATA = 1; + GPIO_PORT_DATA = 5; + + GPIO_PORT_DIRECTION = 7; + + WriteCommand(CMD_STATUS | RD); + + GPIO_PORT_DIRECTION = 5; + + statusData = ReadData(); + + rtc->status = (statusData & (STATUS_POWER | STATUS_24HOUR)) + | ((statusData & STATUS_INTAE) >> 3) + | ((statusData & STATUS_INTME) >> 2) + | ((statusData & STATUS_INTFE) >> 1); + + GPIO_PORT_DATA = 1; + GPIO_PORT_DATA = 1; + + sLocked = FALSE; + + return TRUE; +} + +bool8 SiiRtcSetStatus(struct SiiRtcInfo *rtc) +{ + u8 statusData; + + if (sLocked == TRUE) + return FALSE; + + sLocked = TRUE; + + GPIO_PORT_DATA = 1; + GPIO_PORT_DATA = 5; + + statusData = STATUS_24HOUR + | ((rtc->status & SIIRTCINFO_INTAE) << 3) + | ((rtc->status & SIIRTCINFO_INTME) << 2) + | ((rtc->status & SIIRTCINFO_INTFE) << 1); + + GPIO_PORT_DIRECTION = 7; + + WriteCommand(CMD_STATUS | WR); + + WriteData(statusData); + + GPIO_PORT_DATA = 1; + GPIO_PORT_DATA = 1; + + sLocked = FALSE; + + return TRUE; +} + +bool8 SiiRtcGetDateTime(struct SiiRtcInfo *rtc) +{ + u8 i; + + if (sLocked == TRUE) + return FALSE; + + sLocked = TRUE; + + GPIO_PORT_DATA = 1; + GPIO_PORT_DATA = 5; + + GPIO_PORT_DIRECTION = 7; + + WriteCommand(CMD_DATETIME | RD); + + GPIO_PORT_DIRECTION = 5; + + for (i = 0; i < DATETIME_BUF_LEN; i++) + DATETIME_BUF(rtc, i) = ReadData(); + + INFO_BUF(rtc, OFFSET_HOUR) &= 0x7F; + + GPIO_PORT_DATA = 1; + GPIO_PORT_DATA = 1; + + sLocked = FALSE; + + return TRUE; +} + +bool8 SiiRtcSetDateTime(struct SiiRtcInfo *rtc) +{ + u8 i; + + if (sLocked == TRUE) + return FALSE; + + sLocked = TRUE; + + GPIO_PORT_DATA = 1; + GPIO_PORT_DATA = 5; + + GPIO_PORT_DIRECTION = 7; + + WriteCommand(CMD_DATETIME | WR); + + for (i = 0; i < DATETIME_BUF_LEN; i++) + WriteData(DATETIME_BUF(rtc, i)); + + GPIO_PORT_DATA = 1; + GPIO_PORT_DATA = 1; + + sLocked = FALSE; + + return TRUE; +} + +bool8 SiiRtcGetTime(struct SiiRtcInfo *rtc) +{ + u8 i; + + if (sLocked == TRUE) + return FALSE; + + sLocked = TRUE; + + GPIO_PORT_DATA = 1; + GPIO_PORT_DATA = 5; + + GPIO_PORT_DIRECTION = 7; + + WriteCommand(CMD_TIME | RD); + + GPIO_PORT_DIRECTION = 5; + + for (i = 0; i < TIME_BUF_LEN; i++) + TIME_BUF(rtc, i) = ReadData(); + + INFO_BUF(rtc, OFFSET_HOUR) &= 0x7F; + + GPIO_PORT_DATA = 1; + GPIO_PORT_DATA = 1; + + sLocked = FALSE; + + return TRUE; +} + +bool8 SiiRtcSetTime(struct SiiRtcInfo *rtc) +{ + u8 i; + + if (sLocked == TRUE) + return FALSE; + + sLocked = TRUE; + + GPIO_PORT_DATA = 1; + GPIO_PORT_DATA = 5; + + GPIO_PORT_DIRECTION = 7; + + WriteCommand(CMD_TIME | WR); + + for (i = 0; i < TIME_BUF_LEN; i++) + WriteData(TIME_BUF(rtc, i)); + + GPIO_PORT_DATA = 1; + GPIO_PORT_DATA = 1; + + sLocked = FALSE; + + return TRUE; +} + +bool8 SiiRtcSetAlarm(struct SiiRtcInfo *rtc) +{ + u8 i; + u8 alarmData[2]; + + if (sLocked == TRUE) + return FALSE; + + sLocked = TRUE; + + // Decode BCD. + alarmData[0] = (rtc->alarmHour & 0xF) + 10 * ((rtc->alarmHour >> 4) & 0xF); + + // The AM/PM flag must be set correctly even in 24-hour mode. + + if (alarmData[0] < 12) + alarmData[0] = rtc->alarmHour | ALARM_AM; + else + alarmData[0] = rtc->alarmHour | ALARM_PM; + + alarmData[1] = rtc->alarmMinute; + + GPIO_PORT_DATA = 1; + GPIO_PORT_DATA = 5; + + GPIOPortDirection = 7; // Why is this the only instance that uses a symbol? + + WriteCommand(CMD_ALARM | WR); + + for (i = 0; i < 2; i++) + WriteData(alarmData[i]); + + GPIO_PORT_DATA = 1; + GPIO_PORT_DATA = 1; + + sLocked = FALSE; + + return TRUE; +} + +static int WriteCommand(u8 value) +{ + u8 i; + u8 temp; + + for (i = 0; i < 8; i++) + { + temp = ((value >> (7 - i)) & 1); + GPIO_PORT_DATA = (temp << 1) | 4; + GPIO_PORT_DATA = (temp << 1) | 4; + GPIO_PORT_DATA = (temp << 1) | 4; + GPIO_PORT_DATA = (temp << 1) | 5; + } + + // control reaches end of non-void function +} + +static int WriteData(u8 value) +{ + u8 i; + u8 temp; + + for (i = 0; i < 8; i++) + { + temp = ((value >> i) & 1); + GPIO_PORT_DATA = (temp << 1) | 4; + GPIO_PORT_DATA = (temp << 1) | 4; + GPIO_PORT_DATA = (temp << 1) | 4; + GPIO_PORT_DATA = (temp << 1) | 5; + } + + // control reaches end of non-void function +} + +static u8 ReadData() +{ + u8 i; + u8 temp; + u8 value; + + for (i = 0; i < 8; i++) + { + GPIO_PORT_DATA = 4; + GPIO_PORT_DATA = 4; + GPIO_PORT_DATA = 4; + GPIO_PORT_DATA = 4; + GPIO_PORT_DATA = 4; + GPIO_PORT_DATA = 5; + + temp = ((GPIO_PORT_DATA & 2) >> 1); + value = (value >> 1) | (temp << 7); // UB: accessing uninitialized var + } + + return value; +} + +static void EnableGpioPortRead() +{ + GPIO_PORT_READ_ENABLE = 1; +} + +static void DisableGpioPortRead() +{ + GPIO_PORT_READ_ENABLE = 0; +} diff --git a/src/string_util.c b/src/string_util.c new file mode 100644 index 000000000..009072dca --- /dev/null +++ b/src/string_util.c @@ -0,0 +1,780 @@ +#include "global.h" +#include "string_util.h" +#include "text.h" + +EWRAM_DATA u8 gUnknownStringVar[16] = {0}; + +static const u8 sDigits[] = __("0123456789ABCDEF"); + +static const s32 sPowersOfTen[] = +{ + 1, + 10, + 100, + 1000, + 10000, + 100000, + 1000000, + 10000000, + 100000000, + 1000000000, +}; + +extern u8 gExpandedPlaceholder_Empty[]; +extern u8 gExpandedPlaceholder_Kun[]; +extern u8 gExpandedPlaceholder_Chan[]; +extern u8 gExpandedPlaceholder_Sapphire[]; +extern u8 gExpandedPlaceholder_Ruby[]; +extern u8 gExpandedPlaceholder_Emerald[]; +extern u8 gExpandedPlaceholder_Aqua[]; +extern u8 gExpandedPlaceholder_Magma[]; +extern u8 gExpandedPlaceholder_Archie[]; +extern u8 gExpandedPlaceholder_Maxie[]; +extern u8 gExpandedPlaceholder_Kyogre[]; +extern u8 gExpandedPlaceholder_Groudon[]; +extern u8 gExpandedPlaceholder_Brendan[]; +extern u8 gExpandedPlaceholder_May[]; + +u8 *StringCopy10(u8 *dest, const u8 *src) +{ + u8 i; + u32 limit = 10; + + for (i = 0; i < limit; i++) + { + dest[i] = src[i]; + + if (dest[i] == EOS) + return &dest[i]; + } + + dest[i] = EOS; + return &dest[i]; +} + +u8 *StringGetEnd10(u8 *str) +{ + u8 i; + u32 limit = 10; + + for (i = 0; i < limit; i++) + if (str[i] == EOS) + return &str[i]; + + str[i] = EOS; + return &str[i]; +} + +u8 *StringCopy7(u8 *dest, const u8 *src) +{ + s32 i; + s32 limit = 7; + + for (i = 0; i < limit; i++) + { + dest[i] = src[i]; + + if (dest[i] == EOS) + return &dest[i]; + } + + dest[i] = EOS; + return &dest[i]; +} + +u8 *StringCopy(u8 *dest, const u8 *src) +{ + while (*src != EOS) + { + *dest = *src; + dest++; + src++; + } + + *dest = EOS; + return dest; +} + +u8 *StringAppend(u8 *dest, const u8 *src) +{ + while (*dest != EOS) + dest++; + + return StringCopy(dest, src); +} + +u8 *StringCopyN(u8 *dest, const u8 *src, u8 n) +{ + u16 i; + + for (i = 0; i < n; i++) + dest[i] = src[i]; + + return &dest[n]; +} + +u8 *StringAppendN(u8 *dest, const u8 *src, u8 n) +{ + while (*dest != EOS) + dest++; + + return StringCopyN(dest, src, n); +} + +u16 StringLength(const u8 *str) +{ + u16 length = 0; + + while (str[length] != EOS) + length++; + + return length; +} + +s32 StringCompare(const u8 *str1, const u8 *str2) +{ + while (*str1 == *str2) + { + if (*str1 == EOS) + return 0; + str1++; + str2++; + } + + return *str1 - *str2; +} + +s32 StringCompareN(const u8 *str1, const u8 *str2, u32 n) +{ + while (*str1 == *str2) + { + if (*str1 == EOS) + return 0; + str1++; + str2++; + if (--n == 0) + return 0; + } + + return *str1 - *str2; +} + +bool8 IsStringLengthAtLeast(const u8 *str, s32 n) +{ + u8 i; + + for (i = 0; i < n; i++) + if (str[i] && str[i] != EOS) + return TRUE; + + return FALSE; +} + +u8 *ConvertIntToDecimalStringN(u8 *dest, s32 value, enum StringConvertMode mode, u8 n) +{ + enum { WAITING_FOR_NONZERO_DIGIT, WRITING_DIGITS, WRITING_SPACES } state; + s32 powerOfTen; + s32 largestPowerOfTen = sPowersOfTen[n - 1]; + + state = WAITING_FOR_NONZERO_DIGIT; + + if (mode == STR_CONV_MODE_RIGHT_ALIGN) + state = WRITING_SPACES; + + if (mode == STR_CONV_MODE_LEADING_ZEROS) + state = WRITING_DIGITS; + + for (powerOfTen = largestPowerOfTen; powerOfTen > 0; powerOfTen /= 10) + { + u8 c; + u16 digit = value / powerOfTen; + s32 temp = value - (powerOfTen * digit); + + if (state == WRITING_DIGITS) + { + u8 *out = dest++; + + if (digit <= 9) + c = sDigits[digit]; + else + c = CHAR_QUESTION_MARK; + + *out = c; + } + else if (digit != 0 || powerOfTen == 1) + { + u8 *out; + state = WRITING_DIGITS; + out = dest++; + + if (digit <= 9) + c = sDigits[digit]; + else + c = CHAR_QUESTION_MARK; + + *out = c; + } + else if (state == WRITING_SPACES) + { + *dest++ = 0x77; + } + + value = temp; + } + + *dest = EOS; + return dest; +} + +u8 *ConvertUIntToDecimalStringN(u8 *dest, u32 value, enum StringConvertMode mode, u8 n) +{ + enum { WAITING_FOR_NONZERO_DIGIT, WRITING_DIGITS, WRITING_SPACES } state; + s32 powerOfTen; + s32 largestPowerOfTen = sPowersOfTen[n - 1]; + + state = WAITING_FOR_NONZERO_DIGIT; + + if (mode == STR_CONV_MODE_RIGHT_ALIGN) + state = WRITING_SPACES; + + if (mode == STR_CONV_MODE_LEADING_ZEROS) + state = WRITING_DIGITS; + + for (powerOfTen = largestPowerOfTen; powerOfTen > 0; powerOfTen /= 10) + { + u8 c; + u16 digit = value / powerOfTen; + u32 temp = value - (powerOfTen * digit); + + if (state == WRITING_DIGITS) + { + u8 *out = dest++; + + if (digit <= 9) + c = sDigits[digit]; + else + c = CHAR_QUESTION_MARK; + + *out = c; + } + else if (digit != 0 || powerOfTen == 1) + { + u8 *out; + state = WRITING_DIGITS; + out = dest++; + + if (digit <= 9) + c = sDigits[digit]; + else + c = CHAR_QUESTION_MARK; + + *out = c; + } + else if (state == WRITING_SPACES) + { + *dest++ = 0x77; + } + + value = temp; + } + + *dest = EOS; + return dest; +} + +u8 *ConvertIntToHexStringN(u8 *dest, s32 value, enum StringConvertMode mode, u8 n) +{ + enum { WAITING_FOR_NONZERO_DIGIT, WRITING_DIGITS, WRITING_SPACES } state; + u8 i; + s32 powerOfSixteen; + s32 largestPowerOfSixteen = 1; + + for (i = 1; i < n; i++) + largestPowerOfSixteen *= 16; + + state = WAITING_FOR_NONZERO_DIGIT; + + if (mode == STR_CONV_MODE_RIGHT_ALIGN) + state = WRITING_SPACES; + + if (mode == STR_CONV_MODE_LEADING_ZEROS) + state = WRITING_DIGITS; + + for (powerOfSixteen = largestPowerOfSixteen; powerOfSixteen > 0; powerOfSixteen /= 16) + { + u8 c; + u32 digit = value / powerOfSixteen; + s32 temp = value % powerOfSixteen; + + if (state == WRITING_DIGITS) + { + char *out = dest++; + + if (digit <= 0xF) + c = sDigits[digit]; + else + c = CHAR_QUESTION_MARK; + + *out = c; + } + else if (digit != 0 || powerOfSixteen == 1) + { + char *out; + state = WRITING_DIGITS; + out = dest++; + + if (digit <= 0xF) + c = sDigits[digit]; + else + c = CHAR_QUESTION_MARK; + + *out = c; + } + else if (state == WRITING_SPACES) + { + *dest++ = 0x77; + } + + value = temp; + } + + *dest = EOS; + return dest; +} + +u8 *StringExpandPlaceholders(u8 *dest, const u8 *src) +{ + for (;;) + { + u8 c = *src++; + u8 placeholderId; + u8 *expandedString; + + switch (c) + { + case PLACEHOLDER_BEGIN: + placeholderId = *src++; + expandedString = GetExpandedPlaceholder(placeholderId); + dest = StringExpandPlaceholders(dest, expandedString); + break; + case EXT_CTRL_CODE_BEGIN: + *dest++ = c; + c = *src++; + *dest++ = c; + + switch (c) + { + case 0x07: + case 0x09: + case 0x0F: + case 0x15: + case 0x16: + case 0x17: + case 0x18: + break; + case 0x04: + *dest++ = *src++; + case 0x0B: + *dest++ = *src++; + default: + *dest++ = *src++; + } + break; + case EOS: + *dest = EOS; + return dest; + case 0xFA: + case 0xFB: + case 0xFE: + default: + *dest++ = c; + } + } +} + +u8 *StringBraille(u8 *dest, const u8 *src) +{ + u8 setBrailleFont[] = { 0xFC, 0x06, 0x06, 0xFF }; + u8 gotoLine2[] = { 0xFE, 0xFC, 0x0E, 0x02, 0xFF }; + + dest = StringCopy(dest, setBrailleFont); + + for (;;) + { + u8 c = *src++; + + switch (c) + { + case EOS: + *dest = c; + return dest; + case 0xFE: + dest = StringCopy(dest, gotoLine2); + break; + default: + *dest++ = c; + *dest++ = c + 0x40; + break; + } + } +} + +static u8 *ExpandPlaceholder_UnknownStringVar(void) +{ + return gUnknownStringVar; +} + +static u8 *ExpandPlaceholder_PlayerName(void) +{ + return gSaveBlock2Ptr->playerName; +} + +static u8 *ExpandPlaceholder_StringVar1(void) +{ + return gStringVar1; +} + +static u8 *ExpandPlaceholder_StringVar2(void) +{ + return gStringVar2; +} + +static u8 *ExpandPlaceholder_StringVar3(void) +{ + return gStringVar3; +} + +static u8 *ExpandPlaceholder_KunChan(void) +{ + if (gSaveBlock2Ptr->playerGender == MALE) + return gExpandedPlaceholder_Kun; + else + return gExpandedPlaceholder_Chan; +} + +static u8 *ExpandPlaceholder_RivalName(void) +{ + if (gSaveBlock2Ptr->playerGender == MALE) + return gExpandedPlaceholder_May; + else + return gExpandedPlaceholder_Brendan; +} + +static u8 *ExpandPlaceholder_Version(void) +{ + return gExpandedPlaceholder_Emerald; +} + +static u8 *ExpandPlaceholder_Aqua(void) +{ + return gExpandedPlaceholder_Aqua; +} + +static u8 *ExpandPlaceholder_Magma(void) +{ + return gExpandedPlaceholder_Magma; +} + +static u8 *ExpandPlaceholder_Archie(void) +{ + return gExpandedPlaceholder_Archie; +} + +static u8 *ExpandPlaceholder_Maxie(void) +{ + return gExpandedPlaceholder_Maxie; +} + +static u8 *ExpandPlaceholder_Kyogre(void) +{ + return gExpandedPlaceholder_Kyogre; +} + +static u8 *ExpandPlaceholder_Groudon(void) +{ + return gExpandedPlaceholder_Groudon; +} + +u8 *GetExpandedPlaceholder(u32 id) +{ + typedef u8 *(*ExpandPlaceholderFunc)(void); + + static const ExpandPlaceholderFunc funcs[] = + { + ExpandPlaceholder_UnknownStringVar, + ExpandPlaceholder_PlayerName, + ExpandPlaceholder_StringVar1, + ExpandPlaceholder_StringVar2, + ExpandPlaceholder_StringVar3, + ExpandPlaceholder_KunChan, + ExpandPlaceholder_RivalName, + ExpandPlaceholder_Version, + ExpandPlaceholder_Aqua, + ExpandPlaceholder_Magma, + ExpandPlaceholder_Archie, + ExpandPlaceholder_Maxie, + ExpandPlaceholder_Kyogre, + ExpandPlaceholder_Groudon, + }; + + if (id >= ARRAY_COUNT(funcs)) + return gExpandedPlaceholder_Empty; + else + return funcs[id](); +} + +u8 *StringFill(u8 *dest, u8 c, u16 n) +{ + u16 i; + + for (i = 0; i < n; i++) + *dest++ = c; + + *dest = EOS; + return dest; +} + +u8 *StringCopyPadded(u8 *dest, const u8 *src, u8 c, u16 n) +{ + while (*src != EOS) + { + *dest++ = *src++; + + if (n) + n--; + } + + n--; + + while (n != (u16)-1) + { + *dest++ = c; + n--; + } + + *dest = EOS; + return dest; +} + +u8 *StringFillWithTerminator(u8 *dest, u16 n) +{ + return StringFill(dest, EOS, n); +} + +u8 *StringCopyN_Multibyte(u8 *dest, u8 *src, u32 n) +{ + u32 i; + + for (i = n - 1; i != (u32)-1; i--) + { + if (*src == EOS) + { + break; + } + else + { + *dest++ = *src++; + if (*(src - 1) == 0xF9) + *dest++ = *src++; + } + } + + *dest = EOS; + return dest; +} + +u32 StringLength_Multibyte(u8 *str) +{ + u32 length = 0; + + while (*str != EOS) + { + if (*str == 0xF9) + str++; + str++; + length++; + } + + return length; +} + +u8 *WriteColorChangeControlCode(u8 *dest, u32 colorType, u8 color) +{ + *dest = 0xFC; + dest++; + + switch (colorType) + { + case 0: + *dest = 1; + dest++; + break; + case 1: + *dest = 3; + dest++; + break; + case 2: + *dest = 2; + dest++; + break; + } + + *dest = color; + dest++; + *dest = EOS; + return dest; +} + +bool32 sub_8009228(u8 *str) +{ + while (*str != EOS) + { + if (*str <= 0xA0) + if (*str != 0) + return TRUE; + str++; + } + + return FALSE; +} + +bool32 sub_800924C(u8 *str, s32 n) +{ + s32 i; + + for (i = 0; *str != EOS && i < n; i++) + { + if (*str <= 0xA0) + if (*str != 0) + return TRUE; + str++; + } + + return FALSE; +} + +u8 GetExtCtrlCodeLength(u8 code) +{ + static const u8 lengths[] = + { + 1, + 2, + 2, + 2, + 4, + 2, + 2, + 1, + 2, + 1, + 1, + 3, + 2, + 2, + 2, + 1, + 3, + 2, + 2, + 2, + 2, + 1, + 1, + 1, + 1, + }; + + u8 length = 0; + if (code < ARRAY_COUNT(lengths)) + length = lengths[code]; + return length; +} + +static const u8 *SkipExtCtrlCode(const u8 *s) +{ + while (*s == 0xFC) + { + s++; + s += GetExtCtrlCodeLength(*s); + } + + return s; +} + +s32 StringCompareWithoutExtCtrlCodes(const u8 *str1, const u8 *str2) +{ + s32 retVal = 0; + + while (1) + { + str1 = SkipExtCtrlCode(str1); + str2 = SkipExtCtrlCode(str2); + + if (*str1 > *str2) + break; + + if (*str1 < *str2) + { + retVal = -1; + if (*str2 == 0xFF) + retVal = 1; + } + + if (*str1 == 0xFF) + return retVal; + + str1++; + str2++; + } + + retVal = 1; + + if (*str1 == 0xFF) + retVal = -1; + + return retVal; +} + +void ConvertInternationalString(u8 *s, u8 language) +{ + if (language == LANGUAGE_JAPANESE) + { + u8 i; + + StripExtCtrlCodes(s); + i = StringLength(s); + s[i++] = 0xFC; + s[i++] = 22; + s[i++] = 0xFF; + + i--; + + while (i != (u8)-1) + { + s[i + 2] = s[i]; + i--; + } + + s[0] = 0xFC; + s[1] = 21; + } +} + +void StripExtCtrlCodes(u8 *str) +{ + u16 srcIndex = 0; + u16 destIndex = 0; + while (str[srcIndex] != 0xFF) + { + if (str[srcIndex] == 0xFC) + { + srcIndex++; + srcIndex += GetExtCtrlCodeLength(str[srcIndex]); + } + else + { + str[destIndex++] = str[srcIndex++]; + } + } + str[destIndex] = 0xFF; +} diff --git a/src/task.c b/src/task.c index f84c83e80..bf8abd794 100644 --- a/src/task.c +++ b/src/task.c @@ -49,7 +49,6 @@ u8 CreateTask(TaskFunc func, u8 priority) return 0; } -#ifdef NONMATCHING static void InsertTask(u8 newTaskId) { u8 taskId = FindFirstActiveTask(); @@ -62,7 +61,7 @@ static void InsertTask(u8 newTaskId) return; } - for (;;) + while (1) { if (gTasks[newTaskId].priority < gTasks[taskId].priority) { @@ -70,112 +69,22 @@ static void InsertTask(u8 newTaskId) // so we insert the new task before it. gTasks[newTaskId].prev = gTasks[taskId].prev; gTasks[newTaskId].next = taskId; - if (gTasks[taskId].prev != HEAD_SENTINEL) gTasks[gTasks[taskId].prev].next = newTaskId; - gTasks[taskId].prev = newTaskId; return; } - - if (gTasks[taskId].next != TAIL_SENTINEL) - taskId = gTasks[taskId].next; - else - break; + if (gTasks[taskId].next == TAIL_SENTINEL) + { + // We've reached the end. + gTasks[newTaskId].prev = taskId; + gTasks[newTaskId].next = gTasks[taskId].next; + gTasks[taskId].next = newTaskId; + return; + } + taskId = gTasks[taskId].next; } - - // We've reached the end. - gTasks[newTaskId].prev = taskId; - gTasks[newTaskId].next = gTasks[taskId].next; - gTasks[taskId].next = newTaskId; } -#else -__attribute__((naked)) -static void InsertTask(u8 newTaskId) -{ - asm("push {r4, r5, r6, r7, lr}\n\ - mov r7, r8\n\ - push {r7}\n\ - lsl r0, r0, #24\n\ - lsr r4, r0, #24\n\ - bl FindFirstActiveTask\n\ - lsl r0, r0, #24\n\ - lsr r1, r0, #24\n\ - cmp r1, #16\n\ - bne .LInsertTask_foundActiveTask\n\ - ldr r1, .LInsertTask_gTasks1\n\ - lsl r0, r4, #2\n\ - add r0, r0, r4\n\ - lsl r0, r0, #3\n\ - add r0, r0, r1\n\ - mov r1, #254\n\ - strb r1, [r0, #5]\n\ - mov r1, #255\n\ - strb r1, [r0, #6]\n\ - b .LInsertTask_done\n\ - .align 2, 0\n\ -.LInsertTask_gTasks1:\n\ - .word gTasks\n\ -.LInsertTask_foundActiveTask:\n\ - ldr r6, .LInsertTask_gTasks2\n\ - lsl r0, r4, #2\n\ - mov r12, r0\n\ - mov r8, r6\n\ - add r0, r0, r4\n\ - lsl r0, r0, #3\n\ - add r2, r0, r6\n\ -.LInsertTask_loop:\n\ - lsl r0, r1, #2\n\ - add r0, r0, r1\n\ - lsl r5, r0, #3\n\ - mov r7, r8\n\ - add r3, r5, r7\n\ - ldrb r0, [r2, #7]\n\ - ldrb r7, [r3, #7]\n\ - cmp r0, r7\n\ - bcs .LInsertTask_next\n\ - ldrb r0, [r3, #5]\n\ - strb r0, [r2, #5]\n\ - strb r1, [r2, #6]\n\ - ldrb r0, [r3, #5]\n\ - cmp r0, #254\n\ - beq .LInsertTask_insertAtHead\n\ - add r1, r0, #0\n\ - lsl r0, r1, #2\n\ - add r0, r0, r1\n\ - lsl r0, r0, #3\n\ - add r0, r0, r8\n\ - strb r4, [r0, #6]\n\ -.LInsertTask_insertAtHead:\n\ - strb r4, [r3, #5]\n\ - b .LInsertTask_done\n\ - .align 2, 0\n\ -.LInsertTask_gTasks2:\n\ - .word gTasks\n\ -.LInsertTask_next:\n\ - ldrb r0, [r3, #6]\n\ - cmp r0, #255\n\ - beq .LInsertTask_insertAtTail\n\ - add r1, r0, #0\n\ - b .LInsertTask_loop\n\ -.LInsertTask_insertAtTail:\n\ - mov r2, r12\n\ - add r0, r2, r4\n\ - lsl r0, r0, #3\n\ - add r0, r0, r6\n\ - strb r1, [r0, #5]\n\ - add r2, r5, r6\n\ - ldrb r1, [r2, #6]\n\ - strb r1, [r0, #6]\n\ - strb r4, [r2, #6]\n\ -.LInsertTask_done:\n\ - pop {r3}\n\ - mov r8, r3\n\ - pop {r4, r5, r6, r7}\n\ - pop {r0}\n\ - bx r0\n"); -} -#endif // NONMATCHING void DestroyTask(u8 taskId) { diff --git a/sym_bss.txt b/sym_bss.txt index 45005362c..e10bd14ba 100644 --- a/sym_bss.txt +++ b/sym_bss.txt @@ -433,8 +433,9 @@ gUnknown_03001294: @ 3001294 gUnknown_03001298: @ 3001298 .space 0x4 -gUnknown_0300129C: @ 300129C - .space 0xC + .include "src/multiboot.o" + + .space 0x4 @ XXX: why is this needed? gUnknown_030012A8: @ 30012A8 .space 0x10 @@ -497,11 +498,6 @@ gUnknown_03001300: @ 3001300 .space 0x770 .include "src/agb_flash.o" - - .space 0x2 - -gUnknown_03001A7E: @ 3001A7E - .space 0x2 - + .include "src/siirtc.o" .include "tools/agbcc/lib/libgcc.a:dp-bit.o" .include "tools/agbcc/lib/libgcc.a:fp-bit.o" diff --git a/sym_common.txt b/sym_common.txt index 4a8aebd0b..b6c5d6a86 100644 --- a/sym_common.txt +++ b/sym_common.txt @@ -1,12 +1,12 @@ .space 0x8 -gUnknown_030022B0: @ 30022B0 +gKeyRepeatStartDelay: @ 30022B0 .space 0x4 gUnknown_030022B4: @ 30022B4 .space 0xC -gUnknown_030022C0: @ 30022C0 +gMain: @ 30022C0 .space 0x2C gUnknown_030022EC: @ 30022EC @@ -21,28 +21,22 @@ gUnknown_030024F8: @ 30024F8 gUnknown_030026F8: @ 30026F8 .space 0x4 -gUnknown_030026FC: @ 30026FC +gKeyRepeatContinueDelay: @ 30026FC .space 0x4 -gUnknown_03002700: @ 3002700 +gSoftResetDisabled: @ 3002700 .space 0x10 -gUnknown_03002710: @ 3002710 - .space 0x4 - -gUnknown_03002714: @ 3002714 - .space 0x18 - -gUnknown_0300272C: @ 300272C - .space 0x1C +gIntrTable: @ 3002710 + .space 0x38 gUnknown_03002748: @ 3002748 .space 0x8 -gUnknown_03002750: @ 3002750 +IntrMain_Buffer: @ 3002750 .space 0x800 -gUnknown_03002F50: @ 3002F50 +gPcmDmaCounter: @ 3002F50 .space 0x4 gUnknown_03002F54: @ 3002F54 @@ -135,7 +129,7 @@ gUnknown_030030F4: @ 30030F4 gUnknown_030030F8: @ 30030F8 .space 0x4 -gUnknown_030030FC: @ 30030FC +gLinkVSyncDisabled: @ 30030FC .space 0x4 gUnknown_03003100: @ 3003100 @@ -267,19 +261,19 @@ gUnknown_03005D78: @ 3005D78 gUnknown_03005D7C: @ 3005D7C .space 0x4 -gUnknown_03005D80: @ 3005D80 +gRngValue: @ 3005D80 .space 0x4 -gUnknown_03005D84: @ 3005D84 +gRng2Value: @ 3005D84 .space 0x4 -gUnknown_03005D88: @ 3005D88 +gFlashMemoryPresent: @ 3005D88 .space 0x4 -gUnknown_03005D8C: @ 3005D8C +gSaveBlock1Ptr: @ 3005D8C .space 0x4 -gUnknown_03005D90: @ 3005D90 +gSaveBlock2Ptr: @ 3005D90 .space 0x4 gUnknown_03005D94: @ 3005D94 @@ -524,14 +518,3 @@ gUnknown_03007898: @ 3007898 gUnknown_030078A0: @ 30078A0 .space 0x660 - -gUnknown_03007F00: @ 3007F00 - .space 0xF0 - -gUnknown_03007FF0: @ 3007FF0 - .space 0x8 - -gUnknown_03007FF8: @ 3007FF8 - .space 0x4 - -gUnknown_03007FFC: @ 3007FFC diff --git a/sym_ewram.txt b/sym_ewram.txt index f606787dc..7411b3c73 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -1,4 +1,4 @@ -gUnknown_02020000: @ 2020000 +gTrainerId: @ 2020000 .space 0x4 gUnknown_02020004: @ 2020004 @@ -64,20 +64,19 @@ gUnknown_02021BC0: @ 2021BC0 gUnknown_02021CC0: @ 2021CC0 .space 0x4 -gUnknown_02021CC4: @ 2021CC4 +gStringVar1: @ 2021CC4 .space 0x100 -gUnknown_02021DC4: @ 2021DC4 +gStringVar2: @ 2021DC4 .space 0x100 -gUnknown_02021EC4: @ 2021EC4 +gStringVar3: @ 2021EC4 .space 0x100 -gUnknown_02021FC4: @ 2021FC4 +gStringVar4: @ 2021FC4 .space 0x3E8 -gUnknown_020223AC: @ 20223AC - .space 0x10 + .include "src/string_util.o" gUnknown_020223BC: @ 20223BC .space 0x1 @@ -325,7 +324,7 @@ gUnknown_02022F78: @ 2022F78 gUnknown_02022F88: @ 2022F88 .space 0x64 -gUnknown_02022FEC: @ 2022FEC +gBattleTypeFlags: @ 2022FEC .space 0x4 gUnknown_02022FF0: @ 2022FF0 @@ -391,7 +390,7 @@ gUnknown_02024082: @ 2024082 gUnknown_02024083: @ 2024083 .space 0x1 -gUnknown_02024084: @ 2024084 +gBattleMons: @ 2024084 .space 0xC gUnknown_02024090: @ 2024090 @@ -436,7 +435,7 @@ gUnknown_020241EC: @ 20241EC gUnknown_020241EE: @ 20241EE .space 0x2 -gUnknown_020241F0: @ 20241F0 +gBattleMoveDamage: @ 20241F0 .space 0x4 gUnknown_020241F4: @ 20241F4 @@ -454,7 +453,7 @@ gUnknown_0202420A: @ 202420A gUnknown_0202420B: @ 202420B .space 0x1 -gUnknown_0202420C: @ 202420C +gEnemyMonIndex: @ 202420C .space 0x1 gUnknown_0202420D: @ 202420D @@ -469,7 +468,7 @@ gUnknown_0202420F: @ 202420F gUnknown_02024210: @ 2024210 .space 0x1 -gUnknown_02024211: @ 2024211 +gCritMultiplier: @ 2024211 .space 0x1 gUnknown_02024212: @ 2024212 @@ -511,7 +510,7 @@ gUnknown_02024270: @ 2024270 gUnknown_02024274: @ 2024274 .space 0x8 -gUnknown_0202427C: @ 202427C +gBattleMoveFlags: @ 202427C .space 0x4 gUnknown_02024280: @ 2024280 @@ -562,7 +561,7 @@ gUnknown_0202433C: @ 202433C gUnknown_0202437C: @ 202437C .space 0x50 -gUnknown_020243CC: @ 20243CC +gBattleWeather: @ 20243CC .space 0x4 gUnknown_020243D0: @ 20243D0 @@ -658,7 +657,7 @@ gUnknown_020244E9: @ 20244E9 gUnknown_020244EA: @ 20244EA .space 0x2 -gUnknown_020244EC: @ 20244EC +gPlayerParty: @ 20244EC .space 0x64 gUnknown_02024550: @ 2024550 @@ -676,7 +675,7 @@ gUnknown_0202467C: @ 202467C gUnknown_020246E0: @ 20246E0 .space 0x64 -gUnknown_02024744: @ 2024744 +gEnemyParty: @ 2024744 .space 0x64 gUnknown_020247A8: @ 20247A8 @@ -700,12 +699,9 @@ gUnknown_0202499C: @ 202499C gUnknown_020249B4: @ 20249B4 .space 0x8 -gUnknown_020249BC: @ 20249BC - .space 0x4 - -gUnknown_020249C0: @ 20249C0 - .space 0x4 + .include "src/rng.o" + .align 2 gUnknown_020249C4: @ 20249C4 .space 0x64 @@ -1621,10 +1617,10 @@ gUnknown_0203AB30: @ 203AB30 gUnknown_0203AB34: @ 203AB34 .space 0x4 -gUnknown_0203AB38: @ 203AB38 +gAIScriptPtr: @ 203AB38 .space 0x4 -gUnknown_0203AB3C: @ 203AB3C +gPlayerMonIndex: @ 203AB3C .space 0x4 gUnknown_0203AB40: @ 203AB40