Decompile some of beanstalkSubtask

This commit is contained in:
octorock
2022-03-31 22:36:32 +02:00
parent ced56e2fa3
commit 03e15c611c
38 changed files with 3585 additions and 3673 deletions
+2 -1
View File
@@ -288,6 +288,7 @@ void ChestSpawner_Type0Action3(ChestSpawnerEntity* this) {
}
void sub_080842D8(ChestSpawnerEntity* this) {
// TODO recreate as TileData[]
static const u8 gUnk_0811F854[] = {
35, 64, 191, 255, 35, 64, 192, 255, 38, 64, 255, 255, 38, 64, 0, 0, 255, 255,
};
@@ -310,7 +311,7 @@ void sub_080842D8(ChestSpawnerEntity* this) {
if ((super->y.HALF.HI & 8) != 0) {
index += 2;
}
SetMultipleTiles((u16*)gUnk_0811F898[index], COORD_TO_TILE(super), super->collisionLayer);
SetMultipleTiles((TileData*)gUnk_0811F898[index], COORD_TO_TILE(super), super->collisionLayer);
}
const Hitbox gUnk_0811F8A8 = { 0, -3, { 0, 0, 0, 0 }, 6, 6 };
+3 -3
View File
@@ -8,8 +8,8 @@
static void SetJailBarTiles(Entity*, u32);
extern void (*const gUnk_08124950[])(Entity*);
extern u16 gUnk_08124960[];
extern u16 gUnk_0812497A[];
extern TileData gUnk_08124960[];
extern TileData gUnk_0812497A[];
void JailBars(Entity* this) {
gUnk_08124950[this->action](this);
@@ -49,7 +49,7 @@ void nullsub_127(Entity* this) {
}
static void SetJailBarTiles(Entity* this, u32 arg1) {
u16* puVar1;
TileData* puVar1;
puVar1 = gUnk_08124960;
if (arg1 == 1) {
+8 -10
View File
@@ -11,7 +11,6 @@ typedef struct {
u16 unk6a;
} MacroPlayerEntity;
extern u8 gUnk_02018EB0[];
extern int sub_0807A094(int);
void MacroPlayer_Type0(MacroPlayerEntity*);
@@ -112,8 +111,7 @@ void MacroPlayer_Type0_Init(MacroPlayerEntity* this) {
this->unk6a = 4;
super->spriteRendering.b0 = 3;
SetAffineInfo(super, 4, 4, 0);
ptr = gUnk_02018EB0;
*(Entity**)&ptr[0x14] = super;
gUnk_02018EB0.unk_14 = super;
ChangeObjPalette(super, sub_0807A094(0));
pEVar1 = CreateObject(PORTAL_FALLING_PLAYER, 1, 0);
if (pEVar1 != NULL) {
@@ -139,7 +137,7 @@ void MacroPlayer_Type0_Action1(MacroPlayerEntity* this) {
super->zVelocity = 0x30000;
super->spriteSettings.shadow = 0;
super->child->subAction = 1;
gUnk_02018EB0[0x18] = 1;
gUnk_02018EB0.unk_18 = 1;
}
}
@@ -153,7 +151,7 @@ void MacroPlayer_Type0_Action2(MacroPlayerEntity* this) {
super->direction = 10;
super->speed = 0xc0;
super->zVelocity = 0x28000;
gUnk_02018EB0[0x19] = 1;
gUnk_02018EB0.unk_19 = 1;
}
}
@@ -167,7 +165,7 @@ void MacroPlayer_Type0_Action3(MacroPlayerEntity* this) {
super->direction = 17;
super->speed = 0x100;
super->zVelocity = 0x24000;
gUnk_02018EB0[0x1a] = 1;
gUnk_02018EB0.unk_1a = 1;
}
}
@@ -216,7 +214,7 @@ void MacroPlayer_Type0_Action7(MacroPlayerEntity* this) {
super->direction = DirectionWest;
}
if (super->x.HALF.HI < 0x30) {
gUnk_02018EB0[0x1b] = 1;
gUnk_02018EB0.unk_1b = 1;
}
}
@@ -227,7 +225,7 @@ void MacroPlayer_Type0_Action8(MacroPlayerEntity* this) {
super->direction = DirectionEast;
}
if (super->x.HALF.HI > 0xd0) {
gUnk_02018EB0[0x1b] = 1;
gUnk_02018EB0.unk_1b = 1;
}
}
@@ -235,7 +233,7 @@ void MacroPlayer_Type0_Action9(MacroPlayerEntity* this) {
UpdateAnimationSingleFrame(super);
LinearMoveUpdate(super);
if (super->y.HALF.HI > 0x120) {
gUnk_02018EB0[0x1b] = 1;
gUnk_02018EB0.unk_1b = 1;
}
}
@@ -246,6 +244,6 @@ void MacroPlayer_Type0_Action10(MacroPlayerEntity* this) {
super->direction = DirectionWest;
}
if (super->x.HALF.HI < 0x10) {
gUnk_02018EB0[0x1b] = 1;
gUnk_02018EB0.unk_1b = 1;
}
}
+3 -2
View File
@@ -103,14 +103,15 @@ void sub_08097CB4(Object74Entity* this) {
}
void sub_08097CFC(Object74Entity* this) {
// TODO recreate as TileData[]
static const u16 gUnk_08123344[] = { 16448, 65471, 16449, 65472, 16450, 65473, 16451, 65535, 16452, 0,
16453, 1, 16454, 63, 16455, 64, 16456, 65, 65535 };
static const u16 gUnk_0812336A[] = {
16449, 65471, 16449, 65472, 16452, 65535, 16452, 0, 16455, 63, 16455, 64, 65535
};
if ((super->x.HALF.HI & 0xf) == 0) {
SetMultipleTiles((u16*)gUnk_0812336A, COORD_TO_TILE(super), super->collisionLayer);
SetMultipleTiles((TileData*)gUnk_0812336A, COORD_TO_TILE(super), super->collisionLayer);
} else {
SetMultipleTiles((u16*)gUnk_08123344, COORD_TO_TILE(super), super->collisionLayer);
SetMultipleTiles((TileData*)gUnk_08123344, COORD_TO_TILE(super), super->collisionLayer);
}
}
+3 -1
View File
@@ -78,7 +78,7 @@ void PushableGrave_Init(PushableGraveEntity* this) {
super->hitbox = (Hitbox*)&gUnk_080FD570;
SetTile(tileIndex, tilePosition, super->collisionLayer);
if (super->type2 == 2) {
SetMultipleTiles((u16*)gUnk_081232C0, tilePosition, super->collisionLayer);
SetMultipleTiles((TileData*)gUnk_081232C0, tilePosition, super->collisionLayer);
}
}
}
@@ -200,6 +200,8 @@ bool32 sub_0809798C(PushableGraveEntity* this) {
void (*const gUnk_081232AC[])(PushableGraveEntity*) = {
PushableGrave_Init, PushableGrave_Action1, PushableGrave_Action2, PushableGrave_Action3, PushableGrave_Action4,
};
// TODO recreate as TileData[]
const u8 gUnk_081232C0[] = {
61, 64, 191, 255, 61, 64, 192, 255, 61, 64, 193, 255, 61, 64, 255,
255, 61, 64, 1, 0, 61, 64, 63, 0, 61, 64, 65, 0, 255, 255,
+3 -2
View File
@@ -15,6 +15,7 @@ void StoneTablet(Entity* this) {
}
void sub_080979CC(Entity* this) {
// TODO recreate as TileData[]
static const u16 gUnk_081232EC[] = { 0x4022, 0xfffe, 0x4022, 0xffff, 0x4022, 0x0, 0x4022, 0x1, 0xffff };
static const u16 gUnk_081232FE[] = { 0x4065, 0xffbf, 0x4022, 0xffc0, 0x4066, 0xffc1, 0x4029,
0xffff, 0x4026, 0x0, 0x402a, 0x1, 0xffff };
@@ -22,10 +23,10 @@ void sub_080979CC(Entity* this) {
this->spriteSettings.draw = 1;
if (this->type == 3) {
this->frameIndex = 0;
SetMultipleTiles((u16*)gUnk_081232FE, COORD_TO_TILE(this), this->collisionLayer);
SetMultipleTiles((TileData*)gUnk_081232FE, COORD_TO_TILE(this), this->collisionLayer);
} else {
this->frameIndex = this->type;
SetMultipleTiles((u16*)gUnk_081232EC, COORD_TO_TILE(this), this->collisionLayer);
SetMultipleTiles((TileData*)gUnk_081232EC, COORD_TO_TILE(this), this->collisionLayer);
}
}