From f5387cf6b18b57f3620c05d652a9cf5b8bc2f347 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Fri, 29 Sep 2017 19:03:50 +0200 Subject: [PATCH] decompile metatile behav --- asm/battle_setup.s | 10 +- asm/decoration.s | 28 +- asm/field_control_avatar.s | 96 +- asm/field_door.s | 8 +- asm/field_effect_helpers.s | 6 +- asm/field_player_avatar.s | 4 +- asm/field_screen.s | 4 +- asm/field_tasks.s | 32 +- asm/fldeff_80F9BCC.s | 6 +- asm/fldeff_cut.s | 10 +- asm/item_use.s | 2 +- asm/metatile_behavior.s | 2610 ------------------- asm/pokenav.s | 2 +- asm/rom4.s | 6 +- asm/secret_base.s | 16 +- asm/wild_encounter.s | 12 +- data/{metatile_behavior.s => rom_8486FEC.s} | 4 +- include/metatile_behavior.h | 156 +- include/metatile_behaviors.h | 179 ++ ld_script.txt | 5 +- src/field_map_obj.c | 2 +- src/metatile_behavior.c | 1436 ++++++++++ 22 files changed, 1889 insertions(+), 2745 deletions(-) delete mode 100644 asm/metatile_behavior.s rename data/{metatile_behavior.s => rom_8486FEC.s} (60%) create mode 100644 include/metatile_behaviors.h create mode 100644 src/metatile_behavior.c diff --git a/asm/battle_setup.s b/asm/battle_setup.s index 752e4adf1..c2c762e96 100644 --- a/asm/battle_setup.s +++ b/asm/battle_setup.s @@ -704,7 +704,7 @@ _080B0C64: lsls r0, r5, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl sub_8089588 + bl MetatileBehavior_IsMB_0B lsls r0, 24 cmp r0, 0 beq _080B0C78 @@ -734,7 +734,7 @@ _080B0C9C: lsls r0, r5, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl sub_808962C + bl MetatileBehavior_IsDeepOrOceanWater lsls r0, 24 cmp r0, 0 bne _080B0CF2 @@ -744,7 +744,7 @@ _080B0C9C: cmp r0, 0 bne _080B0CE0 adds r0, r4, 0 - bl sub_808959C + bl MetatileBehavior_IsMountain lsls r0, 24 cmp r0, 0 beq _080B0CC8 @@ -757,7 +757,7 @@ _080B0CC8: cmp r0, 0 beq _080B0CF6 adds r0, r4, 0 - bl sub_80894D4 + bl MetatileBehavior_GetBridgeSth lsls r0, 24 cmp r0, 0 beq _080B0CE4 @@ -766,7 +766,7 @@ _080B0CE0: b _080B0D1A _080B0CE4: adds r0, r4, 0 - bl sub_80894AC + bl MetatileBehavior_IsBridge lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 diff --git a/asm/decoration.s b/asm/decoration.s index 9b65c7c79..89bfbe3bf 100644 --- a/asm/decoration.s +++ b/asm/decoration.s @@ -2222,7 +2222,7 @@ _08127C0A: lsls r4, r0, 16 lsls r0, r4, 8 lsrs r0, 24 - bl sub_80892D8 + bl MetatileBehavior_IsMB_B9 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -2257,7 +2257,7 @@ _08127C64: bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 - bl sub_8089328 + bl MetatileBehavior_IsMB_B7 lsls r0, 24 lsrs r0, 24 movs r6, 0x1 @@ -3189,7 +3189,7 @@ sub_8128484: @ 8128484 lsrs r0, 24 lsls r1, 16 lsrs r4, r1, 16 - bl sub_80892C4 + bl MetatileBehavior_IsMB_B3 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -3257,7 +3257,7 @@ sub_81284F4: @ 81284F4 lsls r0, r6, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl sub_80892C4 + bl MetatileBehavior_IsMB_B3 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -3266,7 +3266,7 @@ sub_81284F4: @ 81284F4 cmp r0, 0x21 bne _08128522 adds r0, r4, 0 - bl sub_8089378 + bl MetatileBehavior_IsMB_C2 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -3274,7 +3274,7 @@ sub_81284F4: @ 81284F4 _08128522: lsls r0, r6, 24 lsrs r0, 24 - bl sub_8089314 + bl MetatileBehavior_IsNormal lsls r0, 24 cmp r0, 0 beq _08128534 @@ -3520,7 +3520,7 @@ _081286B8: adds r5, r1, 0 ands r5, r0 adds r0, r4, 0 - bl sub_8089314 + bl MetatileBehavior_IsNormal lsls r0, 24 cmp r0, 0 bne _08128724 @@ -3625,12 +3625,12 @@ _08128790: adds r5, r1, 0 ands r5, r0 adds r0, r4, 0 - bl sub_8089314 + bl MetatileBehavior_IsNormal lsls r0, 24 cmp r0, 0 bne _081287F2 adds r0, r4, 0 - bl sub_8089328 + bl MetatileBehavior_IsMB_B7 lsls r0, 24 cmp r0, 0 bne _081287F2 @@ -3707,7 +3707,7 @@ _08128868: bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 - bl sub_8089328 + bl MetatileBehavior_IsMB_B7 lsls r0, 24 cmp r0, 0 beq _0812890C @@ -3772,7 +3772,7 @@ _081288D8: bne _08128910 _08128900: adds r0, r4, 0 - bl sub_8089364 + bl MetatileBehavior_IsMB_C3 lsls r0, 24 cmp r0, 0 bne _0812891C @@ -3781,7 +3781,7 @@ _0812890C: b _0812893E _08128910: adds r0, r4, 0 - bl sub_8089350 + bl MetatileBehavior_IsMB_B5 lsls r0, 24 cmp r0, 0 beq _08128900 @@ -6182,13 +6182,13 @@ _08129CA8: lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl sub_8089288 + bl MetatileBehavior_IsSecretBasePC lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq _08129CDE adds r0, r4, 0 - bl sub_8089404 + bl MetatileBehavior_IsMB_C5 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 diff --git a/asm/field_control_avatar.s b/asm/field_control_avatar.s index 5c515ae3d..0a71a6f49 100644 --- a/asm/field_control_avatar.s +++ b/asm/field_control_avatar.s @@ -51,7 +51,7 @@ process_overworld_input: @ 809BF08 bl cur_mapdata_block_role_at_player_pos lsls r0, 24 lsrs r0, 24 - bl sub_808904C + bl MetatileBehavior_IsMoveTile lsls r0, 24 lsrs r7, r0, 24 cmp r6, 0x2 @@ -831,7 +831,7 @@ _0809C55C: .pool _0809C574: adds r0, r5, 0 - bl is_tile_x8B + bl MetatileBehavior_IsClosedSootopolisGymDoor lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -841,7 +841,7 @@ _0809C574: .pool _0809C58C: adds r0, r5, 0 - bl is_tile_xEA + bl MetatileBehavior_IsUnknownClosedDoor lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -851,7 +851,7 @@ _0809C58C: .pool _0809C5A4: adds r0, r5, 0 - bl is_tile_x84 + bl MetatileBehavior_IsCableBoxResults1 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -859,7 +859,7 @@ _0809C5A4: b _0809C6E4 _0809C5B4: adds r0, r5, 0 - bl is_tile_x87 + bl MetatileBehavior_IsPokeblockFeeder lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -869,7 +869,7 @@ _0809C5B4: .pool _0809C5CC: adds r0, r5, 0 - bl is_tile_x8C + bl MetatileBehavior_IsTrickHousePuzzleDoor lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -879,7 +879,7 @@ _0809C5CC: .pool _0809C5E4: adds r0, r5, 0 - bl is_tile_x85 + bl MetatileBehavior_IsRegionMap lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -889,7 +889,7 @@ _0809C5E4: .pool _0809C5FC: adds r0, r5, 0 - bl sub_8089A1C + bl MetatileBehavior_IsRunningShoesInstruction lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -899,7 +899,7 @@ _0809C5FC: .pool _0809C614: adds r0, r5, 0 - bl sub_8089A30 + bl MetatileBehavior_IsPictureBookShelf lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -909,7 +909,7 @@ _0809C614: .pool _0809C62C: adds r0, r5, 0 - bl sub_8089A44 + bl MetatileBehavior_IsBookShelf lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -919,7 +919,7 @@ _0809C62C: .pool _0809C644: adds r0, r5, 0 - bl sub_8089A58 + bl MetatileBehavior_IsPokeCenterBookShelf lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -929,7 +929,7 @@ _0809C644: .pool _0809C65C: adds r0, r5, 0 - bl sub_8089A6C + bl MetatileBehavior_IsVase lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -939,7 +939,7 @@ _0809C65C: .pool _0809C674: adds r0, r5, 0 - bl sub_8089A80 + bl MetatileBehavior_IsTrashCan lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -949,7 +949,7 @@ _0809C674: .pool _0809C68C: adds r0, r5, 0 - bl sub_8089A94 + bl MetatileBehavior_IsShopShelf lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -959,7 +959,7 @@ _0809C68C: .pool _0809C6A4: adds r0, r5, 0 - bl sub_8089AA8 + bl MetatileBehavior_IsBlueprint lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -970,7 +970,7 @@ _0809C6A4: _0809C6BC: adds r0, r5, 0 adds r1, r4, 0 - bl sub_8089AD0 + bl MetatileBehavior_IsPlayerFacingWirelessBoxResults lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -981,7 +981,7 @@ _0809C6BC: _0809C6D4: adds r0, r5, 0 adds r1, r4, 0 - bl sub_8089AEC + bl MetatileBehavior_IsCableBoxResults2 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1023,7 +1023,7 @@ _0809C71C: cmp r4, r0 bne _0809C7D0 adds r0, r5, 0 - bl sub_8089288 + bl MetatileBehavior_IsSecretBasePC lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1033,7 +1033,7 @@ _0809C71C: .pool _0809C74C: adds r0, r5, 0 - bl sub_808929C + bl MetatileBehavior_IsSecretBaseRegisterPC lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1043,7 +1043,7 @@ _0809C74C: .pool _0809C764: adds r0, r5, 0 - bl sub_80893DC + bl MetatileBehavior_IsMB_BF lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1053,7 +1053,7 @@ _0809C764: .pool _0809C77C: adds r0, r5, 0 - bl sub_80893F0 + bl MetatileBehavior_IsSecretBaseTvOrShield lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1063,7 +1063,7 @@ _0809C77C: .pool _0809C794: adds r0, r5, 0 - bl sub_80892EC + bl MetatileBehavior_IsMB_C6 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1072,7 +1072,7 @@ _0809C794: b _0809C7E2 _0809C7A8: adds r0, r5, 0 - bl sub_8089364 + bl MetatileBehavior_IsMB_C3 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1081,7 +1081,7 @@ _0809C7A8: b _0809C7E2 _0809C7BC: adds r0, r5, 0 - bl sub_8089350 + bl MetatileBehavior_IsMB_B5 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1090,7 +1090,7 @@ _0809C7BC: b _0809C7E2 _0809C7D0: adds r0, r5, 0 - bl sub_8089300 + bl MetatileBehavior_IsSecretBasePoster lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1297,7 +1297,7 @@ sub_809C96C: @ 809C96C lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl sub_8089918 + bl MetatileBehavior_IsCrackedFloorHole lsls r0, 24 cmp r0, 0 beq _0809C988 @@ -1306,7 +1306,7 @@ sub_809C96C: @ 809C96C .pool _0809C988: adds r0, r4, 0 - bl sub_8089ABC + bl MetatileBehavior_IsBattlePyramidWarp lsls r0, 24 cmp r0, 0 beq _0809C9A4 @@ -1318,7 +1318,7 @@ _0809C996: .pool _0809C9A4: adds r0, r4, 0 - bl sub_80893C8 + bl MetatileBehavior_IsSecretBaseGlitterMat lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1327,7 +1327,7 @@ _0809C9A4: b _0809C9E8 _0809C9B8: adds r0, r4, 0 - bl sub_80893B4 + bl MetatileBehavior_IsSecretBaseSoundMat lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1376,7 +1376,7 @@ _0809CA04: bne _0809CAF8 lsls r0, r4, 24 lsrs r0, 24 - bl sub_808904C + bl MetatileBehavior_IsMoveTile lsls r0, 24 cmp r0, 0 bne _0809CAF8 @@ -1719,7 +1719,7 @@ sub_809CC9C: @ 809CC9C .pool _0809CCF8: adds r0, r4, 0 - bl sub_8089870 + bl MetatileBehavior_IsLavaridgeB1FWarp lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1729,7 +1729,7 @@ _0809CCF8: b _0809CD8C _0809CD0E: adds r0, r4, 0 - bl is_role_x68 + bl MetatileBehavior_IsLavaridge1FWarp lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1749,7 +1749,7 @@ _0809CD24: b _0809CD8C _0809CD3A: adds r0, r4, 0 - bl sub_80898AC + bl MetatileBehavior_IsWarpOrBridge lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1759,7 +1759,7 @@ _0809CD3A: b _0809CD8C _0809CD50: adds r0, r4, 0 - bl sub_8089904 + bl MetatileBehavior_IsMtPyreHole lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1771,7 +1771,7 @@ _0809CD50: .pool _0809CD6C: adds r0, r4, 0 - bl sub_80898C0 + bl MetatileBehavior_IsMossdeepGymWarp lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1797,7 +1797,7 @@ is_warp_tile: @ 809CD94 lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl is_tile_x69_2_warp_door + bl MetatileBehavior_IsWarpDoor lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1815,19 +1815,19 @@ is_warp_tile: @ 809CD94 cmp r0, 0x1 beq _0809CE2A adds r0, r4, 0 - bl sub_8088F58 + bl MetatileBehavior_IsNonAnimDoor lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq _0809CE2A adds r0, r4, 0 - bl sub_8089870 + bl MetatileBehavior_IsLavaridgeB1FWarp lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq _0809CE2A adds r0, r4, 0 - bl is_role_x68 + bl MetatileBehavior_IsLavaridge1FWarp lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1839,19 +1839,19 @@ is_warp_tile: @ 809CD94 cmp r0, 0x1 beq _0809CE2A adds r0, r4, 0 - bl sub_8089904 + bl MetatileBehavior_IsMtPyreHole lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq _0809CE2A adds r0, r4, 0 - bl sub_80898C0 + bl MetatileBehavior_IsMossdeepGymWarp lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq _0809CE2A adds r0, r4, 0 - bl sub_80898AC + bl MetatileBehavior_IsWarpOrBridge lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -2048,7 +2048,7 @@ map_warp_consider_2_to_inside: @ 809CF78 lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl sub_8089210 + bl MetatileBehavior_IsSecretBaseOpen lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -2062,7 +2062,7 @@ map_warp_consider_2_to_inside: @ 809CF78 .pool _0809CFB0: adds r0, r4, 0 - bl is_tile_x69_2_warp_door + bl MetatileBehavior_IsWarpDoor lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -2322,7 +2322,7 @@ dive_warp: @ 809D16C bne _0809D1A4 lsls r0, r5, 24 lsrs r0, 24 - bl sub_80895D0 + bl MetatileBehavior_IsUnableToEmerge lsls r0, 24 cmp r0, 0 bne _0809D1A4 @@ -2340,7 +2340,7 @@ dive_warp: @ 809D16C _0809D1A4: lsls r0, r5, 24 lsrs r0, 24 - bl sub_80895B0 + bl MetatileBehavior_IsDiveable lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -2394,7 +2394,7 @@ sub_809D1E8: @ 809D1E8 cmp r0, 0x5 bne _0809D244 adds r0, r5, 0 - bl sub_80895D0 + bl MetatileBehavior_IsUnableToEmerge lsls r0, 24 cmp r0, 0 bne _0809D244 @@ -2417,7 +2417,7 @@ sub_809D1E8: @ 809D1E8 .pool _0809D244: adds r0, r5, 0 - bl sub_80895B0 + bl MetatileBehavior_IsDiveable lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 diff --git a/asm/field_door.s b/asm/field_door.s index 987f0bd8c..4602158df 100644 --- a/asm/field_door.s +++ b/asm/field_door.s @@ -589,7 +589,7 @@ sub_808A854: @ 808A854 bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 - bl sub_8088EFC + bl MetatileBehavior_IsDoor lsls r0, 24 cmp r0, 0 beq _0808A876 @@ -612,7 +612,7 @@ sub_808A880: @ 808A880 bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 - bl sub_8088EFC + bl MetatileBehavior_IsDoor lsls r0, 24 cmp r0, 0 beq _0808A8A2 @@ -635,7 +635,7 @@ sub_808A8AC: @ 808A8AC bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 - bl sub_8088EFC + bl MetatileBehavior_IsDoor lsls r0, 24 cmp r0, 0 beq _0808A8D8 @@ -664,7 +664,7 @@ task_overworld_door_add_if_role_69_for_opening_door_at: @ 808A8E4 bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 - bl sub_8088EFC + bl MetatileBehavior_IsDoor lsls r0, 24 cmp r0, 0 beq _0808A910 diff --git a/asm/field_effect_helpers.s b/asm/field_effect_helpers.s index 76ba35fd2..223a27937 100644 --- a/asm/field_effect_helpers.s +++ b/asm/field_effect_helpers.s @@ -130,13 +130,13 @@ npc_pal_op: @ 8153FAC cmp r0, 0 bne _08154008 ldrb r0, [r5, 0x1F] - bl sub_80894D4 + bl MetatileBehavior_GetBridgeSth lsls r0, 24 lsrs r0, 24 cmp r0, 0 bne _08153FEE ldrb r0, [r5, 0x1E] - bl sub_80894D4 + bl MetatileBehavior_GetBridgeSth lsls r0, 24 lsrs r0, 24 cmp r0, 0 @@ -702,7 +702,7 @@ _08154412: cmp r0, r1 bne _08154490 ldrb r0, [r4, 0x1E] - bl sub_8088E64 + bl MetatileBehavior_IsPokeGrass lsls r0, 24 cmp r0, 0 bne _08154490 diff --git a/asm/field_player_avatar.s b/asm/field_player_avatar.s index aaca9b2ba..9f47c0a55 100644 --- a/asm/field_player_avatar.s +++ b/asm/field_player_avatar.s @@ -1223,7 +1223,7 @@ sub_808B238: @ 808B238 bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 - bl sub_8088F58 + bl MetatileBehavior_IsNonAnimDoor lsls r0, 24 cmp r0, 0 bne _0808B2D8 @@ -2255,7 +2255,7 @@ PlayCollisionSoundIfNotFacingWarp: @ 808B9EC bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 - bl is_tile_x69_2_warp_door + bl MetatileBehavior_IsWarpDoor lsls r0, 24 cmp r0, 0 bne _0808BA54 diff --git a/asm/field_screen.s b/asm/field_screen.s index 13f418f17..0de68b86b 100644 --- a/asm/field_screen.s +++ b/asm/field_screen.s @@ -8248,7 +8248,7 @@ sub_80AF334: @ 80AF334 lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl sub_8088EFC + bl MetatileBehavior_IsDoor lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -8258,7 +8258,7 @@ sub_80AF334: @ 80AF334 .pool _080AF36C: adds r0, r4, 0 - bl sub_8088F58 + bl MetatileBehavior_IsNonAnimDoor lsls r0, 24 lsrs r0, 24 ldr r1, =task_map_chg_seq_0807E2CC diff --git a/asm/field_tasks.s b/asm/field_tasks.s index 26761b8d1..6f8174fd8 100644 --- a/asm/field_tasks.s +++ b/asm/field_tasks.s @@ -221,7 +221,7 @@ sub_809DA30: @ 809DA30 lsls r1, 24 lsrs r4, r1, 24 adds r0, r4, 0 - bl sub_8089764 + bl MetatileBehavior_IsPacifilogVerticalLog1 lsls r0, 24 cmp r0, 0 beq _0809DA48 @@ -229,7 +229,7 @@ sub_809DA30: @ 809DA30 b _0809DA80 _0809DA48: adds r0, r4, 0 - bl sub_8089778 + bl MetatileBehavior_IsPacifilogVerticalLog2 lsls r0, 24 cmp r0, 0 beq _0809DA5A @@ -238,7 +238,7 @@ _0809DA48: b _0809DA80 _0809DA5A: adds r0, r4, 0 - bl sub_808978C + bl MetatileBehavior_IsPacifilogHorizontalLog1 lsls r0, 24 cmp r0, 0 beq _0809DA6C @@ -247,7 +247,7 @@ _0809DA5A: b _0809DA80 _0809DA6C: adds r0, r4, 0 - bl sub_80897A0 + bl MetatileBehavior_IsPacifilogHorizontalLog2 lsls r0, 24 cmp r0, 0 bne _0809DA7C @@ -414,7 +414,7 @@ sub_809DB7C: @ 809DB7C lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl sub_8089764 + bl MetatileBehavior_IsPacifilogVerticalLog1 lsls r0, 24 cmp r0, 0 beq _0809DBC0 @@ -427,7 +427,7 @@ _0809DBBC: b _0809DC08 _0809DBC0: adds r0, r4, 0 - bl sub_8089778 + bl MetatileBehavior_IsPacifilogVerticalLog2 lsls r0, 24 cmp r0, 0 beq _0809DBD8 @@ -439,7 +439,7 @@ _0809DBC0: b _0809DBBC _0809DBD8: adds r0, r4, 0 - bl sub_808978C + bl MetatileBehavior_IsPacifilogHorizontalLog1 lsls r0, 24 cmp r0, 0 beq _0809DBF0 @@ -451,7 +451,7 @@ _0809DBD8: b _0809DBBC _0809DBF0: adds r0, r4, 0 - bl sub_80897A0 + bl MetatileBehavior_IsPacifilogHorizontalLog2 lsls r0, 24 cmp r0, 0 beq _0809DC06 @@ -496,7 +496,7 @@ sub_809DC18: @ 809DC18 lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl sub_8089764 + bl MetatileBehavior_IsPacifilogVerticalLog1 lsls r0, 24 cmp r0, 0 beq _0809DC5C @@ -509,7 +509,7 @@ _0809DC58: b _0809DCA4 _0809DC5C: adds r0, r4, 0 - bl sub_8089778 + bl MetatileBehavior_IsPacifilogVerticalLog2 lsls r0, 24 cmp r0, 0 beq _0809DC74 @@ -521,7 +521,7 @@ _0809DC5C: b _0809DC58 _0809DC74: adds r0, r4, 0 - bl sub_808978C + bl MetatileBehavior_IsPacifilogHorizontalLog1 lsls r0, 24 cmp r0, 0 beq _0809DC8C @@ -533,7 +533,7 @@ _0809DC74: b _0809DC58 _0809DC8C: adds r0, r4, 0 - bl sub_80897A0 + bl MetatileBehavior_IsPacifilogHorizontalLog2 lsls r0, 24 cmp r0, 0 beq _0809DCA2 @@ -1326,7 +1326,7 @@ _0809E29A: lsls r4, 24 lsrs r4, 24 adds r0, r4, 0 - bl sub_8089604 + bl MetatileBehavior_IsThinIce lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1341,7 +1341,7 @@ _0809E29A: .pool _0809E2E0: adds r0, r4, 0 - bl sub_8089618 + bl MetatileBehavior_IsCrackedIce lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1630,7 +1630,7 @@ _0809E53E: lsls r0, r6, 24 lsrs r6, r0, 24 adds r0, r6, 0 - bl sub_8089918 + bl MetatileBehavior_IsCrackedFloorHole lsls r0, 24 cmp r0, 0 beq _0809E556 @@ -1658,7 +1658,7 @@ _0809E572: ldrh r0, [r4] strh r0, [r5, 0x6] adds r0, r6, 0 - bl sub_808992C + bl MetatileBehavior_IsCrackedFloor lsls r0, 24 cmp r0, 0 beq _0809E5D2 diff --git a/asm/fldeff_80F9BCC.s b/asm/fldeff_80F9BCC.s index 3bc667754..3ad2a398b 100644 --- a/asm/fldeff_80F9BCC.s +++ b/asm/fldeff_80F9BCC.s @@ -584,7 +584,7 @@ sub_80FA004: @ 80FA004 lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl sub_808923C + bl MetatileBehavior_IsSecretBaseCave lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -599,7 +599,7 @@ sub_80FA004: @ 80FA004 .pool _080FA070: adds r0, r4, 0 - bl sub_808925C + bl MetatileBehavior_IsSecretBaseTree lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -614,7 +614,7 @@ _080FA070: .pool _080FA0A0: adds r0, r4, 0 - bl is_tile_x98 + bl MetatileBehavior_IsSecretBaseShrub lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 diff --git a/asm/fldeff_cut.s b/asm/fldeff_cut.s index ce7e79de8..7f67185a9 100755 --- a/asm/fldeff_cut.s +++ b/asm/fldeff_cut.s @@ -130,7 +130,7 @@ _080D37F6: lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl sub_8088E64 + bl MetatileBehavior_IsPokeGrass lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -175,7 +175,7 @@ _080D3890: movs r0, 0x1 strb r0, [r1] adds r0, r4, 0 - bl sub_80899F8 + bl MetatileBehavior_IsCuttableGrass lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x1 @@ -309,7 +309,7 @@ _080D395A: lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl sub_8088E64 + bl MetatileBehavior_IsPokeGrass lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -339,7 +339,7 @@ _080D39F4: b _080D395A _080D39F8: adds r0, r4, 0 - bl sub_80899F8 + bl MetatileBehavior_IsCuttableGrass lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x1 @@ -1344,7 +1344,7 @@ sub_80D423C: @ 80D423C bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 - bl MetatileBehavior_IsLongGrass2 + bl MetatileBehavior_IsLongGrass_Duplicate lsls r0, 24 cmp r0, 0 beq _080D42AE diff --git a/asm/item_use.s b/asm/item_use.s index 200b0e62f..42b2d8bc0 100644 --- a/asm/item_use.s +++ b/asm/item_use.s @@ -464,7 +464,7 @@ _080FD3EC: _080FD40C: lsls r0, r6, 24 lsrs r0, 24 - bl sub_8089510 + bl MetatileBehavior_8089510 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 diff --git a/asm/metatile_behavior.s b/asm/metatile_behavior.s deleted file mode 100644 index 30b0f4348..000000000 --- a/asm/metatile_behavior.s +++ /dev/null @@ -1,2610 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start ShouldDoJumpLandingDustEffect -ShouldDoJumpLandingDustEffect: @ 8088DEC - movs r0, 0x1 - bx lr - thumb_func_end ShouldDoJumpLandingDustEffect - - thumb_func_start sub_8088DF0 -sub_8088DF0: @ 8088DF0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_08486EFC - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08088E0C - movs r0, 0 - b _08088E0E - .pool -_08088E0C: - movs r0, 0x1 -_08088E0E: - pop {r1} - bx r1 - thumb_func_end sub_8088DF0 - - thumb_func_start MetatileBehavior_IsJumpEast -MetatileBehavior_IsJumpEast: @ 8088E14 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x38 - beq _08088E22 - movs r0, 0 - b _08088E24 -_08088E22: - movs r0, 0x1 -_08088E24: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsJumpEast - - thumb_func_start MetatileBehavior_IsJumpWest -MetatileBehavior_IsJumpWest: @ 8088E28 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x39 - beq _08088E36 - movs r0, 0 - b _08088E38 -_08088E36: - movs r0, 0x1 -_08088E38: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsJumpWest - - thumb_func_start MetatileBehavior_IsJumpNorth -MetatileBehavior_IsJumpNorth: @ 8088E3C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3A - beq _08088E4A - movs r0, 0 - b _08088E4C -_08088E4A: - movs r0, 0x1 -_08088E4C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsJumpNorth - - thumb_func_start MetatileBehavior_IsJumpSouth -MetatileBehavior_IsJumpSouth: @ 8088E50 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3B - beq _08088E5E - movs r0, 0 - b _08088E60 -_08088E5E: - movs r0, 0x1 -_08088E60: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsJumpSouth - - thumb_func_start sub_8088E64 -sub_8088E64: @ 8088E64 - push {lr} - lsls r0, 24 - movs r1, 0xFE - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _08088E78 - movs r0, 0 - b _08088E7A -_08088E78: - movs r0, 0x1 -_08088E7A: - pop {r1} - bx r1 - thumb_func_end sub_8088E64 - - thumb_func_start MetatileBehavior_IsSandOrDeepSand -MetatileBehavior_IsSandOrDeepSand: @ 8088E80 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x21 - beq _08088E8E - cmp r0, 0x6 - bne _08088E92 -_08088E8E: - movs r0, 0x1 - b _08088E94 -_08088E92: - movs r0, 0 -_08088E94: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSandOrDeepSand - - thumb_func_start MetatileBehavior_IsDeepSand -MetatileBehavior_IsDeepSand: @ 8088E98 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x6 - beq _08088EA6 - movs r0, 0 - b _08088EA8 -_08088EA6: - movs r0, 0x1 -_08088EA8: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsDeepSand - - thumb_func_start MetatileBehavior_IsReflective -MetatileBehavior_IsReflective: @ 8088EAC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - beq _08088ECA - cmp r0, 0x16 - beq _08088ECA - cmp r0, 0x1A - beq _08088ECA - cmp r0, 0x20 - beq _08088ECA - cmp r0, 0x14 - beq _08088ECA - cmp r0, 0x2B - bne _08088ECE -_08088ECA: - movs r0, 0x1 - b _08088ED0 -_08088ECE: - movs r0, 0 -_08088ED0: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsReflective - - thumb_func_start MetatileBehavior_IsIce -MetatileBehavior_IsIce: @ 8088ED4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x20 - beq _08088EE2 - movs r0, 0 - b _08088EE4 -_08088EE2: - movs r0, 0x1 -_08088EE4: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsIce - - thumb_func_start is_tile_x69_2_warp_door -is_tile_x69_2_warp_door: @ 8088EE8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x69 - beq _08088EF6 - movs r0, 0 - b _08088EF8 -_08088EF6: - movs r0, 0x1 -_08088EF8: - pop {r1} - bx r1 - thumb_func_end is_tile_x69_2_warp_door - - thumb_func_start sub_8088EFC -sub_8088EFC: @ 8088EFC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8D - beq _08088F0A - cmp r0, 0x69 - bne _08088F0E -_08088F0A: - movs r0, 0x1 - b _08088F10 -_08088F0E: - movs r0, 0 -_08088F10: - pop {r1} - bx r1 - thumb_func_end sub_8088EFC - - thumb_func_start MetatileBehavior_IsEscalator -MetatileBehavior_IsEscalator: @ 8088F14 - push {lr} - lsls r0, 24 - movs r1, 0x96 - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _08088F28 - movs r0, 0 - b _08088F2A -_08088F28: - movs r0, 0x1 -_08088F2A: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsEscalator - - thumb_func_start sub_8088F30 -sub_8088F30: @ 8088F30 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - beq _08088F3E - movs r0, 0 - b _08088F40 -_08088F3E: - movs r0, 0x1 -_08088F40: - pop {r1} - bx r1 - thumb_func_end sub_8088F30 - - thumb_func_start MetatileBehavior_IsLadder -MetatileBehavior_IsLadder: @ 8088F44 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x61 - beq _08088F52 - movs r0, 0 - b _08088F54 -_08088F52: - movs r0, 0x1 -_08088F54: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsLadder - - thumb_func_start sub_8088F58 -sub_8088F58: @ 8088F58 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x60 - beq _08088F6A - cmp r0, 0x6C - beq _08088F6A - cmp r0, 0x6E - bne _08088F6E -_08088F6A: - movs r0, 0x1 - b _08088F70 -_08088F6E: - movs r0, 0 -_08088F70: - pop {r1} - bx r1 - thumb_func_end sub_8088F58 - - thumb_func_start sub_8088F74 -sub_8088F74: @ 8088F74 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x6E - beq _08088F82 - movs r0, 0 - b _08088F84 -_08088F82: - movs r0, 0x1 -_08088F84: - pop {r1} - bx r1 - thumb_func_end sub_8088F74 - - thumb_func_start MetatileBehavior_IsSurfableWaterOrUnderwater -MetatileBehavior_IsSurfableWaterOrUnderwater: @ 8088F88 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_08486EFC - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08088FA4 - movs r0, 0 - b _08088FA6 - .pool -_08088FA4: - movs r0, 0x1 -_08088FA6: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSurfableWaterOrUnderwater - - thumb_func_start MetatileBehavior_IsEastArrowWarp -MetatileBehavior_IsEastArrowWarp: @ 8088FAC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x62 - beq _08088FBA - movs r0, 0 - b _08088FBC -_08088FBA: - movs r0, 0x1 -_08088FBC: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsEastArrowWarp - - thumb_func_start MetatileBehavior_IsWestArrowWarp -MetatileBehavior_IsWestArrowWarp: @ 8088FC0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x63 - beq _08088FCE - movs r0, 0 - b _08088FD0 -_08088FCE: - movs r0, 0x1 -_08088FD0: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsWestArrowWarp - - thumb_func_start MetatileBehavior_IsNorthArrowWarp -MetatileBehavior_IsNorthArrowWarp: @ 8088FD4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x64 - beq _08088FE2 - cmp r0, 0x1B - bne _08088FE6 -_08088FE2: - movs r0, 0x1 - b _08088FE8 -_08088FE6: - movs r0, 0 -_08088FE8: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsNorthArrowWarp - - thumb_func_start MetatileBehavior_IsSouthArrowWarp -MetatileBehavior_IsSouthArrowWarp: @ 8088FEC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x65 - beq _08088FFE - cmp r0, 0x6D - beq _08088FFE - cmp r0, 0x1C - bne _08089002 -_08088FFE: - movs r0, 0x1 - b _08089004 -_08089002: - movs r0, 0 -_08089004: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSouthArrowWarp - - thumb_func_start sub_8089008 -sub_8089008: @ 8089008 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r5, 0 - adds r0, r4, 0 - bl MetatileBehavior_IsEastArrowWarp - lsls r0, 24 - cmp r0, 0 - bne _08089040 - adds r0, r4, 0 - bl MetatileBehavior_IsWestArrowWarp - lsls r0, 24 - cmp r0, 0 - bne _08089040 - adds r0, r4, 0 - bl MetatileBehavior_IsNorthArrowWarp - lsls r0, 24 - cmp r0, 0 - bne _08089040 - adds r0, r4, 0 - bl MetatileBehavior_IsSouthArrowWarp - lsls r0, 24 - cmp r0, 0 - beq _08089042 -_08089040: - movs r5, 0x1 -_08089042: - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8089008 - - thumb_func_start sub_808904C -sub_808904C: @ 808904C - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0xC0 - lsls r2, 24 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0x8 - bls _08089082 - adds r0, r1, 0 - subs r0, 0x50 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bls _08089082 - cmp r1, 0xD0 - beq _08089082 - cmp r1, 0xD2 - beq _08089082 - cmp r1, 0x13 - beq _08089082 - cmp r1, 0x20 - beq _08089082 - cmp r1, 0xBB - beq _08089082 - cmp r1, 0xBC - bne _08089086 -_08089082: - movs r0, 0x1 - b _08089088 -_08089086: - movs r0, 0 -_08089088: - pop {r1} - bx r1 - thumb_func_end sub_808904C - - thumb_func_start MetatileBehavior_IsIce_2 -@ bool8 MetatileBehavior_IsIce_2(u8 metatileBehavior) -MetatileBehavior_IsIce_2: @ 808908C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x20 - beq _0808909A - movs r0, 0 - b _0808909C -_0808909A: - movs r0, 0x1 -_0808909C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsIce_2 - - thumb_func_start MetatileBehavior_IsTrickHouseSlipperyFloor -@ bool8 MetatileBehavior_IsTrickHouseSlipperyFloor(u8 metatileBehavior) -MetatileBehavior_IsTrickHouseSlipperyFloor: @ 80890A0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x48 - beq _080890AE - movs r0, 0 - b _080890B0 -_080890AE: - movs r0, 0x1 -_080890B0: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsTrickHouseSlipperyFloor - - thumb_func_start MetatileBehavior_0x05 -MetatileBehavior_0x05: @ 80890B4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - beq _080890C2 - movs r0, 0 - b _080890C4 -_080890C2: - movs r0, 0x1 -_080890C4: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_0x05 - - thumb_func_start MetatileBehavior_IsWalkNorth -@ bool8 MetatileBehavior_IsWalkNorth(u8 metatileBehavior) -MetatileBehavior_IsWalkNorth: @ 80890C8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x42 - beq _080890D6 - movs r0, 0 - b _080890D8 -_080890D6: - movs r0, 0x1 -_080890D8: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsWalkNorth - - thumb_func_start MetatileBehavior_IsWalkSouth -@ bool8 MetatileBehavior_IsWalkSouth(u8 metatileBehavior) -MetatileBehavior_IsWalkSouth: @ 80890DC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x43 - beq _080890EA - movs r0, 0 - b _080890EC -_080890EA: - movs r0, 0x1 -_080890EC: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsWalkSouth - - thumb_func_start MetatileBehavior_IsWalkWest -@ bool8 MetatileBehavior_IsWalkWest(u8 metatileBehavior) -MetatileBehavior_IsWalkWest: @ 80890F0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x41 - beq _080890FE - movs r0, 0 - b _08089100 -_080890FE: - movs r0, 0x1 -_08089100: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsWalkWest - - thumb_func_start MetatileBehavior_IsWalkEast -@ bool8 MetatileBehavior_IsWalkEast(u8 metatileBehavior) -MetatileBehavior_IsWalkEast: @ 8089104 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _08089112 - movs r0, 0 - b _08089114 -_08089112: - movs r0, 0x1 -_08089114: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsWalkEast - - thumb_func_start MetatileBehavior_IsNorthwardCurrent -@ bool8 MetatileBehavior_IsNorthwardCurrent(u8 metatileBehavior) -MetatileBehavior_IsNorthwardCurrent: @ 8089118 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x52 - beq _08089126 - movs r0, 0 - b _08089128 -_08089126: - movs r0, 0x1 -_08089128: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsNorthwardCurrent - - thumb_func_start MetatileBehavior_IsSouthwardCurrent -@ bool8 MetatileBehavior_IsSouthwardCurrent(u8 metatileBehavior) -MetatileBehavior_IsSouthwardCurrent: @ 808912C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x53 - beq _0808913A - movs r0, 0 - b _0808913C -_0808913A: - movs r0, 0x1 -_0808913C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSouthwardCurrent - - thumb_func_start MetatileBehavior_IsWestwardCurrent -@ bool8 MetatileBehavior_IsWestwardCurrent(u8 metatileBehavior) -MetatileBehavior_IsWestwardCurrent: @ 8089140 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x51 - beq _0808914E - movs r0, 0 - b _08089150 -_0808914E: - movs r0, 0x1 -_08089150: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsWestwardCurrent - - thumb_func_start MetatileBehavior_IsEastwardCurrent -@ bool8 MetatileBehavior_IsEastwardCurrent(u8 metatileBehavior) -MetatileBehavior_IsEastwardCurrent: @ 8089154 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x50 - beq _08089162 - movs r0, 0 - b _08089164 -_08089162: - movs r0, 0x1 -_08089164: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsEastwardCurrent - - thumb_func_start MetatileBehavior_IsSlideNorth -@ bool8 MetatileBehavior_IsSlideNorth(u8 metatileBehavior) -MetatileBehavior_IsSlideNorth: @ 8089168 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x46 - beq _08089176 - movs r0, 0 - b _08089178 -_08089176: - movs r0, 0x1 -_08089178: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSlideNorth - - thumb_func_start MetatileBehavior_IsSlideSouth -@ bool8 MetatileBehavior_IsSlideSouth(u8 metatileBehavior) -MetatileBehavior_IsSlideSouth: @ 808917C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x47 - beq _0808918A - movs r0, 0 - b _0808918C -_0808918A: - movs r0, 0x1 -_0808918C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSlideSouth - - thumb_func_start MetatileBehavior_IsSlideWest -@ bool8 MetatileBehavior_IsSlideWest(u8 metatileBehavior) -MetatileBehavior_IsSlideWest: @ 8089190 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x45 - beq _0808919E - movs r0, 0 - b _080891A0 -_0808919E: - movs r0, 0x1 -_080891A0: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSlideWest - - thumb_func_start MetatileBehavior_IsSlideEast -@ bool8 MetatileBehavior_IsSlideEast(u8 metatileBehavior) -MetatileBehavior_IsSlideEast: @ 80891A4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x44 - beq _080891B2 - movs r0, 0 - b _080891B4 -_080891B2: - movs r0, 0x1 -_080891B4: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSlideEast - - thumb_func_start MetatileBehavior_IsCounter -MetatileBehavior_IsCounter: @ 80891B8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x80 - beq _080891C6 - movs r0, 0 - b _080891C8 -_080891C6: - movs r0, 0x1 -_080891C8: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsCounter - - thumb_func_start MetatileBehavior_IsPlayerFacingTVScreen -@ bool8 MetatileBehavior_IsPlayerFacingTVScreen(u8 behavior, u8 direction) -MetatileBehavior_IsPlayerFacingTVScreen: @ 80891CC - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x2 - bne _080891DE - cmp r0, 0x86 - beq _080891E2 -_080891DE: - movs r0, 0 - b _080891E4 -_080891E2: - movs r0, 0x1 -_080891E4: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsPlayerFacingTVScreen - - thumb_func_start MetatileBehavior_IsPC -MetatileBehavior_IsPC: @ 80891E8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x83 - beq _080891F6 - movs r0, 0 - b _080891F8 -_080891F6: - movs r0, 0x1 -_080891F8: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsPC - - thumb_func_start is_tile_x84 -is_tile_x84: @ 80891FC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x84 - beq _0808920A - movs r0, 0 - b _0808920C -_0808920A: - movs r0, 0x1 -_0808920C: - pop {r1} - bx r1 - thumb_func_end is_tile_x84 - - thumb_func_start sub_8089210 -sub_8089210: @ 8089210 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x91 - beq _08089232 - cmp r0, 0x93 - beq _08089232 - cmp r0, 0x95 - beq _08089232 - cmp r0, 0x97 - beq _08089232 - cmp r0, 0x99 - beq _08089232 - cmp r0, 0x9B - beq _08089232 - cmp r0, 0x9D - bne _08089236 -_08089232: - movs r0, 0x1 - b _08089238 -_08089236: - movs r0, 0 -_08089238: - pop {r1} - bx r1 - thumb_func_end sub_8089210 - - thumb_func_start sub_808923C -sub_808923C: @ 808923C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x90 - beq _08089252 - cmp r0, 0x92 - beq _08089252 - cmp r0, 0x94 - beq _08089252 - cmp r0, 0x9A - bne _08089256 -_08089252: - movs r0, 0x1 - b _08089258 -_08089256: - movs r0, 0 -_08089258: - pop {r1} - bx r1 - thumb_func_end sub_808923C - - thumb_func_start sub_808925C -sub_808925C: @ 808925C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x96 - beq _0808926A - cmp r0, 0x9C - bne _0808926E -_0808926A: - movs r0, 0x1 - b _08089270 -_0808926E: - movs r0, 0 -_08089270: - pop {r1} - bx r1 - thumb_func_end sub_808925C - - thumb_func_start is_tile_x98 -is_tile_x98: @ 8089274 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x98 - beq _08089282 - movs r0, 0 - b _08089284 -_08089282: - movs r0, 0x1 -_08089284: - pop {r1} - bx r1 - thumb_func_end is_tile_x98 - - thumb_func_start sub_8089288 -sub_8089288: @ 8089288 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB0 - beq _08089296 - movs r0, 0 - b _08089298 -_08089296: - movs r0, 0x1 -_08089298: - pop {r1} - bx r1 - thumb_func_end sub_8089288 - - thumb_func_start sub_808929C -sub_808929C: @ 808929C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB1 - beq _080892AA - movs r0, 0 - b _080892AC -_080892AA: - movs r0, 0x1 -_080892AC: - pop {r1} - bx r1 - thumb_func_end sub_808929C - - thumb_func_start sub_80892B0 -sub_80892B0: @ 80892B0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB2 - beq _080892BE - movs r0, 0 - b _080892C0 -_080892BE: - movs r0, 0x1 -_080892C0: - pop {r1} - bx r1 - thumb_func_end sub_80892B0 - - thumb_func_start sub_80892C4 -sub_80892C4: @ 80892C4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB3 - beq _080892D2 - movs r0, 0 - b _080892D4 -_080892D2: - movs r0, 0x1 -_080892D4: - pop {r1} - bx r1 - thumb_func_end sub_80892C4 - - thumb_func_start sub_80892D8 -sub_80892D8: @ 80892D8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB9 - beq _080892E6 - movs r0, 0 - b _080892E8 -_080892E6: - movs r0, 0x1 -_080892E8: - pop {r1} - bx r1 - thumb_func_end sub_80892D8 - - thumb_func_start sub_80892EC -sub_80892EC: @ 80892EC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xC6 - beq _080892FA - movs r0, 0 - b _080892FC -_080892FA: - movs r0, 0x1 -_080892FC: - pop {r1} - bx r1 - thumb_func_end sub_80892EC - - thumb_func_start sub_8089300 -sub_8089300: @ 8089300 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xC7 - beq _0808930E - movs r0, 0 - b _08089310 -_0808930E: - movs r0, 0x1 -_08089310: - pop {r1} - bx r1 - thumb_func_end sub_8089300 - - thumb_func_start sub_8089314 -sub_8089314: @ 8089314 - push {lr} - lsls r0, 24 - cmp r0, 0 - beq _08089320 - movs r0, 0 - b _08089322 -_08089320: - movs r0, 0x1 -_08089322: - pop {r1} - bx r1 - thumb_func_end sub_8089314 - - thumb_func_start sub_8089328 -sub_8089328: @ 8089328 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB7 - beq _08089336 - movs r0, 0 - b _08089338 -_08089336: - movs r0, 0x1 -_08089338: - pop {r1} - bx r1 - thumb_func_end sub_8089328 - - thumb_func_start sub_808933C -sub_808933C: @ 808933C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB2 - beq _0808934A - movs r0, 0 - b _0808934C -_0808934A: - movs r0, 0x1 -_0808934C: - pop {r1} - bx r1 - thumb_func_end sub_808933C - - thumb_func_start sub_8089350 -sub_8089350: @ 8089350 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB5 - beq _0808935E - movs r0, 0 - b _08089360 -_0808935E: - movs r0, 0x1 -_08089360: - pop {r1} - bx r1 - thumb_func_end sub_8089350 - - thumb_func_start sub_8089364 -sub_8089364: @ 8089364 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xC3 - beq _08089372 - movs r0, 0 - b _08089374 -_08089372: - movs r0, 0x1 -_08089374: - pop {r1} - bx r1 - thumb_func_end sub_8089364 - - thumb_func_start sub_8089378 -sub_8089378: @ 8089378 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xC2 - beq _08089386 - movs r0, 0 - b _08089388 -_08089386: - movs r0, 0x1 -_08089388: - pop {r1} - bx r1 - thumb_func_end sub_8089378 - - thumb_func_start sub_808938C -sub_808938C: @ 808938C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB8 - beq _0808939A - movs r0, 0 - b _0808939C -_0808939A: - movs r0, 0x1 -_0808939C: - pop {r1} - bx r1 - thumb_func_end sub_808938C - - thumb_func_start sub_80893A0 -sub_80893A0: @ 80893A0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xBE - beq _080893AE - movs r0, 0 - b _080893B0 -_080893AE: - movs r0, 0x1 -_080893B0: - pop {r1} - bx r1 - thumb_func_end sub_80893A0 - - thumb_func_start sub_80893B4 -sub_80893B4: @ 80893B4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xBD - beq _080893C2 - movs r0, 0 - b _080893C4 -_080893C2: - movs r0, 0x1 -_080893C4: - pop {r1} - bx r1 - thumb_func_end sub_80893B4 - - thumb_func_start sub_80893C8 -sub_80893C8: @ 80893C8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xBA - beq _080893D6 - movs r0, 0 - b _080893D8 -_080893D6: - movs r0, 0x1 -_080893D8: - pop {r1} - bx r1 - thumb_func_end sub_80893C8 - - thumb_func_start sub_80893DC -sub_80893DC: @ 80893DC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xBF - beq _080893EA - movs r0, 0 - b _080893EC -_080893EA: - movs r0, 0x1 -_080893EC: - pop {r1} - bx r1 - thumb_func_end sub_80893DC - - thumb_func_start sub_80893F0 -sub_80893F0: @ 80893F0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xC4 - beq _080893FE - movs r0, 0 - b _08089400 -_080893FE: - movs r0, 0x1 -_08089400: - pop {r1} - bx r1 - thumb_func_end sub_80893F0 - - thumb_func_start sub_8089404 -sub_8089404: @ 8089404 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xC5 - beq _08089412 - movs r0, 0 - b _08089414 -_08089412: - movs r0, 0x1 -_08089414: - pop {r1} - bx r1 - thumb_func_end sub_8089404 - - thumb_func_start MetatileBehavior_HasRipples -MetatileBehavior_HasRipples: @ 8089418 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - beq _0808942A - cmp r0, 0x16 - beq _0808942A - cmp r0, 0x14 - bne _0808942E -_0808942A: - movs r0, 0x1 - b _08089430 -_0808942E: - movs r0, 0 -_08089430: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_HasRipples - - thumb_func_start MetatileBehavior_IsPuddle -MetatileBehavior_IsPuddle: @ 8089434 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x16 - beq _08089442 - movs r0, 0 - b _08089444 -_08089442: - movs r0, 0x1 -_08089444: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsPuddle - - thumb_func_start MetatileBehavior_IsTallGrass -MetatileBehavior_IsTallGrass: @ 8089448 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _08089456 - movs r0, 0 - b _08089458 -_08089456: - movs r0, 0x1 -_08089458: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsTallGrass - - thumb_func_start MetatileBehavior_IsLongGrass -MetatileBehavior_IsLongGrass: @ 808945C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - beq _0808946A - movs r0, 0 - b _0808946C -_0808946A: - movs r0, 0x1 -_0808946C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsLongGrass - - thumb_func_start MetatileBehavior_IsBerryTreeSoil -MetatileBehavior_IsBerryTreeSoil: @ 8089470 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xA0 - beq _0808947E - movs r0, 0 - b _08089480 -_0808947E: - movs r0, 0x1 -_08089480: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsBerryTreeSoil - - thumb_func_start MetatileBehavior_IsAsh -MetatileBehavior_IsAsh: @ 8089484 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x24 - beq _08089492 - movs r0, 0 - b _08089494 -_08089492: - movs r0, 0x1 -_08089494: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsAsh - - thumb_func_start MetatileBehavior_IsUnusedFootprintMetatile -MetatileBehavior_IsUnusedFootprintMetatile: @ 8089498 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x25 - beq _080894A6 - movs r0, 0 - b _080894A8 -_080894A6: - movs r0, 0x1 -_080894A8: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsUnusedFootprintMetatile - - thumb_func_start sub_80894AC -sub_80894AC: @ 80894AC - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0x90 - lsls r2, 24 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0x3 - bls _080894CA - adds r0, r1, 0 - subs r0, 0x7C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bhi _080894CE -_080894CA: - movs r0, 0x1 - b _080894D0 -_080894CE: - movs r0, 0 -_080894D0: - pop {r1} - bx r1 - thumb_func_end sub_80894AC - - thumb_func_start sub_80894D4 -sub_80894D4: @ 80894D4 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - adds r2, r1, 0 - adds r0, r1, 0 - subs r0, 0x70 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bls _0808950A - adds r0, r1, 0 - subs r0, 0x7A - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _080894F8 - movs r0, 0x2 - b _0808950A -_080894F8: - adds r0, r2, 0 - subs r0, 0x7C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _08089508 - movs r0, 0 - b _0808950A -_08089508: - movs r0, 0x3 -_0808950A: - pop {r1} - bx r1 - thumb_func_end sub_80894D4 - - thumb_func_start sub_8089510 -sub_8089510: @ 8089510 - push {lr} - lsls r0, 24 - movs r1, 0x90 - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x3 - bls _08089524 - movs r0, 0 - b _08089526 -_08089524: - movs r0, 0x1 -_08089526: - pop {r1} - bx r1 - thumb_func_end sub_8089510 - - thumb_func_start sub_808952C -sub_808952C: @ 808952C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl MetatileBehavior_IsSurfableWaterOrUnderwater - lsls r0, 24 - cmp r0, 0 - bne _08089550 - adds r0, r4, 0 - bl sub_8088DF0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08089550 - movs r0, 0x1 - b _08089552 -_08089550: - movs r0, 0 -_08089552: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808952C - - thumb_func_start sub_8089558 -sub_8089558: @ 8089558 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl MetatileBehavior_IsSurfableWaterOrUnderwater - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0808957E - adds r0, r4, 0 - bl sub_8088DF0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0808957E - movs r0, 0x1 - b _08089580 -_0808957E: - movs r0, 0 -_08089580: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8089558 - - thumb_func_start sub_8089588 -sub_8089588: @ 8089588 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB - beq _08089596 - movs r0, 0 - b _08089598 -_08089596: - movs r0, 0x1 -_08089598: - pop {r1} - bx r1 - thumb_func_end sub_8089588 - - thumb_func_start sub_808959C -sub_808959C: @ 808959C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xC - beq _080895AA - movs r0, 0 - b _080895AC -_080895AA: - movs r0, 0x1 -_080895AC: - pop {r1} - bx r1 - thumb_func_end sub_808959C - - thumb_func_start sub_80895B0 -sub_80895B0: @ 80895B0 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0xEF - lsls r2, 24 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0x1 - bls _080895C6 - cmp r1, 0x14 - bne _080895CA -_080895C6: - movs r0, 0x1 - b _080895CC -_080895CA: - movs r0, 0 -_080895CC: - pop {r1} - bx r1 - thumb_func_end sub_80895B0 - - thumb_func_start sub_80895D0 -sub_80895D0: @ 80895D0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x19 - beq _080895DE - cmp r0, 0x2A - bne _080895E2 -_080895DE: - movs r0, 0x1 - b _080895E4 -_080895E2: - movs r0, 0 -_080895E4: - pop {r1} - bx r1 - thumb_func_end sub_80895D0 - - thumb_func_start MetatileBehavior_IsShallowFlowingWater -MetatileBehavior_IsShallowFlowingWater: @ 80895E8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x17 - beq _080895FA - cmp r0, 0x1B - beq _080895FA - cmp r0, 0x1C - bne _080895FE -_080895FA: - movs r0, 0x1 - b _08089600 -_080895FE: - movs r0, 0 -_08089600: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsShallowFlowingWater - - thumb_func_start sub_8089604 -sub_8089604: @ 8089604 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x26 - beq _08089612 - movs r0, 0 - b _08089614 -_08089612: - movs r0, 0x1 -_08089614: - pop {r1} - bx r1 - thumb_func_end sub_8089604 - - thumb_func_start sub_8089618 -sub_8089618: @ 8089618 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x27 - beq _08089626 - movs r0, 0 - b _08089628 -_08089626: - movs r0, 0x1 -_08089628: - pop {r1} - bx r1 - thumb_func_end sub_8089618 - - thumb_func_start sub_808962C -sub_808962C: @ 808962C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x15 - beq _0808963E - cmp r0, 0x11 - beq _0808963E - cmp r0, 0x12 - bne _08089642 -_0808963E: - movs r0, 0x1 - b _08089644 -_08089642: - movs r0, 0 -_08089644: - pop {r1} - bx r1 - thumb_func_end sub_808962C - - thumb_func_start sub_8089648 -sub_8089648: @ 8089648 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x18 - beq _08089656 - cmp r0, 0x1A - bne _0808965A -_08089656: - movs r0, 0x1 - b _0808965C -_0808965A: - movs r0, 0 -_0808965C: - pop {r1} - bx r1 - thumb_func_end sub_8089648 - - thumb_func_start sub_8089660 -sub_8089660: @ 8089660 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl MetatileBehavior_IsSurfableWaterOrUnderwater - lsls r0, 24 - cmp r0, 0 - beq _08089682 - adds r0, r4, 0 - bl MetatileBehavior_IsWaterfall - lsls r0, 24 - cmp r0, 0 - bne _08089682 - movs r0, 0x1 - b _08089684 -_08089682: - movs r0, 0 -_08089684: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8089660 - - thumb_func_start MetatileBehavior_IsEastBlocked -MetatileBehavior_IsEastBlocked: @ 808968C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x30 - beq _080896A6 - cmp r0, 0x34 - beq _080896A6 - cmp r0, 0x36 - beq _080896A6 - cmp r0, 0xC1 - beq _080896A6 - cmp r0, 0xBE - bne _080896AA -_080896A6: - movs r0, 0x1 - b _080896AC -_080896AA: - movs r0, 0 -_080896AC: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsEastBlocked - - thumb_func_start MetatileBehavior_IsWestBlocked -MetatileBehavior_IsWestBlocked: @ 80896B0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x31 - beq _080896CA - cmp r0, 0x35 - beq _080896CA - cmp r0, 0x37 - beq _080896CA - cmp r0, 0xC1 - beq _080896CA - cmp r0, 0xBE - bne _080896CE -_080896CA: - movs r0, 0x1 - b _080896D0 -_080896CE: - movs r0, 0 -_080896D0: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsWestBlocked - - thumb_func_start MetatileBehavior_IsNorthBlocked -MetatileBehavior_IsNorthBlocked: @ 80896D4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x32 - beq _080896EA - cmp r0, 0x34 - beq _080896EA - cmp r0, 0x35 - beq _080896EA - cmp r0, 0xC0 - bne _080896EE -_080896EA: - movs r0, 0x1 - b _080896F0 -_080896EE: - movs r0, 0 -_080896F0: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsNorthBlocked - - thumb_func_start MetatileBehavior_IsSouthBlocked -MetatileBehavior_IsSouthBlocked: @ 80896F4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x33 - beq _0808970A - cmp r0, 0x36 - beq _0808970A - cmp r0, 0x37 - beq _0808970A - cmp r0, 0xC0 - bne _0808970E -_0808970A: - movs r0, 0x1 - b _08089710 -_0808970E: - movs r0, 0 -_08089710: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSouthBlocked - - thumb_func_start MetatileBehavior_IsShortGrass -MetatileBehavior_IsShortGrass: @ 8089714 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x7 - beq _08089722 - movs r0, 0 - b _08089724 -_08089722: - movs r0, 0x1 -_08089724: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsShortGrass - - thumb_func_start MetatileBehavior_IsHotSprings -MetatileBehavior_IsHotSprings: @ 8089728 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x28 - beq _08089736 - movs r0, 0 - b _08089738 -_08089736: - movs r0, 0x1 -_08089738: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsHotSprings - - thumb_func_start MetatileBehavior_IsWaterfall -@ bool8 MetatileBehavior_IsWaterfall(u8 metatileBehavior) -MetatileBehavior_IsWaterfall: @ 808973C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x13 - beq _0808974A - movs r0, 0 - b _0808974C -_0808974A: - movs r0, 0x1 -_0808974C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsWaterfall - - thumb_func_start MetatileBehavior_IsFortreeBridge -MetatileBehavior_IsFortreeBridge: @ 8089750 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x78 - beq _0808975E - movs r0, 0 - b _08089760 -_0808975E: - movs r0, 0x1 -_08089760: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsFortreeBridge - - thumb_func_start sub_8089764 -sub_8089764: @ 8089764 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x74 - beq _08089772 - movs r0, 0 - b _08089774 -_08089772: - movs r0, 0x1 -_08089774: - pop {r1} - bx r1 - thumb_func_end sub_8089764 - - thumb_func_start sub_8089778 -sub_8089778: @ 8089778 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x75 - beq _08089786 - movs r0, 0 - b _08089788 -_08089786: - movs r0, 0x1 -_08089788: - pop {r1} - bx r1 - thumb_func_end sub_8089778 - - thumb_func_start sub_808978C -sub_808978C: @ 808978C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x76 - beq _0808979A - movs r0, 0 - b _0808979C -_0808979A: - movs r0, 0x1 -_0808979C: - pop {r1} - bx r1 - thumb_func_end sub_808978C - - thumb_func_start sub_80897A0 -sub_80897A0: @ 80897A0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x77 - beq _080897AE - movs r0, 0 - b _080897B0 -_080897AE: - movs r0, 0x1 -_080897B0: - pop {r1} - bx r1 - thumb_func_end sub_80897A0 - - thumb_func_start MetatileBehavior_IsPacifidlogLog -MetatileBehavior_IsPacifidlogLog: @ 80897B4 - push {lr} - lsls r0, 24 - movs r1, 0x8C - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x3 - bls _080897C8 - movs r0, 0 - b _080897CA -_080897C8: - movs r0, 0x1 -_080897CA: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsPacifidlogLog - - thumb_func_start is_tile_x8C -is_tile_x8C: @ 80897D0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8C - beq _080897DE - movs r0, 0 - b _080897E0 -_080897DE: - movs r0, 0x1 -_080897E0: - pop {r1} - bx r1 - thumb_func_end is_tile_x8C - - thumb_func_start is_tile_x85 -is_tile_x85: @ 80897E4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x85 - beq _080897F2 - movs r0, 0 - b _080897F4 -_080897F2: - movs r0, 0x1 -_080897F4: - pop {r1} - bx r1 - thumb_func_end is_tile_x85 - - thumb_func_start is_tile_x8B -is_tile_x8B: @ 80897F8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8B - beq _08089806 - movs r0, 0 - b _08089808 -_08089806: - movs r0, 0x1 -_08089808: - pop {r1} - bx r1 - thumb_func_end is_tile_x8B - - thumb_func_start is_tile_xEA -is_tile_xEA: @ 808980C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xEA - beq _0808981A - movs r0, 0 - b _0808981C -_0808981A: - movs r0, 0x1 -_0808981C: - pop {r1} - bx r1 - thumb_func_end is_tile_xEA - - thumb_func_start is_tile_x8A -is_tile_x8A: @ 8089820 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8A - beq _0808982E - movs r0, 0 - b _08089830 -_0808982E: - movs r0, 0x1 -_08089830: - pop {r1} - bx r1 - thumb_func_end is_tile_x8A - - thumb_func_start is_tile_x87 -is_tile_x87: @ 8089834 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x87 - beq _08089842 - movs r0, 0 - b _08089844 -_08089842: - movs r0, 0x1 -_08089844: - pop {r1} - bx r1 - thumb_func_end is_tile_x87 - - thumb_func_start MetatileBehavior_0xBB -@ bool8 MetatileBehavior_0xBB(u8 metatileBehavior) -MetatileBehavior_0xBB: @ 8089848 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xBB - beq _08089856 - movs r0, 0 - b _08089858 -_08089856: - movs r0, 0x1 -_08089858: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_0xBB - - thumb_func_start MetatileBehavior_0xBC -@ bool8 MetatileBehavior_0xBC(u8 metatileBehavior) -MetatileBehavior_0xBC: @ 808985C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xBC - beq _0808986A - movs r0, 0 - b _0808986C -_0808986A: - movs r0, 0x1 -_0808986C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_0xBC - - thumb_func_start sub_8089870 -sub_8089870: @ 8089870 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x29 - beq _0808987E - movs r0, 0 - b _08089880 -_0808987E: - movs r0, 0x1 -_08089880: - pop {r1} - bx r1 - thumb_func_end sub_8089870 - - thumb_func_start is_role_x68 -is_role_x68: @ 8089884 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x68 - beq _08089892 - movs r0, 0 - b _08089894 -_08089892: - movs r0, 0x1 -_08089894: - pop {r1} - bx r1 - thumb_func_end is_role_x68 - - thumb_func_start MetatileBehavior_IsAquaHideoutWarp -MetatileBehavior_IsAquaHideoutWarp: @ 8089898 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x67 - beq _080898A6 - movs r0, 0 - b _080898A8 -_080898A6: - movs r0, 0x1 -_080898A8: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsAquaHideoutWarp - - thumb_func_start sub_80898AC -sub_80898AC: @ 80898AC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x70 - beq _080898BA - movs r0, 0 - b _080898BC -_080898BA: - movs r0, 0x1 -_080898BC: - pop {r1} - bx r1 - thumb_func_end sub_80898AC - - thumb_func_start sub_80898C0 -sub_80898C0: @ 80898C0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE - beq _080898CE - movs r0, 0 - b _080898D0 -_080898CE: - movs r0, 0x1 -_080898D0: - pop {r1} - bx r1 - thumb_func_end sub_80898C0 - - thumb_func_start MetatileBehavior_IsSurfableFishableWater -MetatileBehavior_IsSurfableFishableWater: @ 80898D4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - beq _080898F8 - cmp r0, 0x15 - beq _080898F8 - cmp r0, 0x11 - beq _080898F8 - cmp r0, 0x12 - beq _080898F8 - cmp r0, 0x14 - beq _080898F8 - subs r0, 0x50 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bhi _080898FC -_080898F8: - movs r0, 0x1 - b _080898FE -_080898FC: - movs r0, 0 -_080898FE: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSurfableFishableWater - - thumb_func_start sub_8089904 -sub_8089904: @ 8089904 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xF - beq _08089912 - movs r0, 0 - b _08089914 -_08089912: - movs r0, 0x1 -_08089914: - pop {r1} - bx r1 - thumb_func_end sub_8089904 - - thumb_func_start sub_8089918 -sub_8089918: @ 8089918 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x66 - beq _08089926 - movs r0, 0 - b _08089928 -_08089926: - movs r0, 0x1 -_08089928: - pop {r1} - bx r1 - thumb_func_end sub_8089918 - - thumb_func_start sub_808992C -sub_808992C: @ 808992C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD2 - beq _0808993A - movs r0, 0 - b _0808993C -_0808993A: - movs r0, 0x1 -_0808993C: - pop {r1} - bx r1 - thumb_func_end sub_808992C - - thumb_func_start MetatileBehavior_IsMuddySlope -@ bool8 MetatileBehavior_IsMuddySlope(u8 metatileBehavior) -MetatileBehavior_IsMuddySlope: @ 8089940 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD0 - beq _0808994E - movs r0, 0 - b _08089950 -_0808994E: - movs r0, 0x1 -_08089950: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsMuddySlope - - thumb_func_start MetatileBehavior_IsBumpySlope -MetatileBehavior_IsBumpySlope: @ 8089954 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD1 - beq _08089962 - movs r0, 0 - b _08089964 -_08089962: - movs r0, 0x1 -_08089964: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsBumpySlope - - thumb_func_start MetatileBehavior_IsIsolatedVerticalRail -MetatileBehavior_IsIsolatedVerticalRail: @ 8089968 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD3 - beq _08089976 - movs r0, 0 - b _08089978 -_08089976: - movs r0, 0x1 -_08089978: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsIsolatedVerticalRail - - thumb_func_start MetatileBehavior_IsIsolatedHorizontalRail -MetatileBehavior_IsIsolatedHorizontalRail: @ 808997C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD4 - beq _0808998A - movs r0, 0 - b _0808998C -_0808998A: - movs r0, 0x1 -_0808998C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsIsolatedHorizontalRail - - thumb_func_start MetatileBehavior_IsVerticalRail -MetatileBehavior_IsVerticalRail: @ 8089990 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD5 - beq _0808999E - movs r0, 0 - b _080899A0 -_0808999E: - movs r0, 0x1 -_080899A0: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsVerticalRail - - thumb_func_start MetatileBehavior_IsHorizontalRail -MetatileBehavior_IsHorizontalRail: @ 80899A4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD6 - beq _080899B2 - movs r0, 0 - b _080899B4 -_080899B2: - movs r0, 0x1 -_080899B4: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsHorizontalRail - - thumb_func_start MetatileBehavior_IsSeaweed -MetatileBehavior_IsSeaweed: @ 80899B8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x22 - beq _080899C6 - cmp r0, 0x2A - bne _080899CA -_080899C6: - movs r0, 0x1 - b _080899CC -_080899CA: - movs r0, 0 -_080899CC: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSeaweed - - thumb_func_start MetatileBehavior_IsRunningDisallowed -MetatileBehavior_IsRunningDisallowed: @ 80899D0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xA - beq _080899EC - cmp r0, 0x3 - beq _080899EC - cmp r0, 0x28 - beq _080899EC - bl MetatileBehavior_IsPacifidlogLog - lsls r0, 24 - cmp r0, 0 - beq _080899F0 -_080899EC: - movs r0, 0x1 - b _080899F2 -_080899F0: - movs r0, 0 -_080899F2: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsRunningDisallowed - - thumb_func_start sub_80899F8 -sub_80899F8: @ 80899F8 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0xFE - lsls r2, 24 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0x1 - bls _08089A12 - cmp r1, 0x24 - beq _08089A12 - cmp r1, 0x9 - bne _08089A16 -_08089A12: - movs r0, 0x1 - b _08089A18 -_08089A16: - movs r0, 0 -_08089A18: - pop {r1} - bx r1 - thumb_func_end sub_80899F8 - - thumb_func_start sub_8089A1C -sub_8089A1C: @ 8089A1C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8E - beq _08089A2A - movs r0, 0 - b _08089A2C -_08089A2A: - movs r0, 0x1 -_08089A2C: - pop {r1} - bx r1 - thumb_func_end sub_8089A1C - - thumb_func_start sub_8089A30 -sub_8089A30: @ 8089A30 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE0 - beq _08089A3E - movs r0, 0 - b _08089A40 -_08089A3E: - movs r0, 0x1 -_08089A40: - pop {r1} - bx r1 - thumb_func_end sub_8089A30 - - thumb_func_start sub_8089A44 -sub_8089A44: @ 8089A44 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE1 - beq _08089A52 - movs r0, 0 - b _08089A54 -_08089A52: - movs r0, 0x1 -_08089A54: - pop {r1} - bx r1 - thumb_func_end sub_8089A44 - - thumb_func_start sub_8089A58 -sub_8089A58: @ 8089A58 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE2 - beq _08089A66 - movs r0, 0 - b _08089A68 -_08089A66: - movs r0, 0x1 -_08089A68: - pop {r1} - bx r1 - thumb_func_end sub_8089A58 - - thumb_func_start sub_8089A6C -sub_8089A6C: @ 8089A6C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE3 - beq _08089A7A - movs r0, 0 - b _08089A7C -_08089A7A: - movs r0, 0x1 -_08089A7C: - pop {r1} - bx r1 - thumb_func_end sub_8089A6C - - thumb_func_start sub_8089A80 -sub_8089A80: @ 8089A80 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE4 - beq _08089A8E - movs r0, 0 - b _08089A90 -_08089A8E: - movs r0, 0x1 -_08089A90: - pop {r1} - bx r1 - thumb_func_end sub_8089A80 - - thumb_func_start sub_8089A94 -sub_8089A94: @ 8089A94 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE5 - beq _08089AA2 - movs r0, 0 - b _08089AA4 -_08089AA2: - movs r0, 0x1 -_08089AA4: - pop {r1} - bx r1 - thumb_func_end sub_8089A94 - - thumb_func_start sub_8089AA8 -sub_8089AA8: @ 8089AA8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE6 - beq _08089AB6 - movs r0, 0 - b _08089AB8 -_08089AB6: - movs r0, 0x1 -_08089AB8: - pop {r1} - bx r1 - thumb_func_end sub_8089AA8 - - thumb_func_start sub_8089ABC -sub_8089ABC: @ 8089ABC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD - beq _08089ACA - movs r0, 0 - b _08089ACC -_08089ACA: - movs r0, 0x1 -_08089ACC: - pop {r1} - bx r1 - thumb_func_end sub_8089ABC - - thumb_func_start sub_8089AD0 -sub_8089AD0: @ 8089AD0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x2 - bne _08089AE2 - cmp r0, 0xE8 - beq _08089AE6 -_08089AE2: - movs r0, 0 - b _08089AE8 -_08089AE6: - movs r0, 0x1 -_08089AE8: - pop {r1} - bx r1 - thumb_func_end sub_8089AD0 - - thumb_func_start sub_8089AEC -sub_8089AEC: @ 8089AEC - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x2 - bne _08089AFE - cmp r0, 0xE7 - beq _08089B02 -_08089AFE: - movs r0, 0 - b _08089B04 -_08089B02: - movs r0, 0x1 -_08089B04: - pop {r1} - bx r1 - thumb_func_end sub_8089AEC - - thumb_func_start MetatileBehavior_IsQuestionnaire -MetatileBehavior_IsQuestionnaire: @ 8089B08 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8F - beq _08089B16 - movs r0, 0 - b _08089B18 -_08089B16: - movs r0, 0x1 -_08089B18: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsQuestionnaire - - thumb_func_start MetatileBehavior_IsLongGrass2 -MetatileBehavior_IsLongGrass2: @ 8089B1C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - beq _08089B2A - movs r0, 0 - b _08089B2C -_08089B2A: - movs r0, 0x1 -_08089B2C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsLongGrass2 - - thumb_func_start MetatileBehavior_IsLongGrassSouthEdge -MetatileBehavior_IsLongGrassSouthEdge: @ 8089B30 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x9 - beq _08089B3E - movs r0, 0 - b _08089B40 -_08089B3E: - movs r0, 0x1 -_08089B40: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsLongGrassSouthEdge - - thumb_func_start MetatileBehavior_IsTrainerHillTimer -MetatileBehavior_IsTrainerHillTimer: @ 8089B44 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE9 - beq _08089B52 - movs r0, 0 - b _08089B54 -_08089B52: - movs r0, 0x1 -_08089B54: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsTrainerHillTimer - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/pokenav.s b/asm/pokenav.s index 58e60c51d..28f0df0ea 100755 --- a/asm/pokenav.s +++ b/asm/pokenav.s @@ -27356,7 +27356,7 @@ _081D4870: bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 - bl sub_8088E64 + bl MetatileBehavior_IsPokeGrass lsls r0, 24 lsrs r0, 24 _081D4888: diff --git a/asm/rom4.s b/asm/rom4.s index 9fb9e2bd6..c80eb194e 100644 --- a/asm/rom4.s +++ b/asm/rom4.s @@ -1699,19 +1699,19 @@ _080853AC: lsls r4, 24 lsrs r5, r4, 24 adds r0, r5, 0 - bl sub_8088F74 + bl MetatileBehavior_IsDeepSouthWarp lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq _080853E8 adds r0, r5, 0 - bl sub_8088F58 + bl MetatileBehavior_IsNonAnimDoor lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq _08085442 adds r0, r5, 0 - bl sub_8088EFC + bl MetatileBehavior_IsDoor lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 diff --git a/asm/secret_base.s b/asm/secret_base.s index e514e88f1..0290e9f7f 100644 --- a/asm/secret_base.s +++ b/asm/secret_base.s @@ -1163,13 +1163,13 @@ _080E941E: lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl sub_8089350 + bl MetatileBehavior_IsMB_B5 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq _080E9462 adds r0, r4, 0 - bl sub_8089364 + bl MetatileBehavior_IsMB_C3 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -3288,7 +3288,7 @@ _080EA62C: .pool _080EA668: adds r0, r5, 0 - bl sub_80893C8 + bl MetatileBehavior_IsSecretBaseGlitterMat lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -3308,7 +3308,7 @@ _080EA680: .pool _080EA698: adds r0, r5, 0 - bl sub_808938C + bl MetatileBehavior_IsSecretBaseBalloon lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -3377,7 +3377,7 @@ _080EA714: .pool _080EA72C: adds r0, r5, 0 - bl sub_80893A0 + bl MetatileBehavior_IsMB_BE lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -3409,7 +3409,7 @@ _080EA75E: .pool _080EA778: adds r0, r5, 0 - bl sub_80893B4 + bl MetatileBehavior_IsSecretBaseSoundMat lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -3429,7 +3429,7 @@ _080EA778: .pool _080EA7A8: adds r0, r5, 0 - bl MetatileBehavior_0xBB + bl MetatileBehavior_IsSecretBaseJumpMat lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -3449,7 +3449,7 @@ _080EA7A8: .pool _080EA7D8: adds r0, r5, 0 - bl MetatileBehavior_0xBC + bl MetatileBehavior_IsSecretBaseSpinMat lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 diff --git a/asm/wild_encounter.s b/asm/wild_encounter.s index 2c628a5e4..9b6c901f6 100644 --- a/asm/wild_encounter.s +++ b/asm/wild_encounter.s @@ -68,7 +68,7 @@ _080B4920: bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 - bl sub_8089660 + bl MetatileBehavior_IsSurfableAndNotWaterfall lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1424,7 +1424,7 @@ _080B539C: lsls r0, r6, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl sub_808952C + bl MetatileBehavior_IsLandWildEncounter lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1498,7 +1498,7 @@ _080B5418: .pool _080B543C: adds r0, r4, 0 - bl sub_8089558 + bl MetatileBehavior_IsWaterWildEncounter lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1509,7 +1509,7 @@ _080B543C: cmp r0, 0 beq _080B54FE adds r0, r4, 0 - bl sub_80894AC + bl MetatileBehavior_IsBridge lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1726,7 +1726,7 @@ _080B562C: bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 - bl sub_808952C + bl MetatileBehavior_IsLandWildEncounter lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1769,7 +1769,7 @@ _080B568C: bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 - bl sub_8089558 + bl MetatileBehavior_IsWaterWildEncounter lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 diff --git a/data/metatile_behavior.s b/data/rom_8486FEC.s similarity index 60% rename from data/metatile_behavior.s rename to data/rom_8486FEC.s index ea19a3031..9b7834a32 100644 --- a/data/metatile_behavior.s +++ b/data/rom_8486FEC.s @@ -4,5 +4,5 @@ .section .rodata .align 2, 0 -gUnknown_08486EFC:: @ 8486EFC - .incbin "baserom.gba", 0x486efc, 0x10090 +gUnknown_8486FEC:: @ 8486FEC + .incbin "baserom.gba", 0x486fec, 0xFFA0 diff --git a/include/metatile_behavior.h b/include/metatile_behavior.h index 5ed36c690..d6743b788 100644 --- a/include/metatile_behavior.h +++ b/include/metatile_behavior.h @@ -1,11 +1,149 @@ -#ifndef GUARD_METATILE_BEHAVIOR_H -#define GUARD_METATILE_BEHAVIOR_H +#ifndef GUARD_METATILE_BEHAVIOR +#define GUARD_METATILE_BEHAVIOR -// Exported type declarations +bool8 ShouldDoJumpLandingDustEffect(u8); +bool8 MetatileBehavior_IsEncounterTile(u8); +bool8 MetatileBehavior_IsJumpEast(u8); +bool8 MetatileBehavior_IsJumpWest(u8); +bool8 MetatileBehavior_IsJumpNorth(u8); +bool8 MetatileBehavior_IsJumpSouth(u8); +bool8 MetatileBehavior_IsPokeGrass(u8); +bool8 MetatileBehavior_IsSandOrDeepSand(u8); +bool8 MetatileBehavior_IsDeepSand(u8); +bool8 MetatileBehavior_IsReflective(u8); +bool8 MetatileBehavior_IsIce(u8); +bool8 MetatileBehavior_IsWarpDoor(u8); +bool8 MetatileBehavior_IsDoor(u8); +bool8 MetatileBehavior_IsEscalator(u8); +bool8 MetatileBehavior_IsMB_04(u8); +bool8 MetatileBehavior_IsLadder(u8); +bool8 MetatileBehavior_IsNonAnimDoor(u8); +bool8 MetatileBehavior_IsDeepSouthWarp(u8); +bool8 MetatileBehavior_IsSurfableWaterOrUnderwater(u8); +bool8 MetatileBehavior_IsEastArrowWarp(u8); +bool8 MetatileBehavior_IsWestArrowWarp(u8); +bool8 MetatileBehavior_IsNorthArrowWarp(u8); +bool8 MetatileBehavior_IsSouthArrowWarp(u8); +bool8 MetatileBehavior_IsArrowWarp(u8); +bool8 MetatileBehavior_IsMoveTile(u8); +bool8 MetatileBehavior_IsIce_2(u8); +bool8 MetatileBehavior_IsTrickHouseSlipperyFloor(u8); +bool8 MetatileBehavior_IsMB_05(u8); +bool8 MetatileBehavior_IsWalkNorth(u8); +bool8 MetatileBehavior_IsWalkSouth(u8); +bool8 MetatileBehavior_IsWalkWest(u8); +bool8 MetatileBehavior_IsWalkEast(u8); +bool8 MetatileBehavior_IsNorthwardCurrent(u8); +bool8 MetatileBehavior_IsSouthwardCurrent(u8); +bool8 MetatileBehavior_IsWestwardCurrent(u8); +bool8 MetatileBehavior_IsEastwardCurrent(u8); +bool8 MetatileBehavior_IsSlideNorth(u8); +bool8 MetatileBehavior_IsSlideSouth(u8); +bool8 MetatileBehavior_IsSlideWest(u8); +bool8 MetatileBehavior_IsSlideEast(u8); +bool8 MetatileBehavior_IsCounter(u8); +bool8 MetatileBehavior_IsPlayerFacingTVScreen(u8 tile, u8 playerDir); +bool8 MetatileBehavior_IsPC(u8); +bool8 MetatileBehavior_IsCableBoxResults1(u8); +bool8 MetatileBehavior_IsSecretBaseOpen(u8); +bool8 MetatileBehavior_IsSecretBaseCave(u8); +bool8 MetatileBehavior_IsSecretBaseTree(u8); +bool8 MetatileBehavior_IsSecretBaseShrub(u8); +bool8 MetatileBehavior_IsSecretBasePC(u8); +bool8 MetatileBehavior_IsSecretBaseRegisterPC(u8); +bool8 MetatileBehavior_IsMB_B2(u8); +bool8 MetatileBehavior_IsMB_B3(u8); +bool8 MetatileBehavior_IsMB_B9(u8); +bool8 MetatileBehavior_IsMB_C6(u8); +bool8 MetatileBehavior_IsSecretBasePoster(u8); +bool8 MetatileBehavior_IsNormal(u8); +bool8 MetatileBehavior_IsMB_B7(u8); +bool8 MetatileBehavior_IsMB_B2_Duplicate(u8); +bool8 MetatileBehavior_IsMB_B5(u8); +bool8 MetatileBehavior_IsMB_C3(u8); +bool8 MetatileBehavior_IsMB_C2(u8); +bool8 MetatileBehavior_IsSecretBaseBalloon(u8); +bool8 MetatileBehavior_IsMB_BE(u8); +bool8 MetatileBehavior_IsSecretBaseSoundMat(u8); +bool8 MetatileBehavior_IsSecretBaseGlitterMat(u8); +bool8 MetatileBehavior_IsMB_BF(u8); +bool8 MetatileBehavior_IsSecretBaseTvOrShield(u8); +bool8 MetatileBehavior_IsMB_C5(u8); +bool8 MetatileBehavior_HasRipples(u8); +bool8 MetatileBehavior_IsPuddle(u8); +bool8 MetatileBehavior_IsTallGrass(u8); +bool8 MetatileBehavior_IsLongGrass(u8); +bool8 MetatileBehavior_IsBerryTreeSoil(u8); +bool8 MetatileBehavior_IsAsh(u8); +bool8 MetatileBehavior_IsUnusedFootprintMetatile(u8); +bool8 MetatileBehavior_IsBridge(u8); +u8 MetatileBehavior_GetBridgeSth(u8); +u8 MetatileBehavior_8089510(u8); +bool8 MetatileBehavior_IsLandWildEncounter(u8); +bool8 MetatileBehavior_IsWaterWildEncounter(u8); +bool8 MetatileBehavior_IsMB_0B(u8); +bool8 MetatileBehavior_IsMountain(u8); +bool8 MetatileBehavior_IsDiveable(u8); +bool8 MetatileBehavior_IsUnableToEmerge(u8); +bool8 MetatileBehavior_IsShallowFlowingWater(u8); +bool8 MetatileBehavior_IsThinIce(u8); +bool8 MetatileBehavior_IsCrackedIce(u8); +bool8 MetatileBehavior_IsDeepOrOceanWater(u8); +bool8 MetatileBehavior_IsMB_18_OrMB_1A(u8); +bool8 MetatileBehavior_IsSurfableAndNotWaterfall(u8); +bool8 MetatileBehavior_IsEastBlocked(u8); +bool8 MetatileBehavior_IsWestBlocked(u8); +bool8 MetatileBehavior_IsNorthBlocked(u8); +bool8 MetatileBehavior_IsSouthBlocked(u8); +bool8 MetatileBehavior_IsShortGrass(u8); +bool8 MetatileBehavior_IsHotSprings(u8); +bool8 MetatileBehavior_IsWaterfall(u8); +bool8 MetatileBehavior_IsFortreeBridge(u8); +bool8 MetatileBehavior_IsPacifilogVerticalLog1(u8); +bool8 MetatileBehavior_IsPacifilogVerticalLog2(u8); +bool8 MetatileBehavior_IsPacifilogHorizontalLog1(u8); +bool8 MetatileBehavior_IsPacifilogHorizontalLog2(u8); +bool8 MetatileBehavior_IsPacifidlogLog(u8); +bool8 MetatileBehavior_IsTrickHousePuzzleDoor(u8); +bool8 MetatileBehavior_IsRegionMap(u8); +bool8 MetatileBehavior_IsClosedSootopolisGymDoor(u8); +bool8 MetatileBehavior_IsUnknownClosedDoor(u8); +bool8 MetatileBehavior_IsRoulette(u8); +bool8 MetatileBehavior_IsPokeblockFeeder(u8); +bool8 MetatileBehavior_IsSecretBaseJumpMat(u8); +bool8 MetatileBehavior_IsSecretBaseSpinMat(u8); +bool8 MetatileBehavior_IsLavaridgeB1FWarp(u8); +bool8 MetatileBehavior_IsLavaridgeB1FWarp(u8); +bool8 MetatileBehavior_IsAquaHideoutWarp(u8); +bool8 MetatileBehavior_IsWarpOrBridge(u8); +bool8 MetatileBehavior_IsMossdeepGymWarp(u8); +bool8 MetatileBehavior_IsSurfableFishableWater(u8); +bool8 MetatileBehavior_IsMtPyreHole(u8); +bool8 MetatileBehavior_IsCrackedFloorHole(u8); +bool8 MetatileBehavior_IsCrackedFloor(u8); +bool8 MetatileBehavior_IsMuddySlope(u8); +bool8 MetatileBehavior_IsBumpySlope(u8); +bool8 MetatileBehavior_IsIsolatedVerticalRail(u8); +bool8 MetatileBehavior_IsIsolatedHorizontalRail(u8); +bool8 MetatileBehavior_IsVerticalRail(u8); +bool8 MetatileBehavior_IsHorizontalRail(u8); +bool8 MetatileBehavior_IsSeaweed(u8); +bool8 MetatileBehavior_IsRunningDisallowed(u8); +bool8 MetatileBehavior_IsCuttableGrass(u8); +bool8 MetatileBehavior_IsRunningShoesInstruction(u8); +bool8 MetatileBehavior_IsPictureBookShelf(u8); +bool8 MetatileBehavior_IsBookShelf(u8); +bool8 MetatileBehavior_IsPokeCenterBookShelf(u8); +bool8 MetatileBehavior_IsVase(u8); +bool8 MetatileBehavior_IsTrashCan(u8); +bool8 MetatileBehavior_IsShopShelf(u8); +bool8 MetatileBehavior_IsBlueprint(u8); +bool8 MetatileBehavior_IsBattlePyramidWarp(u8); +bool8 MetatileBehavior_IsPlayerFacingWirelessBoxResults(u8 tile, u8 playerDir); +bool8 MetatileBehavior_IsCableBoxResults2(u8 tile, u8 playerDir); +bool8 MetatileBehavior_IsQuestionnaire(u8); +bool8 MetatileBehavior_IsLongGrass_Duplicate(u8); +bool8 MetatileBehavior_IsLongGrassSouthEdge(u8); +bool8 MetatileBehavior_IsTrainerHillTimer(u8); -// Exported RAM declarations - -// Exported ROM declarations -bool8 sub_8088E64(u8); - -#endif //GUARD_METATILE_BEHAVIOR_H +#endif // GUARD_METATILE_BEHAVIOR diff --git a/include/metatile_behaviors.h b/include/metatile_behaviors.h new file mode 100644 index 000000000..dd3a8b4f4 --- /dev/null +++ b/include/metatile_behaviors.h @@ -0,0 +1,179 @@ +#ifndef GUARD_METATILE_BEHAVIORS +#define GUARD_METATILE_BEHAVIORS + +#define MB_NORMAL 0x00 +#define MB_TALL_GRASS 0x02 +#define MB_LONG_GRASS 0x03 +#define MB_04 0x04 +#define MB_05 0x05 +#define MB_DEEP_SAND 0x06 +#define MB_SHORT_GRASS 0x07 +#define MB_CAVE 0x08 +#define MB_LONG_GRASS_SOUTH_EDGE 0x09 +#define MB_NO_RUNNING 0x0A +#define MB_0B 0x0B +#define MB_MOUNTAIN_TOP 0x0C +#define MB_BATTLE_PYRAMID_WARP 0x0D +#define MB_MOSSDEEP_GYM_WARP 0x0E +#define MB_MT_PYRE_HOLE 0x0F +#define MB_POND_WATER 0x10 +#define MB_SEMI_DEEP_WATER 0x11 +#define MB_DEEP_WATER 0x12 +#define MB_WATERFALL 0x13 +#define MB_SOOTOPOLIS_DEEP_WATER 0x14 +#define MB_OCEAN_WATER 0x15 +#define MB_PUDDLE 0x16 +#define MB_SHALLOW_WATER 0x17 +#define MB_18 0x18 +#define MB_NO_SURFACING 0x19 +#define MB_1A 0x1A +#define MB_STAIRS_OUTSIDE_ABANDONED_SHIP 0x1B +#define MB_SHOAL_CAVE_ENTRANCE 0x1C +#define MB_ICE 0x20 +#define MB_SAND 0x21 +#define MB_SEAWEED 0x22 +#define MB_ASHGRASS 0x24 +#define MB_25 0x25 +#define MB_THIN_ICE 0x26 +#define MB_CRACKED_ICE 0x27 +#define MB_HOT_SPRINGS 0x28 +#define MB_LAVARIDGE_GYM_B1F_WARP 0x29 +#define MB_SEAWEED_NO_SURFACING 0x2A +#define MB_REFLECTION_UNDER_BRIDGE 0x2B +#define MB_IMPASSABLE_EAST 0x30 +#define MB_IMPASSABLE_WEST 0x31 +#define MB_IMPASSABLE_NORTH 0x32 +#define MB_IMPASSABLE_SOUTH 0x33 +#define MB_IMPASSABLE_NORTHEAST 0x34 +#define MB_IMPASSABLE_NORTHWEST 0x35 +#define MB_IMPASSABLE_SOUTHEAST 0x36 +#define MB_IMPASSABLE_SOUTHWEST 0x37 +#define MB_JUMP_EAST 0x38 +#define MB_JUMP_WEST 0x39 +#define MB_JUMP_NORTH 0x3A +#define MB_JUMP_SOUTH 0x3B +#define MB_JUMP_SOUTHEAST 0x3E +#define MB_JUMP_SOUTHWEST 0x3F +#define MB_WALK_EAST 0x40 +#define MB_WALK_WEST 0x41 +#define MB_WALK_NORTH 0x42 +#define MB_WALK_SOUTH 0x43 +#define MB_SLIDE_EAST 0x44 +#define MB_SLIDE_WEST 0x45 +#define MB_SLIDE_NORTH 0x46 +#define MB_SLIDE_SOUTH 0x47 +#define MB_TRICK_HOUSE_PUZZLE_8_FLOOR 0x48 +#define MB_EASTWARD_CURRENT 0x50 +#define MB_WESTWARD_CURRENT 0x51 +#define MB_NORTHWARD_CURRENT 0x52 +#define MB_SOUTHWARD_CURRENT 0x53 +#define MB_NON_ANIMATED_DOOR 0x60 +#define MB_LADDER 0x61 +#define MB_EAST_ARROW_WARP 0x62 +#define MB_WEST_ARROW_WARP 0x63 +#define MB_NORTH_ARROW_WARP 0x64 +#define MB_SOUTH_ARROW_WARP 0x65 +#define MB_CRACKED_FLOOR_HOLE 0x66 +#define MB_AQUA_HIDEOUT_WARP 0x67 +#define MB_LAVARIDGE_GYM_1F_WARP 0x68 +#define MB_ANIMATED_DOOR 0x69 +#define MB_UP_ESCALATOR 0x6A +#define MB_DOWN_ESCALATOR 0x6B +#define MB_WATER_DOOR 0x6C +#define MB_WATER_SOUTH_ARROW_WARP 0x6D +#define MB_DEEP_SOUTH_WARP 0x6E +#define MB_WARP_OR_BRIDGE 0x70 +#define MB_71 0x71 +#define MB_ROUTE120_NORTH_BRIDGE_1 0x72 +#define MB_ROUTE120_NORTH_BRIDGE_2 0x73 +#define MB_PACIFIDLOG_VERTICAL_LOG_1 0x74 +#define MB_PACIFIDLOG_VERTICAL_LOG_2 0x75 +#define MB_PACIFIDLOG_HORIZONTAL_LOG_1 0x76 +#define MB_PACIFIDLOG_HORIZONTAL_LOG_2 0x77 +#define MB_FORTREE_BRIDGE 0x78 +#define MB_ROUTE120_SOUTH_BRIDGE_1 0x7A +#define MB_ROUTE120_SOUTH_BRIDGE_2 0x7B +#define MB_ROUTE120_NORTH_BRIDGE_3 0x7C +#define MB_ROUTE120_NORTH_BRIDGE_4 0x7D +#define MB_7E 0x7E +#define MB_ROUTE110_BRIDGE 0x7F +#define MB_COUNTER 0x80 +#define MB_PC 0x83 +#define MB_CABLE_BOX_RESULTS_1 0x84 +#define MB_REGION_MAP 0x85 +#define MB_TELEVISION 0x86 +#define MB_POKEBLOCK_FEEDER 0x87 +#define MB_SLOT_MACHINE 0x89 +#define MB_ROULETTE 0x8A +#define MB_CLOSED_SOOTOPOLIS_GYM_DOOR 0x8B +#define MB_TRICK_HOUSE_PUZZLE_DOOR 0x8C +#define MB_8D 0x8D +#define MB_RUNNING_SHOES_INSTRUCTION 0x8E +#define MB_QUESTIONNAIRE 0x8F +#define MB_SECRET_BASE_SPOT_RED_CAVE 0x90 +#define MB_SECRET_BASE_SPOT_RED_CAVE_OPEN 0x91 +#define MB_SECRET_BASE_SPOT_BROWN_CAVE 0x92 +#define MB_SECRET_BASE_SPOT_BROWN_CAVE_OPEN 0x93 +#define MB_SECRET_BASE_SPOT_YELLOW_CAVE 0x94 +#define MB_SECRET_BASE_SPOT_YELLOW_CAVE_OPEN 0x95 +#define MB_SECRET_BASE_SPOT_TREE_LEFT 0x96 +#define MB_SECRET_BASE_SPOT_TREE_LEFT_OPEN 0x97 +#define MB_SECRET_BASE_SPOT_SHRUB 0x98 +#define MB_SECRET_BASE_SPOT_SHRUB_OPEN 0x99 +#define MB_SECRET_BASE_SPOT_BLUE_CAVE 0x9A +#define MB_SECRET_BASE_SPOT_BLUE_CAVE_OPEN 0x9B +#define MB_SECRET_BASE_SPOT_TREE_RIGHT 0x9C +#define MB_SECRET_BASE_SPOT_TREE_RIGHT_OPEN 0x9D +#define MB_BERRY_TREE_SOIL 0xA0 +#define MB_SECRET_BASE_PC 0xB0 +#define MB_SECRET_BASE_REGISTER_PC 0xB1 +#define MB_B2 0xB2 +#define MB_B3 0xB3 +#define MB_B4 0xB4 +#define MB_B5 0xB5 +#define MB_B6 0xB6 +#define MB_B7 0xB7 +#define MB_SECRET_BASE_BALLOON 0xB8 +#define MB_B9 0xB9 +#define MB_SECRET_BASE_GLITTER_MAT 0xBA +#define MB_SECRET_BASE_JUMP_MAT 0xBB +#define MB_SECRET_BASE_SPIN_MAT 0xBC +#define MB_SECRET_BASE_SOUND_MAT 0xBD +#define MB_BE 0xBE +#define MB_BF 0xBF +#define MB_BED 0xC0 +#define MB_C1 0xC1 +#define MB_C2 0xC2 +#define MB_C3 0xC3 +#define MB_SECRET_BASE_TV_SHIELD 0xC4 +#define MB_C5 0xC5 +#define MB_C6 0xC6 +#define MB_SECRET_BASE_POSTER 0xC7 +#define MB_C8 0xC8 +#define MB_C9 0xC9 +#define MB_CA 0xCA +#define MB_CB 0xCB +#define MB_CC 0xCC +#define MB_CD 0xCD +#define MB_CE 0xCE +#define MB_CF 0xCF +#define MB_MUDDY_SLOPE 0xD0 +#define MB_BUMPY_SLOPE 0xD1 +#define MB_CRACKED_FLOOR 0xD2 +#define MB_ISOLATED_VERTICAL_RAIL 0xD3 +#define MB_ISOLATED_HORIZONTAL_RAIL 0xD4 +#define MB_VERTICAL_RAIL 0xD5 +#define MB_HORIZONTAL_RAIL 0xD6 +#define MB_PICTURE_BOOK_SHELF 0xE0 +#define MB_BOOKSHELF 0xE1 +#define MB_POKEMON_CENTER_BOOKSHELF 0xE2 +#define MB_VASE 0xE3 +#define MB_TRASH_CAN 0xE4 +#define MB_SHOP_SHELF 0xE5 +#define MB_BLUEPRINT 0xE6 +#define MB_CABLE_BOX_RESULTS_2 0xE7 +#define MB_WIRELESS_BOX_RESULTS 0xE8 +#define MB_TRAINER_HILL_TIMER 0xE9 +#define MB_UNKNOWN_CLOSED_DOOR 0xEA + +#endif // GUARD_METATILE_BEHAVIORS diff --git a/ld_script.txt b/ld_script.txt index 64a43d573..4025a487f 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -92,7 +92,7 @@ SECTIONS { src/new_game.o(.text); asm/rom4.o(.text); asm/fieldmap.o(.text); - asm/metatile_behavior.o(.text); + src/metatile_behavior.o(.text); asm/field_camera.o(.text); asm/field_door.o(.text); asm/field_player_avatar.o(.text); @@ -349,7 +349,8 @@ SECTIONS { src/new_game.o(.rodata); data/rom4.o(.rodata); data/fieldmap.o(.rodata); - data/metatile_behavior.o(.rodata); + src/metatile_behavior.o(.rodata); + data/rom_8486FEC.o(.rodata); data/field_door.o(.rodata); data/field_player_avatar.o(.rodata); data/field_map_obj.o(.rodata); diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 26bc513fb..e80e402c8 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -3413,7 +3413,7 @@ bool8 mss_08062EA4(struct MapObject *mapObject, struct Sprite *sprite) { return FALSE; } - return gUnknown_0850DA64[player_get_x22()](mapObject, sprite, player_get_direction_upper_nybble(), sub_8088E64); + return gUnknown_0850DA64[player_get_x22()](mapObject, sprite, player_get_direction_upper_nybble(), MetatileBehavior_IsPokeGrass); } bool8 sub_80925AC(struct MapObject *, struct Sprite *); diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c new file mode 100644 index 000000000..b9760f522 --- /dev/null +++ b/src/metatile_behavior.c @@ -0,0 +1,1436 @@ +#include "global.h" +#include "metatile_behavior.h" +#include "metatile_behaviors.h" + +#define TILE_FLAG_ENCOUNTER_TILE 1 +#define TILE_FLAG_SURFABLE 2 + +#define TILE_ATTRIBUTES(three, two, one) (((one) ? 1 : 0) | ((two) ? 2 : 0) | ((three) ? 4 : 0)) + +// wonder what the third flag is supposed to do +static const u8 sTileBitAttributes[] = +{ + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_NORMAL 0x00 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x01 + TILE_ATTRIBUTES(TRUE, FALSE, TRUE), // MB_TALL_GRASS 0x02 + TILE_ATTRIBUTES(TRUE, FALSE, TRUE), // MB_LONG_GRASS 0x03 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_04 0x04 + TILE_ATTRIBUTES(FALSE, FALSE, TRUE), // MB_05 0x05 + TILE_ATTRIBUTES(TRUE, FALSE, TRUE), // MB_DEEP_SAND 0x06 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SHORT_GRASS 0x07 + TILE_ATTRIBUTES(TRUE, FALSE, TRUE), // MB_CAVE 0x08 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_LONG_GRASS_SOUTH_EDGE 0x09 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_NO_RUNNING 0x0A + TILE_ATTRIBUTES(TRUE, FALSE, TRUE), // MB_0B 0x0B + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_MOUNTAIN_TOP 0x0C + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_BATTLE_PYRAMID_WARP 0x0D + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_MOSSDEEP_GYM_WARP 0x0E + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_MT_PYRE_HOLE 0x0F + TILE_ATTRIBUTES(TRUE, TRUE, TRUE), // MB_POND_WATER 0x10 + TILE_ATTRIBUTES(TRUE, TRUE, TRUE), // MB_SEMI_DEEP_WATER 0x11 + TILE_ATTRIBUTES(TRUE, TRUE, TRUE), // MB_DEEP_WATER 0x12 + TILE_ATTRIBUTES(TRUE, TRUE, FALSE), // MB_WATERFALL 0x13 + TILE_ATTRIBUTES(TRUE, TRUE, FALSE), // MB_SOOTOPOLIS_DEEP_WATER 0x14 + TILE_ATTRIBUTES(TRUE, TRUE, TRUE), // MB_OCEAN_WATER 0x15 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_PUDDLE 0x16 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SHALLOW_WATER 0x17 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_18 0x18 + TILE_ATTRIBUTES(TRUE, TRUE, FALSE), // MB_NO_SURFACING 0x19 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_1A 0x1A + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_STAIRS_OUTSIDE_ABANDONED_SHIP 0x1B + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SHOAL_CAVE_ENTRANCE 0x1C + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x1D + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x1E + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x1F + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_ICE 0x20 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SAND 0x21 + TILE_ATTRIBUTES(TRUE, TRUE, TRUE), // MB_SEAWEED 0x22 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // ? 0x23 + TILE_ATTRIBUTES(TRUE, FALSE, TRUE), // MB_ASHGRASS 0x24 + TILE_ATTRIBUTES(TRUE, FALSE, TRUE), // MB_25 0x25 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_THIN_ICE 0x26 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_CRACKED_ICE 0x27 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_HOT_SPRINGS 0x28 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_LAVARIDGE_GYM_B1F_WARP 0x29 + TILE_ATTRIBUTES(TRUE, TRUE, TRUE), // MB_SEAWEED_NO_SURFACING 0x2A + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_REFLECTION_UNDER_BRIDGE 0x2B + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x2C + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x2D + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x2E + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x2F + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_IMPASSABLE_EAST 0x30 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_IMPASSABLE_WEST 0x31 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_IMPASSABLE_NORTH 0x32 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_IMPASSABLE_SOUTH 0x33 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_IMPASSABLE_NORTHEAST 0x34 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_IMPASSABLE_NORTHWEST 0x35 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_IMPASSABLE_SOUTHEAST 0x36 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_IMPASSABLE_SOUTHWEST 0x37 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_JUMP_EAST 0x38 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_JUMP_WEST 0x39 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_JUMP_NORTH 0x3A + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_JUMP_SOUTH 0x3B + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // ? 0x3C + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // ? 0x3D + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_JUMP_SOUTHEAST 0x3E + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_JUMP_SOUTHWEST 0x3F + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_WALK_EAST 0x40 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_WALK_WEST 0x41 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_WALK_NORTH 0x42 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_WALK_SOUTH 0x43 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SLIDE_EAST 0x44 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SLIDE_WEST 0x45 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SLIDE_NORTH 0x46 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SLIDE_SOUTH 0x47 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_TRICK_HOUSE_PUZZLE_8_FLOOR 0x48 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // ? 0x49 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // ? 0x4A + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x4B + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x4C + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x4D + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x4E + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x4F + TILE_ATTRIBUTES(TRUE, TRUE, FALSE), // MB_EASTWARD_CURRENT 0x50 + TILE_ATTRIBUTES(TRUE, TRUE, FALSE), // MB_WESTWARD_CURRENT 0x51 + TILE_ATTRIBUTES(TRUE, TRUE, FALSE), // MB_NORTHWARD_CURRENT 0x52 + TILE_ATTRIBUTES(TRUE, TRUE, FALSE), // MB_SOUTHWARD_CURRENT 0x53 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x54 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x55 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x56 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x57 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x58 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x59 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x5A + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x5B + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x5C + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x5D + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x5E + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x5F + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_NON_ANIMATED_DOOR 0x60 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_LADDER 0x61 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_EAST_ARROW_WARP 0x62 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_WEST_ARROW_WARP 0x63 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_NORTH_ARROW_WARP 0x64 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SOUTH_ARROW_WARP 0x65 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_CRACKED_FLOOR_HOLE 0x66 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_AQUA_HIDEOUT_WARP 0x67 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_LAVARIDGE_GYM_1F_WARP 0x68 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_ANIMATED_DOOR 0x69 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_UP_ESCALATOR 0x6A + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_DOWN_ESCALATOR 0x6B + TILE_ATTRIBUTES(TRUE, TRUE, FALSE), // MB_WATER_DOOR 0x6C + TILE_ATTRIBUTES(TRUE, TRUE, FALSE), // MB_WATER_SOUTH_ARROW_WARP 0x6D + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_DEEP_SOUTH_WARP 0x6E + TILE_ATTRIBUTES(TRUE, TRUE, FALSE), // ? 0x6F + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_WARP_OR_BRIDGE 0x70 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_71 0x71 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_ROUTE120_NORTH_BRIDGE_1 0x72 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_ROUTE120_NORTH_BRIDGE_2 0x73 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_PACIFIDLOG_VERTICAL_LOG_1 0x74 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_PACIFIDLOG_VERTICAL_LOG_2 0x75 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_PACIFIDLOG_HORIZONTAL_LOG_1 0x76 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_PACIFIDLOG_HORIZONTAL_LOG_2 0x77 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_FORTREE_BRIDGE 0x78 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x79 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_ROUTE120_SOUTH_BRIDGE_1 0x7A + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_ROUTE120_SOUTH_BRIDGE_2 0x7B + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_ROUTE120_NORTH_BRIDGE_3 0x7C + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_ROUTE120_NORTH_BRIDGE_4 0x7D + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_7E 0x7E + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_ROUTE110_BRIDGE 0x7F + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_COUNTER 0x80 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x81 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x82 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_PC 0x83 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_CABLE_BOX_RESULTS_1 0x84 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_REGION_MAP 0x85 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_TELEVISION 0x86 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_POKEBLOCK_FEEDER 0x87 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x88 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SLOT_MACHINE 0x89 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_ROULETTE 0x8A + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_CLOSED_SOOTOPOLIS_GYM_DOOR 0x8B + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_TRICK_HOUSE_PUZZLE_DOOR 0x8C + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_8D 0x8D + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_RUNNING_SHOES_INSTRUCTION 0x8E + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_QUESTIONNAIRE 0x8F + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_RED_CAVE 0x90 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_RED_CAVE_OPEN 0x91 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_BROWN_CAVE 0x92 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_BROWN_CAVE_OPEN 0x93 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_YELLOW_CAVE 0x94 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_YELLOW_CAVE_OPEN 0x95 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_TREE_LEFT 0x96 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_TREE_LEFT_OPEN 0x97 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_SHRUB 0x98 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_SHRUB_OPEN 0x99 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_BLUE_CAVE 0x9A + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_BLUE_CAVE_OPEN 0x9B + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_TREE_RIGHT 0x9C + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_TREE_RIGHT_OPEN 0x9D + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x9E + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0x9F + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_BERRY_TREE_SOIL 0xA0 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xA1 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xA2 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xA3 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xA4 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xA5 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xA6 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xA7 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xA8 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xA9 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xAA + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xAB + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xAC + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xAD + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xAE + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xAF A + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_PC 0xB0 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_REGISTER_PC 0xB1 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_B2 0xB2 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_B3 0xB3 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_B4 0xB4 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_B5 0xB5 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_B6 0xB6 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_B7 0xB7 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SECRET_BASE_BALLOON 0xB8 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_B9 0xB9 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SECRET_BASE_GLITTER_MAT 0xBA + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SECRET_BASE_JUMP_MAT 0xBB + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SECRET_BASE_SPIN_MAT 0xBC + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SECRET_BASE_SOUND_MAT 0xBD + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_BE 0xBE + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_BF 0xBF + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_BED 0xC0 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_C1 0xC1 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_C2 0xC2 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_C3 0xC3 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SECRET_BASE_TV_SHIELD 0xC4 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_C5 0xC5 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_C6 0xC6 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_POSTER 0xC7 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_C8 0xC8 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_C9 0xC9 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_CA 0xCA + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_CB 0xCB + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_CC 0xCC + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_CD 0xCD + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_CE 0xCE + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_CF 0xCF + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_MUDDY_SLOPE 0xD0 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_BUMPY_SLOPE 0xD1 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_CRACKED_FLOOR 0xD2 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_ISOLATED_VERTICAL_RAIL 0xD3 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_ISOLATED_HORIZONTAL_RAIL 0xD4 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_VERTICAL_RAIL 0xD5 + TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_HORIZONTAL_RAIL 0xD6 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xD7 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xD8 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xD9 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xDA + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xDB + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xDC + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xDD + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xDE + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xDF + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_PICTURE_BOOK_SHELF 0xE0 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_BOOKSHELF 0xE1 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_POKEMON_CENTER_BOOKSHELF 0xE2 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_VASE 0xE3 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_TRASH_CAN 0xE4 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SHOP_SHELF 0xE5 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_BLUEPRINT 0xE6 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_CABLE_BOX_RESULTS_2 0xE7 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_WIRELESS_BOX_RESULTS 0xE8 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_TRAINER_HILL_TIMER 0xE9 + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNKNOWN_CLOSED_DOOR 0xEA + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xEB + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xEC + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xED + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xEE + TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // ? 0xEF +}; + +// only used as default case for checking jump landing in field_ground_effect. +bool8 ShouldDoJumpLandingDustEffect(u8 var) +{ + return TRUE; +} + +bool8 MetatileBehavior_IsEncounterTile(u8 var) +{ + if ((sTileBitAttributes[var] & TILE_FLAG_ENCOUNTER_TILE) != 0) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsJumpEast(u8 var) +{ + if (var == MB_JUMP_EAST) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsJumpWest(u8 var) +{ + if (var == MB_JUMP_WEST) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsJumpNorth(u8 var) +{ + if (var == MB_JUMP_NORTH) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsJumpSouth(u8 var) +{ + if (var == MB_JUMP_SOUTH) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsPokeGrass(u8 var) +{ + if (var == MB_TALL_GRASS || var == MB_LONG_GRASS) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSandOrDeepSand(u8 var) +{ + if (var == MB_SAND || var == MB_DEEP_SAND) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsDeepSand(u8 var) +{ + if (var == MB_DEEP_SAND) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsReflective(u8 var) +{ + if (var == MB_POND_WATER || var == MB_PUDDLE || var == MB_1A || var == MB_ICE || var == MB_SOOTOPOLIS_DEEP_WATER || var == MB_REFLECTION_UNDER_BRIDGE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsIce(u8 var) +{ + if (var == MB_ICE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsWarpDoor(u8 var) +{ + if (var == MB_ANIMATED_DOOR) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsDoor(u8 var) +{ + if (var == MB_8D || var == MB_ANIMATED_DOOR) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsEscalator(u8 var) +{ + if (var == MB_UP_ESCALATOR || var == MB_DOWN_ESCALATOR) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsMB_04(u8 var) // unused +{ + if (var == MB_04) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsLadder(u8 var) +{ + if (var == MB_LADDER) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsNonAnimDoor(u8 var) +{ + if (var == MB_NON_ANIMATED_DOOR || var == MB_WATER_DOOR || var == MB_DEEP_SOUTH_WARP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsDeepSouthWarp(u8 var) +{ + if (var == MB_DEEP_SOUTH_WARP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSurfableWaterOrUnderwater(u8 var) +{ + if ((sTileBitAttributes[var] & TILE_FLAG_SURFABLE) != 0) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsEastArrowWarp(u8 var) +{ + if (var == MB_EAST_ARROW_WARP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsWestArrowWarp(u8 var) +{ + if (var == MB_WEST_ARROW_WARP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsNorthArrowWarp(u8 var) +{ + if (var == MB_NORTH_ARROW_WARP || var == MB_STAIRS_OUTSIDE_ABANDONED_SHIP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSouthArrowWarp(u8 var) +{ + if (var == MB_SOUTH_ARROW_WARP || var == MB_WATER_SOUTH_ARROW_WARP || var == MB_SHOAL_CAVE_ENTRANCE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsArrowWarp(u8 var) // unused +{ + u8 ret = FALSE; + + if (MetatileBehavior_IsEastArrowWarp(var) + || MetatileBehavior_IsWestArrowWarp(var) + || MetatileBehavior_IsNorthArrowWarp(var) + || MetatileBehavior_IsSouthArrowWarp(var)) + { + ret = TRUE; + } + + return ret; +} + +bool8 MetatileBehavior_IsMoveTile(u8 var) +{ + if ((var >= MB_WALK_EAST && var <= MB_TRICK_HOUSE_PUZZLE_8_FLOOR) || (var >= MB_EASTWARD_CURRENT && var <= MB_SOUTHWARD_CURRENT) + || var == MB_MUDDY_SLOPE || var == MB_CRACKED_FLOOR || var == MB_WATERFALL || var == MB_ICE || var == MB_SECRET_BASE_JUMP_MAT || var == MB_SECRET_BASE_SPIN_MAT) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsIce_2(u8 var) +{ + if (var == MB_ICE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsTrickHouseSlipperyFloor(u8 var) +{ + if (var == MB_TRICK_HOUSE_PUZZLE_8_FLOOR) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsMB_05(u8 var) +{ + if (var == MB_05) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsWalkNorth(u8 var) +{ + if (var == MB_WALK_NORTH) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsWalkSouth(u8 var) +{ + if (var == MB_WALK_SOUTH) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsWalkWest(u8 var) +{ + if (var == MB_WALK_WEST) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsWalkEast(u8 var) +{ + if (var == MB_WALK_EAST) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsNorthwardCurrent(u8 var) +{ + if (var == MB_NORTHWARD_CURRENT) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSouthwardCurrent(u8 var) +{ + if (var == MB_SOUTHWARD_CURRENT) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsWestwardCurrent(u8 var) +{ + if (var == MB_WESTWARD_CURRENT) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsEastwardCurrent(u8 var) +{ + if (var == MB_EASTWARD_CURRENT) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSlideNorth(u8 var) +{ + if (var == MB_SLIDE_NORTH) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSlideSouth(u8 var) +{ + if (var == MB_SLIDE_SOUTH) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSlideWest(u8 var) +{ + if (var == MB_SLIDE_WEST) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSlideEast(u8 var) +{ + if (var == MB_SLIDE_EAST) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsCounter(u8 var) +{ + if (var == MB_COUNTER) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsPlayerFacingTVScreen(u8 tile, u8 playerDir) +{ + if (playerDir != CONNECTION_NORTH) // if the player isn't facing north, forget about it. + return FALSE; + else if (tile == MB_TELEVISION) // is the player's north tile a TV? + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsPC(u8 var) +{ + if (var == MB_PC) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsCableBoxResults1(u8 var) +{ + if (var == MB_CABLE_BOX_RESULTS_1) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSecretBaseOpen(u8 var) +{ + if (var == MB_SECRET_BASE_SPOT_RED_CAVE_OPEN || var == MB_SECRET_BASE_SPOT_BROWN_CAVE_OPEN + || var == MB_SECRET_BASE_SPOT_YELLOW_CAVE_OPEN || var == MB_SECRET_BASE_SPOT_TREE_LEFT_OPEN + || var == MB_SECRET_BASE_SPOT_SHRUB_OPEN || var == MB_SECRET_BASE_SPOT_BLUE_CAVE_OPEN + || var == MB_SECRET_BASE_SPOT_TREE_RIGHT_OPEN) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSecretBaseCave(u8 var) +{ + if (var == MB_SECRET_BASE_SPOT_RED_CAVE || var == MB_SECRET_BASE_SPOT_BROWN_CAVE || var == MB_SECRET_BASE_SPOT_YELLOW_CAVE || var == MB_SECRET_BASE_SPOT_BLUE_CAVE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSecretBaseTree(u8 var) +{ + if (var == MB_SECRET_BASE_SPOT_TREE_LEFT || var == MB_SECRET_BASE_SPOT_TREE_RIGHT) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSecretBaseShrub(u8 var) +{ + if (var == MB_SECRET_BASE_SPOT_SHRUB) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSecretBasePC(u8 var) +{ + if (var == MB_SECRET_BASE_PC) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSecretBaseRegisterPC(u8 var) +{ + if (var == MB_SECRET_BASE_REGISTER_PC) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsMB_B2(u8 var) // unused +{ + if (var == MB_B2) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsMB_B3(u8 var) +{ + if (var == MB_B3) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsMB_B9(u8 var) +{ + if (var == MB_B9) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsMB_C6(u8 var) +{ + if (var == MB_C6) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSecretBasePoster(u8 var) +{ + if (var == MB_SECRET_BASE_POSTER) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsNormal(u8 var) +{ + if (var == MB_NORMAL) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsMB_B7(u8 var) +{ + if (var == MB_B7) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsMB_B2_Duplicate(u8 var) // unused +{ + if (var == MB_B2) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsMB_B5(u8 var) +{ + if (var == MB_B5) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsMB_C3(u8 var) +{ + if (var == MB_C3) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsMB_C2(u8 var) +{ + if (var == MB_C2) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSecretBaseBalloon(u8 var) +{ + if (var == MB_SECRET_BASE_BALLOON) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsMB_BE(u8 var) +{ + if (var == MB_BE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSecretBaseSoundMat(u8 var) +{ + if (var == MB_SECRET_BASE_SOUND_MAT) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSecretBaseGlitterMat(u8 var) +{ + if (var == MB_SECRET_BASE_GLITTER_MAT) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsMB_BF(u8 var) +{ + if (var == MB_BF) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSecretBaseTvOrShield(u8 var) +{ + if (var == MB_SECRET_BASE_TV_SHIELD) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsMB_C5(u8 var) +{ + if (var == MB_C5) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_HasRipples(u8 var) +{ + if (var == MB_POND_WATER || var == MB_PUDDLE || var == MB_SOOTOPOLIS_DEEP_WATER) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsPuddle(u8 var) +{ + if (var == MB_PUDDLE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsTallGrass(u8 var) +{ + if (var == MB_TALL_GRASS) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsLongGrass(u8 var) +{ + if (var == MB_LONG_GRASS) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsBerryTreeSoil(u8 var) +{ + if (var == MB_BERRY_TREE_SOIL) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsAsh(u8 var) +{ + if (var == MB_ASHGRASS) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsUnusedFootprintMetatile(u8 var) +{ + if (var == MB_25) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsBridge(u8 var) +{ + if ((var == MB_WARP_OR_BRIDGE || var == MB_71 || var == MB_ROUTE120_NORTH_BRIDGE_1 || var == MB_ROUTE120_NORTH_BRIDGE_2) + || (var == MB_ROUTE120_NORTH_BRIDGE_3 || var == MB_ROUTE120_NORTH_BRIDGE_4 || var == MB_7E || var == MB_ROUTE110_BRIDGE)) + return TRUE; + else + return FALSE; +} + +u8 MetatileBehavior_GetBridgeSth(u8 var) +{ + u8 result = var - MB_WARP_OR_BRIDGE; + if (result < 4) + return result; + + result = var - MB_ROUTE120_SOUTH_BRIDGE_1; + if (result < 2) + return 2; + + result = var - MB_ROUTE120_NORTH_BRIDGE_3; + if (result < 2) + return 3; + + return 0; +} + +u8 MetatileBehavior_8089510(u8 var) +{ + u8 result = var - MB_WARP_OR_BRIDGE; + + if (result < 4) + return 1; + else + return 0; +} + +bool8 MetatileBehavior_IsLandWildEncounter(u8 var) +{ + if (MetatileBehavior_IsSurfableWaterOrUnderwater(var) == FALSE && MetatileBehavior_IsEncounterTile(var) == TRUE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsWaterWildEncounter(u8 var) +{ + if (MetatileBehavior_IsSurfableWaterOrUnderwater(var) == TRUE && MetatileBehavior_IsEncounterTile(var) == TRUE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsMB_0B(u8 var) +{ + if (var == MB_0B) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsMountain(u8 var) +{ + if (var == MB_MOUNTAIN_TOP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsDiveable(u8 var) +{ + if (var == MB_SEMI_DEEP_WATER || var == MB_DEEP_WATER || var == MB_SOOTOPOLIS_DEEP_WATER) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsUnableToEmerge(u8 var) +{ + if (var == MB_NO_SURFACING || var == MB_SEAWEED_NO_SURFACING) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsShallowFlowingWater(u8 var) +{ + if (var == MB_SHALLOW_WATER || var == MB_STAIRS_OUTSIDE_ABANDONED_SHIP || var == MB_SHOAL_CAVE_ENTRANCE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsThinIce(u8 var) +{ + if (var == MB_THIN_ICE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsCrackedIce(u8 var) +{ + if (var == MB_CRACKED_ICE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsDeepOrOceanWater(u8 var) +{ + if (var == MB_OCEAN_WATER || var == MB_SEMI_DEEP_WATER || var == MB_DEEP_WATER) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsMB_18_OrMB_1A(u8 var) // unused +{ + if (var == MB_18 || var == MB_1A) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSurfableAndNotWaterfall(u8 var) +{ + if (MetatileBehavior_IsSurfableWaterOrUnderwater(var) && MetatileBehavior_IsWaterfall(var) == FALSE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsEastBlocked(u8 var) +{ + if (var == MB_IMPASSABLE_EAST || var == MB_IMPASSABLE_NORTHEAST || var == MB_IMPASSABLE_SOUTHEAST || var == MB_C1 || var == MB_BE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsWestBlocked(u8 var) +{ + if (var == MB_IMPASSABLE_WEST || var == MB_IMPASSABLE_NORTHWEST || var == MB_IMPASSABLE_SOUTHWEST || var == MB_C1 || var == MB_BE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsNorthBlocked(u8 var) +{ + if (var == MB_IMPASSABLE_NORTH || var == MB_IMPASSABLE_NORTHEAST || var == MB_IMPASSABLE_NORTHWEST || var == MB_BED) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSouthBlocked(u8 var) +{ + if (var == MB_IMPASSABLE_SOUTH || var == MB_IMPASSABLE_SOUTHEAST || var == MB_IMPASSABLE_SOUTHWEST || var == MB_BED) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsShortGrass(u8 var) +{ + if (var == MB_SHORT_GRASS) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsHotSprings(u8 var) +{ + if (var == MB_HOT_SPRINGS) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsWaterfall(u8 var) +{ + if (var == MB_WATERFALL) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsFortreeBridge(u8 var) +{ + if (var == MB_FORTREE_BRIDGE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsPacifilogVerticalLog1(u8 var) +{ + if (var == MB_PACIFIDLOG_VERTICAL_LOG_1) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsPacifilogVerticalLog2(u8 var) +{ + if (var == MB_PACIFIDLOG_VERTICAL_LOG_2) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsPacifilogHorizontalLog1(u8 var) +{ + if (var == MB_PACIFIDLOG_HORIZONTAL_LOG_1) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsPacifilogHorizontalLog2(u8 var) +{ + if (var == MB_PACIFIDLOG_HORIZONTAL_LOG_2) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsPacifidlogLog(u8 var) +{ + if (var == MB_PACIFIDLOG_VERTICAL_LOG_1 || var == MB_PACIFIDLOG_VERTICAL_LOG_2 + || var == MB_PACIFIDLOG_HORIZONTAL_LOG_1 || var == MB_PACIFIDLOG_HORIZONTAL_LOG_2) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsTrickHousePuzzleDoor(u8 var) +{ + if (var == MB_TRICK_HOUSE_PUZZLE_DOOR) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsRegionMap(u8 var) +{ + if (var == MB_REGION_MAP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsClosedSootopolisGymDoor(u8 var) +{ + if (var == MB_CLOSED_SOOTOPOLIS_GYM_DOOR) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsUnknownClosedDoor(u8 var) +{ + if (var == MB_UNKNOWN_CLOSED_DOOR) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsRoulette(u8 var) // unused +{ + if (var == MB_ROULETTE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsPokeblockFeeder(u8 var) +{ + if (var == MB_POKEBLOCK_FEEDER) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSecretBaseJumpMat(u8 var) +{ + if (var == MB_SECRET_BASE_JUMP_MAT) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSecretBaseSpinMat(u8 var) +{ + if (var == MB_SECRET_BASE_SPIN_MAT) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsLavaridgeB1FWarp(u8 var) +{ + if (var == MB_LAVARIDGE_GYM_B1F_WARP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsLavaridge1FWarp(u8 var) +{ + if (var == MB_LAVARIDGE_GYM_1F_WARP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsAquaHideoutWarp(u8 var) +{ + if (var == MB_AQUA_HIDEOUT_WARP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsWarpOrBridge(u8 var) +{ + if (var == MB_WARP_OR_BRIDGE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsMossdeepGymWarp(u8 var) +{ + if (var == MB_MOSSDEEP_GYM_WARP) + return TRUE; + else + return FALSE; +} + + +bool8 MetatileBehavior_IsSurfableFishableWater(u8 var) +{ + if (var == MB_POND_WATER || var == MB_OCEAN_WATER || var == MB_SEMI_DEEP_WATER || var == MB_DEEP_WATER + || var == MB_SOOTOPOLIS_DEEP_WATER || (var == MB_EASTWARD_CURRENT || var == MB_WESTWARD_CURRENT + || var == MB_NORTHWARD_CURRENT || var == MB_SOUTHWARD_CURRENT)) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsMtPyreHole(u8 var) +{ + if (var == MB_MT_PYRE_HOLE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsCrackedFloorHole(u8 var) +{ + if (var == MB_CRACKED_FLOOR_HOLE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsCrackedFloor(u8 var) +{ + if (var == MB_CRACKED_FLOOR) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsMuddySlope(u8 var) +{ + if (var == MB_MUDDY_SLOPE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsBumpySlope(u8 var) +{ + if (var == MB_BUMPY_SLOPE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsIsolatedVerticalRail(u8 var) +{ + if (var == MB_ISOLATED_VERTICAL_RAIL) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsIsolatedHorizontalRail(u8 var) +{ + if (var == MB_ISOLATED_HORIZONTAL_RAIL) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsVerticalRail(u8 var) +{ + if (var == MB_VERTICAL_RAIL) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsHorizontalRail(u8 var) +{ + if (var == MB_HORIZONTAL_RAIL) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSeaweed(u8 var) +{ + if (var == MB_SEAWEED || var == MB_SEAWEED_NO_SURFACING) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsRunningDisallowed(u8 var) +{ + if (var == MB_NO_RUNNING || var == MB_LONG_GRASS || var == MB_HOT_SPRINGS || MetatileBehavior_IsPacifidlogLog(var) != FALSE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsCuttableGrass(u8 var) +{ + if (var == MB_TALL_GRASS || var == MB_LONG_GRASS || var == MB_ASHGRASS || var == MB_LONG_GRASS_SOUTH_EDGE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsRunningShoesInstruction(u8 var) +{ + if (var == MB_RUNNING_SHOES_INSTRUCTION) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsPictureBookShelf(u8 var) +{ + if (var == MB_PICTURE_BOOK_SHELF) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsBookShelf(u8 var) +{ + if (var == MB_BOOKSHELF) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsPokeCenterBookShelf(u8 var) +{ + if (var == MB_POKEMON_CENTER_BOOKSHELF) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsVase(u8 var) +{ + if (var == MB_VASE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsTrashCan(u8 var) +{ + if (var == MB_TRASH_CAN) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsShopShelf(u8 var) +{ + if (var == MB_SHOP_SHELF) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsBlueprint(u8 var) +{ + if (var == MB_BLUEPRINT) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsBattlePyramidWarp(u8 var) +{ + if (var == MB_BATTLE_PYRAMID_WARP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsPlayerFacingWirelessBoxResults(u8 tile, u8 playerDir) +{ + if (playerDir != CONNECTION_NORTH) // if the player isn't facing north, forget about it. + return FALSE; + else if (tile == MB_WIRELESS_BOX_RESULTS) // is the player's north tile the monitor with results? + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsCableBoxResults2(u8 tile, u8 playerDir) +{ + if (playerDir != CONNECTION_NORTH) // if the player isn't facing north, forget about it. + return FALSE; + else if (tile == MB_CABLE_BOX_RESULTS_2) // is the player's north tile the monitor with results? + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsQuestionnaire(u8 var) +{ + if (var == MB_QUESTIONNAIRE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsLongGrass_Duplicate(u8 var) +{ + if (var == MB_LONG_GRASS) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsLongGrassSouthEdge(u8 var) +{ + if (var == MB_LONG_GRASS_SOUTH_EDGE) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsTrainerHillTimer(u8 var) +{ + if (var == MB_TRAINER_HILL_TIMER) + return TRUE; + else + return FALSE; +}