diff --git a/asm/battle_2.s b/asm/battle_2.s index 53b83c10e..078a7a939 100644 --- a/asm/battle_2.s +++ b/asm/battle_2.s @@ -410,7 +410,7 @@ sub_8036B44: @ 8036B44 movs r0, 0xC2 lsls r0, 1 adds r4, r5, r0 - bl sub_80E162C + bl IsEnigmaBerryValid cmp r0, 0x1 bne _08036BC0 movs r2, 0 @@ -513,7 +513,7 @@ berry_801017C: @ 8036C08 beq _08036C20 b _08036D4C _08036C20: - bl sub_80E162C + bl IsEnigmaBerryValid cmp r0, 0x1 bne _08036CDC movs r5, 0 diff --git a/asm/battle_controller_player.s b/asm/battle_controller_player.s index 5854d5e47..2d1f6de7f 100644 --- a/asm/battle_controller_player.s +++ b/asm/battle_controller_player.s @@ -4127,7 +4127,7 @@ sub_80598E0: @ 80598E0 ands r0, r1 cmp r0, 0 bne _08059906 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r1, [r0] movs r0, 0x1 bl dp01_build_cmdbuf_x23_aa_0 diff --git a/asm/battle_controller_safari.s b/asm/battle_controller_safari.s index 3de3c2608..5f26cf4e7 100644 --- a/asm/battle_controller_safari.s +++ b/asm/battle_controller_safari.s @@ -396,7 +396,7 @@ sub_8159698: @ 8159698 ands r0, r1 cmp r0, 0 bne _081596BE - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r1, [r0] movs r0, 0x1 bl dp01_build_cmdbuf_x23_aa_0 diff --git a/asm/battle_controller_wally.s b/asm/battle_controller_wally.s index c00988ed2..3ee2b7e45 100644 --- a/asm/battle_controller_wally.s +++ b/asm/battle_controller_wally.s @@ -308,7 +308,7 @@ sub_8168610: @ 8168610 ands r0, r1 cmp r0, 0 bne _08168636 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r1, [r0] movs r0, 0x1 bl dp01_build_cmdbuf_x23_aa_0 diff --git a/asm/battle_setup.s b/asm/battle_setup.s index aea1be97c..058d649f3 100644 --- a/asm/battle_setup.s +++ b/asm/battle_setup.s @@ -1678,7 +1678,7 @@ battle_80801F0: @ 80B13F8 ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] bl GetFieldObjectIdByLocalIdAndMap - ldr r1, =gUnknown_03005DF0 + ldr r1, =gSelectedMapObject strb r0, [r1] _080B141A: pop {r0} @@ -1880,10 +1880,10 @@ SingleTrainerWantsBattle: @ 80B162C push {r4,lr} lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_03005DF0 + ldr r2, =gSelectedMapObject strb r0, [r2] ldr r4, =gScriptLastTalked - ldr r3, =gUnknown_02037350 + ldr r3, =gMapObjects lsls r2, r0, 3 adds r2, r0 lsls r2, 2 @@ -1908,10 +1908,10 @@ TwoTrainersWantBattle: @ 80B1670 push {r4,lr} lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_03005DF0 + ldr r2, =gSelectedMapObject strb r0, [r2] ldr r4, =gScriptLastTalked - ldr r3, =gUnknown_02037350 + ldr r3, =gMapObjects lsls r2, r0, 3 adds r2, r0 lsls r2, 2 @@ -1960,12 +1960,12 @@ GetTrainerFlagFromScriptPointer: @ 80B16B8 thumb_func_start sub_80B16D8 sub_80B16D8: @ 80B16D8 push {r4,lr} - ldr r0, =gUnknown_03005DF0 + ldr r0, =gSelectedMapObject ldrb r0, [r0] lsls r4, r0, 3 adds r4, r0 lsls r4, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r4, r0 ldrb r0, [r4, 0x18] lsls r0, 28 @@ -1998,7 +1998,7 @@ check_trainer_flag: @ 80B1718 lsls r0, 24 cmp r0, 0 beq _080B1734 - ldr r0, =gUnknown_03005DF0 + ldr r0, =gSelectedMapObject ldrb r0, [r0] bl GetBattlePyramidTrainerFlag b _080B1752 @@ -2013,7 +2013,7 @@ _080B1734: bl FlagGet b _080B1752 _080B174A: - ldr r0, =gUnknown_03005DF0 + ldr r0, =gSelectedMapObject ldrb r0, [r0] bl GetTrainerHillTrainerFlag _080B1752: @@ -2341,7 +2341,7 @@ sub_80B1A14: @ 80B1A14 b _080B1AD8 .pool _080B1A44: - ldr r3, =gUnknown_02037350 + ldr r3, =gMapObjects ldr r2, =gUnknown_03006090 ldr r0, =gUnknown_02038BFC ldrb r1, [r0] @@ -2381,7 +2381,7 @@ _080B1A7C: b _080B1AD8 .pool _080B1AAC: - ldr r3, =gUnknown_02037350 + ldr r3, =gMapObjects ldr r2, =gUnknown_03006090 ldr r0, =gUnknown_02038BFC ldrb r1, [r0] diff --git a/asm/berry.s b/asm/berry.s deleted file mode 100644 index 54c4333d5..000000000 --- a/asm/berry.s +++ /dev/null @@ -1,1120 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_80E15B8 -sub_80E15B8: @ 80E15B8 - push {lr} - sub sp, 0x4 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r0, =0x000031f8 - adds r1, r0 - ldr r2, =0x0100001a - mov r0, sp - bl CpuSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E15B8 - - thumb_func_start sub_80E15E4 -sub_80E15E4: @ 80E15E4 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x000031f8 - adds r3, r0, r1 - movs r2, 0 -_080E15F2: - adds r0, r3, r2 - adds r1, r4, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x33 - bls _080E15F2 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E15E4 - - thumb_func_start sub_80E1610 -sub_80E1610: @ 80E1610 - push {lr} - adds r3, r0, 0 - movs r2, 0 - movs r1, 0 -_080E1618: - adds r0, r3, r1 - ldrb r0, [r0] - adds r2, r0 - adds r1, 0x1 - cmp r1, 0x2F - bls _080E1618 - adds r0, r2, 0 - pop {r1} - bx r1 - thumb_func_end sub_80E1610 - - thumb_func_start sub_80E162C -sub_80E162C: @ 80E162C - push {r4,lr} - ldr r4, =gSaveBlock1Ptr - ldr r1, [r4] - ldr r2, =0x0000320c - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080E1674 - ldr r2, =0x00003202 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080E1674 - ldr r2, =0x000031f8 - adds r0, r1, r2 - bl sub_80E1610 - ldr r1, [r4] - ldr r2, =0x00003228 - adds r1, r2 - ldr r1, [r1] - cmp r0, r1 - bne _080E1674 - movs r0, 0x1 - b _080E1676 - .pool -_080E1674: - movs r0, 0 -_080E1676: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80E162C - - thumb_func_start GetBerryInfo -@ struct berry_info *GetBerryInfo(u8 berryType) -GetBerryInfo: @ 80E167C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2B - bne _080E16A0 - bl sub_80E162C - cmp r0, 0 - beq _080E16A0 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x000031f8 - b _080E16B4 - .pool -_080E16A0: - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2A - bls _080E16AC - movs r4, 0x1 -_080E16AC: - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - ldr r1, =gBerries - 0x1c @ 1-based array -_080E16B4: - adds r0, r1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetBerryInfo - - thumb_func_start GetBerryTreeInfo -@ struct BerryTreeInfo *GetBerryTreeInfo(u8 berryTreeId) -GetBerryTreeInfo: @ 80E16C0 - lsls r0, 24 - ldr r1, =gSaveBlock1Ptr - lsrs r0, 21 - ldr r2, =0x0000169c - adds r0, r2 - ldr r1, [r1] - adds r1, r0 - adds r0, r1, 0 - bx lr - .pool - thumb_func_end GetBerryTreeInfo - - thumb_func_start FieldObjectInteractionWaterBerryTree -@ bool8 FieldObjectInteractionWaterBerryTree() -FieldObjectInteractionWaterBerryTree: @ 80E16DC - push {lr} - ldr r0, =gUnknown_03005DF0 - ldrb r0, [r0] - bl FieldObjectGetBerryTreeId - lsls r0, 24 - lsrs r0, 24 - bl GetBerryTreeInfo - adds r2, r0, 0 - ldrb r0, [r2, 0x1] - lsls r0, 25 - lsrs r0, 25 - cmp r0, 0x2 - beq _080E1718 - cmp r0, 0x2 - bgt _080E1708 - cmp r0, 0x1 - beq _080E1712 - b _080E172E - .pool -_080E1708: - cmp r0, 0x3 - beq _080E171E - cmp r0, 0x4 - beq _080E1724 - b _080E172E -_080E1712: - ldrb r0, [r2, 0x5] - movs r1, 0x10 - b _080E1728 -_080E1718: - ldrb r0, [r2, 0x5] - movs r1, 0x20 - b _080E1728 -_080E171E: - ldrb r0, [r2, 0x5] - movs r1, 0x40 - b _080E1728 -_080E1724: - ldrb r0, [r2, 0x5] - movs r1, 0x80 -_080E1728: - orrs r0, r1 - strb r0, [r2, 0x5] - b _080E1732 -_080E172E: - movs r0, 0 - b _080E1734 -_080E1732: - movs r0, 0x1 -_080E1734: - pop {r1} - bx r1 - thumb_func_end FieldObjectInteractionWaterBerryTree - - thumb_func_start IsPlayerFacingPlantedBerryTree -@ bool8 IsPlayerFacingPlantedBerryTree() -IsPlayerFacingPlantedBerryTree: @ 80E1738 - push {lr} - bl GetFieldObjectScriptPointerForComparison - ldr r1, =gUnknown_082742F9 - cmp r0, r1 - bne _080E1768 - ldr r0, =gUnknown_03005DF0 - ldrb r0, [r0] - bl FieldObjectGetBerryTreeId - lsls r0, 24 - lsrs r0, 24 - bl GetStageByBerryTreeId - lsls r0, 24 - cmp r0, 0 - bne _080E1768 - movs r0, 0x1 - b _080E176A - .pool -_080E1768: - movs r0, 0 -_080E176A: - pop {r1} - bx r1 - thumb_func_end IsPlayerFacingPlantedBerryTree - - thumb_func_start WaterBerryTree -@ bool8 WaterBerryTree() -WaterBerryTree: @ 80E1770 - push {lr} - bl GetFieldObjectScriptPointerForComparison - ldr r1, =gUnknown_082742F9 - cmp r0, r1 - bne _080E178C - bl FieldObjectInteractionWaterBerryTree - lsls r0, 24 - lsrs r0, 24 - b _080E178E - .pool -_080E178C: - movs r0, 0 -_080E178E: - pop {r1} - bx r1 - thumb_func_end WaterBerryTree - - thumb_func_start ClearBerryTrees -@ void ClearBerryTrees() -ClearBerryTrees: @ 80E1794 - push {r4-r6,lr} - movs r2, 0 - ldr r6, =gSaveBlock1Ptr - ldr r5, =0x0000169c - ldr r0, =gUnknown_0858ABD0 - ldr r3, [r0] - ldr r4, [r0, 0x4] -_080E17A2: - ldr r0, [r6] - lsls r1, r2, 3 - adds r0, r1 - adds r0, r5 - str r3, [r0] - str r4, [r0, 0x4] - adds r2, 0x1 - cmp r2, 0x7F - ble _080E17A2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ClearBerryTrees - - thumb_func_start BerryTreeGrow -@ bool8 BerryTreeGrow(struct BerryTreeInfo *berryTree) -BerryTreeGrow: @ 80E17C8 - push {r4,lr} - adds r4, r0, 0 - ldrb r1, [r4, 0x1] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080E17DA -_080E17D6: - movs r0, 0 - b _080E1866 -_080E17DA: - lsls r0, r1, 25 - lsrs r0, 25 - cmp r0, 0x5 - bhi _080E1864 - lsls r0, 2 - ldr r1, =_080E17F0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080E17F0: - .4byte _080E17D6 - .4byte _080E1810 - .4byte _080E1810 - .4byte _080E1810 - .4byte _080E1808 - .4byte _080E1828 -_080E1808: - adds r0, r4, 0 - bl CalcBerryYield - strb r0, [r4, 0x4] -_080E1810: - ldrb r2, [r4, 0x1] - lsls r1, r2, 25 - lsrs r1, 25 - adds r1, 0x1 - movs r0, 0x7F - ands r1, r0 - movs r0, 0x80 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x1] - b _080E1864 -_080E1828: - ldrb r0, [r4, 0x5] - movs r1, 0x11 - negs r1, r1 - ands r1, r0 - movs r0, 0x21 - negs r0, r0 - ands r1, r0 - subs r0, 0x20 - ands r1, r0 - movs r0, 0x7F - ands r1, r0 - movs r0, 0 - strb r0, [r4, 0x4] - ldrb r2, [r4, 0x1] - subs r0, 0x80 - ands r0, r2 - movs r2, 0x2 - orrs r0, r2 - strb r0, [r4, 0x1] - adds r1, 0x1 - movs r0, 0xF - ands r1, r0 - strb r1, [r4, 0x5] - cmp r1, 0xA - bne _080E1864 - ldr r0, =gUnknown_0858ABD0 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r4] - str r1, [r4, 0x4] -_080E1864: - movs r0, 0x1 -_080E1866: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end BerryTreeGrow - - thumb_func_start BerryTreeTimeUpdate -@ void BerryTreeTimeUpdate(s32 deltaSeconds) -BerryTreeTimeUpdate: @ 80E1870 - push {r4-r7,lr} - adds r6, r0, 0 - movs r2, 0 -_080E1876: - ldr r1, =gSaveBlock1Ptr - lsls r0, r2, 3 - ldr r3, =0x0000169c - adds r0, r3 - ldr r1, [r1] - adds r4, r1, r0 - ldrb r0, [r4] - adds r7, r2, 0x1 - cmp r0, 0 - beq _080E1910 - ldrb r1, [r4, 0x1] - movs r0, 0x7F - ands r0, r1 - cmp r0, 0 - beq _080E1910 - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080E1910 - ldrb r0, [r4] - bl GetStageDurationByBerryType - lsls r0, 16 - lsrs r0, 16 - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 3 - subs r1, r0 - cmp r6, r1 - blt _080E18CC - ldr r0, =gUnknown_0858ABD0 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r4] - str r1, [r4, 0x4] - b _080E1910 - .pool -_080E18CC: - adds r5, r6, 0 - cmp r5, 0 - beq _080E1910 - ldrh r1, [r4, 0x2] - cmp r1, r5 - ble _080E18DC - subs r0, r1, r5 - b _080E190E -_080E18DC: - subs r5, r1 - ldrb r0, [r4] - bl GetStageDurationByBerryType - strh r0, [r4, 0x2] - adds r0, r4, 0 - bl BerryTreeGrow - cmp r0, 0 - beq _080E1910 - ldrb r1, [r4, 0x1] - movs r0, 0x7F - ands r0, r1 - cmp r0, 0x5 - bne _080E1900 - ldrh r0, [r4, 0x2] - lsls r0, 2 - strh r0, [r4, 0x2] -_080E1900: - cmp r5, 0 - beq _080E1910 - ldrh r0, [r4, 0x2] - adds r1, r0, 0 - cmp r0, r5 - ble _080E18DC - subs r0, r5 -_080E190E: - strh r0, [r4, 0x2] -_080E1910: - adds r2, r7, 0 - cmp r2, 0x7F - ble _080E1876 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end BerryTreeTimeUpdate - - thumb_func_start PlantBerryTree -@ void PlantBerryTree(u8 berryTreeId, u8 berryType, u8 stage, u8 a4) -PlantBerryTree: @ 80E191C - push {r4-r7,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r3, 24 - lsrs r7, r3, 24 - bl GetBerryTreeInfo - adds r6, r0, 0 - ldr r0, =gUnknown_0858ABD0 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r6] - str r1, [r6, 0x4] - strb r4, [r6] - adds r0, r4, 0 - bl GetStageDurationByBerryType - strh r0, [r6, 0x2] - movs r1, 0x7F - ands r1, r5 - ldrb r2, [r6, 0x1] - movs r0, 0x80 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r6, 0x1] - cmp r5, 0x5 - bne _080E196E - adds r0, r6, 0 - bl CalcBerryYield - strb r0, [r6, 0x4] - ldrh r0, [r6, 0x2] - lsls r0, 2 - strh r0, [r6, 0x2] -_080E196E: - cmp r7, 0 - bne _080E197A - ldrb r0, [r6, 0x1] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r6, 0x1] -_080E197A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end PlantBerryTree - - thumb_func_start RemoveBerryTree -@ void RemoveBerryTree(u8 berryTreeId) -RemoveBerryTree: @ 80E1984 - lsls r0, 24 - ldr r1, =gSaveBlock1Ptr - ldr r2, [r1] - lsrs r0, 21 - adds r2, r0 - ldr r0, =0x0000169c - adds r2, r0 - ldr r0, =gUnknown_0858ABD0 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r2] - str r1, [r2, 0x4] - bx lr - .pool - thumb_func_end RemoveBerryTree - - thumb_func_start GetBerryTypeByBerryTreeId -@ u8 GetBerryTypeByBerryTreeId(u8 berryTreeId) -GetBerryTypeByBerryTreeId: @ 80E19AC - lsls r0, 24 - ldr r1, =gSaveBlock1Ptr - ldr r1, [r1] - lsrs r0, 21 - adds r1, r0 - ldr r0, =0x0000169c - adds r1, r0 - ldrb r0, [r1] - bx lr - .pool - thumb_func_end GetBerryTypeByBerryTreeId - - thumb_func_start GetStageByBerryTreeId -@ u8 GetStageByBerryTreeId(u8 berryTreeId) -GetStageByBerryTreeId: @ 80E19C8 - lsls r0, 24 - ldr r1, =gSaveBlock1Ptr - ldr r1, [r1] - lsrs r0, 21 - adds r1, r0 - ldr r0, =0x0000169d - adds r1, r0 - ldrb r0, [r1] - lsls r0, 25 - lsrs r0, 25 - bx lr - .pool - thumb_func_end GetStageByBerryTreeId - - thumb_func_start ItemIdToBerryType -@ u8 ItemIdToBerryType(u16 itemId) -ItemIdToBerryType: @ 80E19E8 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - ldr r2, =0xff7b0000 - adds r0, r2 - lsrs r0, 16 - cmp r0, 0x2A - bhi _080E1A08 - adds r0, r1, 0 - adds r0, 0x7C - lsls r0, 24 - lsrs r0, 24 - b _080E1A0A - .pool -_080E1A08: - movs r0, 0x1 -_080E1A0A: - pop {r1} - bx r1 - thumb_func_end ItemIdToBerryType - - thumb_func_start BerryTypeToItemId -@ u16 BerryTypeToItemId(u16 berryType) -BerryTypeToItemId: @ 80E1A10 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - ldr r2, =0xffff0000 - adds r0, r2 - lsrs r0, 16 - cmp r0, 0x2A - bhi _080E1A30 - adds r0, r1, 0 - adds r0, 0x84 - lsls r0, 16 - lsrs r0, 16 - b _080E1A32 - .pool -_080E1A30: - movs r0, 0x85 -_080E1A32: - pop {r1} - bx r1 - thumb_func_end BerryTypeToItemId - - thumb_func_start GetBerryNameByBerryType -@ void GetBerryNameByBerryType(u8 berryType, u8 *dest) -GetBerryNameByBerryType: @ 80E1A38 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - bl GetBerryInfo - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0x6 - bl memcpy - movs r0, 0xFF - strb r0, [r4, 0x6] - pop {r4} - pop {r0} - bx r0 - thumb_func_end GetBerryNameByBerryType - - thumb_func_start GetBerryCountStringByBerryType -@ void GetBerryCountStringByBerryType(u8 berryType, u8 *dest, u32 berryCount) -GetBerryCountStringByBerryType: @ 80E1A58 - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r0, 24 - lsrs r0, 24 - bl GetBerryInfo - adds r1, r0, 0 - adds r0, r4, 0 - adds r2, r5, 0 - bl GetBerryCountString - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end GetBerryCountStringByBerryType - - thumb_func_start ResetBerryTreeSparkleFlag -@ void ResetBerryTreeSparkleFlag(u8 berryTreeId) -ResetBerryTreeSparkleFlag: @ 80E1A78 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl GetBerryTreeInfo - ldrb r2, [r0, 0x1] - movs r1, 0x7F - ands r1, r2 - strb r1, [r0, 0x1] - pop {r0} - bx r0 - thumb_func_end ResetBerryTreeSparkleFlag - - thumb_func_start BerryTreeGetNumStagesWatered -@ u8 BerryTreeGetNumStagesWatered(struct BerryTreeInfo *berryTree) -BerryTreeGetNumStagesWatered: @ 80E1A90 - push {lr} - ldrb r2, [r0, 0x5] - movs r0, 0x10 - ands r0, r2 - lsls r0, 24 - lsrs r0, 24 - negs r0, r0 - lsrs r1, r0, 31 - movs r0, 0x20 - ands r0, r2 - cmp r0, 0 - beq _080E1AAA - adds r1, 0x1 -_080E1AAA: - movs r0, 0x40 - ands r0, r2 - cmp r0, 0 - beq _080E1AB8 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 -_080E1AB8: - movs r0, 0x80 - ands r0, r2 - cmp r0, 0 - beq _080E1AC6 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 -_080E1AC6: - adds r0, r1, 0 - pop {r1} - bx r1 - thumb_func_end BerryTreeGetNumStagesWatered - - thumb_func_start GetNumStagesWateredByBerryTreeId -@ u8 GetNumStagesWateredByBerryTreeId(u8 berryTreeId) -GetNumStagesWateredByBerryTreeId: @ 80E1ACC - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl GetBerryTreeInfo - bl BerryTreeGetNumStagesWatered - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end GetNumStagesWateredByBerryTreeId - - thumb_func_start CalcBerryYieldInternal -@ u8 CalcBerryYieldInternal(u16 max, u16 min, u8 numStagesWatered) -CalcBerryYieldInternal: @ 80E1AE4 - push {r4-r6,lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - lsrs r6, r1, 16 - lsls r2, 24 - lsrs r2, 24 - cmp r2, 0 - bne _080E1AFA - lsls r0, r6, 24 - b _080E1B2E -_080E1AFA: - subs r1, r0, r6 - subs r0, r2, 0x1 - adds r5, r1, 0 - muls r5, r0 - adds r4, r1, 0 - muls r4, r2 - bl Random - lsls r0, 16 - lsrs r0, 16 - subs r4, r5 - adds r4, 0x1 - adds r1, r4, 0 - bl __umodsi3 - adds r5, r0 - movs r0, 0x3 - ands r0, r5 - cmp r0, 0x1 - bls _080E1B28 - lsrs r0, r5, 2 - adds r0, 0x1 - b _080E1B2A -_080E1B28: - lsrs r0, r5, 2 -_080E1B2A: - adds r0, r6 - lsls r0, 24 -_080E1B2E: - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end CalcBerryYieldInternal - - thumb_func_start CalcBerryYield -@ u8 CalcBerryYield(struct BerryTreeInfo *berryTree) -CalcBerryYield: @ 80E1B38 - push {r4-r6,lr} - adds r4, r0, 0 - ldrb r0, [r4] - bl GetBerryInfo - ldrb r6, [r0, 0xB] - ldrb r5, [r0, 0xA] - adds r0, r4, 0 - bl BerryTreeGetNumStagesWatered - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r5, 0 - adds r1, r6, 0 - bl CalcBerryYieldInternal - lsls r0, 24 - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end CalcBerryYield - - thumb_func_start GetBerryCountByBerryTreeId -@ u8 GetBerryCountByBerryTreeId(u8 berryTreeId) -GetBerryCountByBerryTreeId: @ 80E1B64 - lsls r0, 24 - ldr r1, =gSaveBlock1Ptr - ldr r1, [r1] - lsrs r0, 21 - adds r1, r0 - movs r0, 0xB5 - lsls r0, 5 - adds r1, r0 - ldrb r0, [r1] - bx lr - .pool - thumb_func_end GetBerryCountByBerryTreeId - - thumb_func_start GetStageDurationByBerryType -@ u16 GetStageDurationByBerryType(u8 berryType) -GetStageDurationByBerryType: @ 80E1B7C - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl GetBerryInfo - ldrb r1, [r0, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 18 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end GetStageDurationByBerryType - - thumb_func_start FieldObjectInteractionGetBerryTreeData -@ void FieldObjectInteractionGetBerryTreeData() -FieldObjectInteractionGetBerryTreeData: @ 80E1B94 - push {r4-r6,lr} - ldr r0, =gUnknown_03005DF0 - ldrb r0, [r0] - bl FieldObjectGetBerryTreeId - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - bl GetBerryTypeByBerryTreeId - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r5, 0 - bl ResetBerryTreeSparkleFlag - ldr r0, =gScriptLastTalked - ldrb r0, [r0] - ldr r1, =gSaveBlock1Ptr - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl sub_8092E9C - lsls r0, 24 - cmp r0, 0 - beq _080E1BE0 - ldr r1, =gSpecialVar_0x8004 - movs r0, 0xFF - strh r0, [r1] - b _080E1BEE - .pool -_080E1BE0: - ldr r4, =gSpecialVar_0x8004 - adds r0, r5, 0 - bl GetStageByBerryTreeId - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] -_080E1BEE: - ldr r4, =gSpecialVar_0x8005 - adds r0, r5, 0 - bl GetNumStagesWateredByBerryTreeId - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - ldr r4, =gSpecialVar_0x8006 - adds r0, r5, 0 - bl GetBerryCountByBerryTreeId - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - ldr r1, =gStringVar1 - ldrh r2, [r4] - adds r0, r6, 0 - bl GetBerryCountStringByBerryType - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectInteractionGetBerryTreeData - - thumb_func_start FieldObjectInteractionGetBerryName -@ void FieldObjectInteractionGetBerryName() -FieldObjectInteractionGetBerryName: @ 80E1C2C - push {lr} - ldr r0, =gUnknown_03005DF0 - ldrb r0, [r0] - bl FieldObjectGetBerryTreeId - lsls r0, 24 - lsrs r0, 24 - bl GetBerryTypeByBerryTreeId - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gStringVar1 - bl GetBerryNameByBerryType - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectInteractionGetBerryName - - thumb_func_start FieldObjectInteractionGetBerryCountString -@ void FieldObjectInteractionGetBerryCountString() -FieldObjectInteractionGetBerryCountString: @ 80E1C54 - push {r4,r5,lr} - ldr r0, =gUnknown_03005DF0 - ldrb r0, [r0] - bl FieldObjectGetBerryTreeId - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl GetBerryTypeByBerryTreeId - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r4, 0 - bl GetBerryCountByBerryTreeId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetBerryCountStringByBerryType - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectInteractionGetBerryCountString - - thumb_func_start ChooseBerry -@ void ChooseBerry() -ChooseBerry: @ 80E1C94 - push {lr} - ldr r0, =CB2_ChooseBerry - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end ChooseBerry - - thumb_func_start FieldObjectInteractionPlantBerryTree -@ void FieldObjectInteractionPlantBerryTree() -FieldObjectInteractionPlantBerryTree: @ 80E1CA4 - push {r4,lr} - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - bl ItemIdToBerryType - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_03005DF0 - ldrb r0, [r0] - bl FieldObjectGetBerryTreeId - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - movs r2, 0x1 - movs r3, 0x1 - bl PlantBerryTree - bl FieldObjectInteractionGetBerryTreeData - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectInteractionPlantBerryTree - - thumb_func_start FieldObjectInteractionPickBerryTree -@ void FieldObjectInteractionPickBerryTree() -FieldObjectInteractionPickBerryTree: @ 80E1CDC - push {r4-r6,lr} - ldr r0, =gUnknown_03005DF0 - ldrb r0, [r0] - bl FieldObjectGetBerryTreeId - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r5, 0 - bl GetBerryTypeByBerryTreeId - lsls r0, 24 - lsrs r0, 24 - ldr r6, =gSpecialVar_0x8004 - bl BerryTypeToItemId - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl GetBerryCountByBerryTreeId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl AddBagItem - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectInteractionPickBerryTree - - thumb_func_start FieldObjectInteractionRemoveBerryTree -@ void FieldObjectInteractionRemoveBerryTree() -FieldObjectInteractionRemoveBerryTree: @ 80E1D28 - push {lr} - ldr r0, =gUnknown_03005DF0 - ldrb r0, [r0] - bl FieldObjectGetBerryTreeId - lsls r0, 24 - lsrs r0, 24 - bl RemoveBerryTree - ldr r0, =gScriptLastTalked - ldrb r0, [r0] - ldr r1, =gSaveBlock1Ptr - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl sub_8092EF0 - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectInteractionRemoveBerryTree - - thumb_func_start PlayerHasBerries -@ bool8 PlayerHasBerries() -PlayerHasBerries: @ 80E1D5C - push {lr} - movs r0, 0x4 - bl IsBagPocketNonEmpty - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end PlayerHasBerries - - thumb_func_start ResetBerryTreeSparkleFlags -@ void ResetBerryTreeSparkleFlags() -ResetBerryTreeSparkleFlags: @ 80E1D6C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl GetCameraCoords - mov r0, sp - ldrh r2, [r0] - ldrh r1, [r4] - adds r1, 0x3 - adds r3, r2, 0 - adds r3, 0xE - lsls r1, 16 - movs r5, 0x80 - lsls r5, 12 - adds r0, r1, r5 - lsrs r0, 16 - mov r10, r0 - mov r5, sp - lsls r2, 16 - asrs r2, 16 - mov r9, r2 - ldr r4, =gUnknown_02037350 - lsls r3, 16 - asrs r3, 16 - mov r8, r3 - asrs r7, r1, 16 - movs r6, 0xF -_080E1DB0: - ldrb r0, [r4] - lsls r0, 31 - cmp r0, 0 - beq _080E1DEC - ldrb r0, [r4, 0x6] - cmp r0, 0xC - bne _080E1DEC - ldrh r0, [r4, 0x10] - strh r0, [r5] - ldrh r0, [r4, 0x12] - mov r1, sp - strh r0, [r1, 0x2] - movs r2, 0 - ldrsh r1, [r5, r2] - cmp r9, r1 - bgt _080E1DEC - cmp r1, r8 - bgt _080E1DEC - lsls r0, 16 - asrs r1, r0, 16 - cmp r7, r1 - bgt _080E1DEC - mov r2, r10 - lsls r0, r2, 16 - asrs r0, 16 - cmp r1, r0 - bgt _080E1DEC - ldrb r0, [r4, 0x1D] - bl ResetBerryTreeSparkleFlag -_080E1DEC: - adds r4, 0x24 - subs r6, 0x1 - cmp r6, 0 - bge _080E1DB0 - 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 ResetBerryTreeSparkleFlags - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/berry_blender.s b/asm/berry_blender.s index cc859f052..fb410e9f3 100644 --- a/asm/berry_blender.s +++ b/asm/berry_blender.s @@ -1190,7 +1190,7 @@ _080801F8: movs r5, 0xAC lsls r5, 1 adds r0, r5 - ldr r1, =gUnknown_0203CE7C + ldr r1, =gScriptItemId ldrh r1, [r1] bl sub_807FE14 ldr r0, =gUnknown_020228C4 @@ -2043,7 +2043,7 @@ _080808F8: _08080950: bl sub_800B4C0 bl sub_8080588 - ldr r4, =gUnknown_0203CE7C + ldr r4, =gScriptItemId ldrh r1, [r4] movs r0, 0 bl sub_8082FDC @@ -7619,7 +7619,7 @@ _080837EA: movs r1, 0x6 bl CreateTask bl sub_80EECEC - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] movs r1, 0x1 bl RemoveBagItem diff --git a/asm/berry_tag_screen.s b/asm/berry_tag_screen.s index 4d5022189..4d7644723 100644 --- a/asm/berry_tag_screen.s +++ b/asm/berry_tag_screen.s @@ -12,7 +12,7 @@ sub_8177C14: @ 8177C14 ldr r0, =0x0000180c bl AllocZeroed str r0, [r4] - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] bl ItemIdToBerryType ldr r1, [r4] diff --git a/asm/bike.s b/asm/bike.s index bcb5177be..22d52c0fa 100644 --- a/asm/bike.s +++ b/asm/bike.s @@ -131,7 +131,7 @@ sub_8119238: @ 8119238 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 ldrb r1, [r4, 0x1E] adds r0, r5, 0 @@ -166,7 +166,7 @@ sub_8119280: @ 8119280 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 ldrb r1, [r4, 0x1E] adds r0, r5, 0 @@ -525,7 +525,7 @@ CheckMovementInputAcroBikeStandingWheelie: @ 8119540 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r1, r0, r1 movs r0, 0 strb r0, [r5, 0x2] @@ -613,7 +613,7 @@ CheckMovementInputAcroBikeBunnyHop: @ 81195E0 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r7, r0, r1 movs r0, 0x2 mov r1, r8 @@ -698,7 +698,7 @@ CheckMovementInputAcroBikeMovingWheelie: @ 8119688 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r7, r0, r1 movs r0, 0x2 mov r9, r0 @@ -802,7 +802,7 @@ CheckMovementInputAcroBikeUnknownMode5: @ 8119764 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 ldrb r2, [r0, 0x1] movs r1, 0x3 @@ -868,7 +868,7 @@ sub_81197F4: @ 81197F4 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r5, r0, r1 ldrb r1, [r5, 0x1E] adds r0, r4, 0 @@ -898,7 +898,7 @@ sub_8119830: @ 8119830 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 ldrb r1, [r4, 0x1E] adds r0, r5, 0 @@ -966,7 +966,7 @@ sub_81198C0: @ 81198C0 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r5, r0, r1 ldrb r1, [r5, 0x1E] adds r0, r4, 0 @@ -995,7 +995,7 @@ sub_81198FC: @ 81198FC lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r5, r0, r1 ldrb r1, [r5, 0x1E] adds r0, r4, 0 @@ -1024,7 +1024,7 @@ sub_8119938: @ 8119938 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r5, r0, r1 ldrb r1, [r5, 0x1E] adds r0, r4, 0 @@ -1053,7 +1053,7 @@ sub_8119974: @ 8119974 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r5, r0, r1 ldrb r1, [r5, 0x1E] adds r0, r4, 0 @@ -1082,7 +1082,7 @@ sub_81199B0: @ 81199B0 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r5, r0, r1 ldrb r1, [r5, 0x1E] adds r0, r4, 0 @@ -1161,7 +1161,7 @@ _08119A58: lsls r4, r0, 3 adds r4, r0 lsls r4, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r4, r0 movs r0, 0x22 bl PlaySE @@ -1203,7 +1203,7 @@ sub_8119AA4: @ 8119AA4 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r5, r0, r1 ldrb r1, [r5, 0x1E] adds r0, r4, 0 @@ -1272,7 +1272,7 @@ sub_8119B34: @ 8119B34 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r5, r0, r1 ldrb r1, [r5, 0x1E] adds r0, r4, 0 @@ -1341,7 +1341,7 @@ sub_8119BC4: @ 8119BC4 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r5, r0, r1 ldrb r1, [r5, 0x1E] adds r0, r4, 0 @@ -1686,7 +1686,7 @@ sub_8119E38: @ 8119E38 lsls r4, r0, 3 adds r4, r0 lsls r4, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r4, r0 ldrh r1, [r4, 0x10] add r0, sp, 0x4 @@ -1965,7 +1965,7 @@ player_should_look_direction_be_enforced_upon_movement: @ 811A044 lsls r0, 24 cmp r0, 0 beq _0811A078 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldr r0, =gUnknown_02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 diff --git a/asm/field_control_avatar.s b/asm/field_control_avatar.s index f3321f27a..0e83f4b80 100644 --- a/asm/field_control_avatar.s +++ b/asm/field_control_avatar.s @@ -187,7 +187,7 @@ sub_809C014: @ 809C014 ldr r0, =gScriptLastTalked movs r1, 0 strh r1, [r0] - ldr r0, =gUnknown_03005DF0 + ldr r0, =gSelectedMapObject strb r1, [r0] bl player_get_direction_lower_nybble lsls r0, 24 @@ -552,7 +552,7 @@ _0809C30E: lsrs r3, r0, 24 cmp r3, 0x10 beq _0809C32E - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects lsls r2, r3, 3 adds r0, r2, r3 lsls r0, 2 @@ -580,7 +580,7 @@ _0809C34C: adds r4, 0x1 cmp r4, 0x3 ble _0809C340 - ldr r0, =gUnknown_03005DF0 + ldr r0, =gSelectedMapObject strb r3, [r0] ldr r1, =gScriptLastTalked adds r0, r2, r3 @@ -615,7 +615,7 @@ TryGetMapObjectScript: @ 809C384 lsrs r4, r0, 24 cmp r4, 0x10 beq _0809C3B4 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects lsls r2, r4, 3 adds r0, r2, r4 lsls r0, 2 @@ -652,7 +652,7 @@ _0809C3B4: lsrs r4, r0, 24 cmp r4, 0x10 beq _0809C400 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects lsls r2, r4, 3 adds r0, r2, r4 lsls r0, 2 @@ -666,7 +666,7 @@ _0809C400: b _0809C44E .pool _0809C40C: - ldr r0, =gUnknown_03005DF0 + ldr r0, =gSelectedMapObject strb r4, [r0] ldr r1, =gScriptLastTalked adds r0, r2, r4 diff --git a/asm/field_effect.s b/asm/field_effect.s index c2f98a3e3..c40098993 100644 --- a/asm/field_effect.s +++ b/asm/field_effect.s @@ -2032,7 +2032,7 @@ mapldr_08084390: @ 80B6AA4 ldr r0, =c3_080843F8 movs r1, 0 bl CreateTask - ldr r4, =gUnknown_02037350 + ldr r4, =gMapObjects ldr r3, =gUnknown_02037590 ldrb r1, [r3, 0x5] lsls r0, r1, 3 @@ -2168,7 +2168,7 @@ sub_80B6BCC: @ 80B6BCC lsls r5, r0, 3 adds r5, r0 lsls r5, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects mov r8, r0 add r5, r8 ldrb r0, [r6, 0x4] @@ -2282,7 +2282,7 @@ sub_80B6C90: @ 80B6C90 movs r0, 0x1 strh r0, [r5, 0xA] strh r1, [r5, 0xC] - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldrb r0, [r6, 0x5] lsls r1, r0, 3 adds r1, r0 @@ -2314,7 +2314,7 @@ sub_80B6D04: @ 80B6D04 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r6, r0, r1 ldrb r1, [r2, 0x4] lsls r0, r1, 4 @@ -2556,7 +2556,7 @@ sub_80B6EE0: @ 80B6EE0 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 adds r0, r4, 0 bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive @@ -2833,7 +2833,7 @@ sub_80B7114: @ 80B7114 lsls r4, r0, 3 adds r4, r0 lsls r4, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r4, r0 movs r0, 0x4 bl GetFaceDirectionAnimId @@ -3068,7 +3068,7 @@ sub_80B72F4: @ 80B72F4 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 adds r0, r4, 0 bl FieldObjectClearAnimIfSpecialAnimFinished @@ -3143,7 +3143,7 @@ _080B7396: lsls r1, r0, 3 adds r1, r0 lsls r1, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r1, r0 ldr r2, [r2] adds r0, r4, 0 @@ -3392,7 +3392,7 @@ dive_3_unknown: @ 80B7580 lsls r0, 24 cmp r0, 0 bne _080B75C4 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldr r0, =gUnknown_02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 @@ -3451,7 +3451,7 @@ _080B7604: lsls r1, r0, 3 adds r1, r0 lsls r1, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r1, r0 ldrb r0, [r5, 0x4] lsls r2, r0, 4 @@ -3781,7 +3781,7 @@ _080B78A4: lsls r1, r0, 3 adds r1, r0 lsls r1, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r1, r0 ldrb r0, [r5, 0x4] lsls r2, r0, 4 @@ -4030,7 +4030,7 @@ _080B7AA0: lsls r1, r0, 3 adds r1, r0 lsls r1, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r1, r0 ldrb r0, [r5, 0x4] lsls r2, r0, 4 @@ -4364,7 +4364,7 @@ _080B7D60: lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r5, r0, r1 adds r0, r5, 0 bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive @@ -4465,7 +4465,7 @@ mapldr_080859D4: @ 80B7E48 ldr r1, =gUnknown_03005DAC movs r0, 0 str r0, [r1] - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldr r0, =gUnknown_02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 @@ -4542,7 +4542,7 @@ sub_80B7EE8: @ 80B7EE8 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r6, r0, r1 ldrh r1, [r5, 0xA] movs r2, 0xA @@ -4700,7 +4700,7 @@ sub_80B8034: @ 80B8034 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r5, r0, r1 ldrh r1, [r4, 0xA] movs r2, 0xA @@ -4770,7 +4770,7 @@ sub_80B80C4: @ 80B80C4 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r3, r0, r1 ldrb r1, [r2, 0x4] lsls r0, r1, 4 @@ -4910,7 +4910,7 @@ mapldr_08085D88: @ 80B8200 ldr r1, =gUnknown_03005DAC movs r0, 0 str r0, [r1] - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldr r0, =gUnknown_02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 @@ -4983,7 +4983,7 @@ sub_80B8280: @ 80B8280 adds r0, r1 negs r0, r0 strh r0, [r2, 0x26] - ldr r3, =gUnknown_02037350 + ldr r3, =gMapObjects ldrb r0, [r5, 0x5] lsls r1, r0, 3 adds r1, r0 @@ -5032,7 +5032,7 @@ sub_80B830C: @ 80B830C lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r6, r0, r1 ldrb r1, [r2, 0x4] lsls r0, r1, 4 @@ -5161,7 +5161,7 @@ sub_80B8410: @ 80B8410 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r5, r0, r1 ldrh r0, [r4, 0xA] subs r0, 0x1 @@ -6348,7 +6348,7 @@ sub_80B8DB4: @ 80B8DB4 adds r0, r6, 0 mov r1, r8 bl PlayerGetDestCoords - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldrb r1, [r5, 0x5] lsls r0, r1, 3 adds r0, r1 @@ -6379,7 +6379,7 @@ sub_80B8E14: @ 80B8E14 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 adds r0, r4, 0 bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive @@ -6415,7 +6415,7 @@ sub_80B8E60: @ 80B8E60 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 bl FieldObjectCheckIfSpecialAnimFinishedOrInactive lsls r0, 24 @@ -6454,7 +6454,7 @@ sub_80B8EA8: @ 80B8EA8 lsls r4, r0, 3 adds r4, r0 lsls r4, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r4, r0 movs r0, 0x3 bl GetPlayerAvatarGraphicsIdByStateId @@ -6503,7 +6503,7 @@ sub_80B8F24: @ 80B8F24 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 adds r0, r4, 0 bl FieldObjectClearAnimIfSpecialAnimFinished @@ -6834,7 +6834,7 @@ sub_80B9204: @ 80B9204 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 adds r0, r4, 0 bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive @@ -6875,7 +6875,7 @@ sub_80B925C: @ 80B925C lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 @@ -6911,7 +6911,7 @@ sub_80B92A0: @ 80B92A0 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r5, r0, r1 ldrh r1, [r4, 0x26] movs r0, 0x8 @@ -6960,7 +6960,7 @@ sub_80B92F8: @ 80B92F8 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 movs r1, 0x2 bl FieldObjectSetSpecialAnim @@ -6980,7 +6980,7 @@ sub_80B933C: @ 80B933C lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r2, r0, r1 ldrh r1, [r4, 0xC] movs r3, 0xC @@ -7028,7 +7028,7 @@ sub_80B9390: @ 80B9390 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 movs r0, 0x3 bl GetPlayerAvatarGraphicsIdByStateId @@ -7092,7 +7092,7 @@ sub_80B9418: @ 80B9418 lsls r4, r0, 3 adds r4, r0 lsls r4, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r4, r0 adds r0, r4, 0 bl FieldObjectClearAnimIfSpecialAnimActive @@ -7587,7 +7587,7 @@ sub_80B9804: @ 80B9804 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 adds r0, r4, 0 bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive @@ -7678,7 +7678,7 @@ _080B98D0: lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 ldrb r0, [r0, 0x4] lsls r4, r0, 4 @@ -7765,7 +7765,7 @@ sub_80B9978: @ 80B9978 lsls r5, r0, 3 adds r5, r0 lsls r5, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r5, r0 ldrb r0, [r5, 0x4] lsls r4, r0, 4 @@ -7815,7 +7815,7 @@ sub_80B99F0: @ 80B99F0 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 @@ -7877,7 +7877,7 @@ sub_80B9A60: @ 80B9A60 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 movs r7, 0 ldrh r1, [r5, 0x26] @@ -8119,7 +8119,7 @@ sub_80B9C54: @ 80B9C54 asrs r0, 16 cmp r0, 0x78 ble _080B9CC2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects movs r1, 0x4 ldrsh r0, [r7, r1] lsls r1, r0, 3 @@ -8357,7 +8357,7 @@ sub_80B9E28: @ 80B9E28 lsls r4, r0, 3 adds r4, r0 lsls r4, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r4, r0 movs r0, 0x10 ldrsh r5, [r4, r0] @@ -8507,7 +8507,7 @@ _080B9F7C: lsls r4, r0, 3 adds r4, r0 lsls r4, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r4, r0 ldrh r0, [r5, 0x4] strh r0, [r6, 0x20] diff --git a/asm/field_effect_helpers.s b/asm/field_effect_helpers.s index fc2a8682a..69c67672c 100644 --- a/asm/field_effect_helpers.s +++ b/asm/field_effect_helpers.s @@ -248,7 +248,7 @@ objc_reflection_maybe: @ 81540A8 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r7, r0, r1 ldrb r1, [r7, 0x4] lsls r0, r1, 4 @@ -581,7 +581,7 @@ oei_shadow: @ 8154340 bl GetFieldObjectIdByLocalIdAndMap lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects lsls r1, r0, 3 adds r1, r0 lsls r1, 2 @@ -673,7 +673,7 @@ _08154412: lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 ldrb r0, [r4, 0x4] lsls r1, r0, 4 @@ -909,7 +909,7 @@ _08154604: lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r2, r0, r1 ldr r0, [r2, 0x10] ldr r1, [r5, 0x30] @@ -1248,7 +1248,7 @@ _081548B4: lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r2, r0, r1 ldr r0, [r2, 0x10] ldr r1, [r5, 0x30] @@ -1346,7 +1346,7 @@ sub_815496C: @ 815496C lsls r1, r0, 3 adds r1, r0 lsls r1, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r5, r1, r0 ldr r0, =gFieldEffectObjectTemplatePointers ldr r0, [r0, 0x78] @@ -1432,7 +1432,7 @@ sub_8154A10: @ 8154A10 lsls r0, 24 cmp r0, 0 bne _08154A4E - ldr r5, =gUnknown_02037350 + ldr r5, =gMapObjects mov r0, sp ldrb r1, [r0] lsls r0, r1, 3 @@ -1787,7 +1787,7 @@ sub_8154CEC: @ 8154CEC lsls r1, r0, 3 adds r1, r0 lsls r1, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r5, r1, r0 ldr r0, =gFieldEffectObjectTemplatePointers ldr r0, [r0, 0x34] @@ -1881,7 +1881,7 @@ _08154DC0: b _08154E0A _08154DCA: ldr r3, =gSprites - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects mov r0, sp ldrb r1, [r0] lsls r0, r1, 3 @@ -2040,7 +2040,7 @@ sub_8154EFC: @ 8154EFC lsls r1, r0, 3 adds r1, r0 lsls r1, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r6, r1, r0 ldr r0, =gFieldEffectObjectTemplatePointers ldr r0, [r0, 0x34] @@ -2127,7 +2127,7 @@ sub_8154FB4: @ 8154FB4 lsls r0, 24 cmp r0, 0 bne _08154FEE - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects mov r0, sp ldrb r1, [r0] lsls r0, r1, 3 @@ -2248,7 +2248,7 @@ sub_81550B4: @ 81550B4 lsls r1, r0, 3 adds r1, r0 lsls r1, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r5, r1, r0 ldr r0, =gFieldEffectObjectTemplatePointers ldr r0, [r0, 0x7C] @@ -2332,7 +2332,7 @@ sub_8155158: @ 8155158 lsls r0, 24 cmp r0, 0 bne _08155192 - ldr r5, =gUnknown_02037350 + ldr r5, =gMapObjects mov r0, sp ldrb r1, [r0] lsls r0, r1, 3 @@ -2765,7 +2765,7 @@ sub_81554AC: @ 81554AC movs r2, 0x32 ldrsh r1, [r4, r2] bl CurrentMapDrawMetatileAt - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldr r0, =gUnknown_02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 @@ -2972,7 +2972,7 @@ sub_8155658: @ 8155658 lsls r4, r0, 3 adds r4, r0 lsls r4, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r4, r0 ldrb r0, [r4, 0x4] lsls r5, r0, 4 @@ -3325,7 +3325,7 @@ sub_8155900: @ 8155900 lsls r1, r0, 3 adds r1, r0 lsls r1, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r6, r1, r0 ldr r0, =gFieldEffectObjectTemplatePointers ldr r0, [r0, 0x74] @@ -3419,7 +3419,7 @@ sub_81559BC: @ 81559BC lsls r0, 24 cmp r0, 0 bne _081559F6 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects mov r0, sp ldrb r1, [r0] lsls r0, r1, 3 @@ -3474,7 +3474,7 @@ _08155A46: strh r6, [r4, 0x20] strh r5, [r4, 0x22] ldr r3, =gSprites - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects mov r0, sp ldrb r1, [r0] lsls r0, r1, 3 @@ -3793,7 +3793,7 @@ sub_8155C88: @ 8155C88 adds r0, r5, 0 bl FieldEffectStop _08155CB8: - ldr r4, =gUnknown_02037350 + ldr r4, =gMapObjects mov r0, sp ldrb r1, [r0] lsls r0, r1, 3 @@ -4514,7 +4514,7 @@ _08156212: lsls r0, r7, 3 adds r0, r7 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 ldrb r0, [r4] lsls r0, 31 diff --git a/asm/field_map_obj.s b/asm/field_map_obj.s index 468f859d8..223e29ad7 100644 --- a/asm/field_map_obj.s +++ b/asm/field_map_obj.s @@ -28,7 +28,7 @@ npc_clear_ids_and_state: @ 808D3F0 npcs_clear_ids_and_state: @ 808D410 push {r4,r5,lr} movs r4, 0 - ldr r5, =gUnknown_02037350 + ldr r5, =gMapObjects _0808D416: lsls r0, r4, 3 adds r0, r4 @@ -138,7 +138,7 @@ sub_808D450: @ 808D450 sub_808D4F4: @ 808D4F4 push {lr} movs r1, 0 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldrb r0, [r2] b _0808D518 .pool @@ -218,7 +218,7 @@ _0808D56C: GetFieldObjectIdByXY: @ 808D574 push {r4-r6,lr} movs r3, 0 - ldr r5, =gUnknown_02037350 + ldr r5, =gMapObjects lsls r0, 16 asrs r4, r0, 16 lsls r1, 16 @@ -265,7 +265,7 @@ GetFieldObjectIdByLocalIdAndMapInternal: @ 808D5B8 lsls r2, 24 lsrs r2, 24 movs r1, 0 - ldr r6, =gUnknown_02037350 + ldr r6, =gMapObjects _0808D5CA: lsls r0, r1, 3 adds r0, r1 @@ -307,7 +307,7 @@ GetFieldObjectIdByLocalId: @ 808D608 lsls r0, 24 lsrs r3, r0, 24 movs r2, 0 - ldr r4, =gUnknown_02037350 + ldr r4, =gMapObjects _0808D612: lsls r0, r2, 3 adds r0, r2 @@ -365,7 +365,7 @@ _0808D66E: lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 adds r0, r4, 0 bl npc_clear_ids_and_state @@ -582,7 +582,7 @@ GetAvailableFieldObjectSlot: @ 808D810 lsls r2, 24 lsrs r4, r2, 24 movs r2, 0 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects ldrb r0, [r1] lsls r0, 31 adds r7, r1, 0 @@ -627,7 +627,7 @@ _0808D868: _0808D870: mov r0, r12 strb r2, [r0] - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects _0808D876: lsls r0, r2, 3 adds r0, r2 @@ -701,7 +701,7 @@ RemoveFieldObjectByLocalIdAndMap: @ 808D8C4 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 bl RemoveFieldObject _0808D902: @@ -760,7 +760,7 @@ _0808D95C: lsls r0, r4, 3 adds r0, r4 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 bl RemoveFieldObject _0808D972: @@ -812,7 +812,7 @@ _0808D9C8: lsls r4, r0, 3 adds r0, r4, r0 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r6, r0, r1 ldrb r0, [r6, 0x5] bl GetFieldObjectGraphicsInfo @@ -867,7 +867,7 @@ _0808DA24: mov r8, r0 cmp r0, 0x40 bne _0808DA64 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects mov r2, r9 adds r1, r4, r2 lsls r1, 2 @@ -1051,7 +1051,7 @@ SpawnFieldObject: @ 808DB40 .pool _0808DBBC: ldr r4, =gSprites - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects lsls r0, r2, 3 adds r0, r2 lsls r0, 2 @@ -1704,7 +1704,7 @@ _0808E0AA: lsls r0, r3, 3 adds r0, r3 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r2, r0, r1 ldr r0, [r2] ldr r1, =0x00010001 @@ -1804,7 +1804,7 @@ sub_808E16C: @ 808E16C lsrs r5, 16 bl ClearPlayerAvatarInfo movs r6, 0 - ldr r7, =gUnknown_02037350 + ldr r7, =gMapObjects lsls r4, 16 lsls r5, 16 _0808E186: @@ -1872,7 +1872,7 @@ _0808E1EC: lsls r0, r1, 3 add r0, r9 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r6, r0, r1 movs r0, 0 str r0, [sp, 0x20] @@ -2097,7 +2097,7 @@ SetPlayerAvatarFieldObjectIdAndObjectId: @ 808E3C4 ldr r5, =gUnknown_02037590 strb r0, [r5, 0x5] strb r1, [r5, 0x4] - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects lsls r4, r0, 3 adds r4, r0 lsls r4, 2 @@ -2270,7 +2270,7 @@ sub_808E504: @ 808E504 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 adds r1, r4, 0 bl FieldObjectSetGraphicsId @@ -2346,7 +2346,7 @@ FieldObjectTurnByLocalIdAndMap: @ 808E594 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 adds r1, r4, 0 bl FieldObjectTurn @@ -2367,7 +2367,7 @@ sub_808E5D4: @ 808E5D4 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 bl FieldObjectTurn pop {r0} @@ -2528,7 +2528,7 @@ npc_by_local_id_and_map_set_field_1_bit_x20: @ 808E6F8 lsls r0, 24 cmp r0, 0 bne _0808E73A - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects mov r0, sp ldrb r0, [r0] lsls r1, r0, 3 @@ -2583,7 +2583,7 @@ sub_808E75C: @ 808E75C lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 ldrb r1, [r0] movs r2, 0x4 @@ -2617,7 +2617,7 @@ sub_808E78C: @ 808E78C lsls r2, r0, 3 adds r2, r0 lsls r2, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r2, r0 ldrb r1, [r2, 0x4] lsls r0, r1, 4 @@ -2659,7 +2659,7 @@ sub_808E7E4: @ 808E7E4 lsls r1, r0, 3 adds r1, r0 lsls r1, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r1, r0 ldrb r2, [r1, 0x3] movs r0, 0x5 @@ -2697,7 +2697,7 @@ sub_808E82C: @ 808E82C lsls r0, 24 cmp r0, 0 bne _0808E870 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects mov r0, sp ldrb r1, [r0] lsls r0, r1, 3 @@ -3176,7 +3176,7 @@ sub_808EBA8: @ 808EBA8 lsls r0, r3, 3 adds r0, r3 lsls r0, 2 - ldr r3, =gUnknown_02037350 + ldr r3, =gMapObjects adds r0, r3 movs r3, 0xE0 lsls r3, 11 @@ -3217,7 +3217,7 @@ UpdateFieldObjectCoordsForCameraUpdate: @ 808EC10 cmp r0, 0 beq _0808EC68 movs r3, 0 - ldr r5, =gUnknown_02037350 + ldr r5, =gMapObjects movs r0, 0x4 ldrsh r4, [r2, r0] movs r0, 0x8 @@ -3275,7 +3275,7 @@ GetFieldObjectIdByXYZ: @ 808EC78 lsls r2, 24 lsrs r5, r2, 24 movs r4, 0 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects mov r8, r0 _0808EC90: lsls r0, r4, 3 @@ -3795,7 +3795,7 @@ GetFieldObjectScriptPointerByFieldObjectId: @ 808F01C push {lr} lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects lsls r2, r0, 3 adds r2, r0 lsls r2, 2 @@ -3831,7 +3831,7 @@ GetFieldObjectFlagIdByFieldObjectId: @ 808F058 push {lr} lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects lsls r2, r0, 3 adds r2, r0 lsls r2, 2 @@ -3862,7 +3862,7 @@ sub_808F080: @ 808F080 lsls r0, 24 cmp r0, 0 bne _0808F0B4 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects mov r0, sp ldrb r1, [r0] lsls r0, r1, 3 @@ -3884,7 +3884,7 @@ _0808F0B6: sub_808F0BC: @ 808F0BC lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects lsls r1, r0, 3 adds r1, r0 lsls r1, 2 @@ -3909,7 +3909,7 @@ sub_808F0D4: @ 808F0D4 lsls r0, 24 cmp r0, 0 bne _0808F108 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects mov r0, sp ldrb r1, [r0] lsls r0, r1, 3 @@ -3932,7 +3932,7 @@ _0808F10A: FieldObjectGetBerryTreeId: @ 808F110 lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects lsls r1, r0, 3 adds r1, r0 lsls r1, 2 @@ -4141,7 +4141,7 @@ sub_808F254: @ 808F254 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 bl sub_808F208 _0808F282: @@ -4179,7 +4179,7 @@ _0808F2B6: lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 ldr r1, =gUnknown_082766A2 bl sub_808F228 @@ -4191,7 +4191,7 @@ _0808F2D4: lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 ldr r1, =gUnknown_082766A6 bl sub_808F228 @@ -4319,7 +4319,7 @@ FieldObjectCB_NoMovement1: @ 808F3E0 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =FieldObjectCB2_NoMovement1 bl FieldObjectStep @@ -4343,7 +4343,7 @@ FieldObjectCB_GoRandomDirections: @ 808F408 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =FieldObjectCB2_GoRandomDirections bl FieldObjectStep @@ -5082,7 +5082,7 @@ FieldObjectCB_LookRandomDirections: @ 808F944 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =FieldObjectCB2_LookRandomDirections bl FieldObjectStep @@ -5256,7 +5256,7 @@ FieldObjectCB_RandomlyGoNorthOrSouth: @ 808FA84 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =FieldObjectCB2_RandomlyGoNorthOrSouth bl FieldObjectStep @@ -5469,7 +5469,7 @@ FieldObjectCB_RandomlyGoEastOrWest: @ 808FC08 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =FieldObjectCB2_RandomlyGoEastOrWest bl FieldObjectStep @@ -5679,7 +5679,7 @@ FieldObjectCB_FaceFixedDirection: @ 808FD8C lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =FieldObjectCB2_FaceFixedDirection bl FieldObjectStep @@ -5773,7 +5773,7 @@ FieldObjectCB_BerryTree: @ 808FE2C lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r5, r0, r1 ldrh r1, [r4, 0x3C] movs r0, 0x1 @@ -6071,7 +6071,7 @@ FieldObjectCB_RandomlyLookNorthOrSouth: @ 8090050 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =FieldObjectCB2_RandomlyLookNorthOrSouth bl FieldObjectStep @@ -6239,7 +6239,7 @@ FieldObjectCB_RandomlyLookEastOrWest: @ 8090190 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =FieldObjectCB2_RandomlyLookEastOrWest bl FieldObjectStep @@ -6407,7 +6407,7 @@ FieldObjectCB_RandomlyLookNorthOrWest: @ 80902D0 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =FieldObjectCB2_RandomlyLookNorthOrWest bl FieldObjectStep @@ -6575,7 +6575,7 @@ FieldObjectCB_RandomlyLookNorthOrEast: @ 8090410 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8090434 bl FieldObjectStep @@ -6743,7 +6743,7 @@ FieldObjectCB_RandomlyLookSouthOrWest: @ 8090550 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8090574 bl FieldObjectStep @@ -6911,7 +6911,7 @@ FieldObjectCB_RandomlyLookSouthOrEast: @ 8090690 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_80906B4 bl FieldObjectStep @@ -7079,7 +7079,7 @@ FieldObjectCB_RandomlyLookNorthOrSouthOrWest: @ 80907D0 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_80907F4 bl FieldObjectStep @@ -7247,7 +7247,7 @@ FieldObjectCB_RandomlyLookNorthOrSouthOrEast: @ 8090910 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8090934 bl FieldObjectStep @@ -7415,7 +7415,7 @@ FieldObjectCB_RandomlyLookNorthOrEastOrWest: @ 8090A50 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8090A74 bl FieldObjectStep @@ -7583,7 +7583,7 @@ FieldObjectCB_RandomlyLookSouthOrEastOrWest: @ 8090B90 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8090BB4 bl FieldObjectStep @@ -7751,7 +7751,7 @@ FieldObjectCB_LookAroundCounterclockwise: @ 8090CD0 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8090CF4 bl FieldObjectStep @@ -7891,7 +7891,7 @@ FieldObjectCB_LookAroundClockwise: @ 8090DD4 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8090DF8 bl FieldObjectStep @@ -8030,7 +8030,7 @@ FieldObjectCB_AlternatelyGoInOppositeDirections: @ 8090ED8 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8090EFC bl FieldObjectStep @@ -8348,7 +8348,7 @@ FieldObjectCB_GoInDirectionSequence1: @ 8091138 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_809115C bl FieldObjectStep @@ -8421,7 +8421,7 @@ FieldObjectCB_GoInDirectionSequence2: @ 80911C4 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_80911E8 bl FieldObjectStep @@ -8494,7 +8494,7 @@ FieldObjectCB_GoInDirectionSequence3: @ 8091250 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8091274 bl FieldObjectStep @@ -8567,7 +8567,7 @@ FieldObjectCB_GoInDirectionSequence4: @ 80912DC lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8091300 bl FieldObjectStep @@ -8640,7 +8640,7 @@ FieldObjectCB_GoInDirectionSequence5: @ 8091368 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_809138C bl FieldObjectStep @@ -8714,7 +8714,7 @@ FieldObjectCB_GoInDirectionSequence6: @ 80913F4 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8091418 bl FieldObjectStep @@ -8787,7 +8787,7 @@ FieldObjectCB_GoInDirectionSequence7: @ 8091480 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_80914A4 bl FieldObjectStep @@ -8860,7 +8860,7 @@ FieldObjectCB_GoInDirectionSequence8: @ 809150C lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8091530 bl FieldObjectStep @@ -8933,7 +8933,7 @@ FieldObjectCB_GoInDirectionSequence9: @ 8091598 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_80915BC bl FieldObjectStep @@ -9006,7 +9006,7 @@ FieldObjectCB_GoInDirectionSequence10: @ 8091624 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8091648 bl FieldObjectStep @@ -9079,7 +9079,7 @@ FieldObjectCB_GoInDirectionSequence11: @ 80916B0 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_80916D4 bl FieldObjectStep @@ -9152,7 +9152,7 @@ FieldObjectCB_GoInDirectionSequence12: @ 809173C lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8091760 bl FieldObjectStep @@ -9225,7 +9225,7 @@ FieldObjectCB_GoInDirectionSequence13: @ 80917C8 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_80917EC bl FieldObjectStep @@ -9298,7 +9298,7 @@ FieldObjectCB_GoInDirectionSequence14: @ 8091854 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8091878 bl FieldObjectStep @@ -9371,7 +9371,7 @@ FieldObjectCB_GoInDirectionSequence15: @ 80918E0 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8091904 bl FieldObjectStep @@ -9444,7 +9444,7 @@ FieldObjectCB_GoInDirectionSequence16: @ 809196C lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8091990 bl FieldObjectStep @@ -9517,7 +9517,7 @@ FieldObjectCB_GoInDirectionSequence17: @ 80919F8 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8091A1C bl FieldObjectStep @@ -9590,7 +9590,7 @@ FieldObjectCB_GoInDirectionSequence18: @ 8091A84 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8091AA8 bl FieldObjectStep @@ -9663,7 +9663,7 @@ FieldObjectCB_GoInDirectionSequence19: @ 8091B10 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8091B34 bl FieldObjectStep @@ -9736,7 +9736,7 @@ FieldObjectCB_GoInDirectionSequence20: @ 8091B9C lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8091BC0 bl FieldObjectStep @@ -9809,7 +9809,7 @@ FieldObjectCB_GoInDirectionSequence21: @ 8091C28 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8091C4C bl FieldObjectStep @@ -9882,7 +9882,7 @@ FieldObjectCB_GoInDirectionSequence22: @ 8091CB4 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8091CD8 bl FieldObjectStep @@ -9955,7 +9955,7 @@ FieldObjectCB_GoInDirectionSequence23: @ 8091D40 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8091D64 bl FieldObjectStep @@ -10028,7 +10028,7 @@ FieldObjectCB_GoInDirectionSequence24: @ 8091DCC lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8091DF0 bl FieldObjectStep @@ -10101,7 +10101,7 @@ FieldObjectCB_CopyPlayer1: @ 8091E58 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8091E7C bl FieldObjectStep @@ -10155,7 +10155,7 @@ sub_8091EC0: @ 8091EC0 push {r4-r7,lr} adds r6, r0, 0 adds r7, r1, 0 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldr r3, =gUnknown_02037590 ldrb r1, [r3, 0x5] lsls r0, r1, 3 @@ -10878,7 +10878,7 @@ FieldObjectCB_CopyPlayer2: @ 8092494 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_80924B8 bl FieldObjectStep @@ -10910,7 +10910,7 @@ mss_08062EA4: @ 80924D8 push {r4-r7,lr} adds r6, r0, 0 adds r7, r1, 0 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldr r3, =gUnknown_02037590 ldrb r1, [r3, 0x5] lsls r0, r1, 3 @@ -10962,7 +10962,7 @@ FieldObjectCB_TreeDisguise: @ 809253C lsls r1, r0, 3 adds r1, r0 lsls r1, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r4, r1, r0 adds r6, r4, 0 adds r6, 0x21 @@ -10996,7 +10996,7 @@ _08092584: lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 ldr r2, =sub_80925AC adds r1, r5, 0 @@ -11025,7 +11025,7 @@ FieldObjectCB_MountainDisguise: @ 80925B8 lsls r1, r0, 3 adds r1, r0 lsls r1, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r4, r1, r0 adds r6, r4, 0 adds r6, 0x21 @@ -11059,7 +11059,7 @@ _08092600: lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 ldr r2, =sub_80925AC adds r1, r5, 0 @@ -11077,7 +11077,7 @@ FieldObjectCB_Hidden1: @ 8092628 adds r3, r0, 0 movs r1, 0x3C ldrsh r0, [r3, r1] - ldr r4, =gUnknown_02037350 + ldr r4, =gMapObjects cmp r0, 0 bne _08092668 movs r0, 0x2E @@ -11175,7 +11175,7 @@ FieldObjectCB_WalkInPlace1: @ 80926D4 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_80926F8 bl FieldObjectStep @@ -11234,7 +11234,7 @@ FieldObjectCB_WalkInPlace4: @ 8092744 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8092768 bl FieldObjectStep @@ -11293,7 +11293,7 @@ FieldObjectCB_WalkInPlace2: @ 80927B4 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_80927D8 bl FieldObjectStep @@ -11353,7 +11353,7 @@ FieldObjectCB_WalkInPlace3: @ 8092824 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_8092848 bl FieldObjectStep @@ -11412,7 +11412,7 @@ FieldObjectCB_Hidden2: @ 8092894 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =sub_80928B8 bl FieldObjectStep @@ -12234,7 +12234,7 @@ _08092E2E: lsls r0, r4, 3 adds r0, r4 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r2, r0, r1 ldrb r0, [r2] lsls r0, 31 @@ -12304,7 +12304,7 @@ sub_8092E9C: @ 8092E9C cmp r0, 0 bne _08092EE8 ldr r3, =gSprites - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects mov r0, sp ldrb r1, [r0] lsls r0, r1, 3 @@ -12348,7 +12348,7 @@ sub_8092EF0: @ 8092EF0 cmp r0, 0 bne _08092F2E ldr r3, =gSprites - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects mov r0, sp ldrb r1, [r0] lsls r0, r1, 3 @@ -16972,7 +16972,7 @@ sub_8094F38: @ 8094F38 ldrsh r0, [r5, r1] movs r2, 0x12 ldrsh r1, [r5, r2] - ldr r4, =gUnknown_02037350 + ldr r4, =gMapObjects mov r2, sp ldrb r2, [r2] lsls r3, r2, 3 @@ -17018,7 +17018,7 @@ sub_8094F94: @ 8094F94 ldrsh r0, [r5, r1] movs r2, 0x12 ldrsh r1, [r5, r2] - ldr r4, =gUnknown_02037350 + ldr r4, =gMapObjects mov r2, sp ldrb r2, [r2] lsls r3, r2, 3 diff --git a/asm/field_player_avatar.s b/asm/field_player_avatar.s index 6947746ef..1698c054e 100644 --- a/asm/field_player_avatar.s +++ b/asm/field_player_avatar.s @@ -15,7 +15,7 @@ FieldObjectCB_NoMovement2: @ 808A998 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldr r2, =FieldObjectCB2_NoMovement2 bl FieldObjectStep @@ -48,7 +48,7 @@ player_step: @ 808A9C0 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r5, r0, r1 adds r0, r5, 0 bl sub_808C280 @@ -240,7 +240,7 @@ GetForcedMovementByMetatileBehavior: @ 808AB38 ands r0, r1 cmp r0, 0 bne _0808AB8A - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldrb r1, [r3, 0x5] lsls r0, r1, 3 adds r0, r1 @@ -290,7 +290,7 @@ ForcedMovement_None: @ 808AB94 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 ldrb r2, [r0, 0x1] movs r1, 0x3 @@ -386,7 +386,7 @@ DoForcedMovementInCurrentDirection: @ 808AC58 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 ldrb r2, [r0, 0x1] movs r3, 0x4 @@ -528,7 +528,7 @@ ForcedMovement_Slide: @ 808AD60 lsls r2, r3, 3 adds r2, r3 lsls r2, 2 - ldr r3, =gUnknown_02037350 + ldr r3, =gMapObjects adds r2, r3 ldrb r3, [r2, 0x1] movs r4, 0x4 @@ -623,7 +623,7 @@ ForcedMovement_MuddySlope: @ 808AE10 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 ldrb r1, [r4, 0x18] movs r0, 0xF0 @@ -809,7 +809,7 @@ _0808AF68: lsls r0, 24 cmp r0, 0 beq _0808AFB0 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldrb r1, [r4, 0x5] lsls r0, r1, 3 adds r0, r1 @@ -848,7 +848,7 @@ CheckForPlayerAvatarCollision: @ 808AFBC lsls r4, r0, 3 adds r4, r0 lsls r4, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r4, r0 ldrh r1, [r4, 0x10] add r0, sp, 0x4 @@ -899,7 +899,7 @@ sub_808B028: @ 808B028 lsls r4, r0, 3 adds r4, r0 lsls r4, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r4, r0 ldrh r1, [r4, 0x10] add r0, sp, 0x4 @@ -1187,7 +1187,7 @@ sub_808B238: @ 808B238 lsrs r6, r0, 24 cmp r6, 0x10 beq _0808B2D8 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects lsls r1, r6, 3 adds r1, r6 lsls r1, 2 @@ -1290,7 +1290,7 @@ IsPlayerCollidingWithFarawayIslandMew: @ 808B324 lsls r1, r2, 3 adds r1, r2 lsls r1, 2 - ldr r5, =gUnknown_02037350 + ldr r5, =gMapObjects adds r3, r1, r5 ldrh r2, [r3, 0x10] mov r1, sp @@ -1401,7 +1401,7 @@ _0808B3F4: lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 ldr r1, [r2] bl _call_via_r1 @@ -1621,7 +1621,7 @@ _0808B5B6: thumb_func_start player_is_anim_in_certain_ranges player_is_anim_in_certain_ranges: @ 808B5BC push {lr} - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldr r0, =gUnknown_02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 @@ -1696,7 +1696,7 @@ PlayerIsAnimActive: @ 808B63C lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive lsls r0, 24 @@ -1715,7 +1715,7 @@ PlayerCheckIfAnimFinishedOrInactive: @ 808B660 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 bl FieldObjectCheckIfSpecialAnimFinishedOrInactive lsls r0, 24 @@ -1727,7 +1727,7 @@ PlayerCheckIfAnimFinishedOrInactive: @ 808B660 thumb_func_start player_set_x22 player_set_x22: @ 808B684 - ldr r3, =gUnknown_02037350 + ldr r3, =gMapObjects ldr r1, =gUnknown_02037590 ldrb r2, [r1, 0x5] lsls r1, r2, 3 @@ -1742,7 +1742,7 @@ player_set_x22: @ 808B684 thumb_func_start player_get_x22 player_get_x22: @ 808B6A0 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldr r0, =gUnknown_02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 @@ -1766,7 +1766,7 @@ sub_808B6BC: @ 808B6BC lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r0, r2 bl FieldObjectForceSetSpecialAnim pop {r0} @@ -1793,7 +1793,7 @@ player_npc_set_state_and_x22_etc: @ 808B6E4 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 adds r1, r5, 0 bl FieldObjectSetSpecialAnim @@ -2013,7 +2013,7 @@ _0808B872: lsls r0, 24 cmp r0, 0 beq _0808B89A - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldrb r1, [r4, 0x5] lsls r0, r1, 3 adds r0, r1 @@ -2219,7 +2219,7 @@ PlayCollisionSoundIfNotFacingWarp: @ 808B9EC sub sp, 0x4 lsls r0, 24 lsrs r4, r0, 24 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldr r0, =gUnknown_02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 @@ -2275,7 +2275,7 @@ GetXYCoordsOneStepInFrontOfPlayer: @ 808BA68 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 - ldr r3, =gUnknown_02037350 + ldr r3, =gMapObjects ldr r2, =gUnknown_02037590 ldrb r1, [r2, 0x5] lsls r0, r1, 3 @@ -2307,7 +2307,7 @@ GetXYCoordsOneStepInFrontOfPlayer: @ 808BA68 @ void PlayerGetDestCoords(u16 *x, u16 *y) PlayerGetDestCoords: @ 808BAAC push {r4,r5,lr} - ldr r5, =gUnknown_02037350 + ldr r5, =gMapObjects ldr r4, =gUnknown_02037590 ldrb r3, [r4, 0x5] lsls r2, r3, 3 @@ -2339,7 +2339,7 @@ plaer_get_pos_including_state_based_drift: @ 808BADC lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r3, r0, r1 ldrb r1, [r3] movs r0, 0xC0 @@ -2465,7 +2465,7 @@ _0808BC30: thumb_func_start player_get_direction_lower_nybble @ u8 player_get_direction_lower_nybble() player_get_direction_lower_nybble: @ 808BC38 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldr r0, =gUnknown_02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 @@ -2482,7 +2482,7 @@ player_get_direction_lower_nybble: @ 808BC38 thumb_func_start player_get_direction_upper_nybble @ u8 player_get_direction_upper_nybble() player_get_direction_upper_nybble: @ 808BC58 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldr r0, =gUnknown_02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 @@ -2498,7 +2498,7 @@ player_get_direction_upper_nybble: @ 808BC58 thumb_func_start PlayerGetZCoord @ u8 PlayerGetZCoord() PlayerGetZCoord: @ 808BC74 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldr r0, =gUnknown_02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 @@ -2521,7 +2521,7 @@ sub_808BC90: @ 808BC90 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 lsls r3, 16 asrs r3, 16 @@ -2578,7 +2578,7 @@ sub_808BCF4: @ 808BCF4 lsls r4, r0, 3 adds r4, r0 lsls r4, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r4, r0 adds r0, r4, 0 bl npc_clear_strange_bits @@ -2809,7 +2809,7 @@ IsPlayerFacingSurfableFishableWater: @ 808BE74 lsls r4, r0, 3 adds r4, r0 lsls r4, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r4, r0 ldrh r1, [r4, 0x10] mov r0, sp @@ -3060,7 +3060,7 @@ InitPlayerAvatar: @ 808BFE0 lsls r4, r5, 3 adds r4, r5 lsls r4, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r4, r0 ldrb r0, [r4, 0x2] movs r1, 0x1 @@ -3097,7 +3097,7 @@ sub_808C0A8: @ 808C0A8 push {r4-r6,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r6, =gUnknown_02037350 + ldr r6, =gMapObjects ldr r5, =gUnknown_02037590 ldrb r0, [r5, 0x5] lsls r1, r0, 3 @@ -3152,7 +3152,7 @@ sub_808C114: @ 808C114 lsls r4, r0, 3 adds r4, r0 lsls r4, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r4, r0 movs r0, 0x5 bl GetPlayerAvatarGraphicsIdByStateId @@ -3186,7 +3186,7 @@ sub_808C15C: @ 808C15C lsls r4, r0, 3 adds r4, r0 lsls r4, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r4, r0 movs r0, 0x6 bl GetPlayerAvatarGraphicsIdByStateId @@ -3227,7 +3227,7 @@ sub_808C1B4: @ 808C1B4 lsls r4, r0, 3 adds r4, r0 lsls r4, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r4, r0 movs r0, 0x2 bl GetPlayerAvatarGraphicsIdByStateId @@ -3276,7 +3276,7 @@ sub_808C228: @ 808C228 lsls r4, r0, 3 adds r4, r0 lsls r4, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r4, r0 movs r0, 0x7 bl GetPlayerAvatarGraphicsIdByStateId @@ -3414,7 +3414,7 @@ taskFF_bump_boulder: @ 808C34C lsrs r0, 24 ldr r6, =gUnknown_08497530 ldr r2, =gTasks - ldr r5, =gUnknown_02037350 + ldr r5, =gMapObjects lsls r1, r0, 2 adds r1, r0 lsls r1, 3 @@ -3625,7 +3625,7 @@ _0808C50A: lsls r1, r0, 3 adds r1, r0 lsls r1, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r1, r0 ldr r2, [r2] adds r0, r4, 0 @@ -3726,7 +3726,7 @@ _0808C5E2: lsls r1, r0, 3 adds r1, r0 lsls r1, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r1, r0 ldr r2, [r2] adds r0, r4, 0 @@ -3936,7 +3936,7 @@ taskFF_0805D1D4: @ 808C7A8 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r5, r0, r1 adds r0, r5, 0 bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive @@ -3983,7 +3983,7 @@ sub_808C814: @ 808C814 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 adds r0, r4, 0 bl FieldObjectClearAnimIfSpecialAnimFinished @@ -4127,7 +4127,7 @@ fish1: @ 808C918 ldrh r1, [r6] adds r1, r0 strh r1, [r5, 0x22] - ldr r3, =gUnknown_02037350 + ldr r3, =gMapObjects ldr r2, =gUnknown_02037590 ldrb r1, [r2, 0x5] lsls r0, r1, 3 @@ -4579,7 +4579,7 @@ _0808CCBC: lsls r4, r0, 3 adds r4, r0 lsls r4, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects mov r8, r0 add r4, r8 ldrh r1, [r5, 0x24] @@ -4792,7 +4792,7 @@ fishE: @ 808CE8C lsls r4, r0, 3 adds r4, r0 lsls r4, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects mov r8, r0 add r4, r8 ldrh r1, [r6, 0x24] @@ -4984,7 +4984,7 @@ _0808D03A: ands r0, r1 cmp r0, 0 beq _0808D05E - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldrb r1, [r3, 0x5] lsls r0, r1, 3 adds r0, r1 @@ -5037,7 +5037,7 @@ sub_808D094: @ 808D094 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 ldrb r1, [r4, 0x4] lsls r0, r1, 4 @@ -5217,7 +5217,7 @@ sub_808D1FC: @ 808D1FC lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 ldrb r1, [r4, 0x4] lsls r0, r1, 4 diff --git a/asm/fldeff_80F9BCC.s b/asm/fldeff_80F9BCC.s index dffc7c780..f783547e1 100644 --- a/asm/fldeff_80F9BCC.s +++ b/asm/fldeff_80F9BCC.s @@ -1722,7 +1722,7 @@ _080FA9CA: sub_80FA9D0: @ 80FA9D0 push {r4,lr} sub sp, 0x4 - ldr r3, =gUnknown_02037350 + ldr r3, =gMapObjects ldr r2, =gUnknown_02037590 ldrb r1, [r2, 0x5] lsls r0, r1, 3 @@ -2312,7 +2312,7 @@ sub_80FAEF0: @ 80FAEF0 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 adds r0, r4, 0 bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive @@ -2362,7 +2362,7 @@ sub_80FAF64: @ 80FAF64 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r5, r0, r1 adds r0, r5, 0 bl FieldObjectClearAnimIfSpecialAnimFinished diff --git a/asm/fldeff_emotion.s b/asm/fldeff_emotion.s index 845f5618f..f8b66da0d 100644 --- a/asm/fldeff_emotion.s +++ b/asm/fldeff_emotion.s @@ -167,7 +167,7 @@ _080B4756: bl FieldEffectStop b _080B47B2 _080B4764: - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects mov r0, sp ldrb r1, [r0] lsls r0, r1, 3 @@ -274,7 +274,7 @@ sub_80B4808: @ 80B4808 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 ldrb r0, [r0, 0x18] lsls r0, 28 @@ -301,7 +301,7 @@ _080B4870: lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 ldrb r0, [r0, 0x18] lsls r0, 28 diff --git a/asm/item_use.s b/asm/item_use.s index 733b24470..7298407b9 100644 --- a/asm/item_use.s +++ b/asm/item_use.s @@ -11,7 +11,7 @@ SetUpItemUseCallback: @ 80FD060 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r1, =gUnknown_0203CE7C + ldr r1, =gScriptItemId ldrh r0, [r1] cmp r0, 0xAF bne _080FD084 @@ -260,7 +260,7 @@ sub_80FD254: @ 80FD254 push {lr} sub sp, 0x24 mov r1, sp - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] strh r0, [r1, 0x20] ldr r1, =bag_menu_mail_related @@ -381,7 +381,7 @@ ItemUseOnFieldCB_Bike: @ 80FD358 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] bl ItemId_GetSecondaryId lsls r0, 24 @@ -515,7 +515,7 @@ ItemUseOnFieldCB_Rod: @ 80FD468 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] bl ItemId_GetSecondaryId lsls r0, 24 @@ -1306,7 +1306,7 @@ sub_80FDA24: @ 80FDA24 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r4, =gUnknown_02037350 + ldr r4, =gMapObjects adds r0, r4 bl FieldObjectClearAnimIfSpecialAnimFinished movs r0, 0xFF @@ -1356,7 +1356,7 @@ sub_80FDA94: @ 80FDA94 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 bl FieldObjectCheckIfSpecialAnimFinishedOrInactive lsls r0, 24 @@ -1395,7 +1395,7 @@ sub_80FDADC: @ 80FDADC lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 bl FieldObjectCheckIfSpecialAnimFinishedOrInactive lsls r0, 24 @@ -1642,7 +1642,7 @@ sub_80FDD10: @ 80FDD10 b _080FDD68 .pool _080FDD58: - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] bl ItemId_GetFieldFunc adds r1, r0, 0 @@ -1661,7 +1661,7 @@ sub_80FDD74: @ 80FDD74 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] movs r1, 0x1 bl RemoveBagItem @@ -1692,7 +1692,7 @@ ItemUseOutOfBattle_WailmerPail: @ 80FDDA4 b _080FDDD8 .pool _080FDDC8: - bl WaterBerryTree + bl TryToWaterBerryTree lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1759,7 +1759,7 @@ sub_80FDE2C: @ 80FDE2C lsrs r2, r0, 24 cmp r2, 0x10 beq _080FDE68 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects lsls r1, r2, 3 adds r1, r2 lsls r1, 2 @@ -1886,7 +1886,7 @@ ItemUseOutOfBattle_TMHM: @ 80FDF48 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r1, [r0] movs r0, 0xA9 lsls r0, 1 @@ -1945,7 +1945,7 @@ task08_0809AD8C: @ 80FDFBC cmp r0, 0 beq _080FE000 ldr r4, =gStringVar1 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] bl ItemIdToBattleMoveId lsls r0, 16 @@ -2002,7 +2002,7 @@ sub_80FE03C: @ 80FE03C thumb_func_start sub_80FE058 sub_80FE058: @ 80FE058 push {r4,lr} - ldr r4, =gUnknown_0203CE7C + ldr r4, =gScriptItemId ldrh r0, [r4] movs r1, 0x1 bl RemoveBagItem @@ -2125,7 +2125,7 @@ sub_80FE164: @ 80FE164 cmp r0, 0 bne _080FE1C2 ldr r4, =0x00004021 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] bl ItemId_GetHoldEffectParam adds r1, r0, 0 @@ -2205,7 +2205,7 @@ ItemUseOutOfBattle_BlackWhiteFlute: @ 80FE234 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r4, =gUnknown_0203CE7C + ldr r4, =gScriptItemId ldrh r0, [r4] ldr r1, =gStringVar2 bl CopyItemName @@ -2361,7 +2361,7 @@ ItemUseInBattle_PokeBall: @ 80FE394 lsls r0, 24 cmp r0, 0 bne _080FE3D0 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] movs r1, 0x1 bl RemoveBagItem @@ -2450,7 +2450,7 @@ sub_80FE440: @ 80FE440 ble _080FE4AC movs r0, 0x1 bl PlaySE - ldr r4, =gUnknown_0203CE7C + ldr r4, =gScriptItemId ldrh r0, [r4] movs r1, 0x1 bl RemoveBagItem @@ -2496,7 +2496,7 @@ ItemUseInBattle_StatIncrease: @ 80FE4B8 muls r0, r2 ldr r1, =gPlayerParty adds r0, r1 - ldr r1, =gUnknown_0203CE7C + ldr r1, =gScriptItemId ldrh r1, [r1] lsls r2, 24 lsrs r2, 24 @@ -2664,7 +2664,7 @@ ItemUseOutOfBattle_EnigmaBerry: @ 80FE650 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] bl GetItemEffectType lsls r0, 24 @@ -2785,7 +2785,7 @@ ItemUseInBattle_EnigmaBerry: @ 80FE77C push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] bl GetItemEffectType lsls r0, 24 diff --git a/asm/lilycove_lady.s b/asm/lilycove_lady.s index debcc3fbe..fca8cb29b 100644 --- a/asm/lilycove_lady.s +++ b/asm/lilycove_lady.s @@ -566,7 +566,7 @@ _0818DE36: thumb_func_start sub_818DE44 sub_818DE44: @ 818DE44 push {lr} - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] bl sub_818DD84 lsls r0, 24 @@ -1323,7 +1323,7 @@ sub_818E47C: @ 818E47C thumb_func_start sub_818E490 sub_818E490: @ 818E490 push {lr} - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] movs r1, 0x1 bl RemoveBagItem @@ -1341,7 +1341,7 @@ sub_818E4A4: @ 818E4A4 ldr r1, =0x00003b58 adds r0, r1 str r0, [r2] - ldr r1, =gUnknown_0203CE7C + ldr r1, =gScriptItemId ldrh r1, [r1] strh r1, [r0, 0x28] movs r3, 0 diff --git a/asm/link.s b/asm/link.s index e052aec63..da9cbc928 100644 --- a/asm/link.s +++ b/asm/link.s @@ -1232,7 +1232,7 @@ _08009E8C: _08009EA8: ldr r0, =gUnknown_03003110 strh r2, [r0] - ldr r1, =gUnknown_0203CE7C + ldr r1, =gScriptItemId ldrh r1, [r1] b _08009F04 .pool @@ -31367,7 +31367,7 @@ sub_8019AD8: @ 8019AD8 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 adds r0, r4, 0 bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive @@ -31413,7 +31413,7 @@ sub_8019B3C: @ 8019B3C lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 adds r0, r4, 0 bl FieldObjectClearAnimIfSpecialAnimFinished @@ -45605,7 +45605,7 @@ _08020D74: sub_8020D8C: @ 8020D8C push {r4,lr} sub sp, 0xC - ldr r1, =gUnknown_0203CE7C + ldr r1, =gScriptItemId ldrh r0, [r1] subs r0, 0x85 lsls r0, 16 @@ -45626,7 +45626,7 @@ _08020DB0: ldrb r0, [r2, 0x8] lsls r0, 5 adds r0, r2, r0 - ldr r1, =gUnknown_0203CE7C + ldr r1, =gScriptItemId ldrh r1, [r1] subs r1, 0x85 adds r0, 0xA4 diff --git a/asm/load_save.s b/asm/load_save.s index 08170b446..2b4be8e67 100644 --- a/asm/load_save.s +++ b/asm/load_save.s @@ -244,7 +244,7 @@ save_serialize_npcs: @ 8076E1C movs r5, 0xA3 lsls r5, 4 mov r8, r5 - ldr r4, =gUnknown_02037350 + ldr r4, =gMapObjects movs r3, 0 movs r2, 0xF _08076E32: @@ -282,7 +282,7 @@ save_deserialize_npcs: @ 8076E64 movs r5, 0xA3 lsls r5, 4 mov r8, r5 - ldr r4, =gUnknown_02037350 + ldr r4, =gMapObjects movs r3, 0 movs r2, 0xF _08076E7A: diff --git a/asm/map_obj_8097404.s b/asm/map_obj_8097404.s index 404ae3675..50284a013 100644 --- a/asm/map_obj_8097404.s +++ b/asm/map_obj_8097404.s @@ -87,7 +87,7 @@ _0809748E: player_bitmagic: @ 8097494 push {r4,r5,lr} movs r4, 0 - ldr r5, =gUnknown_02037350 + ldr r5, =gMapObjects _0809749A: lsls r0, r4, 3 adds r0, r4 @@ -121,7 +121,7 @@ sub_80974D0: @ 80974D0 lsls r0, 24 lsrs r5, r0, 24 movs r4, 0 - ldr r6, =gUnknown_02037350 + ldr r6, =gMapObjects _080974DA: cmp r4, r5 beq _080974FC @@ -209,7 +209,7 @@ _0809756C: sub_809757C: @ 809757C push {r4,r5,lr} movs r4, 0 - ldr r5, =gUnknown_02037350 + ldr r5, =gMapObjects _08097582: lsls r0, r4, 3 adds r0, r4 @@ -1757,7 +1757,7 @@ sub_8098074: @ 8098074 lsls r1, 24 lsrs r5, r1, 24 movs r4, 0 - ldr r7, =gUnknown_02037350 + ldr r7, =gMapObjects _08098082: cmp r4, r6 beq _080980A8 diff --git a/asm/map_obj_lock.s b/asm/map_obj_lock.s index 7547f23c0..6530c268b 100644 --- a/asm/map_obj_lock.s +++ b/asm/map_obj_lock.s @@ -97,8 +97,8 @@ _0809842A: ldrsh r0, [r5, r1] cmp r0, 0 bne _08098452 - ldr r2, =gUnknown_02037350 - ldr r0, =gUnknown_03005DF0 + ldr r2, =gMapObjects + ldr r0, =gSelectedMapObject ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 @@ -152,7 +152,7 @@ _0809849A: thumb_func_start sub_80984A0 sub_80984A0: @ 80984A0 push {r4,r5,lr} - ldr r4, =gUnknown_03005DF0 + ldr r4, =gSelectedMapObject ldrb r0, [r4] bl sub_80974D0 ldr r0, =sub_8098400 @@ -160,7 +160,7 @@ sub_80984A0: @ 80984A0 bl CreateTask lsls r0, 24 lsrs r5, r0, 24 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldrb r1, [r4] lsls r0, r1, 3 adds r0, r1 @@ -199,7 +199,7 @@ sub_80984F4: @ 80984F4 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 bl FieldObjectClearAnimIfSpecialAnimFinished bl sub_80D338C @@ -212,8 +212,8 @@ sub_80984F4: @ 80984F4 thumb_func_start sub_8098524 sub_8098524: @ 8098524 push {r4,lr} - ldr r4, =gUnknown_02037350 - ldr r0, =gUnknown_03005DF0 + ldr r4, =gMapObjects + ldr r0, =gSelectedMapObject ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 @@ -249,12 +249,12 @@ _08098542: thumb_func_start sub_8098574 sub_8098574: @ 8098574 push {lr} - ldr r0, =gUnknown_03005DF0 + ldr r0, =gSelectedMapObject ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 ldr r1, =gScriptFacing ldrb r1, [r1] @@ -267,12 +267,12 @@ sub_8098574: @ 8098574 thumb_func_start sub_809859C sub_809859C: @ 809859C push {lr} - ldr r0, =gUnknown_03005DF0 + ldr r0, =gSelectedMapObject ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 bl FieldObjectClearAnimIfSpecialAnimActive pop {r0} @@ -307,7 +307,7 @@ _080985E8: ldrsh r0, [r5, r1] cmp r0, 0 bne _0809860C - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects lsls r1, r7, 3 adds r1, r7 lsls r1, 2 @@ -374,7 +374,7 @@ sub_8098630: @ 8098630 mov r1, r9 adds r6, r0, r1 strh r4, [r6, 0xC] - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects mov r8, r2 lsls r0, r4, 3 adds r0, r4 @@ -429,7 +429,7 @@ _080986E0: lsls r0, 3 adds r5, r0, r1 strh r4, [r5, 0xC] - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects lsls r0, r4, 3 adds r0, r4 lsls r0, 2 diff --git a/asm/mystery_event_script.s b/asm/mystery_event_script.s index 07c940f58..df5c034c4 100644 --- a/asm/mystery_event_script.s +++ b/asm/mystery_event_script.s @@ -432,7 +432,7 @@ sub_8153AE8: @ 8153AE8 mov r6, r8 push {r6,r7} adds r7, r0, 0 - bl sub_80E162C + bl IsEnigmaBerryValid mov r8, r0 adds r0, r7, 0 bl ScriptReadWord @@ -450,7 +450,7 @@ sub_8153AE8: @ 8153AE8 movs r2, 0x7 bl StringCopyN adds r0, r4, 0 - bl sub_80E15E4 + bl SetEnigmaBerry ldr r4, =gStringVar2 ldr r1, [r6] adds r1, r5 @@ -481,7 +481,7 @@ _08153B74: bl StringExpandPlaceholders movs r0, 0x2 str r0, [r7, 0x6C] - bl sub_80E162C + bl IsEnigmaBerryValid cmp r0, 0x1 bne _08153B9C ldr r0, =0x0000402d diff --git a/asm/pokeblock_feed.s b/asm/pokeblock_feed.s index 8f63be452..4335e22cc 100644 --- a/asm/pokeblock_feed.s +++ b/asm/pokeblock_feed.s @@ -380,7 +380,7 @@ _08179EEC: b _08179F5E .pool _08179F00: - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrb r0, [r0] bl sub_8179FEC ldr r0, =gUnknown_0203BD1C @@ -692,7 +692,7 @@ sub_817A1C4: @ 817A1C4 ldr r0, =gPlayerParty adds r5, r0 ldr r1, =gSaveBlock1Ptr - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] lsls r0, 3 ldr r2, =0x00000848 diff --git a/asm/porthole.s b/asm/porthole.s index 0efe88773..e5986b47e 100644 --- a/asm/porthole.s +++ b/asm/porthole.s @@ -231,7 +231,7 @@ _080FB75E: sub_80FB768: @ 80FB768 push {lr} bl sub_80FB6EC - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldr r0, =gUnknown_02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 diff --git a/asm/rom4.s b/asm/rom4.s index 9acdbec0a..9e4e9f108 100644 --- a/asm/rom4.s +++ b/asm/rom4.s @@ -4395,7 +4395,7 @@ sub_8086A68: @ 8086A68 thumb_func_start sub_8086A80 sub_8086A80: @ 8086A80 push {lr} - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldr r3, =gUnknown_02037590 ldrb r1, [r3, 0x5] lsls r0, r1, 3 @@ -6030,7 +6030,7 @@ sub_80876F0: @ 80876F0 lsls r5, r6, 3 adds r5, r6 lsls r5, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r5, r0 adds r0, r4, 0 bl sub_80876C4 @@ -6128,7 +6128,7 @@ sub_80877DC: @ 80877DC lsls r1, r0, 3 adds r1, r0 lsls r1, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r1, r0 strb r2, [r1, 0x19] _080877FE: @@ -6148,7 +6148,7 @@ sub_808780C: @ 808780C lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 ldrb r0, [r4, 0x4] cmp r0, 0x40 @@ -6183,7 +6183,7 @@ sub_8087858: @ 8087858 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 ldrb r0, [r0, 0x4] bx lr @@ -6200,7 +6200,7 @@ sub_8087878: @ 8087878 lsls r0, r3, 3 adds r0, r3 lsls r0, 2 - ldr r3, =gUnknown_02037350 + ldr r3, =gMapObjects adds r0, r3 ldrh r3, [r0, 0x10] strh r3, [r1] @@ -6220,7 +6220,7 @@ sub_80878A0: @ 80878A0 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 ldrb r0, [r0, 0x19] bx lr @@ -6237,7 +6237,7 @@ sub_80878C0: @ 80878C0 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 ldrb r0, [r0, 0xB] lsls r0, 28 @@ -6256,7 +6256,7 @@ sub_80878E4: @ 80878E4 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 adds r0, 0x21 movs r1, 0 @@ -6292,7 +6292,7 @@ _0808792E: lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r1, r0, r1 movs r6, 0x10 ldrsh r0, [r1, r6] @@ -6332,7 +6332,7 @@ sub_808796C: @ 808796C lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r6, r0, r1 ldrb r0, [r5] cmp r0, 0 @@ -6584,7 +6584,7 @@ npc_080587EC: @ 8087B40 mov r12, r2 lsls r3, 16 movs r4, 0 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects mov r9, r0 lsrs r2, r3, 16 mov r10, r2 @@ -6660,7 +6660,7 @@ sub_8087BCC: @ 8087BCC lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 ldrb r0, [r2] cmp r0, 0 @@ -6748,7 +6748,7 @@ sub_8087C8C: @ 8087C8C lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r6, r0, r1 ldrh r0, [r6, 0xC] strh r0, [r5, 0x20] diff --git a/asm/rom6.s b/asm/rom6.s index 65b3d9b94..16cb5827b 100644 --- a/asm/rom6.s +++ b/asm/rom6.s @@ -23,7 +23,7 @@ npc_before_player_of_type: @ 8135424 bl GetFieldObjectIdByXYZ lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects lsls r1, r0, 3 adds r1, r0 lsls r1, 2 @@ -75,7 +75,7 @@ task08_080C9820: @ 813549C lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 adds r0, r4, 0 bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive @@ -132,7 +132,7 @@ sub_813552C: @ 813552C lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 bl FieldObjectCheckIfSpecialAnimFinishedOrInactive lsls r0, 24 @@ -196,7 +196,7 @@ _081355B8: lsls r4, r0, 3 adds r4, r0 lsls r4, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r4, r0 bl GetPlayerAvatarGraphicsIdByCurrentState adds r1, r0, 0 @@ -2140,7 +2140,7 @@ _081366D0: ldr r2, =0x0000ffff adds r1, r2, 0 strh r1, [r0] - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId mov r1, r9 strh r1, [r0] adds r0, r7, 0 @@ -2150,7 +2150,7 @@ _081366D0: _081366F8: movs r0, 0x5 bl PlaySE - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId strh r4, [r0] adds r0, r7, 0 bl sub_8136938 @@ -2541,7 +2541,7 @@ sub_8136A50: @ 8136A50 sub_8136A74: @ 8136A74 push {lr} ldr r2, =gSaveBlock1Ptr - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r1, [r0] lsls r1, 3 ldr r0, =0x00000848 @@ -2586,7 +2586,7 @@ sub_8136AB4: @ 8136AB4 ldr r3, =gPokeblockNames ldr r1, =gSaveBlock1Ptr ldr r2, [r1] - ldr r1, =gUnknown_0203CE7C + ldr r1, =gScriptItemId ldrh r1, [r1] lsls r1, 3 adds r2, r1 @@ -2689,7 +2689,7 @@ sub_8136BC0: @ 8136BC0 ands r0, r1 cmp r0, 0 beq _08136C36 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrb r0, [r0] bl sub_8136F68 movs r0, 0x5 @@ -2772,7 +2772,7 @@ sub_8136C8C: @ 8136C8C lsls r0, 24 lsrs r0, 24 ldr r5, =gSaveBlock1Ptr - ldr r7, =gUnknown_0203CE7C + ldr r7, =gScriptItemId ldrh r2, [r7] lsls r2, 3 ldr r6, =0x00000848 @@ -2836,7 +2836,7 @@ sub_8136D2C: @ 8136D2C adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r5, =gUnknown_0203CE7C + ldr r5, =gScriptItemId ldrb r0, [r5] bl SafariZoneActivatePokeblockFeeder ldr r0, =gStringVar1 @@ -2877,7 +2877,7 @@ sub_8136D90: @ 8136D90 lsrs r4, 24 ldr r6, =gSpecialVar_0x8004 ldr r0, =gSaveBlock1Ptr - ldr r5, =gUnknown_0203CE7C + ldr r5, =gScriptItemId ldrh r1, [r5] lsls r1, 3 ldr r2, =0x00000848 @@ -5673,7 +5673,7 @@ _08138454: lsrs r2, r0, 24 cmp r2, 0x10 beq _081384E6 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects lsls r0, r2, 3 adds r0, r2 lsls r0, 2 @@ -7257,7 +7257,7 @@ SpawnScriptFieldObject: @ 8139158 bl SpawnSpecialFieldObjectParametrized lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects lsls r1, r0, 3 adds r1, r0 lsls r1, 2 diff --git a/asm/rom_80AEFFC.s b/asm/rom_80AEFFC.s index 566947ba3..23926a93e 100644 --- a/asm/rom_80AEFFC.s +++ b/asm/rom_80AEFFC.s @@ -599,7 +599,7 @@ _080AF4A4: lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 movs r1, 0x8 bl FieldObjectSetSpecialAnim @@ -630,7 +630,7 @@ _080AF4DC: lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 bl FieldObjectClearAnimIfSpecialAnimFinished movs r0, 0x3 @@ -719,7 +719,7 @@ _080AF5A2: lsls r4, r0, 3 adds r4, r0 lsls r4, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r4, r0 bl player_get_direction_lower_nybble lsls r0, 24 @@ -1370,7 +1370,7 @@ _080AFB26: lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r4, =gUnknown_02037350 + ldr r4, =gMapObjects adds r0, r4 bl FieldObjectClearAnimIfSpecialAnimActive movs r0, 0xFF @@ -1414,7 +1414,7 @@ _080AFB6C: lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 bl FieldObjectClearAnimIfSpecialAnimFinished movs r0, 0 diff --git a/asm/rom_80C6FA0.s b/asm/rom_80C6FA0.s index 570116cd3..715f45609 100644 --- a/asm/rom_80C6FA0.s +++ b/asm/rom_80C6FA0.s @@ -2252,7 +2252,7 @@ _080C8230: ldrb r0, [r0] cmp r0, 0x2 bne _080C825C - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] cmp r0, 0 beq _080C825C @@ -5458,7 +5458,7 @@ _080C9F56: sub_80C9F6C: @ 80C9F6C push {lr} sub sp, 0x4 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r1, [r0] mov r0, sp strh r1, [r0] @@ -23955,7 +23955,7 @@ _080D3630: lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 bl npc_sync_anim_pause_bits _080D3646: @@ -24023,7 +24023,7 @@ sub_80D36A4: @ 80D36A4 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 adds r0, r4, 0 bl FieldObjectIsSpecialAnimActive @@ -27175,7 +27175,7 @@ sub_80D5070: @ 80D5070 adds r4, r0, 0 cmp r4, 0x2A bne _080D5082 - bl sub_80E162C + bl IsEnigmaBerryValid _080D5082: ldr r5, =gBerryPicTable lsls r4, 3 diff --git a/asm/rom_8161F74.s b/asm/rom_8161F74.s index 339476c45..605d3da1c 100644 --- a/asm/rom_8161F74.s +++ b/asm/rom_8161F74.s @@ -8813,7 +8813,7 @@ _08166BB6: lsls r0, 24 cmp r0, 0 bne _08166BDA - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrb r0, [r0] bl sub_8136F68 ldr r0, =sub_8166BEC diff --git a/asm/rom_818E9AC.s b/asm/rom_818E9AC.s index 3fac8c672..b4087b09e 100644 --- a/asm/rom_818E9AC.s +++ b/asm/rom_818E9AC.s @@ -14292,7 +14292,7 @@ sub_81963F0: @ 81963F0 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 bl FieldObjectClearAnimIfSpecialAnimFinished bl sub_80D338C @@ -49829,7 +49829,7 @@ _081A896E: lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 bl FieldObjectClearAnimIfSpecialAnimFinished bl sub_80D338C @@ -50127,7 +50127,7 @@ _081A8BB4: bne _081A8BDC b _081A8D32 _081A8BDC: - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects lsls r1, r2, 3 adds r1, r2 lsls r1, 2 @@ -51130,8 +51130,8 @@ sub_81A9424: @ 81A9424 lsls r1, 4 adds r1, r0 mov r8, r1 - ldr r2, =gUnknown_02037350 - ldr r0, =gUnknown_03005DF0 + ldr r2, =gMapObjects + ldr r0, =gSelectedMapObject ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 @@ -51178,8 +51178,8 @@ _081A9488: mov r9, r0 _081A94AE: ldr r3, =gUnknown_08613ED8 - ldr r2, =gUnknown_02037350 - ldr r0, =gUnknown_03005DF0 + ldr r2, =gMapObjects + ldr r0, =gSelectedMapObject ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 @@ -51790,7 +51790,7 @@ sub_81A9998: @ 81A9998 mov r8, r0 ldr r1, =0x0000028e mov r12, r1 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects mov r9, r0 _081A99CC: movs r2, 0 @@ -51803,7 +51803,7 @@ _081A99CE: cmp r0, r12 bne _081A9A8A adds r2, 0x7 - ldr r0, =gUnknown_03005DF0 + ldr r0, =gSelectedMapObject ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 @@ -51931,7 +51931,7 @@ GetBattlePyramidTrainerFlag: @ 81A9AC4 ldr r1, =0x00000e2a adds r2, r1 ldr r4, =gBitTable - ldr r3, =gUnknown_02037350 + ldr r3, =gMapObjects lsls r1, r0, 3 adds r1, r0 lsls r1, 2 @@ -51964,7 +51964,7 @@ sub_81A9B04: @ 81A9B04 beq _081A9B2E movs r0, 0x1 bl sub_80B47E0 - ldr r1, =gUnknown_03005DF0 + ldr r1, =gSelectedMapObject strb r0, [r1] ldr r0, =gTrainerBattleOpponent_B ldrh r0, [r0] @@ -51985,9 +51985,9 @@ sub_81A9B44: @ 81A9B44 lsls r0, 16 lsrs r5, r0, 16 movs r3, 0 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects mov r12, r0 - ldr r6, =gUnknown_03005DF0 + ldr r6, =gSelectedMapObject ldr r1, =gSaveBlock1Ptr mov r10, r1 ldr r7, =gSaveBlock2Ptr @@ -56182,7 +56182,7 @@ _081ABE32: _081ABE40: movs r0, 0x5 bl PlaySE - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId mov r1, r10 strh r1, [r0] ldr r0, =gTasks + 0x8 @@ -56216,7 +56216,7 @@ _081ABE68: lsrs r0, 24 adds r1, r4, 0 bl BagGetItemIdByPocketPosition - ldr r1, =gUnknown_0203CE7C + ldr r1, =gScriptItemId strh r0, [r1] ldr r1, =gUnknown_08614054 ldrb r0, [r5, 0x4] @@ -57126,7 +57126,7 @@ _081AC668: .4byte _081AC70C .4byte _081AC690 _081AC690: - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] bl ItemId_GetBattleUsage lsls r0, 24 @@ -57171,7 +57171,7 @@ _081AC6E8: b _081ACA10 .pool _081AC70C: - ldr r4, =gUnknown_0203CE7C + ldr r4, =gScriptItemId ldrh r0, [r4] bl itemid_is_unique lsls r0, 24 @@ -57206,7 +57206,7 @@ _081AC748: b _081ACA10 .pool _081AC76C: - ldr r4, =gUnknown_0203CE7C + ldr r4, =gScriptItemId ldrh r0, [r4] bl itemid_is_unique lsls r0, 24 @@ -57241,7 +57241,7 @@ _081AC7A8: b _081ACA10 .pool _081AC7CC: - ldr r4, =gUnknown_0203CE7C + ldr r4, =gScriptItemId ldrh r0, [r4] bl itemid_is_unique lsls r0, 24 @@ -57289,7 +57289,7 @@ _081AC840: ldrb r0, [r0, 0x5] cmp r0, 0x4 beq _081AC856 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] bl sub_8122148 lsls r0, 24 @@ -57359,7 +57359,7 @@ _081AC8D4: ldr r1, =gUnknown_0861402C movs r2, 0x4 bl memcpy - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] bl itemid_is_mail lsls r0, 24 @@ -57397,7 +57397,7 @@ _081AC92C: ldr r0, [r0] ldr r1, =0x00000496 adds r0, r1 - ldr r2, =gUnknown_0203CE7C + ldr r2, =gScriptItemId ldrh r0, [r0] ldrh r1, [r2] cmp r0, r1 @@ -57473,7 +57473,7 @@ _081ACA12: bne _081ACA50 movs r0, 0x1 bl ClearWindowTilemap - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] bl PrintTMHMMoveData movs r0, 0x3 @@ -57485,7 +57485,7 @@ _081ACA12: b _081ACA86 .pool _081ACA50: - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] ldr r1, =gStringVar1 bl CopyItemName @@ -57986,7 +57986,7 @@ ItemMenu_UseOutOfBattle: @ 81ACE7C push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r5, =gUnknown_0203CE7C + ldr r5, =gScriptItemId ldrh r0, [r5] bl ItemId_GetFieldFunc cmp r0, 0 @@ -58016,7 +58016,7 @@ _081ACEB8: ldrb r0, [r0, 0x5] cmp r0, 0x3 beq _081ACEE8 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] bl ItemId_GetFieldFunc adds r1, r0, 0 @@ -58056,7 +58056,7 @@ ItemMenu_Toss: @ 81ACEF4 b _081ACF6A .pool _081ACF24: - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] ldr r1, =gStringVar1 bl CopyItemName @@ -58106,7 +58106,7 @@ BagMenuConfirmToss: @ 81ACF88 lsls r4, 3 ldr r0, =gTasks + 0x8 adds r4, r0 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] ldr r1, =gStringVar1 bl CopyItemName @@ -58243,7 +58243,7 @@ BagMenuActuallyToss: @ 81AD0CC lsls r4, 3 ldr r5, =gTasks + 0x8 adds r6, r4, r5 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] ldr r1, =gStringVar1 bl CopyItemName @@ -58313,7 +58313,7 @@ Task_ActuallyToss: @ 81AD150 beq _081AD1CE movs r0, 0x5 bl PlaySE - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] ldrh r1, [r5, 0x10] bl RemoveBagItem @@ -58370,7 +58370,7 @@ ItemMenu_Register: @ 81AD1EC ldr r0, [r0] ldr r2, =0x00000496 adds r1, r0, r2 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r2, [r0] ldrh r0, [r1] cmp r0, r2 @@ -58413,7 +58413,7 @@ ItemMenu_Give: @ 81AD278 lsrs r4, r0, 24 adds r6, r4, 0 bl bag_menu_remove_some_window - ldr r5, =gUnknown_0203CE7C + ldr r5, =gScriptItemId ldrh r0, [r5] bl itemid_80BF6D8_mail_related lsls r0, 24 @@ -58477,7 +58477,7 @@ bag_menu_print_cant_be_held_msg: @ 81AD30C adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] ldr r1, =gStringVar1 bl CopyItemName @@ -58568,7 +58568,7 @@ ItemMenu_UseInBattle: @ 81AD3DC push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r4, =gUnknown_0203CE7C + ldr r4, =gScriptItemId ldrh r0, [r4] bl ItemId_GetBattleFunc cmp r0, 0 @@ -58602,7 +58602,7 @@ item_menu_type_2: @ 81AD41C push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r4, =gUnknown_0203CE7C + ldr r4, =gScriptItemId ldrh r0, [r4] bl itemid_80BF6D8_mail_related lsls r0, 24 @@ -58663,7 +58663,7 @@ item_menu_type_b: @ 81AD4B4 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r5, =gUnknown_0203CE7C + ldr r5, =gScriptItemId ldrh r0, [r5] bl itemid_is_mail lsls r0, 24 @@ -58752,7 +58752,7 @@ _081AD550: bl player_bitmagic bl sub_808B864 bl sub_808BCF4 - ldr r2, =gUnknown_0203CE7C + ldr r2, =gScriptItemId ldr r0, [r4] adds r0, r5 ldrh r1, [r0] @@ -58799,7 +58799,7 @@ display_sell_item_ask_str: @ 81AD5DC lsls r0, 3 ldr r1, =gTasks + 0x8 adds r4, r0, r1 - ldr r6, =gUnknown_0203CE7C + ldr r6, =gScriptItemId ldrh r0, [r6] bl itemid_get_market_price lsls r0, 16 @@ -58862,7 +58862,7 @@ sub_81AD680: @ 81AD680 ldr r0, =gTasks + 0x8 adds r4, r0 ldr r6, =gStringVar1 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] bl itemid_get_market_price lsls r0, 16 @@ -58945,7 +58945,7 @@ sub_81AD730: @ 81AD730 adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] bl itemid_get_market_price lsls r0, 16 @@ -58997,7 +58997,7 @@ sub_81AD794: @ 81AD794 ldrb r4, [r0] movs r2, 0x10 ldrsh r5, [r6, r2] - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] bl itemid_get_market_price lsls r0, 16 @@ -59062,7 +59062,7 @@ sub_81AD84C: @ 81AD84C lsls r4, 3 ldr r0, =gTasks + 0x8 adds r4, r0 - ldr r6, =gUnknown_0203CE7C + ldr r6, =gScriptItemId ldrh r0, [r6] ldr r1, =gStringVar2 bl CopyItemName @@ -59123,7 +59123,7 @@ sub_81AD8C8: @ 81AD8C8 adds r5, r0 movs r0, 0x5F bl PlaySE - ldr r2, =gUnknown_0203CE7C + ldr r2, =gScriptItemId mov r8, r2 ldrh r0, [r2] mov r3, r10 @@ -59242,7 +59242,7 @@ display_deposit_item_ask_str: @ 81AD9EC b _081ADA5E .pool _081ADA18: - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] ldr r1, =gStringVar1 bl CopyItemName @@ -59367,7 +59367,7 @@ sub_81ADB14: @ 81ADB14 movs r0, 0x1 movs r1, 0 bl FillWindowPixelBuffer - ldr r4, =gUnknown_0203CE7C + ldr r4, =gScriptItemId ldrh r0, [r4] bl itemid_is_unique lsls r0, 24 @@ -59691,7 +59691,7 @@ _081ADDEC: ldrb r0, [r4] movs r1, 0x2 bl bag_menu_print_cursor_ - ldr r1, =gUnknown_0203CE7C + ldr r1, =gScriptItemId movs r0, 0x4 strh r0, [r1] adds r0, r5, 0 @@ -59727,7 +59727,7 @@ unknown_ItemMenu_Show: @ 81ADE38 lsls r4, 24 lsrs r4, 24 ldr r1, =gSpecialVar_0x8005 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] strh r0, [r1] ldr r1, =gScriptResult @@ -59761,7 +59761,7 @@ unknown_ItemMenu_Give2: @ 81ADE8C adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] movs r1, 0x1 bl RemoveBagItem @@ -65475,7 +65475,7 @@ sub_81B0BFC: @ 81B0BFC muls r1, r0 ldr r0, =gPlayerParty adds r6, r1, r0 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r4, [r0] ldr r0, =gUnknown_0203CEC8 ldrb r0, [r0, 0xB] @@ -72001,7 +72001,7 @@ c2_8123744: @ 81B41F0 mov r7, r8 push {r7} sub sp, 0xC - ldr r6, =gUnknown_0203CE7C + ldr r6, =gScriptItemId ldrh r0, [r6] cmp r0, 0 bne _081B4224 @@ -72107,7 +72107,7 @@ sub_81B42D0: @ 81B42D0 ands r0, r1 cmp r0, 0 bne _081B432C - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r4, [r0] ldr r0, =gUnknown_0203CEC8 mov r8, r0 @@ -72231,7 +72231,7 @@ _081B43FC: beq _081B44DE b _081B44EC _081B4402: - ldr r5, =gUnknown_0203CE7C + ldr r5, =gScriptItemId ldrh r0, [r5] movs r1, 0x1 bl RemoveBagItem @@ -72474,7 +72474,7 @@ sub_81B4624: @ 81B4624 muls r0, r1 ldr r1, =gPlayerParty adds r0, r1 - ldr r1, =gUnknown_0203CE7C + ldr r1, =gScriptItemId ldrh r1, [r1] movs r2, 0 movs r3, 0 @@ -72482,7 +72482,7 @@ sub_81B4624: @ 81B4624 b _081B467C .pool _081B4670: - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] ldrh r1, [r1] movs r2, 0 @@ -75621,7 +75621,7 @@ _081B61BC: movs r7, 0 movs r6, 0 _081B61C0: - ldr r4, =gUnknown_0203CE7C + ldr r4, =gScriptItemId ldrh r0, [r4] bl GetItemEffectType lsls r0, 24 @@ -76049,7 +76049,7 @@ ItemUseCB_Medicine: @ 81B6588 muls r1, r0 ldr r0, =gPlayerParty adds r5, r1, r0 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r6, [r0] adds r0, r5, 0 adds r1, r6, 0 @@ -76294,7 +76294,7 @@ sub_81B67C8: @ 81B67C8 muls r1, r0 ldr r0, =gPlayerParty adds r5, r1, r0 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r6, [r0] adds r0, r6, 0 bl GetItemEffectType @@ -76653,7 +76653,7 @@ dp05_ether: @ 81B6AFC push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] cmp r0, 0xAF bne _081B6B20 @@ -76762,7 +76762,7 @@ ether_effect_related: @ 81B6BEC lsrs r6, r0, 24 movs r4, 0 ldr r7, =gUnknown_0203CED6 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r5, [r0] movs r0, 0xE negs r0, r0 @@ -76991,7 +76991,7 @@ sub_81B6DC4: @ 81B6DC4 movs r0, 0xE adds r0, r7 mov r8, r0 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r4, [r0] ldr r1, =gStringVar1 adds r0, r5, 0 @@ -77080,7 +77080,7 @@ sub_81B6EB4: @ 81B6EB4 adds r5, r1, r0 adds r6, r2, 0 adds r6, 0xE - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r4, [r0] movs r1, 0x2 ldrsh r0, [r6, r1] @@ -77671,7 +77671,7 @@ dp05_rare_candy: @ 81B7404 movs r1, 0x86 lsls r1, 2 adds r4, r6, r1 - ldr r2, =gUnknown_0203CE7C + ldr r2, =gScriptItemId mov r8, r2 adds r0, r5, 0 movs r1, 0x38 @@ -77729,7 +77729,7 @@ _081B74B4: ldrb r0, [r0, 0x9] adds r1, r5, 0 bl sub_81B754C - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] movs r1, 0x1 bl RemoveBagItem @@ -78346,7 +78346,7 @@ sub_81B7A28: @ 81B7A28 lsls r0, 16 lsrs r7, r0, 16 ldrb r0, [r6, 0x9] - ldr r1, =gUnknown_0203CE7C + ldr r1, =gScriptItemId ldrh r1, [r1] movs r2, 0 bl ExecuteTableBasedItemEffect__ @@ -78498,7 +78498,7 @@ _081B7BC8: ldr r1, =gUnknown_0203CEE8 movs r0, 0x1 strb r0, [r1] - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] movs r1, 0x1 bl RemoveBagItem @@ -78574,7 +78574,7 @@ sub_81B7C74: @ 81B7C74 ldr r0, [r1] str r0, [r2] ldrb r0, [r1, 0x9] - ldr r4, =gUnknown_0203CE7C + ldr r4, =gScriptItemId ldrh r1, [r4] movs r2, 0 bl ExecuteTableBasedItemEffect__ @@ -78947,7 +78947,7 @@ _081B7F72: movs r3, 0 bl sub_81B0038 ldr r1, =gUnknown_0203CEC8 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] strh r0, [r1, 0xC] add sp, 0xC diff --git a/asm/rom_81BE66C.s b/asm/rom_81BE66C.s index 119556f70..4a53cd463 100644 --- a/asm/rom_81BE66C.s +++ b/asm/rom_81BE66C.s @@ -225,7 +225,7 @@ sub_81BE808: @ 81BE808 lsls r2, r0, 3 adds r2, r0 lsls r2, 2 - ldr r4, =gUnknown_02037350 + ldr r4, =gMapObjects adds r2, r4 ldr r3, =gSprites ldrb r1, [r2, 0x4] @@ -13574,7 +13574,7 @@ _081C5C5C: _081C5C88: movs r0, 0x5 bl PlaySE - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId strh r4, [r0] adds r0, r5, 0 bl sub_81C5B14 @@ -13583,7 +13583,7 @@ _081C5C88: _081C5CA0: movs r0, 0x5 bl PlaySE - ldr r2, =gUnknown_0203CE7C + ldr r2, =gScriptItemId mov r12, r2 ldr r0, =gSaveBlock2Ptr ldr r2, [r0] @@ -13670,7 +13670,7 @@ sub_81C5D20: @ 81C5D20 b _081C5DD8 .pool _081C5D74: - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] bl ItemId_GetBattleUsage lsls r0, 24 @@ -13711,7 +13711,7 @@ _081C5DCE: _081C5DD8: strb r0, [r1] _081C5DDA: - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] ldr r1, =gStringVar1 bl CopyItemName @@ -14184,7 +14184,7 @@ sub_81C61E0: @ 81C61E0 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r4, =gUnknown_0203CE7C + ldr r4, =gScriptItemId ldrh r0, [r4] bl ItemId_GetPocket lsls r0, 24 @@ -14304,7 +14304,7 @@ sub_81C62C4: @ 81C62C4 b _081C6334 .pool _081C62F4: - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] ldr r1, =gStringVar1 bl CopyItemName @@ -14351,7 +14351,7 @@ sub_81C6350: @ 81C6350 lsls r4, 3 ldr r0, =gTasks + 0x8 adds r4, r0 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] ldr r1, =gStringVar1 bl CopyItemName @@ -14566,7 +14566,7 @@ sub_81C654C: @ 81C654C lsls r4, 3 ldr r5, =gTasks + 0x8 adds r6, r4, r5 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] ldr r1, =gStringVar1 bl CopyItemName @@ -14624,7 +14624,7 @@ sub_81C65CC: @ 81C65CC beq _081C662E movs r0, 0x5 bl PlaySE - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] ldrh r1, [r4, 0x10] bl RemovePyramidBagItem @@ -14660,7 +14660,7 @@ sub_81C6648: @ 81C6648 lsrs r4, r0, 24 adds r6, r4, 0 bl sub_81C61A8 - ldr r5, =gUnknown_0203CE7C + ldr r5, =gScriptItemId ldrh r0, [r5] bl itemid_is_mail lsls r0, 24 @@ -14702,7 +14702,7 @@ sub_81C66AC: @ 81C66AC adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r0, =gUnknown_0203CE7C + ldr r0, =gScriptItemId ldrh r0, [r0] ldr r1, =gStringVar1 bl CopyItemName @@ -14774,7 +14774,7 @@ sub_81C674C: @ 81C674C lsls r0, 24 lsrs r4, r0, 24 adds r6, r4, 0 - ldr r5, =gUnknown_0203CE7C + ldr r5, =gScriptItemId ldrh r0, [r5] bl itemid_80BF6D8_mail_related lsls r0, 24 @@ -14809,7 +14809,7 @@ sub_81C679C: @ 81C679C push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r4, =gUnknown_0203CE7C + ldr r4, =gScriptItemId ldrh r0, [r4] bl ItemId_GetBattleFunc cmp r0, 0 @@ -42692,7 +42692,7 @@ sub_81D427C: @ 81D427C lsls r1, r0, 3 adds r1, r0 lsls r1, 2 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects adds r5, r1, r2 ldr r4, =gUnknown_030012F8 ldr r3, =gUnknown_02037590 @@ -42730,7 +42730,7 @@ _081D42CA: mov r8, r0 cmp r0, 0x3 bls _081D42CA - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldr r0, =gUnknown_02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 @@ -42786,7 +42786,7 @@ _081D4356: _081D4360: movs r4, 0 mov r8, r4 - ldr r6, =gUnknown_02037350 + ldr r6, =gMapObjects mov r10, r6 _081D4368: ldr r3, =gUnknown_02037590 @@ -42804,7 +42804,7 @@ _081D4368: ldrsh r2, [r4, r6] movs r6, 0 ldrsh r0, [r0, r6] - ldr r6, =gUnknown_02037350 + ldr r6, =gMapObjects mov r9, r6 mov r12, r3 adds r7, r1, 0 @@ -42952,7 +42952,7 @@ _081D449E: ldrsh r1, [r4, r3] movs r3, 0 ldrsh r0, [r0, r3] - ldr r3, =gUnknown_02037350 + ldr r3, =gMapObjects mov r9, r3 mov r12, r2 cmp r1, r0 @@ -43210,7 +43210,7 @@ _081D46D0: ldrsh r0, [r0, r3] cmp r0, 0 bne _081D476E - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldr r0, =gUnknown_02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 @@ -43235,7 +43235,7 @@ _081D46D0: beq _081D470C b _081D447C _081D470C: - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldr r0, =gUnknown_02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 @@ -43289,7 +43289,7 @@ _081D476E: ldrsh r0, [r0, r2] cmp r0, 0 bne _081D480C - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldr r0, =gUnknown_02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 @@ -43314,7 +43314,7 @@ _081D476E: beq _081D47AA b _081D45AA _081D47AA: - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects ldr r0, =gUnknown_02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 @@ -43385,7 +43385,7 @@ sub_81D4834: @ 81D4834 lsls r0, 16 lsls r1, 16 lsrs r4, r1, 16 - ldr r3, =gUnknown_02037350 + ldr r3, =gMapObjects ldr r1, =gUnknown_02037590 ldrb r2, [r1, 0x5] lsls r1, r2, 3 @@ -43436,7 +43436,7 @@ sub_81D4890: @ 81D4890 lsls r1, r0, 3 adds r1, r0 lsls r1, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r4, r1, r0 movs r1, 0 ldr r3, =gUnknown_030012FC @@ -43684,7 +43684,7 @@ sub_81D4A90: @ 81D4A90 lsls r1, r0, 3 adds r1, r0 lsls r1, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r5, r1, r0 ldrb r1, [r5, 0x1] movs r0, 0x21 @@ -46426,7 +46426,7 @@ GetTrainerHillTrainerFlag: @ 81D619C bl sub_81D5520 lsls r0, 24 lsrs r0, 23 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects lsls r1, r4, 3 adds r1, r4 lsls r1, 2 diff --git a/asm/scrcmd.s b/asm/scrcmd.s index 2cef4b0b0..139f1cf8e 100644 --- a/asm/scrcmd.s +++ b/asm/scrcmd.s @@ -2987,8 +2987,8 @@ sA9_unknown: @ 809A974 thumb_func_start s5A_face_player s5A_face_player: @ 809A9A4 push {r4,lr} - ldr r2, =gUnknown_02037350 - ldr r0, =gUnknown_03005DF0 + ldr r2, =gMapObjects + ldr r0, =gSelectedMapObject ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 @@ -3163,8 +3163,8 @@ sub_809AAEC: @ 809AAEC movs r0, 0 b _0809AB3A _0809AAFC: - ldr r2, =gUnknown_02037350 - ldr r0, =gUnknown_03005DF0 + ldr r2, =gMapObjects + ldr r0, =gSelectedMapObject ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 @@ -3208,7 +3208,7 @@ s6B_release: @ 809AB44 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 bl FieldObjectClearAnimIfSpecialAnimFinished bl sub_80D338C @@ -3223,8 +3223,8 @@ s6B_release: @ 809AB44 s6C_release_2: @ 809AB7C push {r4,lr} bl textbox_close - ldr r4, =gUnknown_02037350 - ldr r0, =gUnknown_03005DF0 + ldr r4, =gMapObjects + ldr r0, =gSelectedMapObject ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 @@ -5379,7 +5379,7 @@ sub_809BBDC: @ 809BBDC sub_809BBE8: @ 809BBE8 push {lr} bl sub_80B47BC - ldr r1, =gUnknown_03005DF0 + ldr r1, =gSelectedMapObject strb r0, [r1] movs r0, 0 pop {r1} @@ -5397,8 +5397,8 @@ sub_809BBFC: @ 809BBFC movs r0, 0 b _0809BC30 _0809BC0C: - ldr r2, =gUnknown_02037350 - ldr r0, =gUnknown_03005DF0 + ldr r2, =gMapObjects + ldr r0, =gSelectedMapObject ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 diff --git a/asm/script_pokemon_util_80F87D8.s b/asm/script_pokemon_util_80F87D8.s index c0bcb5a6e..e5193c4d2 100644 --- a/asm/script_pokemon_util_80F87D8.s +++ b/asm/script_pokemon_util_80F87D8.s @@ -508,7 +508,7 @@ _080F8BBA: bl GetFieldObjectIdByLocalIdAndMap lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_02037350 + ldr r2, =gMapObjects lsls r1, r0, 3 adds r1, r0 lsls r1, 2 diff --git a/asm/secret_base.s b/asm/secret_base.s index 286033edd..4e2ac0c9b 100644 --- a/asm/secret_base.s +++ b/asm/secret_base.s @@ -756,7 +756,7 @@ sub_80E90C8: @ 80E90C8 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 movs r1, 0x2 bl FieldObjectTurn diff --git a/asm/shop.s b/asm/shop.s index e5be4cd20..268f5911a 100644 --- a/asm/shop.s +++ b/asm/shop.s @@ -1633,7 +1633,7 @@ _080E07AA: lsrs r0, 24 mov r1, r12 strh r0, [r1] - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects lsls r0, r6, 3 adds r0, r6 lsls r0, 2 @@ -1730,7 +1730,7 @@ BuyMenuDrawFieldObjects: @ 80E08F0 movs r7, 0 ldr r0, =gUnknown_02039F70 mov r8, r0 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects mov r10, r1 ldr r2, =gSprites mov r9, r2 diff --git a/asm/trainer_see.s b/asm/trainer_see.s index cd9715a5c..d725b9f15 100644 --- a/asm/trainer_see.s +++ b/asm/trainer_see.s @@ -15,7 +15,7 @@ CheckForTrainersWantingBattle: @ 80B3BE8 ldr r0, =gUnknown_02038BFC strb r1, [r0] movs r4, 0 - ldr r6, =gUnknown_02037350 + ldr r6, =gMapObjects _080B3BF8: lsls r0, r4, 3 adds r0, r4 @@ -180,7 +180,7 @@ _080B3D56: lsls r4, r5, 3 adds r0, r4, r5 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 bl CheckIfTrainerCanApproachPlayer lsls r0, 24 @@ -227,7 +227,7 @@ _080B3D8A: mov r1, r8 adds r0, r1, r5 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r0, r1 subs r1, r6, 0x1 lsls r1, 24 @@ -691,7 +691,7 @@ c3_8081EDC: @ 80B4118 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r5, r0, r1 ldrb r0, [r5] lsls r0, 31 @@ -887,7 +887,7 @@ _080B427A: lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 adds r0, r4, 0 bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive @@ -906,7 +906,7 @@ _080B42D2: lsls r4, r0, 3 adds r4, r0 lsls r4, 2 - ldr r0, =gUnknown_02037350 + ldr r0, =gMapObjects adds r4, r0 ldrb r0, [r5, 0x18] lsls r0, 28 @@ -941,7 +941,7 @@ sub_80B4318: @ 80B4318 lsls r0, r1, 3 adds r0, r1 lsls r0, 2 - ldr r1, =gUnknown_02037350 + ldr r1, =gMapObjects adds r4, r0, r1 adds r0, r4, 0 bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive diff --git a/charmap.txt b/charmap.txt index b3e876a87..f698701c4 100644 --- a/charmap.txt +++ b/charmap.txt @@ -143,7 +143,7 @@ RIGHT_ARROW = 7C 'Ãœ' = F3 'ä' = F4 'ö' = F5 -'ü' = F6 +'ü' = F6 TALL_PLUS = FC 0C FB '$' = FF diff --git a/data/data3_a1.s b/data/data3_a1.s index 6532e6da3..20eb6d6a6 100644 --- a/data/data3_a1.s +++ b/data/data3_a1.s @@ -8,8 +8,11 @@ gUnknown_0858AB24:: @ 858AB24 .incbin "baserom.gba", 0x58ab24, 0xac -gUnknown_0858ABD0:: @ 858ABD0 - .incbin "baserom.gba", 0x58abd0, 0xb90 +gBlankBerryTree:: @ 858ABD0 + .4byte 0x0, 0x0 + +gUnknown_0858ABD8:: @ 858ABD8 + .incbin "baserom.gba", 0x58abd8, 0xb88 gUnknown_0858B760:: @ 858B760 .incbin "baserom.gba", 0x58b760, 0x390 diff --git a/data/event_scripts.s b/data/event_scripts.s index cef599407..f058d75db 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -198,7 +198,7 @@ gUnknown_08273D1F:: @ 8273D1F gUnknown_082742E6:: @ 82742E6 .incbin "baserom.gba", 0x2742e6, 0x13 -gUnknown_082742F9:: @ 82742F9 +BerryTreeScript:: @ 82742F9 .incbin "baserom.gba", 0x2742f9, 0x189 gUnknown_08274482:: @ 8274482 diff --git a/include/berry.h b/include/berry.h index f0acbe0ad..7c2636411 100644 --- a/include/berry.h +++ b/include/berry.h @@ -37,12 +37,14 @@ u8 CalcBerryYieldInternal(u16 max, u16 min, u8 water); u8 CalcBerryYield(struct BerryTree *tree); u8 GetBerryCountByBerryTreeId(u8 id); u16 GetStageDurationByBerryType(u8); +void Bag_ChooseBerry(void); void FieldObjectInteractionGetBerryTreeData(void); -void sub_80B4EE4(void); void FieldObjectInteractionPlantBerryTree(void); void FieldObjectInteractionPickBerryTree(void); void FieldObjectInteractionRemoveBerryTree(void); u8 PlayerHasBerries(void); void ResetBerryTreeSparkleFlags(void); +extern const struct Berry gBerries[]; + #endif // GUARD_BERRY_H diff --git a/include/fieldmap.h b/include/fieldmap.h new file mode 100644 index 000000000..f3b5a7668 --- /dev/null +++ b/include/fieldmap.h @@ -0,0 +1,6 @@ +#ifndef GUARD_FIELDMAP_H +#define GUARD_FIELDMAP_H + +void GetCameraCoords(u16*, u16*); + +#endif // GUARD_FIELDMAP_H diff --git a/include/global.berry.h b/include/global.berry.h index 6695a9f4b..a77da20ba 100644 --- a/include/global.berry.h +++ b/include/global.berry.h @@ -42,10 +42,6 @@ struct Berry2 struct EnigmaBerry { struct Berry2 berry; - u8 pic[(6 * 6) * TILE_SIZE_4BPP]; - u16 palette[16]; - u8 description1[45]; - u8 description2[45]; u8 itemEffect[18]; u8 holdEffect; u8 holdEffectParam; diff --git a/include/global.h b/include/global.h index 32c13d86c..5340a9790 100644 --- a/include/global.h +++ b/include/global.h @@ -649,8 +649,9 @@ struct DaycareData u8 stepCounter; }; -#define FLAGS_NUMBER 300 -#define VARS_NUMBER 256 +#define BERRY_TREES_NUMBER 128 +#define FLAGS_NUMBER 300 +#define VARS_NUMBER 256 struct SaveBlock1 { @@ -688,7 +689,7 @@ struct SaveBlock1 /*0x1270*/ u8 flags[FLAGS_NUMBER]; /*0x139C*/ u16 vars[VARS_NUMBER]; /*0x159C*/ u32 gameStats[NUM_GAME_STATS]; - /*0x169C*/ struct BerryTree berryTrees[128]; + /*0x169C*/ struct BerryTree berryTrees[BERRY_TREES_NUMBER]; /*0x1A9C*/ struct SecretBaseRecord secretBases[20]; /*0x271C*/ u8 playerRoomDecor[12]; /*0x2728*/ u8 playerRoomDecorPos[12]; @@ -731,6 +732,7 @@ struct SaveBlock1 /*0x31A8*/ u8 giftRibbons[52]; /*0x31DC*/ struct Roamer roamer; /*0x31F8*/ struct EnigmaBerry enigmaBerry; + /*0x322C*/ u8 field_322C[1276]; /*0x3728*/ struct RamScript ramScript; /*0x3B14*/ struct RecordMixingGift recordMixingGift; /*0x3B24*/ u8 seen2[52]; diff --git a/ld_script.txt b/ld_script.txt index 7151e2959..5ff90ee52 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -136,7 +136,6 @@ SECTIONS { asm/contest.o(.text); asm/shop.o(.text); src/berry.o(.text); - asm/berry.o(.text); asm/script_menu.o(.text); asm/naming_screen.o(.text); src/money.o(.text); @@ -305,6 +304,7 @@ SECTIONS { data/data2c.o(.rodata); src/trig.o(.rodata); data/data3.o(.rodata); + src/berry.o(.rodata); data/data3_a1.o(.rodata); src/pokemon_size_record.o(.rodata) data/data3a.o(.rodata) diff --git a/src/berry.c b/src/berry.c index 9065261f0..ffd30d47f 100644 --- a/src/berry.c +++ b/src/berry.c @@ -1,5 +1,23 @@ #include "global.h" #include "berry.h" +#include "main.h" +#include "item.h" +#include "items.h" +#include "text.h" +#include "rng.h" +#include "event_data.h" +#include "fieldmap.h" + +extern u8 FieldObjectGetBerryTreeId(u8 mapObjectId); +extern void sub_8092EF0(u8 mapId, u8 mapNumber, u8 mapGroup); +extern void CB2_ChooseBerry(void); +extern const u8* GetFieldObjectScriptPointerForComparison(void); +extern bool8 sub_8092E9C(u8, u8, u8); + +extern u16 gScriptItemId; + +extern const u8 BerryTreeScript[]; +extern const struct BerryTree gBlankBerryTree; #define BERRY_NAME_LENGTH 6 @@ -53,93 +71,92 @@ #endif // ENGLISH -const u8 gBerryDescriptionPart1_Cheri[] = _("Blooms with delicate pretty flowers."); -const u8 gBerryDescriptionPart2_Cheri[] = _("The bright red BERRY is very spicy."); -const u8 gBerryDescriptionPart1_Chesto[] = _("The BERRY’s thick skin and fruit are"); -const u8 gBerryDescriptionPart2_Chesto[] = _("very tough. It is dry-tasting all over."); -const u8 gBerryDescriptionPart1_Pecha[] = _("Very sweet and delicious."); -const u8 gBerryDescriptionPart2_Pecha[] = _("Also very tender - handle with care."); -const u8 gBerryDescriptionPart1_Rawst[] = _("If the leaves grow long and curly,"); -const u8 gBerryDescriptionPart2_Rawst[] = _("the BERRY seems to grow very bitter."); -const u8 gBerryDescriptionPart1_Aspear[] = _("The hard BERRY is dense with a rich"); -const u8 gBerryDescriptionPart2_Aspear[] = _("juice. It is quite sour."); -const u8 gBerryDescriptionPart1_Leppa[] = _("Grows slower than CHERI and others."); -const u8 gBerryDescriptionPart2_Leppa[] = _("The smaller the BERRY, the tastier."); -const u8 gBerryDescriptionPart1_Oran[] = _("A peculiar BERRY with a mix of flavors."); -const u8 gBerryDescriptionPart2_Oran[] = _("BERRIES grow in half a day."); -const u8 gBerryDescriptionPart1_Persim[] = _("Loves sunlight. The BERRY’s color"); -const u8 gBerryDescriptionPart2_Persim[] = _("grows vivid when exposed to the sun."); -const u8 gBerryDescriptionPart1_Lum[] = _("Slow to grow. If raised with loving"); -const u8 gBerryDescriptionPart2_Lum[] = _("care, it may grow two BERRIES."); -const u8 gBerryDescriptionPart1_Sitrus[] = _("Closely related to ORAN. The large"); -const u8 gBerryDescriptionPart2_Sitrus[] = _("BERRY has a well-rounded flavor."); -const u8 gBerryDescriptionPart1_Figy[] = _("The BERRY, which looks chewed up,"); -const u8 gBerryDescriptionPart2_Figy[] = _("brims with spicy substances."); -const u8 gBerryDescriptionPart1_Wiki[] = _("The BERRY is said to have grown lumpy"); -const u8 gBerryDescriptionPart2_Wiki[] = _("to help POKéMON grip it."); -const u8 gBerryDescriptionPart1_Mago[] = _("The BERRY turns curvy as it grows."); -const u8 gBerryDescriptionPart2_Mago[] = _("The curvier, the sweeter and tastier."); -const u8 gBerryDescriptionPart1_Aguav[] = _("The flower is dainty. It is rare in its"); -const u8 gBerryDescriptionPart2_Aguav[] = _("ability to grow without light."); -const u8 gBerryDescriptionPart1_Iapapa[] = _("The BERRY is very big and sour."); -const u8 gBerryDescriptionPart2_Iapapa[] = _("It takes at least a day to grow."); -const u8 gBerryDescriptionPart1_Razz[] = _("The red BERRY tastes slightly spicy."); -const u8 gBerryDescriptionPart2_Razz[] = _("It grows quickly in just four hours."); -const u8 gBerryDescriptionPart1_Bluk[] = _("The BERRY is blue on the outside, but"); -const u8 gBerryDescriptionPart2_Bluk[] = _("it blackens the mouth when eaten."); -const u8 gBerryDescriptionPart1_Nanab[] = _("This BERRY was the seventh"); -const u8 gBerryDescriptionPart2_Nanab[] = _("discovered in the world. It is sweet."); -const u8 gBerryDescriptionPart1_Wepear[] = _("The flower is small and white. It has a"); -const u8 gBerryDescriptionPart2_Wepear[] = _("delicate balance of bitter and sour."); -const u8 gBerryDescriptionPart1_Pinap[] = _("Weak against wind and cold."); -const u8 gBerryDescriptionPart2_Pinap[] = _("The fruit is spicy and the skin, sour."); -const u8 gBerryDescriptionPart1_Pomeg[] = _("However much it is watered,"); -const u8 gBerryDescriptionPart2_Pomeg[] = _("it only grows up to six BERRIES."); -const u8 gBerryDescriptionPart1_Kelpsy[] = _("A rare variety shaped like a root."); -const u8 gBerryDescriptionPart2_Kelpsy[] = _("Grows a very large flower."); -const u8 gBerryDescriptionPart1_Qualot[] = _("Loves water. Grows strong even in"); -const u8 gBerryDescriptionPart2_Qualot[] = _("locations with constant rainfall."); -const u8 gBerryDescriptionPart1_Hondew[] = _("A BERRY that is very valuable and"); -const u8 gBerryDescriptionPart2_Hondew[] = _("rarely seen. It is very delicious."); -const u8 gBerryDescriptionPart1_Grepa[] = _("Despite its tenderness and round"); -const u8 gBerryDescriptionPart2_Grepa[] = _("shape, the BERRY is unimaginably sour."); -const u8 gBerryDescriptionPart1_Tamato[] = _("The BERRY is lip-bendingly spicy."); -const u8 gBerryDescriptionPart2_Tamato[] = _("It takes time to grow."); -const u8 gBerryDescriptionPart1_Cornn[] = _("A BERRY from an ancient era. May not"); -const u8 gBerryDescriptionPart2_Cornn[] = _("grow unless planted in quantity."); -const u8 gBerryDescriptionPart1_Magost[] = _("A BERRY that is widely said to have"); -const u8 gBerryDescriptionPart2_Magost[] = _("a finely balanced flavor."); -const u8 gBerryDescriptionPart1_Rabuta[] = _("A rare variety that is overgrown with"); -const u8 gBerryDescriptionPart2_Rabuta[] = _("hair. It is quite bitter."); -const u8 gBerryDescriptionPart1_Nomel[] = _("Quite sour. Just one bite makes it"); -const u8 gBerryDescriptionPart2_Nomel[] = _("impossible to taste for three days."); -const u8 gBerryDescriptionPart1_Spelon[] = _("The vividly red BERRY is very spicy."); -const u8 gBerryDescriptionPart2_Spelon[] = _("Its warts secrete a spicy substance."); -const u8 gBerryDescriptionPart1_Pamtre[] = _("Drifts on the sea from somewhere."); -const u8 gBerryDescriptionPart2_Pamtre[] = _("It is thought to grow elsewhere."); -const u8 gBerryDescriptionPart1_Watmel[] = _("A huge BERRY, with some over 20"); -const u8 gBerryDescriptionPart2_Watmel[] = _("inches discovered. Exceedingly sweet."); -const u8 gBerryDescriptionPart1_Durin[] = _("Bitter to even look at. It is so"); -const u8 gBerryDescriptionPart2_Durin[] = _("bitter, no one has ever eaten it as is."); -const u8 gBerryDescriptionPart1_Belue[] = _("It is glossy and looks delicious, but"); -const u8 gBerryDescriptionPart2_Belue[] = _("it is awfully sour. Takes time to grow."); -const u8 gBerryDescriptionPart1_Liechi[] = _("A mysterious BERRY. It is rumored to"); -const u8 gBerryDescriptionPart2_Liechi[] = _("contain the power of the sea."); -const u8 gBerryDescriptionPart1_Ganlon[] = _("A mysterious BERRY. It is rumored to"); -const u8 gBerryDescriptionPart2_Ganlon[] = _("contain the power of the land."); -const u8 gBerryDescriptionPart1_Salac[] = _("A mysterious BERRY. It is rumored to"); -const u8 gBerryDescriptionPart2_Salac[] = _("contain the power of the sky."); -const u8 gBerryDescriptionPart1_Petaya[] = _("A mysterious BERRY. It is rumored to"); -const u8 gBerryDescriptionPart2_Petaya[] = _("contain the power of all living things."); -const u8 gBerryDescriptionPart1_Apicot[] = _("A very mystifying BERRY. No telling"); -const u8 gBerryDescriptionPart2_Apicot[] = _("what may happen or how it can be used."); -const u8 gBerryDescriptionPart1_Lansat[] = _("Said to be a legendary BERRY."); -const u8 gBerryDescriptionPart2_Lansat[] = _("Holding it supposedly brings joy."); -const u8 gBerryDescriptionPart1_Starf[] = _("So strong, it was abandoned at the"); -const u8 gBerryDescriptionPart2_Starf[] = _("world’s edge. Considered a mirage."); -const u8 gBerryDescriptionPart1_Enigma[] = _("A completely enigmatic BERRY."); -const u8 gBerryDescriptionPart2_Enigma[] = _("Appears to have the power of stars."); - +static const u8 sBerryDescriptionPart1_Cheri[] = _("Blooms with delicate pretty flowers."); +static const u8 sBerryDescriptionPart2_Cheri[] = _("The bright red BERRY is very spicy."); +static const u8 sBerryDescriptionPart1_Chesto[] = _("The BERRY’s thick skin and fruit are"); +static const u8 sBerryDescriptionPart2_Chesto[] = _("very tough. It is dry-tasting all over."); +static const u8 sBerryDescriptionPart1_Pecha[] = _("Very sweet and delicious."); +static const u8 sBerryDescriptionPart2_Pecha[] = _("Also very tender - handle with care."); +static const u8 sBerryDescriptionPart1_Rawst[] = _("If the leaves grow long and curly,"); +static const u8 sBerryDescriptionPart2_Rawst[] = _("the BERRY seems to grow very bitter."); +static const u8 sBerryDescriptionPart1_Aspear[] = _("The hard BERRY is dense with a rich"); +static const u8 sBerryDescriptionPart2_Aspear[] = _("juice. It is quite sour."); +static const u8 sBerryDescriptionPart1_Leppa[] = _("Grows slower than CHERI and others."); +static const u8 sBerryDescriptionPart2_Leppa[] = _("The smaller the BERRY, the tastier."); +static const u8 sBerryDescriptionPart1_Oran[] = _("A peculiar BERRY with a mix of flavors."); +static const u8 sBerryDescriptionPart2_Oran[] = _("BERRIES grow in half a day."); +static const u8 sBerryDescriptionPart1_Persim[] = _("Loves sunlight. The BERRY’s color"); +static const u8 sBerryDescriptionPart2_Persim[] = _("grows vivid when exposed to the sun."); +static const u8 sBerryDescriptionPart1_Lum[] = _("Slow to grow. If raised with loving"); +static const u8 sBerryDescriptionPart2_Lum[] = _("care, it may grow two BERRIES."); +static const u8 sBerryDescriptionPart1_Sitrus[] = _("Closely related to ORAN. The large"); +static const u8 sBerryDescriptionPart2_Sitrus[] = _("BERRY has a well-rounded flavor."); +static const u8 sBerryDescriptionPart1_Figy[] = _("The BERRY, which looks chewed up,"); +static const u8 sBerryDescriptionPart2_Figy[] = _("brims with spicy substances."); +static const u8 sBerryDescriptionPart1_Wiki[] = _("The BERRY is said to have grown lumpy"); +static const u8 sBerryDescriptionPart2_Wiki[] = _("to help POKéMON grip it."); +static const u8 sBerryDescriptionPart1_Mago[] = _("The BERRY turns curvy as it grows."); +static const u8 sBerryDescriptionPart2_Mago[] = _("The curvier, the sweeter and tastier."); +static const u8 sBerryDescriptionPart1_Aguav[] = _("The flower is dainty. It is rare in its"); +static const u8 sBerryDescriptionPart2_Aguav[] = _("ability to grow without light."); +static const u8 sBerryDescriptionPart1_Iapapa[] = _("The BERRY is very big and sour."); +static const u8 sBerryDescriptionPart2_Iapapa[] = _("It takes at least a day to grow."); +static const u8 sBerryDescriptionPart1_Razz[] = _("The red BERRY tastes slightly spicy."); +static const u8 sBerryDescriptionPart2_Razz[] = _("It grows quickly in just four hours."); +static const u8 sBerryDescriptionPart1_Bluk[] = _("The BERRY is blue on the outside, but"); +static const u8 sBerryDescriptionPart2_Bluk[] = _("it blackens the mouth when eaten."); +static const u8 sBerryDescriptionPart1_Nanab[] = _("This BERRY was the seventh"); +static const u8 sBerryDescriptionPart2_Nanab[] = _("discovered in the world. It is sweet."); +static const u8 sBerryDescriptionPart1_Wepear[] = _("The flower is small and white. It has a"); +static const u8 sBerryDescriptionPart2_Wepear[] = _("delicate balance of bitter and sour."); +static const u8 sBerryDescriptionPart1_Pinap[] = _("Weak against wind and cold."); +static const u8 sBerryDescriptionPart2_Pinap[] = _("The fruit is spicy and the skin, sour."); +static const u8 sBerryDescriptionPart1_Pomeg[] = _("However much it is watered,"); +static const u8 sBerryDescriptionPart2_Pomeg[] = _("it only grows up to six BERRIES."); +static const u8 sBerryDescriptionPart1_Kelpsy[] = _("A rare variety shaped like a root."); +static const u8 sBerryDescriptionPart2_Kelpsy[] = _("Grows a very large flower."); +static const u8 sBerryDescriptionPart1_Qualot[] = _("Loves water. Grows strong even in"); +static const u8 sBerryDescriptionPart2_Qualot[] = _("locations with constant rainfall."); +static const u8 sBerryDescriptionPart1_Hondew[] = _("A BERRY that is very valuable and"); +static const u8 sBerryDescriptionPart2_Hondew[] = _("rarely seen. It is very delicious."); +static const u8 sBerryDescriptionPart1_Grepa[] = _("Despite its tenderness and round"); +static const u8 sBerryDescriptionPart2_Grepa[] = _("shape, the BERRY is unimaginably sour."); +static const u8 sBerryDescriptionPart1_Tamato[] = _("The BERRY is lip-bendingly spicy."); +static const u8 sBerryDescriptionPart2_Tamato[] = _("It takes time to grow."); +static const u8 sBerryDescriptionPart1_Cornn[] = _("A BERRY from an ancient era. May not"); +static const u8 sBerryDescriptionPart2_Cornn[] = _("grow unless planted in quantity."); +static const u8 sBerryDescriptionPart1_Magost[] = _("A BERRY that is widely said to have"); +static const u8 sBerryDescriptionPart2_Magost[] = _("a finely balanced flavor."); +static const u8 sBerryDescriptionPart1_Rabuta[] = _("A rare variety that is overgrown with"); +static const u8 sBerryDescriptionPart2_Rabuta[] = _("hair. It is quite bitter."); +static const u8 sBerryDescriptionPart1_Nomel[] = _("Quite sour. Just one bite makes it"); +static const u8 sBerryDescriptionPart2_Nomel[] = _("impossible to taste for three days."); +static const u8 sBerryDescriptionPart1_Spelon[] = _("The vividly red BERRY is very spicy."); +static const u8 sBerryDescriptionPart2_Spelon[] = _("Its warts secrete a spicy substance."); +static const u8 sBerryDescriptionPart1_Pamtre[] = _("Drifts on the sea from somewhere."); +static const u8 sBerryDescriptionPart2_Pamtre[] = _("It is thought to grow elsewhere."); +static const u8 sBerryDescriptionPart1_Watmel[] = _("A huge BERRY, with some over 20"); +static const u8 sBerryDescriptionPart2_Watmel[] = _("inches discovered. Exceedingly sweet."); +static const u8 sBerryDescriptionPart1_Durin[] = _("Bitter to even look at. It is so"); +static const u8 sBerryDescriptionPart2_Durin[] = _("bitter, no one has ever eaten it as is."); +static const u8 sBerryDescriptionPart1_Belue[] = _("It is glossy and looks delicious, but"); +static const u8 sBerryDescriptionPart2_Belue[] = _("it is awfully sour. Takes time to grow."); +static const u8 sBerryDescriptionPart1_Liechi[] = _("A mysterious BERRY. It is rumored to"); +static const u8 sBerryDescriptionPart2_Liechi[] = _("contain the power of the sea."); +static const u8 sBerryDescriptionPart1_Ganlon[] = _("A mysterious BERRY. It is rumored to"); +static const u8 sBerryDescriptionPart2_Ganlon[] = _("contain the power of the land."); +static const u8 sBerryDescriptionPart1_Salac[] = _("A mysterious BERRY. It is rumored to"); +static const u8 sBerryDescriptionPart2_Salac[] = _("contain the power of the sky."); +static const u8 sBerryDescriptionPart1_Petaya[] = _("A mysterious BERRY. It is rumored to"); +static const u8 sBerryDescriptionPart2_Petaya[] = _("contain the power of all living things."); +static const u8 sBerryDescriptionPart1_Apicot[] = _("A very mystifying BERRY. No telling"); +static const u8 sBerryDescriptionPart2_Apicot[] = _("what may happen or how it can be used."); +static const u8 sBerryDescriptionPart1_Lansat[] = _("Said to be a legendary BERRY."); +static const u8 sBerryDescriptionPart2_Lansat[] = _("Holding it supposedly brings joy."); +static const u8 sBerryDescriptionPart1_Starf[] = _("So strong, it was abandoned at the"); +static const u8 sBerryDescriptionPart2_Starf[] = _("world’s edge. Considered a mirage."); +static const u8 sBerryDescriptionPart1_Enigma[] = _("A completely enigmatic BERRY."); +static const u8 sBerryDescriptionPart2_Enigma[] = _("Appears to have the power of stars."); const struct Berry gBerries[] = { @@ -149,8 +166,8 @@ const struct Berry gBerries[] = .size = 20, .maxYield = 3, .minYield = 2, - .description1 = gBerryDescriptionPart1_Cheri, - .description2 = gBerryDescriptionPart2_Cheri, + .description1 = sBerryDescriptionPart1_Cheri, + .description2 = sBerryDescriptionPart2_Cheri, .stageDuration = 3, .spicy = 10, .dry = 0, @@ -165,8 +182,8 @@ const struct Berry gBerries[] = .size = 80, .maxYield = 3, .minYield = 2, - .description1 = gBerryDescriptionPart1_Chesto, - .description2 = gBerryDescriptionPart2_Chesto, + .description1 = sBerryDescriptionPart1_Chesto, + .description2 = sBerryDescriptionPart2_Chesto, .stageDuration = 3, .spicy = 0, .dry = 10, @@ -181,8 +198,8 @@ const struct Berry gBerries[] = .size = 40, .maxYield = 3, .minYield = 2, - .description1 = gBerryDescriptionPart1_Pecha, - .description2 = gBerryDescriptionPart2_Pecha, + .description1 = sBerryDescriptionPart1_Pecha, + .description2 = sBerryDescriptionPart2_Pecha, .stageDuration = 3, .spicy = 0, .dry = 0, @@ -197,8 +214,8 @@ const struct Berry gBerries[] = .size = 32, .maxYield = 3, .minYield = 2, - .description1 = gBerryDescriptionPart1_Rawst, - .description2 = gBerryDescriptionPart2_Rawst, + .description1 = sBerryDescriptionPart1_Rawst, + .description2 = sBerryDescriptionPart2_Rawst, .stageDuration = 3, .spicy = 0, .dry = 0, @@ -213,8 +230,8 @@ const struct Berry gBerries[] = .size = 50, .maxYield = 3, .minYield = 2, - .description1 = gBerryDescriptionPart1_Aspear, - .description2 = gBerryDescriptionPart2_Aspear, + .description1 = sBerryDescriptionPart1_Aspear, + .description2 = sBerryDescriptionPart2_Aspear, .stageDuration = 3, .spicy = 0, .dry = 0, @@ -229,8 +246,8 @@ const struct Berry gBerries[] = .size = 28, .maxYield = 3, .minYield = 2, - .description1 = gBerryDescriptionPart1_Leppa, - .description2 = gBerryDescriptionPart2_Leppa, + .description1 = sBerryDescriptionPart1_Leppa, + .description2 = sBerryDescriptionPart2_Leppa, .stageDuration = 4, .spicy = 10, .dry = 0, @@ -245,8 +262,8 @@ const struct Berry gBerries[] = .size = 35, .maxYield = 3, .minYield = 2, - .description1 = gBerryDescriptionPart1_Oran, - .description2 = gBerryDescriptionPart2_Oran, + .description1 = sBerryDescriptionPart1_Oran, + .description2 = sBerryDescriptionPart2_Oran, .stageDuration = 3, .spicy = 10, .dry = 10, @@ -261,8 +278,8 @@ const struct Berry gBerries[] = .size = 47, .maxYield = 3, .minYield = 2, - .description1 = gBerryDescriptionPart1_Persim, - .description2 = gBerryDescriptionPart2_Persim, + .description1 = sBerryDescriptionPart1_Persim, + .description2 = sBerryDescriptionPart2_Persim, .stageDuration = 3, .spicy = 10, .dry = 10, @@ -277,8 +294,8 @@ const struct Berry gBerries[] = .size = 34, .maxYield = 2, .minYield = 1, - .description1 = gBerryDescriptionPart1_Lum, - .description2 = gBerryDescriptionPart2_Lum, + .description1 = sBerryDescriptionPart1_Lum, + .description2 = sBerryDescriptionPart2_Lum, .stageDuration = 12, .spicy = 10, .dry = 10, @@ -293,8 +310,8 @@ const struct Berry gBerries[] = .size = 95, .maxYield = 3, .minYield = 2, - .description1 = gBerryDescriptionPart1_Sitrus, - .description2 = gBerryDescriptionPart2_Sitrus, + .description1 = sBerryDescriptionPart1_Sitrus, + .description2 = sBerryDescriptionPart2_Sitrus, .stageDuration = 6, .spicy = 10, .dry = 10, @@ -309,8 +326,8 @@ const struct Berry gBerries[] = .size = 100, .maxYield = 3, .minYield = 2, - .description1 = gBerryDescriptionPart1_Figy, - .description2 = gBerryDescriptionPart2_Figy, + .description1 = sBerryDescriptionPart1_Figy, + .description2 = sBerryDescriptionPart2_Figy, .stageDuration = 6, .spicy = 10, .dry = 0, @@ -325,8 +342,8 @@ const struct Berry gBerries[] = .size = 115, .maxYield = 3, .minYield = 2, - .description1 = gBerryDescriptionPart1_Wiki, - .description2 = gBerryDescriptionPart2_Wiki, + .description1 = sBerryDescriptionPart1_Wiki, + .description2 = sBerryDescriptionPart2_Wiki, .stageDuration = 6, .spicy = 0, .dry = 10, @@ -341,8 +358,8 @@ const struct Berry gBerries[] = .size = 126, .maxYield = 3, .minYield = 2, - .description1 = gBerryDescriptionPart1_Mago, - .description2 = gBerryDescriptionPart2_Mago, + .description1 = sBerryDescriptionPart1_Mago, + .description2 = sBerryDescriptionPart2_Mago, .stageDuration = 6, .spicy = 0, .dry = 0, @@ -357,8 +374,8 @@ const struct Berry gBerries[] = .size = 64, .maxYield = 3, .minYield = 2, - .description1 = gBerryDescriptionPart1_Aguav, - .description2 = gBerryDescriptionPart2_Aguav, + .description1 = sBerryDescriptionPart1_Aguav, + .description2 = sBerryDescriptionPart2_Aguav, .stageDuration = 6, .spicy = 0, .dry = 0, @@ -373,8 +390,8 @@ const struct Berry gBerries[] = .size = 223, .maxYield = 3, .minYield = 2, - .description1 = gBerryDescriptionPart1_Iapapa, - .description2 = gBerryDescriptionPart2_Iapapa, + .description1 = sBerryDescriptionPart1_Iapapa, + .description2 = sBerryDescriptionPart2_Iapapa, .stageDuration = 6, .spicy = 0, .dry = 0, @@ -389,8 +406,8 @@ const struct Berry gBerries[] = .size = 120, .maxYield = 6, .minYield = 3, - .description1 = gBerryDescriptionPart1_Razz, - .description2 = gBerryDescriptionPart2_Razz, + .description1 = sBerryDescriptionPart1_Razz, + .description2 = sBerryDescriptionPart2_Razz, .stageDuration = 1, .spicy = 10, .dry = 10, @@ -405,8 +422,8 @@ const struct Berry gBerries[] = .size = 108, .maxYield = 6, .minYield = 3, - .description1 = gBerryDescriptionPart1_Bluk, - .description2 = gBerryDescriptionPart2_Bluk, + .description1 = sBerryDescriptionPart1_Bluk, + .description2 = sBerryDescriptionPart2_Bluk, .stageDuration = 1, .spicy = 0, .dry = 10, @@ -421,8 +438,8 @@ const struct Berry gBerries[] = .size = 77, .maxYield = 6, .minYield = 3, - .description1 = gBerryDescriptionPart1_Nanab, - .description2 = gBerryDescriptionPart2_Nanab, + .description1 = sBerryDescriptionPart1_Nanab, + .description2 = sBerryDescriptionPart2_Nanab, .stageDuration = 1, .spicy = 0, .dry = 0, @@ -437,8 +454,8 @@ const struct Berry gBerries[] = .size = 74, .maxYield = 6, .minYield = 3, - .description1 = gBerryDescriptionPart1_Wepear, - .description2 = gBerryDescriptionPart2_Wepear, + .description1 = sBerryDescriptionPart1_Wepear, + .description2 = sBerryDescriptionPart2_Wepear, .stageDuration = 1, .spicy = 0, .dry = 0, @@ -453,8 +470,8 @@ const struct Berry gBerries[] = .size = 80, .maxYield = 6, .minYield = 3, - .description1 = gBerryDescriptionPart1_Pinap, - .description2 = gBerryDescriptionPart2_Pinap, + .description1 = sBerryDescriptionPart1_Pinap, + .description2 = sBerryDescriptionPart2_Pinap, .stageDuration = 1, .spicy = 10, .dry = 0, @@ -469,8 +486,8 @@ const struct Berry gBerries[] = .size = 135, .maxYield = 6, .minYield = 2, - .description1 = gBerryDescriptionPart1_Pomeg, - .description2 = gBerryDescriptionPart2_Pomeg, + .description1 = sBerryDescriptionPart1_Pomeg, + .description2 = sBerryDescriptionPart2_Pomeg, .stageDuration = 3, .spicy = 10, .dry = 0, @@ -485,8 +502,8 @@ const struct Berry gBerries[] = .size = 150, .maxYield = 6, .minYield = 2, - .description1 = gBerryDescriptionPart1_Kelpsy, - .description2 = gBerryDescriptionPart2_Kelpsy, + .description1 = sBerryDescriptionPart1_Kelpsy, + .description2 = sBerryDescriptionPart2_Kelpsy, .stageDuration = 3, .spicy = 0, .dry = 10, @@ -501,8 +518,8 @@ const struct Berry gBerries[] = .size = 110, .maxYield = 6, .minYield = 2, - .description1 = gBerryDescriptionPart1_Qualot, - .description2 = gBerryDescriptionPart2_Qualot, + .description1 = sBerryDescriptionPart1_Qualot, + .description2 = sBerryDescriptionPart2_Qualot, .stageDuration = 3, .spicy = 10, .dry = 0, @@ -517,8 +534,8 @@ const struct Berry gBerries[] = .size = 162, .maxYield = 6, .minYield = 2, - .description1 = gBerryDescriptionPart1_Hondew, - .description2 = gBerryDescriptionPart2_Hondew, + .description1 = sBerryDescriptionPart1_Hondew, + .description2 = sBerryDescriptionPart2_Hondew, .stageDuration = 3, .spicy = 10, .dry = 10, @@ -533,8 +550,8 @@ const struct Berry gBerries[] = .size = 149, .maxYield = 6, .minYield = 2, - .description1 = gBerryDescriptionPart1_Grepa, - .description2 = gBerryDescriptionPart2_Grepa, + .description1 = sBerryDescriptionPart1_Grepa, + .description2 = sBerryDescriptionPart2_Grepa, .stageDuration = 3, .spicy = 0, .dry = 10, @@ -549,8 +566,8 @@ const struct Berry gBerries[] = .size = 200, .maxYield = 4, .minYield = 2, - .description1 = gBerryDescriptionPart1_Tamato, - .description2 = gBerryDescriptionPart2_Tamato, + .description1 = sBerryDescriptionPart1_Tamato, + .description2 = sBerryDescriptionPart2_Tamato, .stageDuration = 6, .spicy = 20, .dry = 10, @@ -565,8 +582,8 @@ const struct Berry gBerries[] = .size = 75, .maxYield = 4, .minYield = 2, - .description1 = gBerryDescriptionPart1_Cornn, - .description2 = gBerryDescriptionPart2_Cornn, + .description1 = sBerryDescriptionPart1_Cornn, + .description2 = sBerryDescriptionPart2_Cornn, .stageDuration = 6, .spicy = 0, .dry = 20, @@ -581,8 +598,8 @@ const struct Berry gBerries[] = .size = 140, .maxYield = 4, .minYield = 2, - .description1 = gBerryDescriptionPart1_Magost, - .description2 = gBerryDescriptionPart2_Magost, + .description1 = sBerryDescriptionPart1_Magost, + .description2 = sBerryDescriptionPart2_Magost, .stageDuration = 6, .spicy = 0, .dry = 0, @@ -597,8 +614,8 @@ const struct Berry gBerries[] = .size = 226, .maxYield = 4, .minYield = 2, - .description1 = gBerryDescriptionPart1_Rabuta, - .description2 = gBerryDescriptionPart2_Rabuta, + .description1 = sBerryDescriptionPart1_Rabuta, + .description2 = sBerryDescriptionPart2_Rabuta, .stageDuration = 6, .spicy = 0, .dry = 0, @@ -613,8 +630,8 @@ const struct Berry gBerries[] = .size = 285, .maxYield = 4, .minYield = 2, - .description1 = gBerryDescriptionPart1_Nomel, - .description2 = gBerryDescriptionPart2_Nomel, + .description1 = sBerryDescriptionPart1_Nomel, + .description2 = sBerryDescriptionPart2_Nomel, .stageDuration = 6, .spicy = 10, .dry = 0, @@ -629,8 +646,8 @@ const struct Berry gBerries[] = .size = 133, .maxYield = 2, .minYield = 1, - .description1 = gBerryDescriptionPart1_Spelon, - .description2 = gBerryDescriptionPart2_Spelon, + .description1 = sBerryDescriptionPart1_Spelon, + .description2 = sBerryDescriptionPart2_Spelon, .stageDuration = 18, .spicy = 40, .dry = 10, @@ -645,8 +662,8 @@ const struct Berry gBerries[] = .size = 244, .maxYield = 2, .minYield = 1, - .description1 = gBerryDescriptionPart1_Pamtre, - .description2 = gBerryDescriptionPart2_Pamtre, + .description1 = sBerryDescriptionPart1_Pamtre, + .description2 = sBerryDescriptionPart2_Pamtre, .stageDuration = 18, .spicy = 0, .dry = 40, @@ -661,8 +678,8 @@ const struct Berry gBerries[] = .size = 250, .maxYield = 2, .minYield = 1, - .description1 = gBerryDescriptionPart1_Watmel, - .description2 = gBerryDescriptionPart2_Watmel, + .description1 = sBerryDescriptionPart1_Watmel, + .description2 = sBerryDescriptionPart2_Watmel, .stageDuration = 18, .spicy = 0, .dry = 0, @@ -677,8 +694,8 @@ const struct Berry gBerries[] = .size = 280, .maxYield = 2, .minYield = 1, - .description1 = gBerryDescriptionPart1_Durin, - .description2 = gBerryDescriptionPart2_Durin, + .description1 = sBerryDescriptionPart1_Durin, + .description2 = sBerryDescriptionPart2_Durin, .stageDuration = 18, .spicy = 0, .dry = 0, @@ -693,8 +710,8 @@ const struct Berry gBerries[] = .size = 300, .maxYield = 2, .minYield = 1, - .description1 = gBerryDescriptionPart1_Belue, - .description2 = gBerryDescriptionPart2_Belue, + .description1 = sBerryDescriptionPart1_Belue, + .description2 = sBerryDescriptionPart2_Belue, .stageDuration = 18, .spicy = 10, .dry = 0, @@ -709,8 +726,8 @@ const struct Berry gBerries[] = .size = 111, .maxYield = 2, .minYield = 1, - .description1 = gBerryDescriptionPart1_Liechi, - .description2 = gBerryDescriptionPart2_Liechi, + .description1 = sBerryDescriptionPart1_Liechi, + .description2 = sBerryDescriptionPart2_Liechi, .stageDuration = 24, .spicy = 40, .dry = 0, @@ -725,8 +742,8 @@ const struct Berry gBerries[] = .size = 33, .maxYield = 2, .minYield = 1, - .description1 = gBerryDescriptionPart1_Ganlon, - .description2 = gBerryDescriptionPart2_Ganlon, + .description1 = sBerryDescriptionPart1_Ganlon, + .description2 = sBerryDescriptionPart2_Ganlon, .stageDuration = 24, .spicy = 0, .dry = 40, @@ -741,8 +758,8 @@ const struct Berry gBerries[] = .size = 95, .maxYield = 2, .minYield = 1, - .description1 = gBerryDescriptionPart1_Salac, - .description2 = gBerryDescriptionPart2_Salac, + .description1 = sBerryDescriptionPart1_Salac, + .description2 = sBerryDescriptionPart2_Salac, .stageDuration = 24, .spicy = 0, .dry = 0, @@ -757,8 +774,8 @@ const struct Berry gBerries[] = .size = 237, .maxYield = 2, .minYield = 1, - .description1 = gBerryDescriptionPart1_Petaya, - .description2 = gBerryDescriptionPart2_Petaya, + .description1 = sBerryDescriptionPart1_Petaya, + .description2 = sBerryDescriptionPart2_Petaya, .stageDuration = 24, .spicy = 40, .dry = 0, @@ -773,8 +790,8 @@ const struct Berry gBerries[] = .size = 75, .maxYield = 2, .minYield = 1, - .description1 = gBerryDescriptionPart1_Apicot, - .description2 = gBerryDescriptionPart2_Apicot, + .description1 = sBerryDescriptionPart1_Apicot, + .description2 = sBerryDescriptionPart2_Apicot, .stageDuration = 24, .spicy = 0, .dry = 40, @@ -789,8 +806,8 @@ const struct Berry gBerries[] = .size = 97, .maxYield = 2, .minYield = 1, - .description1 = gBerryDescriptionPart1_Lansat, - .description2 = gBerryDescriptionPart2_Lansat, + .description1 = sBerryDescriptionPart1_Lansat, + .description2 = sBerryDescriptionPart2_Lansat, .stageDuration = 24, .spicy = 10, .dry = 10, @@ -805,8 +822,8 @@ const struct Berry gBerries[] = .size = 153, .maxYield = 2, .minYield = 1, - .description1 = gBerryDescriptionPart1_Starf, - .description2 = gBerryDescriptionPart2_Starf, + .description1 = sBerryDescriptionPart1_Starf, + .description2 = sBerryDescriptionPart2_Starf, .stageDuration = 24, .spicy = 10, .dry = 10, @@ -821,8 +838,8 @@ const struct Berry gBerries[] = .size = 0, .maxYield = 2, .minYield = 1, - .description1 = gBerryDescriptionPart1_Enigma, - .description2 = gBerryDescriptionPart2_Enigma, + .description1 = sBerryDescriptionPart1_Enigma, + .description2 = sBerryDescriptionPart2_Enigma, .stageDuration = 24, .spicy = 40, .dry = 40, @@ -833,3 +850,405 @@ const struct Berry gBerries[] = }, }; +// unused +void ClearEnigmaBerries(void) +{ + CpuFill16(0, &gSaveBlock1Ptr->enigmaBerry, sizeof(gSaveBlock1Ptr->enigmaBerry)); +} + +void SetEnigmaBerry(u8 *src) +{ + u32 i; + u8 *dest = (u8*)&gSaveBlock1Ptr->enigmaBerry; + + for (i = 0; i < sizeof(gSaveBlock1Ptr->enigmaBerry); i++) + dest[i] = src[i]; +} + +u32 GetEnigmaBerryChecksum(struct EnigmaBerry *enigmaBerry) +{ + u32 i; + u32 checksum; + u8 *dest; + + dest = (u8*)enigmaBerry; + checksum = 0; + for (i = 0; i < sizeof(gSaveBlock1Ptr->enigmaBerry) - sizeof(gSaveBlock1Ptr->enigmaBerry.checksum); i++) + { + checksum += dest[i]; + } + + return checksum; +} + +bool32 IsEnigmaBerryValid(void) +{ + if (!gSaveBlock1Ptr->enigmaBerry.berry.stageDuration) + return FALSE; + if (!gSaveBlock1Ptr->enigmaBerry.berry.maxYield) + return FALSE; + if (GetEnigmaBerryChecksum(&gSaveBlock1Ptr->enigmaBerry) != gSaveBlock1Ptr->enigmaBerry.checksum) + return FALSE; + return TRUE; +} + +const struct Berry *GetBerryInfo(u8 berry) +{ + if (berry == 0x2B && IsEnigmaBerryValid()) + return (struct Berry*)(&gSaveBlock1Ptr->enigmaBerry.berry); + else + { + if (berry == 0 || berry > 0x2B) + berry = 1; + return &gBerries[berry - 1]; + } +} + +struct BerryTree *GetBerryTreeInfo(u8 id) +{ + return &gSaveBlock1Ptr->berryTrees[id]; +} + +bool32 FieldObjectInteractionWaterBerryTree(void) +{ + struct BerryTree *tree = GetBerryTreeInfo(FieldObjectGetBerryTreeId(gSelectedMapObject)); + + switch (tree->stage) + { + case 1: + tree->watered1 = TRUE; + break; + case 2: + tree->watered2 = TRUE; + break; + case 3: + tree->watered3 = TRUE; + break; + case 4: + tree->watered4 = TRUE; + break; + default: + return FALSE; + } + return TRUE; +} + +bool8 IsPlayerFacingPlantedBerryTree(void) +{ + if (GetFieldObjectScriptPointerForComparison() == BerryTreeScript + && GetStageByBerryTreeId(FieldObjectGetBerryTreeId(gSelectedMapObject)) == 0) + return TRUE; + else + return FALSE; +} + +bool8 TryToWaterBerryTree(void) +{ + if (GetFieldObjectScriptPointerForComparison() != BerryTreeScript) + return FALSE; + else + return FieldObjectInteractionWaterBerryTree(); +} + +void ClearBerryTrees(void) +{ + int i; + + for (i = 0; i < BERRY_TREES_NUMBER; i++) + gSaveBlock1Ptr->berryTrees[i] = gBlankBerryTree; +} + +bool32 BerryTreeGrow(struct BerryTree *tree) +{ + if (tree->growthSparkle) + return FALSE; + switch (tree->stage) + { + case 0: + return FALSE; + case 4: + tree->berryYield = CalcBerryYield(tree); + case 1: + case 2: + case 3: + tree->stage++; + break; + case 5: + tree->watered1 = 0; + tree->watered2 = 0; + tree->watered3 = 0; + tree->watered4 = 0; + tree->berryYield = 0; + tree->stage = 2; + if (++tree->regrowthCount == 10) + *tree = gBlankBerryTree; + break; + } + return TRUE; +} + +void BerryTreeTimeUpdate(s32 minutes) +{ + int i; + struct BerryTree *tree; + + for (i = 0; i < BERRY_TREES_NUMBER; i++) + { + tree = &gSaveBlock1Ptr->berryTrees[i]; + + if (tree->berry && tree->stage && !tree->growthSparkle) + { + if (minutes >= GetStageDurationByBerryType(tree->berry) * 71) + { + *tree = gBlankBerryTree; + } + else + { + s32 time = minutes; + + while (time != 0) + { + if (tree->minutesUntilNextStage > time) + { + tree->minutesUntilNextStage -= time; + break; + } + time -= tree->minutesUntilNextStage; + tree->minutesUntilNextStage = GetStageDurationByBerryType(tree->berry); + if (!BerryTreeGrow(tree)) + break; + if (tree->stage == 5) + tree->minutesUntilNextStage *= 4; + } + } + } + } +} + +void PlantBerryTree(u8 id, u8 berry, u8 stage, bool8 sparkle) +{ + struct BerryTree *tree = GetBerryTreeInfo(id); + + *tree = gBlankBerryTree; + tree->berry = berry; + tree->minutesUntilNextStage = GetStageDurationByBerryType(berry); + tree->stage = stage; + if (stage == 5) + { + tree->berryYield = CalcBerryYield(tree); + tree->minutesUntilNextStage *= 4; + } + if (!sparkle) + { + tree->growthSparkle = TRUE; + } +} + +void RemoveBerryTree(u8 id) +{ + gSaveBlock1Ptr->berryTrees[id] = gBlankBerryTree; +} + +u8 GetBerryTypeByBerryTreeId(u8 id) +{ + return gSaveBlock1Ptr->berryTrees[id].berry; +} + +u8 GetStageByBerryTreeId(u8 id) +{ + return gSaveBlock1Ptr->berryTrees[id].stage; +} + +u8 ItemIdToBerryType(u16 item) +{ + u16 berry = item - FIRST_BERRY; + + if (berry > LAST_BERRY - FIRST_BERRY) + return 1; + else + return item - FIRST_BERRY + 1; +} + +u16 BerryTypeToItemId(u16 berry) +{ + u16 item = berry - 1; + + if (item > LAST_BERRY - FIRST_BERRY) + return FIRST_BERRY; + else + return berry + FIRST_BERRY - 1; +} + +void GetBerryNameByBerryType(u8 berry, u8 *string) +{ + memcpy(string, GetBerryInfo(berry)->name, BERRY_NAME_LENGTH); + string[BERRY_NAME_LENGTH] = EOS; +} + +void GetBerryCountStringByBerryType(u8 berry, u8* dest, u32 berryCount) +{ + GetBerryCountString(dest, GetBerryInfo(berry)->name, berryCount); +} + +void ResetBerryTreeSparkleFlag(u8 id) +{ + GetBerryTreeInfo(id)->growthSparkle = 0; +} + +u8 BerryTreeGetNumStagesWatered(struct BerryTree *tree) +{ + u8 count = 0; + + if (tree->watered1) + count++; + if (tree->watered2) + count++; + if (tree->watered3) + count++; + if (tree->watered4) + count++; + return count; +} + +u8 GetNumStagesWateredByBerryTreeId(u8 id) +{ + return BerryTreeGetNumStagesWatered(GetBerryTreeInfo(id)); +} + +u8 CalcBerryYieldInternal(u16 max, u16 min, u8 water) +{ + u32 randMin; + u32 randMax; + u32 rand; + u32 extraYield; + + if (water == 0) + return min; + else + { + randMin = (max - min) * (water - 1); + randMax = (max - min) * (water); + rand = randMin + Random() % (randMax - randMin + 1); + + if ((rand & 3) > 1) + extraYield = rand / 4 + 1; + else + extraYield = rand / 4; + return extraYield + min; + } +} + +u8 CalcBerryYield(struct BerryTree *tree) +{ + const struct Berry *berry = GetBerryInfo(tree->berry); + u8 min = berry->minYield; + u8 max = berry->maxYield; + + return CalcBerryYieldInternal(max, min, BerryTreeGetNumStagesWatered(tree)); +} + +u8 GetBerryCountByBerryTreeId(u8 id) +{ + return gSaveBlock1Ptr->berryTrees[id].berryYield; +} + +u16 GetStageDurationByBerryType(u8 berry) +{ + return GetBerryInfo(berry)->stageDuration * 60; +} + +void FieldObjectInteractionGetBerryTreeData(void) +{ + u8 id; + u8 berry; + u8 unk; + u8 group; + u8 num; + + id = FieldObjectGetBerryTreeId(gSelectedMapObject); + berry = GetBerryTypeByBerryTreeId(id); + ResetBerryTreeSparkleFlag(id); + unk = gScriptLastTalked; + num = gSaveBlock1Ptr->location.mapNum; + group = gSaveBlock1Ptr->location.mapGroup; + if (sub_8092E9C(unk, num, group)) + gSpecialVar_0x8004 = 0xFF; + else + gSpecialVar_0x8004 = GetStageByBerryTreeId(id); + gSpecialVar_0x8005 = GetNumStagesWateredByBerryTreeId(id); + gSpecialVar_0x8006 = GetBerryCountByBerryTreeId(id); + GetBerryCountStringByBerryType(berry, gStringVar1, gSpecialVar_0x8006); +} + +void FieldObjectInteractionGetBerryName(void) +{ + u8 berryType = GetBerryTypeByBerryTreeId(FieldObjectGetBerryTreeId(gSelectedMapObject)); + GetBerryNameByBerryType(berryType, gStringVar1); +} + +void FieldObjectInteractionGetBerryCountString(void) +{ + u8 treeId = FieldObjectGetBerryTreeId(gSelectedMapObject); + u8 berry = GetBerryTypeByBerryTreeId(treeId); + u8 count = GetBerryCountByBerryTreeId(treeId); + GetBerryCountStringByBerryType(berry, gStringVar1, count); +} + +void Bag_ChooseBerry(void) +{ + SetMainCallback2(CB2_ChooseBerry); +} + +void FieldObjectInteractionPlantBerryTree(void) +{ + u8 berry = ItemIdToBerryType(gScriptItemId); + + PlantBerryTree(FieldObjectGetBerryTreeId(gSelectedMapObject), berry, 1, TRUE); + FieldObjectInteractionGetBerryTreeData(); +} + +void FieldObjectInteractionPickBerryTree(void) +{ + u8 id = FieldObjectGetBerryTreeId(gSelectedMapObject); + u8 berry = GetBerryTypeByBerryTreeId(id); + + gSpecialVar_0x8004 = AddBagItem(BerryTypeToItemId(berry), GetBerryCountByBerryTreeId(id)); +} + +void FieldObjectInteractionRemoveBerryTree(void) +{ + RemoveBerryTree(FieldObjectGetBerryTreeId(gSelectedMapObject)); + sub_8092EF0(gScriptLastTalked, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup); +} + +u8 PlayerHasBerries(void) +{ + return IsBagPocketNonEmpty(BAG_BERRIES); +} + +void ResetBerryTreeSparkleFlags(void) +{ + s16 cam_left; + s16 cam_top; + s16 left; + s16 top; + s16 right; + s16 bottom; + int i; + + GetCameraCoords(&cam_left, &cam_top); + left = cam_left; + top = cam_top + 3; + right = cam_left + 14; + bottom = top + 8; + for (i = 0; i < (u8)ARRAY_COUNT(gSaveBlock1Ptr->mapObjects); i++) + { + if (gMapObjects[i].active && gMapObjects[i].animPattern == 12) + { + cam_left = gMapObjects[i].coords2.x; + cam_top = gMapObjects[i].coords2.y; + if (left <= cam_left && cam_left <= right && top <= cam_top && cam_top <= bottom) + ResetBerryTreeSparkleFlag(gMapObjects[i].trainerRange_berryTreeId); + } + } +} diff --git a/src/item.c b/src/item.c index 4ad70e11f..c85e2fe1f 100644 --- a/src/item.c +++ b/src/item.c @@ -1,5 +1,6 @@ #include "global.h" #include "item.h" +#include "items.h" #include "string_util.h" #include "text.h" #include "event_data.h" @@ -86,10 +87,10 @@ void CopyItemName(u16 itemId, u8 *string) void CopyItemNameHandlePlural(u16 itemId, u8 *string, u32 quantity) { - if (itemId == 4) + if (itemId == ITEM_POKE_BALL) { if (quantity < 2) - StringCopy(string, ItemId_GetItem(4)->name); + StringCopy(string, ItemId_GetItem(ITEM_POKE_BALL)->name); else StringCopy(string, gOtherText_PokeBalls); } diff --git a/sym_common.txt b/sym_common.txt index c2a966f53..cf737c390 100644 --- a/sym_common.txt +++ b/sym_common.txt @@ -293,7 +293,7 @@ gUnknown_03005DE8: @ 3005DE8 gUnknown_03005DEC: @ 3005DEC .space 0x4 -gUnknown_03005DF0: @ 3005DF0 +gSelectedMapObject: @ 3005DF0 .space 0x4 gUnknown_03005DF4: @ 3005DF4 diff --git a/sym_ewram.txt b/sym_ewram.txt index dda072481..c7b18acd2 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -675,7 +675,7 @@ gUnknown_02037348: @ 2037348 gUnknown_0203734C: @ 203734C .space 0x4 -gUnknown_02037350: @ 2037350 +gMapObjects: @ 2037350 .space 0x240 gUnknown_02037590: @ 2037590 @@ -1882,7 +1882,7 @@ gUnknown_0203CE74: @ 203CE74 gUnknown_0203CE78: @ 203CE78 .space 0x4 -gUnknown_0203CE7C: @ 203CE7C +gScriptItemId: @ 203CE7C .space 0x4 gUnknown_0203CE80: @ 203CE80