diff --git a/asm/non_matching/beanstalkSubtask/sub_0801A570.inc b/asm/non_matching/beanstalkSubtask/sub_0801A570.inc index e7e7effd..79670f74 100644 --- a/asm/non_matching/beanstalkSubtask/sub_0801A570.inc +++ b/asm/non_matching/beanstalkSubtask/sub_0801A570.inc @@ -100,7 +100,7 @@ _0801A628: mov r0, sb ldrb r1, [r0] adds r0, r4, #0 - bl GetTileType + bl GetMetaTileType adds r5, r0, #0 ldr r1, _0801A670 @ =0xFFFFFC97 adds r0, r5, r1 @@ -201,7 +201,7 @@ _0801A6E6: mov r0, sb ldrb r1, [r0] adds r0, r4, #0 - bl GetTileType + bl GetMetaTileType adds r5, r0, #0 ldr r0, _0801A734 @ =0x00000369 cmp r5, r0 @@ -303,7 +303,7 @@ _0801A7A6: mov r0, sb ldrb r1, [r0] adds r0, r4, #0 - bl GetTileType + bl GetMetaTileType adds r5, r0, #0 ldr r0, _0801A7F4 @ =0x00000369 cmp r5, r0 @@ -399,7 +399,7 @@ _0801A85E: mov r0, sb ldrb r1, [r0] adds r0, r4, #0 - bl GetTileType + bl GetMetaTileType adds r5, r0, #0 ldr r0, _0801A89C @ =0x00000369 cmp r5, r0 diff --git a/asm/src/intr.s b/asm/src/intr.s index adaaa7f6..faa00538 100644 --- a/asm/src/intr.s +++ b/asm/src/intr.s @@ -86,12 +86,12 @@ arm_sub_080B1A0C: @ 0x080B1A0C add r1, r1, r2 ldrb r2, [r0, #0x38] mov r0, r3 - b arm_GetTileTypeByPos -arm_GetTileTypeByEntity: + b arm_GetMetaTileTypeByPos +arm_GetMetaTileTypeByEntity: ldrb r2, [r0, #0x38] ldrh r1, [r0, #0x32] ldrh r0, [r0, #0x2e] -arm_GetTileTypeByPos: +arm_GetMetaTileTypeByPos: ldr ip, _080B1C18 @ =gRoomControls ldrh r3, [ip, #6] sub r0, r0, r3 @@ -106,8 +106,8 @@ arm_sub_080B1A58: add r0, r0, r1, lsl #6 mov r1, r2 - arm_func_start arm_GetTileType -arm_GetTileType: @ 0x080B1A60 + arm_func_start arm_GetMetaTileType +arm_GetMetaTileType: @ 0x080B1A60 ldr r2, _080B1C1C @ =gMapDataPtrs _080B1A64: add r2, r2, r1, lsl #3 @@ -208,7 +208,7 @@ arm_sub_080B1B68: @ 0x080B1B68 arm_func_start arm_sub_080B1B84 arm_sub_080B1B84: @ 0x080B1B84 mov ip, lr - bl arm_GetTileType + bl arm_GetMetaTileType lsls r0, r0, #0x12 ldrlo r1, _080B1C3C @ =gUnk_08000360 ldrhs r1, _080B1C40 @ =gUnk_080B7A3E @@ -220,7 +220,7 @@ arm_sub_080B1B84: @ 0x080B1B84 arm_sub_080B1BA4: @ 0x080B1BA4 mov ip, lr mov r3, r2 - bl arm_GetTileType + bl arm_GetMetaTileType lsls r0, r0, #0x12 ldrlo r1, _080B1C44 @ =gUnk_08000360 ldrhs r1, _080B1C48 @ =gUnk_080B7A3E diff --git a/asm/src/player.s b/asm/src/player.s index 962a5686..ebf6e131 100644 --- a/asm/src/player.s +++ b/asm/src/player.s @@ -326,7 +326,7 @@ sub_08008796: @ 0x08008796 adds r1, r7, #0 movs r2, #0x38 ldrb r2, [r4, r2] - bl GetTileTypeByPos + bl GetMetaTileTypeByPos ldr r1, _080088D8 @ =gUnk_080046A4 bl sub_08007DE0 beq _080087CE diff --git a/asm/src/script.s b/asm/src/script.s index ef5ad1cc..bc78fd76 100644 --- a/asm/src/script.s +++ b/asm/src/script.s @@ -80,7 +80,7 @@ ResolveCollisionLayer: @ 0x08016A30 ldrh r0, [r4, #0x2e] ldrh r1, [r4, #0x32] movs r2, #2 - bl GetTileTypeByPos + bl GetMetaTileTypeByPos movs r3, #1 cmp r0, #0 beq _08016A62 diff --git a/asm/src/veneer.s b/asm/src/veneer.s index 54eb79bb..f030c308 100644 --- a/asm/src/veneer.s +++ b/asm/src/veneer.s @@ -5,6 +5,7 @@ .text +@ copies from the gMapDataBottomSpecial to the bg buffers depending on gUpdateVisibleTiles thumb_func_start UpdateScrollVram UpdateScrollVram: @ 0x08000108 push {r4, lr} @@ -54,8 +55,8 @@ CloneTile: @ 0x08000152 ldrh r0, [r3, r0] lsrs r2, r2, #2 - non_word_aligned_thumb_func_start SetTile -SetTile: @ r0 = tile type, r1, = tile position, r2 = layer + non_word_aligned_thumb_func_start SetMetaTile +SetMetaTile: @ r0 = tile type, r1, = tile position, r2 = layer push {r4-r7, lr} lsls r3, r2, #3 @ 1: 8, 2: 16 ldr r4, _08000208 @ =gMapDataPtrs @@ -80,7 +81,7 @@ SetTile: @ r0 = tile type, r1, = tile position, r2 = layer bl DeleteLoadedTileEntity @ DeleteLoadedTileEntity(metaTilePos, layer) adds r0, r7, #0 @ r0 = oldMetaTile pop {r1, r2} - bl sub_0801AF48 @ sub_0801AF48(oldMetaTile, metaTilePos, layer) + bl StoreMetaTileForSpecialTile @ StoreMetaTileForSpecialTile(oldMetaTile, metaTilePos, layer) pop {r4, r5, r6, r7, pc} @ pop pc results in returning to the calling function _0800019A: adds r3, #4 @ r3 = layer * 8 + 4 @@ -113,8 +114,8 @@ SetVvvAtMetaTilePos: @ 0x080001D0 strb r0, [r3, r1] @ gMapBottom.vvv[metaTilePos] = r0 bx lr - non_word_aligned_thumb_func_start GetTileIndex -GetTileIndex: @ 0x080001DA + non_word_aligned_thumb_func_start GetMetaTileIndex +GetMetaTileIndex: @ 0x080001DA lsls r1, r1, #3 ldr r2, _08000224 @ =gMapDataPtrs ldr r1, [r2, r1] @@ -221,9 +222,9 @@ sub_080B1A0C: @ 0x0800029C @ call 0x080B1A28 @ r0: entity @ return: u32 (tileType) - thumb_func_start GetTileTypeByEntity -GetTileTypeByEntity: @ 0x080002A0 - ldr r3, _0800030C @ =ram_GetTileTypeByEntity + thumb_func_start GetMetaTileTypeByEntity +GetMetaTileTypeByEntity: @ 0x080002A0 + ldr r3, _0800030C @ =ram_GetMetaTileTypeByEntity bx r3 @ call 0x080B1A34 @@ -231,9 +232,9 @@ GetTileTypeByEntity: @ 0x080002A0 @ r1: s32 (yPos) @ r2: u32 (layer) @ return: u32 (tileType) - thumb_func_start GetTileTypeByPos -GetTileTypeByPos: @ 0x080002A4 - ldr r3, _08000310 @ =ram_GetTileTypeByPos + thumb_func_start GetMetaTileTypeByPos +GetMetaTileTypeByPos: @ 0x080002A4 + ldr r3, _08000310 @ =ram_GetMetaTileTypeByPos bx r3 @ call 0x080B1A48 @@ -258,9 +259,9 @@ sub_080B1A58: @ 0x080002AC @ r0: u32 (tileIndex) @ r1: u32 (layer) @ return: u32 (tileType) - thumb_func_start GetTileType -GetTileType: @ 0x080002B0 - ldr r3, _0800031C @ =ram_GetTileType + thumb_func_start GetMetaTileType +GetMetaTileType: @ 0x080002B0 + ldr r3, _0800031C @ =ram_GetMetaTileType bx r3 @ call 0x080B1A8C @@ -409,11 +410,11 @@ _080002FC: .4byte ram_sub_080B19EC _08000300: .4byte ram_sub_080B19FC _08000304: .4byte ram_sub_080B1A04 _08000308: .4byte ram_sub_080B1A0C -_0800030C: .4byte ram_GetTileTypeByEntity -_08000310: .4byte ram_GetTileTypeByPos +_0800030C: .4byte ram_GetMetaTileTypeByEntity +_08000310: .4byte ram_GetMetaTileTypeByPos _08000314: .4byte ram_sub_080B1A48 _08000318: .4byte ram_sub_080B1A58 -_0800031C: .4byte ram_GetTileType +_0800031C: .4byte ram_GetMetaTileType _08000320: .4byte ram_GetVvvRelativeToEntity _08000324: .4byte ram_GetVvvAtEntity _08000328: .4byte ram_GetVvvAtWorldCoords diff --git a/data/animations/npc/kid.s b/data/animations/npc/kid.s index fcaf867e..6e81c22f 100644 --- a/data/animations/npc/kid.s +++ b/data/animations/npc/kid.s @@ -91,6 +91,7 @@ gSpriteAnimations_Kid:: @ 0810C1E4 .4byte 00000000 @ TODO data of an unused entity? +@ maybe the unused original guard npc? gUnk_0810C268:: @ 0810C268 .4byte sub_08062AD0 .4byte sub_08062AD4 @@ -103,6 +104,8 @@ gUnk_0810C275:: @ 0810C275 gUnk_0810C27A:: @ 0810C27A .incbin "kid/gUnk_0810C27A.bin" + +gUnk_0810C280:: @ 0810C280 .4byte gUnk_0810C270 .4byte gUnk_0810C275 .4byte gUnk_0810C27A diff --git a/include/asm.h b/include/asm.h index bec879a5..846c1783 100644 --- a/include/asm.h +++ b/include/asm.h @@ -6,11 +6,11 @@ extern u32 Random(void); extern u32 GetRandomByWeight(const u8*); extern void CloneTile(u32, u32, u32); -extern u32 GetTileTypeByEntity(struct Entity_*); -extern u32 GetTileTypeByPos(s32 x, s32 y, u32 layer); -extern u32 GetTileType(u32 position, u32 layer); +extern u32 GetMetaTileTypeByEntity(struct Entity_*); +extern u32 GetMetaTileTypeByPos(s32 x, s32 y, u32 layer); +extern u32 GetMetaTileType(u32 metaTilePos, u32 layer); -extern void SetTile(u32 metaTile, u32 metaTilePos, u32 layer); +extern void SetMetaTile(u32 metaTile, u32 metaTilePos, u32 layer); extern void UpdateScrollVram(void); extern u32 sub_080B1BA4(u32, u32, u32); diff --git a/include/backgroundAnimations.h b/include/backgroundAnimations.h index 104044ed..4c3ad5c8 100644 --- a/include/backgroundAnimations.h +++ b/include/backgroundAnimations.h @@ -3,7 +3,7 @@ #include "global.h" -enum { +typedef enum { BG_ANIM_DEFAULT = 0, BG_ANIM_PALETTE = 16, BG_ANIM_MULTIPLE = 128, diff --git a/include/beanstalkSubtask.h b/include/beanstalkSubtask.h index f82c83e5..781cc93d 100644 --- a/include/beanstalkSubtask.h +++ b/include/beanstalkSubtask.h @@ -6,13 +6,13 @@ /* tiles 0x4000 and above create an entry here - */ -#define MAX_0200B240 0x100 +*/ +#define MAX_SPECIAL_TILES 0x100 typedef struct { - u16 position; // (layer << 0xc) | position - u16 data; -} struct_0200B240; -extern struct_0200B240 gUnk_0200B240[MAX_0200B240]; + u16 metaTilePosAndLayer; // (layer << 12) | position + u16 metaTileIndex; +} SpecialTileEntry; +extern SpecialTileEntry gMetaTilesForSpecialTiles[MAX_SPECIAL_TILES]; typedef struct { u16 collision; @@ -21,4 +21,11 @@ typedef struct { void LoadMapData(MapDataDefinition* dataDefinition); +/** + * Renders a metaTleMap with 16x16 meta tiles into a tilemap with 8x8 tiles. + * + * Takes into account the special meta tiles >= 0x4000 using GetMetaTileSetIndexForSpecialTile. + */ +void RenderMapLayerToTileMap(u16* tileMap, MapLayer* mapLayer); + #endif // BEANSTALKSUBTASK_H diff --git a/include/fileselect.h b/include/fileselect.h index 9c17bad7..83b05111 100644 --- a/include/fileselect.h +++ b/include/fileselect.h @@ -66,8 +66,6 @@ extern void CreateDialogBox(u32, u32); extern const Font gUnk_080FC844; extern const u16 gUnk_080FC85C[][3]; extern void (*const gUnk_080FC908[])(void); -extern const u8 gGlobalGfxAndPalettes[]; -extern u32 gUsedPalettes; extern u8 gTextGfxBuffer[]; #endif // FILESELECT_H \ No newline at end of file diff --git a/include/functions.h b/include/functions.h index e65297b7..e9647997 100644 --- a/include/functions.h +++ b/include/functions.h @@ -24,8 +24,7 @@ extern u32 CreateRandomItemDrop(Entity*, u32); extern void DrawDirect(u32 spriteIndex, u32 frameIndex); extern void DrawEntities(void); extern void FlushSprites(void); -extern LayerStruct* GetLayerByIndex(u32); -extern u32 GetTileIndex(u32 tilePos, u32 layer); +extern u32 GetMetaTileIndex(u32 metaTilePos, u32 layer); extern u32 GiveItem(u32, u32); extern bool32 LoadFixedGFX(Entity*, u32); extern void LoadResources(void); diff --git a/include/manager/bombableWallManager.h b/include/manager/bombableWallManager.h index 8d41bde4..2347807c 100644 --- a/include/manager/bombableWallManager.h +++ b/include/manager/bombableWallManager.h @@ -6,13 +6,13 @@ typedef struct { Manager base; u8 field_0x20[0x15]; - u8 field_0x35; + u8 layer; u8 field_0x36; u8 field_0x37; s16 x; u16 y; - u16 tile; - u16 field_0x3e; + u16 metaTilePos; + u16 flag; } BombableWallManager; #endif // BOMBABLEWALLMANAGER_H diff --git a/include/map.h b/include/map.h index fcb8f589..e603bb42 100644 --- a/include/map.h +++ b/include/map.h @@ -4,6 +4,16 @@ #include "global.h" #include "screen.h" +/** + * @page TileMap TileMap + * @brief + * + */ + +/** + * @brief Layer of the MetaTileMap. + * @ingroup TileMap + */ typedef struct { /*0x0000*/ BgSettings* bgSettings; /*0x0004*/ u16 mapData[0x40 * 0x40]; @@ -38,16 +48,13 @@ typedef struct { 0x12: ice 0x57: cloning pad */ -} LayerStruct; +} MapLayer; -extern LayerStruct gMapTop; -extern LayerStruct gMapBottom; +extern MapLayer gMapTop; +extern MapLayer gMapBottom; -// Rendered tilemaps https://www.coranac.com/tonc/text/regbg.htm#sec-map -// extern u16 gMapDataTopSpecial[0x4000]; -// extern u16 gMapDataBottomSpecial[0x4000]; -LayerStruct* GetLayerByIndex(u32); +extern MapLayer* GetLayerByIndex(u32 layer); /* Definition where some map data is found and where it should be copied to. @@ -64,4 +71,9 @@ typedef struct { // The src is compressed. #define MAP_COMPRESSED 0x80000000 +typedef enum { + LAYER_BOTTOM = 1, + LAYER_TOP = 2, +} LayerIndex; + #endif // MAP_H diff --git a/include/player.h b/include/player.h index 736e62a9..75e6d80a 100644 --- a/include/player.h +++ b/include/player.h @@ -231,7 +231,7 @@ typedef struct { typedef struct { u16 flags; - u16 keys; + u16 keys; /**< GBA keys bitmask, see io_reg.h */ } PlayerMacroEntry ALIGNED(2); typedef enum { diff --git a/include/room.h b/include/room.h index 18c3328f..3c11c750 100644 --- a/include/room.h +++ b/include/room.h @@ -34,7 +34,7 @@ typedef struct { /*0x0A*/ s16 scroll_x; /*0x0C*/ s16 scroll_y; /*0x0E*/ u8 scrollSpeed; /**< Pixels per frame that the camera can scroll. */ - /*0x0F*/ u8 scroll_flags; // 0x2 = ?? (apply collision value on bottom map no matter the layer SetTileType is called + /*0x0F*/ u8 scroll_flags; // 0x2 = ?? (apply collision value on bottom map no matter the layer SetMetaTileType is called // for), 0x4 = camera scrolling /*0x10*/ u8 scroll_direction; /*0x11*/ s8 oam_offset_x; @@ -74,7 +74,7 @@ typedef struct { /* 0x0a */ u8 unk2; /* 0x0b */ u8 filler2; /* 0x0c */ s16 lightLevel; - /* 0x0e */ u16 unk_0e; // Number of previous values for special tiles stored in gUnk_0200B240 + /* 0x0e */ u16 specialTileCount; // Number of previous values for special tiles stored in gMetaTilesForSpecialTiles /* 0x10 */ u8 unk_10[4]; /* 0x14 */ u32 flags; /* 0x18 */ u32 unk3; @@ -225,7 +225,7 @@ typedef enum { extern void** gCurrentRoomProperties; -void SetTileType(u32 tileType, u32 position, u32 layer); +void SetMetaTileType(u32 metaTileType, u32 metaTilePos, u32 layer); void InitScreenShake(u32 time, u32 magnitude); void CallRoomProp5And7(void); diff --git a/include/structures.h b/include/structures.h index 42c20353..493cc603 100644 --- a/include/structures.h +++ b/include/structures.h @@ -392,4 +392,7 @@ typedef struct { u8 gfxGroup; } PACKED StaffrollGfxEntry; +extern const u8 gGlobalGfxAndPalettes[]; +extern u32 gUsedPalettes; + #endif // STRUCTURES_H diff --git a/include/tilemap.h b/include/tilemap.h new file mode 100644 index 00000000..57242a97 --- /dev/null +++ b/include/tilemap.h @@ -0,0 +1,13 @@ +#ifndef TILEMAP_H +#define TILEMAP_H + +#include "global.h" + +// gMapDataTopSpecial and gMapDataBottomSpecial are tilemaps of 8x8 pixels. But they are also reused for other data in other parts of the game. + + +// Rendered tilemaps https://www.coranac.com/tonc/text/regbg.htm#sec-map +extern u16 gMapDataTopSpecial[0x4000]; +extern u16 gMapDataBottomSpecial[0x4000]; + +#endif // TILEMAP_H diff --git a/include/tiles.h b/include/tiles.h index 9915face..3db98b1b 100644 --- a/include/tiles.h +++ b/include/tiles.h @@ -15,4 +15,1695 @@ typedef enum { PERMA_ROCK4 = 0x1D6, } Tile; +typedef enum { + META_TILE_TYPE_0, // 0x0 + META_TILE_TYPE_1, // 0x1 + META_TILE_TYPE_2, // 0x2 + META_TILE_TYPE_3, // 0x3 + META_TILE_TYPE_4, // 0x4 + META_TILE_TYPE_5, // 0x5 + META_TILE_TYPE_6, // 0x6 + META_TILE_TYPE_7, // 0x7 + META_TILE_TYPE_8, // 0x8 + META_TILE_TYPE_9, // 0x9 + META_TILE_TYPE_10, // 0xa + META_TILE_TYPE_11, // 0xb + META_TILE_TYPE_12, // 0xc + META_TILE_TYPE_13, // 0xd + META_TILE_TYPE_14, // 0xe + META_TILE_TYPE_15, // 0xf + META_TILE_TYPE_16, // 0x10 + META_TILE_TYPE_17, // 0x11 + META_TILE_TYPE_18, // 0x12 + META_TILE_TYPE_19, // 0x13 + META_TILE_TYPE_20, // 0x14 + META_TILE_TYPE_21, // 0x15 + META_TILE_TYPE_22, // 0x16 + META_TILE_TYPE_23, // 0x17 + META_TILE_TYPE_24, // 0x18 + META_TILE_TYPE_25, // 0x19 + META_TILE_TYPE_26, // 0x1a + META_TILE_TYPE_27, // 0x1b + META_TILE_TYPE_28, // 0x1c + META_TILE_TYPE_29, // 0x1d + META_TILE_TYPE_30, // 0x1e + META_TILE_TYPE_31, // 0x1f + META_TILE_TYPE_32, // 0x20 + META_TILE_TYPE_33, // 0x21 + META_TILE_TYPE_34, // 0x22 + META_TILE_TYPE_35, // 0x23 + META_TILE_TYPE_36, // 0x24 + META_TILE_TYPE_37, // 0x25 + META_TILE_TYPE_38, // 0x26 + META_TILE_TYPE_39, // 0x27 + META_TILE_TYPE_40, // 0x28 + META_TILE_TYPE_41, // 0x29 + META_TILE_TYPE_42, // 0x2a + META_TILE_TYPE_43, // 0x2b + META_TILE_TYPE_44, // 0x2c + META_TILE_TYPE_45, // 0x2d + META_TILE_TYPE_46, // 0x2e + META_TILE_TYPE_47, // 0x2f + META_TILE_TYPE_48, // 0x30 + META_TILE_TYPE_49, // 0x31 + META_TILE_TYPE_50, // 0x32 + META_TILE_TYPE_51, // 0x33 + META_TILE_TYPE_52, // 0x34 + META_TILE_TYPE_53, // 0x35 + META_TILE_TYPE_54, // 0x36 + META_TILE_TYPE_55, // 0x37 + META_TILE_TYPE_56, // 0x38 + META_TILE_TYPE_57, // 0x39 + META_TILE_TYPE_58, // 0x3a + META_TILE_TYPE_59, // 0x3b + META_TILE_TYPE_60, // 0x3c + META_TILE_TYPE_61, // 0x3d + META_TILE_TYPE_62, // 0x3e + META_TILE_TYPE_63, // 0x3f + META_TILE_TYPE_64, // 0x40 + META_TILE_TYPE_65, // 0x41 + META_TILE_TYPE_66, // 0x42 + META_TILE_TYPE_67, // 0x43 + META_TILE_TYPE_68, // 0x44 + META_TILE_TYPE_69, // 0x45 + META_TILE_TYPE_70, // 0x46 + META_TILE_TYPE_71, // 0x47 + META_TILE_TYPE_72, // 0x48 + META_TILE_TYPE_73, // 0x49 + META_TILE_TYPE_74, // 0x4a + META_TILE_TYPE_75, // 0x4b + META_TILE_TYPE_76, // 0x4c + META_TILE_TYPE_77, // 0x4d + META_TILE_TYPE_78, // 0x4e + META_TILE_TYPE_79, // 0x4f + META_TILE_TYPE_80, // 0x50 + META_TILE_TYPE_81, // 0x51 + META_TILE_TYPE_82, // 0x52 + META_TILE_TYPE_83, // 0x53 + META_TILE_TYPE_84, // 0x54 + META_TILE_TYPE_85, // 0x55 + META_TILE_TYPE_86, // 0x56 + META_TILE_TYPE_87, // 0x57 + META_TILE_TYPE_88, // 0x58 + META_TILE_TYPE_89, // 0x59 + META_TILE_TYPE_90, // 0x5a + META_TILE_TYPE_91, // 0x5b + META_TILE_TYPE_92, // 0x5c + META_TILE_TYPE_93, // 0x5d + META_TILE_TYPE_94, // 0x5e + META_TILE_TYPE_95, // 0x5f + META_TILE_TYPE_96, // 0x60 + META_TILE_TYPE_97, // 0x61 + META_TILE_TYPE_98, // 0x62 + META_TILE_TYPE_99, // 0x63 + META_TILE_TYPE_100, // 0x64 + META_TILE_TYPE_101, // 0x65 + META_TILE_TYPE_102, // 0x66 + META_TILE_TYPE_103, // 0x67 + META_TILE_TYPE_104, // 0x68 + META_TILE_TYPE_105, // 0x69 + META_TILE_TYPE_106, // 0x6a + META_TILE_TYPE_107, // 0x6b + META_TILE_TYPE_108, // 0x6c + META_TILE_TYPE_109, // 0x6d + META_TILE_TYPE_110, // 0x6e + META_TILE_TYPE_111, // 0x6f + META_TILE_TYPE_112, // 0x70 + META_TILE_TYPE_113, // 0x71 + META_TILE_TYPE_114, // 0x72 + META_TILE_TYPE_115, // 0x73 + META_TILE_TYPE_116, // 0x74 + META_TILE_TYPE_117, // 0x75 + META_TILE_TYPE_118, // 0x76 + META_TILE_TYPE_119, // 0x77 + META_TILE_TYPE_120, // 0x78 + META_TILE_TYPE_121, // 0x79 + META_TILE_TYPE_122, // 0x7a + META_TILE_TYPE_123, // 0x7b + META_TILE_TYPE_124, // 0x7c + META_TILE_TYPE_125, // 0x7d + META_TILE_TYPE_126, // 0x7e + META_TILE_TYPE_127, // 0x7f + META_TILE_TYPE_128, // 0x80 + META_TILE_TYPE_129, // 0x81 + META_TILE_TYPE_130, // 0x82 + META_TILE_TYPE_131, // 0x83 + META_TILE_TYPE_132, // 0x84 + META_TILE_TYPE_133, // 0x85 + META_TILE_TYPE_134, // 0x86 + META_TILE_TYPE_135, // 0x87 + META_TILE_TYPE_136, // 0x88 + META_TILE_TYPE_137, // 0x89 + META_TILE_TYPE_138, // 0x8a + META_TILE_TYPE_139, // 0x8b + META_TILE_TYPE_140, // 0x8c + META_TILE_TYPE_141, // 0x8d + META_TILE_TYPE_142, // 0x8e + META_TILE_TYPE_143, // 0x8f + META_TILE_TYPE_144, // 0x90 + META_TILE_TYPE_145, // 0x91 + META_TILE_TYPE_146, // 0x92 + META_TILE_TYPE_147, // 0x93 + META_TILE_TYPE_148, // 0x94 + META_TILE_TYPE_149, // 0x95 + META_TILE_TYPE_150, // 0x96 + META_TILE_TYPE_151, // 0x97 + META_TILE_TYPE_152, // 0x98 + META_TILE_TYPE_153, // 0x99 + META_TILE_TYPE_154, // 0x9a + META_TILE_TYPE_155, // 0x9b + META_TILE_TYPE_156, // 0x9c + META_TILE_TYPE_157, // 0x9d + META_TILE_TYPE_158, // 0x9e + META_TILE_TYPE_159, // 0x9f + META_TILE_TYPE_160, // 0xa0 + META_TILE_TYPE_161, // 0xa1 + META_TILE_TYPE_162, // 0xa2 + META_TILE_TYPE_163, // 0xa3 + META_TILE_TYPE_164, // 0xa4 + META_TILE_TYPE_165, // 0xa5 + META_TILE_TYPE_166, // 0xa6 + META_TILE_TYPE_167, // 0xa7 + META_TILE_TYPE_168, // 0xa8 + META_TILE_TYPE_169, // 0xa9 + META_TILE_TYPE_170, // 0xaa + META_TILE_TYPE_171, // 0xab + META_TILE_TYPE_172, // 0xac + META_TILE_TYPE_173, // 0xad + META_TILE_TYPE_174, // 0xae + META_TILE_TYPE_175, // 0xaf + META_TILE_TYPE_176, // 0xb0 + META_TILE_TYPE_177, // 0xb1 + META_TILE_TYPE_178, // 0xb2 + META_TILE_TYPE_179, // 0xb3 + META_TILE_TYPE_180, // 0xb4 + META_TILE_TYPE_181, // 0xb5 + META_TILE_TYPE_182, // 0xb6 + META_TILE_TYPE_183, // 0xb7 + META_TILE_TYPE_184, // 0xb8 + META_TILE_TYPE_185, // 0xb9 + META_TILE_TYPE_186, // 0xba + META_TILE_TYPE_187, // 0xbb + META_TILE_TYPE_188, // 0xbc + META_TILE_TYPE_189, // 0xbd + META_TILE_TYPE_190, // 0xbe + META_TILE_TYPE_191, // 0xbf + META_TILE_TYPE_192, // 0xc0 + META_TILE_TYPE_193, // 0xc1 + META_TILE_TYPE_194, // 0xc2 + META_TILE_TYPE_195, // 0xc3 + META_TILE_TYPE_196, // 0xc4 + META_TILE_TYPE_197, // 0xc5 + META_TILE_TYPE_198, // 0xc6 + META_TILE_TYPE_199, // 0xc7 + META_TILE_TYPE_200, // 0xc8 + META_TILE_TYPE_201, // 0xc9 + META_TILE_TYPE_202, // 0xca + META_TILE_TYPE_203, // 0xcb + META_TILE_TYPE_204, // 0xcc + META_TILE_TYPE_205, // 0xcd + META_TILE_TYPE_206, // 0xce + META_TILE_TYPE_207, // 0xcf + META_TILE_TYPE_208, // 0xd0 + META_TILE_TYPE_209, // 0xd1 + META_TILE_TYPE_210, // 0xd2 + META_TILE_TYPE_211, // 0xd3 + META_TILE_TYPE_212, // 0xd4 + META_TILE_TYPE_213, // 0xd5 + META_TILE_TYPE_214, // 0xd6 + META_TILE_TYPE_215, // 0xd7 + META_TILE_TYPE_216, // 0xd8 + META_TILE_TYPE_217, // 0xd9 + META_TILE_TYPE_218, // 0xda + META_TILE_TYPE_219, // 0xdb + META_TILE_TYPE_220, // 0xdc + META_TILE_TYPE_221, // 0xdd + META_TILE_TYPE_222, // 0xde + META_TILE_TYPE_223, // 0xdf + META_TILE_TYPE_224, // 0xe0 + META_TILE_TYPE_225, // 0xe1 + META_TILE_TYPE_226, // 0xe2 + META_TILE_TYPE_227, // 0xe3 + META_TILE_TYPE_228, // 0xe4 + META_TILE_TYPE_229, // 0xe5 + META_TILE_TYPE_230, // 0xe6 + META_TILE_TYPE_231, // 0xe7 + META_TILE_TYPE_232, // 0xe8 + META_TILE_TYPE_233, // 0xe9 + META_TILE_TYPE_234, // 0xea + META_TILE_TYPE_235, // 0xeb + META_TILE_TYPE_236, // 0xec + META_TILE_TYPE_237, // 0xed + META_TILE_TYPE_238, // 0xee + META_TILE_TYPE_239, // 0xef + META_TILE_TYPE_240, // 0xf0 + META_TILE_TYPE_241, // 0xf1 + META_TILE_TYPE_242, // 0xf2 + META_TILE_TYPE_243, // 0xf3 + META_TILE_TYPE_244, // 0xf4 + META_TILE_TYPE_245, // 0xf5 + META_TILE_TYPE_246, // 0xf6 + META_TILE_TYPE_247, // 0xf7 + META_TILE_TYPE_248, // 0xf8 + META_TILE_TYPE_249, // 0xf9 + META_TILE_TYPE_250, // 0xfa + META_TILE_TYPE_251, // 0xfb + META_TILE_TYPE_252, // 0xfc + META_TILE_TYPE_253, // 0xfd + META_TILE_TYPE_254, // 0xfe + META_TILE_TYPE_255, // 0xff + META_TILE_TYPE_256, // 0x100 + META_TILE_TYPE_257, // 0x101 + META_TILE_TYPE_258, // 0x102 + META_TILE_TYPE_259, // 0x103 + META_TILE_TYPE_260, // 0x104 + META_TILE_TYPE_261, // 0x105 + META_TILE_TYPE_262, // 0x106 + META_TILE_TYPE_263, // 0x107 + META_TILE_TYPE_264, // 0x108 + META_TILE_TYPE_265, // 0x109 + META_TILE_TYPE_266, // 0x10a + META_TILE_TYPE_267, // 0x10b + META_TILE_TYPE_268, // 0x10c + META_TILE_TYPE_269, // 0x10d + META_TILE_TYPE_270, // 0x10e + META_TILE_TYPE_271, // 0x10f + META_TILE_TYPE_272, // 0x110 + META_TILE_TYPE_273, // 0x111 + META_TILE_TYPE_274, // 0x112 + META_TILE_TYPE_275, // 0x113 + META_TILE_TYPE_276, // 0x114 + META_TILE_TYPE_277, // 0x115 + META_TILE_TYPE_278, // 0x116 + META_TILE_TYPE_279, // 0x117 + META_TILE_TYPE_280, // 0x118 + META_TILE_TYPE_281, // 0x119 + META_TILE_TYPE_282, // 0x11a + META_TILE_TYPE_283, // 0x11b + META_TILE_TYPE_284, // 0x11c + META_TILE_TYPE_285, // 0x11d + META_TILE_TYPE_286, // 0x11e + META_TILE_TYPE_287, // 0x11f + META_TILE_TYPE_288, // 0x120 + META_TILE_TYPE_289, // 0x121 + META_TILE_TYPE_290, // 0x122 + META_TILE_TYPE_291, // 0x123 + META_TILE_TYPE_292, // 0x124 + META_TILE_TYPE_293, // 0x125 + META_TILE_TYPE_294, // 0x126 + META_TILE_TYPE_295, // 0x127 + META_TILE_TYPE_296, // 0x128 + META_TILE_TYPE_297, // 0x129 + META_TILE_TYPE_298, // 0x12a + META_TILE_TYPE_299, // 0x12b + META_TILE_TYPE_300, // 0x12c + META_TILE_TYPE_301, // 0x12d + META_TILE_TYPE_302, // 0x12e + META_TILE_TYPE_303, // 0x12f + META_TILE_TYPE_304, // 0x130 + META_TILE_TYPE_305, // 0x131 + META_TILE_TYPE_306, // 0x132 + META_TILE_TYPE_307, // 0x133 + META_TILE_TYPE_308, // 0x134 + META_TILE_TYPE_309, // 0x135 + META_TILE_TYPE_310, // 0x136 + META_TILE_TYPE_311, // 0x137 + META_TILE_TYPE_312, // 0x138 + META_TILE_TYPE_313, // 0x139 + META_TILE_TYPE_314, // 0x13a + META_TILE_TYPE_315, // 0x13b + META_TILE_TYPE_316, // 0x13c + META_TILE_TYPE_317, // 0x13d + META_TILE_TYPE_318, // 0x13e + META_TILE_TYPE_319, // 0x13f + META_TILE_TYPE_320, // 0x140 + META_TILE_TYPE_321, // 0x141 + META_TILE_TYPE_322, // 0x142 + META_TILE_TYPE_323, // 0x143 + META_TILE_TYPE_324, // 0x144 + META_TILE_TYPE_325, // 0x145 + META_TILE_TYPE_326, // 0x146 + META_TILE_TYPE_327, // 0x147 + META_TILE_TYPE_328, // 0x148 + META_TILE_TYPE_329, // 0x149 + META_TILE_TYPE_330, // 0x14a + META_TILE_TYPE_331, // 0x14b + META_TILE_TYPE_332, // 0x14c + META_TILE_TYPE_333, // 0x14d + META_TILE_TYPE_334, // 0x14e + META_TILE_TYPE_335, // 0x14f + META_TILE_TYPE_336, // 0x150 + META_TILE_TYPE_337, // 0x151 + META_TILE_TYPE_338, // 0x152 + META_TILE_TYPE_339, // 0x153 + META_TILE_TYPE_340, // 0x154 + META_TILE_TYPE_341, // 0x155 + META_TILE_TYPE_342, // 0x156 + META_TILE_TYPE_343, // 0x157 + META_TILE_TYPE_344, // 0x158 + META_TILE_TYPE_345, // 0x159 + META_TILE_TYPE_346, // 0x15a + META_TILE_TYPE_347, // 0x15b + META_TILE_TYPE_348, // 0x15c + META_TILE_TYPE_349, // 0x15d + META_TILE_TYPE_350, // 0x15e + META_TILE_TYPE_351, // 0x15f + META_TILE_TYPE_352, // 0x160 + META_TILE_TYPE_353, // 0x161 + META_TILE_TYPE_354, // 0x162 + META_TILE_TYPE_355, // 0x163 + META_TILE_TYPE_356, // 0x164 + META_TILE_TYPE_357, // 0x165 + META_TILE_TYPE_358, // 0x166 + META_TILE_TYPE_359, // 0x167 + META_TILE_TYPE_360, // 0x168 + META_TILE_TYPE_361, // 0x169 + META_TILE_TYPE_362, // 0x16a + META_TILE_TYPE_363, // 0x16b + META_TILE_TYPE_364, // 0x16c + META_TILE_TYPE_365, // 0x16d + META_TILE_TYPE_366, // 0x16e + META_TILE_TYPE_367, // 0x16f + META_TILE_TYPE_368, // 0x170 + META_TILE_TYPE_369, // 0x171 + META_TILE_TYPE_370, // 0x172 + META_TILE_TYPE_371, // 0x173 + META_TILE_TYPE_372, // 0x174 + META_TILE_TYPE_373, // 0x175 + META_TILE_TYPE_374, // 0x176 + META_TILE_TYPE_375, // 0x177 + META_TILE_TYPE_376, // 0x178 + META_TILE_TYPE_377, // 0x179 + META_TILE_TYPE_378, // 0x17a + META_TILE_TYPE_379, // 0x17b + META_TILE_TYPE_380, // 0x17c + META_TILE_TYPE_381, // 0x17d + META_TILE_TYPE_382, // 0x17e + META_TILE_TYPE_383, // 0x17f + META_TILE_TYPE_384, // 0x180 + META_TILE_TYPE_385, // 0x181 + META_TILE_TYPE_386, // 0x182 + META_TILE_TYPE_387, // 0x183 + META_TILE_TYPE_388, // 0x184 + META_TILE_TYPE_389, // 0x185 + META_TILE_TYPE_390, // 0x186 + META_TILE_TYPE_391, // 0x187 + META_TILE_TYPE_392, // 0x188 + META_TILE_TYPE_393, // 0x189 + META_TILE_TYPE_394, // 0x18a + META_TILE_TYPE_395, // 0x18b + META_TILE_TYPE_396, // 0x18c + META_TILE_TYPE_397, // 0x18d + META_TILE_TYPE_398, // 0x18e + META_TILE_TYPE_399, // 0x18f + META_TILE_TYPE_400, // 0x190 + META_TILE_TYPE_401, // 0x191 + META_TILE_TYPE_402, // 0x192 + META_TILE_TYPE_403, // 0x193 + META_TILE_TYPE_404, // 0x194 + META_TILE_TYPE_405, // 0x195 + META_TILE_TYPE_406, // 0x196 + META_TILE_TYPE_407, // 0x197 + META_TILE_TYPE_408, // 0x198 + META_TILE_TYPE_409, // 0x199 + META_TILE_TYPE_410, // 0x19a + META_TILE_TYPE_411, // 0x19b + META_TILE_TYPE_412, // 0x19c + META_TILE_TYPE_413, // 0x19d + META_TILE_TYPE_414, // 0x19e + META_TILE_TYPE_415, // 0x19f + META_TILE_TYPE_416, // 0x1a0 + META_TILE_TYPE_417, // 0x1a1 + META_TILE_TYPE_418, // 0x1a2 + META_TILE_TYPE_419, // 0x1a3 + META_TILE_TYPE_420, // 0x1a4 + META_TILE_TYPE_421, // 0x1a5 + META_TILE_TYPE_422, // 0x1a6 + META_TILE_TYPE_423, // 0x1a7 + META_TILE_TYPE_424, // 0x1a8 + META_TILE_TYPE_425, // 0x1a9 + META_TILE_TYPE_426, // 0x1aa + META_TILE_TYPE_427, // 0x1ab + META_TILE_TYPE_428, // 0x1ac + META_TILE_TYPE_429, // 0x1ad + META_TILE_TYPE_430, // 0x1ae + META_TILE_TYPE_431, // 0x1af + META_TILE_TYPE_432, // 0x1b0 + META_TILE_TYPE_433, // 0x1b1 + META_TILE_TYPE_434, // 0x1b2 + META_TILE_TYPE_435, // 0x1b3 + META_TILE_TYPE_436, // 0x1b4 + META_TILE_TYPE_437, // 0x1b5 + META_TILE_TYPE_438, // 0x1b6 + META_TILE_TYPE_439, // 0x1b7 + META_TILE_TYPE_440, // 0x1b8 + META_TILE_TYPE_441, // 0x1b9 + META_TILE_TYPE_442, // 0x1ba + META_TILE_TYPE_443, // 0x1bb + META_TILE_TYPE_444, // 0x1bc + META_TILE_TYPE_445, // 0x1bd + META_TILE_TYPE_446, // 0x1be + META_TILE_TYPE_447, // 0x1bf + META_TILE_TYPE_448, // 0x1c0 + META_TILE_TYPE_449, // 0x1c1 + META_TILE_TYPE_450, // 0x1c2 + META_TILE_TYPE_451, // 0x1c3 + META_TILE_TYPE_452, // 0x1c4 + META_TILE_TYPE_453, // 0x1c5 + META_TILE_TYPE_454, // 0x1c6 + META_TILE_TYPE_455, // 0x1c7 + META_TILE_TYPE_456, // 0x1c8 + META_TILE_TYPE_457, // 0x1c9 + META_TILE_TYPE_458, // 0x1ca + META_TILE_TYPE_459, // 0x1cb + META_TILE_TYPE_460, // 0x1cc + META_TILE_TYPE_461, // 0x1cd + META_TILE_TYPE_462, // 0x1ce + META_TILE_TYPE_463, // 0x1cf + META_TILE_TYPE_464, // 0x1d0 + META_TILE_TYPE_465, // 0x1d1 + META_TILE_TYPE_466, // 0x1d2 + META_TILE_TYPE_467, // 0x1d3 + META_TILE_TYPE_468, // 0x1d4 + META_TILE_TYPE_469, // 0x1d5 + META_TILE_TYPE_470, // 0x1d6 + META_TILE_TYPE_471, // 0x1d7 + META_TILE_TYPE_472, // 0x1d8 + META_TILE_TYPE_473, // 0x1d9 + META_TILE_TYPE_474, // 0x1da + META_TILE_TYPE_475, // 0x1db + META_TILE_TYPE_476, // 0x1dc + META_TILE_TYPE_477, // 0x1dd + META_TILE_TYPE_478, // 0x1de + META_TILE_TYPE_479, // 0x1df + META_TILE_TYPE_480, // 0x1e0 + META_TILE_TYPE_481, // 0x1e1 + META_TILE_TYPE_482, // 0x1e2 + META_TILE_TYPE_483, // 0x1e3 + META_TILE_TYPE_484, // 0x1e4 + META_TILE_TYPE_485, // 0x1e5 + META_TILE_TYPE_486, // 0x1e6 + META_TILE_TYPE_487, // 0x1e7 + META_TILE_TYPE_488, // 0x1e8 + META_TILE_TYPE_489, // 0x1e9 + META_TILE_TYPE_490, // 0x1ea + META_TILE_TYPE_491, // 0x1eb + META_TILE_TYPE_492, // 0x1ec + META_TILE_TYPE_493, // 0x1ed + META_TILE_TYPE_494, // 0x1ee + META_TILE_TYPE_495, // 0x1ef + META_TILE_TYPE_496, // 0x1f0 + META_TILE_TYPE_497, // 0x1f1 + META_TILE_TYPE_498, // 0x1f2 + META_TILE_TYPE_499, // 0x1f3 + META_TILE_TYPE_500, // 0x1f4 + META_TILE_TYPE_501, // 0x1f5 + META_TILE_TYPE_502, // 0x1f6 + META_TILE_TYPE_503, // 0x1f7 + META_TILE_TYPE_504, // 0x1f8 + META_TILE_TYPE_505, // 0x1f9 + META_TILE_TYPE_506, // 0x1fa + META_TILE_TYPE_507, // 0x1fb + META_TILE_TYPE_508, // 0x1fc + META_TILE_TYPE_509, // 0x1fd + META_TILE_TYPE_510, // 0x1fe + META_TILE_TYPE_511, // 0x1ff + META_TILE_TYPE_512, // 0x200 + META_TILE_TYPE_513, // 0x201 + META_TILE_TYPE_514, // 0x202 + META_TILE_TYPE_515, // 0x203 + META_TILE_TYPE_516, // 0x204 + META_TILE_TYPE_517, // 0x205 + META_TILE_TYPE_518, // 0x206 + META_TILE_TYPE_519, // 0x207 + META_TILE_TYPE_520, // 0x208 + META_TILE_TYPE_521, // 0x209 + META_TILE_TYPE_522, // 0x20a + META_TILE_TYPE_523, // 0x20b + META_TILE_TYPE_524, // 0x20c + META_TILE_TYPE_525, // 0x20d + META_TILE_TYPE_526, // 0x20e + META_TILE_TYPE_527, // 0x20f + META_TILE_TYPE_528, // 0x210 + META_TILE_TYPE_529, // 0x211 + META_TILE_TYPE_530, // 0x212 + META_TILE_TYPE_531, // 0x213 + META_TILE_TYPE_532, // 0x214 + META_TILE_TYPE_533, // 0x215 + META_TILE_TYPE_534, // 0x216 + META_TILE_TYPE_535, // 0x217 + META_TILE_TYPE_536, // 0x218 + META_TILE_TYPE_537, // 0x219 + META_TILE_TYPE_538, // 0x21a + META_TILE_TYPE_539, // 0x21b + META_TILE_TYPE_540, // 0x21c + META_TILE_TYPE_541, // 0x21d + META_TILE_TYPE_542, // 0x21e + META_TILE_TYPE_543, // 0x21f + META_TILE_TYPE_544, // 0x220 + META_TILE_TYPE_545, // 0x221 + META_TILE_TYPE_546, // 0x222 + META_TILE_TYPE_547, // 0x223 + META_TILE_TYPE_548, // 0x224 + META_TILE_TYPE_549, // 0x225 + META_TILE_TYPE_550, // 0x226 + META_TILE_TYPE_551, // 0x227 + META_TILE_TYPE_552, // 0x228 + META_TILE_TYPE_553, // 0x229 + META_TILE_TYPE_554, // 0x22a + META_TILE_TYPE_555, // 0x22b + META_TILE_TYPE_556, // 0x22c + META_TILE_TYPE_557, // 0x22d + META_TILE_TYPE_558, // 0x22e + META_TILE_TYPE_559, // 0x22f + META_TILE_TYPE_560, // 0x230 + META_TILE_TYPE_561, // 0x231 + META_TILE_TYPE_562, // 0x232 + META_TILE_TYPE_563, // 0x233 + META_TILE_TYPE_564, // 0x234 + META_TILE_TYPE_565, // 0x235 + META_TILE_TYPE_566, // 0x236 + META_TILE_TYPE_567, // 0x237 + META_TILE_TYPE_568, // 0x238 + META_TILE_TYPE_569, // 0x239 + META_TILE_TYPE_570, // 0x23a + META_TILE_TYPE_571, // 0x23b + META_TILE_TYPE_572, // 0x23c + META_TILE_TYPE_573, // 0x23d + META_TILE_TYPE_574, // 0x23e + META_TILE_TYPE_575, // 0x23f + META_TILE_TYPE_576, // 0x240 + META_TILE_TYPE_577, // 0x241 + META_TILE_TYPE_578, // 0x242 + META_TILE_TYPE_579, // 0x243 + META_TILE_TYPE_580, // 0x244 + META_TILE_TYPE_581, // 0x245 + META_TILE_TYPE_582, // 0x246 + META_TILE_TYPE_583, // 0x247 + META_TILE_TYPE_584, // 0x248 + META_TILE_TYPE_585, // 0x249 + META_TILE_TYPE_586, // 0x24a + META_TILE_TYPE_587, // 0x24b + META_TILE_TYPE_588, // 0x24c + META_TILE_TYPE_589, // 0x24d + META_TILE_TYPE_590, // 0x24e + META_TILE_TYPE_591, // 0x24f + META_TILE_TYPE_592, // 0x250 + META_TILE_TYPE_593, // 0x251 + META_TILE_TYPE_594, // 0x252 + META_TILE_TYPE_595, // 0x253 + META_TILE_TYPE_596, // 0x254 + META_TILE_TYPE_597, // 0x255 + META_TILE_TYPE_598, // 0x256 + META_TILE_TYPE_599, // 0x257 + META_TILE_TYPE_600, // 0x258 + META_TILE_TYPE_601, // 0x259 + META_TILE_TYPE_602, // 0x25a + META_TILE_TYPE_603, // 0x25b + META_TILE_TYPE_604, // 0x25c + META_TILE_TYPE_605, // 0x25d + META_TILE_TYPE_606, // 0x25e + META_TILE_TYPE_607, // 0x25f + META_TILE_TYPE_608, // 0x260 + META_TILE_TYPE_609, // 0x261 + META_TILE_TYPE_610, // 0x262 + META_TILE_TYPE_611, // 0x263 + META_TILE_TYPE_612, // 0x264 + META_TILE_TYPE_613, // 0x265 + META_TILE_TYPE_614, // 0x266 + META_TILE_TYPE_615, // 0x267 + META_TILE_TYPE_616, // 0x268 + META_TILE_TYPE_617, // 0x269 + META_TILE_TYPE_618, // 0x26a + META_TILE_TYPE_619, // 0x26b + META_TILE_TYPE_620, // 0x26c + META_TILE_TYPE_621, // 0x26d + META_TILE_TYPE_622, // 0x26e + META_TILE_TYPE_623, // 0x26f + META_TILE_TYPE_624, // 0x270 + META_TILE_TYPE_625, // 0x271 + META_TILE_TYPE_626, // 0x272 + META_TILE_TYPE_627, // 0x273 + META_TILE_TYPE_628, // 0x274 + META_TILE_TYPE_629, // 0x275 + META_TILE_TYPE_630, // 0x276 + META_TILE_TYPE_631, // 0x277 + META_TILE_TYPE_632, // 0x278 + META_TILE_TYPE_633, // 0x279 + META_TILE_TYPE_634, // 0x27a + META_TILE_TYPE_635, // 0x27b + META_TILE_TYPE_636, // 0x27c + META_TILE_TYPE_637, // 0x27d + META_TILE_TYPE_638, // 0x27e + META_TILE_TYPE_639, // 0x27f + META_TILE_TYPE_640, // 0x280 + META_TILE_TYPE_641, // 0x281 + META_TILE_TYPE_642, // 0x282 + META_TILE_TYPE_643, // 0x283 + META_TILE_TYPE_644, // 0x284 + META_TILE_TYPE_645, // 0x285 + META_TILE_TYPE_646, // 0x286 + META_TILE_TYPE_647, // 0x287 + META_TILE_TYPE_648, // 0x288 + META_TILE_TYPE_649, // 0x289 + META_TILE_TYPE_650, // 0x28a + META_TILE_TYPE_651, // 0x28b + META_TILE_TYPE_652, // 0x28c + META_TILE_TYPE_653, // 0x28d + META_TILE_TYPE_654, // 0x28e + META_TILE_TYPE_655, // 0x28f + META_TILE_TYPE_656, // 0x290 + META_TILE_TYPE_657, // 0x291 + META_TILE_TYPE_658, // 0x292 + META_TILE_TYPE_659, // 0x293 + META_TILE_TYPE_660, // 0x294 + META_TILE_TYPE_661, // 0x295 + META_TILE_TYPE_662, // 0x296 + META_TILE_TYPE_663, // 0x297 + META_TILE_TYPE_664, // 0x298 + META_TILE_TYPE_665, // 0x299 + META_TILE_TYPE_666, // 0x29a + META_TILE_TYPE_667, // 0x29b + META_TILE_TYPE_668, // 0x29c + META_TILE_TYPE_669, // 0x29d + META_TILE_TYPE_670, // 0x29e + META_TILE_TYPE_671, // 0x29f + META_TILE_TYPE_672, // 0x2a0 + META_TILE_TYPE_673, // 0x2a1 + META_TILE_TYPE_674, // 0x2a2 + META_TILE_TYPE_675, // 0x2a3 + META_TILE_TYPE_676, // 0x2a4 + META_TILE_TYPE_677, // 0x2a5 + META_TILE_TYPE_678, // 0x2a6 + META_TILE_TYPE_679, // 0x2a7 + META_TILE_TYPE_680, // 0x2a8 + META_TILE_TYPE_681, // 0x2a9 + META_TILE_TYPE_682, // 0x2aa + META_TILE_TYPE_683, // 0x2ab + META_TILE_TYPE_684, // 0x2ac + META_TILE_TYPE_685, // 0x2ad + META_TILE_TYPE_686, // 0x2ae + META_TILE_TYPE_687, // 0x2af + META_TILE_TYPE_688, // 0x2b0 + META_TILE_TYPE_689, // 0x2b1 + META_TILE_TYPE_690, // 0x2b2 + META_TILE_TYPE_691, // 0x2b3 + META_TILE_TYPE_692, // 0x2b4 + META_TILE_TYPE_693, // 0x2b5 + META_TILE_TYPE_694, // 0x2b6 + META_TILE_TYPE_695, // 0x2b7 + META_TILE_TYPE_696, // 0x2b8 + META_TILE_TYPE_697, // 0x2b9 + META_TILE_TYPE_698, // 0x2ba + META_TILE_TYPE_699, // 0x2bb + META_TILE_TYPE_700, // 0x2bc + META_TILE_TYPE_701, // 0x2bd + META_TILE_TYPE_702, // 0x2be + META_TILE_TYPE_703, // 0x2bf + META_TILE_TYPE_704, // 0x2c0 + META_TILE_TYPE_705, // 0x2c1 + META_TILE_TYPE_706, // 0x2c2 + META_TILE_TYPE_707, // 0x2c3 + META_TILE_TYPE_708, // 0x2c4 + META_TILE_TYPE_709, // 0x2c5 + META_TILE_TYPE_710, // 0x2c6 + META_TILE_TYPE_711, // 0x2c7 + META_TILE_TYPE_712, // 0x2c8 + META_TILE_TYPE_713, // 0x2c9 + META_TILE_TYPE_714, // 0x2ca + META_TILE_TYPE_715, // 0x2cb + META_TILE_TYPE_716, // 0x2cc + META_TILE_TYPE_717, // 0x2cd + META_TILE_TYPE_718, // 0x2ce + META_TILE_TYPE_719, // 0x2cf + META_TILE_TYPE_720, // 0x2d0 + META_TILE_TYPE_721, // 0x2d1 + META_TILE_TYPE_722, // 0x2d2 + META_TILE_TYPE_723, // 0x2d3 + META_TILE_TYPE_724, // 0x2d4 + META_TILE_TYPE_725, // 0x2d5 + META_TILE_TYPE_726, // 0x2d6 + META_TILE_TYPE_727, // 0x2d7 + META_TILE_TYPE_728, // 0x2d8 + META_TILE_TYPE_729, // 0x2d9 + META_TILE_TYPE_730, // 0x2da + META_TILE_TYPE_731, // 0x2db + META_TILE_TYPE_732, // 0x2dc + META_TILE_TYPE_733, // 0x2dd + META_TILE_TYPE_734, // 0x2de + META_TILE_TYPE_735, // 0x2df + META_TILE_TYPE_736, // 0x2e0 + META_TILE_TYPE_737, // 0x2e1 + META_TILE_TYPE_738, // 0x2e2 + META_TILE_TYPE_739, // 0x2e3 + META_TILE_TYPE_740, // 0x2e4 + META_TILE_TYPE_741, // 0x2e5 + META_TILE_TYPE_742, // 0x2e6 + META_TILE_TYPE_743, // 0x2e7 + META_TILE_TYPE_744, // 0x2e8 + META_TILE_TYPE_745, // 0x2e9 + META_TILE_TYPE_746, // 0x2ea + META_TILE_TYPE_747, // 0x2eb + META_TILE_TYPE_748, // 0x2ec + META_TILE_TYPE_749, // 0x2ed + META_TILE_TYPE_750, // 0x2ee + META_TILE_TYPE_751, // 0x2ef + META_TILE_TYPE_752, // 0x2f0 + META_TILE_TYPE_753, // 0x2f1 + META_TILE_TYPE_754, // 0x2f2 + META_TILE_TYPE_755, // 0x2f3 + META_TILE_TYPE_756, // 0x2f4 + META_TILE_TYPE_757, // 0x2f5 + META_TILE_TYPE_758, // 0x2f6 + META_TILE_TYPE_759, // 0x2f7 + META_TILE_TYPE_760, // 0x2f8 + META_TILE_TYPE_761, // 0x2f9 + META_TILE_TYPE_762, // 0x2fa + META_TILE_TYPE_763, // 0x2fb + META_TILE_TYPE_764, // 0x2fc + META_TILE_TYPE_765, // 0x2fd + META_TILE_TYPE_766, // 0x2fe + META_TILE_TYPE_767, // 0x2ff + META_TILE_TYPE_768, // 0x300 + META_TILE_TYPE_769, // 0x301 + META_TILE_TYPE_770, // 0x302 + META_TILE_TYPE_771, // 0x303 + META_TILE_TYPE_772, // 0x304 + META_TILE_TYPE_773, // 0x305 + META_TILE_TYPE_774, // 0x306 + META_TILE_TYPE_775, // 0x307 + META_TILE_TYPE_776, // 0x308 + META_TILE_TYPE_777, // 0x309 + META_TILE_TYPE_778, // 0x30a + META_TILE_TYPE_779, // 0x30b + META_TILE_TYPE_780, // 0x30c + META_TILE_TYPE_781, // 0x30d + META_TILE_TYPE_782, // 0x30e + META_TILE_TYPE_783, // 0x30f + META_TILE_TYPE_784, // 0x310 + META_TILE_TYPE_785, // 0x311 + META_TILE_TYPE_786, // 0x312 + META_TILE_TYPE_787, // 0x313 + META_TILE_TYPE_788, // 0x314 + META_TILE_TYPE_789, // 0x315 + META_TILE_TYPE_790, // 0x316 + META_TILE_TYPE_791, // 0x317 + META_TILE_TYPE_792, // 0x318 + META_TILE_TYPE_793, // 0x319 + META_TILE_TYPE_794, // 0x31a + META_TILE_TYPE_795, // 0x31b + META_TILE_TYPE_796, // 0x31c + META_TILE_TYPE_797, // 0x31d + META_TILE_TYPE_798, // 0x31e + META_TILE_TYPE_799, // 0x31f + META_TILE_TYPE_800, // 0x320 + META_TILE_TYPE_801, // 0x321 + META_TILE_TYPE_802, // 0x322 + META_TILE_TYPE_803, // 0x323 + META_TILE_TYPE_804, // 0x324 + META_TILE_TYPE_805, // 0x325 + META_TILE_TYPE_806, // 0x326 + META_TILE_TYPE_807, // 0x327 + META_TILE_TYPE_808, // 0x328 + META_TILE_TYPE_809, // 0x329 + META_TILE_TYPE_810, // 0x32a + META_TILE_TYPE_811, // 0x32b + META_TILE_TYPE_812, // 0x32c + META_TILE_TYPE_813, // 0x32d + META_TILE_TYPE_814, // 0x32e + META_TILE_TYPE_815, // 0x32f + META_TILE_TYPE_816, // 0x330 + META_TILE_TYPE_817, // 0x331 + META_TILE_TYPE_818, // 0x332 + META_TILE_TYPE_819, // 0x333 + META_TILE_TYPE_820, // 0x334 + META_TILE_TYPE_821, // 0x335 + META_TILE_TYPE_822, // 0x336 + META_TILE_TYPE_823, // 0x337 + META_TILE_TYPE_824, // 0x338 + META_TILE_TYPE_825, // 0x339 + META_TILE_TYPE_826, // 0x33a + META_TILE_TYPE_827, // 0x33b + META_TILE_TYPE_828, // 0x33c + META_TILE_TYPE_829, // 0x33d + META_TILE_TYPE_830, // 0x33e + META_TILE_TYPE_831, // 0x33f + META_TILE_TYPE_832, // 0x340 + META_TILE_TYPE_833, // 0x341 + META_TILE_TYPE_834, // 0x342 + META_TILE_TYPE_835, // 0x343 + META_TILE_TYPE_836, // 0x344 + META_TILE_TYPE_837, // 0x345 + META_TILE_TYPE_838, // 0x346 + META_TILE_TYPE_839, // 0x347 + META_TILE_TYPE_840, // 0x348 + META_TILE_TYPE_841, // 0x349 + META_TILE_TYPE_842, // 0x34a + META_TILE_TYPE_843, // 0x34b + META_TILE_TYPE_844, // 0x34c + META_TILE_TYPE_845, // 0x34d + META_TILE_TYPE_846, // 0x34e + META_TILE_TYPE_847, // 0x34f + META_TILE_TYPE_848, // 0x350 + META_TILE_TYPE_849, // 0x351 + META_TILE_TYPE_850, // 0x352 + META_TILE_TYPE_851, // 0x353 + META_TILE_TYPE_852, // 0x354 + META_TILE_TYPE_853, // 0x355 + META_TILE_TYPE_854, // 0x356 + META_TILE_TYPE_855, // 0x357 + META_TILE_TYPE_856, // 0x358 + META_TILE_TYPE_857, // 0x359 + META_TILE_TYPE_858, // 0x35a + META_TILE_TYPE_859, // 0x35b + META_TILE_TYPE_860, // 0x35c + META_TILE_TYPE_861, // 0x35d + META_TILE_TYPE_862, // 0x35e + META_TILE_TYPE_863, // 0x35f + META_TILE_TYPE_864, // 0x360 + META_TILE_TYPE_865, // 0x361 + META_TILE_TYPE_866, // 0x362 + META_TILE_TYPE_867, // 0x363 + META_TILE_TYPE_868, // 0x364 + META_TILE_TYPE_869, // 0x365 + META_TILE_TYPE_870, // 0x366 + META_TILE_TYPE_871, // 0x367 + META_TILE_TYPE_872, // 0x368 + META_TILE_TYPE_873, // 0x369 + META_TILE_TYPE_874, // 0x36a + META_TILE_TYPE_875, // 0x36b + META_TILE_TYPE_876, // 0x36c + META_TILE_TYPE_877, // 0x36d + META_TILE_TYPE_878, // 0x36e + META_TILE_TYPE_879, // 0x36f + META_TILE_TYPE_880, // 0x370 + META_TILE_TYPE_881, // 0x371 + META_TILE_TYPE_882, // 0x372 + META_TILE_TYPE_883, // 0x373 + META_TILE_TYPE_884, // 0x374 + META_TILE_TYPE_885, // 0x375 + META_TILE_TYPE_886, // 0x376 + META_TILE_TYPE_887, // 0x377 + META_TILE_TYPE_888, // 0x378 + META_TILE_TYPE_889, // 0x379 + META_TILE_TYPE_890, // 0x37a + META_TILE_TYPE_891, // 0x37b + META_TILE_TYPE_892, // 0x37c + META_TILE_TYPE_893, // 0x37d + META_TILE_TYPE_894, // 0x37e + META_TILE_TYPE_895, // 0x37f + META_TILE_TYPE_896, // 0x380 + META_TILE_TYPE_897, // 0x381 + META_TILE_TYPE_898, // 0x382 + META_TILE_TYPE_899, // 0x383 + META_TILE_TYPE_900, // 0x384 + META_TILE_TYPE_901, // 0x385 + META_TILE_TYPE_902, // 0x386 + META_TILE_TYPE_903, // 0x387 + META_TILE_TYPE_904, // 0x388 + META_TILE_TYPE_905, // 0x389 + META_TILE_TYPE_906, // 0x38a + META_TILE_TYPE_907, // 0x38b + META_TILE_TYPE_908, // 0x38c + META_TILE_TYPE_909, // 0x38d + META_TILE_TYPE_910, // 0x38e + META_TILE_TYPE_911, // 0x38f + META_TILE_TYPE_912, // 0x390 + META_TILE_TYPE_913, // 0x391 + META_TILE_TYPE_914, // 0x392 + META_TILE_TYPE_915, // 0x393 + META_TILE_TYPE_916, // 0x394 + META_TILE_TYPE_917, // 0x395 + META_TILE_TYPE_918, // 0x396 + META_TILE_TYPE_919, // 0x397 + META_TILE_TYPE_920, // 0x398 + META_TILE_TYPE_921, // 0x399 + META_TILE_TYPE_922, // 0x39a + META_TILE_TYPE_923, // 0x39b + META_TILE_TYPE_924, // 0x39c + META_TILE_TYPE_925, // 0x39d + META_TILE_TYPE_926, // 0x39e + META_TILE_TYPE_927, // 0x39f + META_TILE_TYPE_928, // 0x3a0 + META_TILE_TYPE_929, // 0x3a1 + META_TILE_TYPE_930, // 0x3a2 + META_TILE_TYPE_931, // 0x3a3 + META_TILE_TYPE_932, // 0x3a4 + META_TILE_TYPE_933, // 0x3a5 + META_TILE_TYPE_934, // 0x3a6 + META_TILE_TYPE_935, // 0x3a7 + META_TILE_TYPE_936, // 0x3a8 + META_TILE_TYPE_937, // 0x3a9 + META_TILE_TYPE_938, // 0x3aa + META_TILE_TYPE_939, // 0x3ab + META_TILE_TYPE_940, // 0x3ac + META_TILE_TYPE_941, // 0x3ad + META_TILE_TYPE_942, // 0x3ae + META_TILE_TYPE_943, // 0x3af + META_TILE_TYPE_944, // 0x3b0 + META_TILE_TYPE_945, // 0x3b1 + META_TILE_TYPE_946, // 0x3b2 + META_TILE_TYPE_947, // 0x3b3 + META_TILE_TYPE_948, // 0x3b4 + META_TILE_TYPE_949, // 0x3b5 + META_TILE_TYPE_950, // 0x3b6 + META_TILE_TYPE_951, // 0x3b7 + META_TILE_TYPE_952, // 0x3b8 + META_TILE_TYPE_953, // 0x3b9 + META_TILE_TYPE_954, // 0x3ba + META_TILE_TYPE_955, // 0x3bb + META_TILE_TYPE_956, // 0x3bc + META_TILE_TYPE_957, // 0x3bd + META_TILE_TYPE_958, // 0x3be + META_TILE_TYPE_959, // 0x3bf + META_TILE_TYPE_960, // 0x3c0 + META_TILE_TYPE_961, // 0x3c1 + META_TILE_TYPE_962, // 0x3c2 + META_TILE_TYPE_963, // 0x3c3 + META_TILE_TYPE_964, // 0x3c4 + META_TILE_TYPE_965, // 0x3c5 + META_TILE_TYPE_966, // 0x3c6 + META_TILE_TYPE_967, // 0x3c7 + META_TILE_TYPE_968, // 0x3c8 + META_TILE_TYPE_969, // 0x3c9 + META_TILE_TYPE_970, // 0x3ca + META_TILE_TYPE_971, // 0x3cb + META_TILE_TYPE_972, // 0x3cc + META_TILE_TYPE_973, // 0x3cd + META_TILE_TYPE_974, // 0x3ce + META_TILE_TYPE_975, // 0x3cf + META_TILE_TYPE_976, // 0x3d0 + META_TILE_TYPE_977, // 0x3d1 + META_TILE_TYPE_978, // 0x3d2 + META_TILE_TYPE_979, // 0x3d3 + META_TILE_TYPE_980, // 0x3d4 + META_TILE_TYPE_981, // 0x3d5 + META_TILE_TYPE_982, // 0x3d6 + META_TILE_TYPE_983, // 0x3d7 + META_TILE_TYPE_984, // 0x3d8 + META_TILE_TYPE_985, // 0x3d9 + META_TILE_TYPE_986, // 0x3da + META_TILE_TYPE_987, // 0x3db + META_TILE_TYPE_988, // 0x3dc + META_TILE_TYPE_989, // 0x3dd + META_TILE_TYPE_990, // 0x3de + META_TILE_TYPE_991, // 0x3df + META_TILE_TYPE_992, // 0x3e0 + META_TILE_TYPE_993, // 0x3e1 + META_TILE_TYPE_994, // 0x3e2 + META_TILE_TYPE_995, // 0x3e3 + META_TILE_TYPE_996, // 0x3e4 + META_TILE_TYPE_997, // 0x3e5 + META_TILE_TYPE_998, // 0x3e6 + META_TILE_TYPE_999, // 0x3e7 + META_TILE_TYPE_1000, // 0x3e8 + META_TILE_TYPE_1001, // 0x3e9 + META_TILE_TYPE_1002, // 0x3ea + META_TILE_TYPE_1003, // 0x3eb + META_TILE_TYPE_1004, // 0x3ec + META_TILE_TYPE_1005, // 0x3ed + META_TILE_TYPE_1006, // 0x3ee + META_TILE_TYPE_1007, // 0x3ef + META_TILE_TYPE_1008, // 0x3f0 + META_TILE_TYPE_1009, // 0x3f1 + META_TILE_TYPE_1010, // 0x3f2 + META_TILE_TYPE_1011, // 0x3f3 + META_TILE_TYPE_1012, // 0x3f4 + META_TILE_TYPE_1013, // 0x3f5 + META_TILE_TYPE_1014, // 0x3f6 + META_TILE_TYPE_1015, // 0x3f7 + META_TILE_TYPE_1016, // 0x3f8 + META_TILE_TYPE_1017, // 0x3f9 + META_TILE_TYPE_1018, // 0x3fa + META_TILE_TYPE_1019, // 0x3fb + META_TILE_TYPE_1020, // 0x3fc + META_TILE_TYPE_1021, // 0x3fd + META_TILE_TYPE_1022, // 0x3fe + META_TILE_TYPE_1023, // 0x3ff + META_TILE_TYPE_1024, // 0x400 + META_TILE_TYPE_1025, // 0x401 + META_TILE_TYPE_1026, // 0x402 + META_TILE_TYPE_1027, // 0x403 + META_TILE_TYPE_1028, // 0x404 + META_TILE_TYPE_1029, // 0x405 + META_TILE_TYPE_1030, // 0x406 + META_TILE_TYPE_1031, // 0x407 + META_TILE_TYPE_1032, // 0x408 + META_TILE_TYPE_1033, // 0x409 + META_TILE_TYPE_1034, // 0x40a + META_TILE_TYPE_1035, // 0x40b + META_TILE_TYPE_1036, // 0x40c + META_TILE_TYPE_1037, // 0x40d + META_TILE_TYPE_1038, // 0x40e + META_TILE_TYPE_1039, // 0x40f + META_TILE_TYPE_1040, // 0x410 + META_TILE_TYPE_1041, // 0x411 + META_TILE_TYPE_1042, // 0x412 + META_TILE_TYPE_1043, // 0x413 + META_TILE_TYPE_1044, // 0x414 + META_TILE_TYPE_1045, // 0x415 + META_TILE_TYPE_1046, // 0x416 + META_TILE_TYPE_1047, // 0x417 + META_TILE_TYPE_1048, // 0x418 + META_TILE_TYPE_1049, // 0x419 + META_TILE_TYPE_1050, // 0x41a + META_TILE_TYPE_1051, // 0x41b + META_TILE_TYPE_1052, // 0x41c + META_TILE_TYPE_1053, // 0x41d + META_TILE_TYPE_1054, // 0x41e + META_TILE_TYPE_1055, // 0x41f + META_TILE_TYPE_1056, // 0x420 + META_TILE_TYPE_1057, // 0x421 + META_TILE_TYPE_1058, // 0x422 + META_TILE_TYPE_1059, // 0x423 + META_TILE_TYPE_1060, // 0x424 + META_TILE_TYPE_1061, // 0x425 + META_TILE_TYPE_1062, // 0x426 + META_TILE_TYPE_1063, // 0x427 + META_TILE_TYPE_1064, // 0x428 + META_TILE_TYPE_1065, // 0x429 + META_TILE_TYPE_1066, // 0x42a + META_TILE_TYPE_1067, // 0x42b + META_TILE_TYPE_1068, // 0x42c + META_TILE_TYPE_1069, // 0x42d + META_TILE_TYPE_1070, // 0x42e + META_TILE_TYPE_1071, // 0x42f + META_TILE_TYPE_1072, // 0x430 + META_TILE_TYPE_1073, // 0x431 + META_TILE_TYPE_1074, // 0x432 + META_TILE_TYPE_1075, // 0x433 + META_TILE_TYPE_1076, // 0x434 + META_TILE_TYPE_1077, // 0x435 + META_TILE_TYPE_1078, // 0x436 + META_TILE_TYPE_1079, // 0x437 + META_TILE_TYPE_1080, // 0x438 + META_TILE_TYPE_1081, // 0x439 + META_TILE_TYPE_1082, // 0x43a + META_TILE_TYPE_1083, // 0x43b + META_TILE_TYPE_1084, // 0x43c + META_TILE_TYPE_1085, // 0x43d + META_TILE_TYPE_1086, // 0x43e + META_TILE_TYPE_1087, // 0x43f + META_TILE_TYPE_1088, // 0x440 + META_TILE_TYPE_1089, // 0x441 + META_TILE_TYPE_1090, // 0x442 + META_TILE_TYPE_1091, // 0x443 + META_TILE_TYPE_1092, // 0x444 + META_TILE_TYPE_1093, // 0x445 + META_TILE_TYPE_1094, // 0x446 + META_TILE_TYPE_1095, // 0x447 + META_TILE_TYPE_1096, // 0x448 + META_TILE_TYPE_1097, // 0x449 + META_TILE_TYPE_1098, // 0x44a + META_TILE_TYPE_1099, // 0x44b + META_TILE_TYPE_1100, // 0x44c + META_TILE_TYPE_1101, // 0x44d + META_TILE_TYPE_1102, // 0x44e + META_TILE_TYPE_1103, // 0x44f + META_TILE_TYPE_1104, // 0x450 + META_TILE_TYPE_1105, // 0x451 + META_TILE_TYPE_1106, // 0x452 + META_TILE_TYPE_1107, // 0x453 + META_TILE_TYPE_1108, // 0x454 + META_TILE_TYPE_1109, // 0x455 + META_TILE_TYPE_1110, // 0x456 + META_TILE_TYPE_1111, // 0x457 + META_TILE_TYPE_1112, // 0x458 + META_TILE_TYPE_1113, // 0x459 + META_TILE_TYPE_1114, // 0x45a + META_TILE_TYPE_1115, // 0x45b + META_TILE_TYPE_1116, // 0x45c + META_TILE_TYPE_1117, // 0x45d + META_TILE_TYPE_1118, // 0x45e + META_TILE_TYPE_1119, // 0x45f + META_TILE_TYPE_1120, // 0x460 + META_TILE_TYPE_1121, // 0x461 + META_TILE_TYPE_1122, // 0x462 + META_TILE_TYPE_1123, // 0x463 + META_TILE_TYPE_1124, // 0x464 + META_TILE_TYPE_1125, // 0x465 + META_TILE_TYPE_1126, // 0x466 + META_TILE_TYPE_1127, // 0x467 + META_TILE_TYPE_1128, // 0x468 + META_TILE_TYPE_1129, // 0x469 + META_TILE_TYPE_1130, // 0x46a + META_TILE_TYPE_1131, // 0x46b + META_TILE_TYPE_1132, // 0x46c + META_TILE_TYPE_1133, // 0x46d + META_TILE_TYPE_1134, // 0x46e + META_TILE_TYPE_1135, // 0x46f + META_TILE_TYPE_1136, // 0x470 + META_TILE_TYPE_1137, // 0x471 + META_TILE_TYPE_1138, // 0x472 + META_TILE_TYPE_1139, // 0x473 + META_TILE_TYPE_1140, // 0x474 + META_TILE_TYPE_1141, // 0x475 + META_TILE_TYPE_1142, // 0x476 + META_TILE_TYPE_1143, // 0x477 + META_TILE_TYPE_1144, // 0x478 + META_TILE_TYPE_1145, // 0x479 + META_TILE_TYPE_1146, // 0x47a + META_TILE_TYPE_1147, // 0x47b + META_TILE_TYPE_1148, // 0x47c + META_TILE_TYPE_1149, // 0x47d + META_TILE_TYPE_1150, // 0x47e + META_TILE_TYPE_1151, // 0x47f + META_TILE_TYPE_1152, // 0x480 + META_TILE_TYPE_1153, // 0x481 + META_TILE_TYPE_1154, // 0x482 + META_TILE_TYPE_1155, // 0x483 + META_TILE_TYPE_1156, // 0x484 + META_TILE_TYPE_1157, // 0x485 + META_TILE_TYPE_1158, // 0x486 + META_TILE_TYPE_1159, // 0x487 + META_TILE_TYPE_1160, // 0x488 + META_TILE_TYPE_1161, // 0x489 + META_TILE_TYPE_1162, // 0x48a + META_TILE_TYPE_1163, // 0x48b + META_TILE_TYPE_1164, // 0x48c + META_TILE_TYPE_1165, // 0x48d + META_TILE_TYPE_1166, // 0x48e + META_TILE_TYPE_1167, // 0x48f + META_TILE_TYPE_1168, // 0x490 + META_TILE_TYPE_1169, // 0x491 + META_TILE_TYPE_1170, // 0x492 + META_TILE_TYPE_1171, // 0x493 + META_TILE_TYPE_1172, // 0x494 + META_TILE_TYPE_1173, // 0x495 + META_TILE_TYPE_1174, // 0x496 + META_TILE_TYPE_1175, // 0x497 + META_TILE_TYPE_1176, // 0x498 + META_TILE_TYPE_1177, // 0x499 + META_TILE_TYPE_1178, // 0x49a + META_TILE_TYPE_1179, // 0x49b + META_TILE_TYPE_1180, // 0x49c + META_TILE_TYPE_1181, // 0x49d + META_TILE_TYPE_1182, // 0x49e + META_TILE_TYPE_1183, // 0x49f + META_TILE_TYPE_1184, // 0x4a0 + META_TILE_TYPE_1185, // 0x4a1 + META_TILE_TYPE_1186, // 0x4a2 + META_TILE_TYPE_1187, // 0x4a3 + META_TILE_TYPE_1188, // 0x4a4 + META_TILE_TYPE_1189, // 0x4a5 + META_TILE_TYPE_1190, // 0x4a6 + META_TILE_TYPE_1191, // 0x4a7 + META_TILE_TYPE_1192, // 0x4a8 + META_TILE_TYPE_1193, // 0x4a9 + META_TILE_TYPE_1194, // 0x4aa + META_TILE_TYPE_1195, // 0x4ab + META_TILE_TYPE_1196, // 0x4ac + META_TILE_TYPE_1197, // 0x4ad + META_TILE_TYPE_1198, // 0x4ae + META_TILE_TYPE_1199, // 0x4af + META_TILE_TYPE_1200, // 0x4b0 + META_TILE_TYPE_1201, // 0x4b1 + META_TILE_TYPE_1202, // 0x4b2 + META_TILE_TYPE_1203, // 0x4b3 + META_TILE_TYPE_1204, // 0x4b4 + META_TILE_TYPE_1205, // 0x4b5 + META_TILE_TYPE_1206, // 0x4b6 + META_TILE_TYPE_1207, // 0x4b7 + META_TILE_TYPE_1208, // 0x4b8 + META_TILE_TYPE_1209, // 0x4b9 + META_TILE_TYPE_1210, // 0x4ba + META_TILE_TYPE_1211, // 0x4bb + META_TILE_TYPE_1212, // 0x4bc + META_TILE_TYPE_1213, // 0x4bd + META_TILE_TYPE_1214, // 0x4be + META_TILE_TYPE_1215, // 0x4bf + META_TILE_TYPE_1216, // 0x4c0 + META_TILE_TYPE_1217, // 0x4c1 + META_TILE_TYPE_1218, // 0x4c2 + META_TILE_TYPE_1219, // 0x4c3 + META_TILE_TYPE_1220, // 0x4c4 + META_TILE_TYPE_1221, // 0x4c5 + META_TILE_TYPE_1222, // 0x4c6 + META_TILE_TYPE_1223, // 0x4c7 + META_TILE_TYPE_1224, // 0x4c8 + META_TILE_TYPE_1225, // 0x4c9 + META_TILE_TYPE_1226, // 0x4ca + META_TILE_TYPE_1227, // 0x4cb + META_TILE_TYPE_1228, // 0x4cc + META_TILE_TYPE_1229, // 0x4cd + META_TILE_TYPE_1230, // 0x4ce + META_TILE_TYPE_1231, // 0x4cf + META_TILE_TYPE_1232, // 0x4d0 + META_TILE_TYPE_1233, // 0x4d1 + META_TILE_TYPE_1234, // 0x4d2 + META_TILE_TYPE_1235, // 0x4d3 + META_TILE_TYPE_1236, // 0x4d4 + META_TILE_TYPE_1237, // 0x4d5 + META_TILE_TYPE_1238, // 0x4d6 + META_TILE_TYPE_1239, // 0x4d7 + META_TILE_TYPE_1240, // 0x4d8 + META_TILE_TYPE_1241, // 0x4d9 + META_TILE_TYPE_1242, // 0x4da + META_TILE_TYPE_1243, // 0x4db + META_TILE_TYPE_1244, // 0x4dc + META_TILE_TYPE_1245, // 0x4dd + META_TILE_TYPE_1246, // 0x4de + META_TILE_TYPE_1247, // 0x4df + META_TILE_TYPE_1248, // 0x4e0 + META_TILE_TYPE_1249, // 0x4e1 + META_TILE_TYPE_1250, // 0x4e2 + META_TILE_TYPE_1251, // 0x4e3 + META_TILE_TYPE_1252, // 0x4e4 + META_TILE_TYPE_1253, // 0x4e5 + META_TILE_TYPE_1254, // 0x4e6 + META_TILE_TYPE_1255, // 0x4e7 + META_TILE_TYPE_1256, // 0x4e8 + META_TILE_TYPE_1257, // 0x4e9 + META_TILE_TYPE_1258, // 0x4ea + META_TILE_TYPE_1259, // 0x4eb + META_TILE_TYPE_1260, // 0x4ec + META_TILE_TYPE_1261, // 0x4ed + META_TILE_TYPE_1262, // 0x4ee + META_TILE_TYPE_1263, // 0x4ef + META_TILE_TYPE_1264, // 0x4f0 + META_TILE_TYPE_1265, // 0x4f1 + META_TILE_TYPE_1266, // 0x4f2 + META_TILE_TYPE_1267, // 0x4f3 + META_TILE_TYPE_1268, // 0x4f4 + META_TILE_TYPE_1269, // 0x4f5 + META_TILE_TYPE_1270, // 0x4f6 + META_TILE_TYPE_1271, // 0x4f7 + META_TILE_TYPE_1272, // 0x4f8 + META_TILE_TYPE_1273, // 0x4f9 + META_TILE_TYPE_1274, // 0x4fa + META_TILE_TYPE_1275, // 0x4fb + META_TILE_TYPE_1276, // 0x4fc + META_TILE_TYPE_1277, // 0x4fd + META_TILE_TYPE_1278, // 0x4fe + META_TILE_TYPE_1279, // 0x4ff + META_TILE_TYPE_1280, // 0x500 + META_TILE_TYPE_1281, // 0x501 + META_TILE_TYPE_1282, // 0x502 + META_TILE_TYPE_1283, // 0x503 + META_TILE_TYPE_1284, // 0x504 + META_TILE_TYPE_1285, // 0x505 + META_TILE_TYPE_1286, // 0x506 + META_TILE_TYPE_1287, // 0x507 + META_TILE_TYPE_1288, // 0x508 + META_TILE_TYPE_1289, // 0x509 + META_TILE_TYPE_1290, // 0x50a + META_TILE_TYPE_1291, // 0x50b + META_TILE_TYPE_1292, // 0x50c + META_TILE_TYPE_1293, // 0x50d + META_TILE_TYPE_1294, // 0x50e + META_TILE_TYPE_1295, // 0x50f + META_TILE_TYPE_1296, // 0x510 + META_TILE_TYPE_1297, // 0x511 + META_TILE_TYPE_1298, // 0x512 + META_TILE_TYPE_1299, // 0x513 + META_TILE_TYPE_1300, // 0x514 + META_TILE_TYPE_1301, // 0x515 + META_TILE_TYPE_1302, // 0x516 + META_TILE_TYPE_1303, // 0x517 + META_TILE_TYPE_1304, // 0x518 + META_TILE_TYPE_1305, // 0x519 + META_TILE_TYPE_1306, // 0x51a + META_TILE_TYPE_1307, // 0x51b + META_TILE_TYPE_1308, // 0x51c + META_TILE_TYPE_1309, // 0x51d + META_TILE_TYPE_1310, // 0x51e + META_TILE_TYPE_1311, // 0x51f + META_TILE_TYPE_1312, // 0x520 + META_TILE_TYPE_1313, // 0x521 + META_TILE_TYPE_1314, // 0x522 + META_TILE_TYPE_1315, // 0x523 + META_TILE_TYPE_1316, // 0x524 + META_TILE_TYPE_1317, // 0x525 + META_TILE_TYPE_1318, // 0x526 + META_TILE_TYPE_1319, // 0x527 + META_TILE_TYPE_1320, // 0x528 + META_TILE_TYPE_1321, // 0x529 + META_TILE_TYPE_1322, // 0x52a + META_TILE_TYPE_1323, // 0x52b + META_TILE_TYPE_1324, // 0x52c + META_TILE_TYPE_1325, // 0x52d + META_TILE_TYPE_1326, // 0x52e + META_TILE_TYPE_1327, // 0x52f + META_TILE_TYPE_1328, // 0x530 + META_TILE_TYPE_1329, // 0x531 + META_TILE_TYPE_1330, // 0x532 + META_TILE_TYPE_1331, // 0x533 + META_TILE_TYPE_1332, // 0x534 + META_TILE_TYPE_1333, // 0x535 + META_TILE_TYPE_1334, // 0x536 + META_TILE_TYPE_1335, // 0x537 + META_TILE_TYPE_1336, // 0x538 + META_TILE_TYPE_1337, // 0x539 + META_TILE_TYPE_1338, // 0x53a + META_TILE_TYPE_1339, // 0x53b + META_TILE_TYPE_1340, // 0x53c + META_TILE_TYPE_1341, // 0x53d + META_TILE_TYPE_1342, // 0x53e + META_TILE_TYPE_1343, // 0x53f + META_TILE_TYPE_1344, // 0x540 + META_TILE_TYPE_1345, // 0x541 + META_TILE_TYPE_1346, // 0x542 + META_TILE_TYPE_1347, // 0x543 + META_TILE_TYPE_1348, // 0x544 + META_TILE_TYPE_1349, // 0x545 + META_TILE_TYPE_1350, // 0x546 + META_TILE_TYPE_1351, // 0x547 + META_TILE_TYPE_1352, // 0x548 + META_TILE_TYPE_1353, // 0x549 + META_TILE_TYPE_1354, // 0x54a + META_TILE_TYPE_1355, // 0x54b + META_TILE_TYPE_1356, // 0x54c + META_TILE_TYPE_1357, // 0x54d + META_TILE_TYPE_1358, // 0x54e + META_TILE_TYPE_1359, // 0x54f + META_TILE_TYPE_1360, // 0x550 + META_TILE_TYPE_1361, // 0x551 + META_TILE_TYPE_1362, // 0x552 + META_TILE_TYPE_1363, // 0x553 + META_TILE_TYPE_1364, // 0x554 + META_TILE_TYPE_1365, // 0x555 + META_TILE_TYPE_1366, // 0x556 + META_TILE_TYPE_1367, // 0x557 + META_TILE_TYPE_1368, // 0x558 + META_TILE_TYPE_1369, // 0x559 + META_TILE_TYPE_1370, // 0x55a + META_TILE_TYPE_1371, // 0x55b + META_TILE_TYPE_1372, // 0x55c + META_TILE_TYPE_1373, // 0x55d + META_TILE_TYPE_1374, // 0x55e + META_TILE_TYPE_1375, // 0x55f + META_TILE_TYPE_1376, // 0x560 + META_TILE_TYPE_1377, // 0x561 + META_TILE_TYPE_1378, // 0x562 + META_TILE_TYPE_1379, // 0x563 + META_TILE_TYPE_1380, // 0x564 + META_TILE_TYPE_1381, // 0x565 + META_TILE_TYPE_1382, // 0x566 + META_TILE_TYPE_1383, // 0x567 + META_TILE_TYPE_1384, // 0x568 + META_TILE_TYPE_1385, // 0x569 + META_TILE_TYPE_1386, // 0x56a + META_TILE_TYPE_1387, // 0x56b + META_TILE_TYPE_1388, // 0x56c + META_TILE_TYPE_1389, // 0x56d + META_TILE_TYPE_1390, // 0x56e + META_TILE_TYPE_1391, // 0x56f + META_TILE_TYPE_1392, // 0x570 + META_TILE_TYPE_1393, // 0x571 + META_TILE_TYPE_1394, // 0x572 + META_TILE_TYPE_1395, // 0x573 +} MetaTile; + +typedef enum { + SPECIAL_META_TILE_0 = 0x4000, + SPECIAL_META_TILE_1, // 0x4001 + SPECIAL_META_TILE_2, // 0x4002 + SPECIAL_META_TILE_3, // 0x4003 + SPECIAL_META_TILE_4, // 0x4004 + SPECIAL_META_TILE_5, // 0x4005 + SPECIAL_META_TILE_6, // 0x4006 + SPECIAL_META_TILE_7, // 0x4007 + SPECIAL_META_TILE_8, // 0x4008 + SPECIAL_META_TILE_9, // 0x4009 + SPECIAL_META_TILE_10, // 0x400a + SPECIAL_META_TILE_11, // 0x400b + SPECIAL_META_TILE_12, // 0x400c + SPECIAL_META_TILE_13, // 0x400d + SPECIAL_META_TILE_14, // 0x400e + SPECIAL_META_TILE_15, // 0x400f + SPECIAL_META_TILE_16, // 0x4010 + SPECIAL_META_TILE_17, // 0x4011 + SPECIAL_META_TILE_18, // 0x4012 + SPECIAL_META_TILE_19, // 0x4013 + SPECIAL_META_TILE_20, // 0x4014 + SPECIAL_META_TILE_21, // 0x4015 + SPECIAL_META_TILE_22, // 0x4016 + SPECIAL_META_TILE_23, // 0x4017 + SPECIAL_META_TILE_24, // 0x4018 + SPECIAL_META_TILE_25, // 0x4019 + SPECIAL_META_TILE_26, // 0x401a + SPECIAL_META_TILE_27, // 0x401b + SPECIAL_META_TILE_28, // 0x401c + SPECIAL_META_TILE_29, // 0x401d + SPECIAL_META_TILE_30, // 0x401e + SPECIAL_META_TILE_31, // 0x401f + SPECIAL_META_TILE_32, // 0x4020 + SPECIAL_META_TILE_33, // 0x4021 + SPECIAL_META_TILE_34, // 0x4022 + SPECIAL_META_TILE_35, // 0x4023 + SPECIAL_META_TILE_36, // 0x4024 + SPECIAL_META_TILE_37, // 0x4025 + SPECIAL_META_TILE_38, // 0x4026 + SPECIAL_META_TILE_39, // 0x4027 + SPECIAL_META_TILE_40, // 0x4028 + SPECIAL_META_TILE_41, // 0x4029 + SPECIAL_META_TILE_42, // 0x402a + SPECIAL_META_TILE_43, // 0x402b + SPECIAL_META_TILE_44, // 0x402c + SPECIAL_META_TILE_45, // 0x402d + SPECIAL_META_TILE_46, // 0x402e + SPECIAL_META_TILE_47, // 0x402f + SPECIAL_META_TILE_48, // 0x4030 + SPECIAL_META_TILE_49, // 0x4031 + SPECIAL_META_TILE_50, // 0x4032 + SPECIAL_META_TILE_51, // 0x4033 + SPECIAL_META_TILE_52, // 0x4034 + SPECIAL_META_TILE_53, // 0x4035 + SPECIAL_META_TILE_54, // 0x4036 + SPECIAL_META_TILE_55, // 0x4037 + SPECIAL_META_TILE_56, // 0x4038 + SPECIAL_META_TILE_57, // 0x4039 + SPECIAL_META_TILE_58, // 0x403a + SPECIAL_META_TILE_59, // 0x403b + SPECIAL_META_TILE_60, // 0x403c + SPECIAL_META_TILE_61, // 0x403d + SPECIAL_META_TILE_62, // 0x403e + SPECIAL_META_TILE_63, // 0x403f + SPECIAL_META_TILE_64, // 0x4040 + SPECIAL_META_TILE_65, // 0x4041 + SPECIAL_META_TILE_66, // 0x4042 + SPECIAL_META_TILE_67, // 0x4043 + SPECIAL_META_TILE_68, // 0x4044 + SPECIAL_META_TILE_69, // 0x4045 + SPECIAL_META_TILE_70, // 0x4046 + SPECIAL_META_TILE_71, // 0x4047 + SPECIAL_META_TILE_72, // 0x4048 + SPECIAL_META_TILE_73, // 0x4049 + SPECIAL_META_TILE_74, // 0x404a + SPECIAL_META_TILE_75, // 0x404b + SPECIAL_META_TILE_76, // 0x404c + SPECIAL_META_TILE_77, // 0x404d + SPECIAL_META_TILE_78, // 0x404e + SPECIAL_META_TILE_79, // 0x404f + SPECIAL_META_TILE_80, // 0x4050 + SPECIAL_META_TILE_81, // 0x4051 + SPECIAL_META_TILE_82, // 0x4052 + SPECIAL_META_TILE_83, // 0x4053 + SPECIAL_META_TILE_84, // 0x4054 + SPECIAL_META_TILE_85, // 0x4055 + SPECIAL_META_TILE_86, // 0x4056 + SPECIAL_META_TILE_87, // 0x4057 + SPECIAL_META_TILE_88, // 0x4058 + SPECIAL_META_TILE_89, // 0x4059 + SPECIAL_META_TILE_90, // 0x405a + SPECIAL_META_TILE_91, // 0x405b + SPECIAL_META_TILE_92, // 0x405c + SPECIAL_META_TILE_93, // 0x405d + SPECIAL_META_TILE_94, // 0x405e + SPECIAL_META_TILE_95, // 0x405f + SPECIAL_META_TILE_96, // 0x4060 + SPECIAL_META_TILE_97, // 0x4061 + SPECIAL_META_TILE_98, // 0x4062 + SPECIAL_META_TILE_99, // 0x4063 + SPECIAL_META_TILE_100, // 0x4064 + SPECIAL_META_TILE_101, // 0x4065 + SPECIAL_META_TILE_102, // 0x4066 + SPECIAL_META_TILE_103, // 0x4067 + SPECIAL_META_TILE_104, // 0x4068 + SPECIAL_META_TILE_105, // 0x4069 + SPECIAL_META_TILE_106, // 0x406a + SPECIAL_META_TILE_107, // 0x406b + SPECIAL_META_TILE_108, // 0x406c + SPECIAL_META_TILE_109, // 0x406d + SPECIAL_META_TILE_110, // 0x406e + SPECIAL_META_TILE_111, // 0x406f + SPECIAL_META_TILE_112, // 0x4070 + SPECIAL_META_TILE_113, // 0x4071 + SPECIAL_META_TILE_114, // 0x4072 + SPECIAL_META_TILE_115, // 0x4073 + SPECIAL_META_TILE_116, // 0x4074 + SPECIAL_META_TILE_117, // 0x4075 + SPECIAL_META_TILE_118, // 0x4076 + SPECIAL_META_TILE_119, // 0x4077 + SPECIAL_META_TILE_120, // 0x4078 + SPECIAL_META_TILE_121, // 0x4079 + SPECIAL_META_TILE_122, // 0x407a + SPECIAL_META_TILE_123, // 0x407b + SPECIAL_META_TILE_124, // 0x407c + SPECIAL_META_TILE_125, // 0x407d + SPECIAL_META_TILE_126, // 0x407e + SPECIAL_META_TILE_127, // 0x407f + SPECIAL_META_TILE_128, // 0x4080 + SPECIAL_META_TILE_129, // 0x4081 + SPECIAL_META_TILE_130, // 0x4082 + SPECIAL_META_TILE_131, // 0x4083 + SPECIAL_META_TILE_132, // 0x4084 + SPECIAL_META_TILE_133, // 0x4085 + SPECIAL_META_TILE_134, // 0x4086 + SPECIAL_META_TILE_135, // 0x4087 + SPECIAL_META_TILE_136, // 0x4088 + SPECIAL_META_TILE_137, // 0x4089 + SPECIAL_META_TILE_138, // 0x408a + SPECIAL_META_TILE_139, // 0x408b + SPECIAL_META_TILE_140, // 0x408c + SPECIAL_META_TILE_141, // 0x408d + SPECIAL_META_TILE_142, // 0x408e + SPECIAL_META_TILE_143, // 0x408f + SPECIAL_META_TILE_144, // 0x4090 + SPECIAL_META_TILE_145, // 0x4091 + SPECIAL_META_TILE_146, // 0x4092 + SPECIAL_META_TILE_147, // 0x4093 + SPECIAL_META_TILE_148, // 0x4094 + SPECIAL_META_TILE_149, // 0x4095 + SPECIAL_META_TILE_150, // 0x4096 +} SpecialMetaTile; + + +typedef enum { + VVV_0 = 0, + VVV_1 = 1, + VVV_2 = 2, + VVV_3 = 3, + VVV_4 = 4, + VVV_5 = 5, + VVV_6 = 6, + VVV_7 = 7, + VVV_8 = 8, // -> SURFACE_7 + VVV_9 = 9, // sub_0801FDE4(leever) + VVV_10 = 10, // sub_0801FDE4(leever), sub_08025AB8(puffstool) + VVV_11 = 11, // sub_0801FDE4(leever) + VVV_12 = 12, // sub_0801FDE4(leever) + VVV_13 = 13, // -> SURFACE_PIT, sub_08094E30(cutsceneMiscObject), sub_08085B40(lilypadLarge), Pot_Action1, + // sub_080AD040(playerItemHeldObject), UpdatePlayerCollision, sub_0807B434(playerUtils) + VVV_14 = 14, // -> SURFACE_SLOPE_GNDWATER + VVV_15 = 15, // -> SURFACE_SHALLOW_WATER, SPECIAL_META_TILE_145 + VVV_16 = 16, // -> SURFACE_WATER, sub_0801FBD0(chuchu), PlayerItemBottle_UseEmptyBottle, SPECIAL_META_TILE_137 - + // 140, sub_080AD040(playerItemHeldObject) + VVV_17 = 17, // -> SURFACE_14, sub_08085A44(lilypadLarge), sub_080AD040(playerItemHeldObject) + VVV_18 = 18, // -> SURFACE_ICE, SPECIAL_META_TILE_117 - 124 + VVV_19 = 19, // -> SURFACE_SWAMP, sub_0803163C(rope), sub_080AD040(playerItemHeldObject) + VVV_20 = 20, + VVV_21 = 21, + VVV_22 = 22, // -> SURFACE_DUST + VVV_23 = 23, // -> SURFACE_2D + VVV_24 = 24, // -> SURFACE_16 + VVV_25 = 25, // -> SURFACE_HOLE, CrenelBeanSprout_Action1, sub_08097144(objectOnPillar), sub_0808A644(pushableRock), + // sub_080701F8(playerItemPacciCaneProjectile) + VVV_26 = 26, + VVV_27 = 27, // -> SURFACE_BUTTON + VVV_28 = 28, + VVV_29 = 29, // -> SURFACE_BUTTON + VVV_30 = 30, + VVV_31 = 31, // -> SURFACE_MINISH_DOOR_FRONT + VVV_32 = 32, // -> SURFACE_MINISH_DOOR_BACK + VVV_33 = 33, // -> SURFACE_A + VVV_34 = 34, // -> SURFACE_B + VVV_35 = 35, // SPECIAL_META_TILE_130 + VVV_36 = 36, + VVV_37 = 37, + VVV_38 = 38, // -> SURFACE_SLOPE_GNDGND_V + VVV_39 = 39, // -> SURFACE_SLOPE_GNDGND_H + VVV_40 = 40, // -> SURFACE_DOOR_13, SPECIAL_META_TILE_105, sub_080732D0(player), UpdateDoorTransition + VVV_41 = 41, // -> SURFACE_DOOR, sub_08076DF4(itemGustJar), Minecart_Action3, sub_080896B0(pushableStatue), + // SPECIAL_META_TILE_128, SPECIAL_META_TILE_131 - 136, SPECIAL_META_TILE_141, sub_080724DC(player), UpdateDoorTransition + VVV_42 = 42, // -> SURFACE_E, sub_080611D4(npc5) + VVV_43 = 43, // -> SURFACE_D, sub_080611D4(npc5) + VVV_44 = 44, // -> SURFACE_10, sub_080611D4(npc5) + VVV_45 = 45, // -> SURFACE_F, sub_080611D4(npc5) + VVV_46 = 46, // BombableWallManager_Action1, sub_080878CC(smokeParticle), sub_080A7A84(playerItemSword) + VVV_47 = 47, + VVV_48 = 48, // -> SURFACE_22 + VVV_49 = 49, // -> SURFACE_22 + VVV_50 = 50, // -> SURFACE_22 + VVV_51 = 51, // -> SURFACE_22 + VVV_52 = 52, // -> SURFACE_LIGHT_GRADE + VVV_53 = 53, // -> SURFACE_29 + VVV_54 = 54, + VVV_55 = 55, + VVV_56 = 56, + VVV_57 = 57, + VVV_58 = 58, // SPECIAL_META_TILE_81 + VVV_59 = 59, + VVV_60 = 60, + VVV_61 = 61, // MinishPortalManager_Main, SPECIAL_META_TILE_64 - 72 + VVV_62 = 62, // sub_080AA544(removableDust) + VVV_63 = 63, // -> SURFACE_AUTO_LADDER, FurnitureInit(for STAIRCASE), UpdateDoorTransition + VVV_64 = 64, // -> SURFACE_E + VVV_65 = 65, // -> SURFACE_D + VVV_66 = 66, // -> SURFACE_10 + VVV_67 = 67, // -> SURFACE_F + VVV_68 = 68, // -> SURFACE_D + VVV_69 = 69, // -> SURFACE_E + VVV_70 = 70, // -> SURFACE_D + VVV_71 = 71, // -> SURFACE_E + VVV_72 = 72, // -> SURFACE_10 + VVV_73 = 73, // -> SURFACE_D + VVV_74 = 74, // -> SURFACE_E + VVV_75 = 75, // -> SURFACE_D + VVV_76 = 76, + VVV_77 = 77, + VVV_78 = 78, + VVV_79 = 79, + VVV_80 = 80, // -> SURFACE_CLIMB_WALL, SPECIAL_META_TILE_142 + VVV_81 = 81, // -> SURFACE_2C, SPECIAL_META_TILE_143 + VVV_82 = 82, // -> SURFACE_26 + VVV_83 = 83, // -> SURFACE_LADDER, SPECIAL_META_TILE_23 + VVV_84 = 84, // TreeHidingPortal_Action1 + VVV_85 = 85, + VVV_86 = 86, // sub_080774A0(itemMoleMitts), sub_0807B464(playerUtils) + VVV_87 = 87, // -> SURFACE_CLONE_TILE, sub_0806B0E0(townMinish) + VVV_88 = 88, + VVV_89 = 89, + VVV_90 = 90, // -> SURFACE_1C, sub_080AD040(playerItemHeldObject) + VVV_91 = 91, + VVV_92 = 92, + VVV_93 = 93, + VVV_94 = 94, + VVV_95 = 95, + VVV_96 = 96, + VVV_97 = 97, // -> SURFACE_1B + VVV_98 = 98, // -> SURFACE_21 + VVV_99 = 99, // -> SURFACE_24 + VVV_100 = 100, // Minecart_Action3 + VVV_101 = 101, // -> SURFACE_6, Minecart_Action3 + VVV_102 = 102, // -> SURFACE_6, Minecart_Action3 + VVV_103 = 103, // -> SURFACE_6, Minecart_Action3 + VVV_104 = 104, // -> SURFACE_6, Minecart_Action3 + VVV_105 = 105, // -> SURFACE_6, Minecart_Action3 + VVV_106 = 106, // -> SURFACE_6, Minecart_Action3 + VVV_107 = 107, // -> SURFACE_6 + VVV_108 = 108, // -> SURFACE_6, Minecart_Action3 + VVV_109 = 109, // -> SURFACE_6, Minecart_Action3 + VVV_110 = 110, // -> SURFACE_6, Minecart_Action3 + VVV_111 = 111, // -> SURFACE_6, Minecart_Action3 + VVV_112 = 112, + VVV_113 = 113, + VVV_114 = 114, + VVV_115 = 115, + VVV_116 = 116, // -> SURFACE_EDGE, SPECIAL_META_TILE_126, SPECIAL_META_TILE_127, sub_08018E68(playerItemGustBig), + // sub_080AD040(playerItemHeldObject) + VVV_117 = 117, + VVV_240 = 240, // -> SURFACE_HOLE, sub_0802F300(tektite), sub_0808A644(pushableRock), SPECIAL_META_TILE_32 + VVV_241 = 241, // -> SURFACE_LADDER, sub_0802F300(tektite), SPECIAL_META_TILE_20, UpdateDoorTransition + VVV_242 = 242, // sub_0802F300(tektite), Minecart_Action3, SPECIAL_META_TILE_24 + VVV_243 = 243, // sub_0802F300(tektite), Minecart_Action3, SPECIAL_META_TILE_25 + // up to VVV_255 -> sub_0802F300(tektite) +} Vvv; + + +typedef enum { + COLLISION_TYPE_0, + + +} CollisionType; #endif // TILES_H diff --git a/linker.ld b/linker.ld index 5228c36b..6f86a56e 100644 --- a/linker.ld +++ b/linker.ld @@ -33,7 +33,7 @@ SECTIONS { . = 0x00006F00; gUnk_02006F00 = .; . = 0x0000AF00; gHUD = .; . = 0x0000AF34; gUnk_0200AF34 = .; - . = 0x0000B240; gUnk_0200B240 = .; + . = 0x0000B240; gMetaTilesForSpecialTiles = .; . = 0x0000B640; gUnk_0200B640 = .; . = 0x0000B644; gUsedPalettes = .; . = 0x0000B650; gMapTop = .; @@ -160,11 +160,11 @@ SECTIONS { . = 0x00005770; ram_sub_080B19FC = .; . = 0x00005778; ram_sub_080B1A04 = .; . = 0x00005780; ram_sub_080B1A0C = .; - . = 0x0000579C; ram_GetTileTypeByEntity = .; - . = 0x000057A8; ram_GetTileTypeByPos = .; + . = 0x0000579C; ram_GetMetaTileTypeByEntity = .; + . = 0x000057A8; ram_GetMetaTileTypeByPos = .; . = 0x000057BC; ram_sub_080B1A48 = .; . = 0x000057CC; ram_sub_080B1A58 = .; - . = 0x000057D4; ram_GetTileType = .; + . = 0x000057D4; ram_GetMetaTileType = .; . = 0x00005800; ram_GetVvvRelativeToEntity = .; . = 0x0000581C; ram_GetVvvAtEntity = .; . = 0x00005828; ram_GetVvvAtWorldCoords = .; diff --git a/src/backgroundAnimations.c b/src/backgroundAnimations.c index 81da6078..c944b205 100644 --- a/src/backgroundAnimations.c +++ b/src/backgroundAnimations.c @@ -8,7 +8,6 @@ #include "asm.h" #include "assets/gfx_offsets.h" #include "common.h" -#include "fileselect.h" #include "functions.h" void LoadBgAnimationGfx(const BgAnimationGfx*); diff --git a/src/beanstalkSubtask.c b/src/beanstalkSubtask.c index f95786e1..4dba66e2 100644 --- a/src/beanstalkSubtask.c +++ b/src/beanstalkSubtask.c @@ -15,6 +15,7 @@ #include "screen.h" #include "scroll.h" #include "structures.h" +#include "tiles.h" extern void sub_0807C898(void); extern void sub_0805BB74(s32); @@ -53,9 +54,9 @@ extern const Data gUnk_080B44C2[]; void sub_0801AD6C(const Data*, u32); bool32 sub_0801A4F8(void); bool32 sub_0801AA58(Entity*, u32, u32); -void RenderTilemapToScreenblock(u16*, LayerStruct*); +void RenderMapLayerToTileMap(u16* tileMap, MapLayer* mapLayer); -u32 sub_0801AC68(u32 position, u32 data); +u32 GetMetaTileSetIndexForSpecialTile(u32 position, u32 data); extern u32 sub_0807BDB8(Entity* this, u32 param_2); extern void sub_0804B388(u32 a1, u32 a2); @@ -68,11 +69,11 @@ extern const s16 gUnk_080B4490[]; extern const s16 gUnk_080B4468[]; extern const s16 gUnk_080B4478[]; -bool32 sub_0801A2B0(LayerStruct* layer, u32 position, u32 collisionType); +bool32 sub_0801A2B0(MapLayer* mapLayer, u32 position, u32 collisionType); bool32 sub_0801A9F0(u32 param_1, u32 param_2, u32 param_3); u32 sub_0801A570(Entity*, u32); -bool32 sub_0801A458(LayerStruct* layer, u32 position, u32 collisionType); -bool32 sub_0801A370(LayerStruct* layer, u32 position); +bool32 sub_0801A458(MapLayer* mapLayer, u32 position, u32 collisionType); +bool32 sub_0801A370(MapLayer* mapLayer, u32 position); u32 sub_0801A8D0(Entity* this, u32 param_2); void sub_0801967C(void) { @@ -161,7 +162,7 @@ void LoadMapData(MapDataDefinition* dataDefinition) { u32 UpdatePlayerCollision(void) { u32 direction; u32 tileType; - LayerStruct* layer; + MapLayer* mapLayer; Transition* transition; Entity* pushedBlock; Entity* player; @@ -216,10 +217,10 @@ u32 UpdatePlayerCollision(void) { } } } - layer = GetLayerByIndex(gPlayerEntity.collisionLayer); + mapLayer = GetLayerByIndex(gPlayerEntity.collisionLayer); ptr1 = &gUnk_080B4468[gPlayerEntity.animationState & 6]; position = COORD_TO_TILE_OFFSET(&gPlayerEntity, -ptr1[0], -ptr1[1]); - tileType = GetTileType(position, gPlayerEntity.collisionLayer); + tileType = GetMetaTileType(position, gPlayerEntity.collisionLayer); if (tileType < 0x4000) { direction = sub_080B1B54(tileType); } else { @@ -230,10 +231,10 @@ u32 UpdatePlayerCollision(void) { switch (direction) { case 0x4000: - if (sub_0801A458(layer, position, 2) == 0) { + if (sub_0801A458(mapLayer, position, 2) == 0) { return 0; } - layer->mapData[position] = 0x4001 + (gPlayerEntity.animationState >> 1); + mapLayer->mapData[position] = 0x4001 + (gPlayerEntity.animationState >> 1); if ((gPlayerState.flags & PL_MINISH) != 0) { gPlayerState.pushedObject = 0xc0; } else { @@ -280,10 +281,10 @@ u32 UpdatePlayerCollision(void) { sub_08078AC0(4, 0, 1); return 0; case 0x401b: - if (sub_0801A2B0(layer, position, 0xb) == 0) { + if (sub_0801A2B0(mapLayer, position, 0xb) == 0) { return 0; } - layer->mapData[position] = 0x401c + (gPlayerEntity.animationState >> 1); + mapLayer->mapData[position] = 0x401c + (gPlayerEntity.animationState >> 1); gPlayerState.pushedObject = 0xa0; gPlayerState.queued_action = PLAYER_PUSH; gPlayerState.flags |= PL_BUSY; @@ -371,13 +372,13 @@ u32 UpdatePlayerCollision(void) { COLLISION_OFF(&gPlayerEntity); return 1; case 0x400b: - if (sub_0801A2B0(layer, position, 8) == 0) { + if (sub_0801A2B0(mapLayer, position, 8) == 0) { return 0; } if ((gPlayerEntity.collisionLayer == 3) && (gMapTop.mapData[position] == 0x400b)) { gMapTop.mapData[position] = 0x400c + (gPlayerEntity.animationState >> 1); } else { - layer->mapData[position] = 0x400c + (gPlayerEntity.animationState >> 1); + mapLayer->mapData[position] = 0x400c + (gPlayerEntity.animationState >> 1); } gPlayerState.pushedObject = 0xa0; gPlayerState.queued_action = PLAYER_PUSH; @@ -387,10 +388,10 @@ u32 UpdatePlayerCollision(void) { gPlayerEntity.direction = Direction8FromAnimationState(gPlayerEntity.animationState); return 1; case 0x405a: - if (sub_0801A2B0(layer, position, 2) == 0) { + if (sub_0801A2B0(mapLayer, position, 2) == 0) { return 0; } - layer->mapData[position] = 0x405b + (gPlayerEntity.animationState >> 1); + mapLayer->mapData[position] = 0x405b + (gPlayerEntity.animationState >> 1); gPlayerState.pushedObject = 0x98; gPlayerState.queued_action = PLAYER_PUSH; gPlayerState.flags |= PL_BUSY; @@ -399,10 +400,10 @@ u32 UpdatePlayerCollision(void) { gPlayerEntity.direction = Direction8FromAnimationState(gPlayerEntity.animationState); return 1; case 0x4036: - if (sub_0801A2B0(layer, position, 0xb) == 0) { + if (sub_0801A2B0(mapLayer, position, 0xb) == 0) { return 0; } - layer->mapData[position] = 0x4037 + (gPlayerEntity.animationState >> 1); + mapLayer->mapData[position] = 0x4037 + (gPlayerEntity.animationState >> 1); gPlayerState.pushedObject = 0xa0; gPlayerState.queued_action = PLAYER_PUSH; gPlayerState.flags |= PL_BUSY; @@ -420,7 +421,7 @@ u32 UpdatePlayerCollision(void) { if ((gPlayerEntity.frame & 2) == 0) { return 0; } - layer->mapData[position] = 0x403f; + mapLayer->mapData[position] = 0x403f; gPlayerState.pushedObject = 0x82; gPlayerState.queued_action = PLAYER_PUSH; gPlayerState.flags |= PL_BUSY; @@ -470,8 +471,8 @@ u32 UpdatePlayerCollision(void) { gPlayerEntity.direction = pushedBlock->direction; return 1; case 0x402b ... 0x402d: - if (sub_0801A370(layer, position) != 0) { - layer->mapData[position] = 0x4030 + ((gPlayerEntity.animationState & 4) >> 2); + if (sub_0801A370(mapLayer, position) != 0) { + mapLayer->mapData[position] = 0x4030 + ((gPlayerEntity.animationState & 4) >> 2); if ((gPlayerState.flags & PL_MINISH) != 0) { gPlayerState.pushedObject = 0xa0; } else { @@ -487,10 +488,10 @@ u32 UpdatePlayerCollision(void) { return 0; } case 0x404a: - if (sub_0801A458(layer, position, 8) == 0) { + if (sub_0801A458(mapLayer, position, 8) == 0) { return 0; } - layer->mapData[position] = 0x404b + (gPlayerEntity.animationState >> 1); + mapLayer->mapData[position] = 0x404b + (gPlayerEntity.animationState >> 1); if ((gPlayerState.flags & PL_MINISH) != 0) { gPlayerState.pushedObject = 0xc0; } else { @@ -506,13 +507,13 @@ u32 UpdatePlayerCollision(void) { if (gPlayerState.field_0x35 != 0) { return 0; } - SetTile(0x4054, position, gPlayerEntity.collisionLayer); + SetMetaTile(0x4054, position, gPlayerEntity.collisionLayer); return 4; case 0x4053: if (gPlayerState.field_0x35 != 6) { return 0; } - SetTile(0x4054, position, gPlayerEntity.collisionLayer); + SetMetaTile(0x4054, position, gPlayerEntity.collisionLayer); return 4; case 0x4055: position--; @@ -526,7 +527,7 @@ u32 UpdatePlayerCollision(void) { } for (index = 0; index < 3; index++) { if (sub_0801A8D0(gPlayerClones[index], 0) == position) { - SetTile(0x4059, position, gPlayerEntity.collisionLayer); + SetMetaTile(0x4059, position, gPlayerEntity.collisionLayer); return 4; } } @@ -543,7 +544,7 @@ u32 UpdatePlayerCollision(void) { } for (index = 0; index < 3; index++) { if (sub_0801A8D0(gPlayerClones[index], 6) == position) { - SetTile(0x4059, position, gPlayerEntity.collisionLayer); + SetMetaTile(0x4059, position, gPlayerEntity.collisionLayer); return 4; } } @@ -560,7 +561,7 @@ u32 UpdatePlayerCollision(void) { if ((gPlayerEntity.frame & 1) == 0) { return 0; } - SetTile(0x4074, position, gPlayerEntity.collisionLayer); + SetMetaTile(0x4074, position, gPlayerEntity.collisionLayer); gPlayerState.pushedObject = 0xa0; gPlayerState.queued_action = PLAYER_PUSH; gPlayerState.flags |= PL_BUSY; @@ -579,15 +580,15 @@ u32 UpdatePlayerCollision(void) { if ((gPlayerEntity.frame & 1) == 0) { return 0; } - SetTile(0x4074, position, gPlayerEntity.collisionLayer); - SetVvvAtMetaTilePos(0xd, position, gPlayerEntity.collisionLayer); + SetMetaTile(0x4074, position, gPlayerEntity.collisionLayer); + SetVvvAtMetaTilePos(VVV_13, position, gPlayerEntity.collisionLayer); return 1; default: return 0; } } -bool32 sub_0801A2B0(LayerStruct* layer, u32 position, u32 collisionType) { +bool32 sub_0801A2B0(MapLayer* mapLayer, u32 position, u32 collisionType) { u16 uVar1; s16 x; s16 y; @@ -596,7 +597,7 @@ bool32 sub_0801A2B0(LayerStruct* layer, u32 position, u32 collisionType) { uVar1 = gUnk_080B4488[gPlayerEntity.animationState >> 1]; if ((((gPlayerState.field_0x35 | gPlayerState.direction) & 0x80) == 0) && ((gPlayerEntity.frame & 1) != 0)) { position = (u16)(position - (-uVar1)); // necessary for match - temp4 = sub_080B1B54(GetTileType(position, gPlayerEntity.collisionLayer)); + temp4 = sub_080B1B54(GetMetaTileType(position, gPlayerEntity.collisionLayer)); switch (temp4) { case 0x52: break; @@ -608,10 +609,10 @@ bool32 sub_0801A2B0(LayerStruct* layer, u32 position, u32 collisionType) { case 0x74: return FALSE; default: - if ((layer->collisionData[(position)] != 0x28)) { + if ((mapLayer->collisionData[(position)] != 0x28)) { x = (((position & 0x3f) * 0x10 + (u32)gRoomControls.origin_x)); y = (((position >> 6) * 0x10 + (u32)gRoomControls.origin_y)); - if ((!IsTileCollision(layer->collisionData, x, y, collisionType))) { + if ((!IsTileCollision(mapLayer->collisionData, x, y, collisionType))) { return TRUE; } } @@ -621,8 +622,8 @@ bool32 sub_0801A2B0(LayerStruct* layer, u32 position, u32 collisionType) { return FALSE; } -bool32 sub_0801A370(LayerStruct* layer, u32 position) { - LayerStruct* topLayer; +bool32 sub_0801A370(MapLayer* mapLayer, u32 position) { + MapLayer* topLayer; u32 tileType; u32 pos; s32 offset; @@ -637,7 +638,7 @@ bool32 sub_0801A370(LayerStruct* layer, u32 position) { topLayer = GetLayerByIndex(2); offset = gUnk_080B4488[gPlayerEntity.animationState >> 1]; pos = position + offset; - tileType = GetTileType(pos, gPlayerEntity.collisionLayer); + tileType = GetMetaTileType(pos, gPlayerEntity.collisionLayer); switch (tileType) { case 0x402b: pos += offset; @@ -648,7 +649,7 @@ bool32 sub_0801A370(LayerStruct* layer, u32 position) { if (topLayer->collisionData[pos - 0x80] == 0x46) { return FALSE; } - switch ((u16)sub_080B1B54(GetTileType(pos, gPlayerEntity.collisionLayer))) { + switch ((u16)sub_080B1B54(GetMetaTileType(pos, gPlayerEntity.collisionLayer))) { case 0x52: return FALSE; case 0x26: @@ -659,7 +660,7 @@ bool32 sub_0801A370(LayerStruct* layer, u32 position) { case 0x74: return FALSE; } - switch (temp = layer->collisionData[pos]) { + switch (temp = mapLayer->collisionData[pos]) { case 0: return TRUE; case 5: @@ -678,13 +679,13 @@ bool32 sub_0801A370(LayerStruct* layer, u32 position) { return FALSE; } -bool32 sub_0801A458(LayerStruct* layer, u32 position, u32 collisionType) { +bool32 sub_0801A458(MapLayer* mapLayer, u32 position, u32 collisionType) { u32 tileType; u32 pos; s32 offset = gUnk_080B4488[gPlayerEntity.animationState >> 1]; if (sub_0801A4F8()) { pos = position + offset; - tileType = GetTileType(pos, gPlayerEntity.collisionLayer); + tileType = GetMetaTileType(pos, gPlayerEntity.collisionLayer); switch (sub_080B1B54(tileType)) { case 0x52: case 0x26: @@ -693,10 +694,10 @@ bool32 sub_0801A458(LayerStruct* layer, u32 position, u32 collisionType) { case 0x74: return FALSE; default: - if (((layer->collisionData[pos] != 0x28) && - (!IsTileCollision(layer->collisionData, (pos & 0x3f) * 0x10 + gRoomControls.origin_x, + if (((mapLayer->collisionData[pos] != 0x28) && + (!IsTileCollision(mapLayer->collisionData, (pos & 0x3f) * 0x10 + gRoomControls.origin_x, (pos >> 6) * 0x10 + gRoomControls.origin_y, collisionType))) && - (0xe < (u32)layer->collisionData[pos] - 1)) { + (0xe < (u32)mapLayer->collisionData[pos] - 1)) { return TRUE; } break; @@ -770,7 +771,7 @@ bool32 sub_0801A980(void) { const s16* ptr; GetLayerByIndex(gPlayerEntity.collisionLayer); ptr = &gUnk_080B44A8[gPlayerEntity.animationState & 6]; - tileType = GetTileType(COORD_TO_TILE_OFFSET(&gPlayerEntity, -ptr[0], -ptr[1]), gPlayerEntity.collisionLayer); + tileType = GetMetaTileType(COORD_TO_TILE_OFFSET(&gPlayerEntity, -ptr[0], -ptr[1]), gPlayerEntity.collisionLayer); if (tileType < 0x4000) { sub_080B1B54(tileType); } @@ -815,13 +816,13 @@ bool32 sub_0801A9F0(u32 param_1, u32 param_2, u32 param_3) { } bool32 sub_0801AA58(Entity* this, u32 param_2, u32 param_3) { - LayerStruct* layer; + MapLayer* mapLayer; Entity* object; u32 temp; - layer = GetLayerByIndex(this->collisionLayer); - if (((layer->collisionData[param_2 + gUnk_080B4488[param_3 >> 3]] == 0) || - ((u8)(layer->collisionData[param_2 + gUnk_080B4488[param_3 >> 3]] - 0x20) < 0x20))) { + mapLayer = GetLayerByIndex(this->collisionLayer); + if (((mapLayer->collisionData[param_2 + gUnk_080B4488[param_3 >> 3]] == 0) || + ((u8)(mapLayer->collisionData[param_2 + gUnk_080B4488[param_3 >> 3]] - 0x20) < 0x20))) { object = CreateObject(PUSHED_BLOCK, 0, 0); if (object != NULL) { @@ -841,93 +842,99 @@ bool32 sub_0801AA58(Entity* this, u32 param_2, u32 param_3) { return FALSE; } -void RenderTilemapToScreenblock(u16* specialData, LayerStruct* layer) { - u16* metatiles; +void RenderMapLayerToTileMap(u16* tileMap, MapLayer* mapLayer) { + u16* tiles; u16* mapData; u16* mapDataClone; - u16 index; - u16 innerIndex; - u32 tmp2; - u32 tmp3; - u32 tmp1; + u16 metaTileY; + u16 metaTileX; + u32 metaTilePositionAndLayer; + u32 layerIndex; + // Index into the metatileset at MapLayer.metatiles + u32 metaTileSetIndex; - if (layer == &gMapBottom) { - tmp3 = 1; + if (mapLayer == &gMapBottom) { + layerIndex = 1; } else { - tmp3 = 2; + layerIndex = 2; } - tmp2 = tmp3 << 0xc; - mapDataClone = layer->mapDataClone; - mapData = layer->mapData; + metaTilePositionAndLayer = layerIndex << 0xc; + mapDataClone = mapLayer->mapDataClone; + mapData = mapLayer->mapData; + + for (metaTileY = 0; metaTileY < 0x40; metaTileY++) { + for (metaTileX = 0; metaTileX < 0x10; metaTileX++) { + // inner loop seems to be unrolled four times for some reason? - for (index = 0; index < 0x40; index++) { - for (innerIndex = 0; innerIndex < 0x10; innerIndex++) { if (mapData[0] < 0x4000) { - tmp1 = mapData[0] << 2; + metaTileSetIndex = mapData[0] * 4; } else { - tmp1 = sub_0801AC68(tmp2, mapDataClone[0]); + metaTileSetIndex = GetMetaTileSetIndexForSpecialTile(metaTilePositionAndLayer, mapDataClone[0]); } - metatiles = layer->metatiles + tmp1; - specialData[0] = metatiles[0]; - specialData[1] = metatiles[1]; - specialData[0x80 + 0] = metatiles[2]; - specialData[0x80 + 1] = metatiles[3]; - specialData += 2; + tiles = mapLayer->metatiles + metaTileSetIndex; + tileMap[0] = tiles[0]; + tileMap[1] = tiles[1]; + tileMap[0x80 + 0] = tiles[2]; + tileMap[0x80 + 1] = tiles[3]; + tileMap += 2; + if (mapData[1] < 0x4000) { - tmp1 = mapData[1] << 2; + metaTileSetIndex = mapData[1] * 4; } else { - tmp1 = sub_0801AC68(tmp2 + 1, mapDataClone[1]); + metaTileSetIndex = GetMetaTileSetIndexForSpecialTile(metaTilePositionAndLayer + 1, mapDataClone[1]); } - metatiles = layer->metatiles + tmp1; - specialData[0] = metatiles[0]; - specialData[1] = metatiles[1]; - specialData[0x80 + 0] = metatiles[2]; - specialData[0x80 + 1] = metatiles[3]; - specialData += 2; + tiles = mapLayer->metatiles + metaTileSetIndex; + tileMap[0] = tiles[0]; + tileMap[1] = tiles[1]; + tileMap[0x80 + 0] = tiles[2]; + tileMap[0x80 + 1] = tiles[3]; + tileMap += 2; + if (mapData[2] < 0x4000) { - tmp1 = mapData[2] << 2; + metaTileSetIndex = mapData[2] * 4; } else { - tmp1 = sub_0801AC68(tmp2 + 2, mapDataClone[2]); + metaTileSetIndex = GetMetaTileSetIndexForSpecialTile(metaTilePositionAndLayer + 2, mapDataClone[2]); } - metatiles = layer->metatiles + tmp1; - specialData[0] = metatiles[0]; - specialData[1] = metatiles[1]; - specialData[0x80 + 0] = metatiles[2]; - specialData[0x80 + 1] = metatiles[3]; - specialData += 2; + tiles = mapLayer->metatiles + metaTileSetIndex; + tileMap[0] = tiles[0]; + tileMap[1] = tiles[1]; + tileMap[0x80 + 0] = tiles[2]; + tileMap[0x80 + 1] = tiles[3]; + tileMap += 2; + if (mapData[3] < 0x4000) { - tmp1 = mapData[3] << 2; + metaTileSetIndex = mapData[3] * 4; } else { - tmp1 = sub_0801AC68(tmp2 + 3, mapDataClone[3]); + metaTileSetIndex = GetMetaTileSetIndexForSpecialTile(metaTilePositionAndLayer + 3, mapDataClone[3]); } - metatiles = layer->metatiles + tmp1; - specialData[0] = metatiles[0]; - specialData[1] = metatiles[1]; - specialData[0x80 + 0] = metatiles[2]; - specialData[0x80 + 1] = metatiles[3]; - specialData += 2; + tiles = mapLayer->metatiles + metaTileSetIndex; + tileMap[0] = tiles[0]; + tileMap[1] = tiles[1]; + tileMap[0x80 + 0] = tiles[2]; + tileMap[0x80 + 1] = tiles[3]; + tileMap += 2; mapData += 4; mapDataClone += 4; - tmp2 = (u16)(tmp2 + 4); + metaTilePositionAndLayer = (u16)(metaTilePositionAndLayer + 4); } - specialData = specialData + 0x80; + tileMap = tileMap + 0x80; } } -u32 sub_0801AC68(u32 position, u32 data) { +u32 GetMetaTileSetIndexForSpecialTile(u32 metaTilePosAndLayer, u32 mapDataClone) { u32 index; - struct_0200B240* ptr; - u32 end; + SpecialTileEntry* ptr; + u32 count; - ptr = gUnk_0200B240; - end = gRoomVars.unk_0e; - for (index = 0; index < end; ptr++, index++) { - if (position == ptr->position) { - return ptr->data << 2; + ptr = gMetaTilesForSpecialTiles; + count = gRoomVars.specialTileCount; + for (index = 0; index < count; ptr++, index++) { + if (metaTilePosAndLayer == ptr->metaTilePosAndLayer) { + return ptr->metaTileIndex * 4; } } - return data << 2; + return mapDataClone * 4; } void sub_0801AC98(void) { @@ -945,7 +952,7 @@ void sub_0801AC98(void) { for (indexY = 0; indexY < height; indexY++) { for (indexX = 0; indexX < width; indexX++, position++) { for (ptr = gUnk_080B44C0; ptr->tileType != 0xffff; ptr++) { - if (ptr->tileType == GetTileType(position, 1)) { + if (ptr->tileType == GetMetaTileType(position, 1)) { if (gUnk_080B44B8[ptr->unk_a] != 0) { sub_0801AD6C(ptr, position); break; @@ -954,7 +961,7 @@ void sub_0801AC98(void) { } for (ptr = gUnk_080B44C2; ptr->tileType != 0xffff; ptr++) { - if (ptr->tileType == GetTileType(position, 2)) { + if (ptr->tileType == GetMetaTileType(position, 2)) { if (gUnk_080B44B8[ptr->unk_a] != 0) { sub_0801AD6C(ptr, position); break; @@ -1039,10 +1046,10 @@ void sub_0801AE44(bool32 loadGfx) { } if ((gRoomControls.scroll_flags & 1) == 0) { if (gMapBottom.bgSettings != NULL) { - RenderTilemapToScreenblock(gMapDataBottomSpecial, &gMapBottom); + RenderMapLayerToTileMap(gMapDataBottomSpecial, &gMapBottom); } if (gMapTop.bgSettings != NULL) { - RenderTilemapToScreenblock(gMapDataTopSpecial, &gMapTop); + RenderMapLayerToTileMap(gMapDataTopSpecial, &gMapTop); } } else { sub_0807C4F8(); @@ -1052,47 +1059,47 @@ void sub_0801AE44(bool32 loadGfx) { void SetMultipleTiles(const TileData* tileData, u32 basePosition, u32 layer) { while (tileData->tile != -1) { - SetTile((u16)tileData->tile, basePosition + tileData->position, layer); + SetMetaTile((u16)tileData->tile, basePosition + tileData->position, layer); tileData++; } } -// Add a new entry at the end of gUnk_0200B240 -void sub_0801AF48(u32 data, u32 position, u32 layer) { +// Add a new entry at the end of gMetaTilesForSpecialTiles +void StoreMetaTileForSpecialTile(u32 metaTileIndex, u32 metaTilePos, u32 layer) { u32 index; - if ((data < 0x4000) && (gRoomTransition.field_0x2c[3] == 0)) { - index = gRoomVars.unk_0e; + if ((metaTileIndex < 0x4000) && (gRoomTransition.field_0x2c[3] == 0)) { + index = gRoomVars.specialTileCount; if (index < 0x100) { - gUnk_0200B240[index].data = data; - gUnk_0200B240[index].position = (layer << 0xc) | position; - gRoomVars.unk_0e = index + 1; + gMetaTilesForSpecialTiles[index].metaTileIndex = metaTileIndex; + gMetaTilesForSpecialTiles[index].metaTilePosAndLayer = (layer << 12) | metaTilePos; + gRoomVars.specialTileCount = index + 1; } } } -void DeleteLoadedTileEntity(u32 position, s32 layer) { +void DeleteLoadedTileEntity(u32 metaTilePos, s32 layer) { u32 count; - struct_0200B240* ptr; - u32 positionLayer; + SpecialTileEntry* ptr; + u32 metaTilePosAndLayer; u32 t; layer = layer << 12; - positionLayer = position | layer; - ptr = gUnk_0200B240; - count = gRoomVars.unk_0e; + metaTilePosAndLayer = metaTilePos | layer; + ptr = gMetaTilesForSpecialTiles; + count = gRoomVars.specialTileCount; t = 0; if (t >= count) { return; } - if (positionLayer == ptr->position) { + if (metaTilePosAndLayer == ptr->metaTilePosAndLayer) { count--; - gRoomVars.unk_0e = count; + gRoomVars.specialTileCount = count; ptr[0] = ptr[count]; return; } - while (positionLayer != ptr->position) { + while (metaTilePosAndLayer != ptr->metaTilePosAndLayer) { ptr++; t++; if (t >= count) { @@ -1100,8 +1107,8 @@ void DeleteLoadedTileEntity(u32 position, s32 layer) { } } count--; - gRoomVars.unk_0e = count; - ptr = gUnk_0200B240; + gRoomVars.specialTileCount = count; + ptr = gMetaTilesForSpecialTiles; ptr[t] = ptr[count]; } @@ -1126,7 +1133,7 @@ void sub_0801AFE4(void) { for (x = 0; x < width; x++) { for (ptr = gUnk_080B44D0; ptr->collision != 0; ptr++) { if (ptr->collision == *collisionData) { - SetTile(ptr->tileIndex, y * 0x40 + x, 1); + SetMetaTile(ptr->tileIndex, y * 0x40 + x, 1); break; } } diff --git a/src/code_08049DF4.c b/src/code_08049DF4.c index a4af4474..0b5792f2 100644 --- a/src/code_08049DF4.c +++ b/src/code_08049DF4.c @@ -139,11 +139,11 @@ u32 sub_0804A024(Entity* ent, u32 arg1, u32 arg2) { } } -u32 sub_0804A168(Entity*, Entity*, LayerStruct*); -u32 sub_0804A318(Entity*, Entity*, LayerStruct*); +u32 sub_0804A168(Entity*, Entity*, MapLayer* mapLayer); +u32 sub_0804A318(Entity*, Entity*, MapLayer* mapLayer); u32 sub_0804A044(Entity* entA, Entity* entB, u32 arg2) { - LayerStruct* layer; + MapLayer* mapLayer; s32 ret; s32 yDiff; s32 xDiff; @@ -170,7 +170,7 @@ u32 sub_0804A044(Entity* entA, Entity* entB, u32 arg2) { //! @bug flags & 5 can never equal 0xA if (flags && ((flags & 5) != 0xA)) { - layer = GetLayerByIndex(entA->collisionLayer); + mapLayer = GetLayerByIndex(entA->collisionLayer); if (xDiff < 0) { xDiff = -xDiff; } @@ -179,7 +179,7 @@ u32 sub_0804A044(Entity* entA, Entity* entB, u32 arg2) { } if (xDiff < yDiff) { if (flags & 1) { - ret = sub_0804A168(entA, entB, layer); + ret = sub_0804A168(entA, entB, mapLayer); if (ret != 0xFF) { return ret; } @@ -187,10 +187,10 @@ u32 sub_0804A044(Entity* entA, Entity* entB, u32 arg2) { if (!(flags & 4)) { return 0xFF; } - ret = sub_0804A318(entA, entB, layer); + ret = sub_0804A318(entA, entB, mapLayer); } else { if (flags & 4) { - ret = sub_0804A318(entA, entB, layer); + ret = sub_0804A318(entA, entB, mapLayer); if (ret != 0xFF) { return ret; } @@ -198,7 +198,7 @@ u32 sub_0804A044(Entity* entA, Entity* entB, u32 arg2) { if (!(flags & 1)) { return 0xFF; } - ret = sub_0804A168(entA, entB, layer); + ret = sub_0804A168(entA, entB, mapLayer); } if (ret != 0xFF) { return ret; @@ -208,9 +208,9 @@ u32 sub_0804A044(Entity* entA, Entity* entB, u32 arg2) { return 0xFF; } -bool32 sub_0804A4BC(u8* arg0, u8* arg1, s32 arg2, u32 arg3); +bool32 sub_0804A4BC(u8* from, u8* to, s32 step, u32 bitmask); -u32 sub_0804A168(Entity* entA, Entity* entB, LayerStruct* layer) { +u32 sub_0804A168(Entity* entA, Entity* entB, MapLayer* mapLayer) { u32 uVar2; u32 uVar3; u32 tile1; @@ -222,13 +222,13 @@ u32 sub_0804A168(Entity* entA, Entity* entB, LayerStruct* layer) { tile1 = TILE(uVar2, entA->y.HALF.HI + 10); tile2 = TILE(uVar2, entB->y.HALF.HI); - if (sub_0804A4BC(&layer->collisionData[tile1], &layer->collisionData[tile2], 0x40, uVar3)) { + if (sub_0804A4BC(&mapLayer->collisionData[tile1], &mapLayer->collisionData[tile2], 0x40, uVar3)) { uVar2 = entA->x.HALF.HI + 4; uVar3 ^= 0xF; tile1 = TILE(uVar2, entA->y.HALF.HI + 10); tile2 = TILE(uVar2, entB->y.HALF.HI); - if (sub_0804A4BC(&layer->collisionData[tile1], &layer->collisionData[tile2], 0x40, uVar3)) { + if (sub_0804A4BC(&mapLayer->collisionData[tile1], &mapLayer->collisionData[tile2], 0x40, uVar3)) { return 0x10; } } @@ -238,13 +238,13 @@ u32 sub_0804A168(Entity* entA, Entity* entB, LayerStruct* layer) { tile1 = TILE(uVar2, entA->y.HALF.HI - 10); tile2 = TILE(uVar2, entB->y.HALF.HI); - if (sub_0804A4BC(&layer->collisionData[tile1], &layer->collisionData[tile2], -0x40, uVar3)) { + if (sub_0804A4BC(&mapLayer->collisionData[tile1], &mapLayer->collisionData[tile2], -0x40, uVar3)) { uVar2 = entA->x.HALF.HI + 4; uVar3 ^= 0xF; tile1 = TILE(uVar2, entA->y.HALF.HI - 10); tile2 = TILE(uVar2, entB->y.HALF.HI); - if (sub_0804A4BC(&layer->collisionData[tile1], &layer->collisionData[tile2], -0x40, uVar3)) { + if (sub_0804A4BC(&mapLayer->collisionData[tile1], &mapLayer->collisionData[tile2], -0x40, uVar3)) { return 0; } } @@ -252,7 +252,7 @@ u32 sub_0804A168(Entity* entA, Entity* entB, LayerStruct* layer) { return 0xFF; } -u32 sub_0804A318(Entity* entA, Entity* entB, LayerStruct* layer) { +u32 sub_0804A318(Entity* entA, Entity* entB, MapLayer* mapLayer) { u32 uVar2; u32 uVar3; u32 tile1; @@ -264,13 +264,13 @@ u32 sub_0804A318(Entity* entA, Entity* entB, LayerStruct* layer) { tile1 = TILE(entA->x.HALF.HI + 10, uVar2); tile2 = TILE(entB->x.HALF.HI, uVar2); - if (sub_0804A4BC(&layer->collisionData[tile1], &layer->collisionData[tile2], 1, uVar3)) { + if (sub_0804A4BC(&mapLayer->collisionData[tile1], &mapLayer->collisionData[tile2], 1, uVar3)) { uVar2 = entA->y.HALF.HI + 4; uVar3 ^= 0xF; tile1 = TILE(entA->x.HALF.HI + 10, uVar2); tile2 = TILE(entB->x.HALF.HI, uVar2); - if (sub_0804A4BC(&layer->collisionData[tile1], &layer->collisionData[tile2], 1, uVar3)) { + if (sub_0804A4BC(&mapLayer->collisionData[tile1], &mapLayer->collisionData[tile2], 1, uVar3)) { return 8; } } @@ -280,12 +280,12 @@ u32 sub_0804A318(Entity* entA, Entity* entB, LayerStruct* layer) { tile1 = TILE(entA->x.HALF.HI - 10, uVar2); tile2 = TILE(entB->x.HALF.HI, uVar2); - if (sub_0804A4BC(&layer->collisionData[tile1], &layer->collisionData[tile2], -1, uVar3)) { + if (sub_0804A4BC(&mapLayer->collisionData[tile1], &mapLayer->collisionData[tile2], -1, uVar3)) { uVar2 = entA->y.HALF.HI + 4; uVar3 ^= 0xF; tile1 = TILE(entA->x.HALF.HI - 10, uVar2); tile2 = TILE(entB->x.HALF.HI, uVar2); - if (sub_0804A4BC(&layer->collisionData[tile1], &layer->collisionData[tile2], -1, uVar3)) { + if (sub_0804A4BC(&mapLayer->collisionData[tile1], &mapLayer->collisionData[tile2], -1, uVar3)) { return 0x18; } } @@ -293,21 +293,21 @@ u32 sub_0804A318(Entity* entA, Entity* entB, LayerStruct* layer) { return 0xFF; } -bool32 sub_0804A4BC(u8* arg0, u8* arg1, s32 arg2, u32 arg3) { - while (arg0 != arg1) { - u8 r0 = *arg0; +bool32 sub_0804A4BC(u8* from, u8* to, s32 step, u32 bitmask) { + while (from != to) { + u8 r0 = *from; if (r0 != 0) { if (r0 > 0xF) { return FALSE; } - r0 &= arg3; + r0 &= bitmask; if (r0 != 0) { return FALSE; } } - arg0 += arg2; + from += step; } return TRUE; diff --git a/src/collision.c b/src/collision.c index b514159b..253f3f7c 100644 --- a/src/collision.c +++ b/src/collision.c @@ -10,6 +10,7 @@ #include "object.h" #include "player.h" #include "save.h" +#include "tiles.h" extern u8 gCollidableCount; extern u8 gUnk_080B3740[]; @@ -789,134 +790,1463 @@ CollisionResult CollisionDefault(Entity* org, Entity* tgt, u32 direction, ColSet } // vvv for tileType? - +const u8 gUnk_080B37A0[] = { +VVV_0, // META_TILE_TYPE_0 +VVV_1, // META_TILE_TYPE_1 +VVV_2, // META_TILE_TYPE_2 +VVV_3, // META_TILE_TYPE_3 +VVV_4, // META_TILE_TYPE_4 +VVV_5, // META_TILE_TYPE_5 +VVV_6, // META_TILE_TYPE_6 +VVV_7, // META_TILE_TYPE_7 +VVV_8, // META_TILE_TYPE_8 +VVV_9, // META_TILE_TYPE_9 +VVV_9, // META_TILE_TYPE_10 +VVV_10, // META_TILE_TYPE_11 +VVV_9, // META_TILE_TYPE_12 +VVV_9, // META_TILE_TYPE_13 +VVV_9, // META_TILE_TYPE_14 +VVV_9, // META_TILE_TYPE_15 +VVV_9, // META_TILE_TYPE_16 +VVV_9, // META_TILE_TYPE_17 +VVV_11, // META_TILE_TYPE_18 +VVV_12, // META_TILE_TYPE_19 +VVV_11, // META_TILE_TYPE_20 +VVV_11, // META_TILE_TYPE_21 +VVV_11, // META_TILE_TYPE_22 +VVV_11, // META_TILE_TYPE_23 +VVV_11, // META_TILE_TYPE_24 +VVV_11, // META_TILE_TYPE_25 +VVV_10, // META_TILE_TYPE_26 +VVV_10, // META_TILE_TYPE_27 +VVV_10, // META_TILE_TYPE_28 +VVV_10, // META_TILE_TYPE_29 +VVV_10, // META_TILE_TYPE_30 +VVV_10, // META_TILE_TYPE_31 +VVV_10, // META_TILE_TYPE_32 +VVV_10, // META_TILE_TYPE_33 +VVV_10, // META_TILE_TYPE_34 +VVV_10, // META_TILE_TYPE_35 +VVV_10, // META_TILE_TYPE_36 +VVV_10, // META_TILE_TYPE_37 +VVV_10, // META_TILE_TYPE_38 +VVV_10, // META_TILE_TYPE_39 +VVV_10, // META_TILE_TYPE_40 +VVV_12, // META_TILE_TYPE_41 +VVV_12, // META_TILE_TYPE_42 +VVV_12, // META_TILE_TYPE_43 +VVV_12, // META_TILE_TYPE_44 +VVV_12, // META_TILE_TYPE_45 +VVV_12, // META_TILE_TYPE_46 +VVV_12, // META_TILE_TYPE_47 +VVV_12, // META_TILE_TYPE_48 +VVV_12, // META_TILE_TYPE_49 +VVV_12, // META_TILE_TYPE_50 +VVV_12, // META_TILE_TYPE_51 +VVV_12, // META_TILE_TYPE_52 +VVV_13, // META_TILE_TYPE_53 +VVV_14, // META_TILE_TYPE_54 +VVV_14, // META_TILE_TYPE_55 +VVV_15, // META_TILE_TYPE_56 +VVV_16, // META_TILE_TYPE_57 +VVV_15, // META_TILE_TYPE_58 +VVV_14, // META_TILE_TYPE_59 +VVV_17, // META_TILE_TYPE_60 +VVV_18, // META_TILE_TYPE_61 +VVV_19, // META_TILE_TYPE_62 +VVV_20, // META_TILE_TYPE_63 +VVV_20, // META_TILE_TYPE_64 +VVV_20, // META_TILE_TYPE_65 +VVV_20, // META_TILE_TYPE_66 +VVV_20, // META_TILE_TYPE_67 +VVV_20, // META_TILE_TYPE_68 +VVV_20, // META_TILE_TYPE_69 +VVV_20, // META_TILE_TYPE_70 +VVV_20, // META_TILE_TYPE_71 +VVV_20, // META_TILE_TYPE_72 +VVV_20, // META_TILE_TYPE_73 +VVV_20, // META_TILE_TYPE_74 +VVV_20, // META_TILE_TYPE_75 +VVV_20, // META_TILE_TYPE_76 +VVV_20, // META_TILE_TYPE_77 +VVV_20, // META_TILE_TYPE_78 +VVV_20, // META_TILE_TYPE_79 +VVV_20, // META_TILE_TYPE_80 +VVV_20, // META_TILE_TYPE_81 +VVV_20, // META_TILE_TYPE_82 +VVV_20, // META_TILE_TYPE_83 +VVV_20, // META_TILE_TYPE_84 +VVV_21, // META_TILE_TYPE_85 +VVV_21, // META_TILE_TYPE_86 +VVV_21, // META_TILE_TYPE_87 +VVV_21, // META_TILE_TYPE_88 +VVV_21, // META_TILE_TYPE_89 +VVV_21, // META_TILE_TYPE_90 +VVV_21, // META_TILE_TYPE_91 +VVV_21, // META_TILE_TYPE_92 +VVV_21, // META_TILE_TYPE_93 +VVV_21, // META_TILE_TYPE_94 +VVV_21, // META_TILE_TYPE_95 +VVV_21, // META_TILE_TYPE_96 +VVV_22, // META_TILE_TYPE_97 +VVV_22, // META_TILE_TYPE_98 +VVV_22, // META_TILE_TYPE_99 +VVV_22, // META_TILE_TYPE_100 +VVV_22, // META_TILE_TYPE_101 +VVV_22, // META_TILE_TYPE_102 +VVV_22, // META_TILE_TYPE_103 +VVV_22, // META_TILE_TYPE_104 +VVV_23, // META_TILE_TYPE_105 +VVV_23, // META_TILE_TYPE_106 +VVV_24, // META_TILE_TYPE_107 +VVV_24, // META_TILE_TYPE_108 +VVV_24, // META_TILE_TYPE_109 +VVV_24, // META_TILE_TYPE_110 +VVV_0, // META_TILE_TYPE_111 +VVV_0, // META_TILE_TYPE_112 +VVV_25, // META_TILE_TYPE_113 +VVV_25, // META_TILE_TYPE_114 +VVV_26, // META_TILE_TYPE_115 +VVV_0, // META_TILE_TYPE_116 +VVV_0, // META_TILE_TYPE_117 +VVV_0, // META_TILE_TYPE_118 +VVV_27, // META_TILE_TYPE_119 +VVV_28, // META_TILE_TYPE_120 +VVV_29, // META_TILE_TYPE_121 +VVV_30, // META_TILE_TYPE_122 +VVV_31, // META_TILE_TYPE_123 +VVV_32, // META_TILE_TYPE_124 +VVV_33, // META_TILE_TYPE_125 +VVV_34, // META_TILE_TYPE_126 +VVV_35, // META_TILE_TYPE_127 +VVV_36, // META_TILE_TYPE_128 +VVV_0, // META_TILE_TYPE_129 +VVV_36, // META_TILE_TYPE_130 +VVV_36, // META_TILE_TYPE_131 +VVV_36, // META_TILE_TYPE_132 +VVV_36, // META_TILE_TYPE_133 +VVV_37, // META_TILE_TYPE_134 +VVV_38, // META_TILE_TYPE_135 +VVV_38, // META_TILE_TYPE_136 +VVV_39, // META_TILE_TYPE_137 +VVV_39, // META_TILE_TYPE_138 +VVV_40, // META_TILE_TYPE_139 +VVV_40, // META_TILE_TYPE_140 +VVV_40, // META_TILE_TYPE_141 +VVV_40, // META_TILE_TYPE_142 +VVV_40, // META_TILE_TYPE_143 +VVV_40, // META_TILE_TYPE_144 +VVV_40, // META_TILE_TYPE_145 +VVV_40, // META_TILE_TYPE_146 +VVV_40, // META_TILE_TYPE_147 +VVV_40, // META_TILE_TYPE_148 +VVV_40, // META_TILE_TYPE_149 +VVV_40, // META_TILE_TYPE_150 +VVV_40, // META_TILE_TYPE_151 +VVV_40, // META_TILE_TYPE_152 +VVV_40, // META_TILE_TYPE_153 +VVV_40, // META_TILE_TYPE_154 +VVV_40, // META_TILE_TYPE_155 +VVV_40, // META_TILE_TYPE_156 +VVV_41, // META_TILE_TYPE_157 +VVV_41, // META_TILE_TYPE_158 +VVV_40, // META_TILE_TYPE_159 +VVV_40, // META_TILE_TYPE_160 +VVV_42, // META_TILE_TYPE_161 +VVV_41, // META_TILE_TYPE_162 +VVV_40, // META_TILE_TYPE_163 +VVV_43, // META_TILE_TYPE_164 +VVV_41, // META_TILE_TYPE_165 +VVV_40, // META_TILE_TYPE_166 +VVV_44, // META_TILE_TYPE_167 +VVV_41, // META_TILE_TYPE_168 +VVV_40, // META_TILE_TYPE_169 +VVV_45, // META_TILE_TYPE_170 +VVV_0, // META_TILE_TYPE_171 +VVV_0, // META_TILE_TYPE_172 +VVV_0, // META_TILE_TYPE_173 +VVV_0, // META_TILE_TYPE_174 +VVV_46, // META_TILE_TYPE_175 +VVV_0, // META_TILE_TYPE_176 +VVV_0, // META_TILE_TYPE_177 #ifdef EU -const u8 gUnk_080B37A0[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 10, 9, 9, 9, 9, 9, 9, 11, 12, 11, 11, 11, - 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 13, 14, 14, 15, 16, 15, 14, 17, 18, 19, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 24, 24, 24, 24, 0, 0, 25, 25, - 26, 0, 0, 0, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 0, 36, 36, 36, 36, 37, 38, 38, 39, - 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 41, 41, 40, 40, - 42, 41, 40, 43, 41, 40, 44, 41, 40, 45, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 40, 0, - 42, 42, 42, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 40, 0, 42, 42, 42, 0, 46, 0, 0, - 0, 0, 0, 0, 40, 0, 0, 0, 0, 43, 43, 43, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, - 40, 0, 44, 44, 44, 0, 46, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, 0, 45, 45, 45, 0, 0, - 0, 0, 46, 0, 0, 0, 0, 0, 46, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, - 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, 0, 0, 40, 0, 40, 48, 49, 50, 51, 52, 52, 53, - 53, 54, 55, 0, 56, 57, 58, 59, 0, 0, 60, 60, 60, 60, 0, 0, 0, 0, 61, 61, 62, 9, 9, - 9, 9, 9, 9, 61, 61, 61, 9, 9, 61, 61, 61, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 42, 43, 44, 45, 0, 0, 0, 0, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 63, 0, 63, 83, - 83, 0, 0, 43, 43, 43, 0, 21, 21, 21, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 86, 0, 0, 86, 0, 0, - 41, 0, 0, 41, 40, 0, 0, 0, 0, 0, 86, 0, 0, 86, 0, 0, 41, 0, 0, 41, 40, 0, 0, - 0, 0, 0, 86, 0, 0, 86, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, 0, 86, 86, 86, 86, 86, - 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, - 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, - 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, - 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 10, 9, 10, 10, 13, - 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, - 16, 0, 12, 0, 0, 1, 24, 87, 88, 89, 89, 90, 91, 92, 93, 94, 95, 96, 0, 0, 0, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 97, 97, 97, 97, 98, 98, 0, 0, 99, 99, 99, 99, - 100, 0, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 112, 112, 112, 112, 0, 113, 46, 46, 114, - 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 115, 115, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 43, 44, 45, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 116, 116, 116, 0, 0, 0, 0, 43, 42, 45, 44, 117, 0, 82, - 0, 0, 0, 0, 0, 0, 43, 42, 0, 0, 44, 0, 0, 45, 0, 0, 0, 0, 41, 40, 38, 38, 116, - 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 90, 41, 41, 41, 12, 0, 12, 12, 41, 41, 116, - 0, 0, 10, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, 40, 0, 10, 10, 10, 10, 10, 10, 10, 40, - 40, 84, 84, 84, 84, 0, 61, 61, 61, 61, 61, 61, 61, 61, 62, 62, 62, 62, 62, 62, 62, 62, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 42, 10, 10, 10, 10, 10, 10, - 15, 10, 42, 13, 0, 42, 0, 0, 0, 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 9, 9, 9, 56, - 10, 42, 0, 10, 79, 77, 0, 0, 0, 0, 10, 0, 0, 0, 78, 78, 12, 12, 12, 12, 61, 61, 61, - 40, 12, 40, 10, 10, 10, 0, 0, 39, 39, 39, 39, 39, 39, 38, 38, 52, 52, 12, 55, 0, 0, 0, - 0, 0, 54, 0, 0, 0, 0, 40, 53, 53, 40, 55, 12, 0, 12, 12, 12, 12, 12, 54, 13, 40, 0, - 0, 0, 52, 52, 52, 10, 10, 0, 0, 0, 0, 40, 15, 15, 51, 16, 10, 10, 16, 16, 10, 10, 10, - 10, 0, 0, 15, 9, 14, 15, 14, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 116, 116, - 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 15, 40, 15, 40, 40, 15, 12, 12, 12, 12, 12, 25, - 40, 40, 40, 0, 16, 16, 116, 0, 0, 12, 45, 0, 40, 40, 43, 25, 0, 10, 0, 40, 0, 43, 43, - 43, 0, 42, 42, 42, 42, 0, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 44, 42, 42, 0, 38, - 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 83, 0, 0, 0, 0, 38, 38, 40, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 41, 41, 38, 38, 12, 12, 41, 41, 12, 12, 116, 116, 116, 116, 116, 0, - 0, 40, 0, 0, 43, 42, 0, 0, 44, 13, 40, 40, 42, 44, 45, 44, 45, 44, 45, 42, 42, 42, 43, - 43, 43, 100, 101, 104, 106, 102, 107, 105, 103, 0, 14, 14, 41, 40, 0, 0, 40, 0, 40, 0, 17, 15, - 0, 116, 43, 63, 35, 35, 35, 35, 116, 116, 0, 42, 42, 0, 0, 0, 10, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 0, 0, 44, 43, 40, 40, 40, 116, 0, 0, -}; +VVV_0, // META_TILE_TYPE_178 #else -const u8 gUnk_080B37A0[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 10, 9, 9, 9, 9, 9, 9, 11, 12, 11, 11, 11, - 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 13, 14, 14, 15, 16, 15, 14, 17, 18, 19, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 24, 24, 24, 24, 0, 0, 25, 25, - 26, 0, 0, 0, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 0, 36, 36, 36, 36, 37, 38, 38, 39, - 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 41, 41, 40, 40, - 42, 41, 40, 43, 41, 40, 44, 41, 40, 45, 0, 0, 0, 0, 46, 0, 0, 41, 0, 0, 41, 40, 0, - 42, 42, 42, 0, 0, 0, 0, 46, 0, 0, 41, 0, 0, 41, 40, 0, 42, 42, 42, 0, 46, 0, 0, - 0, 0, 0, 41, 40, 0, 0, 41, 0, 43, 43, 43, 0, 0, 0, 0, 46, 0, 0, 41, 0, 0, 41, - 40, 0, 44, 44, 44, 0, 46, 0, 0, 0, 0, 0, 41, 40, 0, 0, 41, 0, 45, 45, 45, 0, 0, - 0, 0, 46, 0, 0, 0, 0, 0, 46, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, - 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, 0, 0, 40, 0, 40, 48, 49, 50, 51, 52, 52, 53, - 53, 54, 55, 0, 56, 57, 58, 59, 0, 0, 60, 60, 60, 60, 0, 0, 0, 0, 61, 61, 62, 9, 9, - 9, 9, 9, 9, 61, 61, 61, 9, 9, 61, 61, 61, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 42, 43, 44, 45, 0, 0, 0, 0, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 63, 0, 63, 83, - 83, 0, 0, 43, 43, 43, 0, 21, 21, 21, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 86, 0, 0, 86, 0, 0, - 41, 0, 0, 41, 40, 0, 0, 0, 0, 0, 86, 0, 0, 86, 0, 0, 41, 0, 0, 41, 40, 0, 0, - 0, 0, 0, 86, 0, 0, 86, 0, 0, 41, 0, 0, 41, 40, 0, 0, 0, 0, 86, 86, 86, 86, 86, - 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, - 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, - 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, - 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 10, 9, 10, 10, 13, - 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, - 16, 0, 12, 0, 0, 1, 24, 87, 88, 89, 89, 90, 91, 92, 93, 94, 95, 96, 0, 0, 0, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 97, 97, 97, 97, 98, 98, 0, 0, 99, 99, 99, 99, - 100, 0, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 112, 112, 112, 112, 0, 113, 46, 46, 114, - 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 115, 115, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 43, 44, 45, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 116, 116, 116, 0, 0, 0, 0, 43, 42, 45, 44, 117, 0, 82, - 0, 0, 0, 0, 0, 0, 43, 42, 0, 0, 44, 0, 0, 45, 0, 0, 0, 0, 41, 40, 38, 38, 116, - 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 90, 41, 41, 41, 12, 0, 12, 12, 41, 41, 116, - 0, 0, 10, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, 40, 0, 10, 10, 10, 10, 10, 10, 10, 40, - 40, 84, 84, 84, 84, 0, 61, 61, 61, 61, 61, 61, 61, 61, 62, 62, 62, 62, 62, 62, 62, 62, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 42, 10, 10, 10, 10, 10, 10, - 15, 10, 42, 13, 0, 42, 0, 0, 0, 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 9, 9, 9, 56, - 10, 42, 0, 10, 79, 77, 0, 0, 0, 0, 10, 0, 0, 0, 78, 78, 12, 12, 12, 12, 61, 61, 61, - 40, 12, 40, 10, 10, 10, 0, 0, 39, 39, 39, 39, 39, 39, 38, 38, 52, 52, 12, 55, 0, 0, 0, - 0, 0, 54, 0, 0, 0, 0, 40, 53, 53, 40, 55, 12, 0, 12, 12, 12, 12, 12, 54, 13, 40, 0, - 0, 0, 52, 52, 52, 10, 10, 0, 0, 0, 0, 40, 15, 15, 51, 16, 10, 10, 16, 16, 10, 10, 10, - 10, 0, 0, 15, 9, 14, 15, 14, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 116, 116, - 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 15, 40, 15, 40, 40, 15, 12, 12, 12, 12, 12, 25, - 40, 40, 40, 0, 16, 16, 116, 0, 0, 12, 45, 0, 40, 40, 43, 25, 0, 10, 0, 40, 0, 43, 43, - 43, 0, 42, 42, 42, 42, 0, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 44, 42, 42, 0, 38, - 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 83, 0, 0, 0, 0, 38, 38, 40, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 41, 41, 38, 38, 12, 12, 41, 41, 12, 12, 116, 116, 116, 116, 116, 0, - 0, 40, 0, 0, 43, 42, 0, 0, 44, 13, 40, 40, 42, 44, 45, 44, 45, 44, 45, 42, 42, 42, 43, - 43, 43, 100, 101, 104, 106, 102, 107, 105, 103, 0, 14, 14, 41, 40, 41, 41, 40, 41, 40, 41, 17, 15, - 0, 116, 43, 63, 35, 35, 35, 35, 116, 116, 0, 42, 42, 0, 0, 0, 10, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 0, 0, 44, 43, 40, 40, 40, 116, 0, 0, -}; - +VVV_41, // META_TILE_TYPE_178 #endif +VVV_0, // META_TILE_TYPE_179 +VVV_0, // META_TILE_TYPE_180 +#ifdef EU +VVV_0, // META_TILE_TYPE_181 +#else +VVV_41, // META_TILE_TYPE_181 +#endif +VVV_40, // META_TILE_TYPE_182 +VVV_0, // META_TILE_TYPE_183 +VVV_42, // META_TILE_TYPE_184 +VVV_42, // META_TILE_TYPE_185 +VVV_42, // META_TILE_TYPE_186 +VVV_0, // META_TILE_TYPE_187 +VVV_0, // META_TILE_TYPE_188 +VVV_0, // META_TILE_TYPE_189 +VVV_0, // META_TILE_TYPE_190 +VVV_46, // META_TILE_TYPE_191 +VVV_0, // META_TILE_TYPE_192 +VVV_0, // META_TILE_TYPE_193 +#ifdef EU +VVV_0, // META_TILE_TYPE_194 +#else +VVV_41, // META_TILE_TYPE_194 +#endif +VVV_0, // META_TILE_TYPE_195 +VVV_0, // META_TILE_TYPE_196 +#ifdef EU +VVV_0, // META_TILE_TYPE_197 +#else +VVV_41, // META_TILE_TYPE_197 +#endif +VVV_40, // META_TILE_TYPE_198 +VVV_0, // META_TILE_TYPE_199 +VVV_42, // META_TILE_TYPE_200 +VVV_42, // META_TILE_TYPE_201 +VVV_42, // META_TILE_TYPE_202 +VVV_0, // META_TILE_TYPE_203 +VVV_46, // META_TILE_TYPE_204 +VVV_0, // META_TILE_TYPE_205 +VVV_0, // META_TILE_TYPE_206 +VVV_0, // META_TILE_TYPE_207 +VVV_0, // META_TILE_TYPE_208 +VVV_0, // META_TILE_TYPE_209 +#ifdef EU +VVV_0, // META_TILE_TYPE_210 +#else +VVV_41, // META_TILE_TYPE_210 +#endif +VVV_40, // META_TILE_TYPE_211 +VVV_0, // META_TILE_TYPE_212 +VVV_0, // META_TILE_TYPE_213 +#ifdef EU +VVV_0, // META_TILE_TYPE_214 +#else +VVV_41, // META_TILE_TYPE_214 +#endif +VVV_0, // META_TILE_TYPE_215 +VVV_43, // META_TILE_TYPE_216 +VVV_43, // META_TILE_TYPE_217 +VVV_43, // META_TILE_TYPE_218 +VVV_0, // META_TILE_TYPE_219 +VVV_0, // META_TILE_TYPE_220 +VVV_0, // META_TILE_TYPE_221 +VVV_0, // META_TILE_TYPE_222 +VVV_46, // META_TILE_TYPE_223 +VVV_0, // META_TILE_TYPE_224 +VVV_0, // META_TILE_TYPE_225 +#ifdef EU +VVV_0, // META_TILE_TYPE_226 +#else +VVV_41, // META_TILE_TYPE_226 +#endif +VVV_0, // META_TILE_TYPE_227 +VVV_0, // META_TILE_TYPE_228 +#ifdef EU +VVV_0, // META_TILE_TYPE_229 +#else +VVV_41, // META_TILE_TYPE_229 +#endif +VVV_40, // META_TILE_TYPE_230 +VVV_0, // META_TILE_TYPE_231 +VVV_44, // META_TILE_TYPE_232 +VVV_44, // META_TILE_TYPE_233 +VVV_44, // META_TILE_TYPE_234 +VVV_0, // META_TILE_TYPE_235 +VVV_46, // META_TILE_TYPE_236 +VVV_0, // META_TILE_TYPE_237 +VVV_0, // META_TILE_TYPE_238 +VVV_0, // META_TILE_TYPE_239 +VVV_0, // META_TILE_TYPE_240 +VVV_0, // META_TILE_TYPE_241 +#ifdef EU +VVV_0, // META_TILE_TYPE_242 +#else +VVV_41, // META_TILE_TYPE_242 +#endif +VVV_40, // META_TILE_TYPE_243 +VVV_0, // META_TILE_TYPE_244 +VVV_0, // META_TILE_TYPE_245 +#ifdef EU +VVV_0, // META_TILE_TYPE_246 +#else +VVV_41, // META_TILE_TYPE_246 +#endif +VVV_0, // META_TILE_TYPE_247 +VVV_45, // META_TILE_TYPE_248 +VVV_45, // META_TILE_TYPE_249 +VVV_45, // META_TILE_TYPE_250 +VVV_0, // META_TILE_TYPE_251 +VVV_0, // META_TILE_TYPE_252 +VVV_0, // META_TILE_TYPE_253 +VVV_0, // META_TILE_TYPE_254 +VVV_46, // META_TILE_TYPE_255 +VVV_0, // META_TILE_TYPE_256 +VVV_0, // META_TILE_TYPE_257 +VVV_0, // META_TILE_TYPE_258 +VVV_0, // META_TILE_TYPE_259 +VVV_0, // META_TILE_TYPE_260 +VVV_46, // META_TILE_TYPE_261 +VVV_0, // META_TILE_TYPE_262 +VVV_0, // META_TILE_TYPE_263 +VVV_46, // META_TILE_TYPE_264 +VVV_0, // META_TILE_TYPE_265 +VVV_0, // META_TILE_TYPE_266 +VVV_0, // META_TILE_TYPE_267 +VVV_0, // META_TILE_TYPE_268 +VVV_0, // META_TILE_TYPE_269 +VVV_0, // META_TILE_TYPE_270 +VVV_0, // META_TILE_TYPE_271 +VVV_46, // META_TILE_TYPE_272 +VVV_0, // META_TILE_TYPE_273 +VVV_0, // META_TILE_TYPE_274 +VVV_0, // META_TILE_TYPE_275 +VVV_0, // META_TILE_TYPE_276 +VVV_46, // META_TILE_TYPE_277 +VVV_0, // META_TILE_TYPE_278 +VVV_0, // META_TILE_TYPE_279 +VVV_0, // META_TILE_TYPE_280 +VVV_0, // META_TILE_TYPE_281 +VVV_0, // META_TILE_TYPE_282 +VVV_0, // META_TILE_TYPE_283 +VVV_0, // META_TILE_TYPE_284 +VVV_0, // META_TILE_TYPE_285 +VVV_0, // META_TILE_TYPE_286 +VVV_0, // META_TILE_TYPE_287 +VVV_0, // META_TILE_TYPE_288 +VVV_0, // META_TILE_TYPE_289 +VVV_0, // META_TILE_TYPE_290 +VVV_0, // META_TILE_TYPE_291 +VVV_0, // META_TILE_TYPE_292 +VVV_0, // META_TILE_TYPE_293 +VVV_0, // META_TILE_TYPE_294 +VVV_0, // META_TILE_TYPE_295 +VVV_0, // META_TILE_TYPE_296 +VVV_0, // META_TILE_TYPE_297 +VVV_0, // META_TILE_TYPE_298 +VVV_0, // META_TILE_TYPE_299 +VVV_0, // META_TILE_TYPE_300 +VVV_0, // META_TILE_TYPE_301 +VVV_0, // META_TILE_TYPE_302 +VVV_0, // META_TILE_TYPE_303 +VVV_0, // META_TILE_TYPE_304 +VVV_0, // META_TILE_TYPE_305 +VVV_0, // META_TILE_TYPE_306 +VVV_0, // META_TILE_TYPE_307 +VVV_0, // META_TILE_TYPE_308 +VVV_0, // META_TILE_TYPE_309 +VVV_0, // META_TILE_TYPE_310 +VVV_0, // META_TILE_TYPE_311 +VVV_0, // META_TILE_TYPE_312 +VVV_0, // META_TILE_TYPE_313 +VVV_0, // META_TILE_TYPE_314 +VVV_0, // META_TILE_TYPE_315 +VVV_0, // META_TILE_TYPE_316 +VVV_0, // META_TILE_TYPE_317 +VVV_0, // META_TILE_TYPE_318 +VVV_0, // META_TILE_TYPE_319 +VVV_0, // META_TILE_TYPE_320 +VVV_0, // META_TILE_TYPE_321 +VVV_0, // META_TILE_TYPE_322 +VVV_0, // META_TILE_TYPE_323 +VVV_0, // META_TILE_TYPE_324 +VVV_0, // META_TILE_TYPE_325 +VVV_0, // META_TILE_TYPE_326 +VVV_0, // META_TILE_TYPE_327 +VVV_0, // META_TILE_TYPE_328 +VVV_0, // META_TILE_TYPE_329 +VVV_0, // META_TILE_TYPE_330 +VVV_0, // META_TILE_TYPE_331 +VVV_0, // META_TILE_TYPE_332 +VVV_0, // META_TILE_TYPE_333 +VVV_0, // META_TILE_TYPE_334 +VVV_0, // META_TILE_TYPE_335 +VVV_0, // META_TILE_TYPE_336 +VVV_0, // META_TILE_TYPE_337 +VVV_0, // META_TILE_TYPE_338 +VVV_0, // META_TILE_TYPE_339 +VVV_0, // META_TILE_TYPE_340 +VVV_0, // META_TILE_TYPE_341 +VVV_0, // META_TILE_TYPE_342 +VVV_0, // META_TILE_TYPE_343 +VVV_0, // META_TILE_TYPE_344 +VVV_0, // META_TILE_TYPE_345 +VVV_0, // META_TILE_TYPE_346 +VVV_0, // META_TILE_TYPE_347 +VVV_0, // META_TILE_TYPE_348 +VVV_0, // META_TILE_TYPE_349 +VVV_0, // META_TILE_TYPE_350 +VVV_0, // META_TILE_TYPE_351 +VVV_0, // META_TILE_TYPE_352 +VVV_47, // META_TILE_TYPE_353 +VVV_47, // META_TILE_TYPE_354 +VVV_47, // META_TILE_TYPE_355 +VVV_0, // META_TILE_TYPE_356 +VVV_0, // META_TILE_TYPE_357 +VVV_40, // META_TILE_TYPE_358 +VVV_0, // META_TILE_TYPE_359 +VVV_40, // META_TILE_TYPE_360 +VVV_48, // META_TILE_TYPE_361 +VVV_49, // META_TILE_TYPE_362 +VVV_50, // META_TILE_TYPE_363 +VVV_51, // META_TILE_TYPE_364 +VVV_52, // META_TILE_TYPE_365 +VVV_52, // META_TILE_TYPE_366 +VVV_53, // META_TILE_TYPE_367 +VVV_53, // META_TILE_TYPE_368 +VVV_54, // META_TILE_TYPE_369 +VVV_55, // META_TILE_TYPE_370 +VVV_0, // META_TILE_TYPE_371 +VVV_56, // META_TILE_TYPE_372 +VVV_57, // META_TILE_TYPE_373 +VVV_58, // META_TILE_TYPE_374 +VVV_59, // META_TILE_TYPE_375 +VVV_0, // META_TILE_TYPE_376 +VVV_0, // META_TILE_TYPE_377 +VVV_60, // META_TILE_TYPE_378 +VVV_60, // META_TILE_TYPE_379 +VVV_60, // META_TILE_TYPE_380 +VVV_60, // META_TILE_TYPE_381 +VVV_0, // META_TILE_TYPE_382 +VVV_0, // META_TILE_TYPE_383 +VVV_0, // META_TILE_TYPE_384 +VVV_0, // META_TILE_TYPE_385 +VVV_61, // META_TILE_TYPE_386 +VVV_61, // META_TILE_TYPE_387 +VVV_62, // META_TILE_TYPE_388 +VVV_9, // META_TILE_TYPE_389 +VVV_9, // META_TILE_TYPE_390 +VVV_9, // META_TILE_TYPE_391 +VVV_9, // META_TILE_TYPE_392 +VVV_9, // META_TILE_TYPE_393 +VVV_9, // META_TILE_TYPE_394 +VVV_61, // META_TILE_TYPE_395 +VVV_61, // META_TILE_TYPE_396 +VVV_61, // META_TILE_TYPE_397 +VVV_9, // META_TILE_TYPE_398 +VVV_9, // META_TILE_TYPE_399 +VVV_61, // META_TILE_TYPE_400 +VVV_61, // META_TILE_TYPE_401 +VVV_61, // META_TILE_TYPE_402 +VVV_9, // META_TILE_TYPE_403 +VVV_9, // META_TILE_TYPE_404 +VVV_9, // META_TILE_TYPE_405 +VVV_9, // META_TILE_TYPE_406 +VVV_9, // META_TILE_TYPE_407 +VVV_9, // META_TILE_TYPE_408 +VVV_0, // META_TILE_TYPE_409 +VVV_0, // META_TILE_TYPE_410 +VVV_0, // META_TILE_TYPE_411 +VVV_0, // META_TILE_TYPE_412 +VVV_63, // META_TILE_TYPE_413 +VVV_0, // META_TILE_TYPE_414 +VVV_0, // META_TILE_TYPE_415 +VVV_0, // META_TILE_TYPE_416 +VVV_0, // META_TILE_TYPE_417 +VVV_0, // META_TILE_TYPE_418 +VVV_0, // META_TILE_TYPE_419 +VVV_0, // META_TILE_TYPE_420 +VVV_0, // META_TILE_TYPE_421 +VVV_63, // META_TILE_TYPE_422 +VVV_0, // META_TILE_TYPE_423 +VVV_0, // META_TILE_TYPE_424 +VVV_0, // META_TILE_TYPE_425 +VVV_0, // META_TILE_TYPE_426 +VVV_0, // META_TILE_TYPE_427 +VVV_42, // META_TILE_TYPE_428 +VVV_43, // META_TILE_TYPE_429 +VVV_44, // META_TILE_TYPE_430 +VVV_45, // META_TILE_TYPE_431 +VVV_0, // META_TILE_TYPE_432 +VVV_0, // META_TILE_TYPE_433 +VVV_0, // META_TILE_TYPE_434 +VVV_0, // META_TILE_TYPE_435 +VVV_64, // META_TILE_TYPE_436 +VVV_65, // META_TILE_TYPE_437 +VVV_66, // META_TILE_TYPE_438 +VVV_67, // META_TILE_TYPE_439 +VVV_68, // META_TILE_TYPE_440 +VVV_69, // META_TILE_TYPE_441 +VVV_70, // META_TILE_TYPE_442 +VVV_71, // META_TILE_TYPE_443 +VVV_72, // META_TILE_TYPE_444 +VVV_73, // META_TILE_TYPE_445 +VVV_74, // META_TILE_TYPE_446 +VVV_75, // META_TILE_TYPE_447 +VVV_76, // META_TILE_TYPE_448 +VVV_77, // META_TILE_TYPE_449 +VVV_78, // META_TILE_TYPE_450 +VVV_79, // META_TILE_TYPE_451 +VVV_80, // META_TILE_TYPE_452 +VVV_81, // META_TILE_TYPE_453 +VVV_82, // META_TILE_TYPE_454 +VVV_83, // META_TILE_TYPE_455 +VVV_63, // META_TILE_TYPE_456 +VVV_0, // META_TILE_TYPE_457 +VVV_63, // META_TILE_TYPE_458 +VVV_83, // META_TILE_TYPE_459 +VVV_83, // META_TILE_TYPE_460 +VVV_0, // META_TILE_TYPE_461 +VVV_0, // META_TILE_TYPE_462 +VVV_43, // META_TILE_TYPE_463 +VVV_43, // META_TILE_TYPE_464 +VVV_43, // META_TILE_TYPE_465 +VVV_0, // META_TILE_TYPE_466 +VVV_21, // META_TILE_TYPE_467 +VVV_21, // META_TILE_TYPE_468 +VVV_21, // META_TILE_TYPE_469 +VVV_21, // META_TILE_TYPE_470 +VVV_0, // META_TILE_TYPE_471 +VVV_0, // META_TILE_TYPE_472 +VVV_0, // META_TILE_TYPE_473 +VVV_0, // META_TILE_TYPE_474 +VVV_0, // META_TILE_TYPE_475 +VVV_0, // META_TILE_TYPE_476 +VVV_0, // META_TILE_TYPE_477 +VVV_0, // META_TILE_TYPE_478 +VVV_0, // META_TILE_TYPE_479 +VVV_0, // META_TILE_TYPE_480 +VVV_0, // META_TILE_TYPE_481 +VVV_0, // META_TILE_TYPE_482 +VVV_0, // META_TILE_TYPE_483 +VVV_0, // META_TILE_TYPE_484 +VVV_0, // META_TILE_TYPE_485 +VVV_0, // META_TILE_TYPE_486 +VVV_84, // META_TILE_TYPE_487 +VVV_0, // META_TILE_TYPE_488 +VVV_0, // META_TILE_TYPE_489 +VVV_0, // META_TILE_TYPE_490 +VVV_0, // META_TILE_TYPE_491 +VVV_0, // META_TILE_TYPE_492 +VVV_0, // META_TILE_TYPE_493 +VVV_0, // META_TILE_TYPE_494 +VVV_0, // META_TILE_TYPE_495 +VVV_0, // META_TILE_TYPE_496 +VVV_0, // META_TILE_TYPE_497 +VVV_0, // META_TILE_TYPE_498 +VVV_0, // META_TILE_TYPE_499 +VVV_0, // META_TILE_TYPE_500 +VVV_0, // META_TILE_TYPE_501 +VVV_0, // META_TILE_TYPE_502 +VVV_0, // META_TILE_TYPE_503 +VVV_0, // META_TILE_TYPE_504 +VVV_0, // META_TILE_TYPE_505 +VVV_0, // META_TILE_TYPE_506 +VVV_0, // META_TILE_TYPE_507 +VVV_0, // META_TILE_TYPE_508 +VVV_0, // META_TILE_TYPE_509 +VVV_0, // META_TILE_TYPE_510 +VVV_0, // META_TILE_TYPE_511 +VVV_0, // META_TILE_TYPE_512 +VVV_0, // META_TILE_TYPE_513 +VVV_0, // META_TILE_TYPE_514 +VVV_0, // META_TILE_TYPE_515 +VVV_0, // META_TILE_TYPE_516 +VVV_0, // META_TILE_TYPE_517 +VVV_0, // META_TILE_TYPE_518 +VVV_0, // META_TILE_TYPE_519 +VVV_0, // META_TILE_TYPE_520 +VVV_0, // META_TILE_TYPE_521 +VVV_0, // META_TILE_TYPE_522 +VVV_0, // META_TILE_TYPE_523 +VVV_40, // META_TILE_TYPE_524 +VVV_0, // META_TILE_TYPE_525 +VVV_0, // META_TILE_TYPE_526 +VVV_0, // META_TILE_TYPE_527 +VVV_0, // META_TILE_TYPE_528 +VVV_0, // META_TILE_TYPE_529 +VVV_0, // META_TILE_TYPE_530 +VVV_0, // META_TILE_TYPE_531 +VVV_0, // META_TILE_TYPE_532 +VVV_0, // META_TILE_TYPE_533 +VVV_0, // META_TILE_TYPE_534 +VVV_0, // META_TILE_TYPE_535 +VVV_0, // META_TILE_TYPE_536 +VVV_0, // META_TILE_TYPE_537 +VVV_0, // META_TILE_TYPE_538 +VVV_0, // META_TILE_TYPE_539 +VVV_0, // META_TILE_TYPE_540 +VVV_0, // META_TILE_TYPE_541 +VVV_0, // META_TILE_TYPE_542 +VVV_0, // META_TILE_TYPE_543 +VVV_0, // META_TILE_TYPE_544 +VVV_0, // META_TILE_TYPE_545 +VVV_0, // META_TILE_TYPE_546 +VVV_0, // META_TILE_TYPE_547 +VVV_0, // META_TILE_TYPE_548 +VVV_40, // META_TILE_TYPE_549 +VVV_0, // META_TILE_TYPE_550 +VVV_0, // META_TILE_TYPE_551 +VVV_0, // META_TILE_TYPE_552 +VVV_0, // META_TILE_TYPE_553 +VVV_0, // META_TILE_TYPE_554 +VVV_0, // META_TILE_TYPE_555 +VVV_0, // META_TILE_TYPE_556 +VVV_0, // META_TILE_TYPE_557 +VVV_0, // META_TILE_TYPE_558 +VVV_0, // META_TILE_TYPE_559 +VVV_0, // META_TILE_TYPE_560 +VVV_0, // META_TILE_TYPE_561 +VVV_16, // META_TILE_TYPE_562 +VVV_16, // META_TILE_TYPE_563 +VVV_16, // META_TILE_TYPE_564 +VVV_16, // META_TILE_TYPE_565 +VVV_16, // META_TILE_TYPE_566 +VVV_16, // META_TILE_TYPE_567 +VVV_16, // META_TILE_TYPE_568 +VVV_16, // META_TILE_TYPE_569 +VVV_16, // META_TILE_TYPE_570 +VVV_16, // META_TILE_TYPE_571 +VVV_16, // META_TILE_TYPE_572 +VVV_16, // META_TILE_TYPE_573 +VVV_16, // META_TILE_TYPE_574 +VVV_16, // META_TILE_TYPE_575 +VVV_16, // META_TILE_TYPE_576 +VVV_16, // META_TILE_TYPE_577 +VVV_16, // META_TILE_TYPE_578 +VVV_16, // META_TILE_TYPE_579 +VVV_16, // META_TILE_TYPE_580 +VVV_16, // META_TILE_TYPE_581 +VVV_16, // META_TILE_TYPE_582 +VVV_16, // META_TILE_TYPE_583 +VVV_16, // META_TILE_TYPE_584 +VVV_16, // META_TILE_TYPE_585 +VVV_16, // META_TILE_TYPE_586 +VVV_16, // META_TILE_TYPE_587 +VVV_16, // META_TILE_TYPE_588 +VVV_16, // META_TILE_TYPE_589 +VVV_85, // META_TILE_TYPE_590 +VVV_85, // META_TILE_TYPE_591 +VVV_85, // META_TILE_TYPE_592 +VVV_85, // META_TILE_TYPE_593 +VVV_85, // META_TILE_TYPE_594 +VVV_85, // META_TILE_TYPE_595 +VVV_85, // META_TILE_TYPE_596 +VVV_85, // META_TILE_TYPE_597 +VVV_85, // META_TILE_TYPE_598 +VVV_0, // META_TILE_TYPE_599 +VVV_0, // META_TILE_TYPE_600 +VVV_0, // META_TILE_TYPE_601 +VVV_0, // META_TILE_TYPE_602 +VVV_0, // META_TILE_TYPE_603 +VVV_0, // META_TILE_TYPE_604 +VVV_0, // META_TILE_TYPE_605 +VVV_0, // META_TILE_TYPE_606 +VVV_0, // META_TILE_TYPE_607 +VVV_0, // META_TILE_TYPE_608 +VVV_0, // META_TILE_TYPE_609 +VVV_9, // META_TILE_TYPE_610 +VVV_9, // META_TILE_TYPE_611 +VVV_0, // META_TILE_TYPE_612 +VVV_0, // META_TILE_TYPE_613 +VVV_0, // META_TILE_TYPE_614 +VVV_86, // META_TILE_TYPE_615 +VVV_0, // META_TILE_TYPE_616 +VVV_0, // META_TILE_TYPE_617 +VVV_86, // META_TILE_TYPE_618 +VVV_0, // META_TILE_TYPE_619 +VVV_0, // META_TILE_TYPE_620 +VVV_41, // META_TILE_TYPE_621 +VVV_0, // META_TILE_TYPE_622 +VVV_0, // META_TILE_TYPE_623 +VVV_41, // META_TILE_TYPE_624 +VVV_40, // META_TILE_TYPE_625 +VVV_0, // META_TILE_TYPE_626 +VVV_0, // META_TILE_TYPE_627 +VVV_0, // META_TILE_TYPE_628 +VVV_0, // META_TILE_TYPE_629 +VVV_0, // META_TILE_TYPE_630 +VVV_86, // META_TILE_TYPE_631 +VVV_0, // META_TILE_TYPE_632 +VVV_0, // META_TILE_TYPE_633 +VVV_86, // META_TILE_TYPE_634 +VVV_0, // META_TILE_TYPE_635 +VVV_0, // META_TILE_TYPE_636 +VVV_41, // META_TILE_TYPE_637 +VVV_0, // META_TILE_TYPE_638 +VVV_0, // META_TILE_TYPE_639 +VVV_41, // META_TILE_TYPE_640 +VVV_40, // META_TILE_TYPE_641 +VVV_0, // META_TILE_TYPE_642 +VVV_0, // META_TILE_TYPE_643 +VVV_0, // META_TILE_TYPE_644 +VVV_0, // META_TILE_TYPE_645 +VVV_0, // META_TILE_TYPE_646 +VVV_86, // META_TILE_TYPE_647 +VVV_0, // META_TILE_TYPE_648 +VVV_0, // META_TILE_TYPE_649 +VVV_86, // META_TILE_TYPE_650 +VVV_0, // META_TILE_TYPE_651 +VVV_0, // META_TILE_TYPE_652 +#ifdef EU +VVV_0, // META_TILE_TYPE_653 +#else +VVV_41, // META_TILE_TYPE_653 +#endif +VVV_0, // META_TILE_TYPE_654 +VVV_0, // META_TILE_TYPE_655 +#ifdef EU +VVV_0, // META_TILE_TYPE_656 +#else +VVV_41, // META_TILE_TYPE_656 +#endif +VVV_40, // META_TILE_TYPE_657 +VVV_0, // META_TILE_TYPE_658 +VVV_0, // META_TILE_TYPE_659 +VVV_0, // META_TILE_TYPE_660 +VVV_0, // META_TILE_TYPE_661 +VVV_86, // META_TILE_TYPE_662 +VVV_86, // META_TILE_TYPE_663 +VVV_86, // META_TILE_TYPE_664 +VVV_86, // META_TILE_TYPE_665 +VVV_86, // META_TILE_TYPE_666 +VVV_86, // META_TILE_TYPE_667 +VVV_86, // META_TILE_TYPE_668 +VVV_86, // META_TILE_TYPE_669 +VVV_86, // META_TILE_TYPE_670 +VVV_86, // META_TILE_TYPE_671 +VVV_86, // META_TILE_TYPE_672 +VVV_86, // META_TILE_TYPE_673 +VVV_86, // META_TILE_TYPE_674 +VVV_86, // META_TILE_TYPE_675 +VVV_86, // META_TILE_TYPE_676 +VVV_86, // META_TILE_TYPE_677 +VVV_86, // META_TILE_TYPE_678 +VVV_86, // META_TILE_TYPE_679 +VVV_86, // META_TILE_TYPE_680 +VVV_86, // META_TILE_TYPE_681 +VVV_86, // META_TILE_TYPE_682 +VVV_86, // META_TILE_TYPE_683 +VVV_86, // META_TILE_TYPE_684 +VVV_86, // META_TILE_TYPE_685 +VVV_86, // META_TILE_TYPE_686 +VVV_86, // META_TILE_TYPE_687 +VVV_86, // META_TILE_TYPE_688 +VVV_86, // META_TILE_TYPE_689 +VVV_86, // META_TILE_TYPE_690 +VVV_86, // META_TILE_TYPE_691 +VVV_86, // META_TILE_TYPE_692 +VVV_86, // META_TILE_TYPE_693 +VVV_86, // META_TILE_TYPE_694 +VVV_86, // META_TILE_TYPE_695 +VVV_86, // META_TILE_TYPE_696 +VVV_86, // META_TILE_TYPE_697 +VVV_86, // META_TILE_TYPE_698 +VVV_86, // META_TILE_TYPE_699 +VVV_86, // META_TILE_TYPE_700 +VVV_86, // META_TILE_TYPE_701 +VVV_86, // META_TILE_TYPE_702 +VVV_86, // META_TILE_TYPE_703 +VVV_86, // META_TILE_TYPE_704 +VVV_86, // META_TILE_TYPE_705 +VVV_86, // META_TILE_TYPE_706 +VVV_86, // META_TILE_TYPE_707 +VVV_86, // META_TILE_TYPE_708 +VVV_86, // META_TILE_TYPE_709 +VVV_86, // META_TILE_TYPE_710 +VVV_86, // META_TILE_TYPE_711 +VVV_86, // META_TILE_TYPE_712 +VVV_86, // META_TILE_TYPE_713 +VVV_86, // META_TILE_TYPE_714 +VVV_86, // META_TILE_TYPE_715 +VVV_86, // META_TILE_TYPE_716 +VVV_86, // META_TILE_TYPE_717 +VVV_86, // META_TILE_TYPE_718 +VVV_86, // META_TILE_TYPE_719 +VVV_86, // META_TILE_TYPE_720 +VVV_86, // META_TILE_TYPE_721 +VVV_86, // META_TILE_TYPE_722 +VVV_86, // META_TILE_TYPE_723 +VVV_86, // META_TILE_TYPE_724 +VVV_86, // META_TILE_TYPE_725 +VVV_86, // META_TILE_TYPE_726 +VVV_86, // META_TILE_TYPE_727 +VVV_86, // META_TILE_TYPE_728 +VVV_86, // META_TILE_TYPE_729 +VVV_86, // META_TILE_TYPE_730 +VVV_86, // META_TILE_TYPE_731 +VVV_86, // META_TILE_TYPE_732 +VVV_86, // META_TILE_TYPE_733 +VVV_86, // META_TILE_TYPE_734 +VVV_86, // META_TILE_TYPE_735 +VVV_86, // META_TILE_TYPE_736 +VVV_86, // META_TILE_TYPE_737 +VVV_86, // META_TILE_TYPE_738 +VVV_86, // META_TILE_TYPE_739 +VVV_86, // META_TILE_TYPE_740 +VVV_86, // META_TILE_TYPE_741 +VVV_86, // META_TILE_TYPE_742 +VVV_86, // META_TILE_TYPE_743 +VVV_86, // META_TILE_TYPE_744 +VVV_86, // META_TILE_TYPE_745 +VVV_86, // META_TILE_TYPE_746 +VVV_86, // META_TILE_TYPE_747 +VVV_86, // META_TILE_TYPE_748 +VVV_86, // META_TILE_TYPE_749 +VVV_86, // META_TILE_TYPE_750 +VVV_86, // META_TILE_TYPE_751 +VVV_86, // META_TILE_TYPE_752 +VVV_86, // META_TILE_TYPE_753 +VVV_10, // META_TILE_TYPE_754 +VVV_9, // META_TILE_TYPE_755 +VVV_10, // META_TILE_TYPE_756 +VVV_10, // META_TILE_TYPE_757 +VVV_13, // META_TILE_TYPE_758 +VVV_0, // META_TILE_TYPE_759 +VVV_0, // META_TILE_TYPE_760 +VVV_0, // META_TILE_TYPE_761 +VVV_0, // META_TILE_TYPE_762 +VVV_63, // META_TILE_TYPE_763 +VVV_0, // META_TILE_TYPE_764 +VVV_0, // META_TILE_TYPE_765 +VVV_0, // META_TILE_TYPE_766 +VVV_0, // META_TILE_TYPE_767 +VVV_0, // META_TILE_TYPE_768 +VVV_0, // META_TILE_TYPE_769 +VVV_0, // META_TILE_TYPE_770 +VVV_0, // META_TILE_TYPE_771 +VVV_0, // META_TILE_TYPE_772 +VVV_0, // META_TILE_TYPE_773 +VVV_0, // META_TILE_TYPE_774 +VVV_0, // META_TILE_TYPE_775 +VVV_0, // META_TILE_TYPE_776 +VVV_0, // META_TILE_TYPE_777 +VVV_0, // META_TILE_TYPE_778 +VVV_0, // META_TILE_TYPE_779 +VVV_0, // META_TILE_TYPE_780 +VVV_16, // META_TILE_TYPE_781 +VVV_16, // META_TILE_TYPE_782 +VVV_0, // META_TILE_TYPE_783 +VVV_12, // META_TILE_TYPE_784 +VVV_0, // META_TILE_TYPE_785 +VVV_0, // META_TILE_TYPE_786 +VVV_1, // META_TILE_TYPE_787 +VVV_24, // META_TILE_TYPE_788 +VVV_87, // META_TILE_TYPE_789 +VVV_88, // META_TILE_TYPE_790 +VVV_89, // META_TILE_TYPE_791 +VVV_89, // META_TILE_TYPE_792 +VVV_90, // META_TILE_TYPE_793 +VVV_91, // META_TILE_TYPE_794 +VVV_92, // META_TILE_TYPE_795 +VVV_93, // META_TILE_TYPE_796 +VVV_94, // META_TILE_TYPE_797 +VVV_95, // META_TILE_TYPE_798 +VVV_96, // META_TILE_TYPE_799 +VVV_0, // META_TILE_TYPE_800 +VVV_0, // META_TILE_TYPE_801 +VVV_0, // META_TILE_TYPE_802 +VVV_13, // META_TILE_TYPE_803 +VVV_13, // META_TILE_TYPE_804 +VVV_13, // META_TILE_TYPE_805 +VVV_13, // META_TILE_TYPE_806 +VVV_13, // META_TILE_TYPE_807 +VVV_13, // META_TILE_TYPE_808 +VVV_13, // META_TILE_TYPE_809 +VVV_13, // META_TILE_TYPE_810 +VVV_13, // META_TILE_TYPE_811 +VVV_13, // META_TILE_TYPE_812 +VVV_13, // META_TILE_TYPE_813 +VVV_13, // META_TILE_TYPE_814 +VVV_13, // META_TILE_TYPE_815 +VVV_13, // META_TILE_TYPE_816 +VVV_13, // META_TILE_TYPE_817 +VVV_13, // META_TILE_TYPE_818 +VVV_13, // META_TILE_TYPE_819 +VVV_13, // META_TILE_TYPE_820 +VVV_13, // META_TILE_TYPE_821 +VVV_13, // META_TILE_TYPE_822 +VVV_13, // META_TILE_TYPE_823 +VVV_13, // META_TILE_TYPE_824 +VVV_13, // META_TILE_TYPE_825 +VVV_13, // META_TILE_TYPE_826 +VVV_13, // META_TILE_TYPE_827 +VVV_13, // META_TILE_TYPE_828 +VVV_13, // META_TILE_TYPE_829 +VVV_13, // META_TILE_TYPE_830 +VVV_13, // META_TILE_TYPE_831 +VVV_13, // META_TILE_TYPE_832 +VVV_12, // META_TILE_TYPE_833 +VVV_12, // META_TILE_TYPE_834 +VVV_12, // META_TILE_TYPE_835 +VVV_12, // META_TILE_TYPE_836 +VVV_12, // META_TILE_TYPE_837 +VVV_12, // META_TILE_TYPE_838 +VVV_97, // META_TILE_TYPE_839 +VVV_97, // META_TILE_TYPE_840 +VVV_97, // META_TILE_TYPE_841 +VVV_97, // META_TILE_TYPE_842 +VVV_98, // META_TILE_TYPE_843 +VVV_98, // META_TILE_TYPE_844 +VVV_0, // META_TILE_TYPE_845 +VVV_0, // META_TILE_TYPE_846 +VVV_99, // META_TILE_TYPE_847 +VVV_99, // META_TILE_TYPE_848 +VVV_99, // META_TILE_TYPE_849 +VVV_99, // META_TILE_TYPE_850 +VVV_100, // META_TILE_TYPE_851 +VVV_0, // META_TILE_TYPE_852 +VVV_101, // META_TILE_TYPE_853 +VVV_102, // META_TILE_TYPE_854 +VVV_103, // META_TILE_TYPE_855 +VVV_104, // META_TILE_TYPE_856 +VVV_105, // META_TILE_TYPE_857 +VVV_106, // META_TILE_TYPE_858 +VVV_107, // META_TILE_TYPE_859 +VVV_108, // META_TILE_TYPE_860 +VVV_109, // META_TILE_TYPE_861 +VVV_110, // META_TILE_TYPE_862 +VVV_111, // META_TILE_TYPE_863 +VVV_112, // META_TILE_TYPE_864 +VVV_112, // META_TILE_TYPE_865 +VVV_112, // META_TILE_TYPE_866 +VVV_112, // META_TILE_TYPE_867 +VVV_112, // META_TILE_TYPE_868 +VVV_0, // META_TILE_TYPE_869 +VVV_113, // META_TILE_TYPE_870 +VVV_46, // META_TILE_TYPE_871 +VVV_46, // META_TILE_TYPE_872 +VVV_114, // META_TILE_TYPE_873 +VVV_114, // META_TILE_TYPE_874 +VVV_114, // META_TILE_TYPE_875 +VVV_114, // META_TILE_TYPE_876 +VVV_114, // META_TILE_TYPE_877 +VVV_114, // META_TILE_TYPE_878 +VVV_114, // META_TILE_TYPE_879 +VVV_114, // META_TILE_TYPE_880 +VVV_114, // META_TILE_TYPE_881 +VVV_114, // META_TILE_TYPE_882 +VVV_114, // META_TILE_TYPE_883 +VVV_114, // META_TILE_TYPE_884 +VVV_114, // META_TILE_TYPE_885 +VVV_114, // META_TILE_TYPE_886 +VVV_115, // META_TILE_TYPE_887 +VVV_115, // META_TILE_TYPE_888 +VVV_0, // META_TILE_TYPE_889 +VVV_0, // META_TILE_TYPE_890 +VVV_0, // META_TILE_TYPE_891 +VVV_0, // META_TILE_TYPE_892 +VVV_0, // META_TILE_TYPE_893 +VVV_0, // META_TILE_TYPE_894 +VVV_0, // META_TILE_TYPE_895 +VVV_0, // META_TILE_TYPE_896 +VVV_0, // META_TILE_TYPE_897 +VVV_0, // META_TILE_TYPE_898 +VVV_0, // META_TILE_TYPE_899 +VVV_0, // META_TILE_TYPE_900 +VVV_0, // META_TILE_TYPE_901 +VVV_0, // META_TILE_TYPE_902 +VVV_0, // META_TILE_TYPE_903 +VVV_0, // META_TILE_TYPE_904 +VVV_0, // META_TILE_TYPE_905 +VVV_0, // META_TILE_TYPE_906 +VVV_0, // META_TILE_TYPE_907 +VVV_0, // META_TILE_TYPE_908 +VVV_0, // META_TILE_TYPE_909 +VVV_0, // META_TILE_TYPE_910 +VVV_0, // META_TILE_TYPE_911 +VVV_0, // META_TILE_TYPE_912 +VVV_0, // META_TILE_TYPE_913 +VVV_0, // META_TILE_TYPE_914 +VVV_0, // META_TILE_TYPE_915 +VVV_42, // META_TILE_TYPE_916 +VVV_43, // META_TILE_TYPE_917 +VVV_44, // META_TILE_TYPE_918 +VVV_45, // META_TILE_TYPE_919 +VVV_0, // META_TILE_TYPE_920 +VVV_0, // META_TILE_TYPE_921 +VVV_0, // META_TILE_TYPE_922 +VVV_0, // META_TILE_TYPE_923 +VVV_0, // META_TILE_TYPE_924 +VVV_0, // META_TILE_TYPE_925 +VVV_0, // META_TILE_TYPE_926 +VVV_0, // META_TILE_TYPE_927 +VVV_0, // META_TILE_TYPE_928 +VVV_116, // META_TILE_TYPE_929 +VVV_116, // META_TILE_TYPE_930 +VVV_116, // META_TILE_TYPE_931 +VVV_0, // META_TILE_TYPE_932 +VVV_0, // META_TILE_TYPE_933 +VVV_0, // META_TILE_TYPE_934 +VVV_0, // META_TILE_TYPE_935 +VVV_43, // META_TILE_TYPE_936 +VVV_42, // META_TILE_TYPE_937 +VVV_45, // META_TILE_TYPE_938 +VVV_44, // META_TILE_TYPE_939 +VVV_117, // META_TILE_TYPE_940 +VVV_0, // META_TILE_TYPE_941 +VVV_82, // META_TILE_TYPE_942 +VVV_0, // META_TILE_TYPE_943 +VVV_0, // META_TILE_TYPE_944 +VVV_0, // META_TILE_TYPE_945 +VVV_0, // META_TILE_TYPE_946 +VVV_0, // META_TILE_TYPE_947 +VVV_0, // META_TILE_TYPE_948 +VVV_43, // META_TILE_TYPE_949 +VVV_42, // META_TILE_TYPE_950 +VVV_0, // META_TILE_TYPE_951 +VVV_0, // META_TILE_TYPE_952 +VVV_44, // META_TILE_TYPE_953 +VVV_0, // META_TILE_TYPE_954 +VVV_0, // META_TILE_TYPE_955 +VVV_45, // META_TILE_TYPE_956 +VVV_0, // META_TILE_TYPE_957 +VVV_0, // META_TILE_TYPE_958 +VVV_0, // META_TILE_TYPE_959 +VVV_0, // META_TILE_TYPE_960 +VVV_41, // META_TILE_TYPE_961 +VVV_40, // META_TILE_TYPE_962 +VVV_38, // META_TILE_TYPE_963 +VVV_38, // META_TILE_TYPE_964 +VVV_116, // META_TILE_TYPE_965 +VVV_116, // META_TILE_TYPE_966 +VVV_116, // META_TILE_TYPE_967 +VVV_116, // META_TILE_TYPE_968 +VVV_116, // META_TILE_TYPE_969 +VVV_116, // META_TILE_TYPE_970 +VVV_116, // META_TILE_TYPE_971 +VVV_116, // META_TILE_TYPE_972 +VVV_116, // META_TILE_TYPE_973 +VVV_116, // META_TILE_TYPE_974 +VVV_116, // META_TILE_TYPE_975 +VVV_116, // META_TILE_TYPE_976 +VVV_116, // META_TILE_TYPE_977 +VVV_90, // META_TILE_TYPE_978 +VVV_41, // META_TILE_TYPE_979 +VVV_41, // META_TILE_TYPE_980 +VVV_41, // META_TILE_TYPE_981 +VVV_12, // META_TILE_TYPE_982 +VVV_0, // META_TILE_TYPE_983 +VVV_12, // META_TILE_TYPE_984 +VVV_12, // META_TILE_TYPE_985 +VVV_41, // META_TILE_TYPE_986 +VVV_41, // META_TILE_TYPE_987 +VVV_116, // META_TILE_TYPE_988 +VVV_0, // META_TILE_TYPE_989 +VVV_0, // META_TILE_TYPE_990 +VVV_10, // META_TILE_TYPE_991 +VVV_0, // META_TILE_TYPE_992 +VVV_0, // META_TILE_TYPE_993 +VVV_0, // META_TILE_TYPE_994 +VVV_0, // META_TILE_TYPE_995 +VVV_0, // META_TILE_TYPE_996 +VVV_0, // META_TILE_TYPE_997 +VVV_40, // META_TILE_TYPE_998 +VVV_0, // META_TILE_TYPE_999 +VVV_0, // META_TILE_TYPE_1000 +VVV_0, // META_TILE_TYPE_1001 +VVV_40, // META_TILE_TYPE_1002 +VVV_0, // META_TILE_TYPE_1003 +VVV_10, // META_TILE_TYPE_1004 +VVV_10, // META_TILE_TYPE_1005 +VVV_10, // META_TILE_TYPE_1006 +VVV_10, // META_TILE_TYPE_1007 +VVV_10, // META_TILE_TYPE_1008 +VVV_10, // META_TILE_TYPE_1009 +VVV_10, // META_TILE_TYPE_1010 +VVV_40, // META_TILE_TYPE_1011 +VVV_40, // META_TILE_TYPE_1012 +VVV_84, // META_TILE_TYPE_1013 +VVV_84, // META_TILE_TYPE_1014 +VVV_84, // META_TILE_TYPE_1015 +VVV_84, // META_TILE_TYPE_1016 +VVV_0, // META_TILE_TYPE_1017 +VVV_61, // META_TILE_TYPE_1018 +VVV_61, // META_TILE_TYPE_1019 +VVV_61, // META_TILE_TYPE_1020 +VVV_61, // META_TILE_TYPE_1021 +VVV_61, // META_TILE_TYPE_1022 +VVV_61, // META_TILE_TYPE_1023 +VVV_61, // META_TILE_TYPE_1024 +VVV_61, // META_TILE_TYPE_1025 +VVV_62, // META_TILE_TYPE_1026 +VVV_62, // META_TILE_TYPE_1027 +VVV_62, // META_TILE_TYPE_1028 +VVV_62, // META_TILE_TYPE_1029 +VVV_62, // META_TILE_TYPE_1030 +VVV_62, // META_TILE_TYPE_1031 +VVV_62, // META_TILE_TYPE_1032 +VVV_62, // META_TILE_TYPE_1033 +VVV_9, // META_TILE_TYPE_1034 +VVV_9, // META_TILE_TYPE_1035 +VVV_9, // META_TILE_TYPE_1036 +VVV_9, // META_TILE_TYPE_1037 +VVV_9, // META_TILE_TYPE_1038 +VVV_9, // META_TILE_TYPE_1039 +VVV_9, // META_TILE_TYPE_1040 +VVV_9, // META_TILE_TYPE_1041 +VVV_9, // META_TILE_TYPE_1042 +VVV_9, // META_TILE_TYPE_1043 +VVV_9, // META_TILE_TYPE_1044 +VVV_9, // META_TILE_TYPE_1045 +VVV_9, // META_TILE_TYPE_1046 +VVV_9, // META_TILE_TYPE_1047 +VVV_9, // META_TILE_TYPE_1048 +VVV_9, // META_TILE_TYPE_1049 +VVV_9, // META_TILE_TYPE_1050 +VVV_42, // META_TILE_TYPE_1051 +VVV_10, // META_TILE_TYPE_1052 +VVV_10, // META_TILE_TYPE_1053 +VVV_10, // META_TILE_TYPE_1054 +VVV_10, // META_TILE_TYPE_1055 +VVV_10, // META_TILE_TYPE_1056 +VVV_10, // META_TILE_TYPE_1057 +VVV_15, // META_TILE_TYPE_1058 +VVV_10, // META_TILE_TYPE_1059 +VVV_42, // META_TILE_TYPE_1060 +VVV_13, // META_TILE_TYPE_1061 +VVV_0, // META_TILE_TYPE_1062 +VVV_42, // META_TILE_TYPE_1063 +VVV_0, // META_TILE_TYPE_1064 +VVV_0, // META_TILE_TYPE_1065 +VVV_0, // META_TILE_TYPE_1066 +VVV_0, // META_TILE_TYPE_1067 +VVV_16, // META_TILE_TYPE_1068 +VVV_16, // META_TILE_TYPE_1069 +VVV_16, // META_TILE_TYPE_1070 +VVV_16, // META_TILE_TYPE_1071 +VVV_16, // META_TILE_TYPE_1072 +VVV_16, // META_TILE_TYPE_1073 +VVV_16, // META_TILE_TYPE_1074 +VVV_16, // META_TILE_TYPE_1075 +VVV_16, // META_TILE_TYPE_1076 +VVV_9, // META_TILE_TYPE_1077 +VVV_9, // META_TILE_TYPE_1078 +VVV_9, // META_TILE_TYPE_1079 +VVV_56, // META_TILE_TYPE_1080 +VVV_10, // META_TILE_TYPE_1081 +VVV_42, // META_TILE_TYPE_1082 +VVV_0, // META_TILE_TYPE_1083 +VVV_10, // META_TILE_TYPE_1084 +VVV_79, // META_TILE_TYPE_1085 +VVV_77, // META_TILE_TYPE_1086 +VVV_0, // META_TILE_TYPE_1087 +VVV_0, // META_TILE_TYPE_1088 +VVV_0, // META_TILE_TYPE_1089 +VVV_0, // META_TILE_TYPE_1090 +VVV_10, // META_TILE_TYPE_1091 +VVV_0, // META_TILE_TYPE_1092 +VVV_0, // META_TILE_TYPE_1093 +VVV_0, // META_TILE_TYPE_1094 +VVV_78, // META_TILE_TYPE_1095 +VVV_78, // META_TILE_TYPE_1096 +VVV_12, // META_TILE_TYPE_1097 +VVV_12, // META_TILE_TYPE_1098 +VVV_12, // META_TILE_TYPE_1099 +VVV_12, // META_TILE_TYPE_1100 +VVV_61, // META_TILE_TYPE_1101 +VVV_61, // META_TILE_TYPE_1102 +VVV_61, // META_TILE_TYPE_1103 +VVV_40, // META_TILE_TYPE_1104 +VVV_12, // META_TILE_TYPE_1105 +VVV_40, // META_TILE_TYPE_1106 +VVV_10, // META_TILE_TYPE_1107 +VVV_10, // META_TILE_TYPE_1108 +VVV_10, // META_TILE_TYPE_1109 +VVV_0, // META_TILE_TYPE_1110 +VVV_0, // META_TILE_TYPE_1111 +VVV_39, // META_TILE_TYPE_1112 +VVV_39, // META_TILE_TYPE_1113 +VVV_39, // META_TILE_TYPE_1114 +VVV_39, // META_TILE_TYPE_1115 +VVV_39, // META_TILE_TYPE_1116 +VVV_39, // META_TILE_TYPE_1117 +VVV_38, // META_TILE_TYPE_1118 +VVV_38, // META_TILE_TYPE_1119 +VVV_52, // META_TILE_TYPE_1120 +VVV_52, // META_TILE_TYPE_1121 +VVV_12, // META_TILE_TYPE_1122 +VVV_55, // META_TILE_TYPE_1123 +VVV_0, // META_TILE_TYPE_1124 +VVV_0, // META_TILE_TYPE_1125 +VVV_0, // META_TILE_TYPE_1126 +VVV_0, // META_TILE_TYPE_1127 +VVV_0, // META_TILE_TYPE_1128 +VVV_54, // META_TILE_TYPE_1129 +VVV_0, // META_TILE_TYPE_1130 +VVV_0, // META_TILE_TYPE_1131 +VVV_0, // META_TILE_TYPE_1132 +VVV_0, // META_TILE_TYPE_1133 +VVV_40, // META_TILE_TYPE_1134 +VVV_53, // META_TILE_TYPE_1135 +VVV_53, // META_TILE_TYPE_1136 +VVV_40, // META_TILE_TYPE_1137 +VVV_55, // META_TILE_TYPE_1138 +VVV_12, // META_TILE_TYPE_1139 +VVV_0, // META_TILE_TYPE_1140 +VVV_12, // META_TILE_TYPE_1141 +VVV_12, // META_TILE_TYPE_1142 +VVV_12, // META_TILE_TYPE_1143 +VVV_12, // META_TILE_TYPE_1144 +VVV_12, // META_TILE_TYPE_1145 +VVV_54, // META_TILE_TYPE_1146 +VVV_13, // META_TILE_TYPE_1147 +VVV_40, // META_TILE_TYPE_1148 +VVV_0, // META_TILE_TYPE_1149 +VVV_0, // META_TILE_TYPE_1150 +VVV_0, // META_TILE_TYPE_1151 +VVV_52, // META_TILE_TYPE_1152 +VVV_52, // META_TILE_TYPE_1153 +VVV_52, // META_TILE_TYPE_1154 +VVV_10, // META_TILE_TYPE_1155 +VVV_10, // META_TILE_TYPE_1156 +VVV_0, // META_TILE_TYPE_1157 +VVV_0, // META_TILE_TYPE_1158 +VVV_0, // META_TILE_TYPE_1159 +VVV_0, // META_TILE_TYPE_1160 +VVV_40, // META_TILE_TYPE_1161 +VVV_15, // META_TILE_TYPE_1162 +VVV_15, // META_TILE_TYPE_1163 +VVV_51, // META_TILE_TYPE_1164 +VVV_16, // META_TILE_TYPE_1165 +VVV_10, // META_TILE_TYPE_1166 +VVV_10, // META_TILE_TYPE_1167 +VVV_16, // META_TILE_TYPE_1168 +VVV_16, // META_TILE_TYPE_1169 +VVV_10, // META_TILE_TYPE_1170 +VVV_10, // META_TILE_TYPE_1171 +VVV_10, // META_TILE_TYPE_1172 +VVV_10, // META_TILE_TYPE_1173 +VVV_0, // META_TILE_TYPE_1174 +VVV_0, // META_TILE_TYPE_1175 +VVV_15, // META_TILE_TYPE_1176 +VVV_9, // META_TILE_TYPE_1177 +VVV_14, // META_TILE_TYPE_1178 +VVV_15, // META_TILE_TYPE_1179 +VVV_14, // META_TILE_TYPE_1180 +VVV_15, // META_TILE_TYPE_1181 +VVV_15, // META_TILE_TYPE_1182 +VVV_15, // META_TILE_TYPE_1183 +VVV_0, // META_TILE_TYPE_1184 +VVV_0, // META_TILE_TYPE_1185 +VVV_0, // META_TILE_TYPE_1186 +VVV_0, // META_TILE_TYPE_1187 +VVV_0, // META_TILE_TYPE_1188 +VVV_0, // META_TILE_TYPE_1189 +VVV_0, // META_TILE_TYPE_1190 +VVV_0, // META_TILE_TYPE_1191 +VVV_0, // META_TILE_TYPE_1192 +VVV_0, // META_TILE_TYPE_1193 +VVV_116, // META_TILE_TYPE_1194 +VVV_116, // META_TILE_TYPE_1195 +VVV_116, // META_TILE_TYPE_1196 +VVV_116, // META_TILE_TYPE_1197 +VVV_116, // META_TILE_TYPE_1198 +VVV_116, // META_TILE_TYPE_1199 +VVV_116, // META_TILE_TYPE_1200 +VVV_116, // META_TILE_TYPE_1201 +VVV_116, // META_TILE_TYPE_1202 +VVV_116, // META_TILE_TYPE_1203 +VVV_116, // META_TILE_TYPE_1204 +VVV_116, // META_TILE_TYPE_1205 +VVV_116, // META_TILE_TYPE_1206 +VVV_15, // META_TILE_TYPE_1207 +VVV_40, // META_TILE_TYPE_1208 +VVV_15, // META_TILE_TYPE_1209 +VVV_40, // META_TILE_TYPE_1210 +VVV_40, // META_TILE_TYPE_1211 +VVV_15, // META_TILE_TYPE_1212 +VVV_12, // META_TILE_TYPE_1213 +VVV_12, // META_TILE_TYPE_1214 +VVV_12, // META_TILE_TYPE_1215 +VVV_12, // META_TILE_TYPE_1216 +VVV_12, // META_TILE_TYPE_1217 +VVV_25, // META_TILE_TYPE_1218 +VVV_40, // META_TILE_TYPE_1219 +VVV_40, // META_TILE_TYPE_1220 +VVV_40, // META_TILE_TYPE_1221 +VVV_0, // META_TILE_TYPE_1222 +VVV_16, // META_TILE_TYPE_1223 +VVV_16, // META_TILE_TYPE_1224 +VVV_116, // META_TILE_TYPE_1225 +VVV_0, // META_TILE_TYPE_1226 +VVV_0, // META_TILE_TYPE_1227 +VVV_12, // META_TILE_TYPE_1228 +VVV_45, // META_TILE_TYPE_1229 +VVV_0, // META_TILE_TYPE_1230 +VVV_40, // META_TILE_TYPE_1231 +VVV_40, // META_TILE_TYPE_1232 +VVV_43, // META_TILE_TYPE_1233 +VVV_25, // META_TILE_TYPE_1234 +VVV_0, // META_TILE_TYPE_1235 +VVV_10, // META_TILE_TYPE_1236 +VVV_0, // META_TILE_TYPE_1237 +VVV_40, // META_TILE_TYPE_1238 +VVV_0, // META_TILE_TYPE_1239 +VVV_43, // META_TILE_TYPE_1240 +VVV_43, // META_TILE_TYPE_1241 +VVV_43, // META_TILE_TYPE_1242 +VVV_0, // META_TILE_TYPE_1243 +VVV_42, // META_TILE_TYPE_1244 +VVV_42, // META_TILE_TYPE_1245 +VVV_42, // META_TILE_TYPE_1246 +VVV_42, // META_TILE_TYPE_1247 +VVV_0, // META_TILE_TYPE_1248 +VVV_116, // META_TILE_TYPE_1249 +VVV_116, // META_TILE_TYPE_1250 +VVV_116, // META_TILE_TYPE_1251 +VVV_116, // META_TILE_TYPE_1252 +VVV_116, // META_TILE_TYPE_1253 +VVV_116, // META_TILE_TYPE_1254 +VVV_116, // META_TILE_TYPE_1255 +VVV_116, // META_TILE_TYPE_1256 +VVV_116, // META_TILE_TYPE_1257 +VVV_116, // META_TILE_TYPE_1258 +VVV_116, // META_TILE_TYPE_1259 +VVV_44, // META_TILE_TYPE_1260 +VVV_42, // META_TILE_TYPE_1261 +VVV_42, // META_TILE_TYPE_1262 +VVV_0, // META_TILE_TYPE_1263 +VVV_38, // META_TILE_TYPE_1264 +VVV_38, // META_TILE_TYPE_1265 +VVV_0, // META_TILE_TYPE_1266 +VVV_0, // META_TILE_TYPE_1267 +VVV_0, // META_TILE_TYPE_1268 +VVV_0, // META_TILE_TYPE_1269 +VVV_0, // META_TILE_TYPE_1270 +VVV_0, // META_TILE_TYPE_1271 +VVV_0, // META_TILE_TYPE_1272 +VVV_0, // META_TILE_TYPE_1273 +VVV_0, // META_TILE_TYPE_1274 +VVV_63, // META_TILE_TYPE_1275 +VVV_83, // META_TILE_TYPE_1276 +VVV_0, // META_TILE_TYPE_1277 +VVV_0, // META_TILE_TYPE_1278 +VVV_0, // META_TILE_TYPE_1279 +VVV_0, // META_TILE_TYPE_1280 +VVV_38, // META_TILE_TYPE_1281 +VVV_38, // META_TILE_TYPE_1282 +VVV_40, // META_TILE_TYPE_1283 +VVV_12, // META_TILE_TYPE_1284 +VVV_12, // META_TILE_TYPE_1285 +VVV_12, // META_TILE_TYPE_1286 +VVV_12, // META_TILE_TYPE_1287 +VVV_12, // META_TILE_TYPE_1288 +VVV_12, // META_TILE_TYPE_1289 +VVV_12, // META_TILE_TYPE_1290 +VVV_12, // META_TILE_TYPE_1291 +VVV_12, // META_TILE_TYPE_1292 +VVV_12, // META_TILE_TYPE_1293 +VVV_12, // META_TILE_TYPE_1294 +VVV_41, // META_TILE_TYPE_1295 +VVV_41, // META_TILE_TYPE_1296 +VVV_38, // META_TILE_TYPE_1297 +VVV_38, // META_TILE_TYPE_1298 +VVV_12, // META_TILE_TYPE_1299 +VVV_12, // META_TILE_TYPE_1300 +VVV_41, // META_TILE_TYPE_1301 +VVV_41, // META_TILE_TYPE_1302 +VVV_12, // META_TILE_TYPE_1303 +VVV_12, // META_TILE_TYPE_1304 +VVV_116, // META_TILE_TYPE_1305 +VVV_116, // META_TILE_TYPE_1306 +VVV_116, // META_TILE_TYPE_1307 +VVV_116, // META_TILE_TYPE_1308 +VVV_116, // META_TILE_TYPE_1309 +VVV_0, // META_TILE_TYPE_1310 +VVV_0, // META_TILE_TYPE_1311 +VVV_40, // META_TILE_TYPE_1312 +VVV_0, // META_TILE_TYPE_1313 +VVV_0, // META_TILE_TYPE_1314 +VVV_43, // META_TILE_TYPE_1315 +VVV_42, // META_TILE_TYPE_1316 +VVV_0, // META_TILE_TYPE_1317 +VVV_0, // META_TILE_TYPE_1318 +VVV_44, // META_TILE_TYPE_1319 +VVV_13, // META_TILE_TYPE_1320 +VVV_40, // META_TILE_TYPE_1321 +VVV_40, // META_TILE_TYPE_1322 +VVV_42, // META_TILE_TYPE_1323 +VVV_44, // META_TILE_TYPE_1324 +VVV_45, // META_TILE_TYPE_1325 +VVV_44, // META_TILE_TYPE_1326 +VVV_45, // META_TILE_TYPE_1327 +VVV_44, // META_TILE_TYPE_1328 +VVV_45, // META_TILE_TYPE_1329 +VVV_42, // META_TILE_TYPE_1330 +VVV_42, // META_TILE_TYPE_1331 +VVV_42, // META_TILE_TYPE_1332 +VVV_43, // META_TILE_TYPE_1333 +VVV_43, // META_TILE_TYPE_1334 +VVV_43, // META_TILE_TYPE_1335 +VVV_100, // META_TILE_TYPE_1336 +VVV_101, // META_TILE_TYPE_1337 +VVV_104, // META_TILE_TYPE_1338 +VVV_106, // META_TILE_TYPE_1339 +VVV_102, // META_TILE_TYPE_1340 +VVV_107, // META_TILE_TYPE_1341 +VVV_105, // META_TILE_TYPE_1342 +VVV_103, // META_TILE_TYPE_1343 +VVV_0, // META_TILE_TYPE_1344 +VVV_14, // META_TILE_TYPE_1345 +VVV_14, // META_TILE_TYPE_1346 +VVV_41, // META_TILE_TYPE_1347 +VVV_40, // META_TILE_TYPE_1348 +#ifdef EU +VVV_0, // META_TILE_TYPE_1349 +VVV_0, // META_TILE_TYPE_1350 +#else +VVV_41, // META_TILE_TYPE_1349 +VVV_41, // META_TILE_TYPE_1350 +#endif +VVV_40, // META_TILE_TYPE_1351 +#ifdef EU +VVV_0, // META_TILE_TYPE_1352 +#else +VVV_41, // META_TILE_TYPE_1352 +#endif +VVV_40, // META_TILE_TYPE_1353 +#ifdef EU +VVV_0, // META_TILE_TYPE_1354 +#else +VVV_41, // META_TILE_TYPE_1354 +#endif +VVV_17, // META_TILE_TYPE_1355 +VVV_15, // META_TILE_TYPE_1356 +VVV_0, // META_TILE_TYPE_1357 +VVV_116, // META_TILE_TYPE_1358 +VVV_43, // META_TILE_TYPE_1359 +VVV_63, // META_TILE_TYPE_1360 +VVV_35, // META_TILE_TYPE_1361 +VVV_35, // META_TILE_TYPE_1362 +VVV_35, // META_TILE_TYPE_1363 +VVV_35, // META_TILE_TYPE_1364 +VVV_116, // META_TILE_TYPE_1365 +VVV_116, // META_TILE_TYPE_1366 +VVV_0, // META_TILE_TYPE_1367 +VVV_42, // META_TILE_TYPE_1368 +VVV_42, // META_TILE_TYPE_1369 +VVV_0, // META_TILE_TYPE_1370 +VVV_0, // META_TILE_TYPE_1371 +VVV_0, // META_TILE_TYPE_1372 +VVV_10, // META_TILE_TYPE_1373 +VVV_40, // META_TILE_TYPE_1374 +VVV_40, // META_TILE_TYPE_1375 +VVV_40, // META_TILE_TYPE_1376 +VVV_40, // META_TILE_TYPE_1377 +VVV_40, // META_TILE_TYPE_1378 +VVV_40, // META_TILE_TYPE_1379 +VVV_40, // META_TILE_TYPE_1380 +VVV_40, // META_TILE_TYPE_1381 +VVV_40, // META_TILE_TYPE_1382 +VVV_40, // META_TILE_TYPE_1383 +VVV_40, // META_TILE_TYPE_1384 +VVV_40, // META_TILE_TYPE_1385 +VVV_0, // META_TILE_TYPE_1386 +VVV_0, // META_TILE_TYPE_1387 +VVV_44, // META_TILE_TYPE_1388 +VVV_43, // META_TILE_TYPE_1389 +VVV_40, // META_TILE_TYPE_1390 +VVV_40, // META_TILE_TYPE_1391 +VVV_40, // META_TILE_TYPE_1392 +VVV_116, // META_TILE_TYPE_1393 +VVV_0, // META_TILE_TYPE_1394 +VVV_0, // META_TILE_TYPE_1395 + +}; \ No newline at end of file diff --git a/src/cutscene.c b/src/cutscene.c index 2cd3755b..fbb2aa96 100644 --- a/src/cutscene.c +++ b/src/cutscene.c @@ -595,10 +595,10 @@ void sub_08053D34(void) { if (gMenu.field_0xa != 0) { gMenu.field_0xa = 0; if (CheckLocalFlagByBank(FLAG_BANK_7, 0x3d)) { - SetTileType(0x74, 0xc4, 1); + SetMetaTileType(0x74, 0xc4, 1); } if (CheckLocalFlagByBank(FLAG_BANK_7, 0x3e)) { - SetTileType(0x74, 0xcc, 1); + SetMetaTileType(0x74, 0xcc, 1); } } if (gFadeControl.active == 0) { diff --git a/src/enemy/armos.c b/src/enemy/armos.c index e4fa4af1..c7148123 100644 --- a/src/enemy/armos.c +++ b/src/enemy/armos.c @@ -6,13 +6,14 @@ */ #define NENT_DEPRECATED -#include "global.h" -#include "enemy.h" -#include "functions.h" -#include "hitbox.h" -#include "common.h" -#include "flags.h" #include "collision.h" +#include "common.h" +#include "enemy.h" +#include "flags.h" +#include "functions.h" +#include "global.h" +#include "hitbox.h" +#include "tiles.h" typedef struct { /*0x00*/ Entity base; @@ -404,19 +405,18 @@ void sub_080307D4(ArmosEntity* this) { } void sub_080307EC(ArmosEntity* this) { - u32 position = COORD_TO_TILE(super); - this->unk_78 = GetTileIndex(position, super->collisionLayer); - SetTile(0x4022, position, (u32)super->collisionLayer); + u32 metaTilePos = COORD_TO_TILE(super); + this->unk_78 = GetMetaTileIndex(metaTilePos, super->collisionLayer); + SetMetaTile(SPECIAL_META_TILE_34, metaTilePos, (u32)super->collisionLayer); } void sub_08030834(ArmosEntity* this) { - SetTile(this->unk_78, COORD_TO_TILE(super), super->collisionLayer); + SetMetaTile(this->unk_78, COORD_TO_TILE(super), super->collisionLayer); } bool32 sub_0803086C(ArmosEntity* this) { u32 uVar2; - u32 pos; - u32 pos2; + u32 metaTilePos; u16 centerY; u16 centerX; FORCE_REGISTER(u32 r2, r2); @@ -426,10 +426,10 @@ bool32 sub_0803086C(ArmosEntity* this) { centerX = super->x.HALF_U.HI - gRoomControls.origin_x; centerY = super->y.HALF_U.HI - gRoomControls.origin_y; // TODO for some reason the 0x3f of COORD_TO_TILE(super) needs to be forced to r2 here. - pos = ((((((super)->x.HALF.HI) - gRoomControls.origin_x) >> 4) & (r2 = 0x3f)) | + metaTilePos = ((((((super)->x.HALF.HI) - gRoomControls.origin_x) >> 4) & (r2 = 0x3f)) | (((((super)->y.HALF.HI) - gRoomControls.origin_y) >> 4) & r2) << 6); - if (GetTileType(pos, super->collisionLayer) == 0x4049) { + if (GetMetaTileType(metaTilePos, super->collisionLayer) == SPECIAL_META_TILE_73) { if (CheckPlayerInRegion(centerX, centerY, 2, 0xc) != 0) { if (CheckPlayerInRegion(centerX, centerY - 4, 2, 4) != 0) { gPlayerEntity.spritePriority.b0 = 3; @@ -438,11 +438,11 @@ bool32 sub_0803086C(ArmosEntity* this) { return TRUE; } } else { - SetTile(0x4022, pos, super->collisionLayer); + SetMetaTile(SPECIAL_META_TILE_34, metaTilePos, super->collisionLayer); } } else { if (CheckPlayerInRegion(centerX, centerY + 6, 2, 5) != 0) { - SetTile(0x4049, COORD_TO_TILE(super), super->collisionLayer); + SetMetaTile(SPECIAL_META_TILE_73, COORD_TO_TILE(super), super->collisionLayer); } } } diff --git a/src/enemy/bombPeahat.c b/src/enemy/bombPeahat.c index 976d4802..c8d4a14b 100644 --- a/src/enemy/bombPeahat.c +++ b/src/enemy/bombPeahat.c @@ -673,7 +673,7 @@ void sub_0802B204(Entity* this) { bool32 sub_0802B234(Entity* this) { bool32 ret = FALSE; - if (GetTileTypeByEntity(this) - 0x1c4 > 1) + if (GetMetaTileTypeByEntity(this) - 0x1c4 > 1) ret = TRUE; return ret; } diff --git a/src/enemy/businessScrub.c b/src/enemy/businessScrub.c index aa1001a5..17d477e1 100644 --- a/src/enemy/businessScrub.c +++ b/src/enemy/businessScrub.c @@ -90,7 +90,7 @@ void sub_08028994(Entity* this) { } else { this->timer = 0; this->field_0x76.HWORD = COORD_TO_TILE(this); - this->field_0x74.HWORD = GetTileIndex(this->field_0x76.HWORD, this->collisionLayer); + this->field_0x74.HWORD = GetMetaTileIndex(this->field_0x76.HWORD, this->collisionLayer); this->hurtType = 0x41; sub_08028FFC(this); } @@ -429,7 +429,7 @@ void sub_08028FFC(Entity* this) { this->x.HALF.HI = this->field_0x78.HWORD; this->y.HALF.HI = this->field_0x7a.HWORD; InitializeAnimation(this, 0); - SetTile(0x4022, this->field_0x76.HWORD, this->collisionLayer); + SetMetaTile(0x4022, this->field_0x76.HWORD, this->collisionLayer); } void sub_08029078(Entity* this) { @@ -443,7 +443,7 @@ void sub_08029078(Entity* this) { this->spriteIndex = 0xd0; sub_08028FDC(this); sub_080290E0(this, 1); - SetTile(this->field_0x74.HWORD, this->field_0x76.HWORD, this->collisionLayer); + SetMetaTile(this->field_0x74.HWORD, this->field_0x76.HWORD, this->collisionLayer); } } diff --git a/src/enemy/chuchu.c b/src/enemy/chuchu.c index 2dd0b998..6e319531 100644 --- a/src/enemy/chuchu.c +++ b/src/enemy/chuchu.c @@ -8,6 +8,7 @@ #include "asm.h" #include "enemy.h" #include "functions.h" +#include "tiles.h" extern Entity* gUnk_020000B0; @@ -704,7 +705,7 @@ void sub_0801FB68(Entity* this) { } bool32 sub_0801FBD0(Entity* this) { - if (GetVvvAtEntity(this) == 0x10) { + if (GetVvvAtEntity(this) == VVV_16) { return TRUE; } else { return FALSE; diff --git a/src/enemy/chuchuBoss.c b/src/enemy/chuchuBoss.c index ab565a0d..d082e09b 100644 --- a/src/enemy/chuchuBoss.c +++ b/src/enemy/chuchuBoss.c @@ -563,7 +563,7 @@ void sub_080262A8(ChuchuBossEntity* this) { gPlayerEntity.animationState = 0; gRoomControls.camera_target = super; gRoomControls.scrollSpeed = 1; - SetTile(0x4022, 0x2c8, 1); + SetMetaTile(0x4022, 0x2c8, 1); } } diff --git a/src/enemy/doorMimic.c b/src/enemy/doorMimic.c index 9e4af1be..0630e316 100644 --- a/src/enemy/doorMimic.c +++ b/src/enemy/doorMimic.c @@ -40,7 +40,7 @@ void DoorMimic_OnCollision(Entity* this) { } void DoorMimic_OnDeath(Entity* this) { - SetTile((u16)this->field_0x7c.HALF.LO, (u16)this->field_0x7c.HALF.HI, this->collisionLayer); + SetMetaTile((u16)this->field_0x7c.HALF.LO, (u16)this->field_0x7c.HALF.HI, this->collisionLayer); CreateFx(this, FX_POT_SHATTER, 0); SetRoomTrackerFlag(this); DeleteThisEntity(); @@ -116,8 +116,8 @@ void sub_08022198(Entity* this) { void sub_080221C0(Entity* this) { u32 tile = COORD_TO_TILE(this) + gUnk_080B4488[this->type2]; this->field_0x7c.HALF.HI = tile; - this->field_0x7c.HALF.LO = GetTileIndex(tile, this->collisionLayer); - SetTile(gUnk_080CB79C[this->type2], tile, this->collisionLayer); + this->field_0x7c.HALF.LO = GetMetaTileIndex(tile, this->collisionLayer); + SetMetaTile(gUnk_080CB79C[this->type2], tile, this->collisionLayer); } // clang-format off diff --git a/src/enemy/enemy64.c b/src/enemy/enemy64.c index 8eee0dae..8ac7b621 100644 --- a/src/enemy/enemy64.c +++ b/src/enemy/enemy64.c @@ -88,10 +88,10 @@ void Enemy64_Init(Enemy64Entity* this) { Entity* tail; if (CheckFlags(0x7c)) { - SetTile(0x4081, 10, 2); - SetTile(0x4081, 0x4a, 2); - SetTile(0x4081, 0x8a, 2); - SetTile(0x4081, 0xca, 2); + SetMetaTile(0x4081, 10, 2); + SetMetaTile(0x4081, 0x4a, 2); + SetMetaTile(0x4081, 0x8a, 2); + SetMetaTile(0x4081, 0xca, 2); DeleteThisEntity(); } else { sub_0807B7D8(0x323, 10, 1); @@ -443,19 +443,19 @@ void Enemy64_Action4_SubAction7(Enemy64Entity* this) { DeleteThisEntity(); } else if (super->timer == 16) { sub_0807B7D8(0x36, 0xca, 1); - SetTile(0x4081, 0xca, 2); + SetMetaTile(0x4081, 0xca, 2); SoundReq(SFX_HEART_GET); } else if (super->timer == 24) { sub_0807B7D8(0x36, 0x8a, 1); - SetTile(0x4081, 0x8a, 2); + SetMetaTile(0x4081, 0x8a, 2); SoundReq(SFX_HEART_GET); } else if (super->timer == 32) { sub_0807B7D8(0x36, 0x4a, 1); - SetTile(0x4081, 0x4a, 2); + SetMetaTile(0x4081, 0x4a, 2); SoundReq(SFX_HEART_GET); } else if (super->timer == 40) { sub_0807B7D8(0x36, 10, 1); - SetTile(0x4081, 10, 2); + SetMetaTile(0x4081, 10, 2); SoundReq(SFX_HEART_GET); } } diff --git a/src/enemy/eyegore.c b/src/enemy/eyegore.c index f0c8efd5..c2138689 100644 --- a/src/enemy/eyegore.c +++ b/src/enemy/eyegore.c @@ -330,26 +330,26 @@ void sub_08030E80(EyegoreEntity* this) { void sub_08030F00(EyegoreEntity* this) { u32 position = COORD_TO_TILE_OFFSET(super, 8, 0x14); - u16 tileIndex = GetTileIndex(position, super->collisionLayer); + u16 tileIndex = GetMetaTileIndex(position, super->collisionLayer); this->unk_80 = tileIndex; - tileIndex = GetTileIndex(position + 1, super->collisionLayer); + tileIndex = GetMetaTileIndex(position + 1, super->collisionLayer); this->unk_82 = tileIndex; - tileIndex = GetTileIndex(position + 0x40, super->collisionLayer); + tileIndex = GetMetaTileIndex(position + 0x40, super->collisionLayer); this->unk_84 = tileIndex; - tileIndex = GetTileIndex(position + 0x41, super->collisionLayer); + tileIndex = GetMetaTileIndex(position + 0x41, super->collisionLayer); this->unk_86 = tileIndex; - SetTile(0x4022, position, super->collisionLayer); - SetTile(0x4022, position + 1, super->collisionLayer); - SetTile(0x4022, position + 0x40, super->collisionLayer); - SetTile(0x4022, position + 0x41, super->collisionLayer); + SetMetaTile(0x4022, position, super->collisionLayer); + SetMetaTile(0x4022, position + 1, super->collisionLayer); + SetMetaTile(0x4022, position + 0x40, super->collisionLayer); + SetMetaTile(0x4022, position + 0x41, super->collisionLayer); } void sub_08030FB4(EyegoreEntity* this) { u32 position = COORD_TO_TILE_OFFSET(super, 8, 0x14); - SetTile(this->unk_80, position, super->collisionLayer); - SetTile(this->unk_82, position + 1, super->collisionLayer); - SetTile(this->unk_84, position + 0x40, super->collisionLayer); - SetTile(this->unk_86, position + 0x41, super->collisionLayer); + SetMetaTile(this->unk_80, position, super->collisionLayer); + SetMetaTile(this->unk_82, position + 1, super->collisionLayer); + SetMetaTile(this->unk_84, position + 0x40, super->collisionLayer); + SetMetaTile(this->unk_86, position + 0x41, super->collisionLayer); } void sub_08031024(EyegoreEntity* this) { @@ -402,9 +402,9 @@ void sub_08031024(EyegoreEntity* this) { } } else { tmp2 = this->unk_7b >> 1; - uVar5 = GetTileTypeByPos(super->x.HALF.HI + gUnk_080CE2C0[tmp2], + uVar5 = GetMetaTileTypeByPos(super->x.HALF.HI + gUnk_080CE2C0[tmp2], super->y.HALF.HI + gUnk_080CE2C0[tmp2 + 1], super->collisionLayer); - uVar8 = GetTileTypeByPos(super->x.HALF.HI + gUnk_080CE2C0[tmp2 + 2], + uVar8 = GetMetaTileTypeByPos(super->x.HALF.HI + gUnk_080CE2C0[tmp2 + 2], super->y.HALF.HI + gUnk_080CE2C0[tmp2 + 3], super->collisionLayer); if (!(((gUnk_080B3E80[uVar5] == 0) && (gUnk_080B3E80[uVar8] == 0)) || ((this->unk_7b | 1) & 1) == 0)) { diff --git a/src/enemy/fallingBoulder.c b/src/enemy/fallingBoulder.c index 5f9f5ce2..3dfd7ab8 100644 --- a/src/enemy/fallingBoulder.c +++ b/src/enemy/fallingBoulder.c @@ -145,7 +145,7 @@ void sub_0802C4B0(Entity* this) { u32 index; u32 rand; - switch (GetTileIndex(this->field_0x7c.HALF_U.HI, this->collisionLayer)) { + switch (GetMetaTileIndex(this->field_0x7c.HALF_U.HI, this->collisionLayer)) { case 0x1ab ... 0x1af: offset = 8; break; diff --git a/src/enemy/flyingPot.c b/src/enemy/flyingPot.c index 1b628d71..b9a2d293 100644 --- a/src/enemy/flyingPot.c +++ b/src/enemy/flyingPot.c @@ -100,7 +100,7 @@ void FlyingPot_OnCollision(FlyingPotEntity* this) { super->zVelocity = Q_16_16(2.625); super->spritePriority.b1 = 1; - SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer); + SetMetaTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer); } else if (super->z.HALF.HI != 0) { sub_08037408(this); } @@ -146,7 +146,7 @@ void FlyingPot_SubAction2(FlyingPotEntity* this) { COLLISION_OFF(super); super->spriteOffsetX = 0; - SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer); + SetMetaTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer); } if (sub_0806F520(super)) { @@ -177,16 +177,16 @@ void FlyingPot_Init(FlyingPotEntity* this) { super->y.HALF.HI += 3; tile = TILE(super->x.HALF.HI, super->y.HALF.HI); - this->tileIndex = GetTileIndex(tile, super->collisionLayer); - SetTile(0x4000, tile, super->collisionLayer); + this->tileIndex = GetMetaTileIndex(tile, super->collisionLayer); + SetMetaTile(0x4000, tile, super->collisionLayer); InitializeAnimation(super, 5); } void FlyingPot_Action1(FlyingPotEntity* this) { sub_08037418(this); - if (GetTileTypeByEntity(super) != 0x4000) { - SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer); + if (GetMetaTileTypeByEntity(super) != 0x4000) { + SetMetaTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer); sub_08037408(this); } @@ -211,7 +211,7 @@ void FlyingPot_Action2(FlyingPotEntity* this) { super->flags2 = 0xF; super->hitbox = &gUnk_080FD34C; - SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer); + SetMetaTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer); } } @@ -257,8 +257,8 @@ void sub_08037408(FlyingPotEntity* this) { void sub_08037418(FlyingPotEntity* this) { u32 tile = COORD_TO_TILE(super); - if (GetTileIndex(tile, super->collisionLayer) == 0x4067) { - SetTile(this->tileIndex, tile, super->collisionLayer); + if (GetMetaTileIndex(tile, super->collisionLayer) == 0x4067) { + SetMetaTile(this->tileIndex, tile, super->collisionLayer); DeleteThisEntity(); } } diff --git a/src/enemy/flyingSkull.c b/src/enemy/flyingSkull.c index 7897de3a..fdb65937 100644 --- a/src/enemy/flyingSkull.c +++ b/src/enemy/flyingSkull.c @@ -45,7 +45,7 @@ void FlyingSkull_OnCollision(FlyingSkullEntity* this) { COLLISION_OFF(super); super->zVelocity = Q_16_16(2.625); super->spritePriority.b1 = 1; - SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer); + SetMetaTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer); } else if (super->z.HALF.HI) { sub_0803A0E0(this); } @@ -84,7 +84,7 @@ void sub_08039CE0(FlyingSkullEntity* this) { super->timer = 1; super->z.HALF.HI = -1; super->spriteOffsetX = 0; - SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer); + SetMetaTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer); } if (sub_0806F520(super)) { @@ -115,8 +115,8 @@ void sub_08039D74(FlyingSkullEntity* this) { super->y.HALF.HI += 3; tmp = COORD_TO_TILE(super); - this->unk_0x74 = GetTileIndex(tmp, super->collisionLayer); - SetTile(0x4060, tmp, super->collisionLayer); + this->unk_0x74 = GetMetaTileIndex(tmp, super->collisionLayer); + SetMetaTile(0x4060, tmp, super->collisionLayer); InitializeAnimation(super, 0); } @@ -124,8 +124,8 @@ void sub_08039DD8(FlyingSkullEntity* this) { sub_0803A100(this); if (super->type == 0) { - if (GetTileTypeByEntity(super) == 0x4073) { - SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer); + if (GetMetaTileTypeByEntity(super) == 0x4073) { + SetMetaTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer); sub_0803A0E0(this); } @@ -142,7 +142,7 @@ void sub_08039DD8(FlyingSkullEntity* this) { if (ent != NULL) { ent->type2 = 1; CopyPosition(super, ent); - SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer); + SetMetaTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer); DeleteEntity(super); } } @@ -162,7 +162,7 @@ void sub_08039EE4(FlyingSkullEntity* this) { super->hitbox = (Hitbox*)&gUnk_080FD340; gPlayerEntity.animationState; this->unk_0x76 = gPlayerEntity.animationState; - SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer); + SetMetaTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer); } void sub_08039F4C(FlyingSkullEntity* this) { @@ -195,7 +195,7 @@ void sub_08039FAC(FlyingSkullEntity* this) { super->hitType = 0xa0; super->flags2 = 0xf; super->hitbox = (Hitbox*)&gUnk_080FD34C; - SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer); + SetMetaTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer); } } @@ -243,8 +243,8 @@ void sub_0803A0E0(FlyingSkullEntity* this) { void sub_0803A100(FlyingSkullEntity* this) { u32 tile = COORD_TO_TILE(super); - if (GetTileIndex(tile, super->collisionLayer) == 0x4067) { - SetTile(this->unk_0x74, tile, super->collisionLayer); + if (GetMetaTileIndex(tile, super->collisionLayer) == 0x4067) { + SetMetaTile(this->unk_0x74, tile, super->collisionLayer); DeleteThisEntity(); } } diff --git a/src/enemy/helmasaur.c b/src/enemy/helmasaur.c index 18976674..db2b004a 100644 --- a/src/enemy/helmasaur.c +++ b/src/enemy/helmasaur.c @@ -5,10 +5,10 @@ * @brief Helmasaur enemy */ -#include "enemy.h" -#include "object.h" -#include "functions.h" #include "collision.h" +#include "enemy.h" +#include "functions.h" +#include "object.h" extern u32 sub_0804A024(Entity*, u32, u32); @@ -338,15 +338,15 @@ bool32 sub_0802C0E8(Entity* this) { s32 y = this->y.HALF.HI + this->hitbox->offset_y + ptr[1] * 6; u8* layer = this->collisionLayer == 2 ? gMapTop.collisionData : gMapBottom.collisionData; - u32 ret = FALSE; + u32 result = FALSE; if (!sub_0806FC24(TILE(x, y), 9)) { if (IsTileCollision(layer, x, y, 0)) { - ret = 1; + result = TRUE; } else { - ret = 0; + result = FALSE; } } - return ret; + return result; } } diff --git a/src/enemy/leever.c b/src/enemy/leever.c index d9a0be39..5baa8d06 100644 --- a/src/enemy/leever.c +++ b/src/enemy/leever.c @@ -7,6 +7,7 @@ #include "asm.h" #include "enemy.h" #include "physics.h" +#include "tiles.h" extern Entity* gUnk_020000B0; @@ -203,10 +204,10 @@ const s8 gLeeverDrift[] = { }; const u16 gUnk_080CA4CA[] = { - 0x000A, - 0x0009, - 0x000C, - 0x000B, + VVV_10, + VVV_9, + VVV_12, + VVV_11, 0xFFFF, }; // clang-format on diff --git a/src/enemy/mazaalMacro.c b/src/enemy/mazaalMacro.c index 2c8aa172..21af3148 100644 --- a/src/enemy/mazaalMacro.c +++ b/src/enemy/mazaalMacro.c @@ -83,7 +83,7 @@ void sub_08034CC4(Entity* this) { this->field_0x78.HWORD = 0x4b0; sub_08034F70(this); InitializeAnimation(this, this->type); - SetTile(0x4022, COORD_TO_TILE(this), this->collisionLayer); + SetMetaTile(0x4022, COORD_TO_TILE(this), this->collisionLayer); entity = CreateEnemy(MAZAAL_MACRO, 2); if (entity != NULL) { this->child = entity; diff --git a/src/enemy/moldworm.c b/src/enemy/moldworm.c index 04923737..f0594910 100644 --- a/src/enemy/moldworm.c +++ b/src/enemy/moldworm.c @@ -157,7 +157,7 @@ void sub_08023288(Entity* this) { for (i = 0; i < 0x10; i++) { u32 x = gPlayerEntity.x.HALF.HI + gUnk_080CBC70[idx + 0]; u32 y = gPlayerEntity.y.HALF.HI + gUnk_080CBC70[idx + 1]; - if (sub_08023A38(GetTileTypeByPos(x, y, gPlayerEntity.collisionLayer))) { + if (sub_08023A38(GetMetaTileTypeByPos(x, y, gPlayerEntity.collisionLayer))) { sub_08023990(this, x, y); return; } @@ -195,7 +195,7 @@ void sub_08023398(Entity* this) { } if (--this->field_0x78.HWORD == 0) { - if (sub_08023A38(GetTileTypeByEntity(this))) { + if (sub_08023A38(GetMetaTileTypeByEntity(this))) { this->action = 5; this->field_0x7c.BYTES.byte3 = 0; COLLISION_OFF(this); diff --git a/src/enemy/pesto.c b/src/enemy/pesto.c index d4e014df..9c211fcc 100644 --- a/src/enemy/pesto.c +++ b/src/enemy/pesto.c @@ -430,7 +430,7 @@ void sub_080244E8(Entity* this) { this->timer = 12; this->field_0x82.HALF.HI &= ~0x80; ent = this->child; - SetTile((u16)ent->field_0x70.HALF.LO, COORD_TO_TILE(ent), ent->collisionLayer); + SetMetaTile((u16)ent->field_0x70.HALF.LO, COORD_TO_TILE(ent), ent->collisionLayer); DeleteEntity(ent); this->z.HALF.HI -= 0xe; this->field_0x78.HWORD -= 0xe; diff --git a/src/enemy/puffstool.c b/src/enemy/puffstool.c index f32fa848..334585fd 100644 --- a/src/enemy/puffstool.c +++ b/src/enemy/puffstool.c @@ -8,6 +8,7 @@ #include "collision.h" #include "enemy.h" #include "object.h" +#include "tiles.h" extern u8 gUnk_080B3E80[]; @@ -509,12 +510,12 @@ void sub_08025A54(Entity* this) { } } -bool32 sub_08025AB8(u32 tile, u32 layer) { - if (GetCollisionDataAtMetaTilePos(tile, layer)) +bool32 sub_08025AB8(u32 metaTilePos, u32 layer) { + if (GetCollisionDataAtMetaTilePos(metaTilePos, layer)) return FALSE; - if (GetVvvAtMetaTilePos(tile, layer) == 10) { - sub_0807B7D8(0x61, tile, layer); + if (GetVvvAtMetaTilePos(metaTilePos, layer) == VVV_10) { + sub_0807B7D8(0x61, metaTilePos, layer); return TRUE; } diff --git a/src/enemy/rollobite.c b/src/enemy/rollobite.c index f55a3c34..48ce8093 100644 --- a/src/enemy/rollobite.c +++ b/src/enemy/rollobite.c @@ -260,7 +260,7 @@ void sub_08020A7C(Entity* this) { bool32 Rollobite_TryToHoleUp(Entity* this) { if (Rollobite_IsRolledUp(this) && this->z.HALF.HI == 0) { int tile = COORD_TO_TILE(this); - int iVar1 = GetTileType(tile, this->collisionLayer); + int iVar1 = GetMetaTileType(tile, this->collisionLayer); if ((iVar1 * 0x10000 - 0x710000U) >> 0x10 < 2) { this->action = 6; COLLISION_OFF(this); @@ -270,7 +270,7 @@ bool32 Rollobite_TryToHoleUp(Entity* this) { this->y.HALF.HI += 13; this->zVelocity = Q_16_16(2.0); InitializeAnimation(this, this->animationState + 0x14); - SetTile(0x4034, tile, this->collisionLayer); + SetMetaTile(0x4034, tile, this->collisionLayer); return TRUE; } } diff --git a/src/enemy/rope.c b/src/enemy/rope.c index 53cc1df0..361a0e37 100644 --- a/src/enemy/rope.c +++ b/src/enemy/rope.c @@ -7,6 +7,7 @@ #include "enemy.h" #include "physics.h" +#include "tiles.h" void Rope_OnTick(Entity*); void Rope_OnCollision(Entity*); @@ -196,7 +197,7 @@ void sub_08031600(Entity* this) { u32 sub_0803163C(Entity* this) { u32 h; - if (GetVvvAtEntity(this) == 0x13) { + if (GetVvvAtEntity(this) == VVV_19) { h = this->field_0x7a.HWORD / 2; } else { h = this->field_0x7a.HWORD; diff --git a/src/enemy/spinyBeetle.c b/src/enemy/spinyBeetle.c index 3d4f8e29..19900171 100644 --- a/src/enemy/spinyBeetle.c +++ b/src/enemy/spinyBeetle.c @@ -88,8 +88,8 @@ void SpinyBeetle_Init(SpinyBeetleEntity* this) { this->unk_78 = 0; this->unk_7b = 0; this->tile = COORD_TO_TILE(super); - this->tileIndex = GetTileIndex(this->tile, super->collisionLayer); - SetTile(0x4022, this->tile, super->collisionLayer); + this->tileIndex = GetMetaTileIndex(this->tile, super->collisionLayer); + SetMetaTile(0x4022, this->tile, super->collisionLayer); obj = CreateObject(OBJECT_ON_BEETLE, super->type, 0); if (obj == NULL) { @@ -232,7 +232,7 @@ void sub_08033B44(SpinyBeetleEntity* this) { super->spritePriority.b1 = 0; this->unk_7b = 0x78; this->tile = COORD_TO_TILE(super); - this->tileIndex = GetTileIndex(this->tile, super->collisionLayer); + this->tileIndex = GetMetaTileIndex(this->tile, super->collisionLayer); if (this->tileIndex != 0x4022) { stop++; @@ -254,7 +254,7 @@ void sub_08033B44(SpinyBeetleEntity* this) { } } - SetTile(0x4022, this->tile, super->collisionLayer); + SetMetaTile(0x4022, this->tile, super->collisionLayer); InitializeAnimation(super, 0); } @@ -316,7 +316,7 @@ void sub_08033D78(SpinyBeetleEntity* this) { s32 tile; u32 type; tile = COORD_TO_TILE_OFFSET(super, -ptr[0], -ptr[1]); - type = GetTileType(tile, super->collisionLayer); + type = GetMetaTileType(tile, super->collisionLayer); switch (type) { case 0x1c4: diff --git a/src/enemy/stalfos.c b/src/enemy/stalfos.c index 91ca9530..9710736a 100644 --- a/src/enemy/stalfos.c +++ b/src/enemy/stalfos.c @@ -440,7 +440,7 @@ void sub_08039AD4(StalfosEntity* this) { super->action = 0xb; super->child = projectile; InitAnimationForceUpdate(super, super->animationState + 0x18); - SetTile(0x4067, position, super->collisionLayer); + SetMetaTile(0x4067, position, super->collisionLayer); return; } } @@ -457,7 +457,7 @@ u32 sub_08039B28(StalfosEntity* this) { ptr2 = &gUnk_080CF930[super->animationState * 2]; pos = COORD_TO_TILE_OFFSET(super, -ptr2[0], -ptr2[1]); - tileType = GetTileType(pos, (u32)super->collisionLayer); + tileType = GetMetaTileType(pos, (u32)super->collisionLayer); ptr = gUnk_080CF938; do { if (ptr[0] != tileType) { diff --git a/src/enemy/tektite.c b/src/enemy/tektite.c index f046745b..a5d58c33 100644 --- a/src/enemy/tektite.c +++ b/src/enemy/tektite.c @@ -158,7 +158,7 @@ void sub_0802F300(Entity* this) { return; } else if (this->collisions != COL_NONE) { sub_0800417E(this, this->collisions); - } else if ((GetVvvAtEntity(this) & 0xf0) == 0x50) { + } else if ((GetVvvAtEntity(this) & 0xf0) == 0x50) { // VVV_240 and VVV_241? this->direction = (this->direction + 0x10) & 0x1f; } diff --git a/src/enemy/tektiteGolden.c b/src/enemy/tektiteGolden.c index c67a5696..0eb576ca 100644 --- a/src/enemy/tektiteGolden.c +++ b/src/enemy/tektiteGolden.c @@ -134,7 +134,7 @@ void sub_08038048(Entity* this) { return; } else if (this->collisions != COL_NONE) { sub_0800417E(this, this->collisions); - } else if ((GetVvvAtEntity(this) & 0xf0) == 0x50) { + } else if ((GetVvvAtEntity(this) & 0xf0) == 0x50) { // VVV_240 and VVV_241? this->direction = (this->direction + 0x10) & 0x1f; } diff --git a/src/enemy/torchTrap.c b/src/enemy/torchTrap.c index dc3c07cf..db31a752 100644 --- a/src/enemy/torchTrap.c +++ b/src/enemy/torchTrap.c @@ -70,7 +70,7 @@ void sub_0803CF38(TorchTrapEntity* this) { } void sub_0803CF94(TorchTrapEntity* this) { - if (GetTileType(this->unk_74, super->collisionLayer) == 0x76) { + if (GetMetaTileType(this->unk_74, super->collisionLayer) == 0x76) { this->unk_80 = 0; TorchTrap_Reset(this); } else if (this->unk_7c && sub_0803CFD8(this)) { diff --git a/src/enemy/vaatiProjectile.c b/src/enemy/vaatiProjectile.c index 2d735663..a69b118d 100644 --- a/src/enemy/vaatiProjectile.c +++ b/src/enemy/vaatiProjectile.c @@ -277,6 +277,6 @@ void sub_0803E4D8(Entity* this) { tile = TILE(this->x.HALF.HI, this->y.HALF.HI + 8); if (GetCollisionDataAtMetaTilePos(tile, gPlayerEntity.collisionLayer) != 0xff) { - SetTile(0x4074, tile, gPlayerEntity.collisionLayer); + SetMetaTile(0x4074, tile, gPlayerEntity.collisionLayer); } } diff --git a/src/enemy/wizzrobeFire.c b/src/enemy/wizzrobeFire.c index 820bd8ea..09d2f6d7 100644 --- a/src/enemy/wizzrobeFire.c +++ b/src/enemy/wizzrobeFire.c @@ -29,7 +29,7 @@ void WizzrobeFire_OnCollision(WizzrobeEntity* this) { } EnemyFunctionHandlerAfterCollision(super, WizzrobeFire_Functions); if (super->health == 0) { - SetTile(this->tileIndex, this->tilePosition, super->collisionLayer); + SetMetaTile(this->tileIndex, this->tilePosition, super->collisionLayer); } } @@ -114,7 +114,7 @@ void WizzrobeFire_Action2(WizzrobeEntity* this) { super->timer = 40; super->subtimer = 0; super->flags &= ~0x80; - SetTile(this->tileIndex, this->tilePosition, super->collisionLayer); + SetMetaTile(this->tileIndex, this->tilePosition, super->collisionLayer); EnqueueSFX(SFX_156); InitializeAnimation(super, super->direction >> 3); } diff --git a/src/enemy/wizzrobeIce.c b/src/enemy/wizzrobeIce.c index edd48331..7e276ed2 100644 --- a/src/enemy/wizzrobeIce.c +++ b/src/enemy/wizzrobeIce.c @@ -38,7 +38,7 @@ void WizzrobeIce_OnCollision(WizzrobeEntity* this) { } } if (super->health == 0) { - SetTile(this->tileIndex, this->tilePosition, super->collisionLayer); + SetMetaTile(this->tileIndex, this->tilePosition, super->collisionLayer); } } @@ -121,7 +121,7 @@ void WizzrobeIce_Action2(WizzrobeEntity* this) { super->timer = 40; super->subtimer = 0; super->flags &= ~0x80; - SetTile(this->tileIndex, this->tilePosition, super->collisionLayer); + SetMetaTile(this->tileIndex, this->tilePosition, super->collisionLayer); EnqueueSFX(SFX_156); InitializeAnimation(super, super->direction >> 3); } diff --git a/src/enemy/wizzrobeWind.c b/src/enemy/wizzrobeWind.c index 0904fea4..2a87a111 100644 --- a/src/enemy/wizzrobeWind.c +++ b/src/enemy/wizzrobeWind.c @@ -45,7 +45,7 @@ void WizzrobeWind_OnCollision(WizzrobeEntity* this) { } } if (super->health == 0) { - SetTile(this->tileIndex, this->tilePosition, super->collisionLayer); + SetMetaTile(this->tileIndex, this->tilePosition, super->collisionLayer); } } @@ -138,7 +138,7 @@ void WizzrobeWind_Action2(WizzrobeEntity* this) { super->subtimer = 0; super->flags &= ~0x80; EnqueueSFX(SFX_156); - SetTile(this->tileIndex, this->tilePosition, super->collisionLayer); + SetMetaTile(this->tileIndex, this->tilePosition, super->collisionLayer); InitializeAnimation(super, super->direction >> 3); } break; @@ -210,8 +210,8 @@ void WizzrobeWind_Action3(WizzrobeEntity* this) { void sub_0802F888(WizzrobeEntity* this) { super->direction = (sub_08049F84(super, 3) + 4) & 0x18; this->tilePosition = COORD_TO_TILE(super); - this->tileIndex = GetTileIndex(this->tilePosition, super->collisionLayer); - SetTile(0x4071, this->tilePosition, super->collisionLayer); + this->tileIndex = GetMetaTileIndex(this->tilePosition, super->collisionLayer); + SetMetaTile(0x4071, this->tilePosition, super->collisionLayer); } void sub_0802F8E4(WizzrobeEntity* this) { @@ -237,7 +237,7 @@ void sub_0802F8E4(WizzrobeEntity* this) { uVar7 = (uVar1 + iVar4) | 8; uVar6 = TILE(uVar8, uVar7); if ((GetCollisionDataAtMetaTilePos(uVar6, super->collisionLayer) == 0) && - (GetTileIndex(uVar6, super->collisionLayer) != 0x4071)) { + (GetMetaTileIndex(uVar6, super->collisionLayer) != 0x4071)) { super->x.HALF.HI = (s16)uVar8; super->y.HALF.HI = (s16)uVar7; if (sub_08049FA0(super) != 0) { diff --git a/src/entity.c b/src/entity.c index 2ac2b37f..b1817b4d 100644 --- a/src/entity.c +++ b/src/entity.c @@ -44,25 +44,25 @@ void sub_0805E248(void) { v0 = gDiggingCaveEntranceTransition.entrance->targetTilePosition; if (gRoomControls.area == AREA_VEIL_FALLS || gRoomControls.area == AREA_VEIL_FALLS_DIG_CAVE) { - SetTileType(0x27c, v0 + TILE_POS(-1, -1), 1); - SetTileType(0x283, v0 + TILE_POS(-1, -1), 2); - SetTileType(0x27d, v0 + TILE_POS(0, -1), 1); - SetTileType(0x284, v0 + TILE_POS(0, -1), 2); - SetTileType(0x27e, v0 + TILE_POS(1, -1), 1); - SetTileType(0x285, v0 + TILE_POS(1, -1), 2); - SetTileType(0x27f, v0 + TILE_POS(-1, 0), 1); - SetTileType(0x280, v0 + TILE_POS(0, 0), 1); - SetTileType(0x282, v0 + TILE_POS(1, 0), 1); + SetMetaTileType(0x27c, v0 + TILE_POS(-1, -1), 1); + SetMetaTileType(0x283, v0 + TILE_POS(-1, -1), 2); + SetMetaTileType(0x27d, v0 + TILE_POS(0, -1), 1); + SetMetaTileType(0x284, v0 + TILE_POS(0, -1), 2); + SetMetaTileType(0x27e, v0 + TILE_POS(1, -1), 1); + SetMetaTileType(0x285, v0 + TILE_POS(1, -1), 2); + SetMetaTileType(0x27f, v0 + TILE_POS(-1, 0), 1); + SetMetaTileType(0x280, v0 + TILE_POS(0, 0), 1); + SetMetaTileType(0x282, v0 + TILE_POS(1, 0), 1); } else { - SetTileType(0x26c, v0 + TILE_POS(-1, -1), 1); - SetTileType(0x273, v0 + TILE_POS(-1, -1), 2); - SetTileType(0x26d, v0 + TILE_POS(0, -1), 1); - SetTileType(0x274, v0 + TILE_POS(0, -1), 2); - SetTileType(0x26e, v0 + TILE_POS(1, -1), 1); - SetTileType(0x275, v0 + TILE_POS(1, -1), 2); - SetTileType(0x26f, v0 + TILE_POS(-1, 0), 1); - SetTileType(0x270, v0 + TILE_POS(0, 0), 1); - SetTileType(0x272, v0 + TILE_POS(1, 0), 1); + SetMetaTileType(0x26c, v0 + TILE_POS(-1, -1), 1); + SetMetaTileType(0x273, v0 + TILE_POS(-1, -1), 2); + SetMetaTileType(0x26d, v0 + TILE_POS(0, -1), 1); + SetMetaTileType(0x274, v0 + TILE_POS(0, -1), 2); + SetMetaTileType(0x26e, v0 + TILE_POS(1, -1), 1); + SetMetaTileType(0x275, v0 + TILE_POS(1, -1), 2); + SetMetaTileType(0x26f, v0 + TILE_POS(-1, 0), 1); + SetMetaTileType(0x270, v0 + TILE_POS(0, 0), 1); + SetMetaTileType(0x272, v0 + TILE_POS(1, 0), 1); } gUpdateVisibleTiles = 0; } diff --git a/src/item/itemGustJar.c b/src/item/itemGustJar.c index f00ef63b..833f1198 100644 --- a/src/item/itemGustJar.c +++ b/src/item/itemGustJar.c @@ -1,8 +1,8 @@ -#include "global.h" #include "entity.h" #include "item.h" #include "functions.h" #include "playeritem.h" +#include "tiles.h" void (*const ItemGustJar_StateFunctions[])(ItemBehavior* this, u32); @@ -12,7 +12,7 @@ void ItemGustJar(ItemBehavior* this, u32 index) { } void sub_08076DF4(ItemBehavior* this, u32 index) { - if (GetVvvInFront(&gPlayerEntity) != 0x29 && gPlayerState.floor_type != SURFACE_DOOR && + if (GetVvvInFront(&gPlayerEntity) != VVV_41 && gPlayerState.floor_type != SURFACE_DOOR && gPlayerState.floor_type != SURFACE_DOOR_13 && gPlayerState.jump_status == 0) { sub_08077D38(this, index); this->timer = 0; diff --git a/src/item/itemMoleMitts.c b/src/item/itemMoleMitts.c index fbb62e22..0b5c8b17 100644 --- a/src/item/itemMoleMitts.c +++ b/src/item/itemMoleMitts.c @@ -1,9 +1,10 @@ -#include "item.h" -#include "functions.h" -#include "sound.h" #include "effects.h" +#include "functions.h" +#include "item.h" #include "object.h" +#include "sound.h" +#include "tiles.h" s32 sub_080774A0(void); extern s32 sub_0800875A(Entity*, u32, ItemBehavior*); @@ -176,18 +177,18 @@ void sub_08077448(ItemBehavior* this, u32 index) { s32 sub_080774A0(void) { static const s8 gUnk_0811BE1E[] = { 0, -13, 13, 0, 0, 16, -13, 0, 0, 0 }; u32 iVar2; - u32 uVar3; + u32 metaTilePos; - uVar3 = COORD_TO_TILE_OFFSET((&gPlayerEntity), -gUnk_0811BE1E[gPlayerEntity.animationState & 6], + metaTilePos = COORD_TO_TILE_OFFSET((&gPlayerEntity), -gUnk_0811BE1E[gPlayerEntity.animationState & 6], -gUnk_0811BE1E[(gPlayerEntity.animationState & 6) + 1]); - iVar2 = GetCollisionDataAtMetaTilePos(uVar3, gPlayerEntity.collisionLayer); + iVar2 = GetCollisionDataAtMetaTilePos(metaTilePos, gPlayerEntity.collisionLayer); if (iVar2 > 0x16) return 0; if (iVar2 < 0xf) return 0; - if (GetVvvAtMetaTilePos(uVar3, gPlayerEntity.collisionLayer) != 0x56) { + if (GetVvvAtMetaTilePos(metaTilePos, gPlayerEntity.collisionLayer) != VVV_86) { return 1; } else { return 0x56; diff --git a/src/kinstone.c b/src/kinstone.c index e6b8f054..b2a1f7ce 100644 --- a/src/kinstone.c +++ b/src/kinstone.c @@ -340,7 +340,7 @@ void sub_0801876C(u32 worldEventId, bool32 isKinstoneFused) { if (isKinstoneFused == 0) { return; } - SetTileType(0x168, (ptr->x >> 4 & 0x3f) | (ptr->y >> 4 & 0x3f) << 6, 1); + SetMetaTileType(0x168, (ptr->x >> 4 & 0x3f) | (ptr->y >> 4 & 0x3f) << 6, 1); break; case WORLD_EVENT_TYPE_11: if (isKinstoneFused != 0) { @@ -358,12 +358,12 @@ void sub_0801876C(u32 worldEventId, bool32 isKinstoneFused) { *(u16*)&ent->gustJarState = ptr->y + gRoomControls.origin_y; } if (ptr->entity_idx == 0) { - SetTileType(0x8d, (ptr->x >> 4 & 0x3f) | (ptr->y >> 4 & 0x3f) << 6, 1); + SetMetaTileType(0x8d, (ptr->x >> 4 & 0x3f) | (ptr->y >> 4 & 0x3f) << 6, 1); } else { uVar5 = (ptr->x >> 4 & 0x3f) | (ptr->y >> 4 & 0x3f) << 6; - SetTileType(0x8c, uVar5 - 1, 1); + SetMetaTileType(0x8c, uVar5 - 1, 1); uVar3 = 0x8e; - SetTileType(uVar3, uVar5, 1); + SetMetaTileType(uVar3, uVar5, 1); } break; case WORLD_EVENT_TYPE_24: @@ -404,13 +404,13 @@ void sub_080189EC(u32 worldEventId) { tilePosition -= 0x42; for (i = 0; i < 4; i++) { - SetTileType(i + 0x1df, tilePosition + i, 2); + SetMetaTileType(i + 0x1df, tilePosition + i, 2); } tilePosition += 0x40; for (i = 0; i < 4; i++) { - SetTileType(i + 0x1e3, tilePosition + i, 2); - SetTileType(i + 0x1db, tilePosition + i, 1); + SetMetaTileType(i + 0x1e3, tilePosition + i, 2); + SetMetaTileType(i + 0x1db, tilePosition + i, 1); } } @@ -430,7 +430,7 @@ void sub_08018A58(u32 worldEventId) { for (i = 0; i < 4; tilePosition += 0x40, i++) { for (j = 0; j < 7; j++) { - SetTileType(iVar2++, tilePosition + j, 1); + SetMetaTileType(iVar2++, tilePosition + j, 1); } } } @@ -447,8 +447,8 @@ void sub_08018AB4(int param_1) { for (i = 0; i < 3; i++) { j = 0; for (; j < 4; j++) { - SetTileType(iVar2++, param_1 + j, 1); - SetTileType(iVar6++, param_1 - 0x40 + j, 2); + SetMetaTileType(iVar2++, param_1 + j, 1); + SetMetaTileType(iVar6++, param_1 - 0x40 + j, 2); } param_1 += 0x40; } @@ -465,8 +465,8 @@ void sub_08018B10(int param_1) { index = 0; iVar1 = param_1 - 0x40; for (; index < 4; iVar1++, index++) { - SetTileType(iVar4++, param_1 + index, 1); - SetTileType(iVar3++, iVar1, 2); + SetMetaTileType(iVar4++, param_1 + index, 1); + SetMetaTileType(iVar3++, iVar1, 2); } } @@ -490,7 +490,7 @@ void sub_08018B50(u32 worldEventId) { for (i = 0; i < 5; tilePosition += 0x40, i++) { for (j = 0; j < 5; j++) { - SetTileType(iVar2++, tilePosition + j, 1); + SetMetaTileType(iVar2++, tilePosition + j, 1); } } } @@ -513,7 +513,7 @@ void sub_08018BB4(u32 worldEventId) { } else { layer = 2; } - SetTileType(0x73, position, layer); + SetMetaTileType(0x73, position, layer); } } @@ -523,7 +523,7 @@ void CreateMinishEntrance(u32 tilePos) { for (y = 0; y <= 3; y++) { for (x = 0; x <= 4; x++) { - SetTileType(tileID++, tilePos + x, 1); + SetMetaTileType(tileID++, tilePos + x, 1); } tilePos += 0x40; } @@ -533,7 +533,7 @@ void sub_08018C58(u32 tilePos) { u32 i; for (i = 0; i < 6; i += 2, tilePos += 0x40) { - SetTileType(0x260 + i, tilePos, 1); - SetTileType(0x261 + i, tilePos + 1, 1); + SetMetaTileType(0x260 + i, tilePos, 1); + SetMetaTileType(0x261 + i, tilePos + 1, 1); } } diff --git a/src/manager/bombableWallManager.c b/src/manager/bombableWallManager.c index efb1af9f..b207e91c 100644 --- a/src/manager/bombableWallManager.c +++ b/src/manager/bombableWallManager.c @@ -11,19 +11,20 @@ #include "game.h" #include "object.h" #include "sound.h" +#include "tiles.h" -u32 sub_0805BFC4(u32, u32); -void sub_0805C02C(BombableWallManager*); +u32 BombableWallManager_GetBombableType(u32 metaTilePos, u32 layer); +void BombableWallManager_DestroyWall(BombableWallManager*); u32 getArchwayType(void); void BombableWallManager_Init(BombableWallManager*); void BombableWallManager_Action1(BombableWallManager*); void BombableWallManager_Action2(BombableWallManager*); -void sub_0805C050(u32, u32); -void sub_0805C178(u32, u32); -void sub_0805C294(u32, u32); -void sub_0805C3B4(u32, u32); -void sub_0805C4E0(u32, u32); +void BombableWallManager_DestroyWall0(u32, u32); +void BombableWallManager_DestroyWall1(u32, u32); +void BombableWallManager_DestroyWall2(u32, u32); +void BombableWallManager_DestroyWall3(u32, u32); +void BombableWallManager_DestroyWall4(u32, u32); void BombableWallManager_Main(BombableWallManager* this) { static void (*const BombableWallManager_Actions[])(BombableWallManager*) = { @@ -36,20 +37,20 @@ void BombableWallManager_Main(BombableWallManager* this) { void BombableWallManager_Init(BombableWallManager* this) { super->action = 1; - this->tile = (this->x >> 4 & 0x3fU) | (((this->y << 0x10) >> 0x14 & 0x3fU) << 6); - super->type = sub_0805BFC4(this->tile, this->field_0x35); - if (CheckLocalFlag(this->field_0x3e) != 0) { - sub_0805C02C(this); + this->metaTilePos = (this->x >> 4 & 0x3fU) | (((this->y << 0x10) >> 0x14 & 0x3fU) << 6); + super->type = BombableWallManager_GetBombableType(this->metaTilePos, this->layer); + if (CheckLocalFlag(this->flag) != 0) { + BombableWallManager_DestroyWall(this); DeleteManager(super); } } void BombableWallManager_Action1(BombableWallManager* this) { - if (GetVvvAtMetaTilePos(this->tile, this->field_0x35) != 0x2e) { + if (GetVvvAtMetaTilePos(this->metaTilePos, this->layer) != VVV_46) { super->action = 2; super->timer = 90; - sub_0805C02C(this); - SetLocalFlag(this->field_0x3e); + BombableWallManager_DestroyWall(this); + SetLocalFlag(this->flag); } } @@ -60,155 +61,154 @@ void BombableWallManager_Action2(BombableWallManager* this) { } } -u32 sub_0805BFC4(u32 pos, u32 layer) { - u32 tileType = GetTileType(pos, layer); +u32 BombableWallManager_GetBombableType(u32 metaTilePos, u32 layer) { + u32 metaTileType = GetMetaTileType(metaTilePos, layer); - switch (tileType) { - case 0xec: + switch (metaTileType) { + case META_TILE_TYPE_236: return 1; - case 0xbf: + case META_TILE_TYPE_191: return 4; - case 0xaf: + case META_TILE_TYPE_175: return 0; - case 0xcc: + case META_TILE_TYPE_204: return 2; - case 0xdf: + case META_TILE_TYPE_223: return 3; - case 0xff: + case META_TILE_TYPE_255: return 0; - case 0x115: + case META_TILE_TYPE_277: return 1; - case 0x108: + case META_TILE_TYPE_264: return 2; - case 0x110: + case META_TILE_TYPE_272: return 3; - case 0x105: + case META_TILE_TYPE_261: return 4; } return 0xff; } -void sub_0805C02C(BombableWallManager* this) { +void BombableWallManager_DestroyWall(BombableWallManager* this) { static void (*const gUnk_08108CE8[])(u32, u32) = { - sub_0805C050, sub_0805C178, sub_0805C294, sub_0805C3B4, sub_0805C4E0, + BombableWallManager_DestroyWall0, BombableWallManager_DestroyWall1, BombableWallManager_DestroyWall2, BombableWallManager_DestroyWall3, BombableWallManager_DestroyWall4, }; if (super->type != 0xff) { - gUnk_08108CE8[super->type](this->tile, this->field_0x35); + gUnk_08108CE8[super->type](this->metaTilePos, this->layer); } } -void sub_0805C050(u32 pos, u32 layer) { - SetTileType(0xb1, pos - 0x41, layer); - SetTileType(0xb2, pos - 0x40, layer); - SetTileType(0xb3, pos - 0x3f, layer); - SetTileType(0xb4, pos - 1, layer); - SetTileType(0xb7, pos + 1, layer); - if (layer == 1) { - if (AreaHasEnemies() != 0) { +void BombableWallManager_DestroyWall0(u32 metaTilePos, u32 layer) { + SetMetaTileType(META_TILE_TYPE_177, metaTilePos - 0x41, layer); + SetMetaTileType(META_TILE_TYPE_178, metaTilePos - 0x40, layer); + SetMetaTileType(META_TILE_TYPE_179, metaTilePos - 0x3f, layer); + SetMetaTileType(META_TILE_TYPE_180, metaTilePos - 1, layer); + SetMetaTileType(META_TILE_TYPE_183, metaTilePos + 1, layer); + if (layer == LAYER_BOTTOM) { + if (AreaHasEnemies()) { Entity* object = CreateObject(ARCHWAY, 0xe, 0); if (object != NULL) { - object->x.HALF.HI = ((pos & 0x3f) << 4) + 8 + gRoomControls.origin_x; - object->y.HALF.HI = ((pos & 0xfc0) >> 2) - 8 + gRoomControls.origin_y; + object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x; + object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) - 8 + gRoomControls.origin_y; } - SetTileType(0xb5, pos, 1); + SetMetaTileType(META_TILE_TYPE_181, metaTilePos, LAYER_BOTTOM); } else { - if (AreaIsDungeon() != 0) { - SetTileType(0xb5, pos, 1); + if (AreaIsDungeon()) { + SetMetaTileType(META_TILE_TYPE_181, metaTilePos, LAYER_BOTTOM); } else { - SetTileType(0xb6, pos, 1); + SetMetaTileType(META_TILE_TYPE_182, metaTilePos, LAYER_BOTTOM); } } - SetTileType(0xb8, pos - 0x41, 2); - SetTileType(0xb9, pos - 0x40, 2); - SetTileType(0xba, pos - 0x3f, 2); + SetMetaTileType(META_TILE_TYPE_184, metaTilePos - 0x41, LAYER_TOP); + SetMetaTileType(META_TILE_TYPE_185, metaTilePos - 0x40, LAYER_TOP); + SetMetaTileType(META_TILE_TYPE_186, metaTilePos - 0x3f, LAYER_TOP); } else { Entity* object; - SetTileType(0xb5, pos, 2); - if (AreaIsDungeon() == 0) { + SetMetaTileType(META_TILE_TYPE_181, metaTilePos, LAYER_TOP); + if (!AreaIsDungeon()) { return; } object = CreateObject(ARCHWAY, getArchwayType(), 6); if (object == NULL) { return; } - object->x.HALF.HI = ((pos & 0x3f) << 4) + 8 + gRoomControls.origin_x; - object->y.HALF.HI = ((pos & 0xfc0) >> 2) - 0x10 + gRoomControls.origin_y; - object->collisionLayer = 2; + object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x; + object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) - 0x10 + gRoomControls.origin_y; + object->collisionLayer = LAYER_TOP; } } -void sub_0805C178(u32 pos, u32 layer) { +void BombableWallManager_DestroyWall1(u32 metaTilePos, u32 layer) { Entity* object; - SetTileType(0xf1, pos - 0x40, layer); - SetTileType(0xf5, pos - 0x3f, layer); - SetTileType(0xf6, pos + 1, layer); - SetTileType(0xf4, pos + 0x40, layer); - SetTileType(0xf7, pos + 0x41, layer); - if (layer == 1) { - - if (AreaHasEnemies() != 0) { + SetMetaTileType(META_TILE_TYPE_241, metaTilePos - 0x40, layer); + SetMetaTileType(META_TILE_TYPE_245, metaTilePos - 0x3f, layer); + SetMetaTileType(META_TILE_TYPE_246, metaTilePos + 1, layer); + SetMetaTileType(META_TILE_TYPE_244, metaTilePos + 0x40, layer); + SetMetaTileType(META_TILE_TYPE_247, metaTilePos + 0x41, layer); + if (layer == LAYER_BOTTOM) { + if (AreaHasEnemies()) { object = CreateObject(ARCHWAY, 0xe, 1); if (object != NULL) { - object->x.HALF.HI = ((pos & 0x3f) << 4) + 0x18 + gRoomControls.origin_x; - object->y.HALF.HI = ((pos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y; + object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + 0x18 + gRoomControls.origin_x; + object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y; } - SetTileType(0xf2, pos, 1); + SetMetaTileType(META_TILE_TYPE_242, metaTilePos, LAYER_BOTTOM); } else { - if (AreaIsDungeon() != 0) { - SetTileType(0xf2, pos, 1); + if (AreaIsDungeon()) { + SetMetaTileType(META_TILE_TYPE_242, metaTilePos, LAYER_BOTTOM); } else { - SetTileType(0xf3, pos, 1); + SetMetaTileType(META_TILE_TYPE_243, metaTilePos, LAYER_BOTTOM); } } - SetTileType(0xf8, pos - 0x3f, 2); - SetTileType(0xf9, pos + 1, 2); - SetTileType(0xfa, pos + 0x41, 2); + SetMetaTileType(META_TILE_TYPE_248, metaTilePos - 0x3f, LAYER_TOP); + SetMetaTileType(META_TILE_TYPE_249, metaTilePos + 1, LAYER_TOP); + SetMetaTileType(META_TILE_TYPE_250, metaTilePos + 0x41, LAYER_TOP); } else { - SetTileType(0xf2, pos, 2); - if (AreaIsDungeon() == 0) { + SetMetaTileType(META_TILE_TYPE_242, metaTilePos, LAYER_TOP); + if (!AreaIsDungeon()) { return; } object = CreateObject(ARCHWAY, getArchwayType(), 7); if (object == NULL) { return; } - object->x.HALF.HI = ((pos & 0x3f) << 4) + 0x20 + gRoomControls.origin_x; - object->y.HALF.HI = ((pos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y; - object->collisionLayer = 2; + object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + 0x20 + gRoomControls.origin_x; + object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y; + object->collisionLayer = LAYER_TOP; } } -void sub_0805C294(u32 pos, u32 layer) { +void BombableWallManager_DestroyWall2(u32 metaTilePos, u32 layer) { Entity* object; - SetTileType(0xd1, pos - 1, layer); - SetTileType(0xd4, pos + 1, layer); - SetTileType(0xd5, pos + 0x3f, layer); - SetTileType(0xd6, pos + 0x40, layer); - SetTileType(0xd7, pos + 0x41, layer); - if (layer == 1) { - if (AreaHasEnemies() != 0) { + SetMetaTileType(META_TILE_TYPE_209, metaTilePos - 1, layer); + SetMetaTileType(META_TILE_TYPE_212, metaTilePos + 1, layer); + SetMetaTileType(META_TILE_TYPE_213, metaTilePos + 0x3f, layer); + SetMetaTileType(META_TILE_TYPE_214, metaTilePos + 0x40, layer); + SetMetaTileType(META_TILE_TYPE_215, metaTilePos + 0x41, layer); + if (layer == LAYER_BOTTOM) { + if (AreaHasEnemies()) { object = CreateObject(ARCHWAY, 0xe, 2); if (object != NULL) { - object->x.HALF.HI = ((pos & 0x3f) << 4) + 8 + gRoomControls.origin_x; - object->y.HALF.HI = ((pos & 0xfc0) >> 2) + 0x20 + gRoomControls.origin_y; + object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x; + object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) + 0x20 + gRoomControls.origin_y; } - SetTileType(0xd2, pos, 1); + SetMetaTileType(META_TILE_TYPE_210, metaTilePos, LAYER_BOTTOM); } else { - if (AreaIsDungeon() != 0) { - SetTileType(0xd2, pos, 1); + if (AreaIsDungeon()) { + SetMetaTileType(META_TILE_TYPE_210, metaTilePos, LAYER_BOTTOM); } else { - SetTileType(0xd3, pos, 1); + SetMetaTileType(META_TILE_TYPE_211, metaTilePos, LAYER_BOTTOM); } } - SetTileType(0xd8, pos + 0x3f, 2); - SetTileType(0xd9, pos + 0x40, 2); - SetTileType(0xda, pos + 0x41, 2); + SetMetaTileType(META_TILE_TYPE_216, metaTilePos + 0x3f, LAYER_TOP); + SetMetaTileType(META_TILE_TYPE_217, metaTilePos + 0x40, LAYER_TOP); + SetMetaTileType(META_TILE_TYPE_218, metaTilePos + 0x41, LAYER_TOP); } else { - SetTileType(0xd2, pos, 2); + SetMetaTileType(META_TILE_TYPE_210, metaTilePos, LAYER_TOP); if (AreaIsDungeon() == 0) { return; } @@ -216,41 +216,41 @@ void sub_0805C294(u32 pos, u32 layer) { if (object == NULL) { return; } - object->x.HALF.HI = ((pos & 0x3f) << 4) + 8 + gRoomControls.origin_x; - object->y.HALF.HI = ((pos & 0xfc0) >> 2) + 0x20 + gRoomControls.origin_y; - object->collisionLayer = 2; + object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x; + object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) + 0x20 + gRoomControls.origin_y; + object->collisionLayer = LAYER_TOP; } } -void sub_0805C3B4(u32 pos, u32 layer) { +void BombableWallManager_DestroyWall3(u32 metaTilePos, u32 layer) { Entity* object; - SetTileType(0xe1, pos - 0x41, layer); - SetTileType(0xe4, pos - 0x40, layer); - SetTileType(0xe2, pos - 1, layer); - SetTileType(0xe3, pos + 0x3f, layer); - SetTileType(0xe7, pos + 0x40, layer); - if (layer == 1) { - if (AreaHasEnemies() != 0) { + SetMetaTileType(META_TILE_TYPE_225, metaTilePos - 0x41, layer); + SetMetaTileType(META_TILE_TYPE_228, metaTilePos - 0x40, layer); + SetMetaTileType(META_TILE_TYPE_226, metaTilePos - 1, layer); + SetMetaTileType(META_TILE_TYPE_227, metaTilePos + 0x3f, layer); + SetMetaTileType(META_TILE_TYPE_231, metaTilePos + 0x40, layer); + if (layer == LAYER_BOTTOM) { + if (AreaHasEnemies()) { object = CreateObject(ARCHWAY, 0xe, 3); if (object != NULL) { - object->x.HALF.HI = ((pos & 0x3f) << 4) + -0x10 + gRoomControls.origin_x; - object->y.HALF.HI = ((pos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y; + object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + -0x10 + gRoomControls.origin_x; + object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y; } - SetTileType(0xe5, pos, 1); + SetMetaTileType(META_TILE_TYPE_229, metaTilePos, LAYER_BOTTOM); } else { - if (AreaIsDungeon() != 0) { - SetTileType(0xe5, pos, 1); + if (AreaIsDungeon()) { + SetMetaTileType(META_TILE_TYPE_229, metaTilePos, LAYER_BOTTOM); } else { - SetTileType(0xe6, pos, 1); + SetMetaTileType(META_TILE_TYPE_230, metaTilePos, LAYER_BOTTOM); } } - SetTileType(0xe8, pos - 0x41, 2); - SetTileType(0xe9, pos - 1, 2); - SetTileType(0xea, pos + 0x3f, 2); + SetMetaTileType(META_TILE_TYPE_232, metaTilePos - 0x41, LAYER_TOP); + SetMetaTileType(META_TILE_TYPE_233, metaTilePos - 1, LAYER_TOP); + SetMetaTileType(META_TILE_TYPE_234, metaTilePos + 0x3f, LAYER_TOP); } else { - SetTileType(0xe5, pos, 2); - if (AreaIsDungeon() == 0) { + SetMetaTileType(META_TILE_TYPE_229, metaTilePos, LAYER_TOP); + if (!AreaIsDungeon()) { return; } @@ -258,41 +258,41 @@ void sub_0805C3B4(u32 pos, u32 layer) { if (object == NULL) { return; } - object->x.HALF.HI = ((pos & 0x3f) << 4) + -0x10 + gRoomControls.origin_x; - object->y.HALF.HI = ((pos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y; - object->collisionLayer = 2; + object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + -0x10 + gRoomControls.origin_x; + object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y; + object->collisionLayer = LAYER_TOP; } } -void sub_0805C4E0(u32 pos, u32 layer) { +void BombableWallManager_DestroyWall4(u32 metaTilePos, u32 layer) { Entity* object; - SetTileType(0xc1, pos - 0x41, layer); - SetTileType(0xc2, pos - 0x40, layer); - SetTileType(0xc3, pos - 0x3f, layer); - SetTileType(0xc4, pos - 1, layer); - SetTileType(0xc7, pos + 1, layer); - if (layer == 1) { - if (AreaHasEnemies() != 0) { + SetMetaTileType(META_TILE_TYPE_193, metaTilePos - 0x41, layer); + SetMetaTileType(META_TILE_TYPE_194, metaTilePos - 0x40, layer); + SetMetaTileType(META_TILE_TYPE_195, metaTilePos - 0x3f, layer); + SetMetaTileType(META_TILE_TYPE_196, metaTilePos - 1, layer); + SetMetaTileType(META_TILE_TYPE_199, metaTilePos + 1, layer); + if (layer == LAYER_BOTTOM) { + if (AreaHasEnemies()) { object = CreateObject(ARCHWAY, 0xe, 0); if (object != NULL) { - object->x.HALF.HI = ((pos & 0x3f) << 4) + 8 + gRoomControls.origin_x; - object->y.HALF.HI = ((pos & 0xfc0) >> 2) + -0x10 + gRoomControls.origin_y; + object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x; + object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) + -0x10 + gRoomControls.origin_y; } - SetTileType(0xc5, pos, 1); + SetMetaTileType(META_TILE_TYPE_197, metaTilePos, LAYER_BOTTOM); } else { - if (AreaIsDungeon() != 0) { - SetTileType(0xc5, pos, 1); + if (AreaIsDungeon()) { + SetMetaTileType(META_TILE_TYPE_197, metaTilePos, LAYER_BOTTOM); } else { - SetTileType(0xc6, pos, 1); + SetMetaTileType(META_TILE_TYPE_198, metaTilePos, LAYER_BOTTOM); } } - SetTileType(0xc8, pos - 0x41, 2); - SetTileType(0xc9, pos - 0x40, 2); - SetTileType(0xca, pos - 0x3f, 2); + SetMetaTileType(META_TILE_TYPE_200, metaTilePos - 0x41, LAYER_TOP); + SetMetaTileType(META_TILE_TYPE_201, metaTilePos - 0x40, LAYER_TOP); + SetMetaTileType(META_TILE_TYPE_202, metaTilePos - 0x3f, LAYER_TOP); } else { - SetTileType(0xc5, pos, 2); - if (AreaIsDungeon() == 0) { + SetMetaTileType(META_TILE_TYPE_197, metaTilePos, LAYER_TOP); + if (!AreaIsDungeon()) { return; } @@ -300,9 +300,9 @@ void sub_0805C4E0(u32 pos, u32 layer) { if (object == NULL) { return; } - object->x.HALF.HI = ((pos & 0x3f) << 4) + 8 + gRoomControls.origin_x; - object->y.HALF.HI = ((pos & 0xfc0) >> 2) + -0x10 + gRoomControls.origin_y; - object->collisionLayer = 2; + object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x; + object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) + -0x10 + gRoomControls.origin_y; + object->collisionLayer = LAYER_TOP; } } diff --git a/src/manager/destructibleTileObserveManager.c b/src/manager/destructibleTileObserveManager.c index 81a8ef05..076d7b04 100644 --- a/src/manager/destructibleTileObserveManager.c +++ b/src/manager/destructibleTileObserveManager.c @@ -29,7 +29,7 @@ void DestructibleTileObserveManager_Main(DestructibleTileObserveManager* this) { void sub_0805CFF0(DestructibleTileObserveManager_unk* param_1) { if (!CheckLocalFlag(param_1->flag)) { - u32 tileType = GetTileType(param_1->tilePos, param_1->tileLayer); + u32 tileType = GetMetaTileType(param_1->tilePos, param_1->tileLayer); if (param_1->tileType == tileType) { SetLocalFlag(param_1->flag); } diff --git a/src/manager/diggingCaveEntranceManager.c b/src/manager/diggingCaveEntranceManager.c index 8df2d747..ac00ea52 100644 --- a/src/manager/diggingCaveEntranceManager.c +++ b/src/manager/diggingCaveEntranceManager.c @@ -53,9 +53,9 @@ void DiggingCaveEntranceManager_Init(DiggingCaveEntranceManager* this) { tile = 0x81 << 7; // 0x4080 for (entrance = GetDiggingCaveEntranceForRoom(entrance, room); entrance != 0; entrance = GetDiggingCaveEntranceForRoom(entrance, room)) { - SetTile(tile, entrance->sourceTilePosition + TILE_POS(-1, 1), 1); - SetTile(tile, entrance->sourceTilePosition + TILE_POS(0, 1), 1); - SetTile(tile, entrance->sourceTilePosition + TILE_POS(1, 1), 1); + SetMetaTile(tile, entrance->sourceTilePosition + TILE_POS(-1, 1), 1); + SetMetaTile(tile, entrance->sourceTilePosition + TILE_POS(0, 1), 1); + SetMetaTile(tile, entrance->sourceTilePosition + TILE_POS(1, 1), 1); entrance++; } } diff --git a/src/manager/flameManager.c b/src/manager/flameManager.c index 880324fd..35d20216 100644 --- a/src/manager/flameManager.c +++ b/src/manager/flameManager.c @@ -14,19 +14,19 @@ void FlameManager_Main(FlameManager* this) { if (super->action == 0) { this->field_0x38 = TILE(this->field_0x38, this->field_0x3a); - if (GetTileType(this->field_0x38, 2) == 0x75) { + if (GetMetaTileType(this->field_0x38, 2) == 0x75) { super->action = 1; - SetTile(0x406a, this->field_0x38, 1); + SetMetaTile(0x406a, this->field_0x38, 1); } else { DeleteThisEntity(); } } - if (GetTileType(this->field_0x38, 1) == 0x406b) { + if (GetMetaTileType(this->field_0x38, 1) == 0x406b) { sub_0807B7D8(0x76, this->field_0x38, 2); DeleteThisEntity(); } - if (GetTileType(this->field_0x38, 2) == 0x76) { - SetTile(0x406b, this->field_0x38, 1); + if (GetMetaTileType(this->field_0x38, 2) == 0x76) { + SetMetaTile(0x406b, this->field_0x38, 1); DeleteThisEntity(); } } diff --git a/src/manager/holeManager.c b/src/manager/holeManager.c index 563eee3b..c94155f5 100644 --- a/src/manager/holeManager.c +++ b/src/manager/holeManager.c @@ -14,7 +14,6 @@ extern void (*const HoleManager_Actions[])(HoleManager*); -extern u8 gGlobalGfxAndPalettes[]; void HoleManager_Main(HoleManager* this) { HoleManager_Actions[super->action](this); diff --git a/src/manager/lightLevelSetManager.c b/src/manager/lightLevelSetManager.c index c111e3f7..cbc8fd3c 100644 --- a/src/manager/lightLevelSetManager.c +++ b/src/manager/lightLevelSetManager.c @@ -10,6 +10,7 @@ #include "game.h" #include "object.h" #include "room.h" +#include "tiles.h" void sub_0805BE94(LightLevelSetManager*); void sub_0805BEC4(LightLevelSetManager*); @@ -17,7 +18,7 @@ void LightLevelSetManager_Type0(LightLevelSetManager*); void LightLevelSetManager_Type1(LightLevelSetManager*); void LightLevelSetManager_Type2(LightLevelSetManager*); void LightLevelSetManager_Type3(LightLevelSetManager*); -void sub_0805BE70(LightLevelSetManager*, u32); +void sub_0805BE70(LightLevelSetManager* this, u32 metaTileType); void LightLevelSetManager_Main(Manager* this) { static void (*const LightLevelSetManager_Types[])(LightLevelSetManager*) = { @@ -49,7 +50,7 @@ void LightLevelSetManager_Type1(LightLevelSetManager* this) { super->action = 1; super->subtimer = 30; if (CheckFlags(this->field_0x3e) != 0) { - sub_0805BE70(this, 0x75); + sub_0805BE70(this, META_TILE_TYPE_117); super->action = 2; } break; @@ -57,13 +58,13 @@ void LightLevelSetManager_Type1(LightLevelSetManager* this) { if (CheckFlags(this->field_0x3e) != 0 && --super->subtimer == 0) { super->subtimer = 30; sub_0805BEC4(this); - sub_0805BE70(this, 0x76); + sub_0805BE70(this, META_TILE_TYPE_118); } break; case 2: if (CheckFlags(this->field_0x3e) == 0 && --super->subtimer == 0) { super->subtimer = 30; - sub_0805BE70(this, 0x75); + sub_0805BE70(this, META_TILE_TYPE_117); } break; } @@ -78,7 +79,7 @@ void LightLevelSetManager_Type2(LightLevelSetManager* this) { ((s16)this->field_0x38 >> 4 & 0x3fU) | ((s32)((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6); super->action = 1; } else { - if (GetTileType(this->field_0x20, super->type2) == 0x76) { + if (GetMetaTileType(this->field_0x20, super->type2) == 0x76) { SetFlag(this->field_0x3e); ChangeLightLevel(super->timer); DeleteThisEntity(); @@ -102,7 +103,7 @@ void LightLevelSetManager_Type3(LightLevelSetManager* this) { break; case 1: - if (GetTileType(this->field_0x20, super->type2) != 0x76) { + if (GetMetaTileType(this->field_0x20, super->type2) != 0x76) { return; } SetFlag(this->field_0x3e); @@ -130,14 +131,14 @@ void LightLevelSetManager_Type3(LightLevelSetManager* this) { } } -void sub_0805BE70(LightLevelSetManager* this, u32 param_2) { - SetTileType(param_2, +void sub_0805BE70(LightLevelSetManager* this, u32 metaTileType) { + SetMetaTileType(metaTileType, ((this->field_0x38 << 0x10) >> 0x14 & 0x3fU) | ((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6, super->type2); } void sub_0805BE94(LightLevelSetManager* this) { - SetTileType(0x76, ((this->field_0x38 << 0x10) >> 0x14 & 0x3fU) | ((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6, + SetMetaTileType(META_TILE_TYPE_118, ((this->field_0x38 << 0x10) >> 0x14 & 0x3fU) | ((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6, super->type2); ChangeLightLevel(super->timer); DeleteThisEntity(); diff --git a/src/manager/manager29.c b/src/manager/manager29.c index 0b12fe46..f1dcce72 100644 --- a/src/manager/manager29.c +++ b/src/manager/manager29.c @@ -27,15 +27,15 @@ void Manager29_Main(Manager29* this) { } void sub_0805CBD0(Manager29* this) { - LayerStruct* layer; + MapLayer* mapLayer; super->action = 1; this->unk_38 = (this->unk_38 >> 4 & 0x3fU) | (((this->unk_3a << 0x10) >> 0x14 & 0x3fU) << 6); this->unk_3a = (this->unk_3c >> 4 & 0x3f) | (((this->unk_36 + this->unk_37 * 0x100) >> 4 & 0x3fU) << 6); - this->unk_3c = GetTileType(this->unk_38, this->layer); - layer = GetLayerByIndex(this->layer); - this->unk_28 = (u16*)layer->metatileTypes; - this->unk_2c = &layer->mapData[(s16)this->unk_3a]; + this->unk_3c = GetMetaTileType(this->unk_38, this->layer); + mapLayer = GetLayerByIndex(this->layer); + this->unk_28 = (u16*)mapLayer->metatileTypes; + this->unk_2c = &mapLayer->mapData[(s16)this->unk_3a]; } void sub_0805CC3C(Manager29* this) { diff --git a/src/manager/minishPortalManager.c b/src/manager/minishPortalManager.c index 2107d6ef..ea3ae958 100644 --- a/src/manager/minishPortalManager.c +++ b/src/manager/minishPortalManager.c @@ -13,6 +13,7 @@ #include "player.h" #include "room.h" #include "sound.h" +#include "tiles.h" bool32 PortalReadyForMinish(void); @@ -41,7 +42,7 @@ void MinishPortalManager_Main(MinishPortalManager* this) { gArea.portal_mode = 3; } } - if (GetVvvAtRoomCoords(this->unk_38, this->unk_3a, super->timer) == 0x3d) { + if (GetVvvAtRoomCoords(this->unk_38, this->unk_3a, super->timer) == VVV_61) { CreateMagicSparkles(this->unk_38 + gRoomControls.origin_x, this->unk_3a + gRoomControls.origin_y, super->timer); if (super->subtimer == 0) { diff --git a/src/manager/miscManager.c b/src/manager/miscManager.c index 86662f3b..68a034a0 100644 --- a/src/manager/miscManager.c +++ b/src/manager/miscManager.c @@ -123,7 +123,7 @@ void sub_08058F44(u32 x, u32 y, u32 flag) { return; if (sub_080B1A48(x, y, 1) != 0x61) return; - SetTileType(0x26, ((x >> 4) & 0x3F) | (((y >> 4) & 0x3F) << 6), 1); + SetMetaTileType(0x26, ((x >> 4) & 0x3F) | (((y >> 4) & 0x3F) << 6), 1); sub_08058F84(x, y); } @@ -240,7 +240,7 @@ void MiscManager_Type5(MiscManager* this) { DeleteThisEntity(); } super->action = 1; - SetTileType(0x365, TILE_LOCAL(this->x, this->y), super->type2); + SetMetaTileType(0x365, TILE_LOCAL(this->x, this->y), super->type2); break; case 1: if (CheckFlags(this->flags)) { @@ -339,9 +339,9 @@ void sub_0805930C(MiscManager* this) { } void SetDirtTile(u32 tile) { - SetTileType(CUT_GRASS, tile, 1); - SetTileType(0, tile, 2); - SetTileType(0, tile - 0x40, 2); + SetMetaTileType(CUT_GRASS, tile, 1); + SetMetaTileType(0, tile, 2); + SetMetaTileType(0, tile - 0x40, 2); } void MiscManager_TypeA(MiscManager* this) { diff --git a/src/manager/railIntersectionManager.c b/src/manager/railIntersectionManager.c index 68a16d2e..12b1ab56 100644 --- a/src/manager/railIntersectionManager.c +++ b/src/manager/railIntersectionManager.c @@ -45,5 +45,5 @@ void RailIntersectionManager_Action1(RailIntersectionManager* this) { void sub_0805B778(RailIntersectionManager* this) { static const u16 gUnk_08108C9C[] = { 0x358, 0x359, 0x356, 0x35a, 0x35a, 0x357 }; - SetTileType(gUnk_08108C9C[super->type * 2 + super->type2], this->field_0x38, this->field_0x36); + SetMetaTileType(gUnk_08108C9C[super->type * 2 + super->type2], this->field_0x38, this->field_0x36); } diff --git a/src/manager/tilePuzzleManager.c b/src/manager/tilePuzzleManager.c index a229878f..19a91373 100644 --- a/src/manager/tilePuzzleManager.c +++ b/src/manager/tilePuzzleManager.c @@ -30,7 +30,7 @@ void TilePuzzleManager_Main(TilePuzzleManager* this) { this->player_current_tile = COORD_TO_TILE((&gPlayerEntity)); if (this->player_current_tile != this->player_previous_tile) { this->player_previous_tile = this->player_current_tile; - switch (GetTileType(this->player_current_tile, super->type2)) { + switch (GetMetaTileType(this->player_current_tile, super->type2)) { case 0x317: // stepped on a red tile again super->action = FAILED; diff --git a/src/manager/waterfallBottomManager.c b/src/manager/waterfallBottomManager.c index d449a3ae..18ab0efa 100644 --- a/src/manager/waterfallBottomManager.c +++ b/src/manager/waterfallBottomManager.c @@ -10,7 +10,7 @@ #include "functions.h" void WaterfallBottomManager_Main(WaterfallBottomManager* this) { - SetTile(0x4014, 0x5c3, 1); + SetMetaTile(0x4014, 0x5c3, 1); if ((gRoomControls.origin_y + 200 < gPlayerEntity.y.HALF.HI) && ((u32)(gPlayerEntity.x.HALF.HI - gRoomControls.origin_x) - 0x30 < 0x11)) { gPlayerEntity.collisionLayer = 3; diff --git a/src/movement.c b/src/movement.c index 6e87133b..4704f51b 100644 --- a/src/movement.c +++ b/src/movement.c @@ -2162,7 +2162,7 @@ bool32 ProcessMovement3(Entity* this) { } bool32 sub_080AF0C8(Entity* this) { - u32 tileType = GetTileTypeByEntity(this); + u32 tileType = GetMetaTileTypeByEntity(this); switch (tileType) { case 0x87: if (((this->direction + 7) & 0x1f) < 0x10) { diff --git a/src/npc/castorWildsStatue.c b/src/npc/castorWildsStatue.c index c0557905..ec133e80 100644 --- a/src/npc/castorWildsStatue.c +++ b/src/npc/castorWildsStatue.c @@ -67,20 +67,20 @@ void sub_08067418(Entity* this) { this->field_0x74.HWORD = COORD_TO_TILE(this); if (this->type == 0) { this->hitbox = (Hitbox*)&gUnk_08110E94; - SetTile(0x4022, this->field_0x74.HWORD - 1, this->collisionLayer); - SetTile(0x4022, this->field_0x74.HWORD, this->collisionLayer); - SetTile(0x4022, this->field_0x74.HWORD + 0x3f, this->collisionLayer); - SetTile(0x4022, this->field_0x74.HWORD + 0x40, this->collisionLayer); + SetMetaTile(0x4022, this->field_0x74.HWORD - 1, this->collisionLayer); + SetMetaTile(0x4022, this->field_0x74.HWORD, this->collisionLayer); + SetMetaTile(0x4022, this->field_0x74.HWORD + 0x3f, this->collisionLayer); + SetMetaTile(0x4022, this->field_0x74.HWORD + 0x40, this->collisionLayer); } else { this->collisionLayer = 3; this->spriteOrientation.flipY = 1; this->spriteRendering.b3 = 1; this->spritePriority.b0 = 2; if (CheckLocalFlag(HIKYOU_00_SEKIZOU) == 0) { - SetTile(0x4022, 0xe81, 1); - SetTile(0x4022, 0xe82, 1); - SetTile(0x4022, 0xe83, 1); - SetTile(0x4022, 0xec3, 1); + SetMetaTile(0x4022, 0xe81, 1); + SetMetaTile(0x4022, 0xe82, 1); + SetMetaTile(0x4022, 0xe83, 1); + SetMetaTile(0x4022, 0xec3, 1); } } sub_0807DD50(this); diff --git a/src/npc/clothesRack.c b/src/npc/clothesRack.c index 883999f8..62a1e07e 100644 --- a/src/npc/clothesRack.c +++ b/src/npc/clothesRack.c @@ -31,12 +31,12 @@ void sub_0806DD90(Entity* this) { InitializeAnimation(this, uVar2); x = this->x.HALF.HI; y = this->y.HALF.HI; - SetTile(0x4072, TILE(x - 0x18, y - 0x10), this->collisionLayer); - SetTile(0x4072, TILE(x - 0x18, y), this->collisionLayer); - SetTile(0x4072, TILE(x - 0x18, y + 0x10), this->collisionLayer); - SetTile(0x4072, TILE(x + 0x18, y - 0x10), this->collisionLayer); - SetTile(0x4072, TILE(x + 0x18, y), this->collisionLayer); - SetTile(0x4072, TILE(x + 0x18, y + 0x10), this->collisionLayer); + SetMetaTile(0x4072, TILE(x - 0x18, y - 0x10), this->collisionLayer); + SetMetaTile(0x4072, TILE(x - 0x18, y), this->collisionLayer); + SetMetaTile(0x4072, TILE(x - 0x18, y + 0x10), this->collisionLayer); + SetMetaTile(0x4072, TILE(x + 0x18, y - 0x10), this->collisionLayer); + SetMetaTile(0x4072, TILE(x + 0x18, y), this->collisionLayer); + SetMetaTile(0x4072, TILE(x + 0x18, y + 0x10), this->collisionLayer); } void sub_0806DEC8(Entity* this) { diff --git a/src/npc/dampe.c b/src/npc/dampe.c index fad25893..ed638b1a 100644 --- a/src/npc/dampe.c +++ b/src/npc/dampe.c @@ -93,10 +93,10 @@ void sub_0806BEC8(Entity* this, ScriptExecutionContext* context) { } void sub_0806BEFC(void) { - SetTileType(0x17E, 0x58E, 1); - SetTileType(0x17F, 0x58F, 1); - SetTileType(0x180, 0x5CE, 1); - SetTileType(0x181, 0x5CF, 1); + SetMetaTileType(0x17E, 0x58E, 1); + SetMetaTileType(0x17F, 0x58F, 1); + SetMetaTileType(0x180, 0x5CE, 1); + SetMetaTileType(0x181, 0x5CF, 1); } void sub_0806BF44(Entity* this, ScriptExecutionContext* context) { diff --git a/src/npc/dog.c b/src/npc/dog.c index 10427419..df48f4ab 100644 --- a/src/npc/dog.c +++ b/src/npc/dog.c @@ -217,7 +217,7 @@ void sub_08069B44(Entity* this) { this->action = 4; } if ((this->type == 2) && (CheckLocalFlag(MACHI_02_DOG) == 0)) { - SetTile(0x4072, TILE(this->x.HALF.HI, this->y.HALF.HI - 8), this->collisionLayer); + SetMetaTile(0x4072, TILE(this->x.HALF.HI, this->y.HALF.HI - 8), this->collisionLayer); } } } diff --git a/src/npc/kid.c b/src/npc/kid.c index 806eb4df..900e3323 100644 --- a/src/npc/kid.c +++ b/src/npc/kid.c @@ -567,12 +567,12 @@ void sub_080626E0(Entity* this, ScriptExecutionContext* context) { } void sub_08062788(Entity* this, ScriptExecutionContext* context) { - SetTile(0x4072, 0x60b, 1); - SetTile(0x4072, 0x60c, 1); - SetTile(0x4072, 0x60d, 1); - SetTile(0x4072, 0x64b, 1); - SetTile(0x4072, 0x64c, 1); - SetTile(0x4072, 0x64d, 1); + SetMetaTile(0x4072, 0x60b, 1); + SetMetaTile(0x4072, 0x60c, 1); + SetMetaTile(0x4072, 0x60d, 1); + SetMetaTile(0x4072, 0x64b, 1); + SetMetaTile(0x4072, 0x64c, 1); + SetMetaTile(0x4072, 0x64d, 1); } void sub_080627E8(Entity* this, ScriptExecutionContext* context) { diff --git a/src/npc/npc4E.c b/src/npc/npc4E.c index cdfd7abe..b897a5ff 100644 --- a/src/npc/npc4E.c +++ b/src/npc/npc4E.c @@ -185,7 +185,7 @@ void sub_0806DC7C(void) { while (*tiles != 0) { u32 tile = *tiles; tiles = tiles + 1; - SetTileType(0x4072, tile, 1); + SetMetaTileType(0x4072, tile, 1); } } diff --git a/src/npc/npc5.c b/src/npc/npc5.c index d6730cba..3f1ffeff 100644 --- a/src/npc/npc5.c +++ b/src/npc/npc5.c @@ -1,8 +1,9 @@ +#include "collision.h" #include "functions.h" +#include "hitbox.h" #include "message.h" #include "npc.h" -#include "hitbox.h" -#include "collision.h" +#include "tiles.h" typedef struct { u8 unk_0; // u8 @@ -469,7 +470,12 @@ u32 sub_080611D4(Entity* this) { }; static const u8 gUnk_0810AC54[] = { - 0x2b, 0x10, 0x2a, 0x0, 0x2d, 0x8, 0x2c, 0x18, 0x0, + // vvv, animationState + VVV_43, 0x10, + VVV_42, 0x0, + VVV_45, 0x8, + VVV_44, 0x18, + 0x0, }; u32 vvv; diff --git a/src/npc/simon.c b/src/npc/simon.c index 647eae41..3bab201c 100644 --- a/src/npc/simon.c +++ b/src/npc/simon.c @@ -29,7 +29,7 @@ void sub_0806C224(void) { void Simon_CreateChest(Entity* this) { CreateObjectWithParent(this, SPECIAL_FX, FX_BIG_EXPLOSION2, 0); - SetTileType(0x73, COORD_TO_TILE(this), this->collisionLayer); + SetMetaTileType(0x73, COORD_TO_TILE(this), this->collisionLayer); SoundReq(SFX_SECRET_BIG); } diff --git a/src/npc/townMinish.c b/src/npc/townMinish.c index 9808c6e8..c0bbaad2 100644 --- a/src/npc/townMinish.c +++ b/src/npc/townMinish.c @@ -3,6 +3,7 @@ #include "functions.h" #include "item.h" #include "npc.h" +#include "tiles.h" void sub_0806ACC4(Entity*); void sub_0806ABFC(Entity*); @@ -792,8 +793,8 @@ void sub_0806B0E0(Entity* this, ScriptExecutionContext* context) { int idx = 0; // Checks if the dust is gone at these four meta tiles. - if (GetVvvAtRoomCoords(56, 184, 1) == 0x57 && GetVvvAtRoomCoords(72, 184, 1) == 0x57 && - GetVvvAtRoomCoords(56, 200, 1) == 0x57 && GetVvvAtRoomCoords(72, 200, 1) == 0x57) { + if (GetVvvAtRoomCoords(56, 184, 1) == VVV_87 && GetVvvAtRoomCoords(72, 184, 1) == VVV_87 && + GetVvvAtRoomCoords(56, 200, 1) == VVV_87 && GetVvvAtRoomCoords(72, 200, 1) == VVV_87) { idx = 1; } diff --git a/src/npc/zelda.c b/src/npc/zelda.c index 64898ef7..28952c25 100644 --- a/src/npc/zelda.c +++ b/src/npc/zelda.c @@ -172,7 +172,7 @@ void sub_08066F94(void) { while (*puVar2 != 0) { uVar1 = *puVar2; puVar2++; - SetTileType(16498, uVar1, 1); + SetMetaTileType(0x4072, uVar1, 1); } } diff --git a/src/object/angryStatue.c b/src/object/angryStatue.c index 0204c90e..99d42b58 100644 --- a/src/object/angryStatue.c +++ b/src/object/angryStatue.c @@ -29,7 +29,7 @@ void AngryStatue(Entity* this) { void AngryStatue_Init(Entity* this) { this->action = 1; this->hitbox = (Hitbox*)&gUnk_080FD178; - SetTile(0x4022, COORD_TO_TILE(this), this->collisionLayer); + SetMetaTile(0x4022, COORD_TO_TILE(this), this->collisionLayer); InitializeAnimation(this, this->type); } diff --git a/src/object/bakerOven.c b/src/object/bakerOven.c index f1689675..e0ce4ba2 100644 --- a/src/object/bakerOven.c +++ b/src/object/bakerOven.c @@ -101,12 +101,12 @@ void sub_0809CDF0(Entity* this) { (((this->y.HALF.HI - gRoomControls.origin_y) >> 4 & 0x3f) << 6); y = this->field_0x80.HWORD; - SetTile(0x402e, y - 0x01, this->collisionLayer); - SetTile(0x4022, y - 0x00, this->collisionLayer); - SetTile(0x4022, y + 0x01, this->collisionLayer); - SetTile(0x4026, y - 0x41, this->collisionLayer); - SetTile(0x4026, y - 0x40, this->collisionLayer); - SetTile(0x4024, y - 0x3f, this->collisionLayer); - SetTile(0x4026, y - 0x81, this->collisionLayer); - SetTile(0x4026, y - 0x80, this->collisionLayer); + SetMetaTile(0x402e, y - 0x01, this->collisionLayer); + SetMetaTile(0x4022, y - 0x00, this->collisionLayer); + SetMetaTile(0x4022, y + 0x01, this->collisionLayer); + SetMetaTile(0x4026, y - 0x41, this->collisionLayer); + SetMetaTile(0x4026, y - 0x40, this->collisionLayer); + SetMetaTile(0x4024, y - 0x3f, this->collisionLayer); + SetMetaTile(0x4026, y - 0x81, this->collisionLayer); + SetMetaTile(0x4026, y - 0x80, this->collisionLayer); } diff --git a/src/object/beanstalk.c b/src/object/beanstalk.c index 801c89d2..4661d43e 100644 --- a/src/object/beanstalk.c +++ b/src/object/beanstalk.c @@ -259,8 +259,8 @@ void Beanstalk_Action1Type7(BeanstalkEntity* this) { this->unk_70 = TILE(super->x.HALF.HI, this->unk_6c); while (TRUE) { this->unk_70 = TILE(super->x.HALF.HI, this->unk_6c); - SetTile(0x4017, this->unk_70, 2); - SetTile(0x4017, this->unk_70, 1); + SetMetaTile(0x4017, this->unk_70, 2); + SetMetaTile(0x4017, this->unk_70, 1); this->unk_6c += 0x10; if (this->unk_6c >= gRoomControls.origin_y + gRoomControls.height) break; @@ -309,7 +309,7 @@ void Beanstalk_Action1Type8SubAction0(BeanstalkEntity* this) { super->spriteOrientation.flipY = 2; this->unk_70 = COORD_TO_TILE(super); - SetTile(0x4017, this->unk_70, 1); + SetMetaTile(0x4017, this->unk_70, 1); super->subAction = 1; obj = CreateObjectWithParent(super, CHUCHU_BOSS_PARTICLE, 0, 0); if (obj != NULL) { @@ -341,12 +341,12 @@ void Beanstalk_Action1Type9(BeanstalkEntity* this) { if (gPlayerState.floor_type == SURFACE_LADDER) { super->spritePriority.b0 = 0; if (sub_080B1A0C(super, 0, -0x18) != 0x4014) { - SetTile(0x4014, COORD_TO_TILE_OFFSET(super, 0, 0x18), 1); + SetMetaTile(0x4014, COORD_TO_TILE_OFFSET(super, 0, 0x18), 1); } } else { super->spritePriority.b0 = 5; if (this->unk_72 != sub_080B1A0C(super, 0, -0x18)) { - SetTile(this->unk_72, COORD_TO_TILE_OFFSET(super, 0, 0x18), 1); + SetMetaTile(this->unk_72, COORD_TO_TILE_OFFSET(super, 0, 0x18), 1); } } } diff --git a/src/object/bigBarrel.c b/src/object/bigBarrel.c index f40c90a3..c08cba6a 100644 --- a/src/object/bigBarrel.c +++ b/src/object/bigBarrel.c @@ -293,7 +293,7 @@ void sub_08088F20(BigBarrelEntity* this) { pEVar3->collisionLayer = 2; pEVar3->spritePriority.b0 = 2; } - SetTileType(0x76, COORD_TO_TILE(super), 2); + SetMetaTileType(0x76, COORD_TO_TILE(super), 2); break; case 2: if (--super->timer) { diff --git a/src/object/bigIceBlock.c b/src/object/bigIceBlock.c index 0d865546..fb208a90 100644 --- a/src/object/bigIceBlock.c +++ b/src/object/bigIceBlock.c @@ -7,10 +7,10 @@ #define NENT_DEPRECATED #include "functions.h" -#include "global.h" #include "hitbox.h" #include "item.h" #include "object.h" +#include "tiles.h" typedef struct { /*0x00*/ Entity base; @@ -131,127 +131,127 @@ void sub_08099910(BigIceBlockEntity* this) { u32 uVar2; s32 vvv; u32 tileIndex; - u32 position; + u32 metaTilePos; - position = COORD_TO_TILE(super); - this->unk_6e = position; + metaTilePos = COORD_TO_TILE(super); + this->unk_6e = metaTilePos; uVar2 = (((super->x.HALF.HI & 8)) >> 0x3) + ((super->y.HALF.HI & 8) >> 2); this->unk_6c = uVar2; switch (uVar2) { default: - SetTile(0x4022, position - 0x41, super->collisionLayer); - SetTile(0x4022, position - 0x40, super->collisionLayer); - SetTile(0x4022, position - 1, super->collisionLayer); - SetTile(0x4022, position, super->collisionLayer); + SetMetaTile(0x4022, metaTilePos - 0x41, super->collisionLayer); + SetMetaTile(0x4022, metaTilePos - 0x40, super->collisionLayer); + SetMetaTile(0x4022, metaTilePos - 1, super->collisionLayer); + SetMetaTile(0x4022, metaTilePos, super->collisionLayer); break; case 1: - vvv = GetVvvAtMetaTilePos(position - 0x41, super->collisionLayer); + vvv = GetVvvAtMetaTilePos(metaTilePos - 0x41, super->collisionLayer); tileIndex = 0x4024; - if (vvv == 0x12) { + if (vvv == VVV_18) { tileIndex = 0x4079; } - SetTile(tileIndex, position - 0x41, super->collisionLayer); - SetTile(0x4022, position - 0x40, super->collisionLayer); - vvv = GetVvvAtMetaTilePos(position - 0x3f, super->collisionLayer); + SetMetaTile(tileIndex, metaTilePos - 0x41, super->collisionLayer); + SetMetaTile(0x4022, metaTilePos - 0x40, super->collisionLayer); + vvv = GetVvvAtMetaTilePos(metaTilePos - 0x3f, super->collisionLayer); tileIndex = 0x4025; - if (vvv == 0x12) { + if (vvv == VVV_18) { tileIndex = 0x407b; } - SetTile(tileIndex, position - 0x3f, super->collisionLayer); - vvv = GetVvvAtMetaTilePos(position - 1, super->collisionLayer); + SetMetaTile(tileIndex, metaTilePos - 0x3f, super->collisionLayer); + vvv = GetVvvAtMetaTilePos(metaTilePos - 1, super->collisionLayer); tileIndex = 0x4024; - if (vvv == 0x12) { + if (vvv == VVV_18) { tileIndex = 0x4079; } - SetTile(tileIndex, position - 1, super->collisionLayer); - SetTile(0x4022, position, super->collisionLayer); - vvv = GetVvvAtMetaTilePos(position + 1, super->collisionLayer); + SetMetaTile(tileIndex, metaTilePos - 1, super->collisionLayer); + SetMetaTile(0x4022, metaTilePos, super->collisionLayer); + vvv = GetVvvAtMetaTilePos(metaTilePos + 1, super->collisionLayer); tileIndex = 0x4025; - if (vvv == 0x12) { + if (vvv == VVV_18) { tileIndex = 0x407b; } - SetTile(tileIndex, position + 1, super->collisionLayer); + SetMetaTile(tileIndex, metaTilePos + 1, super->collisionLayer); return; break; case 2: - vvv = GetVvvAtMetaTilePos(position - 0x41, super->collisionLayer); + vvv = GetVvvAtMetaTilePos(metaTilePos - 0x41, super->collisionLayer); tileIndex = 0x4023; - if (vvv == 0x12) { + if (vvv == VVV_18) { tileIndex = 0x4077; } - SetTile(tileIndex, position - 0x41, super->collisionLayer); - vvv = GetVvvAtMetaTilePos(position - 0x40, super->collisionLayer); + SetMetaTile(tileIndex, metaTilePos - 0x41, super->collisionLayer); + vvv = GetVvvAtMetaTilePos(metaTilePos - 0x40, super->collisionLayer); tileIndex = 0x4023; - if (vvv == 0x12) { + if (vvv == VVV_18) { tileIndex = 0x4077; } - SetTile(tileIndex, position - 0x40, super->collisionLayer); - SetTile(0x4022, position - 1, super->collisionLayer); - SetTile(0x4022, position, super->collisionLayer); - vvv = GetVvvAtMetaTilePos(position + 0x3f, super->collisionLayer); + SetMetaTile(tileIndex, metaTilePos - 0x40, super->collisionLayer); + SetMetaTile(0x4022, metaTilePos - 1, super->collisionLayer); + SetMetaTile(0x4022, metaTilePos, super->collisionLayer); + vvv = GetVvvAtMetaTilePos(metaTilePos + 0x3f, super->collisionLayer); tileIndex = 0x4026; - if (vvv == 0x12) { + if (vvv == VVV_18) { tileIndex = 0x407c; } - SetTile(tileIndex, position + 0x3f, super->collisionLayer); - vvv = GetVvvAtMetaTilePos(position + 0x40, super->collisionLayer); + SetMetaTile(tileIndex, metaTilePos + 0x3f, super->collisionLayer); + vvv = GetVvvAtMetaTilePos(metaTilePos + 0x40, super->collisionLayer); tileIndex = 0x4026; - if (vvv == 0x12) { + if (vvv == VVV_18) { tileIndex = 0x407c; } - SetTile(tileIndex, position + 0x40, super->collisionLayer); + SetMetaTile(tileIndex, metaTilePos + 0x40, super->collisionLayer); break; case 3: - vvv = GetVvvAtMetaTilePos(position - 0x41, super->collisionLayer); + vvv = GetVvvAtMetaTilePos(metaTilePos - 0x41, super->collisionLayer); tileIndex = 0x4027; - if (vvv == 0x12) { + if (vvv == VVV_18) { tileIndex = 0x4075; } - SetTile(tileIndex, position - 0x41, super->collisionLayer); - vvv = GetVvvAtMetaTilePos(position - 0x40, super->collisionLayer); + SetMetaTile(tileIndex, metaTilePos - 0x41, super->collisionLayer); + vvv = GetVvvAtMetaTilePos(metaTilePos - 0x40, super->collisionLayer); tileIndex = 0x4023; - if (vvv == 0x12) { + if (vvv == VVV_18) { tileIndex = 0x4077; } - SetTile(tileIndex, position - 0x40, super->collisionLayer); - vvv = GetVvvAtMetaTilePos(position - 0x3f, super->collisionLayer); + SetMetaTile(tileIndex, metaTilePos - 0x40, super->collisionLayer); + vvv = GetVvvAtMetaTilePos(metaTilePos - 0x3f, super->collisionLayer); tileIndex = 0x4028; - if (vvv == 0x12) { + if (vvv == VVV_18) { tileIndex = 0x4076; } - SetTile(tileIndex, position - 0x3f, super->collisionLayer); - vvv = GetVvvAtMetaTilePos(position - 1, super->collisionLayer); + SetMetaTile(tileIndex, metaTilePos - 0x3f, super->collisionLayer); + vvv = GetVvvAtMetaTilePos(metaTilePos - 1, super->collisionLayer); tileIndex = 0x4024; - if (vvv == 0x12) { + if (vvv == VVV_18) { tileIndex = 0x4079; } - SetTile(tileIndex, position - 1, super->collisionLayer); - SetTile(0x4022, position, super->collisionLayer); - vvv = GetVvvAtMetaTilePos(position + 1, super->collisionLayer); + SetMetaTile(tileIndex, metaTilePos - 1, super->collisionLayer); + SetMetaTile(0x4022, metaTilePos, super->collisionLayer); + vvv = GetVvvAtMetaTilePos(metaTilePos + 1, super->collisionLayer); tileIndex = 0x4025; - if (vvv == 0x12) { + if (vvv == VVV_18) { tileIndex = 0x407b; } - SetTile(tileIndex, position + 1, super->collisionLayer); - vvv = GetVvvAtMetaTilePos(position + 0x3f, super->collisionLayer); + SetMetaTile(tileIndex, metaTilePos + 1, super->collisionLayer); + vvv = GetVvvAtMetaTilePos(metaTilePos + 0x3f, super->collisionLayer); tileIndex = 0x4029; - if (vvv == 0x12) { + if (vvv == VVV_18) { tileIndex = 0x4078; } - SetTile(tileIndex, position + 0x3f, super->collisionLayer); - vvv = GetVvvAtMetaTilePos(position + 0x40, super->collisionLayer); + SetMetaTile(tileIndex, metaTilePos + 0x3f, super->collisionLayer); + vvv = GetVvvAtMetaTilePos(metaTilePos + 0x40, super->collisionLayer); tileIndex = 0x4026; - if (vvv == 0x12) { + if (vvv == VVV_18) { tileIndex = 0x407c; } - SetTile(tileIndex, position + 0x40, super->collisionLayer); - vvv = GetVvvAtMetaTilePos(position + 0x41, super->collisionLayer); + SetMetaTile(tileIndex, metaTilePos + 0x40, super->collisionLayer); + vvv = GetVvvAtMetaTilePos(metaTilePos + 0x41, super->collisionLayer); tileIndex = 0x402a; - if (vvv == 0x12) { + if (vvv == VVV_18) { tileIndex = 0x407a; } - SetTile(tileIndex, position + 0x41, super->collisionLayer); + SetMetaTile(tileIndex, metaTilePos + 0x41, super->collisionLayer); break; } } diff --git a/src/object/bigPushableLever.c b/src/object/bigPushableLever.c index 1f62e640..8ea37a28 100644 --- a/src/object/bigPushableLever.c +++ b/src/object/bigPushableLever.c @@ -35,7 +35,7 @@ extern const u8 BigPushableLever_PushedOffsets[]; void BigPushableLever_SetIdle(BigPushableLeverEntity*); bool32 BigPushableLever_ShouldStartPushing(BigPushableLeverEntity*); -void BigPushableLever_SetTiles(BigPushableLeverEntity*); +void BigPushableLever_SetMetaTiles(BigPushableLeverEntity*); void BigPushableLever_CalculateSpriteOffsets(BigPushableLeverEntity*); #define TILE_INITIAL 0x4058 @@ -53,8 +53,8 @@ void BigPushableLever_Init(BigPushableLeverEntity* this) { void BigPushableLever_Idle(BigPushableLeverEntity* this) { if (BigPushableLever_ShouldStartPushing(this)) { super->action = PUSHING; - SetTile(this->tileIndexUpper, this->tilePositionUpper, super->collisionLayer); - SetTile(this->tileIndexLower, this->tilePositionLower, super->collisionLayer); + SetMetaTile(this->tileIndexUpper, this->tilePositionUpper, super->collisionLayer); + SetMetaTile(this->tileIndexLower, this->tilePositionLower, super->collisionLayer); EnqueueSFX(SFX_132); RequestPriorityDuration(super, 30); if (PlayerCanBeMoved()) { @@ -83,38 +83,38 @@ void BigPushableLever_Pushing(BigPushableLeverEntity* this) { void BigPushableLever_SetIdle(BigPushableLeverEntity* this) { super->action = IDLE; this->timer = 60; - BigPushableLever_SetTiles(this); + BigPushableLever_SetMetaTiles(this); } -void BigPushableLever_SetTiles(BigPushableLeverEntity* this) { +void BigPushableLever_SetMetaTiles(BigPushableLeverEntity* this) { if (!CheckFlags(this->pushedFlag)) { super->type2 = 0; this->tilePositionUpper = COORD_TO_TILE_OFFSET(super, 0, 0x10); this->tilePositionLower = this->tilePositionUpper - 0x40; - this->tileIndexUpper = GetTileIndex(this->tilePositionUpper, super->collisionLayer); - this->tileIndexLower = GetTileIndex(this->tilePositionLower, super->collisionLayer); - SetTile(0x4057, this->tilePositionUpper, super->collisionLayer); - SetTile(0x4058, this->tilePositionLower, super->collisionLayer); + this->tileIndexUpper = GetMetaTileIndex(this->tilePositionUpper, super->collisionLayer); + this->tileIndexLower = GetMetaTileIndex(this->tilePositionLower, super->collisionLayer); + SetMetaTile(0x4057, this->tilePositionUpper, super->collisionLayer); + SetMetaTile(0x4058, this->tilePositionLower, super->collisionLayer); InitializeAnimation(super, 1); } else { super->type2 = 1; this->tilePositionUpper = COORD_TO_TILE_OFFSET(super, 0x10, 0); this->tilePositionLower = this->tilePositionUpper - 1; - this->tileIndexUpper = GetTileIndex(this->tilePositionUpper, super->collisionLayer); - this->tileIndexLower = GetTileIndex(this->tilePositionLower, super->collisionLayer); - SetTile(0x4055, this->tilePositionUpper, super->collisionLayer); - SetTile(0x4056, this->tilePositionLower, super->collisionLayer); + this->tileIndexUpper = GetMetaTileIndex(this->tilePositionUpper, super->collisionLayer); + this->tileIndexLower = GetMetaTileIndex(this->tilePositionLower, super->collisionLayer); + SetMetaTile(0x4055, this->tilePositionUpper, super->collisionLayer); + SetMetaTile(0x4056, this->tilePositionLower, super->collisionLayer); InitializeAnimation(super, 0); } } bool32 BigPushableLever_ShouldStartPushing(BigPushableLeverEntity* this) { - if (GetTileIndex(this->tilePositionLower, super->collisionLayer) == 0x4059) { + if (GetMetaTileIndex(this->tilePositionLower, super->collisionLayer) == 0x4059) { if (--this->timer == 0) { return TRUE; } BigPushableLever_CalculateSpriteOffsets(this); - SetTile(gUnk_081236E8[super->type2], this->tilePositionLower, super->collisionLayer); + SetMetaTile(gUnk_081236E8[super->type2], this->tilePositionLower, super->collisionLayer); } else { this->timer = 60; super->spriteOffsetX = 0; diff --git a/src/object/blockPushed.c b/src/object/blockPushed.c index eb19a284..a1201014 100644 --- a/src/object/blockPushed.c +++ b/src/object/blockPushed.c @@ -46,7 +46,7 @@ void BlockPushed_Init(BlockPushedEntity* this) { super->x.HALF.HI += tmp; super->y.HALF.HI += tmp; super->hitbox = (Hitbox*)gUnk_0811F64C[super->type]; - this->unk_68 = GetTileType(pos, (u32)super->collisionLayer); + this->unk_68 = GetMetaTileType(pos, (u32)super->collisionLayer); switch (super->type) { case 0: sub_080832D8(pos, this); diff --git a/src/object/board.c b/src/object/board.c index 6bb75f1c..4aea1824 100644 --- a/src/object/board.c +++ b/src/object/board.c @@ -54,7 +54,7 @@ void Board_Init(BoardEntity* this) { UpdateSpriteForCollisionLayer(super); super->spritePriority.b0 = 6; if (super->type == 0) { - SetTile(0x4074, this->tile - 0x40, super->collisionLayer); + SetMetaTile(0x4074, this->tile - 0x40, super->collisionLayer); } sub_08098BE8(this); } diff --git a/src/object/bollard.c b/src/object/bollard.c index 20994ca3..f604ee82 100644 --- a/src/object/bollard.c +++ b/src/object/bollard.c @@ -59,7 +59,7 @@ void Bollard_Action1(BollardEntity* this) { } super->action = 2; InitializeAnimation(super, 3); - SetTile(this->tileIndex, this->tile, super->collisionLayer); + SetMetaTile(this->tileIndex, this->tile, super->collisionLayer); EnqueueSFX(SFX_1A5); } @@ -94,9 +94,9 @@ void Bollard_Action4(BollardEntity* this) { void sub_0808B3AC(BollardEntity* this) { super->spritePriority.b0 = 4; this->tile = COORD_TO_TILE(super); - this->tileIndex = GetTileIndex(this->tile, super->collisionLayer); + this->tileIndex = GetMetaTileIndex(this->tile, super->collisionLayer); this->unk74 = GetCollisionDataAtMetaTilePos(this->tile, super->collisionLayer); - SetTile(0x400b, this->tile, super->collisionLayer); + SetMetaTile(0x400b, this->tile, super->collisionLayer); } void sub_0808B41C(BollardEntity* this) { diff --git a/src/object/bossDoor.c b/src/object/bossDoor.c index c1b3bcff..8a73de50 100644 --- a/src/object/bossDoor.c +++ b/src/object/bossDoor.c @@ -177,31 +177,31 @@ void sub_0808C4BC(BossDoorEntity* this) { void sub_0808C500(BossDoorEntity* this) { if ((this->unk_76 == 0) || (this->unk_76 == 2)) { - this->unk_78 = GetTileIndex(this->unk_74 - 1, super->collisionLayer); - this->unk_7a = GetTileIndex(this->unk_74, super->collisionLayer); - this->unk_7c = GetTileIndex(this->unk_74 + 1, super->collisionLayer); - SetTile(0x4022, this->unk_74 - 1, super->collisionLayer); - SetTile(0x4022, this->unk_74, super->collisionLayer); - SetTile(0x4022, this->unk_74 + 1, super->collisionLayer); + this->unk_78 = GetMetaTileIndex(this->unk_74 - 1, super->collisionLayer); + this->unk_7a = GetMetaTileIndex(this->unk_74, super->collisionLayer); + this->unk_7c = GetMetaTileIndex(this->unk_74 + 1, super->collisionLayer); + SetMetaTile(0x4022, this->unk_74 - 1, super->collisionLayer); + SetMetaTile(0x4022, this->unk_74, super->collisionLayer); + SetMetaTile(0x4022, this->unk_74 + 1, super->collisionLayer); } else { - this->unk_78 = GetTileIndex(this->unk_74 - 0x40, super->collisionLayer); - this->unk_7a = GetTileIndex(this->unk_74, super->collisionLayer); - this->unk_7c = GetTileIndex(this->unk_74 + 0x40, super->collisionLayer); - SetTile(0x4022, this->unk_74 - 0x40, super->collisionLayer); - SetTile(0x4022, this->unk_74, super->collisionLayer); - SetTile(0x4022, this->unk_74 + 0x40, super->collisionLayer); + this->unk_78 = GetMetaTileIndex(this->unk_74 - 0x40, super->collisionLayer); + this->unk_7a = GetMetaTileIndex(this->unk_74, super->collisionLayer); + this->unk_7c = GetMetaTileIndex(this->unk_74 + 0x40, super->collisionLayer); + SetMetaTile(0x4022, this->unk_74 - 0x40, super->collisionLayer); + SetMetaTile(0x4022, this->unk_74, super->collisionLayer); + SetMetaTile(0x4022, this->unk_74 + 0x40, super->collisionLayer); } } void sub_0808C5D0(BossDoorEntity* this) { if ((this->unk_76 == 0) || (this->unk_76 == 2)) { - SetTile(this->unk_78, this->unk_74 - 1, super->collisionLayer); - SetTile(this->unk_7a, this->unk_74, super->collisionLayer); - SetTile(this->unk_7c, this->unk_74 + 1, super->collisionLayer); + SetMetaTile(this->unk_78, this->unk_74 - 1, super->collisionLayer); + SetMetaTile(this->unk_7a, this->unk_74, super->collisionLayer); + SetMetaTile(this->unk_7c, this->unk_74 + 1, super->collisionLayer); } else { - SetTile(this->unk_78, this->unk_74 - 0x40, super->collisionLayer); - SetTile(this->unk_7a, this->unk_74, super->collisionLayer); - SetTile(this->unk_7c, this->unk_74 + 0x40, super->collisionLayer); + SetMetaTile(this->unk_78, this->unk_74 - 0x40, super->collisionLayer); + SetMetaTile(this->unk_7a, this->unk_74, super->collisionLayer); + SetMetaTile(this->unk_7c, this->unk_74 + 0x40, super->collisionLayer); } } diff --git a/src/object/bush.c b/src/object/bush.c index 449b332e..9d83d3e4 100644 --- a/src/object/bush.c +++ b/src/object/bush.c @@ -69,8 +69,8 @@ void Bush_Init(BushEntity* this) { super->flags2 = 4; super->hitbox = (Hitbox*)&gUnk_081205B4; this->unk_72 = 0; - this->unk_70 = GetTileIndex(COORD_TO_TILE(super), super->collisionLayer); - SetTile(0x4022, COORD_TO_TILE(super), super->collisionLayer); + this->unk_70 = GetMetaTileIndex(COORD_TO_TILE(super), super->collisionLayer); + SetMetaTile(0x4022, COORD_TO_TILE(super), super->collisionLayer); InitializeAnimation(super, gUnk_08120588[super->type].unk_0); } diff --git a/src/object/button.c b/src/object/button.c index ff68caba..4f17877e 100644 --- a/src/object/button.c +++ b/src/object/button.c @@ -32,10 +32,10 @@ void Button_Init(Entity* this) { } this->field_0x74.HWORD = (((this->x.HALF.HI - gRoomControls.origin_x) >> 4) & 0x3F) | ((((this->y.HALF.HI - gRoomControls.origin_y) >> 4) & 0x3F) << 6); - this->field_0x70.HALF.HI = GetTileType(this->field_0x74.HWORD, this->collisionLayer); + this->field_0x70.HALF.HI = GetMetaTileType(this->field_0x74.HWORD, this->collisionLayer); if (this->type == 0 && CheckFlags(this->field_0x86.HWORD)) { this->action = 5; - SetTileType(0x7A, this->field_0x74.HWORD, this->collisionLayer); + SetMetaTileType(0x7A, this->field_0x74.HWORD, this->collisionLayer); } else { if (sub_08081E3C(this)) { this->action = 2; @@ -48,7 +48,7 @@ void Button_Init(Entity* this) { void Button_Action1(Entity* this) { if (sub_08081E3C(this)) { this->action = 2; - this->field_0x70.HALF.HI = GetTileType(this->field_0x74.HWORD, this->collisionLayer); + this->field_0x70.HALF.HI = GetMetaTileType(this->field_0x74.HWORD, this->collisionLayer); } } @@ -94,7 +94,7 @@ void Button_Action4(Entity* this) { this->timer--; if (this->subtimer != 0) { this->subtimer = 0; - SetTile(0x4035, this->field_0x74.HWORD, this->collisionLayer); + SetMetaTile(0x4035, this->field_0x74.HWORD, this->collisionLayer); } if (sub_08081CB0(this)) { this->action = 3; @@ -103,7 +103,7 @@ void Button_Action4(Entity* this) { } else { this->action = 2; ClearFlag(this->field_0x86.HWORD); - SetTileType(0x77, this->field_0x74.HWORD, this->collisionLayer); + SetMetaTileType(0x77, this->field_0x74.HWORD, this->collisionLayer); SoundReq(SFX_BUTTON_PRESS); } } @@ -120,14 +120,14 @@ u32 sub_08081CB0(Entity* this) { u16 tmp; if (sub_08081D74(this)) { this->field_0x70.HALF.LO = -1; - if (GetTileType(this->field_0x74.HWORD, this->collisionLayer) == 0x4035) { + if (GetMetaTileType(this->field_0x74.HWORD, this->collisionLayer) == 0x4035) { sub_0807B7D8(0x78, this->field_0x74.HWORD, this->collisionLayer); } return 1; } else { - tmp = GetTileType(this->field_0x74.HWORD, this->collisionLayer); + tmp = GetMetaTileType(this->field_0x74.HWORD, this->collisionLayer); if (tmp != 0x77 && tmp != 0x79 && tmp != 0x4035) { - this->field_0x70.HALF.LO = GetTileIndex(this->field_0x74.HWORD, this->collisionLayer); + this->field_0x70.HALF.LO = GetMetaTileIndex(this->field_0x74.HWORD, this->collisionLayer); return 1; } } @@ -142,7 +142,7 @@ u32 sub_08081D28(Entity* this) { if (this->field_0x70.HALF_U.LO == 0xFFFF) { return 0; } - if (GetTileIndex(this->field_0x74.HWORD, this->collisionLayer) != this->field_0x70.HALF_U.LO) { + if (GetMetaTileIndex(this->field_0x74.HWORD, this->collisionLayer) != this->field_0x70.HALF_U.LO) { return 0; } } @@ -192,7 +192,7 @@ u32 sub_08081E3C(Entity* this) { }; const u16* tmp1; s32 tmp2; - tmp2 = GetTileType(this->field_0x74.HWORD, this->collisionLayer); + tmp2 = GetMetaTileType(this->field_0x74.HWORD, this->collisionLayer); tmp1 = gUnk_0811EE50; do { if (*tmp1 == tmp2) @@ -209,26 +209,26 @@ extern u16 gMapDataBottomSpecial[]; void sub_08081E6C(Entity* this) { u32 tileType; - LayerStruct* r1; + MapLayer* mapLayer; u16* tmp2; u16* tmp; u16* tmp3; u32 tilePosition = this->field_0x74.HWORD; u32 layer = this->collisionLayer; - u32 tile = GetTileType(tilePosition, layer); + u32 tile = GetMetaTileType(tilePosition, layer); if (tile < 0x4000) return; - r1 = GetLayerByIndex(layer); + mapLayer = GetLayerByIndex(layer); tileType = (this->type == 0 ? 0x7a : 0x78); - tmp = r1->metatiles; - tmp = tmp + (r1->unkData2[tileType] << 2); + tmp = mapLayer->metatiles; + tmp = tmp + (mapLayer->unkData2[tileType] << 2); tmp2 = (layer == 2 ? gMapDataTopSpecial : gMapDataBottomSpecial); tmp2 += (((0x3f & tilePosition) << 1) + ((0xfc0 & tilePosition) << 2)); if (sub_08081F00((u32*)tmp2, (u32*)tmp)) return; - SetTileType(tileType, tilePosition, layer); - SetTile(tile, tilePosition, layer); + SetMetaTileType(tileType, tilePosition, layer); + SetMetaTile(tile, tilePosition, layer); } // Are the two tiles already set to the correct one @@ -265,11 +265,11 @@ u32 sub_08081F7C(Entity* this, u32 r7) { } else { if (this->timer == 6) { SetFlag(this->field_0x86.HWORD); - SetTileType(r7, this->field_0x74.HWORD, this->collisionLayer); + SetMetaTileType(r7, this->field_0x74.HWORD, this->collisionLayer); sub_08081F24(this); SoundReq(SFX_BUTTON_PRESS); if (this->field_0x70.HALF_U.LO != 0xFFFF) - SetTile(this->field_0x70.HALF_U.LO, this->field_0x74.HWORD, this->collisionLayer); + SetMetaTile(this->field_0x70.HALF_U.LO, this->field_0x74.HWORD, this->collisionLayer); return 0; } } diff --git a/src/object/cabinFurniture.c b/src/object/cabinFurniture.c index c2704dcd..cb1c7f15 100644 --- a/src/object/cabinFurniture.c +++ b/src/object/cabinFurniture.c @@ -44,38 +44,38 @@ void CabinFurniture_Init(CabinFurnitureEntity* this) { super->spritePriority.b0 = 6; uVar7 = this->tile; uVar6 = uVar7 - 1; - SetTile(0x4022, uVar6, uVar1); - SetTile(0x4022, uVar7, uVar1); - SetTile(0x4022, uVar7 + 1, uVar1); - SetTile(0x4022, uVar7 + 0x3f, uVar1); - SetTile(0x4022, uVar7 + 0x40, uVar1); - SetTile(0x4022, uVar7 + 0x41, uVar1); - SetTile(0x403d, uVar7 - 0x41, uVar1); - SetTile(0x403d, uVar7 - 0x40, uVar1); - SetTile(0x4026, uVar7 - 0x3f, uVar1); - SetTile(0x4026, uVar7 - 0x81, uVar1); - SetTile(0x4026, uVar7 - 0x80, uVar1); + SetMetaTile(0x4022, uVar6, uVar1); + SetMetaTile(0x4022, uVar7, uVar1); + SetMetaTile(0x4022, uVar7 + 1, uVar1); + SetMetaTile(0x4022, uVar7 + 0x3f, uVar1); + SetMetaTile(0x4022, uVar7 + 0x40, uVar1); + SetMetaTile(0x4022, uVar7 + 0x41, uVar1); + SetMetaTile(0x403d, uVar7 - 0x41, uVar1); + SetMetaTile(0x403d, uVar7 - 0x40, uVar1); + SetMetaTile(0x4026, uVar7 - 0x3f, uVar1); + SetMetaTile(0x4026, uVar7 - 0x81, uVar1); + SetMetaTile(0x4026, uVar7 - 0x80, uVar1); break; case 1: super->action = 1; uVar6 = this->tile; - SetTile(0x4022, uVar6, uVar1); - SetTile(0x4022, uVar6 + 0x40, uVar1); - SetTile(0x4025, uVar6 + 0x41, uVar1); + SetMetaTile(0x4022, uVar6, uVar1); + SetMetaTile(0x4022, uVar6 + 0x40, uVar1); + SetMetaTile(0x4025, uVar6 + 0x41, uVar1); if (CheckLocalFlag(0x4f) == 0) { - SetTile(0x402f, uVar6 + 1, uVar1); + SetMetaTile(0x402f, uVar6 + 1, uVar1); } else { - SetTile(0x402d, uVar6 + 1, uVar1); + SetMetaTile(0x402d, uVar6 + 1, uVar1); } break; case 2: super->action = 1; uVar7 = this->tile; uVar6 = uVar7 - 0x41; - SetTile(0x4022, uVar6, uVar1); - SetTile(0x4022, uVar7 - 0x40, uVar1); - SetTile(0x4022, uVar7 - 1, uVar1); - SetTile(0x4022, uVar7, uVar1); + SetMetaTile(0x4022, uVar6, uVar1); + SetMetaTile(0x4022, uVar7 - 0x40, uVar1); + SetMetaTile(0x4022, uVar7 - 1, uVar1); + SetMetaTile(0x4022, uVar7, uVar1); break; } } diff --git a/src/object/carlovObject.c b/src/object/carlovObject.c index f4ffa8a9..27a2da2a 100644 --- a/src/object/carlovObject.c +++ b/src/object/carlovObject.c @@ -95,11 +95,11 @@ void CarlovObject_Type1Init(CarlovObjectEntity* this) { this->unk_72 = super->y.HALF.HI; super->spritePriority.b0 = 5; this->unk_76 = COORD_TO_TILE(super); - this->unk_74 = GetTileIndex(this->unk_76, super->collisionLayer); + this->unk_74 = GetMetaTileIndex(this->unk_76, super->collisionLayer); if (super->timer == 0) { super->action = 1; super->subtimer = 120; - SetTile(0x4022, this->unk_76, super->collisionLayer); + SetMetaTile(0x4022, this->unk_76, super->collisionLayer); } else { super->action = 3; super->spriteSettings.draw = 0; @@ -113,7 +113,7 @@ void CarlovObject_Type1Action1(CarlovObjectEntity* this) { super->action = 2; super->timer = 7; super->direction = 0; - SetTile(this->unk_74, this->unk_76, super->collisionLayer); + SetMetaTile(this->unk_74, this->unk_76, super->collisionLayer); EnqueueSFX(SFX_10B); } } @@ -142,7 +142,7 @@ void CarlovObject_Type1Action4(CarlovObjectEntity* this) { super->action = 5; sub_08083814(super, 2); EnqueueSFX(SFX_10B); - SetTile(0x4022, this->unk_76, super->collisionLayer); + SetMetaTile(0x4022, this->unk_76, super->collisionLayer); } } diff --git a/src/object/chestSpawner.c b/src/object/chestSpawner.c index 8a721a58..a3bfe455 100644 --- a/src/object/chestSpawner.c +++ b/src/object/chestSpawner.c @@ -232,7 +232,7 @@ void ChestSpawner_Type0Init(ChestSpawnerEntity* this) { super->action++; this->tilePosition = COORD_TO_TILE(super); super->hitbox = (Hitbox*)&gUnk_0811F8A8; - if (GetTileTypeByEntity(super) == 0x74) { + if (GetMetaTileTypeByEntity(super) == 0x74) { DeleteThisEntity(); } if (CheckFlags(this->unk_86)) { @@ -271,7 +271,7 @@ void ChestSpawner_Type0Action2(ChestSpawnerEntity* this) { void ChestSpawner_Type0Action3(ChestSpawnerEntity* this) { if ((super->type == 1) || (super->type == 7)) { - if (GetTileTypeByEntity(super) == 0x74) { + if (GetMetaTileTypeByEntity(super) == 0x74) { DeleteEntity(super); } else { if (!CheckFlags(this->unk_86)) { diff --git a/src/object/crenelBeanSprout.c b/src/object/crenelBeanSprout.c index e9af7e85..e2c75700 100644 --- a/src/object/crenelBeanSprout.c +++ b/src/object/crenelBeanSprout.c @@ -10,6 +10,7 @@ #include "functions.h" #include "hitbox.h" #include "object.h" +#include "tiles.h" typedef struct { /*0x00*/ Entity base; @@ -55,13 +56,13 @@ void CrenelBeanSprout_Init(CrenelBeanSproutEntity* this) { if (CheckGlobalFlag(WATERBEAN_OUT)) { if (CheckGlobalFlag(WATERBEAN_PUT) == 0) { PositionRelative(&gPlayerEntity, super, 0, 0x10000); - SetTile(0x4022, 0xdc, super->collisionLayer); + SetMetaTile(0x4022, 0xdc, super->collisionLayer); } else { if (CheckLocalFlag(super->type2) == 0) { InitializeAnimation(super, 10); super->y.HALF.HI += 4; super->action = 4; - SetTile(0x403b, COORD_TO_TILE(super), super->collisionLayer); + SetMetaTile(0x403b, COORD_TO_TILE(super), super->collisionLayer); return; } super->type2 = 0; @@ -108,7 +109,7 @@ void CrenelBeanSprout_Init(CrenelBeanSproutEntity* this) { InitializeAnimation(super, 0xb); super->y.HALF.HI += 4; super->action = 4; - SetTile(0x4032, COORD_TO_TILE(super), super->collisionLayer); + SetMetaTile(0x4032, COORD_TO_TILE(super), super->collisionLayer); return; } else { super->type2 = 0; @@ -169,13 +170,13 @@ void CrenelBeanSprout_Action1(CrenelBeanSproutEntity* this) { tmp = gPlayerEntity.animationState & 6; this->unk_70 = ((super->x.HALF.HI + (s8)gUnk_08123184[tmp]) & -0x10) | 8; this->unk_72 = ((super->y.HALF.HI + (s8)gUnk_08123184[(tmp) + 1]) & -0x10) | 8; - if (GetVvvAtWorldCoords(this->unk_70, this->unk_72, super->collisionLayer) == 0x19) { + if (GetVvvAtWorldCoords(this->unk_70, this->unk_72, super->collisionLayer) == VVV_25) { gHUD.rActionPlayerState = R_ACTION_THROW; } else { gHUD.rActionPlayerState = R_ACTION_NONE; } PositionRelative(&gPlayerEntity, super, 0, 0x10000); - if (GetVvvAtEntity(super) == 0x19) { + if (GetVvvAtEntity(super) == VVV_25) { RestorePrevTileEntity(0xdc, super->collisionLayer); sub_08096A78(this); } @@ -234,7 +235,7 @@ void CrenelBeanSprout_Action3(CrenelBeanSproutEntity* this) { void CrenelBeanSprout_Action4(CrenelBeanSproutEntity* this) { static const u16 gUnk_0812319C[] = { 0x403c, 0x4033 }; - if (gUnk_0812319C[super->type >> 1] == GetTileTypeByEntity(super)) { + if (gUnk_0812319C[super->type >> 1] == GetMetaTileTypeByEntity(super)) { GetNextFrame(super); gPlayerState.keepFacing |= 0x80; gPlayerState.field_0xa |= 0x80; @@ -330,5 +331,5 @@ void sub_08096A78(CrenelBeanSproutEntity* this) { sub_08004168(super); super->y.HALF.HI += 4; super->action = 3; - SetTile(0x403b, COORD_TO_TILE(super), super->collisionLayer); + SetMetaTile(0x403b, COORD_TO_TILE(super), super->collisionLayer); } diff --git a/src/object/cuccoMinigame.c b/src/object/cuccoMinigame.c index f6b02dd1..3e04e6ae 100644 --- a/src/object/cuccoMinigame.c +++ b/src/object/cuccoMinigame.c @@ -363,11 +363,11 @@ void CuccoMinigame_TellObjective(void) { } void sub_080A1648(void) { - SetTileType(0x407f, 0xd36, 1); - SetTileType(0x407f, 0xd37, 1); - SetTileType(0x407f, 0xd38, 1); - SetTileType(0x407e, 0xd75, 1); - SetTileType(0x407e, 0xe75, 1); + SetMetaTileType(0x407f, 0xd36, 1); + SetMetaTileType(0x407f, 0xd37, 1); + SetMetaTileType(0x407f, 0xd38, 1); + SetMetaTileType(0x407e, 0xd75, 1); + SetMetaTileType(0x407e, 0xe75, 1); } void sub_080A169C(void) { diff --git a/src/object/doubleBookshelf.c b/src/object/doubleBookshelf.c index 877c3014..ef7c3484 100644 --- a/src/object/doubleBookshelf.c +++ b/src/object/doubleBookshelf.c @@ -74,7 +74,7 @@ void DoubleBookshelf_Init(DoubleBookshelfEntity* this) { } void DoubleBookshelf_Action1(DoubleBookshelfEntity* this) { - GetTileType(this->unk_82, super->collisionLayer); + GetMetaTileType(this->unk_82, super->collisionLayer); sub_0809B234(this); } @@ -100,39 +100,39 @@ void sub_0809B0B0(DoubleBookshelfEntity* this) { case 0: this->unk_84 = 0; this->unk_82 = position + 2; - SetTile(0x4082, position - 1, layer); - SetTile(0x4022, position, layer); - SetTile(0x4022, position + 1, layer); - SetTile(0x4022, position + 2, layer); + SetMetaTile(0x4082, position - 1, layer); + SetMetaTile(0x4022, position, layer); + SetMetaTile(0x4022, position + 1, layer); + SetMetaTile(0x4022, position + 2, layer); break; case 1: this->unk_84 = 1; this->unk_82 = position; - SetTile(0x405f, position, layer); - SetTile(0x4022, position + 1, layer); - SetTile(0x4022, position + 2, layer); - SetTile(0x4082, position + 3, layer); + SetMetaTile(0x405f, position, layer); + SetMetaTile(0x4022, position + 1, layer); + SetMetaTile(0x4022, position + 2, layer); + SetMetaTile(0x4082, position + 3, layer); break; case 2: this->unk_84 = 1; this->unk_82 = position; - SetTile(0x4082, position + 3, layer); - SetTile(0x4022, position + 2, layer); - SetTile(0x405f, position, layer); + SetMetaTile(0x4082, position + 3, layer); + SetMetaTile(0x4022, position + 2, layer); + SetMetaTile(0x405f, position, layer); SetFlag(((DoubleBookshelfEntity*)super->parent)->unk_86); break; case 3: this->unk_84 = 0; this->unk_82 = position + 2; - SetTile(0x4082, position - 1, layer); - SetTile(0x4022, position, layer); - SetTile(0x405f, position + 2, layer); + SetMetaTile(0x4082, position - 1, layer); + SetMetaTile(0x4022, position, layer); + SetMetaTile(0x405f, position + 2, layer); ClearFlag(((DoubleBookshelfEntity*)super->parent)->unk_86); break; case 4: - SetTile(0x4022, position, layer); - SetTile(0x4022, position + 1, layer); - SetTile(0x4022, position + 2, layer); + SetMetaTile(0x4022, position, layer); + SetMetaTile(0x4022, position + 1, layer); + SetMetaTile(0x4022, position + 2, layer); break; } } @@ -159,7 +159,7 @@ void sub_0809B274(DoubleBookshelfEntity* this) { case 1: if (player->x.HALF.HI + 0x1c > super->x.HALF.HI) { this->unk_84 = 2; - SetTile(0x4022, this->unk_80 + 2, 1); + SetMetaTile(0x4022, this->unk_80 + 2, 1); sub_0809B358((DoubleBookshelfEntity*)super->child); return; } @@ -184,7 +184,7 @@ void sub_0809B334(DoubleBookshelfEntity* this) { s32 index; u32 position = this->unk_80 - 0x81; for (index = 2; index >= 0; index--, position++) { - SetTile(0x4026, position, 1); + SetMetaTile(0x4026, position, 1); } } @@ -196,7 +196,7 @@ void sub_0809B358(DoubleBookshelfEntity* this) { const u16* array = &gUnk_08123D68[this->unk_84]; u32 position = this->unk_80 - 0x82; for (index = 4; index >= 0;) { - SetTile(*array, position, 1); + SetMetaTile(*array, position, 1); index--; position++; array += 2; diff --git a/src/object/figurineDevice.c b/src/object/figurineDevice.c index bf406be3..abaa443a 100644 --- a/src/object/figurineDevice.c +++ b/src/object/figurineDevice.c @@ -307,9 +307,9 @@ void sub_08087F58(FigurineDeviceEntity* this) { switch (super->type) { case 0: case 1: - SetTile(0x4022, this->unk_78 - 1, 1); - SetTile(0x4022, this->unk_78, 1); - SetTile(0x4022, this->unk_78 + 1, 1); + SetMetaTile(0x4022, this->unk_78 - 1, 1); + SetMetaTile(0x4022, this->unk_78, 1); + SetMetaTile(0x4022, this->unk_78 + 1, 1); break; } } diff --git a/src/object/fireplace.c b/src/object/fireplace.c index 57a7cef9..830cf0b8 100644 --- a/src/object/fireplace.c +++ b/src/object/fireplace.c @@ -29,7 +29,7 @@ void Fireplace_Init(Entity* this) { DeleteThisEntity(); } else { sub_0807B7D8(0x30b, TILE(this->x.HALF.HI, this->y.HALF.HI), 2); - SetTile(0x4061, TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer); + SetMetaTile(0x4061, TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer); } Fireplace_Action1(this); } @@ -43,7 +43,7 @@ void Fireplace_Action1(Entity* this) { } void sub_0809B7C0(Entity* this) { - u32 tileType = GetTileTypeByEntity(this); + u32 tileType = GetMetaTileTypeByEntity(this); if (tileType != 0x4061 && tileType != 0x4062) { sub_0809B7DC(this); } @@ -51,6 +51,6 @@ void sub_0809B7C0(Entity* this) { void sub_0809B7DC(Entity* this) { sub_0807B7D8(0xc3 << 2, TILE(this->x.HALF.HI, this->y.HALF.HI), 2); - SetTile(0x4062, TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer); + SetMetaTile(0x4062, TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer); this->timer = 1; } diff --git a/src/object/frozenWaterElement.c b/src/object/frozenWaterElement.c index 377dd87c..52a1f814 100644 --- a/src/object/frozenWaterElement.c +++ b/src/object/frozenWaterElement.c @@ -115,33 +115,33 @@ void FrozenWaterElement_Action2(FrozenWaterElementEntity* this) { void sub_0809C0A8(FrozenWaterElementEntity* this) { u32 position = COORD_TO_TILE(super); - SetTile(0x4022, position - 0x41, super->collisionLayer); - SetTile(0x4022, position - 0x40, super->collisionLayer); - SetTile(0x4022, position - 0x3f, super->collisionLayer); - SetTile(0x4022, position - 2, super->collisionLayer); - SetTile(0x4022, position - 1, super->collisionLayer); - SetTile(0x4022, position, super->collisionLayer); - SetTile(0x4022, position + 1, super->collisionLayer); - SetTile(0x4022, position + 2, super->collisionLayer); - SetTile(0x4022, position + 0x3e, super->collisionLayer); - SetTile(0x4022, position + 0x3f, super->collisionLayer); - SetTile(0x4022, position + 0x40, super->collisionLayer); - SetTile(0x4022, position + 0x41, super->collisionLayer); - SetTile(0x4022, position + 0x42, super->collisionLayer); - SetTile(0x4022, position + 0x7f, super->collisionLayer); - SetTile(0x4022, position + 0x80, super->collisionLayer); - SetTile(0x4022, position + 0x81, super->collisionLayer); - SetTile(0x4022, position + 0x13f, super->collisionLayer); - SetTile(0x4022, position + 0x140, super->collisionLayer); - SetTile(0x4022, position + 0x141, super->collisionLayer); - SetTile(0x4022, position + 0x17f, super->collisionLayer); - SetTile(0x4022, position + 0x181, super->collisionLayer); - SetTile(0x4022, position + 0x1bd, super->collisionLayer); - SetTile(0x4022, position + 0x1be, super->collisionLayer); - SetTile(0x4022, position + 0x1bf, super->collisionLayer); - SetTile(0x4022, position + 0x1c1, super->collisionLayer); - SetTile(0x4022, position + 0x1c2, super->collisionLayer); - SetTile(0x4022, position + 0x1c3, super->collisionLayer); + SetMetaTile(0x4022, position - 0x41, super->collisionLayer); + SetMetaTile(0x4022, position - 0x40, super->collisionLayer); + SetMetaTile(0x4022, position - 0x3f, super->collisionLayer); + SetMetaTile(0x4022, position - 2, super->collisionLayer); + SetMetaTile(0x4022, position - 1, super->collisionLayer); + SetMetaTile(0x4022, position, super->collisionLayer); + SetMetaTile(0x4022, position + 1, super->collisionLayer); + SetMetaTile(0x4022, position + 2, super->collisionLayer); + SetMetaTile(0x4022, position + 0x3e, super->collisionLayer); + SetMetaTile(0x4022, position + 0x3f, super->collisionLayer); + SetMetaTile(0x4022, position + 0x40, super->collisionLayer); + SetMetaTile(0x4022, position + 0x41, super->collisionLayer); + SetMetaTile(0x4022, position + 0x42, super->collisionLayer); + SetMetaTile(0x4022, position + 0x7f, super->collisionLayer); + SetMetaTile(0x4022, position + 0x80, super->collisionLayer); + SetMetaTile(0x4022, position + 0x81, super->collisionLayer); + SetMetaTile(0x4022, position + 0x13f, super->collisionLayer); + SetMetaTile(0x4022, position + 0x140, super->collisionLayer); + SetMetaTile(0x4022, position + 0x141, super->collisionLayer); + SetMetaTile(0x4022, position + 0x17f, super->collisionLayer); + SetMetaTile(0x4022, position + 0x181, super->collisionLayer); + SetMetaTile(0x4022, position + 0x1bd, super->collisionLayer); + SetMetaTile(0x4022, position + 0x1be, super->collisionLayer); + SetMetaTile(0x4022, position + 0x1bf, super->collisionLayer); + SetMetaTile(0x4022, position + 0x1c1, super->collisionLayer); + SetMetaTile(0x4022, position + 0x1c2, super->collisionLayer); + SetMetaTile(0x4022, position + 0x1c3, super->collisionLayer); } void sub_0809C23C(FrozenWaterElementEntity* this) { diff --git a/src/object/furniture.c b/src/object/furniture.c index b274a37f..eb5a496f 100644 --- a/src/object/furniture.c +++ b/src/object/furniture.c @@ -9,6 +9,7 @@ #include "functions.h" #include "object.h" #include "room.h" +#include "tiles.h" enum { FURNITURE_INIT, @@ -216,14 +217,14 @@ static void FurnitureInit(FurnitureEntity* this) { break; case 0x40: super->y.HALF.HI = (super->y.HALF.HI & ~0xF) | 4; - SetTile(0x4017, this->tile - 128, 1); - SetTile(0x4017, this->tile - 64, 1); + SetMetaTile(0x4017, this->tile - 128, 1); + SetMetaTile(0x4017, this->tile - 64, 1); break; case 0x80: super->frameIndex = 0; super->y.HALF.HI = (super->y.HALF.HI & ~0xF) | 6; this->tile = COORD_TO_TILE(super); - SetTile(0x4026, this->tile, super->collisionLayer); + SetMetaTile(0x4026, this->tile, super->collisionLayer); break; case 0x200: break; @@ -259,9 +260,9 @@ static void FurnitureInit(FurnitureEntity* this) { tile = this->tile - 129; cnt = super->type != 26 ? 3 : 2; for (i = 0; i < cnt; ++i, ++tile) { - SetTile(0x4026, tile, 2); - SetTile(0x4026, tile, 1); - SetVvvAtMetaTilePos(0, tile + 64, 1); + SetMetaTile(0x4026, tile, 2); + SetMetaTile(0x4026, tile, 1); + SetVvvAtMetaTilePos(VVV_0, tile + 64, 1); } break; } @@ -286,22 +287,22 @@ static void FurnitureInit(FurnitureEntity* this) { case STAIRCASE: super->collisionLayer = 1; super->spriteOrientation.flipY = 2; - SetTile(0x4074, this->tile - 64, super->collisionLayer); - SetVvvAtMetaTilePos(63, this->tile - 64, super->collisionLayer); - SetTile(0x4017, this->tile, super->collisionLayer); - SetTile(0x4017, this->tile + 64, super->collisionLayer); + SetMetaTile(0x4074, this->tile - 64, super->collisionLayer); + SetVvvAtMetaTilePos(VVV_63, this->tile - 64, super->collisionLayer); + SetMetaTile(0x4017, this->tile, super->collisionLayer); + SetMetaTile(0x4017, this->tile + 64, super->collisionLayer); break; case MINISH_CHEESE: if (super->type2 != 0) super->spriteOffsetX = -4; break; case WOODEN_TABLE: - SetTile(0x4023, this->tile - 65, super->collisionLayer); - SetTile(0x4023, this->tile - 64, super->collisionLayer); - SetTile(0x4023, this->tile - 63, super->collisionLayer); + SetMetaTile(0x4023, this->tile - 65, super->collisionLayer); + SetMetaTile(0x4023, this->tile - 64, super->collisionLayer); + SetMetaTile(0x4023, this->tile - 63, super->collisionLayer); break; case LOW_BOOKSHELF: - SetTile(0x4022, this->tile + 65, super->collisionLayer); + SetMetaTile(0x4022, this->tile + 65, super->collisionLayer); } } @@ -337,20 +338,20 @@ static void FurnitureUpdate(FurnitureEntity* this) { break; case 0x80: if (gPlayerEntity.y.HALF.HI < super->y.HALF.HI + 8) { - if (gPlayerState.floor_type != SURFACE_LADDER && GetTileTypeByEntity(super) == 0x4017) { - SetTile(0x4026, this->tile, super->collisionLayer); - SetTile(0x403D, this->tile - 64, super->collisionLayer); - SetTile(0x403D, this->tile - 128, super->collisionLayer); + if (gPlayerState.floor_type != SURFACE_LADDER && GetMetaTileTypeByEntity(super) == 0x4017) { + SetMetaTile(0x4026, this->tile, super->collisionLayer); + SetMetaTile(0x403D, this->tile - 64, super->collisionLayer); + SetMetaTile(0x403D, this->tile - 128, super->collisionLayer); } } else { if (gPlayerEntity.collisionLayer & 2) { gPlayerEntity.collisionLayer = 1; UpdateSpriteForCollisionLayer(&gPlayerEntity); } - if (GetTileTypeByEntity(super) != 0x4017) { - SetTile(0x4017, this->tile, super->collisionLayer); - SetTile(0x4017, this->tile - 64, super->collisionLayer); - SetTile(0x4014, this->tile - 128, super->collisionLayer); + if (GetMetaTileTypeByEntity(super) != 0x4017) { + SetMetaTile(0x4017, this->tile, super->collisionLayer); + SetMetaTile(0x4017, this->tile - 64, super->collisionLayer); + SetMetaTile(0x4014, this->tile - 128, super->collisionLayer); } } break; @@ -375,28 +376,28 @@ static void sub_08090B6C(FurnitureEntity* this) { num = 2; } for (i = -num; i <= num; ++i) { - SetTile(0x4022, tile + i, cl); + SetMetaTile(0x4022, tile + i, cl); } if (px & 8) { sub_08090CDC(0x4024, tile - i, cl); sub_08090CDC(0x4025, tile + i, cl); } else { - SetTile(0x4022, tile - i, cl); + SetMetaTile(0x4022, tile - i, cl); } break; case 1: num = w2 / 8; for (i = -num; i <= num; i++) { - SetTile(0x4022, tile + i, cl); + SetMetaTile(0x4022, tile + i, cl); } if (px & 8) { sub_08090CDC(0x4024, tile - i, cl); if (i != 0) { - SetTile(0x4022, tile + i, cl); + SetMetaTile(0x4022, tile + i, cl); } } else { if (i != 0) { - SetTile(0x4022, tile - i, cl); + SetMetaTile(0x4022, tile - i, cl); } sub_08090CDC(0x4025, tile + i, cl); } @@ -404,10 +405,10 @@ static void sub_08090B6C(FurnitureEntity* this) { case 2: num = w2 / 4; for (i = -num; i < num; ++i) { - SetTile(0x4022, tile + i, cl); + SetMetaTile(0x4022, tile + i, cl); } if (px & 8) { - SetTile(0x4022, tile + i, cl); + SetMetaTile(0x4022, tile + i, cl); } else { sub_08090CDC(0x4024, tile - i - 1, cl); sub_08090CDC(0x4025, tile + i, cl); @@ -416,7 +417,7 @@ static void sub_08090B6C(FurnitureEntity* this) { case 3: num = w2 / 4; for (i = -num; i <= num; ++i) { - SetTile(0x4022, tile + i, cl); + SetMetaTile(0x4022, tile + i, cl); } if (px & 8) { sub_08090CDC(0x4025, tile + i, cl); @@ -429,12 +430,12 @@ static void sub_08090B6C(FurnitureEntity* this) { } static void sub_08090CDC(u32 id, u32 pos, u32 layer) { - u16 cur = GetTileIndex(pos, layer); + u16 cur = GetMetaTileIndex(pos, layer); u32 next = cur; u32 id2; if ((cur & 0x4000) == 0) { - SetTile(id, pos, layer); + SetMetaTile(id, pos, layer); } else { switch (cur) { case 0x4025: @@ -472,7 +473,7 @@ static void sub_08090CDC(u32 id, u32 pos, u32 layer) { default: return; } - SetTile(next, pos, layer); + SetMetaTile(next, pos, layer); } } diff --git a/src/object/gentariCurtain.c b/src/object/gentariCurtain.c index 14a25cea..dd9f70d6 100644 --- a/src/object/gentariCurtain.c +++ b/src/object/gentariCurtain.c @@ -58,10 +58,10 @@ void GentariCurtain_Init(GentariCurtainEntity* this) { UpdateSpriteForCollisionLayer(super); this->tile = COORD_TO_TILE_OFFSET(super, 0, 8); this->tile2 = COORD_TO_TILE_OFFSET(super, 0, -8); - this->tileIndex = GetTileIndex(this->tile, 1); - this->tileIndex2 = GetTileIndex(this->tile2, 1); - SetTile(0x4022, this->tile, 1); - SetTile(0x4022, this->tile2, 1); + this->tileIndex = GetMetaTileIndex(this->tile, 1); + this->tileIndex2 = GetMetaTileIndex(this->tile2, 1); + SetMetaTile(0x4022, this->tile, 1); + SetMetaTile(0x4022, this->tile2, 1); InitAnimationForceUpdate(super, 0); } else { super->action = 1; @@ -81,8 +81,8 @@ void GentariCurtain_Action2(GentariCurtainEntity* this) { UpdateAnimationSingleFrame(super); if ((super->frame & ANIM_DONE) != 0) { super->action = 3; - SetTile(this->tileIndex, this->tile, 1); - SetTile(this->tileIndex2, this->tile2, 1); + SetMetaTile(this->tileIndex, this->tile, 1); + SetMetaTile(this->tileIndex2, this->tile2, 1); sub_08092214(this); sub_0809223C(this); InitAnimationForceUpdate(super, 1); diff --git a/src/object/giantBookLadder.c b/src/object/giantBookLadder.c index fd1e2a25..6789ecfa 100644 --- a/src/object/giantBookLadder.c +++ b/src/object/giantBookLadder.c @@ -51,36 +51,36 @@ void sub_0808E55C(GiantBookLadderEntity* this) { case 2: position = this->unk74; unaff_r9 = position - 0x101; - SetTile(0x408f, unaff_r9, super->collisionLayer); - SetTile(0x408f, position - 0x100, super->collisionLayer); - SetTile(0x406c, position - 0x102, super->collisionLayer); - SetTile(0x406d, position - 0xff, super->collisionLayer); + SetMetaTile(0x408f, unaff_r9, super->collisionLayer); + SetMetaTile(0x408f, position - 0x100, super->collisionLayer); + SetMetaTile(0x406c, position - 0x102, super->collisionLayer); + SetMetaTile(0x406d, position - 0xff, super->collisionLayer); type = super->type; uVar5 = 6; if (type != 0) { uVar5 = 4; - SetTile(0x4072, position + 0x3f, super->collisionLayer); - SetTile(0x4072, position + 0x40, super->collisionLayer); - SetTile(0x4072, position + 0x7f, super->collisionLayer); - SetTile(0x4072, position + 0x80, super->collisionLayer); + SetMetaTile(0x4072, position + 0x3f, super->collisionLayer); + SetMetaTile(0x4072, position + 0x40, super->collisionLayer); + SetMetaTile(0x4072, position + 0x7f, super->collisionLayer); + SetMetaTile(0x4072, position + 0x80, super->collisionLayer); } break; case 1: position = this->unk74; unaff_r9 = position - 1; - SetTile(0x408e, unaff_r9, super->collisionLayer); - SetTile(0x408e, position, super->collisionLayer); + SetMetaTile(0x408e, unaff_r9, super->collisionLayer); + SetMetaTile(0x408e, position, super->collisionLayer); uVar5 = 2; break; } for (uVar4 = 0; uVar4 < uVar5; uVar4++) { unaff_r9 += 0x40; - SetTile(0x408e, unaff_r9, super->collisionLayer); - SetTile(0x408e, unaff_r9 + 1, super->collisionLayer); + SetMetaTile(0x408e, unaff_r9, super->collisionLayer); + SetMetaTile(0x408e, unaff_r9 + 1, super->collisionLayer); } } u32 sub_0808E670(GiantBookLadderEntity* this) { - return GetTileType(this->unk74 - 0x101, 1); + return GetMetaTileType(this->unk74 - 0x101, 1); } diff --git a/src/object/giantLeaf.c b/src/object/giantLeaf.c index caab128c..b3a0a475 100644 --- a/src/object/giantLeaf.c +++ b/src/object/giantLeaf.c @@ -35,6 +35,6 @@ void sub_0808D618(Entity* ent) { ((((ent->y.HALF.HI - gRoomControls.origin_y) >> 4) & 0x3F) * 64); for (i = 0; i < 13; i++) { - SetTile(16500, tilePos + arr[i], 1); + SetMetaTile(16500, tilePos + arr[i], 1); } } diff --git a/src/object/giantRock2.c b/src/object/giantRock2.c index 923a4dbe..92ac876c 100644 --- a/src/object/giantRock2.c +++ b/src/object/giantRock2.c @@ -39,10 +39,10 @@ void GiantRock2_Init(GiantRock2Entity* this) { position = (this->tile - 0x80); tileIndex = 0x4022; for (index = 4; index > -1; index--) { - SetTile(tileIndex, position - 2, collisionLayer); - SetTile(tileIndex, position - 1, collisionLayer); - SetTile(tileIndex, position, collisionLayer); - SetTile(tileIndex, position + 1, collisionLayer); + SetMetaTile(tileIndex, position - 2, collisionLayer); + SetMetaTile(tileIndex, position - 1, collisionLayer); + SetMetaTile(tileIndex, position, collisionLayer); + SetMetaTile(tileIndex, position + 1, collisionLayer); position += 0x40; } } diff --git a/src/object/giantTwig.c b/src/object/giantTwig.c index 7927c32c..0ed9a81d 100644 --- a/src/object/giantTwig.c +++ b/src/object/giantTwig.c @@ -158,7 +158,7 @@ void sub_08093984(GiantTwigEntity* this) { } for (index = 0; index < 0x13; index++) { - SetTile(0x4074, array[index] + this->tilePosition, 1); + SetMetaTile(0x4074, array[index] + this->tilePosition, 1); } } @@ -177,47 +177,47 @@ void GiantTwig_Type3Idle(GiantTwigEntity* this) { void sub_08093A1C(GiantTwigEntity* this) { switch (super->type) { case 0: - SetTile(0x4024, this->tilePosition + 0x3c, super->collisionLayer); - SetTile(0x4022, this->tilePosition + 0x3d, super->collisionLayer); - SetTile(0x4022, this->tilePosition + 0x3e, super->collisionLayer); - SetTile(0x4029, this->tilePosition + 0x7c, super->collisionLayer); - SetTile(0x4026, this->tilePosition + 0x7d, super->collisionLayer); - SetTile(0x4026, this->tilePosition + 0x7e, super->collisionLayer); - SetTile(0x403d, this->tilePosition + 0x40, super->collisionLayer); - SetTile(0x403d, this->tilePosition + 0x80, super->collisionLayer); - SetTile(0x4027, this->tilePosition + 0x41, super->collisionLayer); - SetTile(0x4023, this->tilePosition + 0x42, super->collisionLayer); - SetTile(0x406d, this->tilePosition + 0x43, super->collisionLayer); - SetTile(0x4029, this->tilePosition + 0x81, super->collisionLayer); - SetTile(0x4026, this->tilePosition + 0x82, super->collisionLayer); - SetTile(0x4026, this->tilePosition + 0x83, super->collisionLayer); + SetMetaTile(0x4024, this->tilePosition + 0x3c, super->collisionLayer); + SetMetaTile(0x4022, this->tilePosition + 0x3d, super->collisionLayer); + SetMetaTile(0x4022, this->tilePosition + 0x3e, super->collisionLayer); + SetMetaTile(0x4029, this->tilePosition + 0x7c, super->collisionLayer); + SetMetaTile(0x4026, this->tilePosition + 0x7d, super->collisionLayer); + SetMetaTile(0x4026, this->tilePosition + 0x7e, super->collisionLayer); + SetMetaTile(0x403d, this->tilePosition + 0x40, super->collisionLayer); + SetMetaTile(0x403d, this->tilePosition + 0x80, super->collisionLayer); + SetMetaTile(0x4027, this->tilePosition + 0x41, super->collisionLayer); + SetMetaTile(0x4023, this->tilePosition + 0x42, super->collisionLayer); + SetMetaTile(0x406d, this->tilePosition + 0x43, super->collisionLayer); + SetMetaTile(0x4029, this->tilePosition + 0x81, super->collisionLayer); + SetMetaTile(0x4026, this->tilePosition + 0x82, super->collisionLayer); + SetMetaTile(0x4026, this->tilePosition + 0x83, super->collisionLayer); break; case 1: if ((super->type2 & 1) != 0) { - SetTile(0x406d, this->tilePosition - 0x81, super->collisionLayer); - SetTile(0x4022, this->tilePosition - 0x41, super->collisionLayer); - SetTile(0x4029, this->tilePosition - 2, super->collisionLayer); - SetTile(0x4026, this->tilePosition - 1, super->collisionLayer); - SetTile(0x4022, this->tilePosition, super->collisionLayer); - SetTile(0x406d, this->tilePosition + 1, super->collisionLayer); - SetTile(0x406e, this->tilePosition + 0x40, super->collisionLayer); - SetTile(0x4022, this->tilePosition + 0x41, super->collisionLayer); - SetTile(0x406d, this->tilePosition + 0x42, super->collisionLayer); + SetMetaTile(0x406d, this->tilePosition - 0x81, super->collisionLayer); + SetMetaTile(0x4022, this->tilePosition - 0x41, super->collisionLayer); + SetMetaTile(0x4029, this->tilePosition - 2, super->collisionLayer); + SetMetaTile(0x4026, this->tilePosition - 1, super->collisionLayer); + SetMetaTile(0x4022, this->tilePosition, super->collisionLayer); + SetMetaTile(0x406d, this->tilePosition + 1, super->collisionLayer); + SetMetaTile(0x406e, this->tilePosition + 0x40, super->collisionLayer); + SetMetaTile(0x4022, this->tilePosition + 0x41, super->collisionLayer); + SetMetaTile(0x406d, this->tilePosition + 0x42, super->collisionLayer); } else { - SetTile(0x406c, this->tilePosition - 0x7f, super->collisionLayer); - SetTile(0x4022, this->tilePosition - 0x3f, super->collisionLayer); - SetTile(0x406c, this->tilePosition - 1, super->collisionLayer); - SetTile(0x4022, this->tilePosition, super->collisionLayer); - SetTile(0x4026, this->tilePosition + 1, super->collisionLayer); - SetTile(0x402a, this->tilePosition + 2, super->collisionLayer); - SetTile(0x406c, this->tilePosition + 0x3e, super->collisionLayer); - SetTile(0x4022, this->tilePosition + 0x3f, super->collisionLayer); - SetTile(0x406f, this->tilePosition + 0x40, super->collisionLayer); + SetMetaTile(0x406c, this->tilePosition - 0x7f, super->collisionLayer); + SetMetaTile(0x4022, this->tilePosition - 0x3f, super->collisionLayer); + SetMetaTile(0x406c, this->tilePosition - 1, super->collisionLayer); + SetMetaTile(0x4022, this->tilePosition, super->collisionLayer); + SetMetaTile(0x4026, this->tilePosition + 1, super->collisionLayer); + SetMetaTile(0x402a, this->tilePosition + 2, super->collisionLayer); + SetMetaTile(0x406c, this->tilePosition + 0x3e, super->collisionLayer); + SetMetaTile(0x4022, this->tilePosition + 0x3f, super->collisionLayer); + SetMetaTile(0x406f, this->tilePosition + 0x40, super->collisionLayer); return; } break; case 3: - SetTile(0x4022, this->tilePosition, super->collisionLayer); + SetMetaTile(0x4022, this->tilePosition, super->collisionLayer); break; } } @@ -226,12 +226,12 @@ void sub_08093C70(GiantTwigEntity* this) { if (this->unk_78 != 0) { if (gPlayerState.heldObject != 0) { this->unk_78 = 0; - SetTile(0x4022, this->tilePosition + 0x3f, super->collisionLayer); - SetTile(0x4022, this->tilePosition + 0x40, super->collisionLayer); - SetTile(0x4022, this->tilePosition + 0x41, super->collisionLayer); - SetTile(0x4026, this->tilePosition + 0x7f, super->collisionLayer); - SetTile(0x4026, this->tilePosition + 0x80, super->collisionLayer); - SetTile(0x4026, this->tilePosition + 0x81, super->collisionLayer); + SetMetaTile(0x4022, this->tilePosition + 0x3f, super->collisionLayer); + SetMetaTile(0x4022, this->tilePosition + 0x40, super->collisionLayer); + SetMetaTile(0x4022, this->tilePosition + 0x41, super->collisionLayer); + SetMetaTile(0x4026, this->tilePosition + 0x7f, super->collisionLayer); + SetMetaTile(0x4026, this->tilePosition + 0x80, super->collisionLayer); + SetMetaTile(0x4026, this->tilePosition + 0x81, super->collisionLayer); } } else { @@ -239,12 +239,12 @@ void sub_08093C70(GiantTwigEntity* this) { if (--this->unk_7a == 0) { this->unk_78++; this->unk_7a = 0x3c; - SetTile(0x403d, this->tilePosition + 0x3f, super->collisionLayer); - SetTile(0x403d, this->tilePosition + 0x40, super->collisionLayer); - SetTile(0x4027, this->tilePosition + 0x41, super->collisionLayer); - SetTile(0x403d, this->tilePosition + 0x7f, super->collisionLayer); - SetTile(0x403d, this->tilePosition + 0x80, super->collisionLayer); - SetTile(0x4029, this->tilePosition + 0x81, super->collisionLayer); + SetMetaTile(0x403d, this->tilePosition + 0x3f, super->collisionLayer); + SetMetaTile(0x403d, this->tilePosition + 0x40, super->collisionLayer); + SetMetaTile(0x4027, this->tilePosition + 0x41, super->collisionLayer); + SetMetaTile(0x403d, this->tilePosition + 0x7f, super->collisionLayer); + SetMetaTile(0x403d, this->tilePosition + 0x80, super->collisionLayer); + SetMetaTile(0x4029, this->tilePosition + 0x81, super->collisionLayer); } } } diff --git a/src/object/hiddenLadderDown.c b/src/object/hiddenLadderDown.c index d2369721..c519bac2 100644 --- a/src/object/hiddenLadderDown.c +++ b/src/object/hiddenLadderDown.c @@ -34,20 +34,20 @@ void HiddenLadderDown_Init(Entity* this) { if (CheckFlags(this->field_0x86.HWORD) != 0) { this->action = 2; this->spriteSettings.draw = TRUE; - SetTileType(0x1a2, *puVar3 - 0x41, this->collisionLayer); - SetTileType(0x1a3, *puVar3 - 0x40, this->collisionLayer); - SetTileType(0x1a4, *puVar3 - 0x3f, this->collisionLayer); - SetTileType(0x1a5, *puVar3 - 1, this->collisionLayer); - SetTileType(0x1a6, *puVar3, this->collisionLayer); - SetTileType(0x1a7, *puVar3 + 1, this->collisionLayer); - SetTileType(0x1a8, *puVar3 + 0x3f, this->collisionLayer); - SetTileType(0x1a9, *puVar3 + 0x40, this->collisionLayer); - SetTileType(0x1aa, *puVar3 + 0x41, this->collisionLayer); + SetMetaTileType(0x1a2, *puVar3 - 0x41, this->collisionLayer); + SetMetaTileType(0x1a3, *puVar3 - 0x40, this->collisionLayer); + SetMetaTileType(0x1a4, *puVar3 - 0x3f, this->collisionLayer); + SetMetaTileType(0x1a5, *puVar3 - 1, this->collisionLayer); + SetMetaTileType(0x1a6, *puVar3, this->collisionLayer); + SetMetaTileType(0x1a7, *puVar3 + 1, this->collisionLayer); + SetMetaTileType(0x1a8, *puVar3 + 0x3f, this->collisionLayer); + SetMetaTileType(0x1a9, *puVar3 + 0x40, this->collisionLayer); + SetMetaTileType(0x1aa, *puVar3 + 0x41, this->collisionLayer); } } void HiddenLadderDown_Action1(Entity* this) { - if (GetTileType(*(u16*)&this->field_0x70.HALF.LO, this->collisionLayer) == 0x1a6) { + if (GetMetaTileType(*(u16*)&this->field_0x70.HALF.LO, this->collisionLayer) == 0x1a6) { this->action = 2; this->spriteSettings.draw = TRUE; SetFlag(this->field_0x86.HWORD); diff --git a/src/object/itemOnGround.c b/src/object/itemOnGround.c index 3ec5a6e2..7603bcee 100644 --- a/src/object/itemOnGround.c +++ b/src/object/itemOnGround.c @@ -216,7 +216,7 @@ void sub_08081188(Entity* this) { void sub_080811AC(Entity* this) { this->action = 2; this->spriteSettings.draw = 0; - this->field_0x6e.HWORD = GetTileTypeByEntity(this); + this->field_0x6e.HWORD = GetMetaTileTypeByEntity(this); } void sub_080811C8(Entity* this) { @@ -282,7 +282,7 @@ void sub_080812A0(Entity* this) { } void sub_080812A8(Entity* this) { - if (GetCollisionDataAtEntity(this) != 0xF && this->field_0x6e.HWORD != GetTileTypeByEntity(this)) { + if (GetCollisionDataAtEntity(this) != 0xF && this->field_0x6e.HWORD != GetMetaTileTypeByEntity(this)) { this->direction = 0; this->speed = 0; this->spriteSettings.draw = 1; diff --git a/src/object/jarPortal.c b/src/object/jarPortal.c index 94000d86..938cdbf0 100644 --- a/src/object/jarPortal.c +++ b/src/object/jarPortal.c @@ -176,10 +176,10 @@ void sub_0808C148(Entity* this, u32 a2) { pos = COORD_TO_TILE(this); if (!a2) { - SetTile(0x4092, pos - 1, this->collisionLayer); - SetTile(0x4093, pos, this->collisionLayer); - SetTile(0x4094, pos + 63, this->collisionLayer); - SetTile(0x4095, pos + 64, this->collisionLayer); + SetMetaTile(0x4092, pos - 1, this->collisionLayer); + SetMetaTile(0x4093, pos, this->collisionLayer); + SetMetaTile(0x4094, pos + 63, this->collisionLayer); + SetMetaTile(0x4095, pos + 64, this->collisionLayer); } else { RestorePrevTileEntity(pos - 1, this->collisionLayer); RestorePrevTileEntity(pos, this->collisionLayer); diff --git a/src/object/ladderUp.c b/src/object/ladderUp.c index 8743fadc..aacbc330 100644 --- a/src/object/ladderUp.c +++ b/src/object/ladderUp.c @@ -37,7 +37,7 @@ void LadderUp(Entity* this) { return; } this->y.HALF.HI = (this->y.HALF.HI & 0xfff0) + 0xc; - SetTile(0x4023, COORD_TO_TILE(this), this->collisionLayer); + SetMetaTile(0x4023, COORD_TO_TILE(this), this->collisionLayer); break; case 1: if (GravityUpdate(this, Q_8_8(16.0)) == 0) { @@ -65,17 +65,17 @@ void LadderUp(Entity* this) { default: if (this->type2 == 0) { if (gPlayerEntity.y.HALF.HI < this->y.HALF.HI) { - if (gPlayerState.floor_type != SURFACE_LADDER && (GetTileTypeByEntity(this) == 0x4017)) { - SetTile(0x4023, COORD_TO_TILE(this), this->collisionLayer); + if (gPlayerState.floor_type != SURFACE_LADDER && (GetMetaTileTypeByEntity(this) == 0x4017)) { + SetMetaTile(0x4023, COORD_TO_TILE(this), this->collisionLayer); RestorePrevTileEntity(COORD_TO_TILE_OFFSET(this, 0, 0x10), this->collisionLayer); } } else { - if (GetTileTypeByEntity(this) != 0x4017) { - SetTile(0x4017, COORD_TO_TILE(this), this->collisionLayer); + if (GetMetaTileTypeByEntity(this) != 0x4017) { + SetMetaTile(0x4017, COORD_TO_TILE(this), this->collisionLayer); if (this->type == 0) { - SetTile(0x4017, COORD_TO_TILE_OFFSET(this, 0, 0x10), this->collisionLayer); + SetMetaTile(0x4017, COORD_TO_TILE_OFFSET(this, 0, 0x10), this->collisionLayer); } else { - SetTile(0x4014, COORD_TO_TILE_OFFSET(this, 0, 0x10), this->collisionLayer); + SetMetaTile(0x4014, COORD_TO_TILE_OFFSET(this, 0, 0x10), this->collisionLayer); } } } diff --git a/src/object/lightDoor.c b/src/object/lightDoor.c index 5a90de45..aefc3a57 100644 --- a/src/object/lightDoor.c +++ b/src/object/lightDoor.c @@ -90,13 +90,13 @@ void LightDoor_Action4(LightDoorEntity* this) { void sub_080850FC(LightDoorEntity* this) { u32 position = COORD_TO_TILE(super); u32 layer = super->collisionLayer; - SetTile(0x403d, position - 0x41, layer); - SetTile(0x403d, position - 0x40, layer); - SetTile(0x403d, position - 0x3f, layer); - SetTile(0x403d, position - 1, layer); - SetTile(0x403d, position, layer); - SetTile(0x403d, position + 1, layer); - SetTile(0x403d, position + 0x3f, layer); - SetTile(0x403d, position + 0x40, layer); - SetTile(0x403d, position + 0x41, layer); + SetMetaTile(0x403d, position - 0x41, layer); + SetMetaTile(0x403d, position - 0x40, layer); + SetMetaTile(0x403d, position - 0x3f, layer); + SetMetaTile(0x403d, position - 1, layer); + SetMetaTile(0x403d, position, layer); + SetMetaTile(0x403d, position + 1, layer); + SetMetaTile(0x403d, position + 0x3f, layer); + SetMetaTile(0x403d, position + 0x40, layer); + SetMetaTile(0x403d, position + 0x41, layer); } diff --git a/src/object/lightableSwitch.c b/src/object/lightableSwitch.c index ba0ba466..e53e313b 100644 --- a/src/object/lightableSwitch.c +++ b/src/object/lightableSwitch.c @@ -91,7 +91,7 @@ static void sub_0809EAD8(Entity* this) { UpdateRailMovement(this, (u16**)&this->child, &this->field_0x74.HWORD); } else { - SetTile(0x4050, COORD_TO_TILE(this), this->collisionLayer); + SetMetaTile(0x4050, COORD_TO_TILE(this), this->collisionLayer); } } diff --git a/src/object/lilypadLarge.c b/src/object/lilypadLarge.c index a9bbe2e1..840f7beb 100644 --- a/src/object/lilypadLarge.c +++ b/src/object/lilypadLarge.c @@ -5,11 +5,12 @@ * * @brief Large Lilypad object */ -#include "global.h" #include "area.h" #include "functions.h" #include "item.h" #include "object.h" +#include "map.h" +#include "tiles.h" typedef struct { Entity base; @@ -344,10 +345,10 @@ void sub_08085A1C(LilypadLargeEntity* this) { void sub_08085A44(LilypadLargeEntity* this) { super->speed = 0x200; - if (GetVvvRelativeToEntity(super, 0x10, 0x18) != 0x11) { + if (GetVvvRelativeToEntity(super, 0x10, 0x18) != VVV_17) { super->direction = 0x18; } else { - if (GetVvvRelativeToEntity(super, -0x10, 0x18) != 0x11) { + if (GetVvvRelativeToEntity(super, -0x10, 0x18) != VVV_17) { super->direction = 8; } else { super->direction = 0x10; @@ -368,7 +369,7 @@ void sub_08085A98(LilypadLargeEntity* this) { this->unk_78.WORD -= 0x20000; SetAffineInfo(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI); } - if (GetVvvRelativeToEntity(super, 0, 0x18) != 0x11) { + if (GetVvvRelativeToEntity(super, 0, 0x18) != VVV_17) { super->subAction = 2; if (gArea.locationIndex == 0x1b) { super->y.HALF.HI += 0xd0; @@ -401,7 +402,7 @@ void sub_08085B40(LilypadLargeEntity* this) { } } else { ResetCollisionLayer(super); - if (GetVvvAtEntity(super) == 0xd) { + if (GetVvvAtEntity(super) == VVV_13) { ResetCollisionLayer(&gPlayerEntity); sub_08085CDC(this); super->direction = GetFacingDirection(&gPlayerEntity, super); @@ -423,7 +424,7 @@ void sub_08085B40(LilypadLargeEntity* this) { super->timer |= 0x80; this->unk_70 = 0; this->unk_6c = 0; - if (GetVvvAtEntity(super) == 0xd) { + if (GetVvvAtEntity(super) == VVV_13) { super->action = 4; } } @@ -471,7 +472,7 @@ void sub_08085D10(LilypadLargeEntity* this) { void sub_08085D28(LilypadLargeEntity* this) { if (((gPlayerState.framestate != PL_STATE_TALKEZLO) && ((gPlayerState.flags & PL_FLAGS2) != 0)) && - (GetVvvRelativeToEntity(super, 0, 0x18) == 0x11)) { + (GetVvvRelativeToEntity(super, 0, 0x18) == VVV_17)) { super->action = 2; super->subAction = 0; sub_08078B48(); diff --git a/src/object/linkEmptyingBottle.c b/src/object/linkEmptyingBottle.c index 8c8b4ac7..99e7f27e 100644 --- a/src/object/linkEmptyingBottle.c +++ b/src/object/linkEmptyingBottle.c @@ -119,7 +119,7 @@ void sub_08094980(LinkEmptyingBottleEntity* this, u32 searchTileIndex, u32 repla xOffset = gUnk_08122A28[index]; yOffset = gUnk_08122A28[index + 1]; if (searchTileIndex == sub_080B1A0C(super, xOffset, yOffset)) { - SetTile(replaceTileIndex, TILE(super->x.HALF.HI + xOffset, super->y.HALF.HI + yOffset), + SetMetaTile(replaceTileIndex, TILE(super->x.HALF.HI + xOffset, super->y.HALF.HI + yOffset), super->collisionLayer); } index += 2; diff --git a/src/object/lockedDoor.c b/src/object/lockedDoor.c index 6cc6c1a6..b1247bca 100644 --- a/src/object/lockedDoor.c +++ b/src/object/lockedDoor.c @@ -104,7 +104,7 @@ void LockedDoor_Init(Entity* this) { this->spritePriority.b0 = 5; this->frame = this->type & 0xF; this->field_0x76.HWORD = TILE(this->x.HALF.HI, this->y.HALF.HI); - this->field_0x74.HWORD = GetTileIndex(this->field_0x76.HWORD, this->collisionLayer); + this->field_0x74.HWORD = GetMetaTileIndex(this->field_0x76.HWORD, this->collisionLayer); switch (this->type2) { case 0: if (!CheckFlags(this->field_0x86.HWORD)) { @@ -151,7 +151,7 @@ void LockedDoor_Action1(Entity* this) { if (--this->timer == 0) { this->action = 2; this->timer = 7; - SetTile(this->field_0x74.HWORD, this->field_0x76.HWORD, this->collisionLayer); + SetMetaTile(this->field_0x74.HWORD, this->field_0x76.HWORD, this->collisionLayer); EnqueueSFX(SFX_10B); } } @@ -251,12 +251,12 @@ void sub_080836A0(Entity* this) { this->spriteSettings.draw = 1; this->x.HALF.HI = this->field_0x70.HALF.LO; this->y.HALF.HI = this->field_0x70.HALF.HI; - SetTile(0x4022, this->field_0x76.HWORD, this->collisionLayer); + SetMetaTile(0x4022, this->field_0x76.HWORD, this->collisionLayer); } void sub_080836DC(Entity* this, u32 unk_0, u32 unk_1) { const struct_0811F680* tmp; - SetTile(0x4022, unk_1, this->collisionLayer); + SetMetaTile(0x4022, unk_1, this->collisionLayer); this->timer = 7; this->spriteSettings.draw = 1; this->direction = (unk_0 << 3) ^ 0x10; diff --git a/src/object/macroAcorn.c b/src/object/macroAcorn.c index c52f503d..690e36ea 100644 --- a/src/object/macroAcorn.c +++ b/src/object/macroAcorn.c @@ -68,38 +68,38 @@ void sub_0809E5F0(Entity* this) { this->field_0x80.HWORD = position; switch (this->type) { case 2: - SetTile(0x4022, position - 0x3d, 1); - SetTile(0x406d, position - 0x3c, 1); + SetMetaTile(0x4022, position - 0x3d, 1); + SetMetaTile(0x406d, position - 0x3c, 1); case 0: - SetTile(0x406c, position - 0x42, 1); - SetTile(0x4022, position - 0x41, 1); - SetTile(0x4022, position - 0x40, 1); - SetTile(0x4022, position - 0x3f, 1); - SetTile(0x4022, position - 2, 1); - SetTile(0x4022, position - 1, 1); - SetTile(0x4022, position, 1); - SetTile(0x4022, position + 1, 1); - SetTile(0x406e, position + 0x3e, 1); - SetTile(0x4022, position + 0x3f, 1); - SetTile(0x4022, position + 0x40, 1); - SetTile(0x406f, position + 0x41, 1); + SetMetaTile(0x406c, position - 0x42, 1); + SetMetaTile(0x4022, position - 0x41, 1); + SetMetaTile(0x4022, position - 0x40, 1); + SetMetaTile(0x4022, position - 0x3f, 1); + SetMetaTile(0x4022, position - 2, 1); + SetMetaTile(0x4022, position - 1, 1); + SetMetaTile(0x4022, position, 1); + SetMetaTile(0x4022, position + 1, 1); + SetMetaTile(0x406e, position + 0x3e, 1); + SetMetaTile(0x4022, position + 0x3f, 1); + SetMetaTile(0x4022, position + 0x40, 1); + SetMetaTile(0x406f, position + 0x41, 1); break; case 3: - SetTile(0x4022, position - 0x44, 1); - SetTile(0x406c, position - 0x45, 1); + SetMetaTile(0x4022, position - 0x44, 1); + SetMetaTile(0x406c, position - 0x45, 1); case 1: - SetTile(0x4022, position - 0x42, 1); - SetTile(0x4022, position - 0x41, 1); - SetTile(0x4022, position - 0x40, 1); - SetTile(0x406d, position - 0x3f, 1); - SetTile(0x4022, position - 2, 1); - SetTile(0x4022, position - 1, 1); - SetTile(0x4022, position, 1); - SetTile(0x4022, position + 1, 1); - SetTile(0x406e, position + 0x3e, 1); - SetTile(0x4022, position + 0x3f, 1); - SetTile(0x4022, position + 0x40, 1); - SetTile(0x406f, position + 0x41, 1); + SetMetaTile(0x4022, position - 0x42, 1); + SetMetaTile(0x4022, position - 0x41, 1); + SetMetaTile(0x4022, position - 0x40, 1); + SetMetaTile(0x406d, position - 0x3f, 1); + SetMetaTile(0x4022, position - 2, 1); + SetMetaTile(0x4022, position - 1, 1); + SetMetaTile(0x4022, position, 1); + SetMetaTile(0x4022, position + 1, 1); + SetMetaTile(0x406e, position + 0x3e, 1); + SetMetaTile(0x4022, position + 0x3f, 1); + SetMetaTile(0x4022, position + 0x40, 1); + SetMetaTile(0x406f, position + 0x41, 1); break; } } diff --git a/src/object/macroBook.c b/src/object/macroBook.c index 59f025a4..ecc7de8f 100644 --- a/src/object/macroBook.c +++ b/src/object/macroBook.c @@ -151,7 +151,7 @@ void sub_0809A958(MacroBookEntity* this) { for (index = 0; index < 5; index++, tilePos += 0x40) { for (index2 = 0; index2 < 4; index2++, tileIndexPtr++) { if ((*tileIndexPtr & 0x4000) != 0) { - SetTile(*tileIndexPtr, tilePos + index2, 1); + SetMetaTile(*tileIndexPtr, tilePos + index2, 1); } } } diff --git a/src/object/macroDecorations.c b/src/object/macroDecorations.c index f68ce765..db2883f3 100644 --- a/src/object/macroDecorations.c +++ b/src/object/macroDecorations.c @@ -89,7 +89,7 @@ void sub_08097EB8(MacroDecorationEntity* this) { const s16* tilePosPtr; u16 tile = COORD_TO_TILE(super); for (tilePosPtr = tilePosArray; *tilePosPtr != 0x7fff; tilePosPtr += 2) { - SetTile((u16)tilePosPtr[1], tile + tilePosPtr[0], 1); + SetMetaTile((u16)tilePosPtr[1], tile + tilePosPtr[0], 1); } } diff --git a/src/object/macroShoe.c b/src/object/macroShoe.c index 2d4b5ac2..fc9e2d00 100644 --- a/src/object/macroShoe.c +++ b/src/object/macroShoe.c @@ -39,9 +39,9 @@ void MacroShoe_Init(Entity* this) { this->action = 1; this->hitbox = (Hitbox*)MacroShoe_TypeHitboxes[this->type]; if (this->type2 == 1) { - SetTile(0x4024, 0x410, 1); - SetTile(0x4026, 0x411, 1); - SetTile(0x4025, 0x412, 1); + SetMetaTile(0x4024, 0x410, 1); + SetMetaTile(0x4026, 0x411, 1); + SetMetaTile(0x4025, 0x412, 1); } } diff --git a/src/object/mask.c b/src/object/mask.c index 566e6ea1..07dd9ee4 100644 --- a/src/object/mask.c +++ b/src/object/mask.c @@ -59,11 +59,11 @@ void Mask_Init(Entity* this) { this->frameIndex = this->type2 & 0x3f; this->field_0x7c.HALF_U.HI = COORD_TO_TILE(this); - this->field_0x7c.HALF_U.LO = GetTileIndex(this->field_0x7c.HALF_U.HI, 1); + this->field_0x7c.HALF_U.LO = GetMetaTileIndex(this->field_0x7c.HALF_U.HI, 1); this->field_0x7a.HWORD = GetCollisionDataAtMetaTilePos((u16)this->field_0x7c.HALF.HI, 1); - SetTile(0x4022, this->field_0x7c.HALF_U.HI, 1); + SetMetaTile(0x4022, this->field_0x7c.HALF_U.HI, 1); } // Probably related to knocking it down @@ -88,7 +88,7 @@ void Mask_Action1(Entity* this) { } // Presumably, make the mask fall - SetTile(this->field_0x7c.HALF_U.LO, this->field_0x7c.HALF_U.HI, 1); + SetMetaTile(this->field_0x7c.HALF_U.LO, this->field_0x7c.HALF_U.HI, 1); SetCollisionData(this->field_0x7a.HWORD, (u16)this->field_0x7c.HALF.HI, 1); diff --git a/src/object/metalDoor.c b/src/object/metalDoor.c index f7236beb..758dd18d 100644 --- a/src/object/metalDoor.c +++ b/src/object/metalDoor.c @@ -103,16 +103,16 @@ void MetalDoor_Action4(Entity* this) { } void sub_080A080C(Entity* this) { - this->field_0x76.HWORD = GetTileIndex(this->field_0x74.HWORD - 1, this->collisionLayer); - this->field_0x78.HWORD = GetTileIndex(this->field_0x74.HWORD, this->collisionLayer); - this->field_0x7a.HWORD = GetTileIndex(this->field_0x74.HWORD + 1, this->collisionLayer); - SetTile(0x4022, this->field_0x74.HWORD - 1, this->collisionLayer); - SetTile(0x4022, this->field_0x74.HWORD, this->collisionLayer); - SetTile(0x4022, this->field_0x74.HWORD + 1, this->collisionLayer); + this->field_0x76.HWORD = GetMetaTileIndex(this->field_0x74.HWORD - 1, this->collisionLayer); + this->field_0x78.HWORD = GetMetaTileIndex(this->field_0x74.HWORD, this->collisionLayer); + this->field_0x7a.HWORD = GetMetaTileIndex(this->field_0x74.HWORD + 1, this->collisionLayer); + SetMetaTile(0x4022, this->field_0x74.HWORD - 1, this->collisionLayer); + SetMetaTile(0x4022, this->field_0x74.HWORD, this->collisionLayer); + SetMetaTile(0x4022, this->field_0x74.HWORD + 1, this->collisionLayer); } void sub_080A0870(Entity* this) { - SetTile(this->field_0x76.HWORD, this->field_0x74.HWORD - 1, this->collisionLayer); - SetTile(this->field_0x78.HWORD, this->field_0x74.HWORD, this->collisionLayer); - SetTile(this->field_0x7a.HWORD, this->field_0x74.HWORD + 1, this->collisionLayer); + SetMetaTile(this->field_0x76.HWORD, this->field_0x74.HWORD - 1, this->collisionLayer); + SetMetaTile(this->field_0x78.HWORD, this->field_0x74.HWORD, this->collisionLayer); + SetMetaTile(this->field_0x7a.HWORD, this->field_0x74.HWORD + 1, this->collisionLayer); } diff --git a/src/object/minecart.c b/src/object/minecart.c index 77a027f1..24043868 100644 --- a/src/object/minecart.c +++ b/src/object/minecart.c @@ -8,6 +8,7 @@ #include "functions.h" #include "hitbox.h" #include "object.h" +#include "tiles.h" typedef struct { Entity base; @@ -60,7 +61,7 @@ void Minecart_Init(MinecartEntity* this) { super->speed = 0x700; super->spritePriority.b1 = 3; InitAnimationForceUpdate(super, super->type2 + 4 + super->animationState); - SetTile(0x4022, COORD_TO_TILE(super), super->collisionLayer); + SetMetaTile(0x4022, COORD_TO_TILE(super), super->collisionLayer); } void Minecart_Action1(MinecartEntity* this) { @@ -106,7 +107,7 @@ void Minecart_Action2(MinecartEntity* this) { if (gPlayerEntity.zVelocity >= 0) { return; } - gPlayerEntity.animationState = super->animationState << 1; + gPlayerEntity.animationState = super->animationState * 2; gPlayerState.flags = (gPlayerState.flags ^ PL_ENTER_MINECART) | PL_IN_MINECART; super->action++; super->subtimer = 1; @@ -170,7 +171,7 @@ void Minecart_Action3(MinecartEntity* this) { super->animationState = AnimationStateFlip90(super->animationState); } else { switch (vvv) { - case 0x64: + case VVV_100: super->flags &= ~ENT_PERSIST; super->hitType = 1; super->collisionFlags = 0x47; @@ -182,7 +183,7 @@ void Minecart_Action3(MinecartEntity* this) { gPlayerState.flags = (gPlayerState.flags ^ PL_IN_MINECART) | PL_ENTER_MINECART; gPlayerEntity.zVelocity = Q_16_16(2.0); gPlayerEntity.speed = 0x200; - gPlayerEntity.animationState = super->animationState << 1; + gPlayerEntity.animationState = super->animationState * 2; gPlayerEntity.direction = super->direction; gPlayerEntity.flags |= PL_MINISH; sub_08004168(super); @@ -190,14 +191,14 @@ void Minecart_Action3(MinecartEntity* this) { SoundReq(SFX_PLY_VO4); SoundReq(SFX_139); return; - case 0x67: - case 0x68: - case 0x69: - case 0x6a: - case 0x6c: - case 0x6d: - case 0x6e: - case 0x6f: + case VVV_103: + case VVV_104: + case VVV_105: + case VVV_106: + case VVV_108: + case VVV_109: + case VVV_110: + case VVV_111: if (vvv == GetVvvAtEntity(super)) { Minecart_Action4(this); gPlayerEntity.animationState = super->animationState << 1; @@ -221,7 +222,7 @@ void Minecart_Action4(MinecartEntity* this) { sub_08004168(super); CopyPosition(super, &gPlayerEntity); switch (GetVvvAtEntity(super)) { - case 0x67: + case VVV_103: if (super->direction == DirectionWest) { super->direction = DirectionNorth; super->animationState = 0; @@ -230,7 +231,7 @@ void Minecart_Action4(MinecartEntity* this) { super->animationState = 1; } break; - case 0x68: + case VVV_104: if (super->direction == DirectionEast) { super->direction = DirectionSouth; super->animationState = 2; @@ -239,7 +240,7 @@ void Minecart_Action4(MinecartEntity* this) { super->animationState = 3; } break; - case 0x69: + case VVV_105: if (super->direction == DirectionEast) { super->direction = DirectionNorth; super->animationState = 0; @@ -248,7 +249,7 @@ void Minecart_Action4(MinecartEntity* this) { super->animationState = 3; } break; - case 0x6a: + case VVV_106: if (super->direction == DirectionWest) { super->direction = DirectionSouth; super->animationState = 2; @@ -263,7 +264,7 @@ void Minecart_Action4(MinecartEntity* this) { } super->action = 3; - gPlayerEntity.animationState = super->animationState << 1; + gPlayerEntity.animationState = super->animationState * 2; } void Minecart_Action5(MinecartEntity* this) { @@ -289,7 +290,7 @@ void Minecart_Action6(MinecartEntity* this) { minecartData->room = gRoomControls.room; minecartData->animationState = super->animationState; InitAnimationForceUpdate(super, super->animationState + 0x10); - SetTile(0x4022, COORD_TO_TILE(super), super->collisionLayer); + SetMetaTile(0x4022, COORD_TO_TILE(super), super->collisionLayer); } else { UpdateAnimationSingleFrame(super); gPlayerEntity.spritePriority.b0 = super->spritePriority.b0 - 1; @@ -343,18 +344,18 @@ const KeyValuePair* const gUnk_081223D8[] = { gUnk_08122436, }; const KeyValuePair gUnk_081223E8[] = { - { 242, 1 }, { 101, 1 }, { 104, 1 }, { 106, 1 }, { 100, 1 }, { 41, 1 }, + { VVV_242, 1 }, { VVV_101, 1 }, { VVV_104, 1 }, { VVV_106, 1 }, { VVV_100, 1 }, { VVV_41, 1 }, }; const u16 gUnk_081223E8End = 0; const KeyValuePair gUnk_08122402[] = { - { 243, 1 }, { 102, 1 }, { 104, 1 }, { 105, 1 }, { 100, 1 }, { 41, 1 }, + { VVV_243, 1 }, { VVV_102, 1 }, { VVV_104, 1 }, { VVV_105, 1 }, { VVV_100, 1 }, { VVV_41, 1 }, }; const u16 gUnk_08122402End = 0; const KeyValuePair gUnk_0812241C[] = { - { 242, 1 }, { 101, 1 }, { 103, 1 }, { 105, 1 }, { 100, 1 }, { 41, 1 }, + { VVV_242, 1 }, { VVV_101, 1 }, { VVV_103, 1 }, { VVV_105, 1 }, { VVV_100, 1 }, { VVV_41, 1 }, }; const u16 gUnk_0812241CEnd = 0; const KeyValuePair gUnk_08122436[] = { - { 243, 1 }, { 102, 1 }, { 106, 1 }, { 103, 1 }, { 100, 1 }, { 41, 1 }, + { VVV_243, 1 }, { VVV_102, 1 }, { VVV_106, 1 }, { VVV_103, 1 }, { VVV_100, 1 }, { VVV_41, 1 }, }; const u16 gUnk_08122436End = 0; diff --git a/src/object/minecartDoor.c b/src/object/minecartDoor.c index edb60f48..7b99b7b8 100644 --- a/src/object/minecartDoor.c +++ b/src/object/minecartDoor.c @@ -55,7 +55,7 @@ void MinecartDoor_Init(MinecartDoorEntity* this) { this->unk_72 = super->y.HALF.HI; super->spritePriority.b0 = 5; this->unk_76 = COORD_TO_TILE(super); - this->unk_74 = GetTileIndex(this->unk_76, super->collisionLayer); + this->unk_74 = GetMetaTileIndex(this->unk_76, super->collisionLayer); super->frameIndex = super->type; if (sub_08096CEC(this)) { if (this->unk_7e != 0) { @@ -66,7 +66,7 @@ void MinecartDoor_Init(MinecartDoorEntity* this) { } else { super->action = 1; super->spriteSettings.draw = 1; - SetTile(0x4022, this->unk_76, super->collisionLayer); + SetMetaTile(0x4022, this->unk_76, super->collisionLayer); } } } @@ -76,7 +76,7 @@ void MinecartDoor_Action1(MinecartDoorEntity* this) { super->action = 2; super->timer = 7; super->direction = super->type << 3; - SetTile(this->unk_74, this->unk_76, super->collisionLayer); + SetMetaTile(this->unk_74, this->unk_76, super->collisionLayer); EnqueueSFX(SFX_10B); } } diff --git a/src/object/minishVillageObject.c b/src/object/minishVillageObject.c index 417c3f99..e67fc613 100644 --- a/src/object/minishVillageObject.c +++ b/src/object/minishVillageObject.c @@ -90,7 +90,7 @@ void MinishVillageObject_Type1(MinishVillageObjectEntity* this) { super->subtimer = 0; super->frameIndex = 0; super->spritePriority.b0 = 7; - SetTile(0x4069, COORD_TO_TILE(super) - 0x40, 1); + SetMetaTile(0x4069, COORD_TO_TILE(super) - 0x40, 1); break; case 2: if ((gRoomTransition.frameCount & 3U) == 0) { @@ -224,7 +224,7 @@ void MinishVillageObject_Type8_Init(MinishVillageObjectEntity* this) { if (super->type2 != 0) { tilePosition -= 0x40; } - SetTile(0x4069, tilePosition, super->collisionLayer); + SetMetaTile(0x4069, tilePosition, super->collisionLayer); } } @@ -237,7 +237,7 @@ void MinishVillageObject_Type8_Action1(MinishVillageObjectEntity* this) { super->timer = 8; super->spriteRendering.alphaBlend = 0; gScreen.controls.layerFXControl = 0; - SetTile(0x4069, COORD_TO_TILE(super), super->collisionLayer); + SetMetaTile(0x4069, COORD_TO_TILE(super), super->collisionLayer); } } } diff --git a/src/object/object30.c b/src/object/object30.c index 196a3bc4..12bd96a4 100644 --- a/src/object/object30.c +++ b/src/object/object30.c @@ -39,12 +39,12 @@ void Object30(Object30Entity* this) { } void Object30_Init(Object30Entity* this) { - LayerStruct* data; + MapLayer* mapLayer; const u16* ptr; switch (super->type) { case 0: - data = GetLayerByIndex(super->collisionLayer); - ptr = &data->mapData[sub_0806F798(super)]; + mapLayer = GetLayerByIndex(super->collisionLayer); + ptr = &mapLayer->mapData[sub_0806F798(super)]; this->unk_6c = (u16*)ptr; this->unk_68 = ptr[0]; super->action = 1; diff --git a/src/object/objectA.c b/src/object/objectA.c index 77622f1f..7419a898 100644 --- a/src/object/objectA.c +++ b/src/object/objectA.c @@ -28,7 +28,7 @@ void ObjectA(Entity* this) { } this->field_0x70.HALF.LO = uVar2; if (CheckFlags(this->field_0x86.HWORD) != 0) { - SetTileType(*(u16*)&this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); + SetMetaTileType(*(u16*)&this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); if ((gRoomControls.reload_flags & 1) != 0) { gUpdateVisibleTiles = 0; } @@ -37,7 +37,7 @@ void ObjectA(Entity* this) { AddInteractableSmallKeyLock(this); } } else if (this->interactType != 0) { - SetTileType(*(u16*)&this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); + SetMetaTileType(*(u16*)&this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); SetFlag(this->field_0x86.HWORD); CreateDust(this); ModDungeonKeys(-1); diff --git a/src/object/objectBlockingStairs.c b/src/object/objectBlockingStairs.c index 5473531d..f69da586 100644 --- a/src/object/objectBlockingStairs.c +++ b/src/object/objectBlockingStairs.c @@ -109,9 +109,9 @@ void ObjectBlockingStairs_Action1(ObjectBlockingStairsEntity* this) { } if (this->unk7b & 0x40) { - tileType = (u32)GetTileType(this->tilePos - 1, super->collisionLayer); + tileType = (u32)GetMetaTileType(this->tilePos - 1, super->collisionLayer); } else { - tileType = (u32)GetTileType(this->tilePos + 1, super->collisionLayer); + tileType = (u32)GetMetaTileType(this->tilePos + 1, super->collisionLayer); } switch (tileType) { @@ -135,23 +135,23 @@ void ObjectBlockingStairs_Action1(ObjectBlockingStairsEntity* this) { if (this->unk7b & 0x80) { this->unk7b &= ~0x80; if ((this->unk7b & 0x40) != 0) { - SetTile(0x402c, this->tilePos - 1, super->collisionLayer); - SetTile(0x403d, this->tilePos + 1, super->collisionLayer); + SetMetaTile(0x402c, this->tilePos - 1, super->collisionLayer); + SetMetaTile(0x403d, this->tilePos + 1, super->collisionLayer); } else { - SetTile(0x403d, this->tilePos - 1, super->collisionLayer); - SetTile(0x402d, this->tilePos + 1, super->collisionLayer); + SetMetaTile(0x403d, this->tilePos - 1, super->collisionLayer); + SetMetaTile(0x402d, this->tilePos + 1, super->collisionLayer); } } else if (this->unk7b & 0x40) { if (xDist >= 5) { this->unk7b &= ~(0x40 | 0x80); - SetTile(0x403d, this->tilePos - 1, super->collisionLayer); - SetTile(0x402d, this->tilePos + 1, super->collisionLayer); + SetMetaTile(0x403d, this->tilePos - 1, super->collisionLayer); + SetMetaTile(0x402d, this->tilePos + 1, super->collisionLayer); } } else { if (-xDist > 4) { this->unk7b |= 0x40; - SetTile(0x402c, this->tilePos - 1, super->collisionLayer); - SetTile(0x403d, this->tilePos + 1, super->collisionLayer); + SetMetaTile(0x402c, this->tilePos - 1, super->collisionLayer); + SetMetaTile(0x403d, this->tilePos + 1, super->collisionLayer); } } } @@ -225,7 +225,7 @@ void sub_080931A4(ObjectBlockingStairsEntity* this, u32 param_2) { for (index = 0, iVar5 = 0; index < 9; index++) { u32 pos = tilePos + iVar5 + index - 1; - SetTile(pTileTypes[index], pos, collisionLayer); + SetMetaTile(pTileTypes[index], pos, collisionLayer); switch (index) { case 2: iVar5 = 0x3d; diff --git a/src/object/objectOnPillar.c b/src/object/objectOnPillar.c index ae4baa1d..daffbf1e 100644 --- a/src/object/objectOnPillar.c +++ b/src/object/objectOnPillar.c @@ -7,9 +7,9 @@ #define NENT_DEPRECATED #include "functions.h" -#include "global.h" #include "hitbox.h" #include "object.h" +#include "tiles.h" typedef struct { /*0x00*/ Entity base; @@ -150,7 +150,7 @@ void ObjectOnPillar_Action4(ObjectOnPillarEntity* this) { bool32 sub_08097008(ObjectOnPillarEntity* this) { Entity* effect; - u32 tileType = GetTileType(this->tilePosition, super->collisionLayer); + u32 tileType = GetMetaTileType(this->tilePosition, super->collisionLayer); if (tileType != 0x4036) { switch (sub_08097074(tileType)) { case 1: @@ -191,8 +191,8 @@ void sub_08097098(ObjectOnPillarEntity* this) { u16 tileType; this->unk_76 = 0x20; EnqueueSFX(SFX_10F); - SetTile(this->tileIndex, this->tilePosition, super->collisionLayer); - tileType = GetTileType(gUnk_080B4488[super->direction >> 3] + this->tilePosition, super->collisionLayer); + SetMetaTile(this->tileIndex, this->tilePosition, super->collisionLayer); + tileType = GetMetaTileType(gUnk_080B4488[super->direction >> 3] + this->tilePosition, super->collisionLayer); if ((tileType == 0x79) || tileType == 0x77) { super->spriteOffsetY = 2; } @@ -200,14 +200,14 @@ void sub_08097098(ObjectOnPillarEntity* this) { void sub_080970F4(ObjectOnPillarEntity* this) { this->tilePosition = COORD_TO_TILE(super); - this->tileIndex = GetTileIndex(this->tilePosition, super->collisionLayer); - SetTile(0x4036, this->tilePosition, super->collisionLayer); + this->tileIndex = GetMetaTileIndex(this->tilePosition, super->collisionLayer); + SetMetaTile(0x4036, this->tilePosition, super->collisionLayer); } bool32 sub_08097144(ObjectOnPillarEntity* this) { LinearMoveUpdate(super); sub_0800445C(super); - if (GetVvvAtEntity(super) == 0x19) { + if (GetVvvAtEntity(super) == VVV_25) { super->spriteOffsetY = 2; } if ((--this->unk_76 == 0) && sub_08097194(this) == FALSE) { @@ -223,7 +223,7 @@ bool32 sub_08097194(ObjectOnPillarEntity* this) { if (sub_0800442E(super)) { return TRUE; } else { - u32 tileType = GetTileTypeByEntity(super); + u32 tileType = GetMetaTileTypeByEntity(super); if (tileType == 0x71 || tileType == 0x72 || (tileType == 0x4020)) { SetFlag(this->unk_86); EnqueueSFX(SFX_10B); @@ -254,13 +254,13 @@ void sub_080971E0(ObjectOnPillarEntity* this) { super->action = 4; super->frameIndex = 1; super->spritePriority.b0 = 7; - SetTile(0, COORD_TO_TILE(super), super->collisionLayer); + SetMetaTile(0, COORD_TO_TILE(super), super->collisionLayer); DeleteThisEntity(); break; case 1: tilePosition = COORD_TO_TILE(super); if (sub_08097348(tilePosition) == 0) { - SetTileType(0x73, tilePosition, super->collisionLayer); + SetMetaTileType(0x73, tilePosition, super->collisionLayer); } DeleteThisEntity(); break; diff --git a/src/object/palaceArchway.c b/src/object/palaceArchway.c index 4f545bef..56c59c9f 100644 --- a/src/object/palaceArchway.c +++ b/src/object/palaceArchway.c @@ -22,7 +22,7 @@ void PalaceArchway_Init(Entity* this) { this->frameIndex = this->type2; this->spriteRendering.b3 = 3; this->spritePriority.b0 = 7; - SetTile(0x4069, COORD_TO_TILE(this), this->collisionLayer); + SetMetaTile(0x4069, COORD_TO_TILE(this), this->collisionLayer); } void PalaceArchway_Action1(Entity* this) { diff --git a/src/object/paper.c b/src/object/paper.c index ce3b8806..b29a0cf1 100644 --- a/src/object/paper.c +++ b/src/object/paper.c @@ -43,7 +43,7 @@ void Paper_Type0(Entity* this) { } this->spriteSettings.draw = 0; } - SetTile(0x4051, COORD_TO_TILE(this), 1); + SetMetaTile(0x4051, COORD_TO_TILE(this), 1); } void Paper_Type1(Entity* this) { @@ -63,8 +63,8 @@ void Paper_Type2(Entity* this) { this->action = 1; this->y.HALF.HI++; this->spriteOffsetY = -1; - SetTile(0x4051, COORD_TO_TILE(this) - 1, 1); - SetTile(0x4051, COORD_TO_TILE(this), 1); + SetMetaTile(0x4051, COORD_TO_TILE(this) - 1, 1); + SetMetaTile(0x4051, COORD_TO_TILE(this), 1); } void Paper_Action1(Entity* this) { diff --git a/src/object/playerClone.c b/src/object/playerClone.c index 48618a99..47446919 100644 --- a/src/object/playerClone.c +++ b/src/object/playerClone.c @@ -52,7 +52,7 @@ void PlayerClone_Init(PlayerCloneEntity* this) { super->y.HALF.HI = (super->y.HALF.HI & 0xfff0) | 8; this->tilePos = COORD_TO_TILE(super); InitializeAnimation(super, 8); - SetTile(0x4016, this->tilePos, super->collisionLayer); + SetMetaTile(0x4016, this->tilePos, super->collisionLayer); SoundReq(SFX_112); } @@ -191,7 +191,7 @@ void sub_08084CAC(PlayerCloneEntity* this) { if (((PlayerCloneEntity*)gPlayerClones[super->type])->unk70 == 0) { ptr = &gUnk_080B4468[super->animationState & 6]; - if (sub_080B1B54(GetTileType(COORD_TO_TILE_OFFSET(super, -ptr[0], -ptr[1]), super->collisionLayer)) == 0x72) { + if (sub_080B1B54(GetMetaTileType(COORD_TO_TILE_OFFSET(super, -ptr[0], -ptr[1]), super->collisionLayer)) == 0x72) { ((PlayerCloneEntity*)gPlayerClones[0])->unk6c |= (1 << super->type); } else { ((PlayerCloneEntity*)gPlayerClones[0])->unk6c &= ~(1 << super->type); diff --git a/src/object/pot.c b/src/object/pot.c index 2d635253..b3f134fa 100644 --- a/src/object/pot.c +++ b/src/object/pot.c @@ -7,12 +7,12 @@ #include "entity.h" #include "flags.h" #include "functions.h" -#include "global.h" #include "hitbox.h" #include "object.h" #include "player.h" #include "room.h" #include "sound.h" +#include "tiles.h" void Pot_Action5(Entity*); static void sub_08082850(Entity*, Entity*); @@ -68,12 +68,12 @@ void Pot_Init(Entity* this) { ResolveCollisionLayer(this); } - this->field_0x70.HALF.LO = GetTileIndex(COORD_TO_TILE(this), this->collisionLayer); + this->field_0x70.HALF.LO = GetMetaTileIndex(COORD_TO_TILE(this), this->collisionLayer); if ((u16)this->field_0x70.HALF.LO == 0x4000) { DeleteThisEntity(); } - SetTile(0x4000, COORD_TO_TILE(this), this->collisionLayer); + SetMetaTile(0x4000, COORD_TO_TILE(this), this->collisionLayer); InitializeAnimation(this, 5); } @@ -86,7 +86,7 @@ void Pot_Action1(Entity* this) { this->subAction = 0; break; case 0x1D: - SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); + SetMetaTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); this->action = 5; this->zVelocity = Q_16_16(2.625); this->spriteOffsetY = 0; @@ -96,7 +96,7 @@ void Pot_Action1(Entity* this) { Pot_Action5(this); break; default: - tileType = GetTileTypeByEntity(this); + tileType = GetMetaTileTypeByEntity(this); if (tileType != 0x4000) { switch (tileType) { case 0x4004: @@ -110,19 +110,19 @@ void Pot_Action1(Entity* this) { this->speed >>= 1; this->timer = 64; } - SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); + SetMetaTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); EnqueueSFX(SFX_10F); break; case 0x4067: - SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); + SetMetaTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); DeleteThisEntity(); break; default: - if (GetVvvAtEntity(this) == 13) { + if (GetVvvAtEntity(this) == VVV_13) { CreateFx(this, FX_FALL_DOWN, 0); } else if (tileType == 0x4005) { gPlayerState.lastSwordMove = SWORD_MOVE_BREAK_POT; - SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); + SetMetaTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); } sub_08082850(this, NULL); break; @@ -148,7 +148,7 @@ void sub_08082510(Entity* this) { this->hitType = 1; this->flags2 = gPlayerEntity.flags2; this->spriteOffsetY = 0; - SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); + SetMetaTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); this->subAction++; } @@ -212,15 +212,15 @@ void Pot_Action4(Entity* this) { this->speed <<= 1; } - this->field_0x70.HALF.LO = GetTileIndex(COORD_TO_TILE(this), this->collisionLayer); - tileType = GetTileTypeByEntity(this); + this->field_0x70.HALF.LO = GetMetaTileIndex(COORD_TO_TILE(this), this->collisionLayer); + tileType = GetMetaTileTypeByEntity(this); switch (tileType) { case 0x71: case 0x72: sub_08082850(this, NULL); break; default: - SetTile(0x4000, COORD_TO_TILE(this), this->collisionLayer); + SetMetaTile(0x4000, COORD_TO_TILE(this), this->collisionLayer); RegisterCarryEntity(this); break; } @@ -243,7 +243,7 @@ void sub_0808270C(Entity* this) { if ((gPlayerState.field_0x1c & 0xF) != 0x1 || (this->contactFlags & 0x7F) != 0x13) { this->spriteOffsetX = 0; this->action = 1; - SetTile(0x4000, COORD_TO_TILE(this), this->collisionLayer); + SetMetaTile(0x4000, COORD_TO_TILE(this), this->collisionLayer); } else { sub_0806F4E8(this); } @@ -254,7 +254,7 @@ void sub_08082778(Entity* this) { this->timer = 1; this->spriteOffsetX = 0; this->spriteOffsetY = -2; - SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); + SetMetaTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); } if ((gPlayerState.field_0x1c & 0xF) != 0x1 || (this->contactFlags & 0x7F) != 0x13) { diff --git a/src/object/pullableMushroom.c b/src/object/pullableMushroom.c index 3200afbf..d884555a 100644 --- a/src/object/pullableMushroom.c +++ b/src/object/pullableMushroom.c @@ -62,7 +62,7 @@ void PullableMushroom_Init(PullableMushroomEntity* this) { super->spritePriority.b0 = 4; super->hitbox = (Hitbox*)&gUnk_080FD224; super->carryFlags = 1; - SetTile(0x4022, COORD_TO_TILE(super), super->collisionLayer); + SetMetaTile(0x4022, COORD_TO_TILE(super), super->collisionLayer); super->health = 1; super->collisionFlags = 7; super->hitType = 0x6e; diff --git a/src/object/pushableFurniture.c b/src/object/pushableFurniture.c index e7310174..c18a041a 100644 --- a/src/object/pushableFurniture.c +++ b/src/object/pushableFurniture.c @@ -169,7 +169,7 @@ void PushableFurniture_Action1(PushableFurnitureEntity* this) { } void sub_0808FB68(PushableFurnitureEntity* this) { - u32 tileIndex = GetTileIndex(this->unk_70, super->collisionLayer); + u32 tileIndex = GetMetaTileIndex(this->unk_70, super->collisionLayer); switch (tileIndex) { case 0x4030: case 0x4031: @@ -179,7 +179,7 @@ void sub_0808FB68(PushableFurnitureEntity* this) { sub_0808FD44(this, 0); break; default: - tileIndex = GetTileIndex(this->unk_72, super->collisionLayer); + tileIndex = GetMetaTileIndex(this->unk_72, super->collisionLayer); switch (tileIndex) { case 0x4030: case 0x4031: @@ -195,7 +195,7 @@ void sub_0808FB68(PushableFurnitureEntity* this) { } void sub_0808FBFC(PushableFurnitureEntity* this) { - u32 tileIndex = GetTileIndex(this->unk_7c, super->collisionLayer); + u32 tileIndex = GetMetaTileIndex(this->unk_7c, super->collisionLayer); if (tileIndex != 0x404a) { super->action = 2; super->direction = ((tileIndex - 0x4bU) & 3) << 3; @@ -303,7 +303,7 @@ void sub_0808FD44(PushableFurnitureEntity* this, u32 param_2) { } EnqueueSFX(SFX_10F); sub_08090254(this); - GetTileIndex(tmp + gUnk_080B4488[super->direction >> 3], super->collisionLayer); + GetMetaTileIndex(tmp + gUnk_080B4488[super->direction >> 3], super->collisionLayer); } void sub_0808FDE8(PushableFurnitureEntity* this) { @@ -313,28 +313,28 @@ void sub_0808FDE8(PushableFurnitureEntity* this) { uVar3 = (u32)this->unk_70; uVar1 = GetCollisionDataAtMetaTilePos(uVar3 - 1, 1); - iVar2 = GetTileIndex(uVar3, 1); + iVar2 = GetMetaTileIndex(uVar3, 1); if (iVar2 == 0x402e) { if ((((uVar1 & 0xf0) != 0) && ((uVar1 & 0xf0) != 0x50)) || ((uVar1 & 5) == 0)) { - SetTile(0x402c, uVar3, 1); + SetMetaTile(0x402c, uVar3, 1); } } else { iVar2 = GetCollisionDataAtMetaTilePos(uVar3, 1); if ((iVar2 == 5) && ((((uVar1 & 0xf0) == 0 || ((uVar1 & 0xf0) == 0x50)) && ((uVar1 & 5) != 0)))) { - SetTile(0x402e, uVar3, 1); + SetMetaTile(0x402e, uVar3, 1); } } uVar3 = (u32)this->unk_72; uVar1 = GetCollisionDataAtMetaTilePos(uVar3 + 1, 1); - iVar2 = GetTileIndex(uVar3, 1); + iVar2 = GetMetaTileIndex(uVar3, 1); if (iVar2 == 0x402f) { if ((((uVar1 & 0xf0) != 0) && ((uVar1 & 0xf0) != 0x50)) || ((uVar1 & 10) == 0)) { - SetTile(0x402d, uVar3, 1); + SetMetaTile(0x402d, uVar3, 1); } } else { iVar2 = GetCollisionDataAtMetaTilePos(uVar3, 1); if (((iVar2 == 10) && (((uVar1 & 0xf0) == 0 || ((uVar1 & 0xf0) == 0x50)))) && ((uVar1 & 10) != 0)) { - SetTile(0x402f, uVar3, 1); + SetMetaTile(0x402f, uVar3, 1); } } } @@ -380,24 +380,24 @@ void sub_0808FF50(PushableFurnitureEntity* this) { switch (this->unk_80) { case 0: this->unk_70 = tmp; - this->unk_74 = GetTileIndex(this->unk_70, 1); - SetTile(0x404a, tmp, 1); + this->unk_74 = GetMetaTileIndex(this->unk_70, 1); + SetMetaTile(0x404a, tmp, 1); break; case 1: if ((tmp2 & 8) != 0) { this->unk_70 = this->unk_7c; - this->unk_74 = GetTileIndex(this->unk_70, 1); - SetTile(gUnk_08121EE4[this->unk_81], position, 1); + this->unk_74 = GetMetaTileIndex(this->unk_70, 1); + SetMetaTile(gUnk_08121EE4[this->unk_81], position, 1); this->unk_72 = tmp + 1; - this->unk_76 = GetTileIndex(this->unk_72, 1); + this->unk_76 = GetMetaTileIndex(this->unk_72, 1); sub_08090094(this, gUnk_08121EE4[this->unk_81 + 4], this->unk_72); sub_0809028C(this, 1); } else { this->unk_72 = this->unk_7c; - this->unk_76 = GetTileIndex(this->unk_72, 1); - SetTile(gUnk_08121EE4[this->unk_81], position, 1); + this->unk_76 = GetMetaTileIndex(this->unk_72, 1); + SetMetaTile(gUnk_08121EE4[this->unk_81], position, 1); this->unk_70 = tmp - 1; - this->unk_74 = GetTileIndex(this->unk_70, 1); + this->unk_74 = GetMetaTileIndex(this->unk_70, 1); sub_08090094(this, gUnk_08121EE4[this->unk_81 + 2], this->unk_70); sub_0809028C(this, 0); } @@ -412,7 +412,7 @@ void sub_08090094(PushableFurnitureEntity* this, u32 param_2, u32 tilePos) { u32 tmp2; tmp1 = GetCollisionDataAtMetaTilePos(tilePos, 1); - index = GetTileIndex(tilePos, 1); + index = GetMetaTileIndex(tilePos, 1); if ((index & 0x4000) == 0) { index = param_2; switch (index) { @@ -420,14 +420,14 @@ void sub_08090094(PushableFurnitureEntity* this, u32 param_2, u32 tilePos) { if (tmp1 == 5) { index = 0x4022; } - SetTile(index, tilePos, 1); + SetMetaTile(index, tilePos, 1); return; case 0x402d: case 0x402f: if (tmp1 == 5) { index = 0x4022; } - SetTile(index, tilePos, 1); + SetMetaTile(index, tilePos, 1); return; case 0x4024: case 0x402c: @@ -435,10 +435,10 @@ void sub_08090094(PushableFurnitureEntity* this, u32 param_2, u32 tilePos) { if (tmp1 == 10) { index = 0x4022; } - SetTile(index, tilePos, 1); + SetMetaTile(index, tilePos, 1); return; default: - SetTile(index, tilePos, 1); + SetMetaTile(index, tilePos, 1); return; } } @@ -490,7 +490,7 @@ void sub_08090094(PushableFurnitureEntity* this, u32 param_2, u32 tilePos) { break; } - SetTile(index, tilePos, 1); + SetMetaTile(index, tilePos, 1); } void sub_08090254(PushableFurnitureEntity* this) { @@ -511,7 +511,7 @@ void sub_0809028C(PushableFurnitureEntity* this, u32 param_2) { if ((this->unk_83 & 0x20) != 0) { sub_08090480(0, uVar2 + 1); } else { - switch (GetTileType(uVar2, 2)) { + switch (GetMetaTileType(uVar2, 2)) { case 0x301: this->unk_83 |= 8; break; @@ -525,7 +525,7 @@ void sub_0809028C(PushableFurnitureEntity* this, u32 param_2) { sub_08090480(0, uVar2); } if ((this->unk_83 & 0x10) != 0) { - switch (GetTileType(pos - 1, 1)) { + switch (GetMetaTileType(pos - 1, 1)) { case 0x300: break; default: @@ -535,7 +535,7 @@ void sub_0809028C(PushableFurnitureEntity* this, u32 param_2) { } return; } - switch (GetTileType(pos - 1, 2)) { + switch (GetMetaTileType(pos - 1, 2)) { case 0x300: this->unk_83 |= 4; break; @@ -552,7 +552,7 @@ void sub_0809028C(PushableFurnitureEntity* this, u32 param_2) { if ((this->unk_83 & 0x10) != 0) { sub_08090480(0, pos - 1); } else { - switch (GetTileType(pos, 2)) { + switch (GetMetaTileType(pos, 2)) { case 0x302: this->unk_83 |= 4; break; @@ -566,7 +566,7 @@ void sub_0809028C(PushableFurnitureEntity* this, u32 param_2) { sub_08090480(0, uVar2); } if ((this->unk_83 & 0x20) != 0) { - switch (GetTileType(uVar2 + 1, 1)) { + switch (GetMetaTileType(uVar2 + 1, 1)) { case 0x300: break; default: @@ -576,7 +576,7 @@ void sub_0809028C(PushableFurnitureEntity* this, u32 param_2) { } return; } - switch (GetTileType(uVar2 + 1, 2)) { + switch (GetMetaTileType(uVar2 + 1, 2)) { case 0x300: this->unk_83 |= 8; break; @@ -592,18 +592,18 @@ void sub_0809028C(PushableFurnitureEntity* this, u32 param_2) { } void sub_08090480(u32 param_1, u32 param_2) { - SetTile(gUnk_08121EF0[param_1], param_2, 1); + SetMetaTile(gUnk_08121EF0[param_1], param_2, 1); } void sub_08090498(PushableFurnitureEntity* this) { u32 tmp = this->unk_70 - 0x80; RestorePrevTileEntity(tmp, 1); - if (((this->unk_83 & 1) != 0) && (GetTileType(tmp, 2) == 0x306)) { + if (((this->unk_83 & 1) != 0) && (GetMetaTileType(tmp, 2) == 0x306)) { SetCollisionData(0x62, tmp, 1); } tmp = this->unk_72 - 0x80; RestorePrevTileEntity(tmp, 1); - if (((this->unk_83 & 2) != 0) && (GetTileType(tmp, 2) == 0x308)) { + if (((this->unk_83 & 2) != 0) && (GetMetaTileType(tmp, 2) == 0x308)) { SetCollisionData(99, tmp, 1); } } diff --git a/src/object/pushableGrave.c b/src/object/pushableGrave.c index 6452d3db..04bf070c 100644 --- a/src/object/pushableGrave.c +++ b/src/object/pushableGrave.c @@ -47,15 +47,15 @@ void PushableGrave_Init(PushableGraveEntity* this) { super->frameIndex = super->type; super->updatePriority = 3; tilePosition = COORD_TO_TILE(super); - this->unk_6a = GetTileIndex(tilePosition - 0x41, super->collisionLayer); - this->unk_6c = GetTileIndex(tilePosition - 0x40, super->collisionLayer); - this->unk_6e = GetTileIndex(tilePosition - 0x3f, super->collisionLayer); - this->unk_70 = GetTileIndex(tilePosition - 1, super->collisionLayer); - this->unk_72 = GetTileIndex(tilePosition, super->collisionLayer); - this->unk_74 = GetTileIndex(tilePosition + 1, super->collisionLayer); - this->unk_76 = GetTileIndex(tilePosition + 0x3f, super->collisionLayer); - this->unk_78 = GetTileIndex(tilePosition + 0x40, super->collisionLayer); - this->unk_7a = GetTileIndex(tilePosition + 0x41, super->collisionLayer); + this->unk_6a = GetMetaTileIndex(tilePosition - 0x41, super->collisionLayer); + this->unk_6c = GetMetaTileIndex(tilePosition - 0x40, super->collisionLayer); + this->unk_6e = GetMetaTileIndex(tilePosition - 0x3f, super->collisionLayer); + this->unk_70 = GetMetaTileIndex(tilePosition - 1, super->collisionLayer); + this->unk_72 = GetMetaTileIndex(tilePosition, super->collisionLayer); + this->unk_74 = GetMetaTileIndex(tilePosition + 1, super->collisionLayer); + this->unk_76 = GetMetaTileIndex(tilePosition + 0x3f, super->collisionLayer); + this->unk_78 = GetMetaTileIndex(tilePosition + 0x40, super->collisionLayer); + this->unk_7a = GetMetaTileIndex(tilePosition + 0x41, super->collisionLayer); if (sub_0809798C(this)) { if (super->type == 0) { super->y.HALF.HI -= 0x16; @@ -71,12 +71,12 @@ void PushableGrave_Init(PushableGraveEntity* this) { tileIndex = PushableGrave_Tiles[super->type2]; if (super->type == 0) { super->hitbox = (Hitbox*)&gUnk_080FD578; - SetTile(tileIndex, tilePosition - 1, super->collisionLayer); - SetTile(tileIndex, tilePosition, super->collisionLayer); + SetMetaTile(tileIndex, tilePosition - 1, super->collisionLayer); + SetMetaTile(tileIndex, tilePosition, super->collisionLayer); super->y.HALF.HI += 2; } else { super->hitbox = (Hitbox*)&gUnk_080FD570; - SetTile(tileIndex, tilePosition, super->collisionLayer); + SetMetaTile(tileIndex, tilePosition, super->collisionLayer); if (super->type2 == 2) { SetMultipleTiles((TileData*)gUnk_081232C0, tilePosition, super->collisionLayer); } @@ -136,9 +136,9 @@ void sub_080977F4(PushableGraveEntity* this) { super->action = 4; super->spriteOffsetY = 0; tilePosition = COORD_TO_TILE(super); - SetTile(0x4022, tilePosition, super->collisionLayer); + SetMetaTile(0x4022, tilePosition, super->collisionLayer); if (super->type == 0) { - SetTile(0x4022, tilePosition - 1, super->collisionLayer); + SetMetaTile(0x4022, tilePosition - 1, super->collisionLayer); } if (this->pushedFlag != 0) { SetFlag(this->pushedFlag); @@ -150,7 +150,7 @@ bool32 sub_0809785C(PushableGraveEntity* this) { if (super->type != 0) { if (super->type2 != 0) { - if ((CheckFlags(this->pushedFlag) != 0) || GetTileType(this->unk_68, super->collisionLayer) == 0x403f) { + if ((CheckFlags(this->pushedFlag) != 0) || GetMetaTileType(this->unk_68, super->collisionLayer) == 0x403f) { super->action = 3; super->timer = 64; super->subtimer = 0; diff --git a/src/object/pushableLever.c b/src/object/pushableLever.c index dec3fcb7..9fdc0151 100644 --- a/src/object/pushableLever.c +++ b/src/object/pushableLever.c @@ -33,7 +33,7 @@ extern const u8 PushableLever_PushedOffsets[]; void PushableLever_SetIdle(PushableLeverEntity*); bool32 PushableLever_ShouldStartPushing(PushableLeverEntity* this); -void PushableLever_SetTiles(PushableLeverEntity*); +void PushableLever_SetMetaTiles(PushableLeverEntity*); void PushableLever_CalculateSpriteOffsets(PushableLeverEntity*); #define TILE_INITIAL 0x4053 @@ -53,7 +53,7 @@ void PushableLever_Idle(PushableLeverEntity* this) { super->action = PUSHING; super->spriteOffsetX = 0; super->spriteOffsetY = 0; - SetTile(this->tileIndex, this->tilePosition, super->collisionLayer); + SetMetaTile(this->tileIndex, this->tilePosition, super->collisionLayer); EnqueueSFX(SFX_16A); RequestPriorityDuration(super, 30); if (PlayerCanBeMoved()) { @@ -82,32 +82,32 @@ void PushableLever_Pushing(PushableLeverEntity* this) { void PushableLever_SetIdle(PushableLeverEntity* this) { super->action = IDLE; this->timer = 60; - PushableLever_SetTiles(this); + PushableLever_SetMetaTiles(this); } -void PushableLever_SetTiles(PushableLeverEntity* this) { +void PushableLever_SetMetaTiles(PushableLeverEntity* this) { if (CheckFlags(this->pushedFlag) == FALSE) { super->type2 = 0; this->tilePosition = COORD_TO_TILE_OFFSET(super, 0, 0x10); - this->tileIndex = GetTileIndex(this->tilePosition, super->collisionLayer); - SetTile(TILE_INITIAL, this->tilePosition, super->collisionLayer); + this->tileIndex = GetMetaTileIndex(this->tilePosition, super->collisionLayer); + SetMetaTile(TILE_INITIAL, this->tilePosition, super->collisionLayer); InitializeAnimation(super, 1); } else { super->type2 = 1; this->tilePosition = COORD_TO_TILE_OFFSET(super, 0x10, 0); - this->tileIndex = GetTileIndex(this->tilePosition, super->collisionLayer); - SetTile(TILE_PUSHED, this->tilePosition, super->collisionLayer); + this->tileIndex = GetMetaTileIndex(this->tilePosition, super->collisionLayer); + SetMetaTile(TILE_PUSHED, this->tilePosition, super->collisionLayer); InitializeAnimation(super, 0); } } bool32 PushableLever_ShouldStartPushing(PushableLeverEntity* this) { - if (GetTileIndex(this->tilePosition, super->collisionLayer) == 0x4054) { + if (GetMetaTileIndex(this->tilePosition, super->collisionLayer) == 0x4054) { if (--this->timer == 0) { return TRUE; } PushableLever_CalculateSpriteOffsets(this); - SetTile(PushableLever_Tiles[super->type2], this->tilePosition, super->collisionLayer); + SetMetaTile(PushableLever_Tiles[super->type2], this->tilePosition, super->collisionLayer); } else { this->timer = 60; super->spriteOffsetX = 0; diff --git a/src/object/pushableRock.c b/src/object/pushableRock.c index 464bb24a..8287b494 100644 --- a/src/object/pushableRock.c +++ b/src/object/pushableRock.c @@ -7,8 +7,8 @@ #define NENT_DEPRECATED #include "functions.h" -#include "global.h" #include "object.h" +#include "tiles.h" typedef struct { /*0x00*/ Entity base; @@ -43,7 +43,7 @@ void PushableRock_Action1(PushableRockEntity* this) { u32 tileType; u32 tmp; - tileType = GetTileType(this->tilePosition, super->collisionLayer); + tileType = GetMetaTileType(this->tilePosition, super->collisionLayer); switch (tileType) { case 0x401c: case 0x401d: @@ -57,7 +57,7 @@ void PushableRock_Action1(PushableRockEntity* this) { } else { super->spriteSettings.flipX = 0; } - SetTile(this->tileIndex, this->tilePosition, super->collisionLayer); + SetMetaTile(this->tileIndex, this->tilePosition, super->collisionLayer); super->action = 2; InitializeAnimation(super, (super->animationState >> 1) + 1); EnqueueSFX(SFX_10F); @@ -91,11 +91,11 @@ void PushableRock_Action3(PushableRockEntity* this) { void sub_0808A644(PushableRockEntity* this) { u32 vvv; this->tilePosition = COORD_TO_TILE(super); - this->tileIndex = GetTileIndex(this->tilePosition, super->collisionLayer); + this->tileIndex = GetMetaTileIndex(this->tilePosition, super->collisionLayer); this->unk_72 = GetCollisionDataAtMetaTilePos(this->tilePosition, super->collisionLayer); vvv = GetVvvAtMetaTilePos(this->tilePosition, super->collisionLayer); - if ((vvv == 0x19) || (vvv == 0xf0)) { - SetTile(0x4015, this->tilePosition, super->collisionLayer); + if ((vvv == VVV_25) || (vvv == VVV_240)) { + SetMetaTile(0x4015, this->tilePosition, super->collisionLayer); super->action = 3; if (!CheckFlags(this->pushedFlag)) { SetFlag(this->pushedFlag); @@ -105,7 +105,7 @@ void sub_0808A644(PushableRockEntity* this) { InitializeAnimation(super, 6); } } else { - SetTile(0x401b, this->tilePosition, super->collisionLayer); + SetMetaTile(0x401b, this->tilePosition, super->collisionLayer); } } diff --git a/src/object/pushableStatue.c b/src/object/pushableStatue.c index f6722b71..e24f56ee 100644 --- a/src/object/pushableStatue.c +++ b/src/object/pushableStatue.c @@ -5,10 +5,10 @@ * @brief Pushable Statue object */ #define NENT_DEPRECATED -#include "global.h" #include "object.h" #include "functions.h" #include "hitbox.h" +#include "tiles.h" typedef struct { /*0x00*/ Entity base; @@ -62,7 +62,7 @@ void PushableStatue_Action1(PushableStatueEntity* this) { Entity* obj; if (sub_0800442E(super) == 0) { - tileType = GetTileType(this->unk_84, super->collisionLayer); + tileType = GetMetaTileType(this->unk_84, super->collisionLayer); if (tileType != 0x400b) { switch (sub_0808968C(tileType)) { case 1: @@ -110,7 +110,7 @@ void PushableStatue_SubAction0(PushableStatueEntity* this) { ptr = &gUnk_08120CB4[index]; PositionRelative(super, &gPlayerEntity, *(ptr) << 0x10, *(ptr + 1) << 0x10); } - tileType = GetTileType(this->unk_84, super->collisionLayer); + tileType = GetMetaTileType(this->unk_84, super->collisionLayer); if (tileType != 0x400b) { switch (sub_0808968C(tileType)) { case 1: @@ -157,17 +157,17 @@ void PushableStatue_Action4(PushableStatueEntity* this) { } else { super->spriteSettings.draw = 1; super->action = 1; - SetTile(0x400b, this->unk_84, super->collisionLayer); + SetMetaTile(0x400b, this->unk_84, super->collisionLayer); sub_080894C8(this); } } void sub_08089454(PushableStatueEntity* this) { this->unk_84 = COORD_TO_TILE(super); - this->unk_80 = GetTileIndex(this->unk_84, super->collisionLayer); - SetTile(0x400b, this->unk_84, super->collisionLayer); - if (super->collisionLayer == 2 && GetTileType(this->unk_84, 1) == 0x310) { - SetTile(0x400b, this->unk_84, 1); + this->unk_80 = GetMetaTileIndex(this->unk_84, super->collisionLayer); + SetMetaTile(0x400b, this->unk_84, super->collisionLayer); + if (super->collisionLayer == 2 && GetMetaTileType(this->unk_84, 1) == 0x310) { + SetMetaTile(0x400b, this->unk_84, 1); } } @@ -196,11 +196,11 @@ void sub_08089538(PushableStatueEntity* this) { u16 tileType; this->unk_86 = 0x20; EnqueueSFX(SFX_10F); - SetTile(this->unk_80, this->unk_84, super->collisionLayer); - if ((super->collisionLayer == 2) && (GetTileType(this->unk_84, 1) == 0x400b)) { + SetMetaTile(this->unk_80, this->unk_84, super->collisionLayer); + if ((super->collisionLayer == 2) && (GetMetaTileType(this->unk_84, 1) == 0x400b)) { CloneTile(0x310, this->unk_84, 1); } - tileType = GetTileType(this->unk_84 + gUnk_080B4488[super->direction >> 3], super->collisionLayer); + tileType = GetMetaTileType(this->unk_84 + gUnk_080B4488[super->direction >> 3], super->collisionLayer); if ((tileType == 0x79) || (tileType == 0x77)) { super->spriteOffsetY = -2; } @@ -253,7 +253,7 @@ u32 sub_0808968C(u32 param_1) { bool32 sub_080896B0(void) { s16 uVar1; s16 iVar2; - LayerStruct* layer; + MapLayer* mapLayer; s32 uVar4; const s16* ptr; u32 tmp1; @@ -265,11 +265,11 @@ bool32 sub_080896B0(void) { uVar1 = gUnk_080B4488[gPlayerEntity.animationState >> 1]; uVar4 = COORD_TO_TILE_OFFSET(&gPlayerEntity, -ptr[0], -ptr[1]) - uVar1; vvv = GetVvvAtMetaTilePos(uVar4, gPlayerEntity.collisionLayer); - if ((vvv - 0x26 > 1) && (vvv != 0x29)) { - layer = GetLayerByIndex(gPlayerEntity.collisionLayer); + if ((vvv - 0x26 > 1) && (vvv != VVV_41)) { + mapLayer = GetLayerByIndex(gPlayerEntity.collisionLayer); iVar2 = (uVar4 * 0x10000) >> 0x10; - tmp1 = layer->collisionData[iVar2]; - tmp2 = layer->collisionData[(iVar2 - uVar1)]; + tmp1 = mapLayer->collisionData[iVar2]; + tmp2 = mapLayer->collisionData[(iVar2 - uVar1)]; if ((tmp1 == 0) && (tmp2 == 0)) { return TRUE; } diff --git a/src/object/railtrack.c b/src/object/railtrack.c index 5a77c8db..3162ebf8 100644 --- a/src/object/railtrack.c +++ b/src/object/railtrack.c @@ -128,13 +128,13 @@ void sub_08085394(Entity* this) { tile = COORD_TO_TILE(this); this->field_0x74.HWORD = *(layerData - off); - SetTile(uVar1, tile - off, this->collisionLayer); + SetMetaTile(uVar1, tile - off, this->collisionLayer); this->field_0x76.HWORD = layerData[0x0]; - SetTile(uVar1, tile - 0x0, this->collisionLayer); + SetMetaTile(uVar1, tile - 0x0, this->collisionLayer); this->field_0x78.HWORD = layerData[off]; - SetTile(uVar1, tile + off, this->collisionLayer); + SetMetaTile(uVar1, tile + off, this->collisionLayer); } void sub_0808543C(Entity* this) { @@ -144,9 +144,9 @@ void sub_0808543C(Entity* this) { temp = gUnk_080B4488[this->animationState / 2][0]; uVar2 = COORD_TO_TILE(this); - SetTile(this->field_0x74.HWORD, uVar2 - temp, this->collisionLayer); - SetTile(this->field_0x76.HWORD, uVar2, this->collisionLayer); - SetTile(this->field_0x78.HWORD, uVar2 + temp, this->collisionLayer); + SetMetaTile(this->field_0x74.HWORD, uVar2 - temp, this->collisionLayer); + SetMetaTile(this->field_0x76.HWORD, uVar2, this->collisionLayer); + SetMetaTile(this->field_0x78.HWORD, uVar2 + temp, this->collisionLayer); } u32 sub_080854A8(Entity* this) { diff --git a/src/object/rotatingTrapdoor.c b/src/object/rotatingTrapdoor.c index 9aa0f947..df523b5d 100644 --- a/src/object/rotatingTrapdoor.c +++ b/src/object/rotatingTrapdoor.c @@ -32,7 +32,7 @@ void RotatingTrapdoor_Init(Entity* this) { this->action = 1; x = 0; y = 0; - switch (GetTileTypeByEntity(this)) { + switch (GetMetaTileTypeByEntity(this)) { case 0x343: x = 0x10; case 0x344: diff --git a/src/object/smallIceBlock.c b/src/object/smallIceBlock.c index 1c5e048a..bc1754d4 100644 --- a/src/object/smallIceBlock.c +++ b/src/object/smallIceBlock.c @@ -87,7 +87,7 @@ void SmallIceBlock_Action1(SmallIceBlockEntity* this) { } } else { if (!sub_0800442E(super)) { - tileType = GetTileType(this->unk_70, super->collisionLayer); + tileType = GetMetaTileType(this->unk_70, super->collisionLayer); if (tileType != 0x405a) { switch (sub_08099618(tileType)) { case 1: @@ -102,7 +102,7 @@ void SmallIceBlock_Action1(SmallIceBlockEntity* this) { if (obj != NULL) { CopyPosition(super, obj); } - SetTile(this->unk_6c, this->unk_70, super->collisionLayer); + SetMetaTile(this->unk_6c, this->unk_70, super->collisionLayer); DeleteEntity(super); break; @@ -161,7 +161,7 @@ void SmallIceBlock_Action4(SmallIceBlockEntity* this) { DeleteThisEntity(); } else { if (super->timer == 0x30) { - SetTile(this->unk_6c, this->unk_70, super->collisionLayer); + SetMetaTile(this->unk_6c, this->unk_70, super->collisionLayer); } SetAffineInfo(super, 0x100, (0x3c - super->timer) * 0x20 + 0x100, 0); if ((super->timer & 1) != 0) { @@ -179,19 +179,19 @@ void SmallIceBlock_Action4(SmallIceBlockEntity* this) { void sub_08099468(SmallIceBlockEntity* this) { this->unk_70 = COORD_TO_TILE(super); - this->unk_6c = GetTileIndex(this->unk_70, super->collisionLayer); - SetTile(0x405a, this->unk_70, super->collisionLayer); + this->unk_6c = GetMetaTileIndex(this->unk_70, super->collisionLayer); + SetMetaTile(0x405a, this->unk_70, super->collisionLayer); } void sub_080994B8(SmallIceBlockEntity* this) { u16 tileType; EnqueueSFX(SFX_ICE_BLOCK_SLIDE); - SetTile(this->unk_6c, this->unk_70, super->collisionLayer); - if ((super->collisionLayer == 2) && (GetTileType(this->unk_70, 1) == 0x405a)) { + SetMetaTile(this->unk_6c, this->unk_70, super->collisionLayer); + if ((super->collisionLayer == 2) && (GetMetaTileType(this->unk_70, 1) == 0x405a)) { CloneTile(0x310, this->unk_70, 1); } - tileType = GetTileType(this->unk_70 + gUnk_080B4488[super->direction >> 3], super->collisionLayer); + tileType = GetMetaTileType(this->unk_70 + gUnk_080B4488[super->direction >> 3], super->collisionLayer); if (tileType == 0x79 || tileType == 0x77) { super->spriteOffsetY = -2; } diff --git a/src/object/smokeParticle.c b/src/object/smokeParticle.c index dacd282f..774ded3d 100644 --- a/src/object/smokeParticle.c +++ b/src/object/smokeParticle.c @@ -6,8 +6,8 @@ */ #define NENT_DEPRECATED #include "functions.h" -#include "global.h" #include "object.h" +#include "tiles.h" void SmokeParticle_Init(Entity*); void SmokeParticle_Action1(Entity*); @@ -64,22 +64,22 @@ void sub_080878CC(Entity* this) { s32 itX; s32 itY; u32 layer; - u32 pos; + u32 metaTilePos; x = this->x.HALF.HI; y = this->y.HALF.HI; layer = this->collisionLayer; for (itX = -0x10; itX < 0x11; itX += 0x10) { for (itY = -0x10; itY < 0x11; itY += 0x10) { - pos = TILE((u32)x + itX, (u32)y + itY); - if (GetVvvAtMetaTilePos(pos, (u8)layer) == 0x2e) { - switch (GetTileType(pos, layer)) { + metaTilePos = TILE((u32)x + itX, (u32)y + itY); + if (GetVvvAtMetaTilePos(metaTilePos, (u8)layer) == VVV_46) { + switch (GetMetaTileType(metaTilePos, layer)) { case 0x368: case 0x367: sub_08008796(this, 3, x + itX, y + itY); break; default: - SetTile(0x4022, pos, layer); + SetMetaTile(0x4022, metaTilePos, layer); break; } } else { diff --git a/src/object/treeHidingPortal.c b/src/object/treeHidingPortal.c index 8887c9db..333c5d70 100644 --- a/src/object/treeHidingPortal.c +++ b/src/object/treeHidingPortal.c @@ -8,11 +8,11 @@ #include "entity.h" #include "flags.h" #include "functions.h" -#include "global.h" #include "object.h" #include "player.h" #include "room.h" #include "sound.h" +#include "tiles.h" extern const s16 gUnk_080B4468[]; @@ -54,7 +54,7 @@ void TreeHidingPortal_Action1(Entity* this) { } } } - if (sub_0809E9A0() == 0x54) { + if (sub_0809E9A0() == VVV_84) { this->action = 2; this->timer = 15; SetPlayerControl(1); @@ -108,7 +108,7 @@ static u32 sub_0809E9A0(void) { const s16* ptr; if (gPlayerEntity.action != PLAYER_BOUNCE) { - vvv = 0; + vvv = VVV_0; } else { ptr = &gUnk_080B4468[gPlayerEntity.animationState & 6]; vvv = GetVvvAtMetaTilePos(COORD_TO_TILE_OFFSET(&gPlayerEntity, -ptr[0], -ptr[1]), 1); diff --git a/src/object/treeThorns.c b/src/object/treeThorns.c index e01a832d..30d40a11 100644 --- a/src/object/treeThorns.c +++ b/src/object/treeThorns.c @@ -30,8 +30,8 @@ void TreeThorns(Entity* this) { this->flags2 = 1; this->hitbox = (Hitbox*)&gHitbox_1; tilePos = COORD_TO_TILE(this); - SetTile(0x4066, tilePos - 1, *layer); - SetTile(0x4065, tilePos, *layer); + SetMetaTile(0x4066, tilePos - 1, *layer); + SetMetaTile(0x4065, tilePos, *layer); UpdateSpriteForCollisionLayer(this); ent = CreateObject(TREE_THORNS, 1, 0); if (ent != NULL) { diff --git a/src/object/unusedSkull.c b/src/object/unusedSkull.c index c6a2e1f5..739cbb8d 100644 --- a/src/object/unusedSkull.c +++ b/src/object/unusedSkull.c @@ -40,7 +40,7 @@ void UnusedSkull_Init(UnusedSkullEntity* this) { super->hurtType = 0x47; super->flags2 = 2; super->hitbox = (Hitbox*)&gHitbox_4; - SetTile(0x4050, COORD_TO_TILE(super), super->collisionLayer); + SetMetaTile(0x4050, COORD_TO_TILE(super), super->collisionLayer); if (super->type == 1 || CheckFlags(this->unk_86)) { super->action = 3; SetFlag(this->unk_86); diff --git a/src/object/waterfallOpening.c b/src/object/waterfallOpening.c index 72c724d1..92455ebb 100644 --- a/src/object/waterfallOpening.c +++ b/src/object/waterfallOpening.c @@ -77,7 +77,7 @@ void WaterfallOpening(Entity* this) { case 2: if ((this->subAction == 0)) { this->subAction = 1; - SetTileType(0x39, COORD_TO_TILE(this), 1); + SetMetaTileType(0x39, COORD_TO_TILE(this), 1); } } diff --git a/src/object/well.c b/src/object/well.c index 8f866a41..480a0821 100644 --- a/src/object/well.c +++ b/src/object/well.c @@ -28,13 +28,13 @@ void Well_Init(Entity* this) { this->action = 1; tilePos = COORD_TO_TILE(this); this->field_0x80.HWORD = tilePos; - SetTile(0x407d, this->field_0x80.HWORD, 1); + SetMetaTile(0x407d, this->field_0x80.HWORD, 1); } void Well_Action1(Entity* this) { s32 tileIndex; - tileIndex = GetTileType(this->field_0x80.HWORD, 1); + tileIndex = GetMetaTileType(this->field_0x80.HWORD, 1); if (tileIndex != 0x407d) { sub_08078B48(); gPlayerEntity.x.WORD = this->x.WORD; diff --git a/src/physics.c b/src/physics.c index 24bc75f8..8465bc7c 100644 --- a/src/physics.c +++ b/src/physics.c @@ -235,8 +235,8 @@ bool32 sub_0806F854(Entity* ent, s32 x, s32 y) { bool32 sub_0806F8DC(Entity* ent) { if (ent->collisionLayer & 2) return FALSE; - if (!GetTileTypeByPos(ent->x.HALF.HI, ent->y.HALF.HI - 4, 2)) { - GetTileTypeByPos(ent->x.HALF.HI, ent->y.HALF.HI - 4, ent->collisionLayer); + if (!GetMetaTileTypeByPos(ent->x.HALF.HI, ent->y.HALF.HI - 4, 2)) { + GetMetaTileTypeByPos(ent->x.HALF.HI, ent->y.HALF.HI - 4, ent->collisionLayer); ent->spriteRendering.b3 = 1; ent->spriteOrientation.flipY = 1; return FALSE; diff --git a/src/player.c b/src/player.c index 985c1739..0dd88815 100644 --- a/src/player.c +++ b/src/player.c @@ -24,6 +24,7 @@ #include "screen.h" #include "screenTransitions.h" #include "sound.h" +#include "tiles.h" #define GRAVITY_RATE Q_8_8(32) #define SLOPE_SPEED_MODIFIER 0x50 @@ -1974,7 +1975,7 @@ static void PlayerRoomTransition(Entity* this) { static void sub_080724DC(Entity* this) { this->knockbackDuration = 0; DeleteClones(); - if (GetVvvAtEntity(this) != 0x29) { + if (GetVvvAtEntity(this) != VVV_41) { if ((gPlayerState.remainingDiveTime == 0) && (gPlayerState.swim_state != 0)) { PlayerUpdateSwimming(this); } @@ -2000,7 +2001,7 @@ static void sub_080724DC(Entity* this) { static void sub_0807258C(Entity* this) { if (gRoomControls.reload_flags == 0) { - if (GetVvvInFront(this) == 0x29) { + if (GetVvvInFront(this) == VVV_41) { UpdatePlayerMovement(); if (sub_080797C4() != 0) { gPlayerState.startPosX = gPlayerEntity.x.HALF.HI; @@ -2188,11 +2189,11 @@ static void PlayerInHoleInit(Entity* this) { gPlayerState.animation = 0x950; } else { gPlayerState.animation = 0x61c; - if (GetTileIndex(COORD_TO_TILE(this), this->collisionLayer) == 0x4020) { + if (GetMetaTileIndex(COORD_TO_TILE(this), this->collisionLayer) == 0x4020) { this->timer = 1; } } - SetTile(0x4070, COORD_TO_TILE(this), this->collisionLayer); + SetMetaTile(0x4070, COORD_TO_TILE(this), this->collisionLayer); ResetActiveItems(); PlayerInHoleUpdate(this); SoundReq(SFX_81); @@ -2249,7 +2250,7 @@ static void sub_08072B5C(Entity* this) { return; } - SetTile(0x4021, COORD_TO_TILE(this), this->collisionLayer); + SetMetaTile(0x4021, COORD_TO_TILE(this), this->collisionLayer); this->direction = Direction8FromAnimationState(this->animationState); temp = sub_0807A2F8(1); if (!temp) { @@ -2362,7 +2363,7 @@ static void sub_08072D54(Entity* this) { LinearMoveUpdate(this); this->timer--; } else { - uVar2 = GetTileType(sub_0806F730(this), this->collisionLayer); + uVar2 = GetMetaTileType(sub_0806F730(this), this->collisionLayer); switch (this->subtimer) { case 0: if (FindValueForKey(uVar2, sTileTable[gPlayerEntity.animationState >> 1])) { @@ -2622,7 +2623,7 @@ static void sub_080731D8(Entity* this) { static void sub_080732D0(Entity* this) { UpdateAnimationSingleFrame(this); - if (GetVvvAtEntity(this) != 40) { + if (GetVvvAtEntity(this) != VVV_40) { this->direction = DirectionNorth; LinearMoveUpdate(this); } else { @@ -4106,7 +4107,7 @@ void sub_0807529C(Entity* this) { void sub_080752AC(Entity* this, ScriptExecutionContext* ctx) { LinearMoveUpdate(this); if (!ctx->unk_18) { - if (GetVvvAtEntity(this) != 41) { + if (GetVvvAtEntity(this) != VVV_41) { ctx->unk_18 = 1; ctx->unk_19 = 6; } diff --git a/src/playerItem/playerItemBottle.c b/src/playerItem/playerItemBottle.c index ac6337f1..de3d14ee 100644 --- a/src/playerItem/playerItemBottle.c +++ b/src/playerItem/playerItemBottle.c @@ -1,9 +1,10 @@ #include "entity.h" +#include "functions.h" +#include "item.h" +#include "object.h" #include "save.h" #include "sound.h" -#include "functions.h" -#include "object.h" -#include "item.h" +#include "tiles.h" void PlayerItemBottle_UseEmptyBottle(Entity*); void PlayerItemBottle_Action1(Entity*); @@ -272,7 +273,7 @@ void PlayerItemBottle_UseEmptyBottle(Entity* this) { if (this->spriteSettings.flipX != 0) { iVar2 = -iVar2; } - if (GetVvvRelativeToEntity(this, iVar2, (s8)ptr2[1]) == 0x10) { + if (GetVvvRelativeToEntity(this, iVar2, (s8)ptr2[1]) == VVV_16) { this->type2 = ITEM_BOTTLE_WATER; } } diff --git a/src/playerItem/playerItemCellOverwriteSet.c b/src/playerItem/playerItemCellOverwriteSet.c index fe87694e..06223445 100644 --- a/src/playerItem/playerItemCellOverwriteSet.c +++ b/src/playerItem/playerItemCellOverwriteSet.c @@ -3,25 +3,317 @@ #include "entity.h" #include "player.h" #include "room.h" +#include "tiles.h" // vvv for specialMetaTile const u8 gUnk_080B7910[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 241, 0, 0, 83, 242, 243, - 0, 0, 0, 0, 0, 0, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 61, 61, 61, 61, 61, 61, 61, 61, 0, 0, 0, 0, 0, - 0, 0, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 18, 18, 18, 18, 18, 18, 18, 0, 116, 116, 41, 0, - 35, 41, 41, 41, 41, 41, 41, 16, 16, 16, 16, 41, 80, 81, 0, 15, 0, 0, 0, 0, 0, -}; + 0, // SPECIAL_META_TILE_0 + 0, // SPECIAL_META_TILE_1 + 0, // SPECIAL_META_TILE_2 + 0, // SPECIAL_META_TILE_3 + 0, // SPECIAL_META_TILE_4 + 0, // SPECIAL_META_TILE_5 + 0, // SPECIAL_META_TILE_6 + 0, // SPECIAL_META_TILE_7 + 0, // SPECIAL_META_TILE_8 + 0, // SPECIAL_META_TILE_9 + 0, // SPECIAL_META_TILE_10 + 0, // SPECIAL_META_TILE_11 + 0, // SPECIAL_META_TILE_12 + 0, // SPECIAL_META_TILE_13 + 0, // SPECIAL_META_TILE_14 + 0, // SPECIAL_META_TILE_15 + 0, // SPECIAL_META_TILE_16 + 0, // SPECIAL_META_TILE_17 + 0, // SPECIAL_META_TILE_18 + 0, // SPECIAL_META_TILE_19 + VVV_241, // SPECIAL_META_TILE_20 + 0, // SPECIAL_META_TILE_21 + 0, // SPECIAL_META_TILE_22 + VVV_83, // SPECIAL_META_TILE_23 + VVV_242, // SPECIAL_META_TILE_24 + VVV_243, // SPECIAL_META_TILE_25 + 0, // SPECIAL_META_TILE_26 + 0, // SPECIAL_META_TILE_27 + 0, // SPECIAL_META_TILE_28 + 0, // SPECIAL_META_TILE_29 + 0, // SPECIAL_META_TILE_30 + 0, // SPECIAL_META_TILE_31 + VVV_240, // SPECIAL_META_TILE_32 + 0, // SPECIAL_META_TILE_33 + 0, // SPECIAL_META_TILE_34 + 0, // SPECIAL_META_TILE_35 + 0, // SPECIAL_META_TILE_36 + 0, // SPECIAL_META_TILE_37 + 0, // SPECIAL_META_TILE_38 + 0, // SPECIAL_META_TILE_39 + 0, // SPECIAL_META_TILE_40 + 0, // SPECIAL_META_TILE_41 + 0, // SPECIAL_META_TILE_42 + 0, // SPECIAL_META_TILE_43 + 0, // SPECIAL_META_TILE_44 + 0, // SPECIAL_META_TILE_45 + 0, // SPECIAL_META_TILE_46 + 0, // SPECIAL_META_TILE_47 + 0, // SPECIAL_META_TILE_48 + 0, // SPECIAL_META_TILE_49 + 0, // SPECIAL_META_TILE_50 + 0, // SPECIAL_META_TILE_51 + 0, // SPECIAL_META_TILE_52 + 0, // SPECIAL_META_TILE_53 + 0, // SPECIAL_META_TILE_54 + 0, // SPECIAL_META_TILE_55 + 0, // SPECIAL_META_TILE_56 + 0, // SPECIAL_META_TILE_57 + 0, // SPECIAL_META_TILE_58 + 0, // SPECIAL_META_TILE_59 + 0, // SPECIAL_META_TILE_60 + 0, // SPECIAL_META_TILE_61 + 0, // SPECIAL_META_TILE_62 + 0, // SPECIAL_META_TILE_63 + VVV_61, // SPECIAL_META_TILE_64 + VVV_61, // SPECIAL_META_TILE_65 + VVV_61, // SPECIAL_META_TILE_66 + VVV_61, // SPECIAL_META_TILE_67 + VVV_61, // SPECIAL_META_TILE_68 + VVV_61, // SPECIAL_META_TILE_69 + VVV_61, // SPECIAL_META_TILE_70 + VVV_61, // SPECIAL_META_TILE_71 + VVV_61, // SPECIAL_META_TILE_72 + 0, // SPECIAL_META_TILE_73 + 0, // SPECIAL_META_TILE_74 + 0, // SPECIAL_META_TILE_75 + 0, // SPECIAL_META_TILE_76 + 0, // SPECIAL_META_TILE_77 + 0, // SPECIAL_META_TILE_78 + 0, // SPECIAL_META_TILE_79 + 0, // SPECIAL_META_TILE_80 + VVV_58, // SPECIAL_META_TILE_81 + 0, // SPECIAL_META_TILE_82 + 0, // SPECIAL_META_TILE_83 + 0, // SPECIAL_META_TILE_84 + 0, // SPECIAL_META_TILE_85 + 0, // SPECIAL_META_TILE_86 + 0, // SPECIAL_META_TILE_87 + 0, // SPECIAL_META_TILE_88 + 0, // SPECIAL_META_TILE_89 + 0, // SPECIAL_META_TILE_90 + 0, // SPECIAL_META_TILE_91 + 0, // SPECIAL_META_TILE_92 + 0, // SPECIAL_META_TILE_93 + 0, // SPECIAL_META_TILE_94 + 0, // SPECIAL_META_TILE_95 + 0, // SPECIAL_META_TILE_96 + 0, // SPECIAL_META_TILE_97 + 0, // SPECIAL_META_TILE_98 + 0, // SPECIAL_META_TILE_99 + 0, // SPECIAL_META_TILE_100 + 0, // SPECIAL_META_TILE_101 + 0, // SPECIAL_META_TILE_102 + 0, // SPECIAL_META_TILE_103 + 0, // SPECIAL_META_TILE_104 + VVV_40, // SPECIAL_META_TILE_105 + 0, // SPECIAL_META_TILE_106 + 0, // SPECIAL_META_TILE_107 + 0, // SPECIAL_META_TILE_108 + 0, // SPECIAL_META_TILE_109 + 0, // SPECIAL_META_TILE_110 + 0, // SPECIAL_META_TILE_111 + 0, // SPECIAL_META_TILE_112 + 0, // SPECIAL_META_TILE_113 + 0, // SPECIAL_META_TILE_114 + 0, // SPECIAL_META_TILE_115 + 0, // SPECIAL_META_TILE_116 + VVV_18, // SPECIAL_META_TILE_117 + VVV_18, // SPECIAL_META_TILE_118 + VVV_18, // SPECIAL_META_TILE_119 + VVV_18, // SPECIAL_META_TILE_120 + VVV_18, // SPECIAL_META_TILE_121 + VVV_18, // SPECIAL_META_TILE_122 + VVV_18, // SPECIAL_META_TILE_123 + VVV_18, // SPECIAL_META_TILE_124 + 0, // SPECIAL_META_TILE_125 + VVV_116, // SPECIAL_META_TILE_126 + VVV_116, // SPECIAL_META_TILE_127 + VVV_41, // SPECIAL_META_TILE_128 + 0, // SPECIAL_META_TILE_129 + VVV_35, // SPECIAL_META_TILE_130 + VVV_41, // SPECIAL_META_TILE_131 + VVV_41, // SPECIAL_META_TILE_132 + VVV_41, // SPECIAL_META_TILE_133 + VVV_41, // SPECIAL_META_TILE_134 + VVV_41, // SPECIAL_META_TILE_135 + VVV_41, // SPECIAL_META_TILE_136 + VVV_16, // SPECIAL_META_TILE_137 + VVV_16, // SPECIAL_META_TILE_138 + VVV_16, // SPECIAL_META_TILE_139 + VVV_16, // SPECIAL_META_TILE_140 + VVV_41, // SPECIAL_META_TILE_141 + VVV_80, // SPECIAL_META_TILE_142 + VVV_81, // SPECIAL_META_TILE_143 + 0, // SPECIAL_META_TILE_144 + VVV_15, // SPECIAL_META_TILE_145 + 0, // SPECIAL_META_TILE_146 + 0, // SPECIAL_META_TILE_147 + 0, // SPECIAL_META_TILE_148 + 0, // SPECIAL_META_TILE_149 + 0, // SPECIAL_META_TILE_150 + }; +// collisionData for specialMetaTile const u8 gUnk_080B79A7[] = { - 29, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 40, 40, - 40, 15, 0, 0, 0, 0, 32, 0, 15, 3, 5, 10, 12, 1, 2, 4, 8, 15, 5, 10, 69, 68, 0, 0, 15, 0, - 0, 0, 15, 0, 0, 0, 0, 15, 0, 0, 15, 0, 1, 3, 2, 5, 15, 10, 4, 12, 8, 71, 15, 0, 0, 0, - 0, 0, 15, 15, 3, 5, 0, 13, 12, 11, 10, 0, 15, 15, 15, 15, 15, 15, 15, 15, 80, 7, 11, 13, 14, 15, - 15, 39, 15, 15, 16, 17, 18, 19, 0, 0, 15, 15, 0, 1, 2, 3, 4, 5, 8, 10, 12, 15, 5, 12, 0, 0, - 95, 39, 103, 104, 105, 106, 107, 49, 50, 58, 60, 35, 43, 43, 5, 34, 1, 2, 4, 8, 12, -}; + 29, // SPECIAL_META_TILE_0 + 0, // SPECIAL_META_TILE_1 + 0, // SPECIAL_META_TILE_2 + 0, // SPECIAL_META_TILE_3 + 0, // SPECIAL_META_TILE_4 + 0, // SPECIAL_META_TILE_5 + 15, // SPECIAL_META_TILE_6 + 0, // SPECIAL_META_TILE_7 + 0, // SPECIAL_META_TILE_8 + 0, // SPECIAL_META_TILE_9 + 0, // SPECIAL_META_TILE_10 + 15, // SPECIAL_META_TILE_11 + 0, // SPECIAL_META_TILE_12 + 0, // SPECIAL_META_TILE_13 + 0, // SPECIAL_META_TILE_14 + 0, // SPECIAL_META_TILE_15 + 0, // SPECIAL_META_TILE_16 + 0, // SPECIAL_META_TILE_17 + 0, // SPECIAL_META_TILE_18 + 0, // SPECIAL_META_TILE_19 + 0, // SPECIAL_META_TILE_20 + 0, // SPECIAL_META_TILE_21 + 0, // SPECIAL_META_TILE_22 + 23, // SPECIAL_META_TILE_23 + 40, // SPECIAL_META_TILE_24 + 40, // SPECIAL_META_TILE_25 + 40, // SPECIAL_META_TILE_26 + 15, // SPECIAL_META_TILE_27 + 0, // SPECIAL_META_TILE_28 + 0, // SPECIAL_META_TILE_29 + 0, // SPECIAL_META_TILE_30 + 0, // SPECIAL_META_TILE_31 + 32, // SPECIAL_META_TILE_32 + 0, // SPECIAL_META_TILE_33 + 15, // SPECIAL_META_TILE_34 + 3, // SPECIAL_META_TILE_35 + 5, // SPECIAL_META_TILE_36 + 10, // SPECIAL_META_TILE_37 + 12, // SPECIAL_META_TILE_38 + 1, // SPECIAL_META_TILE_39 + 2, // SPECIAL_META_TILE_40 + 4, // SPECIAL_META_TILE_41 + 8, // SPECIAL_META_TILE_42 + 15, // SPECIAL_META_TILE_43 + 5, // SPECIAL_META_TILE_44 + 10, // SPECIAL_META_TILE_45 + 69, // SPECIAL_META_TILE_46 + 68, // SPECIAL_META_TILE_47 + 0, // SPECIAL_META_TILE_48 + 0, // SPECIAL_META_TILE_49 + 15, // SPECIAL_META_TILE_50 + 0, // SPECIAL_META_TILE_51 + 0, // SPECIAL_META_TILE_52 + 0, // SPECIAL_META_TILE_53 + 15, // SPECIAL_META_TILE_54 + 0, // SPECIAL_META_TILE_55 + 0, // SPECIAL_META_TILE_56 + 0, // SPECIAL_META_TILE_57 + 0, // SPECIAL_META_TILE_58 + 15, // SPECIAL_META_TILE_59 + 0, // SPECIAL_META_TILE_60 + 0, // SPECIAL_META_TILE_61 + 15, // SPECIAL_META_TILE_62 + 0, // SPECIAL_META_TILE_63 + 1, // SPECIAL_META_TILE_64 + 3, // SPECIAL_META_TILE_65 + 2, // SPECIAL_META_TILE_66 + 5, // SPECIAL_META_TILE_67 + 15, // SPECIAL_META_TILE_68 + 10, // SPECIAL_META_TILE_69 + 4, // SPECIAL_META_TILE_70 + 12, // SPECIAL_META_TILE_71 + 8, // SPECIAL_META_TILE_72 + 71, // SPECIAL_META_TILE_73 + 15, // SPECIAL_META_TILE_74 + 0, // SPECIAL_META_TILE_75 + 0, // SPECIAL_META_TILE_76 + 0, // SPECIAL_META_TILE_77 + 0, // SPECIAL_META_TILE_78 + 0, // SPECIAL_META_TILE_79 + 15, // SPECIAL_META_TILE_80 + 15, // SPECIAL_META_TILE_81 + 3, // SPECIAL_META_TILE_82 + 5, // SPECIAL_META_TILE_83 + 0, // SPECIAL_META_TILE_84 + 13, // SPECIAL_META_TILE_85 + 12, // SPECIAL_META_TILE_86 + 11, // SPECIAL_META_TILE_87 + 10, // SPECIAL_META_TILE_88 + 0, // SPECIAL_META_TILE_89 + 15, // SPECIAL_META_TILE_90 + 15, // SPECIAL_META_TILE_91 + 15, // SPECIAL_META_TILE_92 + 15, // SPECIAL_META_TILE_93 + 15, // SPECIAL_META_TILE_94 + 15, // SPECIAL_META_TILE_95 + 15, // SPECIAL_META_TILE_96 + 15, // SPECIAL_META_TILE_97 + 80, // SPECIAL_META_TILE_98 + 7, // SPECIAL_META_TILE_99 + 11, // SPECIAL_META_TILE_100 + 13, // SPECIAL_META_TILE_101 + 14, // SPECIAL_META_TILE_102 + 15, // SPECIAL_META_TILE_103 + 15, // SPECIAL_META_TILE_104 + 39, // SPECIAL_META_TILE_105 + 15, // SPECIAL_META_TILE_106 + 15, // SPECIAL_META_TILE_107 + 16, // SPECIAL_META_TILE_108 + 17, // SPECIAL_META_TILE_109 + 18, // SPECIAL_META_TILE_110 + 19, // SPECIAL_META_TILE_111 + 0, // SPECIAL_META_TILE_112 + 0, // SPECIAL_META_TILE_113 + 15, // SPECIAL_META_TILE_114 + 15, // SPECIAL_META_TILE_115 + 0, // SPECIAL_META_TILE_116 + 1, // SPECIAL_META_TILE_117 + 2, // SPECIAL_META_TILE_118 + 3, // SPECIAL_META_TILE_119 + 4, // SPECIAL_META_TILE_120 + 5, // SPECIAL_META_TILE_121 + 8, // SPECIAL_META_TILE_122 + 10, // SPECIAL_META_TILE_123 + 12, // SPECIAL_META_TILE_124 + 15, // SPECIAL_META_TILE_125 + 5, // SPECIAL_META_TILE_126 + 12, // SPECIAL_META_TILE_127 + 0, // SPECIAL_META_TILE_128 + 0, // SPECIAL_META_TILE_129 + 95, // SPECIAL_META_TILE_130 + 39, // SPECIAL_META_TILE_131 + 103, // SPECIAL_META_TILE_132 + 104, // SPECIAL_META_TILE_133 + 105, // SPECIAL_META_TILE_134 + 106, // SPECIAL_META_TILE_135 + 107, // SPECIAL_META_TILE_136 + 49, // SPECIAL_META_TILE_137 + 50, // SPECIAL_META_TILE_138 + 58, // SPECIAL_META_TILE_139 + 60, // SPECIAL_META_TILE_140 + 35, // SPECIAL_META_TILE_141 + 43, // SPECIAL_META_TILE_142 + 43, // SPECIAL_META_TILE_143 + 5, // SPECIAL_META_TILE_144 + 34, // SPECIAL_META_TILE_145 + 1, // SPECIAL_META_TILE_146 + 2, // SPECIAL_META_TILE_147 + 4, // SPECIAL_META_TILE_148 + 8, // SPECIAL_META_TILE_149 + 12, // SPECIAL_META_TILE_150 + }; const u16 gUnk_080B7A3E[] = { 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, @@ -39,7 +331,7 @@ void PlayerItemCellOverwriteSet(Entity* this) { if (this->action == 0) { this->field_0x6c.HWORD = - GetTileType(TILE(player->x.HALF.HI + gUnk_080B7B6C[player->animationState & 0xe], + GetMetaTileType(TILE(player->x.HALF.HI + gUnk_080B7B6C[player->animationState & 0xe], player->y.HALF.HI + gUnk_080B7B6C[(player->animationState & 0xe) + 1]), this->collisionLayer); this->action++; @@ -49,7 +341,7 @@ void PlayerItemCellOverwriteSet(Entity* this) { if ((gInput.heldKeys & A_BUTTON) != 0) { if ((R_BUTTON & gInput.newKeys) != 0) { this->field_0x6c.HWORD = - GetTileType(TILE(player->x.HALF.HI + gUnk_080B7B6C[player->animationState & 0xe], + GetMetaTileType(TILE(player->x.HALF.HI + gUnk_080B7B6C[player->animationState & 0xe], player->y.HALF.HI + gUnk_080B7B6C[(player->animationState & 0xe) + 1]), this->collisionLayer); } diff --git a/src/playerItem/playerItemGustBig.c b/src/playerItem/playerItemGustBig.c index b417720b..4c6c208d 100644 --- a/src/playerItem/playerItemGustBig.c +++ b/src/playerItem/playerItemGustBig.c @@ -3,6 +3,7 @@ #include "functions.h" #include "player.h" #include "sound.h" +#include "tiles.h" extern void sub_08078CD0(Entity*); extern void sub_08018FA0(Entity*); @@ -163,7 +164,7 @@ void sub_08018E68(Entity* this) { if (FindValueForKey(sub_080B1A0C(this, x, y), gUnk_080B3DF4) != 0) { return; } - if (GetVvvRelativeToEntity(this, x, y) == 0x74) { + if (GetVvvRelativeToEntity(this, x, y) == VVV_116) { return; } if (sub_080040D8(this, (u8*)gUnk_08003E44, this->x.HALF.HI + x, this->y.HALF.HI + y) == 0) { diff --git a/src/playerItem/playerItemHeldObject.c b/src/playerItem/playerItemHeldObject.c index bb2340f8..6a2e4081 100644 --- a/src/playerItem/playerItemHeldObject.c +++ b/src/playerItem/playerItemHeldObject.c @@ -1,17 +1,18 @@ #define NENT_DEPRECATED -#include "entity.h" -#include "functions.h" -#include "player.h" -#include "new_player.h" #include "asm.h" #include "effects.h" +#include "entity.h" +#include "functions.h" +#include "functions.h" #include "functions.h" -#include "player.h" #include "new_player.h" +#include "new_player.h" +#include "new_player.h" +#include "player.h" +#include "player.h" +#include "player.h" #include "sound.h" -#include "functions.h" -#include "new_player.h" -#include "player.h" +#include "tiles.h" typedef struct { Entity base; @@ -123,7 +124,7 @@ void sub_080AD040(PlayerItemHeldObjectEntity* this) { super->knockbackDuration = 0; } if (GetVvvRelativeToEntity(super, gUnk_081320C4[super->direction >> 2], - gUnk_081320C4[(super->direction >> 2) + 1]) == 0x74) { + gUnk_081320C4[(super->direction >> 2) + 1]) == VVV_116) { LinearMoveUpdate(super); } else { tile = GetCollisionDataAtEntity(super); @@ -138,11 +139,11 @@ void sub_080AD040(PlayerItemHeldObjectEntity* this) { (child->base).z = super->z; tile = GetVvvAtEntity(super); switch (tile) { - case 0xd: - case 0x10: - case 0x11: - case 0x13: - case 0x5a: + case VVV_13: + case VVV_16: + case VVV_17: + case VVV_19: + case VVV_90: if (child == this) { switch (tile) { diff --git a/src/playerItem/playerItemPacciCaneProjectile.c b/src/playerItem/playerItemPacciCaneProjectile.c index 255e49c0..d3714964 100644 --- a/src/playerItem/playerItemPacciCaneProjectile.c +++ b/src/playerItem/playerItemPacciCaneProjectile.c @@ -3,6 +3,7 @@ #include "functions.h" #include "sound.h" #include "object.h" +#include "tiles.h" static const Hitbox gUnk_0811B9D0; @@ -109,15 +110,15 @@ void sub_080701F8(Entity* this) { } if (sub_080B1BA4(COORD_TO_TILE(this), gPlayerEntity.collisionLayer, 0x80) == 0) { if (sub_080040D8(this, &gUnk_08003E44, this->x.HALF.HI, this->y.HALF.HI) == 0) { - if (GetVvvAtEntity(this) == 0x19) { + if (GetVvvAtEntity(this) == VVV_25) { this->action = 4; COLLISION_OFF(this); this->x.HALF.HI = (this->x.HALF.HI & 0xfff0) | 8; this->y.HALF.HI = (this->y.HALF.HI & 0xfff0) | 8; this->spritePriority.b0 = 7; - this->field_0x7c.WORD = GetTileIndex(COORD_TO_TILE(this), this->collisionLayer); + this->field_0x7c.WORD = GetMetaTileIndex(COORD_TO_TILE(this), this->collisionLayer); InitializeAnimation(this, 0x14); - SetTile(0x4020, COORD_TO_TILE(this), this->collisionLayer); + SetMetaTile(0x4020, COORD_TO_TILE(this), this->collisionLayer); return; } } else { @@ -147,7 +148,7 @@ void sub_08070398(Entity* this) { void sub_080703BC(Entity* this) { GetNextFrame(this); - switch (GetTileIndex(COORD_TO_TILE(this), this->collisionLayer)) { + switch (GetMetaTileIndex(COORD_TO_TILE(this), this->collisionLayer)) { default: this->field_0x7c.WORD = 0; sub_08070458(this); @@ -179,7 +180,7 @@ void sub_08070458(Entity* this) { COLLISION_OFF(this); this->speed = 0; if (this->field_0x7c.WORD != 0) { - SetTile(this->field_0x7c.WORD, TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer); + SetMetaTile(this->field_0x7c.WORD, TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer); } InitializeAnimation(this, 0x13); sub_08017744(this); diff --git a/src/playerItem/playerItemSword.c b/src/playerItem/playerItemSword.c index 21e836cc..2a8f4ef4 100644 --- a/src/playerItem/playerItemSword.c +++ b/src/playerItem/playerItemSword.c @@ -1,10 +1,11 @@ #define NENT_DEPRECATED -#include "entity.h" -#include "functions.h" -#include "sound.h" #include "asm.h" #include "effects.h" +#include "entity.h" +#include "functions.h" #include "object.h" +#include "sound.h" +#include "tiles.h" typedef struct { Entity base; @@ -368,7 +369,7 @@ void sub_080A7A84(PlayerItemSwordEntity* this) { (gPlayerState.sword_state != 0)) && ((gPlayerState.sword_state & 0xc0) == 0)) { entity = super; - if (GetVvvRelativeToEntity(entity, xOffset, yOffset) == 0x2e) { + if (GetVvvRelativeToEntity(entity, xOffset, yOffset) == VVV_46) { SoundReqClipped(&gPlayerEntity, SFX_ITEM_GLOVES_KNOCKBACK); } else { SoundReqClipped(&gPlayerEntity, SFX_METAL_CLINK); diff --git a/src/playerUtils.c b/src/playerUtils.c index 303cdf1f..0bc7b6ca 100644 --- a/src/playerUtils.c +++ b/src/playerUtils.c @@ -20,6 +20,8 @@ #include "save.h" #include "screen.h" #include "screenTransitions.h" +#include "tilemap.h" +#include "tiles.h" static void sub_08077E54(ItemBehavior* beh); @@ -66,8 +68,6 @@ extern void DeleteLoadedTileEntity(u32, u32); extern const u8 gUnk_080B3E80[]; // collisionData for tileType? extern u8 gUpdateVisibleTiles; -extern u16 gMapDataTopSpecial[]; -extern u16 gMapDataBottomSpecial[]; bool32 sub_0807BF88(u32, u32, RoomResInfo*); @@ -107,8 +107,8 @@ extern const u16* sub_0806FC50(u32 param_1, u32 param_2); bool32 sub_08079F48(u32 param_1, u32 param_2); -extern void FillVvvForLayer(LayerStruct*); -extern void RenderTilemapToScreenblock(u16*, LayerStruct*); +extern void FillVvvForLayer(MapLayer* mapLayer); +extern void RenderMapLayerToTileMap(u16* tileMap, MapLayer* mapLayer); extern u16 gUnk_080B77C0[]; @@ -821,7 +821,7 @@ const KeyValuePair gUnk_0811C254[] = { { 43, 1 }, { 38, 1 } }; const u16 gUnk_0811C254End = 0; const KeyValuePair gUnk_0811C25E[] = { { 44, 1 }, { 39, 1 } }; const u16 gUnk_0811C25EEnd = 0; -const KeyValuePair gUnk_0811C268[] = { { 16, 1 }, { 90, 1 }, { 17, 1 }, { 19, 1 } }; +const KeyValuePair gUnk_0811C268[] = { { VVV_16, 1 }, { VVV_90, 1 }, { VVV_17, 1 }, { VVV_19, 1 } }; const u16 gUnk_0811C268EEnd = 0; void sub_0807B114(PlayerEntity*); @@ -866,7 +866,7 @@ void sub_08077F84(void) { Entity* obj; if ((gPlayerEntity.collisionLayer & 2) == 0) { - u32 tile = GetTileTypeByPos(gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI - 12, 2); + u32 tile = GetMetaTileTypeByPos(gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI - 12, 2); if (tile == 0x343 || tile == 0x344 || tile == 0x345 || tile == 0x346) { sub_0807AA80(&gPlayerEntity); gPlayerState.jump_status |= 8; @@ -2368,7 +2368,7 @@ void UpdateFloorType(void) { SurfaceType GetSurfaceCalcType(Entity* param_1, s32 x, s32 y) { u32 position = TILE(param_1->x.HALF.HI + (u32)x, param_1->y.HALF.HI + y); - u32 tileType = GetTileTypeByPos(param_1->x.HALF.HI + x, param_1->y.HALF.HI + y, gPlayerEntity.collisionLayer); + u32 tileType = GetMetaTileTypeByPos(param_1->x.HALF.HI + x, param_1->y.HALF.HI + y, gPlayerEntity.collisionLayer); if (tileType != gPlayerState.tileType) { gPlayerState.surfaceTimer = 0; } @@ -2640,7 +2640,7 @@ void sub_0807AAF8(Entity* this, u32 tilePos) { void sub_0807AB44(Entity* this, s32 xOffset, s32 yOffset) { Entity* object; const u16* ptr = - sub_0806FC50(GetTileType(COORD_TO_TILE_OFFSET(this, -xOffset, -yOffset), this->collisionLayer), 0xb); + sub_0806FC50(GetMetaTileType(COORD_TO_TILE_OFFSET(this, -xOffset, -yOffset), this->collisionLayer), 0xb); if (ptr != NULL) { if (ptr[3] == 0x76) { object = CreateObject(FLAME, 1, 0); @@ -2654,7 +2654,7 @@ void sub_0807AB44(Entity* this, s32 xOffset, s32 yOffset) { if (object != NULL) { PositionRelative(this, object, xOffset << 0x10, yOffset << 0x10); object->child = (Entity*)ptr; - SetTile(0x404f, COORD_TO_TILE(object), object->collisionLayer); + SetMetaTile(0x404f, COORD_TO_TILE(object), object->collisionLayer); } } } @@ -2970,26 +2970,26 @@ void sub_0807B2F8(PlayerEntity* this) { } // tileType < 0x800 : set the MetaTileType -// tileType >= 0x4000 : call SetTile directly +// tileType >= 0x4000 : call SetMetaTile directly // else : restore the previous tile entity -void SetTileType(u32 tileType, u32 position, u32 layer) { +void SetMetaTileType(u32 tileType, u32 position, u32 layer) { u8 collisionData; u16 metatile; - LayerStruct* data; + MapLayer* mapLayer; u16* src; u16* dest; if (tileType < 0x800) { DeleteLoadedTileEntity(position, layer); - data = GetLayerByIndex(layer); - metatile = data->unkData2[tileType]; - data->mapData[position] = metatile; + mapLayer = GetLayerByIndex(layer); + metatile = mapLayer->unkData2[tileType]; + mapLayer->mapData[position] = metatile; collisionData = gUnk_080B3E80[tileType]; - data->collisionData[position] = collisionData; + mapLayer->collisionData[position] = collisionData; if ((gRoomControls.scroll_flags & 2) != 0) { gMapBottom.collisionData[position] = collisionData; } - data->vvv[position] = gUnk_080B37A0[tileType]; + mapLayer->vvv[position] = gUnk_080B37A0[tileType]; if ((gRoomControls.scroll_flags & 1) == 0) { u32 offset = (position & 0x3f) * 2 + (position & 0xfc0) * 4; if (layer != 2) { @@ -2997,7 +2997,7 @@ void SetTileType(u32 tileType, u32 position, u32 layer) { } else { dest = gMapDataTopSpecial + offset; } - src = data->metatiles + metatile * 4; + src = mapLayer->metatiles + metatile * 4; // Copy over the tilemap entries (tile_attrs) to the special map data but in a different order. dest[0] = src[0]; dest[1] = src[1]; @@ -3008,24 +3008,24 @@ void SetTileType(u32 tileType, u32 position, u32 layer) { } } } else if (tileType >= 0x4000) { // The tile type actually directly is a tileIndex - SetTile(tileType, position, layer); + SetMetaTile(tileType, position, layer); } else { RestorePrevTileEntity(position, layer); } } bool32 sub_0807B434(u32 metaTilePos, u32 layer) { - switch (GetTileType(metaTilePos, layer)) { + switch (GetMetaTileType(metaTilePos, layer)) { case 0x36: case 0x37: return FALSE; default: - return GetVvvAtMetaTilePos(metaTilePos, layer) != 0xd; + return GetVvvAtMetaTilePos(metaTilePos, layer) != VVV_13; } } bool32 sub_0807B464(u32 metaTilePos, u32 layer) { - return GetVvvAtMetaTilePos(metaTilePos, layer) == 0x56; + return GetVvvAtMetaTilePos(metaTilePos, layer) == VVV_86; } void sub_0807B480(u32 tilePos, u32 param_2) { @@ -3042,11 +3042,11 @@ void sub_0807B480(u32 tilePos, u32 param_2) { tmp1 |= sub_0807B464(tilePos - 1, 2) << 3; tmp1 |= sub_0807B464(tilePos + 0x41, 1) << 1; tmp1 |= sub_0807B464(tilePos + 0x3f, 1) << 3; - if (GetTileType(tilePos + 0x40, 2) != 0) { + if (GetMetaTileType(tilePos + 0x40, 2) != 0) { tmp1 |= sub_0807B464(tilePos + 0x80, 1) << 2; } tmp2 = gUnk_0811C2CC[tmp1]; - tileType = GetTileType(tilePos, 2); + tileType = GetMetaTileType(tilePos, 2); ptr = gUnk_0811C2EC; tmp3 = 0; for (; *ptr != 0; ptr = ptr + 3) { @@ -3062,7 +3062,7 @@ void sub_0807B480(u32 tilePos, u32 param_2) { break; } } - SetTileType(tmp2, tilePos, 2); + SetMetaTileType(tmp2, tilePos, 2); } } @@ -3073,7 +3073,7 @@ void sub_0807B55C(u32 param_1, u32 param_2, u16* param_3) { tmp |= sub_0807B464(param_1 + 1, param_2) << 1; tmp |= sub_0807B464(param_1 + 0x40, param_2) << 2; tmp |= sub_0807B464(param_1 - 1, param_2) << 3; - SetTileType(param_3[tmp], param_1, param_2); + SetMetaTileType(param_3[tmp], param_1, param_2); } } @@ -3087,10 +3087,10 @@ u32 sub_0807B600(u32 param_1) { u32 tile; tile = param_1 - 0x40; - if (GetVvvAtMetaTilePos(param_1, 1) != 0x56) { + if (GetVvvAtMetaTilePos(param_1, 1) != VVV_86) { return FALSE; } else { - tileType = GetTileType(param_1, 1); + tileType = GetMetaTileType(param_1, 1); if (tileType == 0x26a) { sub_0807B820(param_1); } else if (tileType == 0x267) { @@ -3104,21 +3104,21 @@ u32 sub_0807B600(u32 param_1) { } else if (tileType == 0x287) { sub_0807B930(param_1 + 0x40); } else { - if (GetTileType(param_1, 2) != 0) { - SetTileType(0x2f2, param_1, 1); + if (GetMetaTileType(param_1, 2) != 0) { + SetMetaTileType(0x2f2, param_1, 1); if (GetCollisionDataAtMetaTilePos(tile, 1) == 3) { - SetTileType(0x2f4, tile, 1); + SetMetaTileType(0x2f4, tile, 1); } if (GetCollisionDataAtMetaTilePos(param_1 + 0x40, 1) == 3) { - SetTileType(0x2f4, param_1, 1); + SetMetaTileType(0x2f4, param_1, 1); } } else { - SetTileType(0x2f4, param_1, 1); + SetMetaTileType(0x2f4, param_1, 1); } if (sub_0807B464(tile, 2)) { - SetTileType(0, tile, 2); - if (GetTileType(tile, 1) == 0x2f2) { - SetTileType(0x2f4, tile, 1); + SetMetaTileType(0, tile, 2); + if (GetMetaTileType(tile, 1) == 0x2f2) { + SetMetaTileType(0x2f4, tile, 1); } sub_0807B55C(param_1 + 1, 1, (u16*)&gUnk_0811C2AC); sub_0807B55C(param_1 - 1, 1, (u16*)&gUnk_0811C2AC); @@ -3135,76 +3135,76 @@ u32 sub_0807B600(u32 param_1) { void sub_0807B778(u32 position, u32 layer) { u32 tmp; - if (GetVvvAtMetaTilePos(position, layer) == 0xd) { + if (GetVvvAtMetaTilePos(position, layer) == VVV_13) { tmp = sub_0807B434(position - 0x40, layer); tmp |= sub_0807B434(position + 1, layer) << 1; tmp |= sub_0807B434(position + 0x40, layer) << 2; tmp |= sub_0807B434(position - 1, layer) << 3; - SetTileType(gUnk_0811C466[tmp], position, layer); + SetMetaTileType(gUnk_0811C466[tmp], position, layer); } } -void sub_0807B7D8(u32 param_1, u32 param_2, u32 param_3) { +void sub_0807B7D8(u32 param_1, u32 metaTilePos, u32 param_3) { if (param_1 == 53) { - CloneTile(53, param_2, param_3); - sub_0807B778(param_2, param_3); - sub_0807B778(param_2 + 1, param_3); - sub_0807B778(param_2 - 1, param_3); - sub_0807B778(param_2 + 64, param_3); - sub_0807B778(param_2 - 64, param_3); + CloneTile(53, metaTilePos, param_3); + sub_0807B778(metaTilePos, param_3); + sub_0807B778(metaTilePos + 1, param_3); + sub_0807B778(metaTilePos - 1, param_3); + sub_0807B778(metaTilePos + 64, param_3); + sub_0807B778(metaTilePos - 64, param_3); } else { - SetTileType(param_1, param_2, param_3); + SetMetaTileType(param_1, metaTilePos, param_3); } } void sub_0807B820(u32 position) { - SetTileType(0x26c, position + TILE_POS(-1, -1), 1); - SetTileType(0x273, position + TILE_POS(-1, -1), 2); - SetTileType(0x26d, position + TILE_POS(0, -1), 1); - SetTileType(0x274, position + TILE_POS(0, -1), 2); - SetTileType(0x26e, position + TILE_POS(1, -1), 1); - SetTileType(0x275, position + TILE_POS(1, -1), 2); - SetTileType(0x26f, position + TILE_POS(-1, 0), 1); - SetTileType(0x270, position, 1); - SetTileType(0x272, position + TILE_POS(1, 0), 1); + SetMetaTileType(0x26c, position + TILE_POS(-1, -1), 1); + SetMetaTileType(0x273, position + TILE_POS(-1, -1), 2); + SetMetaTileType(0x26d, position + TILE_POS(0, -1), 1); + SetMetaTileType(0x274, position + TILE_POS(0, -1), 2); + SetMetaTileType(0x26e, position + TILE_POS(1, -1), 1); + SetMetaTileType(0x275, position + TILE_POS(1, -1), 2); + SetMetaTileType(0x26f, position + TILE_POS(-1, 0), 1); + SetMetaTileType(0x270, position, 1); + SetMetaTileType(0x272, position + TILE_POS(1, 0), 1); } void sub_0807B8A8(u32 position) { - SetTileType(0x27c, position + TILE_POS(-1, -1), 1); - SetTileType(0x283, position + TILE_POS(-1, -1), 2); - SetTileType(0x27d, position + TILE_POS(0, -1), 1); - SetTileType(0x284, position + TILE_POS(0, -1), 2); - SetTileType(0x27e, position + TILE_POS(1, -1), 1); - SetTileType(0x285, position + TILE_POS(1, -1), 2); - SetTileType(0x27f, position + TILE_POS(-1, 0), 1); - SetTileType(0x280, position, 1); - SetTileType(0x282, position + TILE_POS(1, 0), 1); + SetMetaTileType(0x27c, position + TILE_POS(-1, -1), 1); + SetMetaTileType(0x283, position + TILE_POS(-1, -1), 2); + SetMetaTileType(0x27d, position + TILE_POS(0, -1), 1); + SetMetaTileType(0x284, position + TILE_POS(0, -1), 2); + SetMetaTileType(0x27e, position + TILE_POS(1, -1), 1); + SetMetaTileType(0x285, position + TILE_POS(1, -1), 2); + SetMetaTileType(0x27f, position + TILE_POS(-1, 0), 1); + SetMetaTileType(0x280, position, 1); + SetMetaTileType(0x282, position + TILE_POS(1, 0), 1); } void sub_0807B930(u32 position) { - SetTileType(0x28c, position + TILE_POS(-1, -1), 1); - SetTileType(0x293, position + TILE_POS(-1, -1), 2); - SetTileType(0x28d, position + TILE_POS(0, -1), 1); - SetTileType(0x294, position + TILE_POS(0, -1), 2); - SetTileType(0x28e, position + TILE_POS(1, -1), 1); - SetTileType(0x295, position + TILE_POS(1, -1), 2); - SetTileType(0x28f, position + TILE_POS(-1, 0), 1); - SetTileType(0x290, position, 1); - SetTileType(0x292, position + TILE_POS(1, 0), 1); + SetMetaTileType(0x28c, position + TILE_POS(-1, -1), 1); + SetMetaTileType(0x293, position + TILE_POS(-1, -1), 2); + SetMetaTileType(0x28d, position + TILE_POS(0, -1), 1); + SetMetaTileType(0x294, position + TILE_POS(0, -1), 2); + SetMetaTileType(0x28e, position + TILE_POS(1, -1), 1); + SetMetaTileType(0x295, position + TILE_POS(1, -1), 2); + SetMetaTileType(0x28f, position + TILE_POS(-1, 0), 1); + SetMetaTileType(0x290, position, 1); + SetMetaTileType(0x292, position + TILE_POS(1, 0), 1); } void SetMetaTileByIndex(u32 tileIndex, u32 position, u32 layer) { - LayerStruct* data; + MapLayer* mapLayer; u16* src; u16* dest; u16 tileType; DeleteLoadedTileEntity(position, layer); - data = GetLayerByIndex(layer); - data->mapData[position] = tileIndex; - tileType = data->metatileTypes[tileIndex]; - data->collisionData[position] = gUnk_080B3E80[tileType]; - data->vvv[position] = gUnk_080B37A0[tileType]; + mapLayer = GetLayerByIndex(layer); + mapLayer->mapData[position] = tileIndex; + tileType = mapLayer->metatileTypes[tileIndex]; + mapLayer->collisionData[position] = gUnk_080B3E80[tileType]; + mapLayer->vvv[position] = gUnk_080B37A0[tileType]; if ((gRoomControls.scroll_flags & 1) == 0) { u32 offset = (position & 0x3f) * 2 + (position & 0xfc0) * 4; if (layer != 2) { @@ -3212,7 +3212,7 @@ void SetMetaTileByIndex(u32 tileIndex, u32 position, u32 layer) { } else { dest = gMapDataTopSpecial + offset; } - src = data->metatiles + tileIndex * 4; + src = mapLayer->metatiles + tileIndex * 4; *dest = *src; dest[1] = src[1]; dest[0x80] = src[2]; @@ -3226,16 +3226,16 @@ void SetMetaTileByIndex(u32 tileIndex, u32 position, u32 layer) { void RestorePrevTileEntity(u32 position, u32 layer) { u32 tileIndex; u32 tileType; - LayerStruct* data; + MapLayer* mapLayer; u16* dest; u16* src; DeleteLoadedTileEntity(position, layer); - data = GetLayerByIndex(layer); - data->mapData[position] = tileIndex = data->mapDataClone[position]; - tileType = data->metatileTypes[tileIndex]; - data->collisionData[position] = gUnk_080B3E80[tileType]; - data->vvv[position] = gUnk_080B37A0[tileType]; + mapLayer = GetLayerByIndex(layer); + mapLayer->mapData[position] = tileIndex = mapLayer->mapDataClone[position]; + tileType = mapLayer->metatileTypes[tileIndex]; + mapLayer->collisionData[position] = gUnk_080B3E80[tileType]; + mapLayer->vvv[position] = gUnk_080B37A0[tileType]; if ((gRoomControls.scroll_flags & 1) == 0) { u32 offset = (position & 0x3f) * 2 + (position & 0xfc0) * 4; if (layer != 2) { @@ -3243,7 +3243,7 @@ void RestorePrevTileEntity(u32 position, u32 layer) { } else { dest = gMapDataTopSpecial + offset; } - src = &data->metatiles[tileIndex * 4]; + src = &mapLayer->metatiles[tileIndex * 4]; dest[0] = src[0]; dest[1] = src[1]; dest[0x80] = src[2]; @@ -3256,7 +3256,7 @@ void RestorePrevTileEntity(u32 position, u32 layer) { void sub_0807BB68(const s16* param_1, u32 basePosition, u32 layer) { while (param_1[0] != -1) { - SetTileType((u16)param_1[0], basePosition + param_1[1], layer); + SetMetaTileType((u16)param_1[0], basePosition + param_1[1], layer); param_1 += 2; } } @@ -3266,7 +3266,7 @@ void sub_0807BB98(s32 basePosition, u32 layer, u32 width, u32 height) { u32 x; for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { - SetTile(0x4072, basePosition + x, layer); + SetMetaTile(0x4072, basePosition + x, layer); } basePosition += 0x40; } @@ -3556,8 +3556,8 @@ void LoadRoomGfx(void) { FillVvvForLayer(&gMapTop); if (!clearBottomMap) { // Render the complete bottom and top metatilemaps into the tilemaps. - RenderTilemapToScreenblock((u16*)&gMapDataBottomSpecial, &gMapBottom); - RenderTilemapToScreenblock((u16*)&gMapDataTopSpecial, &gMapTop); + RenderMapLayerToTileMap(gMapDataBottomSpecial, &gMapBottom); + RenderMapLayerToTileMap(gMapDataTopSpecial, &gMapTop); } else { // Copy first half to second half. // Then copy the room back to the first half? @@ -3625,10 +3625,10 @@ void sub_0807C460(void) { for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { if (*mapBottom > 0x3fff) { - SetTile(*mapBottom, position, 1); + SetMetaTile(*mapBottom, position, 1); } if (*mapTop > 0x3fff) { - SetTile(*mapTop, position, 2); + SetMetaTile(*mapTop, position, 2); } mapBottom++; mapTop++; diff --git a/src/projectile/gleerokProjectile.c b/src/projectile/gleerokProjectile.c index b4957290..5c217299 100644 --- a/src/projectile/gleerokProjectile.c +++ b/src/projectile/gleerokProjectile.c @@ -140,7 +140,7 @@ void sub_080A90D8(Entity* this) { if (this->field_0x74.HWORD != TILE(this->x.HALF.HI, this->y.HALF.HI)) { this->field_0x74.HWORD = TILE(this->x.HALF.HI, this->y.HALF.HI); - tmp = GetTileTypeByEntity(this); + tmp = GetMetaTileTypeByEntity(this); if ((tmp == 0x13) || (tmp == 0x34)) { sub_0807B7D8(0x34c, TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer); } diff --git a/src/projectile/mandiblesProjectile.c b/src/projectile/mandiblesProjectile.c index f5c7c303..2bf53960 100644 --- a/src/projectile/mandiblesProjectile.c +++ b/src/projectile/mandiblesProjectile.c @@ -102,8 +102,8 @@ void MandiblesProjectile_Action2(Entity* this) { EnqueueSFX(SFX_15D); } this->field_0x78.HWORD = TILE(this->x.HALF.HI, this->y.HALF.HI); - if (GetTileType(this->field_0x78.HWORD, this->collisionLayer) == 0x4000) { - SetTile(0x4005, this->field_0x78.HWORD, this->collisionLayer); + if (GetMetaTileType(this->field_0x78.HWORD, this->collisionLayer) == 0x4000) { + SetMetaTile(0x4005, this->field_0x78.HWORD, this->collisionLayer); } } diff --git a/src/projectile/removableDust.c b/src/projectile/removableDust.c index 51ce0d95..e0ecba8e 100644 --- a/src/projectile/removableDust.c +++ b/src/projectile/removableDust.c @@ -4,6 +4,7 @@ #include "functions.h" #include "object.h" #include "room.h" +#include "tiles.h" extern void (*const RemovableDust_Functions[])(Entity*); extern const u16 gUnk_08129FD0[]; @@ -60,7 +61,7 @@ void sub_080AA494(Entity* this) { u32 index; index = 0; - tileType = GetTileTypeByEntity(this); + tileType = GetMetaTileTypeByEntity(this); iterator = gUnk_08129FD0; while (*iterator != 0) { if (*(iterator++) == tileType) { @@ -76,7 +77,7 @@ void sub_080AA494(Entity* this) { } this->type2 = index; this->spritePriority.b0 = 7; - SetTile(0x4068, TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer); + SetMetaTile(0x4068, TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer); } void sub_080AA534(Entity* this) { @@ -100,7 +101,7 @@ void sub_080AA544(Entity* this) { iVar4 = 0; do { vvv = GetVvvAtMetaTilePos((param - tmp[uVar3]) & 0xffff, this->collisionLayer); - if (vvv == 0x3e) { + if (vvv == VVV_62) { iVar4++; } uVar3++; diff --git a/src/projectile/spiderWeb.c b/src/projectile/spiderWeb.c index a089d75a..bdf82d31 100644 --- a/src/projectile/spiderWeb.c +++ b/src/projectile/spiderWeb.c @@ -226,7 +226,7 @@ void sub_080AA9E0(Entity* this) { void sub_080AAA68(Entity* this) { static const u16 typeTiles[] = { 0x4023, 0x4025, 0x4026, 0x4024 }; - SetTile(typeTiles[this->type], TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer); + SetMetaTile(typeTiles[this->type], TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer); } void sub_080AAAA8(Entity* this) { diff --git a/src/projectile/v1FireProjectile.c b/src/projectile/v1FireProjectile.c index ea57dd16..7183f2b7 100644 --- a/src/projectile/v1FireProjectile.c +++ b/src/projectile/v1FireProjectile.c @@ -107,7 +107,7 @@ void sub_080AB4A4(Entity* this) { tile = TILE(this->x.HALF.HI, this->y.HALF.HI); if (tmp != tile) { this->field_0x76.HWORD = tile; - switch (GetTileTypeByEntity(this)) { + switch (GetMetaTileTypeByEntity(this)) { case 0x13: case 0x34: sub_0807B7D8(0x34c, this->field_0x76.HWORD, this->collisionLayer); diff --git a/src/projectile/v2Projectile.c b/src/projectile/v2Projectile.c index 98e757bb..c556917d 100644 --- a/src/projectile/v2Projectile.c +++ b/src/projectile/v2Projectile.c @@ -92,7 +92,7 @@ void sub_080ABCC4(Entity* this) { this->subtimer = 0; this->direction = Random() & 0x1f; this->field_0x74.HWORD = TILE(this->x.HALF.HI, this->y.HALF.HI); - this->field_0x76.HWORD = GetTileType(this->field_0x74.HWORD, 2); + this->field_0x76.HWORD = GetMetaTileType(this->field_0x74.HWORD, 2); this->spritePriority.b0 = 2; InitializeAnimation(this, 0); SoundReq(SFX_14B); @@ -114,14 +114,14 @@ void sub_080ABD70(Entity* this) { this->frame &= 0xef; this->speed = 0; this->field_0x74.HWORD = TILE(this->x.HALF.HI, this->y.HALF.HI); - this->field_0x76.HWORD = GetTileType(this->field_0x74.HWORD, 2); + this->field_0x76.HWORD = GetMetaTileType(this->field_0x74.HWORD, 2); tmp = this->field_0x76.HWORD; if (tmp != 0x13) { if (tmp == 0x315) { - SetTileType(0x6e, this->field_0x74.HWORD, 2); + SetMetaTileType(0x6e, this->field_0x74.HWORD, 2); } } else { - SetTileType(0x6d, this->field_0x74.HWORD, 2); + SetMetaTileType(0x6d, this->field_0x74.HWORD, 2); } } if ((this->frame & ANIM_DONE) != 0) { diff --git a/src/projectile/winder.c b/src/projectile/winder.c index d15ce8a0..009997a9 100644 --- a/src/projectile/winder.c +++ b/src/projectile/winder.c @@ -114,12 +114,12 @@ void Winder_SetPositions(WinderEntity* this) { bool32 Winder_CheckForRailings(WinderEntity* this, u32 dir) { u32 tile; u32 val; - LayerStruct* layer = GetLayerByIndex(super->collisionLayer); + MapLayer* mapLayer = GetLayerByIndex(super->collisionLayer); u32 collisionData; tile = TILE(super->x.HALF.HI, super->y.HALF.HI); tile += gUnk_080B4488[dir >> 3]; - collisionData = layer->collisionData[tile]; + collisionData = mapLayer->collisionData[tile]; if (collisionData <= 0x1F) { return FALSE; diff --git a/src/room.c b/src/room.c index 501a8532..c5e70c0b 100644 --- a/src/room.c +++ b/src/room.c @@ -261,7 +261,7 @@ void sub_0804B16C(void) { TileEntity* tile = gSmallChests; do { if (tile->tilePos != 0 && CheckLocalFlag(tile->localFlag)) { - SetTileType(0x74, tile->tilePos, tile->_6 & 1 ? 2 : 1); + SetMetaTileType(0x74, tile->tilePos, tile->_6 & 1 ? 2 : 1); } } while (++tile < gSmallChests + 8); } @@ -342,8 +342,8 @@ static void LoadBombableWallTile(TileEntity* tile) { mgr->base.id = BOMBABLE_WALL_MANAGER; mgr->x = tile->tilePos; mgr->y = *(u16*)&tile->_6; - mgr->field_0x35 = tile->_2; - mgr->field_0x3e = tile->localFlag; + mgr->layer = tile->_2; + mgr->flag = tile->localFlag; AppendEntityToList((Entity*)mgr, 6); } } @@ -354,7 +354,7 @@ static void LoadDarknessTile(TileEntity* tile) { static void LoadDestructibleTile(TileEntity* tile) { if (CheckLocalFlag(*(u16*)&tile->_2)) { - SetTileType(*(u16*)&tile->_6, tile->tilePos, tile->localFlag); + SetMetaTileType(*(u16*)&tile->_6, tile->tilePos, tile->localFlag); } else if (!gRoomVars.filler_0x1) { Manager* mgr; gRoomVars.filler_0x1 = 1; @@ -369,7 +369,7 @@ static void LoadDestructibleTile(TileEntity* tile) { void sub_0804B388(u32 a1, u32 a2) { Entity* e; - SetTileType(a2 == 1 ? 38 : 52, a1, a2); + SetMetaTileType(a2 == 1 ? 38 : 52, a1, a2); e = CreateObject(SPECIAL_FX, FX_DEATH, 0); if (e != NULL) { e->collisionLayer = a2; diff --git a/src/roomInit.c b/src/roomInit.c index 6075e48d..6c56047d 100644 --- a/src/roomInit.c +++ b/src/roomInit.c @@ -806,10 +806,10 @@ extern EntityData gUnk_080D7D34; void sub_StateChange_GreatFairies_Exit(void) { if (GetInventoryValue(ITEM_FOURSWORD)) { - SetTile(0x4072, 0x14d, 1); - SetTile(0x4072, 0x10c, 1); - SetTile(0x4090, 0x14c, 1); - SetTile(0x4090, 0x18c, 1); + SetMetaTile(0x4072, 0x14d, 1); + SetMetaTile(0x4072, 0x10c, 1); + SetMetaTile(0x4090, 0x14c, 1); + SetMetaTile(0x4090, 0x18c, 1); LoadRoomEntityList(&gUnk_080D7D34); } } @@ -860,8 +860,8 @@ void sub_StateChange_Dojos_Grimblade(void) { LoadRoomEntityList(&gUnk_080D827C); } else { sub_0805BC4C(); - SetTileType(0x76, 0x82, 2); - SetTileType(0x76, 0x8c, 2); + SetMetaTileType(0x76, 0x82, 2); + SetMetaTileType(0x76, 0x8c, 2); } } @@ -1042,16 +1042,16 @@ void sub_StateChange_RoyalValley_Main(void) { if (GetInventoryValue(ITEM_QST_GRAVEYARD_KEY) != 2) { LoadRoomEntityList(&gUnk_080D9098); - SetTileType(0x17a, 0x58e, 1); - SetTileType(0x17b, 0x58f, 1); - SetTileType(0x17c, 0x5ce, 1); - SetTileType(0x17d, 0x5cf, 1); + SetMetaTileType(0x17a, 0x58e, 1); + SetMetaTileType(0x17b, 0x58f, 1); + SetMetaTileType(0x17c, 0x5ce, 1); + SetMetaTileType(0x17d, 0x5cf, 1); } EnableRandomDrops(); sub_08059278(); - SetTile(0x4072, 0xa47, 1); - SetTile(0x4072, 0xc47, 1); + SetMetaTile(0x4072, 0xa47, 1); + SetMetaTile(0x4072, 0xc47, 1); if (CheckGlobalFlag(MAZE_CLEAR)) if (gRoomTransition.player_status.start_pos_x == 0x78 && gRoomTransition.player_status.start_pos_y == 0x278) @@ -1109,7 +1109,7 @@ static void sub_0804C128(void) { if (gArea.unk_0c_4 == 6) { sub_080AF250(1); if (CheckLocalFlag(HAKA_01_T0) == 0) { - SetTileType(0x73, 0x107, 1); + SetMetaTileType(0x73, 0x107, 1); } LoadRoomTileEntities(gUnk_080D9328); SetGlobalFlag(MAZE_CLEAR); @@ -1144,7 +1144,7 @@ void sub_0804C290(void) { if (gArea.unk_0c_1) { iVar1 = gArea.unk_0c_1; - SetTileType((gUnk_080D9348 + iVar1)->unk0, (gUnk_080D9348 + iVar1)->unk2, 1); + SetMetaTileType((gUnk_080D9348 + iVar1)->unk0, (gUnk_080D9348 + iVar1)->unk2, 1); } } @@ -1688,7 +1688,7 @@ void sub_StateChange_TownMinishHoles_RemShoeShop(void) { if (!CheckLocalFlag(KOBITO_DOUKUTU_05_T0)) { tilePos = 0x140; for (i = 0; i < 0x13; i++, tilePos++) { - SetTileType(0x4072, tilePos, 1); + SetMetaTileType(0x4072, tilePos, 1); } } LoadRoomEntityList(&gUnk_080DBB90); @@ -2151,11 +2151,11 @@ void sub_StateChange_DeepwoodShrine_StairsToB1(void) { } else { if (!CheckLocalFlag(0x4c)) { LoadRoomEntityList(&gUnk_additional_8_DeepwoodShrine_StairsToB1); - SetTileType(0x79, 0x285, 1); + SetMetaTileType(0x79, 0x285, 1); } else { - SetTileType(0x7a, 0x285, 1); + SetMetaTileType(0x7a, 0x285, 1); if (!CheckLocalFlag(0x24)) { - SetTileType(0x73, 0x205, 1); + SetMetaTileType(0x73, 0x205, 1); } } } @@ -2190,21 +2190,21 @@ void sub_StateChange_DeepwoodShrine_Barrel(void) { switch (gSave.unk7) { case 0: default: - SetTileType(0x90, 0x20b, 1); - SetTileType(0x90, 0x411, 1); + SetMetaTileType(0x90, 0x20b, 1); + SetMetaTileType(0x90, 0x411, 1); break; case 2: - SetTileType(0x90, 0x211, 1); - SetTileType(0x90, 0x40b, 1); + SetMetaTileType(0x90, 0x211, 1); + SetMetaTileType(0x90, 0x40b, 1); break; } if (CheckLocalFlag(0x15)) { - SetTileType(0x76, 0x304, 2); + SetMetaTileType(0x76, 0x304, 2); } if (CheckLocalFlag(0x16)) { - SetTileType(0x76, 0x318, 2); + SetMetaTileType(0x76, 0x318, 2); } } @@ -2248,9 +2248,9 @@ void sub_StateChange_DeepwoodShrine_Entrance(void) { if (GetInventoryValue(ITEM_EARTH_ELEMENT) == 0) { #endif #endif - SetTileType(0x365, 0x349, 1); - SetTileType(0x365, 0x34a, 1); - SetTileType(0x365, 0x34b, 1); + SetMetaTileType(0x365, 0x349, 1); + SetMetaTileType(0x365, 0x34a, 1); + SetMetaTileType(0x365, 0x34b, 1); } } #else @@ -2385,9 +2385,9 @@ u32 sub_unk3_CaveOfFlames_Entrance(void) { #ifdef DEMO_USA void sub_StateChange_CaveOfFlames_Entrance(void) { if (GetInventoryValue(ITEM_FIRE_ELEMENT) == 0) { - SetTileType(0x365, 0x287, 2); - SetTileType(0x365, 0x288, 2); - SetTileType(0x365, 0x289, 2); + SetMetaTileType(0x365, 0x287, 2); + SetMetaTileType(0x365, 0x288, 2); + SetMetaTileType(0x365, 0x289, 2); } } #else @@ -3140,7 +3140,7 @@ extern EntityData gUnk_080E718C; extern EntityData gUnk_080E71AC; void sub_StateChange_RoyalCrypt_Entrance(void) { - SetTileType(0x312, 0x108, 1); + SetMetaTileType(0x312, 0x108, 1); EnableRandomDrops(); if (!CheckLocalFlag(0xc4)) { LoadRoomEntityList(&gUnk_080E718C); @@ -3640,8 +3640,8 @@ void sub_StateChange_DarkHyruleCastleOutside_ZeldaStatuePlatform(void) { LoadRoomEntityList(&gUnk_080EAD68); } else if (!CheckLocalFlag(0x79)) { LoadRoomEntityList(&gUnk_080EADB8); - SetTileType(0x4072, 0x145, 1); - SetTileType(0x4072, 0x149, 1); + SetMetaTileType(0x4072, 0x145, 1); + SetMetaTileType(0x4072, 0x149, 1); gArea.queued_bgm = SFX_NONE; } } @@ -3656,7 +3656,7 @@ void sub_0804D7EC(void) { while (*tilePos != 0) { temp = *tilePos; tilePos++; - SetTileType(0x4072, temp, 1); + SetMetaTileType(0x4072, temp, 1); } } @@ -4352,7 +4352,7 @@ void sub_StateChange_HyruleTown_0(void) { EnableRandomDrops(); TryLoadPrologueHyruleTown(); #if defined(USA) || defined(DEMO_USA) || defined(DEMO_JP) - SetTileType(0x176, 0x66b, 1); + SetMetaTileType(0x176, 0x66b, 1); #endif if (gSave.global_progress == 1) { sub_0801D000(0); @@ -4445,7 +4445,7 @@ void sub_0804E150(void) { uVar3 = 1 << gSave.global_progress; for (; pTileData[1] != 0; pTileData += 3) { if ((pTileData[0] & uVar3) != 0) { - SetTile(pTileData[2], pTileData[1], 1); + SetMetaTile(pTileData[2], pTileData[1], 1); } } if (CheckLocalFlag(SHOP05_OPEN) == 0) { @@ -4453,7 +4453,7 @@ void sub_0804E150(void) { uVar3 = 1 << gSave.global_progress; for (; pTileData[0] != 0; pTileData += 3) { if ((pTileData[0] & uVar3) != 0) { - SetTile(pTileData[2], pTileData[1], 1); + SetMetaTile(pTileData[2], pTileData[1], 1); } } } @@ -4462,7 +4462,7 @@ void sub_0804E150(void) { uVar3 = 1 << gSave.global_progress; for (; pTileData[0] != 0; pTileData += 3) { if ((pTileData[0] & uVar3) != 0) { - SetTile(pTileData[2], pTileData[1], 1); + SetMetaTile(pTileData[2], pTileData[1], 1); } } } @@ -4596,16 +4596,16 @@ void sub_StateChange_CastleGarden_Main(void) { } if (!CheckLocalFlag(SOUGEN_08_TORITSUKI)) { LoadRoomEntityList(&gUnk_080F0800); - SetTileType(0x4072, 600, 1); - SetTileType(0x4072, 0x298, 1); - SetTileType(0x4072, 0x266, 1); - SetTileType(0x4072, 0x2a6, 1); + SetMetaTileType(0x4072, 600, 1); + SetMetaTileType(0x4072, 0x298, 1); + SetMetaTileType(0x4072, 0x266, 1); + SetMetaTileType(0x4072, 0x2a6, 1); } else { if (!GetInventoryValue(ITEM_FOURSWORD)) { LoadRoomEntityList(&gUnk_080F08F0); - SetTileType(0x4072, 0x9e, 1); - SetTileType(0x4072, 0x9f, 1); - SetTileType(0x4072, 0xa0, 1); + SetMetaTileType(0x4072, 0x9e, 1); + SetMetaTileType(0x4072, 0x9f, 1); + SetMetaTileType(0x4072, 0xa0, 1); } LoadRoomEntityList(&gUnk_080F0850); if (!GetInventoryValue(ITEM_WATER_ELEMENT)) { @@ -4613,8 +4613,8 @@ void sub_StateChange_CastleGarden_Main(void) { } else { LoadRoomEntityList(&gUnk_080F0890); } - SetTileType(0x4072, 600, 1); - SetTileType(0x4072, 0x298, 1); + SetMetaTileType(0x4072, 600, 1); + SetMetaTileType(0x4072, 0x298, 1); if (CheckLocalFlag(MAENIWA_00_WARP)) { LoadRoomEntityList(&gUnk_080F0920); ClearLocalFlag(MAENIWA_00_WARP); @@ -4953,10 +4953,10 @@ extern EntityData gUnk_080F3260; void sub_StateChange_HouseInteriors4_Carpenter(void) { if (GetInventoryValue(ITEM_PACCI_CANE)) { LoadRoomEntityList(&gUnk_080F3260); - SetTileType(0x4072, 0x202, 1); - SetTileType(0x4072, 0x242, 1); - SetTileType(0x4072, 0x204, 1); - SetTileType(0x4072, 0x244, 1); + SetMetaTileType(0x4072, 0x202, 1); + SetMetaTileType(0x4072, 0x242, 1); + SetMetaTileType(0x4072, 0x204, 1); + SetMetaTileType(0x4072, 0x244, 1); } } @@ -5042,22 +5042,22 @@ void sub_StateChange_LakeHylia_Main(void) { if ((gSave.global_progress > 3) && CheckGlobalFlag(TINGLE_TALK1ST)) { LoadRoomEntityList(&gUnk_080F3C44); } - SetTile(0x4091, 0x590, 1); - SetTile(0x4091, 0x591, 1); - SetTile(0x4091, 0x592, 1); - SetTile(0x4091, 0x593, 1); - SetTile(0x4091, 0x594, 1); - SetTile(0x4091, 0x5d0, 1); - SetTile(0x4091, 0x610, 1); - SetTile(0x4091, 0x650, 1); - SetTile(0x4091, 0x5d4, 1); - SetTile(0x4091, 0x614, 1); - SetTile(0x4091, 0x654, 1); - SetTile(0x4091, 0x690, 1); - SetTile(0x4091, 0x691, 1); - SetTile(0x4091, 0x692, 1); - SetTile(0x4091, 0x693, 1); - SetTile(0x4091, 0x694, 1); + SetMetaTile(0x4091, 0x590, 1); + SetMetaTile(0x4091, 0x591, 1); + SetMetaTile(0x4091, 0x592, 1); + SetMetaTile(0x4091, 0x593, 1); + SetMetaTile(0x4091, 0x594, 1); + SetMetaTile(0x4091, 0x5d0, 1); + SetMetaTile(0x4091, 0x610, 1); + SetMetaTile(0x4091, 0x650, 1); + SetMetaTile(0x4091, 0x5d4, 1); + SetMetaTile(0x4091, 0x614, 1); + SetMetaTile(0x4091, 0x654, 1); + SetMetaTile(0x4091, 0x690, 1); + SetMetaTile(0x4091, 0x691, 1); + SetMetaTile(0x4091, 0x692, 1); + SetMetaTile(0x4091, 0x693, 1); + SetMetaTile(0x4091, 0x694, 1); } u32 sub_unk3_LakeHylia_Beanstalk(void) { @@ -5211,8 +5211,8 @@ void sub_StateChange_MinishWoods_Main(void) { LoadRoomEntityList(&gUnk_080F4E10); } #ifdef DEMO_USA - SetTileType(0x177, 0x5b4, 1); - SetTileType(0x177, 0x5f4, 1); + SetMetaTileType(0x177, 0x5b4, 1); + SetMetaTileType(0x177, 0x5f4, 1); #endif } @@ -5491,8 +5491,8 @@ void sub_StateChange_WindTribeTower_Entrance(void) { LoadRoomEntityList(&gUnk_080F61BC); } if (!CheckGlobalFlag(WARP_EVENT_END)) { - SetTileType(0x4072, 0x4c7, 1); - SetTileType(0x4072, 0x507, 1); + SetMetaTileType(0x4072, 0x4c7, 1); + SetMetaTileType(0x4072, 0x507, 1); } SetWorldMapPos(8, 0, 0x1e8, 0x158); } @@ -5701,10 +5701,10 @@ void sub_StateChange_HyruleField_EasternHillsNorth(void) { } if (GetInventoryValue(ITEM_GUST_JAR) && !GetInventoryValue(ITEM_PACCI_CANE)) { LoadRoomEntityList(&gUnk_080F7550); - SetTileType(0x4072, 0x311, 1); - SetTileType(0x4072, 0x351, 1); - SetTileType(0x4072, 0x3d9, 1); - SetTileType(0x4072, 0x419, 1); + SetMetaTileType(0x4072, 0x311, 1); + SetMetaTileType(0x4072, 0x351, 1); + SetMetaTileType(0x4072, 0x3d9, 1); + SetMetaTileType(0x4072, 0x419, 1); } } @@ -5733,8 +5733,8 @@ void sub_StateChange_HyruleField_LonLonRanch(void) { } if (!CheckKinstoneFused(KINSTONE_29)) { LoadRoomEntityList(&gUnk_080F7860); - SetTile(0x4072, 0xd88, 1); - SetTile(0x4096, 0xdc8, 1); + SetMetaTile(0x4072, 0xd88, 1); + SetMetaTile(0x4096, 0xdc8, 1); } if ((gSave.global_progress > 3) && CheckGlobalFlag(TINGLE_TALK1ST)) { LoadRoomEntityList(&gUnk_080F78A0); @@ -5775,11 +5775,11 @@ void sub_StateChange_HyruleField_OutsideCastle(void) { sub_0804F4E4(); if (!CheckLocalFlag(SOUGEN_06_AKINDO)) { LoadRoomEntityList(&gUnk_080F7D70); - SetTileType(0x174, 0x7a2, 1); - SetTileType(0x174, 0x7a3, 1); - SetTileType(0x174, 0x7a5, 1); - SetTileType(0x174, 0x7a6, 1); - SetTileType(0x174, 0x7a7, 1); + SetMetaTileType(0x174, 0x7a2, 1); + SetMetaTileType(0x174, 0x7a3, 1); + SetMetaTileType(0x174, 0x7a5, 1); + SetMetaTileType(0x174, 0x7a6, 1); + SetMetaTileType(0x174, 0x7a7, 1); } if (!CheckGlobalFlag(TABIDACHI)) { #ifdef EU @@ -5796,26 +5796,26 @@ static void sub_0804F578(void) { if (!CheckLocalFlag(SOUGEN_06_SLIDE)) { LoadRoomEntityList(&gUnk_080F7DC0); } else { - SetTileType(0x37, 0x94a, 1); - SetTileType(0x37, 0x94b, 1); - SetTileType(0x37, 0x94c, 1); - SetTileType(0x37, 0x98a, 1); - SetTileType(0x37, 0x98b, 1); - SetTileType(0x37, 0x98c, 1); + SetMetaTileType(0x37, 0x94a, 1); + SetMetaTileType(0x37, 0x94b, 1); + SetMetaTileType(0x37, 0x94c, 1); + SetMetaTileType(0x37, 0x98a, 1); + SetMetaTileType(0x37, 0x98b, 1); + SetMetaTileType(0x37, 0x98c, 1); } } void sub_0804F5E8(void) { sub_0804F4E4(); - SetTileType(0x1d3, 0xbde, 1); - SetTileType(0x1d6, 0xbe2, 1); - SetTileType(0x1d4, 0xc1f, 1); - SetTileType(0x1d5, 0xc20, 1); - SetTileType(0x1d6, 0xc5e, 1); - SetTileType(0x4072, 0xb9b, 1); - SetTileType(0x4072, 0xbdb, 1); - SetTileType(0x4072, 0xaa4, 1); - SetTileType(0x4072, 0xae4, 1); + SetMetaTileType(0x1d3, 0xbde, 1); + SetMetaTileType(0x1d6, 0xbe2, 1); + SetMetaTileType(0x1d4, 0xc1f, 1); + SetMetaTileType(0x1d5, 0xc20, 1); + SetMetaTileType(0x1d6, 0xc5e, 1); + SetMetaTileType(0x4072, 0xb9b, 1); + SetMetaTileType(0x4072, 0xbdb, 1); + SetMetaTileType(0x4072, 0xaa4, 1); + SetMetaTileType(0x4072, 0xae4, 1); } void sub_0804F680(Entity* parent, s32 x, s32 y) { @@ -5877,34 +5877,34 @@ void sub_0804F79C(Entity* parent) { } void sub_0804F808(void) { - SetTileType(0x1d3, 0x41d, 1); - SetTileType(0x1d3, 0x621, 1); + SetMetaTileType(0x1d3, 0x41d, 1); + SetMetaTileType(0x1d3, 0x621, 1); } void sub_0804F830(void) { - SetTileType(0x1d4, 0x41e, 1); - SetTileType(0x1d4, 0x620, 1); + SetMetaTileType(0x1d4, 0x41e, 1); + SetMetaTileType(0x1d4, 0x620, 1); } void sub_0804F854(void) { - SetTileType(0x1d5, 0x41f, 1); - SetTileType(0x1d4, 0x4e5, 1); - SetTileType(0x1d5, 0x61f, 1); - SetTileType(0x1d4, 0x559, 1); + SetMetaTileType(0x1d5, 0x41f, 1); + SetMetaTileType(0x1d4, 0x4e5, 1); + SetMetaTileType(0x1d5, 0x61f, 1); + SetMetaTileType(0x1d4, 0x559, 1); } void sub_0804F89C(void) { - SetTileType(0x1d6, 0x420, 1); - SetTileType(0x1d5, 0x525, 1); - SetTileType(0x1d6, 0x61e, 1); - SetTileType(0x1d5, 0x519, 1); + SetMetaTileType(0x1d6, 0x420, 1); + SetMetaTileType(0x1d5, 0x525, 1); + SetMetaTileType(0x1d6, 0x61e, 1); + SetMetaTileType(0x1d5, 0x519, 1); } void sub_0804F8E0(void) { - SetTileType(0x1d3, 0x421, 1); - SetTileType(0x1d6, 0x565, 1); - SetTileType(0x1d3, 0x61d, 1); - SetTileType(0x1d6, 0x4d9, 1); + SetMetaTileType(0x1d3, 0x421, 1); + SetMetaTileType(0x1d6, 0x565, 1); + SetMetaTileType(0x1d3, 0x61d, 1); + SetMetaTileType(0x1d6, 0x4d9, 1); } void sub_0804F928(void) { @@ -6089,7 +6089,7 @@ void sub_StateChange_Caves_LonLonRanchSecret(void) { SetRoomFlag(1); ChangeLightLevel(0x100); if (!CheckLocalFlag(0x12)) { - SetTileType(0x73, 0xcb, 1); + SetMetaTileType(0x73, 0xcb, 1); } } } @@ -6609,7 +6609,7 @@ u32 sub_unk3_MtCrenel_Entrance(void) { void sub_StateChange_MtCrenel_Entrance(void) { #if defined(USA) || defined(DEMO_USA) || defined(DEMO_JP) - SetTileType(0x176, 0x66f, 1); + SetMetaTileType(0x176, 0x66f, 1); #endif } diff --git a/src/scroll.c b/src/scroll.c index 8131f5e0..c62ee6be 100644 --- a/src/scroll.c +++ b/src/scroll.c @@ -6,7 +6,6 @@ #include "common.h" #include "effects.h" #include "entity.h" -#include "fileselect.h" #include "functions.h" #include "game.h" #include "kinstone.h" @@ -15,10 +14,11 @@ #include "object.h" #include "screen.h" #include "structures.h" +#include "tilemap.h" +#include "tiles.h" extern void UpdateScreenShake(void); extern void sub_0807C8B0(u16*, u32, u32); -extern void RenderTilemapToScreenblock(u8*, LayerStruct*); extern void sub_0807C810(); extern void DeleteSleepingEntities(void); extern void sub_0807BBE4(); @@ -54,7 +54,7 @@ u32 sub_080803D0(); u32 sub_08080278(); void sub_08080C80(MapDataDefinition*); void sub_08080368(); -void FillVvvForLayer(LayerStruct*); +void FillVvvForLayer(MapLayer* mapLayer); bool32 sub_08080794(const Transition* transition, u32 param_2, u32 param_3, u32 param_4); bool32 sub_08080808(const Transition* transition, u32 param_2, u32 param_3, u32 param_4); void sub_080808D8(s32); @@ -62,8 +62,6 @@ void sub_080808E4(s32); void sub_08080904(s32); void sub_08080910(s32); -extern u8 gMapDataTopSpecial[]; - extern const s8 gScreenShakeOffsets[]; void UpdateScroll(void) { @@ -305,7 +303,7 @@ void Scroll5Sub1(RoomControls* controls) { gUnk_0200B640 = sub_08080278(); LoadMapData(gCaveBorderMapData[gDiggingCaveEntranceTransition.entrance->type][0]); sub_0807C8B0(gMapTop.mapData, controls->width >> 4, controls->height >> 4); - RenderTilemapToScreenblock(gMapDataTopSpecial, &gMapTop); + RenderMapLayerToTileMap(gMapDataTopSpecial, &gMapTop); } void Scroll5Sub2(RoomControls* controls) { @@ -362,8 +360,8 @@ void Scroll5Sub3(RoomControls* controls) { sub_0807BBE4(); CreateCollisionDataBorderAroundRoom(); sub_0805E248(); - RenderTilemapToScreenblock((u8*)&gMapDataBottomSpecial, &gMapBottom); - RenderTilemapToScreenblock(gMapDataTopSpecial, &gMapTop); + RenderMapLayerToTileMap(gMapDataBottomSpecial, &gMapBottom); + RenderMapLayerToTileMap(gMapDataTopSpecial, &gMapTop); } void Scroll5Sub4(RoomControls* controls) { @@ -700,8 +698,8 @@ void sub_08080930(u32 unused) { SetInitializationPriority(); } -LayerStruct* GetLayerByIndex(u32 layerIndex) { - if (layerIndex == 2) { +MapLayer* GetLayerByIndex(u32 layerIndex) { + if (layerIndex == LAYER_TOP) { return &gMapTop; } else { return &gMapBottom; @@ -782,7 +780,7 @@ void sub_080809D4(void) { } void UpdateDoorTransition() { - u32 uVar1; + u32 vvv; u32 uVar3; u32 uVar4; RoomControls* controls = &gRoomControls; @@ -803,16 +801,16 @@ void UpdateDoorTransition() { case 0x1d: uVar4 = controls->camera_target->y.HALF.HI - controls->origin_y; uVar3 = controls->camera_target->x.HALF.HI - controls->origin_x; - uVar1 = GetVvvAtMetaTilePos( + vvv = GetVvvAtMetaTilePos( (((controls->camera_target->x.HALF.HI - controls->origin_x) >> 4) & 0x3F) | ((((controls->camera_target->y.HALF.HI - controls->origin_y) >> 4) & 0x3F) << 6), controls->camera_target->collisionLayer); gRoomTransition.stairs_idx = sub_080B1A48(uVar3, uVar4, controls->camera_target->collisionLayer); - switch (uVar1) { - case 0x3f: - case 0xf1: - case 0x28: - case 0x29: + switch (vvv) { + case VVV_63: + case VVV_241: + case VVV_40: + case VVV_41: sub_080806BC(uVar3, uVar4, 0xff, 10); break; } @@ -820,18 +818,18 @@ void UpdateDoorTransition() { } // fill the vvv for the whole layer -void FillVvvForLayer(LayerStruct* layer) { +void FillVvvForLayer(MapLayer* mapLayer) { u32 metaTilePos; - u16* metatileTypes = layer->metatileTypes; + u16* metatileTypes = mapLayer->metatileTypes; const u8* ptr = gUnk_080B37A0; - u8* ptr3 = layer->vvv; - u16* mapData = layer->mapData; + u8* ptr3 = mapLayer->vvv; + u16* mapData = mapLayer->mapData; for (metaTilePos = 0; metaTilePos < 0x40 * 0x40; metaTilePos++) { u16 metaTileIndex = mapData[metaTilePos]; if (metaTileIndex < 0x4000) { - layer->vvv[metaTilePos] = ptr[metatileTypes[metaTileIndex]]; + mapLayer->vvv[metaTilePos] = ptr[metatileTypes[metaTileIndex]]; } else { - layer->vvv[metaTilePos] = gUnk_080B7910[metaTileIndex - 0x4000]; + mapLayer->vvv[metaTilePos] = gUnk_080B7910[metaTileIndex - 0x4000]; } } } diff --git a/src/worldEvent/worldEvent17.c b/src/worldEvent/worldEvent17.c index 9b96ecb4..99c11317 100644 --- a/src/worldEvent/worldEvent17.c +++ b/src/worldEvent/worldEvent17.c @@ -12,6 +12,7 @@ #include "script.h" #include "subtask.h" #include "manager/bombableWallManager.h" +#include "tiles.h" // Called Goron Kinstone Fusion Script void sub_08054EB8(Entity* this, ScriptExecutionContext* context) { @@ -21,11 +22,11 @@ void sub_08054EB8(Entity* this, ScriptExecutionContext* context) { manager->base.id = BOMBABLE_WALL_MANAGER; manager->x = this->x.HALF.HI - gRoomControls.origin_x; manager->y = (this->y.HALF.HI - gRoomControls.origin_y) - 0x10; - manager->field_0x35 = 1; + manager->layer = LAYER_BOTTOM; #if defined(EU) || defined(JP) || defined(DEMO_JP) - manager->field_0x3e = 0x77; + manager->flag = 0x77; #else - manager->field_0x3e = 0x79; + manager->flag = 0x79; #endif AppendEntityToList((Entity*)manager, 6); } @@ -33,9 +34,9 @@ void sub_08054EB8(Entity* this, ScriptExecutionContext* context) { void sub_08054EFC(Entity* this, ScriptExecutionContext* context) { Entity* effect; - u32 tmp = COORD_TO_TILE(this) - 0x40; - SetTile(0x4074, tmp, 1); - this->collisionLayer = 2; + u32 metaTilePos = COORD_TO_TILE(this) - 0x40; + SetMetaTile(SPECIAL_META_TILE_116, metaTilePos, LAYER_BOTTOM); + this->collisionLayer = LAYER_TOP; UpdateSpriteForCollisionLayer(this); effect = CreateFx(this, FX_BIG_EXPLOSION, 0); if (effect != NULL) { @@ -156,6 +157,6 @@ void WorldEvent_17_0(void) { void WorldEvent_17_1(void) { if (gMenu.field_0xa != 0) { gMenu.field_0xa = 0; - SetTileType(0x74, 0x407, 1); + SetMetaTileType(0x74, 0x407, 1); } } diff --git a/src/worldEvent/worldEvent2.c b/src/worldEvent/worldEvent2.c index aa347001..0724d7bb 100644 --- a/src/worldEvent/worldEvent2.c +++ b/src/worldEvent/worldEvent2.c @@ -58,7 +58,7 @@ void sub_08055994(void) { } else { layer = 1; } - SetTileType(0x73, (*(u16*)(gMenu.field_0xc + 8) >> 4 & 0x3f) | (*(u16*)(gMenu.field_0xc + 10) >> 4 & 0x3f) << 6, + SetMetaTileType(0x73, (*(u16*)(gMenu.field_0xc + 8) >> 4 & 0x3f) | (*(u16*)(gMenu.field_0xc + 10) >> 4 & 0x3f) << 6, layer); sub_080553E0((u32)gMenu.field_0x4); SoundReq(SFX_SECRET_BIG);