mirror of https://github.com/zeldaret/tmc.git
Create enums for Vvvs and MetaTiles
This commit is contained in:
parent
f9da634427
commit
f89bb66911
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include "global.h"
|
||||
|
||||
enum {
|
||||
typedef enum {
|
||||
BG_ANIM_DEFAULT = 0,
|
||||
BG_ANIM_PALETTE = 16,
|
||||
BG_ANIM_MULTIPLE = 128,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -392,4 +392,7 @@ typedef struct {
|
|||
u8 gfxGroup;
|
||||
} PACKED StaffrollGfxEntry;
|
||||
|
||||
extern const u8 gGlobalGfxAndPalettes[];
|
||||
extern u32 gUsedPalettes;
|
||||
|
||||
#endif // STRUCTURES_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
|
1691
include/tiles.h
1691
include/tiles.h
File diff suppressed because it is too large
Load Diff
|
@ -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 = .;
|
||||
|
|
|
@ -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*);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
1586
src/collision.c
1586
src/collision.c
File diff suppressed because it is too large
Load Diff
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
36
src/entity.c
36
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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
extern void (*const HoleManager_Actions[])(HoleManager*);
|
||||
|
||||
extern u8 gGlobalGfxAndPalettes[];
|
||||
|
||||
void HoleManager_Main(HoleManager* this) {
|
||||
HoleManager_Actions[super->action](this);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -172,7 +172,7 @@ void sub_08066F94(void) {
|
|||
while (*puVar2 != 0) {
|
||||
uVar1 = *puVar2;
|
||||
puVar2++;
|
||||
SetTileType(16498, uVar1, 1);
|
||||
SetMetaTileType(0x4072, uVar1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue