mirror of
https://github.com/zeldaret/tmc
synced 2026-08-20 14:15:10 -04:00
Extract some data
And split up subtasks and world events.
This commit is contained in:
@@ -6,13 +6,12 @@
|
||||
*/
|
||||
#include "asm.h"
|
||||
#include "entity.h"
|
||||
#include "hitbox.h"
|
||||
#include "physics.h"
|
||||
#include "projectile.h"
|
||||
#include "room.h"
|
||||
#include "sound.h"
|
||||
|
||||
extern Hitbox gUnk_080FD178;
|
||||
|
||||
void AngryStatue_Init(Entity*);
|
||||
void AngryStatue_Action1(Entity*);
|
||||
void AngryStatue_Action2(Entity*);
|
||||
@@ -29,7 +28,7 @@ void AngryStatue(Entity* this) {
|
||||
|
||||
void AngryStatue_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->hitbox = &gUnk_080FD178;
|
||||
this->hitbox = (Hitbox*)&gUnk_080FD178;
|
||||
SetTile(0x4022, COORD_TO_TILE(this), this->collisionLayer);
|
||||
InitializeAnimation(this, this->type);
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ void CameraTarget_Action2(Entity* this) {
|
||||
u32 bVar3;
|
||||
u32 temp;
|
||||
u32 temp2;
|
||||
const struct_080C9CBC* ptr;
|
||||
const KinstoneWorldEvent* ptr;
|
||||
|
||||
if ((this->type != 1) &&
|
||||
(((u8)(gUnk_03003DF0.unk_4[3] - 1) >= 100 || (this->child != *(Entity**)(gUnk_03003DF0.unk_4 + 8))))) {
|
||||
@@ -132,7 +132,7 @@ void CameraTarget_Action2(Entity* this) {
|
||||
} else {
|
||||
bVar2 = this->type2;
|
||||
}
|
||||
ptr = gUnk_080C9CBC + bVar2;
|
||||
ptr = gKinstoneWorldEvents + bVar2;
|
||||
bVar1 = ptr->unk6;
|
||||
bVar3 = bVar1 & 1;
|
||||
this->palette.b.b0 = bVar3;
|
||||
|
||||
@@ -13,16 +13,25 @@
|
||||
#include "screen.h"
|
||||
#include "script.h"
|
||||
|
||||
extern u8 gUnk_08114F30[];
|
||||
extern u8 gUnk_08114F34[];
|
||||
extern u8 gUnk_08122AE0[];
|
||||
extern u16 gUnk_08122AE8[];
|
||||
extern s8 gUnk_08122AF8[];
|
||||
extern s8 gUnk_08122AF8[]; // TODO struct s8XY
|
||||
extern u16 gUnk_08122B00[];
|
||||
extern s16 gUnk_08122B0E[];
|
||||
extern u16 gUnk_08122B1E[];
|
||||
extern s8 gUnk_08122B2E[];
|
||||
extern Coords8 gUnk_08122B2E[]; // TODO struct xy
|
||||
typedef struct {
|
||||
Hitbox hit;
|
||||
u8 _8[4]; // TODO fourth param of sub_08078850
|
||||
u8 _c;
|
||||
} HitboxCfg;
|
||||
extern HitboxCfg gUnk_08122B3C[];
|
||||
|
||||
// npcUtils.c
|
||||
extern u8 gUnk_08114F30[];
|
||||
extern u8 gUnk_08114F34[];
|
||||
|
||||
// TODO use Script type
|
||||
extern u16 script_CutsceneMiscObjectTheLittleHat;
|
||||
extern u16 script_CutsceneMiscObjectSwordInChest;
|
||||
extern u16 script_08015B14;
|
||||
@@ -56,13 +65,6 @@ typedef struct {
|
||||
u32 anim;
|
||||
} Type1F;
|
||||
|
||||
typedef struct {
|
||||
Hitbox hit;
|
||||
u8 _8[4];
|
||||
u8 _c;
|
||||
} HitboxCfg;
|
||||
extern HitboxCfg gUnk_08122B3C[];
|
||||
|
||||
typedef void(CutsceneMiscObjectTypeAction)(CutsceneMiscObjectEntity*);
|
||||
|
||||
CutsceneMiscObjectTypeAction sub_08094A5C;
|
||||
@@ -1265,10 +1267,10 @@ void sub_080961F4(CutsceneMiscObjectEntity* this) {
|
||||
}
|
||||
|
||||
void sub_08096208(CutsceneMiscObjectEntity* this, u32 x) {
|
||||
s8* p = &gUnk_08122B2E[x * 2];
|
||||
Coords8* p = &gUnk_08122B2E[x];
|
||||
Entity* e = CreateObject(CUTSCENE_MISC_OBJECT, 0x26, 0);
|
||||
if (e != NULL) {
|
||||
PositionRelative(super, e, Q_16_16(p[0]), Q_16_16(p[1]));
|
||||
PositionRelative(super, e, Q_16_16(p->x), Q_16_16(p->y));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+16
-18
@@ -6,9 +6,10 @@
|
||||
*/
|
||||
|
||||
#define NENT_DEPRECATED
|
||||
#include "figurineMenu.h"
|
||||
#include "fileselect.h"
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
#include "kinstone.h"
|
||||
#include "item.h"
|
||||
#include "message.h"
|
||||
#include "object.h"
|
||||
@@ -43,13 +44,6 @@ typedef struct {
|
||||
|
||||
extern void ModShells(s32);
|
||||
extern u8 gUnk_020227F0;
|
||||
typedef struct {
|
||||
u32 unk_0;
|
||||
u16 unk_4;
|
||||
u8 unk_6;
|
||||
u8 unk_7;
|
||||
} struct_080FC3E4;
|
||||
extern const struct_080FC3E4 gUnk_080FC3E4[];
|
||||
|
||||
void sub_0808804C(FigurineDeviceEntity*);
|
||||
void sub_08087F58(FigurineDeviceEntity*);
|
||||
@@ -509,13 +503,13 @@ NONMATCH("asm/non_matching/figurineDevice/sub_08088160.inc",
|
||||
switch (ptr->unk_6) {
|
||||
case 0x8:
|
||||
case 0x40:
|
||||
if (CheckLocalFlagByBank(ptr->unk_0, ptr->unk_4)) {
|
||||
if (CheckLocalFlagByBank(ptr->bank, ptr->flag)) {
|
||||
result = TRUE;
|
||||
}
|
||||
return result;
|
||||
break;
|
||||
case 0x10:
|
||||
if (CheckKinstoneFused(gUnk_080FC3E4[param_2].unk_4)) {
|
||||
if (CheckKinstoneFused(gUnk_080FC3E4[param_2].flag)) {
|
||||
result = TRUE;
|
||||
}
|
||||
return result;
|
||||
@@ -523,30 +517,34 @@ NONMATCH("asm/non_matching/figurineDevice/sub_08088160.inc",
|
||||
default:
|
||||
return result;
|
||||
case 0x20:
|
||||
switch (gUnk_080FC3E4[param_2].unk_4) {
|
||||
switch (gUnk_080FC3E4[param_2].flag) {
|
||||
case 0:
|
||||
if (CheckKinstoneFused(0x20) || CheckKinstoneFused(0x10) || CheckKinstoneFused(0x19)) {
|
||||
if (CheckKinstoneFused(KINSTONE_20) || CheckKinstoneFused(KINSTONE_10) ||
|
||||
CheckKinstoneFused(KINSTONE_19)) {
|
||||
result = TRUE;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if ((u8)this->unk_7c >= 5 && CheckKinstoneFused(0x28)) {
|
||||
if ((u8)this->unk_7c >= 5 && CheckKinstoneFused(KINSTONE_28)) {
|
||||
result = TRUE;
|
||||
}
|
||||
|
||||
break;
|
||||
case 2:
|
||||
if (CheckKinstoneFused(0x54) || CheckKinstoneFused(0x56) || CheckKinstoneFused(0x3d)) {
|
||||
if (CheckKinstoneFused(KINSTONE_54) || CheckKinstoneFused(KINSTONE_56) ||
|
||||
CheckKinstoneFused(KINSTONE_3D)) {
|
||||
result = TRUE;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (CheckKinstoneFused(0x3b) || CheckKinstoneFused(0x4a) || CheckKinstoneFused(0xd)) {
|
||||
if (CheckKinstoneFused(KINSTONE_3B) || CheckKinstoneFused(KINSTONE_4A) ||
|
||||
CheckKinstoneFused(KINSTONE_D)) {
|
||||
result = TRUE;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (CheckKinstoneFused(0x49) || CheckKinstoneFused(0x55) || CheckKinstoneFused(0x3c)) {
|
||||
if (CheckKinstoneFused(KINSTONE_49) || CheckKinstoneFused(KINSTONE_55) ||
|
||||
CheckKinstoneFused(KINSTONE_3C)) {
|
||||
result = TRUE;
|
||||
}
|
||||
break;
|
||||
@@ -598,9 +596,9 @@ void sub_080882A8(FigurineDeviceEntity* this) {
|
||||
sub_08057044(this->unk_83, &gUnk_020227E8[1], 0x202020);
|
||||
ptr = (u8*)0x02000000;
|
||||
if (ptr[7] == 0) {
|
||||
sub_0805F46C((u32)gUnk_08120AE4[super->type2], (Font*)&gUnk_08120AB4); // TODO convert data
|
||||
ShowTextBox(gUnk_08120AE4[super->type2], (Font*)&gUnk_08120AB4); // TODO convert data
|
||||
} else {
|
||||
sub_0805F46C((u32)gUnk_08120AE4[super->type2], (Font*)&gUnk_08120ACC); // TODO convert data
|
||||
ShowTextBox(gUnk_08120AE4[super->type2], (Font*)&gUnk_08120ACC); // TODO convert data
|
||||
}
|
||||
gScreen.bg0.updated = 1;
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ void sub_0808E7F0(Entity* this) {
|
||||
|
||||
void sub_0808E818(Entity* this) {
|
||||
u32 var0;
|
||||
u32 var1;
|
||||
u32 offset;
|
||||
|
||||
if (!sub_0808E950()) {
|
||||
int var2 = -1;
|
||||
@@ -104,8 +104,8 @@ void sub_0808E818(Entity* this) {
|
||||
this->field_0x68.HWORD = CheckGlobalFlag(EZERO_1ST) == 0 ? 0x400 : 0x100;
|
||||
this->field_0x70.BYTES.byte0 = 4;
|
||||
this->animationState = 2;
|
||||
var1 = gUnk_08133368[GetPlayerPalette(TRUE) - 22] & 0xFFFFFF;
|
||||
LoadPalettes(&gGlobalGfxAndPalettes[var1], 31, 1);
|
||||
offset = gUnk_08133368[GetPlayerPalette(TRUE) - 22] & 0xFFFFFF;
|
||||
LoadPalettes(&gGlobalGfxAndPalettes[offset], 31, 1);
|
||||
}
|
||||
|
||||
if (gUI.lastState == 0) {
|
||||
|
||||
@@ -307,7 +307,7 @@ void FrozenOctorok_Action1SubAction5(FrozenOctorokEntity* this) {
|
||||
void FrozenOctorok_Action1SubAction6(FrozenOctorokEntity* this) {
|
||||
LinearMoveUpdate(super);
|
||||
if ((gRoomControls.origin_y + 0x1c8) < super->y.HALF.HI) {
|
||||
gRoomControls.unk5 = 4;
|
||||
gRoomControls.scrollSpeed = 4;
|
||||
gRoomControls.camera_target = &gPlayerEntity;
|
||||
SetLocalFlag(0x9b);
|
||||
DeleteEntity(super->parent);
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "effects.h"
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "hitbox.h"
|
||||
#include "object.h"
|
||||
#include "player.h"
|
||||
#include "room.h"
|
||||
@@ -23,8 +24,6 @@ typedef struct {
|
||||
union SplitWord unk84;
|
||||
} GleerokParticleEntity;
|
||||
|
||||
extern Hitbox gUnk_080FD2E8;
|
||||
|
||||
void GleerokParticle_Init(GleerokParticleEntity*);
|
||||
void GleerokParticle_Action1(GleerokParticleEntity*);
|
||||
void GleerokParticle_Action2(GleerokParticleEntity*);
|
||||
|
||||
@@ -60,10 +60,10 @@ void GreatFairy_CallBehavior(Entity* this) {
|
||||
if ((gPlayerEntity.y.HALF.HI - gRoomControls.origin_y) < 168) {
|
||||
|
||||
gRoomControls.camera_target = this;
|
||||
gRoomControls.unk5 = 2;
|
||||
gRoomControls.scrollSpeed = 2;
|
||||
} else {
|
||||
gRoomControls.camera_target = &gPlayerEntity;
|
||||
gRoomControls.unk5 = 2;
|
||||
gRoomControls.scrollSpeed = 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ void KinstoneSpark(Entity* this) {
|
||||
this->spriteRendering.b3 = 1;
|
||||
this->spritePriority.b0 = 0;
|
||||
this->spriteOrientation.flipY = 1;
|
||||
ChangeObjPalette(this, gUnk_080C9CBC[gFuseInfo._3].unk0);
|
||||
ChangeObjPalette(this, gKinstoneWorldEvents[gFuseInfo.kinstoneId].objPalette);
|
||||
}
|
||||
GetNextFrame(this);
|
||||
}
|
||||
|
||||
+10
-10
@@ -42,7 +42,7 @@ void LightRay_Type0(LightRayEntity* this) {
|
||||
super->timer = 60;
|
||||
super->subtimer = 0;
|
||||
gRoomControls.camera_target = super;
|
||||
gRoomControls.unk5 = 1;
|
||||
gRoomControls.scrollSpeed = 1;
|
||||
if (super->x.HALF.HI > gPlayerEntity.x.HALF.HI) {
|
||||
tmp = 2;
|
||||
} else {
|
||||
@@ -76,7 +76,7 @@ void LightRay_Type0(LightRayEntity* this) {
|
||||
case 2:
|
||||
if (--super->timer == 0) {
|
||||
gScreen.lcd.displayControl |= 0x4800;
|
||||
gRoomControls.unk5 = 4;
|
||||
gRoomControls.scrollSpeed = 4;
|
||||
(super->parent)->subAction = 1;
|
||||
DeleteThisEntity();
|
||||
}
|
||||
@@ -116,7 +116,7 @@ void LightRay_Type1(LightRayEntity* this) {
|
||||
super->timer = 60;
|
||||
super->subtimer = 32;
|
||||
gRoomControls.camera_target = super;
|
||||
gRoomControls.unk5 = 1;
|
||||
gRoomControls.scrollSpeed = 1;
|
||||
if (super->x.HALF.HI > gPlayerEntity.x.HALF.HI) {
|
||||
tmp = 2;
|
||||
} else {
|
||||
@@ -148,7 +148,7 @@ void LightRay_Type1(LightRayEntity* this) {
|
||||
break;
|
||||
case 2:
|
||||
if (--super->timer == 0) {
|
||||
gRoomControls.unk5 = 4;
|
||||
gRoomControls.scrollSpeed = 4;
|
||||
gScreen.lcd.displayControl &= 0xd7ff;
|
||||
(super->parent)->subAction = 1;
|
||||
DeleteThisEntity();
|
||||
@@ -167,7 +167,7 @@ void LightRay_Type2(LightRayEntity* this) {
|
||||
super->timer = 60;
|
||||
super->subtimer = 0;
|
||||
gRoomControls.camera_target = super;
|
||||
gRoomControls.unk5 = 1;
|
||||
gRoomControls.scrollSpeed = 1;
|
||||
if (super->x.HALF.HI > gPlayerEntity.x.HALF.HI) {
|
||||
tmp = 2;
|
||||
} else {
|
||||
@@ -214,12 +214,12 @@ void LightRay_Type2(LightRayEntity* this) {
|
||||
if (--super->timer == 0) {
|
||||
super->action = 4;
|
||||
gRoomControls.camera_target = &gPlayerEntity;
|
||||
gRoomControls.unk5 = 2;
|
||||
gRoomControls.scrollSpeed = 2;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (sub_0809BE78(this)) {
|
||||
gRoomControls.unk5 = 4;
|
||||
gRoomControls.scrollSpeed = 4;
|
||||
(super->parent)->subAction = 1;
|
||||
SetRoomFlag(100);
|
||||
DeleteThisEntity();
|
||||
@@ -237,7 +237,7 @@ void LightRay_Type3(LightRayEntity* this) {
|
||||
super->timer = 60;
|
||||
super->subtimer = 0;
|
||||
gRoomControls.camera_target = super;
|
||||
gRoomControls.unk5 = 1;
|
||||
gRoomControls.scrollSpeed = 1;
|
||||
if (super->x.HALF.HI > gPlayerEntity.x.HALF.HI) {
|
||||
tmp = 2;
|
||||
} else {
|
||||
@@ -293,7 +293,7 @@ void LightRay_Type4(LightRayEntity* this) {
|
||||
super->timer = 60;
|
||||
super->subtimer = 128;
|
||||
gRoomControls.camera_target = super;
|
||||
gRoomControls.unk5 = 1;
|
||||
gRoomControls.scrollSpeed = 1;
|
||||
if (super->x.HALF.HI > gPlayerEntity.x.HALF.HI) {
|
||||
tmp = 2;
|
||||
} else {
|
||||
@@ -319,7 +319,7 @@ void LightRay_Type4(LightRayEntity* this) {
|
||||
break;
|
||||
case 2:
|
||||
if (--super->timer == 0) {
|
||||
gRoomControls.unk5 = 4;
|
||||
gRoomControls.scrollSpeed = 4;
|
||||
(super->parent)->subAction = 1;
|
||||
DeleteThisEntity();
|
||||
}
|
||||
|
||||
@@ -19,12 +19,6 @@ typedef struct {
|
||||
/*0x68*/ u16 unk_68;
|
||||
} LinkHoldingItemEntity;
|
||||
|
||||
typedef struct {
|
||||
u8 unk_0[6];
|
||||
u16 unk_6;
|
||||
} struct_080FD964;
|
||||
extern const struct_080FD964 gUnk_080FD964[];
|
||||
|
||||
void LinkHoldingItem_Init(LinkHoldingItemEntity*);
|
||||
void LinkHoldingItem_Action1(LinkHoldingItemEntity*);
|
||||
void LinkHoldingItem_Action2(LinkHoldingItemEntity*);
|
||||
@@ -74,7 +68,7 @@ void LinkHoldingItem_Action1(LinkHoldingItemEntity* this) {
|
||||
break;
|
||||
case 2:
|
||||
GiveItem(super->type, super->type2);
|
||||
this->unk_68 = gUnk_080FD964[super->type].unk_6;
|
||||
this->unk_68 = gUnk_080FD964[super->type].gotItemMessageId;
|
||||
SoundReq(SFX_ITEM_GET);
|
||||
break;
|
||||
case 5:
|
||||
|
||||
@@ -223,7 +223,7 @@ void LockedDoor_Action8(Entity* this) {
|
||||
this->timer = 20;
|
||||
sub_08083658(this);
|
||||
SetFlag(this->field_0x86.HWORD);
|
||||
sub_080526F8(-1);
|
||||
ModDungeonKeys(-1);
|
||||
}
|
||||
|
||||
void sub_08083638(Entity* this) {
|
||||
|
||||
@@ -134,7 +134,7 @@ void Minecart_Action3(MinecartEntity* this) {
|
||||
u32 iVar2;
|
||||
u32 uVar3;
|
||||
|
||||
gRoomControls.unk5 = 7;
|
||||
gRoomControls.scrollSpeed = 7;
|
||||
if ((gPlayerState.flags & PL_IN_MINECART) == 0) {
|
||||
super->action = 1;
|
||||
return;
|
||||
|
||||
@@ -40,7 +40,7 @@ void ObjectA(Entity* this) {
|
||||
SetTileType(*(u16*)&this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer);
|
||||
SetFlag(this->field_0x86.HWORD);
|
||||
CreateDust(this);
|
||||
sub_080526F8(-1);
|
||||
ModDungeonKeys(-1);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ void PushableGrave_Action2(PushableGraveEntity* this) {
|
||||
super->subAction = 1;
|
||||
super->subtimer = 120;
|
||||
gRoomControls.camera_target = super;
|
||||
gRoomControls.unk5 = 2;
|
||||
gRoomControls.scrollSpeed = 2;
|
||||
}
|
||||
} else {
|
||||
if (--super->subtimer == 0) {
|
||||
@@ -122,7 +122,7 @@ void PushableGrave_Action3(PushableGraveEntity* this) {
|
||||
sub_080977F4(this);
|
||||
if (super->type == 0) {
|
||||
gRoomControls.camera_target = &gPlayerEntity;
|
||||
gRoomControls.unk5 = 4;
|
||||
gRoomControls.scrollSpeed = 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
#include "hitbox.h"
|
||||
#include "object.h"
|
||||
|
||||
extern void sub_0807CAC8(u32);
|
||||
extern u32 sub_0807CAEC(u32);
|
||||
extern void EnableDungeonWarp(u32);
|
||||
extern u32 IsDungeonWarpActive(u32);
|
||||
|
||||
void WarpPoint_Init(Entity*);
|
||||
void WarpPoint_Action1(Entity*);
|
||||
@@ -50,7 +50,7 @@ void WarpPoint_Init(Entity* this) {
|
||||
if (CheckFlags(this->field_0x86.HWORD)) {
|
||||
sub_0808B830(this);
|
||||
} else {
|
||||
if (AreaIsDungeon() && sub_0807CAEC(this->type)) {
|
||||
if (AreaIsDungeon() && IsDungeonWarpActive(this->type)) {
|
||||
sub_0808B830(this);
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ void WarpPoint_Action1(Entity* this) {
|
||||
if (CheckFlags(this->field_0x86.HWORD)) {
|
||||
sub_0808B830(this);
|
||||
if (AreaIsDungeon()) {
|
||||
sub_0807CAC8(this->type);
|
||||
EnableDungeonWarp(this->type);
|
||||
}
|
||||
this->action = 2;
|
||||
this->subtimer = 60;
|
||||
|
||||
Reference in New Issue
Block a user