mirror of
https://github.com/zeldaret/tmc
synced 2026-07-10 15:13:59 -04:00
Merge branch 'zeldaret:master' into master
This commit is contained in:
@@ -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*);
|
||||
@@ -2519,4 +2518,5 @@ const u16* const gUnk_080B755C[] = {
|
||||
NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
};
|
||||
|
||||
// TODO gMapTop.bgSettings->control values
|
||||
const u16 gUnk_080B77C0[] = { 0x1c42, 0x1d45, 0x1d46, 0x1e03 };
|
||||
|
||||
+222
-214
File diff suppressed because it is too large
Load Diff
+9
-9
@@ -4,8 +4,8 @@
|
||||
|
||||
extern void MemFill32(u32, void*, u32);
|
||||
|
||||
void sub_08049DCC(RoomMemory*);
|
||||
RoomMemory* sub_08049D88(void);
|
||||
void UpdateCurrentRoom(RoomMemory*);
|
||||
RoomMemory* AddCurrentRoom(void);
|
||||
|
||||
void ClearRoomMemory(void) {
|
||||
MemFill32(0xFFFFFFFF, gRoomMemory, 0x40);
|
||||
@@ -19,8 +19,8 @@ void EnemyDisableRespawn(Enemy* ent) {
|
||||
}
|
||||
}
|
||||
|
||||
u32 EnemyEnableRespawn(u32 arg0) {
|
||||
u32 bitmask = gCurrentRoomMemory->enemyBits >> arg0;
|
||||
u32 EnemyEnableRespawn(u32 enemyIdx) {
|
||||
u32 bitmask = gCurrentRoomMemory->enemyBits >> enemyIdx;
|
||||
u32 output = 1;
|
||||
output &= ~bitmask;
|
||||
return output;
|
||||
@@ -31,16 +31,16 @@ void UpdateRoomTracker(void) {
|
||||
|
||||
do {
|
||||
if (gCurrentRoomMemory->area == gRoomControls.area && gCurrentRoomMemory->room == gRoomControls.room) {
|
||||
sub_08049DCC(gCurrentRoomMemory);
|
||||
UpdateCurrentRoom(gCurrentRoomMemory);
|
||||
return;
|
||||
}
|
||||
gCurrentRoomMemory++;
|
||||
|
||||
} while (gCurrentRoomMemory < gRoomMemory + 8);
|
||||
gCurrentRoomMemory = sub_08049D88();
|
||||
gCurrentRoomMemory = AddCurrentRoom();
|
||||
}
|
||||
|
||||
RoomMemory* sub_08049D88(void) {
|
||||
RoomMemory* AddCurrentRoom(void) {
|
||||
RoomMemory* rm = gRoomMemory;
|
||||
RoomMemory* r1 = rm + 1;
|
||||
|
||||
@@ -57,12 +57,12 @@ RoomMemory* sub_08049D88(void) {
|
||||
rm->unk_02 = 0xFFFF;
|
||||
rm->enemyBits = 0;
|
||||
|
||||
sub_08049DCC(rm);
|
||||
UpdateCurrentRoom(rm);
|
||||
|
||||
return rm;
|
||||
}
|
||||
|
||||
void sub_08049DCC(RoomMemory* rm) {
|
||||
void UpdateCurrentRoom(RoomMemory* rm) {
|
||||
RoomMemory* r1 = gRoomMemory;
|
||||
|
||||
do {
|
||||
|
||||
+24
-24
@@ -136,11 +136,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;
|
||||
@@ -167,7 +167,7 @@ u32 sub_0804A044(Entity* entA, Entity* entB, u32 arg2) {
|
||||
|
||||
//! @bug flags & 5 can never equal 0xA
|
||||
if (flags && ((flags & 5) != 0xA)) {
|
||||
layer = GetTileBuffer(entA->collisionLayer);
|
||||
mapLayer = GetLayerByIndex(entA->collisionLayer);
|
||||
if (xDiff < 0) {
|
||||
xDiff = -xDiff;
|
||||
}
|
||||
@@ -176,7 +176,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;
|
||||
}
|
||||
@@ -184,10 +184,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;
|
||||
}
|
||||
@@ -195,7 +195,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;
|
||||
@@ -205,9 +205,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;
|
||||
@@ -219,13 +219,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;
|
||||
}
|
||||
}
|
||||
@@ -235,13 +235,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;
|
||||
}
|
||||
}
|
||||
@@ -249,7 +249,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;
|
||||
@@ -261,13 +261,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;
|
||||
}
|
||||
}
|
||||
@@ -277,12 +277,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;
|
||||
}
|
||||
}
|
||||
@@ -290,21 +290,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;
|
||||
|
||||
+3
-4
@@ -85,17 +85,17 @@ void UpdatePlayerInput(void) {
|
||||
if (playerInput->playerMacroWaiting == 0) { // Execute next macro entry.
|
||||
do {
|
||||
flags = playerMacro->flags >> 0xe;
|
||||
if (flags == 1)
|
||||
if (flags == 1) // PLAYER_MACRO_JUMPTO
|
||||
(u8*)playerMacro += ((s16)playerMacro->keys);
|
||||
else {
|
||||
if (flags == 3) {
|
||||
if (flags == 3) { // PLAYER_MACRO_END
|
||||
playerInput->playerMacroWaiting = 0;
|
||||
playerInput->playerMacroHeldKeys = 0;
|
||||
playerMacro = NULL;
|
||||
playerInput->playerMacro = playerMacro;
|
||||
break;
|
||||
} else {
|
||||
if (flags != 2) {
|
||||
if (flags != 2) { // !PLAYER_MACRO_IGNORE
|
||||
playerInput->playerMacroWaiting = playerMacro->flags;
|
||||
playerInput->playerMacroHeldKeys = playerMacro->keys;
|
||||
}
|
||||
@@ -104,7 +104,6 @@ void UpdatePlayerInput(void) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} while (TRUE);
|
||||
}
|
||||
playerInput->playerMacroWaiting--;
|
||||
|
||||
+1459
-129
File diff suppressed because it is too large
Load Diff
+6
-5
@@ -240,18 +240,18 @@ void ChangeObjPalette(Entity* entity, u32 objPaletteId) {
|
||||
void LoadObjPaletteAtIndex(u32 objPaletteId, u32 a2) {
|
||||
u16* buffer;
|
||||
|
||||
gUsedPalettes |= 1 << (a2 + 0x10);
|
||||
gUsedPalettes |= 1 << (a2 + 16);
|
||||
if (objPaletteId > 5) {
|
||||
if (objPaletteId == 0x15) {
|
||||
buffer = gPaletteBuffer;
|
||||
MemFill16(buffer[0x3C], buffer + (a2 + 0x10) * 0x10, 0x20);
|
||||
MemFill16(buffer[0x3C], buffer + (a2 + 16) * 16, 0x20);
|
||||
} else if (objPaletteId < 0x15) {
|
||||
LoadPalettes((u8*)(gPaletteBuffer + (objPaletteId - 6) * 0x10), a2 + 0x10, 1);
|
||||
LoadPalettes((u8*)(gPaletteBuffer + (objPaletteId - 6) * 16), a2 + 16, 1);
|
||||
} else {
|
||||
u32 offset = gUnk_08133368[(objPaletteId - 0x16)].WORD_U;
|
||||
u32 numPalettes = (offset >> 0x18) & 0xf;
|
||||
offset &= 0xffffff;
|
||||
LoadPalettes(gGlobalGfxAndPalettes + offset, a2 + 0x10, numPalettes);
|
||||
LoadPalettes(gGlobalGfxAndPalettes + offset, a2 + 16, numPalettes);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -361,5 +361,6 @@ void sub_0801D48C(u32 a1, u32 a2) {
|
||||
} while (iVar2 != -1);
|
||||
}
|
||||
|
||||
gUsedPalettes |= 0xffff0000;
|
||||
gUsedPalettes |= 1 << 16 | 1 << 17 | 1 << 18 | 1 << 19 | 1 << 20 | 1 << 21 | 1 << 22 | 1 << 23 | 1 << 24 | 1 << 25 |
|
||||
1 << 26 | 1 << 27 | 1 << 28 | 1 << 29 | 1 << 30 | 1 << 31;
|
||||
}
|
||||
|
||||
+525
-37
@@ -1,6 +1,8 @@
|
||||
#include "common.h"
|
||||
|
||||
#include "assets/map_offsets.h"
|
||||
#include "area.h"
|
||||
#include "asm.h"
|
||||
#include "common.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "game.h"
|
||||
@@ -15,18 +17,10 @@
|
||||
#include "sound.h"
|
||||
#include "structures.h"
|
||||
|
||||
typedef struct {
|
||||
u8 area;
|
||||
u8 room;
|
||||
u8 unk_2;
|
||||
u8 unk_3;
|
||||
u32 mapDataOffset;
|
||||
} DungeonLayout;
|
||||
|
||||
extern u8 gUnk_03003DE0;
|
||||
extern u8 gzHeap[0x1000];
|
||||
extern u8 gUnk_02035542[];
|
||||
extern u32 gUnk_0201AEE0[0x800];
|
||||
extern u32 gDungeonMap[0x800];
|
||||
extern s16 gUnk_02018EE0[];
|
||||
|
||||
extern void (*const gFuseActions[])(void);
|
||||
@@ -77,14 +71,14 @@ void SortKinstoneBag(void);
|
||||
extern void* GetRoomProperty(u32, u32, u32);
|
||||
|
||||
extern u8 gMapData;
|
||||
extern const DungeonLayout** const gUnk_080C9C50[];
|
||||
extern const DungeonLayout* const* const gDungeonLayouts[];
|
||||
extern u8 gMapDataBottomSpecial[];
|
||||
|
||||
u32 sub_0801DF10(const DungeonLayout* lyt);
|
||||
bool32 IsRoomVisited(TileEntity* tileEntity, u32 bank);
|
||||
u32 sub_0801DF60(u32 a1, u8* p);
|
||||
u32 sub_0801DF78(u32 a1, u32 a2);
|
||||
void sub_0801DF28(u32 x, u32 y, s32 color);
|
||||
void DrawMapPixel(u32 x, u32 y, s32 color);
|
||||
void sub_0801E64C(s32 x1, s32 y1, s32 x2, s32 y2, s32 offset);
|
||||
|
||||
extern void* GetRoomProperty(u32, u32, u32);
|
||||
@@ -107,7 +101,7 @@ typedef struct {
|
||||
|
||||
u32 DecToHex(u32 value) {
|
||||
u32 result;
|
||||
register u32 r1 asm("r1");
|
||||
FORCE_REGISTER(u32 r1, r1);
|
||||
|
||||
if (value >= 100000000) {
|
||||
return 0x99999999;
|
||||
@@ -453,23 +447,23 @@ void* zMalloc(u32 size) {
|
||||
void zFree(void* ptr) {
|
||||
u32 uVar1;
|
||||
u32 i;
|
||||
u16* puVar3;
|
||||
s32 uVar5;
|
||||
u16* ptr2;
|
||||
u16* entryPtr;
|
||||
s32 numEntries;
|
||||
u16* lastEntryPtr;
|
||||
|
||||
uVar1 = (int)ptr - (int)gzHeap;
|
||||
if (uVar1 < 0x1000) {
|
||||
puVar3 = (u16*)gzHeap;
|
||||
uVar5 = *puVar3++;
|
||||
entryPtr = (u16*)gzHeap;
|
||||
numEntries = *entryPtr++;
|
||||
|
||||
for (i = 0; i < uVar5; puVar3 += 2, i++) {
|
||||
if (*puVar3 == uVar1) {
|
||||
ptr2 = &((u16*)(gzHeap - 2))[uVar5 * 2];
|
||||
*puVar3 = *ptr2;
|
||||
*ptr2++ = 0;
|
||||
*(puVar3 + 1) = *ptr2;
|
||||
*ptr2 = 0;
|
||||
*(u16*)(gzHeap) = uVar5 - 1;
|
||||
for (i = 0; i < numEntries; entryPtr += 2, i++) {
|
||||
if (*entryPtr == uVar1) {
|
||||
lastEntryPtr = &((u16*)(gzHeap - 2))[numEntries * 2];
|
||||
*entryPtr = *lastEntryPtr;
|
||||
*lastEntryPtr++ = 0;
|
||||
*(entryPtr + 1) = *lastEntryPtr;
|
||||
*lastEntryPtr = 0;
|
||||
*(u16*)(gzHeap) = numEntries - 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -509,13 +503,13 @@ void ClearOAM(void) {
|
||||
|
||||
void ResetScreenRegs(void) {
|
||||
MemClear(&gScreen, sizeof(gScreen));
|
||||
gScreen.bg0.tilemap = &gBG0Buffer;
|
||||
gScreen.bg0.subTileMap = &gBG0Buffer;
|
||||
gScreen.bg0.control = 0x1F0C;
|
||||
gScreen.bg1.tilemap = &gBG1Buffer;
|
||||
gScreen.bg1.subTileMap = &gBG1Buffer;
|
||||
gScreen.bg1.control = 0x1C01;
|
||||
gScreen.bg2.tilemap = &gBG2Buffer;
|
||||
gScreen.bg2.subTileMap = &gBG2Buffer;
|
||||
gScreen.bg2.control = 0x1D02;
|
||||
gScreen.bg3.tilemap = &gBG3Buffer;
|
||||
gScreen.bg3.subTileMap = &gBG3Buffer;
|
||||
gScreen.bg3.control = 0x1E03;
|
||||
gScreen.lcd.displayControl = 0x140;
|
||||
gScreen.lcd.displayControlMask = 0xffff;
|
||||
@@ -538,7 +532,7 @@ void DrawDungeonMap(u32 floor, DungeonMapObject* specialData, u32 size) {
|
||||
specialData->x = (gRoomTransition.player_status.dungeon_map_x >> 4) & 0x7f;
|
||||
specialData->y = (gRoomTransition.player_status.dungeon_map_y >> 4) & 0x7f;
|
||||
specialData++;
|
||||
floorMapData = (DungeonLayout*)gUnk_080C9C50[gArea.dungeon_idx][floor];
|
||||
floorMapData = (DungeonLayout*)gDungeonLayouts[gArea.dungeon_idx][floor];
|
||||
while (floorMapData->area != 0) {
|
||||
tileEntity = (TileEntity*)GetRoomProperty(floorMapData->area, floorMapData->room, 3);
|
||||
if (tileEntity == NULL) {
|
||||
@@ -602,7 +596,7 @@ void sub_0801DD58(u32 area, u32 room) {
|
||||
}
|
||||
|
||||
void LoadDungeonMap(void) {
|
||||
LoadResourceAsync(gUnk_0201AEE0, 0x6006000, sizeof(gUnk_0201AEE0));
|
||||
LoadResourceAsync(gDungeonMap, 0x6006000, sizeof(gDungeonMap));
|
||||
}
|
||||
|
||||
void DrawDungeonFeatures(u32 floor, void* data, u32 size) {
|
||||
@@ -628,7 +622,7 @@ void DrawDungeonFeatures(u32 floor, void* data, u32 size) {
|
||||
if (!AreaHasMap()) {
|
||||
return;
|
||||
}
|
||||
layout = gUnk_080C9C50[gArea.dungeon_idx][floor];
|
||||
layout = gDungeonLayouts[gArea.dungeon_idx][floor];
|
||||
MemClear(gMapDataBottomSpecial, 0x8000);
|
||||
while (layout->area != 0) {
|
||||
// ROOM_VISIT_MARKER has to be first TileEntity in the room.
|
||||
@@ -650,6 +644,7 @@ void DrawDungeonFeatures(u32 floor, void* data, u32 size) {
|
||||
}
|
||||
nextLayout = layout + 1;
|
||||
if (features != 0) {
|
||||
// Copies 0x400 bytes even though the data is less most of the time.
|
||||
DmaCopy32(3, &gMapData + layout->mapDataOffset, &gMapDataBottomSpecial, 0x400);
|
||||
|
||||
roomHeader = gAreaRoomHeaders[layout->area] + layout->room;
|
||||
@@ -666,7 +661,7 @@ void DrawDungeonFeatures(u32 floor, void* data, u32 size) {
|
||||
for (x = 0; x < width; x++) {
|
||||
tmp2 = mapX + x;
|
||||
color = sub_0801DF78(sub_0801DF60(x, ptr), features);
|
||||
sub_0801DF28(tmp2, mapY + y, color);
|
||||
DrawMapPixel(tmp2, mapY + y, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -684,10 +679,10 @@ u32 sub_0801DF10(const DungeonLayout* layout) {
|
||||
return offset;
|
||||
}
|
||||
|
||||
void sub_0801DF28(u32 x, u32 y, s32 color) {
|
||||
void DrawMapPixel(u32 x, u32 y, s32 color) {
|
||||
u32* ptr;
|
||||
u32 tmp;
|
||||
ptr = &gUnk_0201AEE0[(((y >> 3) * 0x10 + (x >> 3)) * 8)];
|
||||
ptr = &gDungeonMap[(((y >> 3) * 0x10 + (x >> 3)) * 8)];
|
||||
ptr = &ptr[(y & 7)];
|
||||
tmp = (color << ((x & 7) * 4));
|
||||
ptr[0] = (ptr[0] & gUnk_080C9460[x & 7]) | tmp;
|
||||
@@ -1287,7 +1282,500 @@ KinstoneId GetFusionToOffer(Entity* entity) {
|
||||
return offeredFusion;
|
||||
}
|
||||
|
||||
const struct_080C9C6C gUnk_080C9C6C[] = {
|
||||
const u16 gUnk_080C93E0[] = {
|
||||
3, 9, 16, 22, 28, 35, 41, 48, 54, 61, 67, 74, 81, 88, 95, 102,
|
||||
110, 117, 125, 133, 141, 149, 158, 167, 176, 185, 195, 205, 215, 226, 238, 250,
|
||||
262, 276, 290, 304, 320, 336, 354, 373, 394, 415, 439, 465, 493, 525, 559, 597,
|
||||
640, 689, 744, 808, 883, 971, 1078, 1209, 1375, 1591, 1885, 2308, 2973, 4167, 6950, 20860
|
||||
};
|
||||
|
||||
const u32 gUnk_080C9460[] = {
|
||||
0xfffffff0, 0xffffff0f, 0xfffff0ff, 0xffff0fff, 0xfff0ffff, 0xff0fffff, 0xf0ffffff, 0xfffffff,
|
||||
};
|
||||
|
||||
const DungeonLayout gDungeonLayouts_None_None[] = {
|
||||
{ 0, 0, 0, 0, 0 },
|
||||
};
|
||||
const DungeonLayout* const gDungeonLayouts_None[] = {
|
||||
gDungeonLayouts_None_None,
|
||||
};
|
||||
|
||||
const DungeonLayout gDungeonLayouts_DeepwoodShrine_1F[] = {
|
||||
{ AREA_DEEPWOOD_SHRINE, ROOM_DEEPWOOD_SHRINE_BOSS_DOOR, 0, 0, offset_gDungeonMaps_DeepwoodShrine_BossDoor },
|
||||
{ AREA_DEEPWOOD_SHRINE_BOSS, ROOM_DEEPWOOD_SHRINE_BOSS_MAIN, 2, 0, offset_gDungeonMaps_DeepwoodShrineBoss_Main },
|
||||
{ 0, 0, 0, 0, 0 },
|
||||
};
|
||||
const DungeonLayout gDungeonLayouts_DeepwoodShrine_B1[] = {
|
||||
{ AREA_DEEPWOOD_SHRINE, ROOM_DEEPWOOD_SHRINE_MADDERPILLAR, 0, 0, offset_gDungeonMaps_DeepwoodShrine_Madderpillar },
|
||||
{ AREA_DEEPWOOD_SHRINE, ROOM_DEEPWOOD_SHRINE_BLUE_PORTAL, 0, 0, offset_gDungeonMaps_DeepwoodShrine_BluePortal },
|
||||
{ AREA_DEEPWOOD_SHRINE, ROOM_DEEPWOOD_SHRINE_STAIRS_TO_B1, 0, 0, offset_gDungeonMaps_DeepwoodShrine_StairsToB1 },
|
||||
{ AREA_DEEPWOOD_SHRINE, ROOM_DEEPWOOD_SHRINE_POT_BRIDGE, 0, 0, offset_gDungeonMaps_DeepwoodShrine_PotBridge },
|
||||
{ AREA_DEEPWOOD_SHRINE, ROOM_DEEPWOOD_SHRINE_DOUBLE_STATUE, 0, 0, offset_gDungeonMaps_DeepwoodShrine_DoubleStatue },
|
||||
{ AREA_DEEPWOOD_SHRINE, ROOM_DEEPWOOD_SHRINE_MAP, 0, 0, offset_gDungeonMaps_DeepwoodShrine_Map },
|
||||
{ AREA_DEEPWOOD_SHRINE, ROOM_DEEPWOOD_SHRINE_BARREL, 0, 0, offset_gDungeonMaps_DeepwoodShrine_Barrel },
|
||||
{ AREA_DEEPWOOD_SHRINE, ROOM_DEEPWOOD_SHRINE_BUTTON, 0, 0, offset_gDungeonMaps_DeepwoodShrine_Button },
|
||||
{ AREA_DEEPWOOD_SHRINE, ROOM_DEEPWOOD_SHRINE_MULLDOZER, 0, 0, offset_gDungeonMaps_DeepwoodShrine_Mulldozer },
|
||||
{ AREA_DEEPWOOD_SHRINE, ROOM_DEEPWOOD_SHRINE_PILLARS, 0, 0, offset_gDungeonMaps_DeepwoodShrine_Pillars },
|
||||
{ AREA_DEEPWOOD_SHRINE, ROOM_DEEPWOOD_SHRINE_LEVER, 0, 0, offset_gDungeonMaps_DeepwoodShrine_Lever },
|
||||
{ AREA_DEEPWOOD_SHRINE, ROOM_DEEPWOOD_SHRINE_ENTRANCE, 0, 0, offset_gDungeonMaps_DeepwoodShrine_Entrance },
|
||||
{ AREA_DEEPWOOD_SHRINE, ROOM_DEEPWOOD_SHRINE_TORCHES, 0, 0, offset_gDungeonMaps_DeepwoodShrine_Torches },
|
||||
{ 0, 0, 0, 0, 0 },
|
||||
};
|
||||
const DungeonLayout gDungeonLayouts_DeepwoodShrine_B2[] = {
|
||||
{ AREA_DEEPWOOD_SHRINE, ROOM_DEEPWOOD_SHRINE_BOSS_KEY, 0, 0, offset_gDungeonMaps_DeepwoodShrine_BossKey },
|
||||
{ AREA_DEEPWOOD_SHRINE, ROOM_DEEPWOOD_SHRINE_COMPASS, 0, 0, offset_gDungeonMaps_DeepwoodShrine_Compass },
|
||||
{ AREA_DEEPWOOD_SHRINE, ROOM_DEEPWOOD_SHRINE_LILY_PAD_WEST, 0, 0, offset_gDungeonMaps_DeepwoodShrine_LilyPadWest },
|
||||
{ AREA_DEEPWOOD_SHRINE, ROOM_DEEPWOOD_SHRINE_LILY_PAD_EAST, 0, 0, offset_gDungeonMaps_DeepwoodShrine_LilyPadEast },
|
||||
{ 0, 0, 0, 0, 0 },
|
||||
};
|
||||
const DungeonLayout* const gDungeonLayouts_DeepwoodShrine[] = {
|
||||
gDungeonLayouts_DeepwoodShrine_1F,
|
||||
gDungeonLayouts_DeepwoodShrine_B1,
|
||||
gDungeonLayouts_DeepwoodShrine_B2,
|
||||
};
|
||||
|
||||
const DungeonLayout gDungeonLayouts_CaveOfFlames_1F[] = {
|
||||
{ AREA_CAVE_OF_FLAMES, ROOM_CAVE_OF_FLAMES_ENTRANCE, 0, 0, offset_gDungeonMaps_CaveOfFlames_Entrance },
|
||||
{ AREA_CAVE_OF_FLAMES, ROOM_CAVE_OF_FLAMES_NORTH_ENTRANCE, 0, 0, offset_gDungeonMaps_CaveOfFlames_NorthEntrance },
|
||||
{ AREA_CAVE_OF_FLAMES, ROOM_CAVE_OF_FLAMES_COMPASS, 0, 0, offset_gDungeonMaps_CaveOfFlames_Compass },
|
||||
{ AREA_CAVE_OF_FLAMES, ROOM_CAVE_OF_FLAMES_BOB_OMB_WALL, 0, 0, offset_gDungeonMaps_CaveOfFlames_BobOmbWall },
|
||||
{ 0, 0, 0, 0, 0 },
|
||||
};
|
||||
const DungeonLayout gDungeonLayouts_CaveOfFlames_B1[] = {
|
||||
{ AREA_CAVE_OF_FLAMES, ROOM_CAVE_OF_FLAMES_AFTER_CANE, 0, 0, offset_gDungeonMaps_CaveOfFlames_AfterCane },
|
||||
{ AREA_CAVE_OF_FLAMES, ROOM_CAVE_OF_FLAMES_SPINY_CHU, 0, 0, offset_gDungeonMaps_CaveOfFlames_SpinyChu },
|
||||
{ AREA_CAVE_OF_FLAMES, ROOM_CAVE_OF_FLAMES_CART_TO_SPINY_CHU, 0, 0,
|
||||
offset_gDungeonMaps_CaveOfFlames_CartToSpinyChu },
|
||||
{ AREA_CAVE_OF_FLAMES, ROOM_CAVE_OF_FLAMES_MAIN_CART, 0, 0, offset_gDungeonMaps_CaveOfFlames_MainCart },
|
||||
{ AREA_CAVE_OF_FLAMES, ROOM_CAVE_OF_FLAMES_CART_WEST, 0, 0, offset_gDungeonMaps_CaveOfFlames_CartWest },
|
||||
{ AREA_CAVE_OF_FLAMES, ROOM_CAVE_OF_FLAMES_HELMASAUR_FIGHT, 0, 0, offset_gDungeonMaps_CaveOfFlames_HelmasaurFight },
|
||||
{ AREA_CAVE_OF_FLAMES, ROOM_CAVE_OF_FLAMES_ROLLOBITE_LAVA_ROOM, 0, 0,
|
||||
offset_gDungeonMaps_CaveOfFlames_RollobiteLavaRoom },
|
||||
{ AREA_CAVE_OF_FLAMES, ROOM_CAVE_OF_FLAMES_MINISH_LAVA_ROOM, 0, 0,
|
||||
offset_gDungeonMaps_CaveOfFlames_MinishLavaRoom },
|
||||
{ 0, 0, 0, 0, 0 },
|
||||
};
|
||||
const DungeonLayout gDungeonLayouts_CaveOfFlames_B2[] = {
|
||||
{ AREA_CAVE_OF_FLAMES, ROOM_CAVE_OF_FLAMES_MINISH_SPIKES, 0, 0, offset_gDungeonMaps_CaveOfFlames_MinishSpikes },
|
||||
{ AREA_CAVE_OF_FLAMES, ROOM_CAVE_OF_FLAMES_TOMPAS_DOOM, 0, 0, offset_gDungeonMaps_CaveOfFlames_TompasDoom },
|
||||
{ AREA_CAVE_OF_FLAMES, ROOM_CAVE_OF_FLAMES_BEFORE_GLEEROK, 0, 0, offset_gDungeonMaps_CaveOfFlames_BeforeGleerok },
|
||||
{ AREA_CAVE_OF_FLAMES, ROOM_CAVE_OF_FLAMES_BOSSKEY_PATH1, 0, 0, offset_gDungeonMaps_CaveOfFlames_BosskeyPath1 },
|
||||
{ AREA_CAVE_OF_FLAMES, ROOM_CAVE_OF_FLAMES_BOSSKEY_PATH2, 0, 0, offset_gDungeonMaps_CaveOfFlames_BosskeyPath2 },
|
||||
{ AREA_CAVE_OF_FLAMES, ROOM_CAVE_OF_FLAMES_BOSS_DOOR, 0, 0, offset_gDungeonMaps_CaveOfFlames_BossDoor },
|
||||
{ 0, 0, 0, 0, 0 },
|
||||
};
|
||||
const DungeonLayout gDungeonLayouts_CaveOfFlames_B3[] = {
|
||||
{ AREA_CAVE_OF_FLAMES_BOSS, ROOM_CAVE_OF_FLAMES_BOSS_0, 2, 0, offset_gDungeonMaps_CaveOfFlamesBoss_0 },
|
||||
{ 0, 0, 0, 0, 0 },
|
||||
};
|
||||
const DungeonLayout* const gDungeonLayouts_CaveOfFlames[] = {
|
||||
gDungeonLayouts_CaveOfFlames_1F,
|
||||
gDungeonLayouts_CaveOfFlames_B1,
|
||||
gDungeonLayouts_CaveOfFlames_B2,
|
||||
gDungeonLayouts_CaveOfFlames_B3,
|
||||
};
|
||||
|
||||
const DungeonLayout gDungeonLayouts_FortressOfWinds_3F[] = {
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_DOUBLE_EYEGORE, 0, 0,
|
||||
offset_gDungeonMaps_FortressOfWinds_DoubleEyegore },
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_EAST_KEY_LEVER, 0, 0,
|
||||
offset_gDungeonMaps_FortressOfWinds_EastKeyLever },
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_PIT_PLATFORMS, 0, 0,
|
||||
offset_gDungeonMaps_FortressOfWinds_PitPlatforms },
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_WEST_KEY_LEVER, 0, 0,
|
||||
offset_gDungeonMaps_FortressOfWinds_WestKeyLever },
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_MAZAAL, 2, 0, offset_gDungeonMaps_FortressOfWinds_Mazaal },
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_BEFORE_MAZAAL, 0, 0,
|
||||
offset_gDungeonMaps_FortressOfWinds_BeforeMazaal },
|
||||
{ 0, 0, 0, 0, 0 },
|
||||
};
|
||||
const DungeonLayout gDungeonLayouts_FortressOfWinds_2F[] = {
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_DARKNUT_ROOM, 0, 0,
|
||||
offset_gDungeonMaps_FortressOfWinds_DarknutRoom },
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_ARROW_EYE_BRIDGE, 0, 0,
|
||||
offset_gDungeonMaps_FortressOfWinds_ArrowEyeBridge },
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_NORTH_SPLIT_PATH_PIT, 0, 0,
|
||||
offset_gDungeonMaps_FortressOfWinds_NorthSplitPathPit },
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_WALLMASTER_MINISH_PORTAL, 0, 0,
|
||||
offset_gDungeonMaps_FortressOfWinds_WallmasterMinishPortal },
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_PILLAR_CLONE_BUTTONS, 0, 0,
|
||||
offset_gDungeonMaps_FortressOfWinds_PillarCloneButtons },
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_ROTATING_SPIKE_TRAPS, 0, 0,
|
||||
offset_gDungeonMaps_FortressOfWinds_RotatingSpikeTraps },
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_STALFOS, 0, 0, offset_gDungeonMaps_FortressOfWinds_Stalfos },
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_ENTRANCE_MOLE_MITTS, 0, 0,
|
||||
offset_gDungeonMaps_FortressOfWinds_EntranceMoleMitts },
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_MAIN_2F, 0, 0, offset_gDungeonMaps_FortressOfWinds_Main2f },
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_MINISH_HOLE, 0, 0,
|
||||
offset_gDungeonMaps_FortressOfWinds_MinishHole },
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_BOSS_KEY, 0, 0, offset_gDungeonMaps_FortressOfWinds_BossKey },
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_WEST_STAIRS_2F, 0, 0,
|
||||
offset_gDungeonMaps_FortressOfWinds_WestStairs2f },
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_EAST_STAIRS_2F, 0, 0,
|
||||
offset_gDungeonMaps_FortressOfWinds_EastStairs2f },
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_5, 1, 1, offset_gDungeonMaps_FortressOfWinds_5 },
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_6, 1, 1, offset_gDungeonMaps_FortressOfWinds_6 },
|
||||
{ 0, 0, 0, 0, 0 },
|
||||
};
|
||||
const DungeonLayout gDungeonLayouts_FortressOfWinds_1F[] = {
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_WEST_STAIRS_1F, 0, 0,
|
||||
offset_gDungeonMaps_FortressOfWinds_WestStairs1f },
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_CENTER_STAIRS_1F, 0, 0,
|
||||
offset_gDungeonMaps_FortressOfWinds_CenterStairs1f },
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_EAST_STAIRS_1F, 0, 0,
|
||||
offset_gDungeonMaps_FortressOfWinds_EastStairs1f },
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_WIZZROBE, 0, 0, offset_gDungeonMaps_FortressOfWinds_Wizzrobe },
|
||||
{ AREA_FORTRESS_OF_WINDS, ROOM_FORTRESS_OF_WINDS_HEART_PIECE, 0, 0,
|
||||
offset_gDungeonMaps_FortressOfWinds_HeartPiece },
|
||||
{ 0, 0, 0, 0, 0 },
|
||||
};
|
||||
const DungeonLayout* const gDungeonLayouts_FortressOfWinds[] = {
|
||||
gDungeonLayouts_FortressOfWinds_3F,
|
||||
gDungeonLayouts_FortressOfWinds_2F,
|
||||
gDungeonLayouts_FortressOfWinds_1F,
|
||||
};
|
||||
|
||||
const DungeonLayout gDungeonLayouts_TempleOfDroplets_B1[] = {
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_WEST_HOLE, 0, 0, offset_gDungeonMaps_TempleOfDroplets_WestHole },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_NORTH_SPLIT_ROOM, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_NorthSplitRoom },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_EAST_HOLE, 0, 0, offset_gDungeonMaps_TempleOfDroplets_EastHole },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_ENTRANCE, 0, 0, offset_gDungeonMaps_TempleOfDroplets_Entrance },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_NORTHWEST_STAIRS, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_NorthwestStairs },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_SCISSORS_MINIBOSS, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_ScissorsMiniboss },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_WATERFALL_NORTHWEST, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_WaterfallNorthwest },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_WATERFALL_NORTHEAST, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_WaterfallNortheast },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_ELEMENT, 0, 0, offset_gDungeonMaps_TempleOfDroplets_Element },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_ICE_CORNER, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_IceCorner },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_ICE_PIT_MAZE, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_IcePitMaze },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_HOLE_TO_BLUE_CHU_KEY, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_HoleToBlueChuKey },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_WEST_WATERFALL_SOUTHEAST, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_WestWaterfallSoutheast },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_WEST_WATERFALL_SOUTHWEST, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_WestWaterfallSouthwest },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_BIG_OCTO, 2, 0, offset_gDungeonMaps_TempleOfDroplets_BigOcto },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_TO_BLUE_CHU, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_ToBlueChu },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_BLUE_CHU, 0, 0, offset_gDungeonMaps_TempleOfDroplets_BlueChu },
|
||||
{ 0, 0, 0, 0, 0 },
|
||||
};
|
||||
const DungeonLayout gDungeonLayouts_TempleOfDroplets_B2[] = {
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_BOSS_KEY, 0, 0, offset_gDungeonMaps_TempleOfDroplets_BossKey },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_NORTH_SMALL_KEY, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_NorthSmallKey },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_BLOCK_CLONE_BUTTON_PUZZLE, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_BlockCloneButtonPuzzle },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_BLOCK_CLONE_PUZZLE, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_BlockClonePuzzle },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_BLOCK_CLONE_ICE_BRIDGE, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_BlockCloneIceBridge },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_STAIRS_TO_SCISSORS_MINIBOSS, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_StairsToScissorsMiniboss },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_SPIKE_BAR_FLIPPER_ROOM, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_SpikeBarFlipperRoom },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_9_LANTERNS, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_9Lanterns },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_LILYPAD_ICE_BLOCKS, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_LilypadIceBlocks },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_29, 0, 0, offset_gDungeonMaps_TempleOfDroplets_29 },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_MULLDOZERS_FIRE_BARS, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_MulldozersFireBars },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_DARK_MAZE, 0, 0, offset_gDungeonMaps_TempleOfDroplets_DarkMaze },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_TWIN_MADDERPILLARS, 1, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_TwinMadderpillars },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_AFTER_TWIN_MADDERPILLARS, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_AfterTwinMadderpillars },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_BLUE_CHU_KEY_LEVER, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_BlueChuKeyLever },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_MULLDOZER_KEY, 1, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_MulldozerKey },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_BEFORE_TWIN_MADDERPILLARS, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_BeforeTwinMadderpillars },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_LILYPAD_B2_WEST, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_LilypadB2West },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_COMPASS, 0, 0, offset_gDungeonMaps_TempleOfDroplets_Compass },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_DARK_SCISSOR_BEETLES, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_DarkScissorBeetles },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_LILYPAD_B2_MIDDLE, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_LilypadB2Middle },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_ICE_MADDERPILLAR, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_IceMadderpillar },
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_FLAMEBAR_BLOCK_PUZZLE, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_FlamebarBlockPuzzle },
|
||||
{ 0, 0, 0, 0, 0 },
|
||||
};
|
||||
const DungeonLayout gDungeonLayouts_TempleOfDroplets_B3[] = {
|
||||
{ AREA_TEMPLE_OF_DROPLETS, ROOM_TEMPLE_OF_DROPLETS_BLUE_CHU_KEY, 0, 0,
|
||||
offset_gDungeonMaps_TempleOfDroplets_BlueChuKey },
|
||||
{ 0, 0, 0, 0, 0 },
|
||||
};
|
||||
const DungeonLayout* const gDungeonLayouts_TempleOfDroplets[] = {
|
||||
gDungeonLayouts_TempleOfDroplets_B1,
|
||||
gDungeonLayouts_TempleOfDroplets_B2,
|
||||
gDungeonLayouts_TempleOfDroplets_B3,
|
||||
};
|
||||
|
||||
const DungeonLayout gDungeonLayouts_PalaceOfWinds_5F[] = {
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_GYORG_TORNADO, 2, 0, offset_gDungeonMaps_PalaceOfWinds_GyorgTornado },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_BOSS_KEY, 0, 0, offset_gDungeonMaps_PalaceOfWinds_BossKey },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_BEFORE_BALL_AND_CHAIN_SOLDIERS, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_BeforeBallAndChainSoldiers },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_GYORG_BOSS_DOOR, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_GyorgBossDoor },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_EAST_CHEST_FROM_GYORG_BOSS_DOOR, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_EastChestFromGyorgBossDoor },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_MOBLIN_AND_WIZZROBE_FIGHT, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_MoblinAndWizzrobeFight },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_FOUR_BUTTON_STALFOS, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_FourButtonStalfos },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_FAN_AND_KEY_TO_BOSS_KEY, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_FanAndKeyToBossKey },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_BALL_AND_CHAIN_SOLDIERS, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_BallAndChainSoldiers },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_BOMBAROSSA_PATH, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_BombarossaPath },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_HOLE_TO_DARKNUT, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_HoleToDarknut },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_TO_BOMBAROSSA_PATH, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_ToBombarossaPath },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_BOMB_WALL_INSIDE, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_BombWallInside },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_BOMB_WALL_OUTSIDE, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_BombWallOutside },
|
||||
{ 0, 0, 0, 0, 0 },
|
||||
};
|
||||
const DungeonLayout gDungeonLayouts_PalaceOfWinds_4F[] = {
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_CLOUD_JUMPS, 0, 0, offset_gDungeonMaps_PalaceOfWinds_CloudJumps },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_BLOCK_MAZE_TO_BOSS_DOOR, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_BlockMazeToBossDoor },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_CRACKED_FLOOR_LAKITU, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_CrackedFloorLakitu },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_HEART_PIECE_BRIDGE, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_HeartPieceBridge },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_FAN_BRIDGE, 0, 0, offset_gDungeonMaps_PalaceOfWinds_FanBridge },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_TO_FAN_BRIDGE, 0, 0, offset_gDungeonMaps_PalaceOfWinds_ToFanBridge },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_RED_WARP_HALL, 0, 0, offset_gDungeonMaps_PalaceOfWinds_RedWarpHall },
|
||||
{ 0, 0, 0, 0, 0 },
|
||||
};
|
||||
const DungeonLayout gDungeonLayouts_PalaceOfWinds_3F[] = {
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_PLATFORM_CLONE_RIDE, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_PlatformCloneRide },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_PIT_CORNER_AFTER_KEY, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_PitCornerAfterKey },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_PLATFORM_CROW_RIDE, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_PlatformCrowRide },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_GRATE_PLATFORM_RIDE, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_GratePlatformRide },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_POT_PUSH, 0, 0, offset_gDungeonMaps_PalaceOfWinds_PotPush },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_FLOORMASTER_LEVER, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_FloormasterLever },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_MAP, 0, 0, offset_gDungeonMaps_PalaceOfWinds_Map },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_CORNER_TO_MAP, 0, 0, offset_gDungeonMaps_PalaceOfWinds_CornerToMap },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_STAIRS_AFTER_FLOORMASTER, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_StairsAfterFloormaster },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_HOLE_TO_KINSTONE_WIZZROBE, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_HoleToKinstoneWizzrobe },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_KEY_ARROW_BUTTON, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_KeyArrowButton },
|
||||
{ 0, 0, 0, 0, 0 },
|
||||
};
|
||||
const DungeonLayout gDungeonLayouts_PalaceOfWinds_2F[] = {
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_GRATES_TO_3F, 0, 0, offset_gDungeonMaps_PalaceOfWinds_GratesTo3f },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_SPINY_FIGHT, 0, 0, offset_gDungeonMaps_PalaceOfWinds_SpinyFight },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_PEAHAT_SWITCH, 0, 0, offset_gDungeonMaps_PalaceOfWinds_PeahatSwitch },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_WHIRLWIND_BOMBAROSSA, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_WhirlwindBombarossa },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_DOOR_TO_STALFOS_FIREBAR, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_DoorToStalfosFirebar },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_STALFOS_FIREBAR_HOLE, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_StalfosFirebarHole },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_SHORTCUT_DOOR_BUTTONS, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_ShortcutDoorButtons },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_TO_PEAHAT_SWITCH, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_ToPeahatSwitch },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_KINSTONE_WIZZROBE_FIGHT, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_KinstoneWizzrobeFight },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_GIBDO_STAIRS, 0, 0, offset_gDungeonMaps_PalaceOfWinds_GibdoStairs },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_SPIKE_BAR_SMALL_KEY, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_SpikeBarSmallKey },
|
||||
{ 0, 0, 0, 0, 0 },
|
||||
};
|
||||
const DungeonLayout gDungeonLayouts_PalaceOfWinds_1F[] = {
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_DARKNUT_MINIBOSS, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_DarknutMiniboss },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_ROC_CAPE, 0, 0, offset_gDungeonMaps_PalaceOfWinds_RocCape },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_FIRE_BAR_GRATES, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_FireBarGrates },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_PLATFORM_RIDE_BOMBAROSSAS, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_PlatformRideBombarossas },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_BRIDGE_AFTER_DARKNUT, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_BridgeAfterDarknut },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_BRIDGE_SWITCHES_CLONE_BLOCK, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_BridgeSwitchesCloneBlock },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_ENTRANCE_ROOM, 0, 0, offset_gDungeonMaps_PalaceOfWinds_EntranceRoom },
|
||||
{ AREA_PALACE_OF_WINDS, ROOM_PALACE_OF_WINDS_DARK_COMPASS_HALL, 0, 0,
|
||||
offset_gDungeonMaps_PalaceOfWinds_DarkCompassHall },
|
||||
{ 0, 0, 0, 0, 0 },
|
||||
};
|
||||
const DungeonLayout* const gDungeonLayouts_PalaceOfWinds[] = {
|
||||
gDungeonLayouts_PalaceOfWinds_5F, gDungeonLayouts_PalaceOfWinds_4F, gDungeonLayouts_PalaceOfWinds_3F,
|
||||
gDungeonLayouts_PalaceOfWinds_2F, gDungeonLayouts_PalaceOfWinds_1F,
|
||||
};
|
||||
|
||||
const DungeonLayout gDungeonLayouts_DarkHyruleCastle_3F[] = {
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_3F_TOP_LEFT_TOWER, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_3fTopLeftTower },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_3F_TOP_RIGHT_TOWER, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_3fTopRightTower },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_3F_BOTTOM_LEFT_TOWER, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_3fBottomLeftTower },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_3F_BOTTOM_RIGHT_TOWER, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_3fBottomRightTower },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_3F_KEATON_HALL_TO_VAATI, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_3fKeatonHallToVaati },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_3F_TRIPLE_DARKNUT, 2, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_3fTripleDarknut },
|
||||
{ 0, 0, 0, 0, 0 },
|
||||
};
|
||||
const DungeonLayout gDungeonLayouts_DarkHyruleCastle_2F[] = {
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_2F_TOP_LEFT_TOWER, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_2fTopLeftTower },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_2F_TOP_LEFT_CORNER, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_2fTopLeftCorner },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_2F_BOSS_KEY, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_2fBossKey },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_2F_BLUE_WARP, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_2fBlueWarp },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_2F_TOP_RIGHT_CORNER_GHINI, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_2fTopRightCornerGhini },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_2F_TOP_RIGHT_CORNER_TORCHES, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_2fTopRightCornerTorches },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_2F_TOP_RIGHT_TOWER, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_2fTopRightTower },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_2F_TOP_LEFT_DARKNUT, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_2fTopLeftDarknut },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_2F_SPARKS, 0, 0, offset_gDungeonMaps_DarkHyruleCastle_2fSparks },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_2F_TOP_RIGHT_DARKNUTS, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_2fTopRightDarknuts },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_2F_LEFT, 0, 0, offset_gDungeonMaps_DarkHyruleCastle_2fLeft },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_2F_RIGHT, 0, 0, offset_gDungeonMaps_DarkHyruleCastle_2fRight },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_2F_BOTTOM_LEFT_DARKNUTS, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_2fBottomLeftDarknuts },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_2F_BOSS_DOOR, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_2fBossDoor },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_2F_BOTTOM_RIGHT_DARKNUT, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_2fBottomRightDarknut },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_2F_BOTTOM_LEFT_CORNER_PUZZLE, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_2fBottomLeftCornerPuzzle },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_2F_ENTRANCE, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_2fEntrance },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_2F_BOTTOM_RIGHT_CORNER, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_2fBottomRightCorner },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_2F_BOTTOM_LEFT_TOWER, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_2fBottomLeftTower },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_2F_BOTTOM_LEFT_GHINI, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_2fBottomLeftGhini },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_2F_BOTTOM_RIGHT_TOWER, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_2fBottomRightTower },
|
||||
{ 0, 0, 0, 0, 0 },
|
||||
};
|
||||
const DungeonLayout gDungeonLayouts_DarkHyruleCastle_1F[] = {
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_1F_ENTRANCE, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_1fEntrance },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_1F_TOP_LEFT_TOWER, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_1fTopLeftTower },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_1F_THRONE_ROOM, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_1fThroneRoom },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_1F_COMPASS, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_1fCompass },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_1F_TOP_RIGHT_TOWER, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_1fTopRightTower },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_1F_BEFORE_THRONE, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_1fBeforeThrone },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_1F_LOOP_TOP_LEFT, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_1fLoopTopLeft },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_1F_LOOP_TOP, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_1fLoopTop },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_1F_LOOP_TOP_RIGHT, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_1fLoopTopRight },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_1F_LOOP_LEFT, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_1fLoopLeft },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_1F_LOOP_RIGHT, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_1fLoopRight },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_1F_LOOP_BOTTOM_LEFT, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_1fLoopBottomLeft },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_1F_LOOP_BOTTOM, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_1fLoopBottom },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_1F_LOOP_BOTTOM_RIGHT, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_1fLoopBottomRight },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_1F_BOTTOM_LEFT_TOWER, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_1fBottomLeftTower },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_1F_BOTTOM_RIGHT_TOWER, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_1fBottomRightTower },
|
||||
{ 0, 0, 0, 0, 0 },
|
||||
};
|
||||
|
||||
const DungeonLayout gDungeonLayouts_DarkHyruleCastle_B1[] = {
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_B1_ENTRANCE, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_B1Entrance },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_B1_BELOW_THRONE, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_B1BelowThrone },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_B1_BELOW_COMPASS, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_B1BelowCompass },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_B1_BEFORE_THRONE, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_B1BeforeThrone },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_B1_TO_PRISON, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_B1ToPrison },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_B1_BOMB_WALL, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_B1BombWall },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_B1_KEATONS, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_B1Keatons },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_B1_TO_PRISON_FIREBAR, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_B1ToPrisonFirebar },
|
||||
{
|
||||
AREA_DARK_HYRULE_CASTLE,
|
||||
ROOM_DARK_HYRULE_CASTLE_B1_CANNONS,
|
||||
0,
|
||||
0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_B1Cannons,
|
||||
},
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_B1_LEFT, 0, 0, offset_gDungeonMaps_DarkHyruleCastle_B1Left },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_B1_RIGHT, 0, 0, offset_gDungeonMaps_DarkHyruleCastle_B1Right },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_B1_MAP, 0, 0, offset_gDungeonMaps_DarkHyruleCastle_B1Map },
|
||||
{ 0, 0, 0, 0, 0 },
|
||||
};
|
||||
const DungeonLayout gDungeonLayouts_DarkHyruleCastle_B2[] = {
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_B2_TO_PRISON, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_B2ToPrison },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_B2_PRISON, 0, 0, offset_gDungeonMaps_DarkHyruleCastle_B2Prison },
|
||||
{ AREA_DARK_HYRULE_CASTLE, ROOM_DARK_HYRULE_CASTLE_B2_DROPDOWN, 0, 0,
|
||||
offset_gDungeonMaps_DarkHyruleCastle_B2Dropdown },
|
||||
{ 0, 0, 0, 0, 0 },
|
||||
};
|
||||
|
||||
const DungeonLayout* const gDungeonLayouts_DarkHyruleCastle[] = {
|
||||
gDungeonLayouts_DarkHyruleCastle_3F, gDungeonLayouts_DarkHyruleCastle_2F, gDungeonLayouts_DarkHyruleCastle_1F,
|
||||
gDungeonLayouts_DarkHyruleCastle_B1, gDungeonLayouts_DarkHyruleCastle_B2,
|
||||
};
|
||||
|
||||
const DungeonLayout* const* const gDungeonLayouts[] = {
|
||||
gDungeonLayouts_None,
|
||||
gDungeonLayouts_DeepwoodShrine,
|
||||
gDungeonLayouts_CaveOfFlames,
|
||||
gDungeonLayouts_FortressOfWinds,
|
||||
gDungeonLayouts_TempleOfDroplets,
|
||||
gDungeonLayouts_PalaceOfWinds,
|
||||
gDungeonLayouts_DarkHyruleCastle,
|
||||
};
|
||||
|
||||
const DungeonFloorMetadata gDungeonFloorMetadatas[] = {
|
||||
{ 1, 2, 2 }, { 3, 3, 3 }, { 4, 3, 0 }, { 3, 5, 5 }, { 3, 2, 2 }, { 5, 7, 7 }, { 5, 5, 5 }, { 1, 3, 3 },
|
||||
{ 1, 3, 3 }, { 1, 3, 3 }, { 1, 3, 3 }, { 1, 3, 3 }, { 1, 3, 3 }, { 1, 3, 3 }, { 1, 3, 3 }, { 1, 3, 3 },
|
||||
};
|
||||
|
||||
+5
-4
@@ -15,6 +15,7 @@
|
||||
#include "npc.h"
|
||||
#include "object.h"
|
||||
#include "screen.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void sub_08051F78(void);
|
||||
void sub_08051FF0(void);
|
||||
@@ -43,7 +44,7 @@ void CutsceneMain_Init(void) {
|
||||
void sub_080535AC(void) {
|
||||
gMenu.overlayType = 1;
|
||||
gMenu.transitionTimer = 120;
|
||||
gUI.field_0x6 = 1;
|
||||
gUI.loadGfxOnRestore = TRUE;
|
||||
gUpdateVisibleTiles = 1;
|
||||
gScreen.lcd.displayControl &= 0xfeff;
|
||||
LoadRoomEntityList(gUnk_080FCB94);
|
||||
@@ -216,7 +217,7 @@ void sub_08053758(void) {
|
||||
gMenu.transitionTimer = 120;
|
||||
gMenu.field_0xa = 0x1e;
|
||||
*((u8*)&gMenu + 0x10) = 0; // TODO
|
||||
gUI.field_0x6 = 1;
|
||||
gUI.loadGfxOnRestore = TRUE;
|
||||
gMapBottom.bgSettings = NULL;
|
||||
gMapTop.bgSettings = NULL;
|
||||
gRoomControls.camera_target = NULL;
|
||||
@@ -595,10 +596,10 @@ void sub_08053D34(void) {
|
||||
if (gMenu.field_0xa != 0) {
|
||||
gMenu.field_0xa = 0;
|
||||
if (CheckLocalFlagByBank(FLAG_BANK_7, 0x3d)) {
|
||||
SetTileType(0x74, 0xc4, 1);
|
||||
SetTileType(TILE_TYPE_116, TILE_POS(4, 3), LAYER_BOTTOM);
|
||||
}
|
||||
if (CheckLocalFlagByBank(FLAG_BANK_7, 0x3e)) {
|
||||
SetTileType(0x74, 0xcc, 1);
|
||||
SetTileType(TILE_TYPE_116, TILE_POS(12, 3), LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
if (gFadeControl.active == 0) {
|
||||
|
||||
@@ -0,0 +1,187 @@
|
||||
#include "flags.h"
|
||||
#include "game.h"
|
||||
#include "message.h"
|
||||
#include "sound.h"
|
||||
|
||||
#ifdef EU
|
||||
#define OVERWORLD_FLAGS AR_IS_OVERWORLD
|
||||
#else
|
||||
#define OVERWORLD_FLAGS AR_IS_OVERWORLD | AR_ALLOWS_WARP
|
||||
#endif
|
||||
|
||||
const AreaHeader gAreaMetadata[] = {
|
||||
{ OVERWORLD_FLAGS, 18, LOCAL_BANK_1, BGM_MINISH_WOODS },
|
||||
{ 0, 20, LOCAL_BANK_2, BGM_MINISH_VILLAGE },
|
||||
{ OVERWORLD_FLAGS, 10, LOCAL_BANK_1, BGM_HYRULE_TOWN },
|
||||
{ OVERWORLD_FLAGS, 0, LOCAL_BANK_1, BGM_HYRULE_FIELD },
|
||||
{ OVERWORLD_FLAGS, 3, LOCAL_BANK_1, BGM_CASTOR_WILDS },
|
||||
{ OVERWORLD_FLAGS, 4, LOCAL_BANK_1, BGM_WIND_RUINS },
|
||||
{ OVERWORLD_FLAGS, 1, LOCAL_BANK_1, BGM_MT_CRENEL },
|
||||
{ OVERWORLD_FLAGS, 8, LOCAL_BANK_1, BGM_HYRULE_CASTLE },
|
||||
{ OVERWORLD_FLAGS, 16, LOCAL_BANK_1, BGM_CLOUD_TOPS },
|
||||
{ OVERWORLD_FLAGS, 5, LOCAL_BANK_1, BGM_ROYAL_VALLEY },
|
||||
{ OVERWORLD_FLAGS, 13, LOCAL_BANK_1, BGM_HYRULE_FIELD },
|
||||
{ OVERWORLD_FLAGS, 17, LOCAL_BANK_1, BGM_HYRULE_FIELD },
|
||||
{ AR_IS_MOLE_CAVE, 0, LOCAL_BANK_3, BGM_DIGGING_CAVE },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_3, BGM_CLOUD_TOPS },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ AR_IS_MOLE_CAVE, 0, LOCAL_BANK_3, BGM_DIGGING_CAVE },
|
||||
{ 0, 21, LOCAL_BANK_2, BGM_MINISH_VILLAGE },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_3, BGM_HYRULE_FIELD },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_3, BGM_HYRULE_FIELD },
|
||||
{ AR_IS_MOLE_CAVE, 0, LOCAL_BANK_3, BGM_DIGGING_CAVE },
|
||||
{ AR_IS_MOLE_CAVE, 0, LOCAL_BANK_3, BGM_DIGGING_CAVE },
|
||||
{ OVERWORLD_FLAGS, 10, LOCAL_BANK_1, BGM_PICORI_FESTIVAL },
|
||||
{ AR_IS_MOLE_CAVE, 0, LOCAL_BANK_3, BGM_DIGGING_CAVE },
|
||||
{ AR_IS_MOLE_CAVE, 0, LOCAL_BANK_3, BGM_DIGGING_CAVE },
|
||||
{ AR_HAS_KEYS | AR_IS_MOLE_CAVE, 26, LOCAL_BANK_3, BGM_FORTRESS_OF_WINDS },
|
||||
{ AR_IS_MOLE_CAVE, 0, LOCAL_BANK_3, BGM_DIGGING_CAVE },
|
||||
{ OVERWORLD_FLAGS, 12, LOCAL_BANK_1, BGM_HYRULE_FIELD },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, LOCAL_BANK_2, BGM_HOUSE },
|
||||
{ AR_HAS_ENEMIES, 0, LOCAL_BANK_2, BGM_HOUSE },
|
||||
{ AR_HAS_ENEMIES, 0, LOCAL_BANK_2, BGM_HOUSE },
|
||||
{ AR_HAS_ENEMIES, 0, LOCAL_BANK_2, BGM_HOUSE },
|
||||
{ AR_HAS_ENEMIES, 0, LOCAL_BANK_2, BGM_HOUSE },
|
||||
{ AR_HAS_ENEMIES, 0, LOCAL_BANK_4, BGM_HOUSE },
|
||||
{ AR_HAS_ENEMIES, 0, LOCAL_BANK_4, BGM_DUNGEON },
|
||||
{ AR_HAS_ENEMIES, 0, LOCAL_BANK_2, BGM_HOUSE },
|
||||
{ AR_HAS_ENEMIES, 0, LOCAL_BANK_2, BGM_HOUSE },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_2, BGM_FAIRY_FOUNTAIN },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_4, BGM_DUNGEON },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_4, BGM_DUNGEON },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_3, BGM_DUNGEON },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_2, BGM_HOUSE },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_3, BGM_HOUSE },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_4, BGM_DUNGEON },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_2, BGM_HOUSE },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_2, BGM_ELEMENT_THEME },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_4, BGM_DUNGEON },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_4, BGM_DUNGEON },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_4, BGM_DUNGEON },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_4, BGM_DUNGEON },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_4, BGM_DUNGEON },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_4, BGM_DUNGEON },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_2, BGM_HOUSE },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ AR_IS_DUNGEON, 0, LOCAL_BANK_3, BGM_DUNGEON },
|
||||
{ AR_IS_DUNGEON, 0, LOCAL_BANK_3, BGM_DUNGEON },
|
||||
{ AR_IS_DUNGEON, 0, LOCAL_BANK_3, BGM_SECRET_CASTLE_ENTRANCE },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_G, BGM_SECRET_CASTLE_ENTRANCE },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_G, BGM_SECRET_CASTLE_ENTRANCE },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_G, BGM_SECRET_CASTLE_ENTRANCE },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_G, BGM_SECRET_CASTLE_ENTRANCE },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP, 24, LOCAL_BANK_5, BGM_DEEPWOOD_SHRINE },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP, 24, LOCAL_BANK_5, BGM_DEEPWOOD_SHRINE },
|
||||
{ 0, 0, LOCAL_BANK_5, BGM_MINISH_WOODS },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_5, BGM_DEEPWOOD_SHRINE },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP, 25, LOCAL_BANK_6, BGM_CAVE_OF_FLAMES },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP, 25, LOCAL_BANK_6, BGM_CAVE_OF_FLAMES },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP, 25, LOCAL_BANK_6, BGM_CAVE_OF_FLAMES },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP, 26, LOCAL_BANK_7, BGM_FORTRESS_OF_WINDS },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP | AR_HAS_NO_ENEMIES, 26, LOCAL_BANK_7, BGM_FORTRESS_OF_WINDS },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP | AR_HAS_NO_ENEMIES, 26, LOCAL_BANK_7, BGM_BOSS_THEME },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP, 26, LOCAL_BANK_7, BGM_FORTRESS_OF_WINDS },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP, 27, LOCAL_BANK_8, BGM_TEMPLE_OF_DROPLETS },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ AR_IS_DUNGEON, 0, LOCAL_BANK_3, BGM_DUNGEON },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP, 27, LOCAL_BANK_8, BGM_TEMPLE_OF_DROPLETS },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON, 30, LOCAL_BANK_3, BGM_ROYAL_CRYPT },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON, 30, LOCAL_BANK_3, BGM_ROYAL_CRYPT },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP, 28, LOCAL_BANK_9, BGM_PALACE_OF_WINDS },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP | AR_HAS_NO_ENEMIES, 28, LOCAL_BANK_9, BGM_BOSS_THEME },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP, 28, LOCAL_BANK_9, BGM_PALACE_OF_WINDS },
|
||||
{ AR_HAS_NO_ENEMIES, 19, LOCAL_BANK_3, BGM_ELEMENTAL_SANCTUARY },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_3, BGM_ELEMENTAL_SANCTUARY },
|
||||
{ AR_HAS_NO_ENEMIES, 22, LOCAL_BANK_1, BGM_HYRULE_CASTLE },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_1, BGM_HYRULE_CASTLE },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ AR_HAS_NO_ENEMIES, 0, LOCAL_BANK_3, BGM_HYRULE_CASTLE },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP, 29, LOCAL_BANK_10, BGM_DARK_HYRULE_CASTLE },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP | AR_HAS_NO_ENEMIES, 29, LOCAL_BANK_10, BGM_DARK_HYRULE_CASTLE },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP | AR_HAS_NO_ENEMIES, 29, LOCAL_BANK_10, BGM_VAATI_WRATH },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP | AR_HAS_NO_ENEMIES, 29, LOCAL_BANK_10, BGM_VAATI_WRATH },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP | AR_HAS_NO_ENEMIES, 29, LOCAL_BANK_10, BGM_VAATI_TRANSFIGURED },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP | AR_HAS_NO_ENEMIES, 29, LOCAL_BANK_10, BGM_DARK_HYRULE_CASTLE },
|
||||
{ 0, 0, 0, 0 },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP, 29, LOCAL_BANK_3, BGM_DARK_HYRULE_CASTLE },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP, 0, LOCAL_BANK_12, BGM_ROYAL_CRYPT },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP, 0, LOCAL_BANK_12, BGM_ROYAL_CRYPT },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP, 0, LOCAL_BANK_12, BGM_ROYAL_CRYPT },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP, 0, LOCAL_BANK_12, BGM_ROYAL_CRYPT },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP, 0, LOCAL_BANK_12, BGM_ROYAL_CRYPT },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP, 0, LOCAL_BANK_12, BGM_ROYAL_CRYPT },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP, 0, LOCAL_BANK_12, BGM_ROYAL_CRYPT },
|
||||
{ AR_HAS_KEYS | AR_IS_DUNGEON | AR_HAS_MAP, 0, LOCAL_BANK_12, BGM_ROYAL_CRYPT },
|
||||
{ 0, 0, 0, 0 },
|
||||
};
|
||||
|
||||
const OverworldLocation gOverworldLocations[] = {
|
||||
{ 0, 0, 62, 74, 0, TEXT_INDEX(TEXT_WINDCRESTS, 0x0b) },
|
||||
{ 0, 75, 62, 104, 1, TEXT_INDEX(TEXT_WINDCRESTS, 0x0c) },
|
||||
{ 0, 105, 62, 164, 2, TEXT_INDEX(TEXT_WINDCRESTS, 0x0d) },
|
||||
{ 0, 165, 62, 197, 3, TEXT_INDEX(TEXT_WINDCRESTS, 0x0e) },
|
||||
{ 63, 0, 92, 74, 4, TEXT_INDEX(TEXT_WINDCRESTS, 0x0f) },
|
||||
{ 63, 75, 92, 134, 5, TEXT_INDEX(TEXT_WINDCRESTS, 0x10) },
|
||||
{ 63, 135, 92, 197, 6, TEXT_INDEX(TEXT_WINDCRESTS, 0x11) },
|
||||
{ 93, 0, 155, 44, 7, TEXT_INDEX(TEXT_WINDCRESTS, 0x12) },
|
||||
{ 93, 45, 155, 94, 8, TEXT_INDEX(TEXT_WINDCRESTS, 0x13) },
|
||||
{ 93, 95, 155, 154, 9, TEXT_INDEX(TEXT_WINDCRESTS, 0x14) },
|
||||
{ 93, 155, 155, 197, 10, TEXT_INDEX(TEXT_WINDCRESTS, 0x15) },
|
||||
{ 156, 0, 185, 74, 11, TEXT_INDEX(TEXT_WINDCRESTS, 0x17) },
|
||||
{ 156, 75, 200, 134, 12, TEXT_INDEX(TEXT_WINDCRESTS, 0x18) },
|
||||
{ 156, 135, 185, 197, 13, TEXT_INDEX(TEXT_WINDCRESTS, 0x19) },
|
||||
{ 186, 0, 248, 62, 14, TEXT_INDEX(TEXT_WINDCRESTS, 0x1a) },
|
||||
{ 186, 63, 248, 134, 15, TEXT_INDEX(TEXT_WINDCRESTS, 0x1b) },
|
||||
{ 186, 135, 248, 197, 16, TEXT_INDEX(TEXT_WINDCRESTS, 0x1c) },
|
||||
{ 255, 255, 255, 255, 99, TEXT_INDEX(TEXT_WINDCRESTS, 0x0b) },
|
||||
};
|
||||
@@ -0,0 +1,247 @@
|
||||
#include "assets/map_offsets.h"
|
||||
#include "map.h"
|
||||
|
||||
/*
|
||||
Tiles for the borders of the cave that are loaded during the transition.
|
||||
When the player goes inside a cave during the start of the enter transition the border tileMap is loaded and at the
|
||||
end the tileMap for the cave is loaded. When the player goes out of a cave during the start of the leave transition
|
||||
the border tileMap is loaded and at the end the tileMap for the outside is loaded.
|
||||
*/
|
||||
|
||||
const MapDataDefinition gCaveBorder_LakeWoods_enter_start[] = {
|
||||
{ offset_gCaveBorder_LakeWoods_outside, gMapTop.mapData, MAP_COMPRESSED | 7938 },
|
||||
};
|
||||
const MapDataDefinition gCaveBorder_LakeWoods_enter_end[] = {
|
||||
{ MAP_MULTIPLE | offset_gAreaRoomMap_LakeWoodsCave_Main_bottom, gMapBottom.mapData, MAP_COMPRESSED | 7938 },
|
||||
{ offset_gAreaRoomMap_LakeWoodsCave_Main_top, gMapTop.mapData, MAP_COMPRESSED | 7938 },
|
||||
};
|
||||
const MapDataDefinition* const gCaveBorder_LakeWoods_enter[] = {
|
||||
gCaveBorder_LakeWoods_enter_start,
|
||||
gCaveBorder_LakeWoods_enter_end,
|
||||
};
|
||||
|
||||
const MapDataDefinition gCaveBorder_LakeWoods_leave_start[] = {
|
||||
{ offset_gCaveBorder_LakeWoods_inside, gMapTop.mapData, MAP_COMPRESSED | 7938 },
|
||||
};
|
||||
const MapDataDefinition gCaveBorder_LakeWoods_leave_end[] = {
|
||||
{ MAP_MULTIPLE | offset_gAreaRoomMap_MinishWoods_Main_bottom, gMapBottom.mapData, MAP_COMPRESSED | 7938 },
|
||||
{ offset_gAreaRoomMap_MinishWoods_Main_top, gMapTop.mapData, MAP_COMPRESSED | 7938 },
|
||||
};
|
||||
const MapDataDefinition* const gCaveBorder_LakeWoods_leave[] = {
|
||||
gCaveBorder_LakeWoods_leave_start,
|
||||
gCaveBorder_LakeWoods_leave_end,
|
||||
};
|
||||
|
||||
const MapDataDefinition gCaveBorder_HyruleTown_enter_start[] = {
|
||||
{ offset_gCaveBorder_HyruleTown_outside, gMapTop.mapData, MAP_COMPRESSED | 7560 },
|
||||
};
|
||||
const MapDataDefinition gCaveBorder_HyruleTown_enter_end[] = {
|
||||
{ MAP_MULTIPLE | offset_gAreaRoomMap_HyruleDigCaves_Town_bottom, gMapBottom.mapData, MAP_COMPRESSED | 7560 },
|
||||
{ offset_gAreaRoomMap_HyruleDigCaves_Town_top, gMapTop.mapData, MAP_COMPRESSED | 7560 },
|
||||
};
|
||||
const MapDataDefinition* const gCaveBorder_HyruleTown_enter[] = {
|
||||
gCaveBorder_HyruleTown_enter_start,
|
||||
gCaveBorder_HyruleTown_enter_end,
|
||||
};
|
||||
|
||||
const MapDataDefinition gCaveBorder_HyruleTown_leave_start[] = {
|
||||
{ offset_gCaveBorder_HyruleTown_inside, gMapTop.mapData, MAP_COMPRESSED | 7560 },
|
||||
};
|
||||
const MapDataDefinition gCaveBorder_HyruleTown_leave_end[] = {
|
||||
{ MAP_MULTIPLE | offset_gAreaRoomMap_HyruleTown_Main_bottom, gMapBottom.mapData, MAP_COMPRESSED | 7560 },
|
||||
{ offset_gAreaRoomMap_HyruleTown_Main_top, gMapTop.mapData, MAP_COMPRESSED | 7560 },
|
||||
};
|
||||
const MapDataDefinition* const gCaveBorder_HyruleTown_leave[] = {
|
||||
gCaveBorder_HyruleTown_leave_start,
|
||||
gCaveBorder_HyruleTown_leave_end,
|
||||
};
|
||||
|
||||
const MapDataDefinition gCaveBorder_EasternHills_enter_start[] = {
|
||||
{ offset_gCaveBorder_EasternHills_outside, gMapTop.mapData, MAP_COMPRESSED | 2040 },
|
||||
};
|
||||
const MapDataDefinition gCaveBorder_EasternHills_enter_end[] = {
|
||||
{ MAP_MULTIPLE | offset_gAreaRoomMap_DigCaves_EasternHills_bottom, gMapBottom.mapData, MAP_COMPRESSED | 2040 },
|
||||
{ offset_gAreaRoomMap_DigCaves_EasternHills_top, gMapTop.mapData, MAP_COMPRESSED | 2040 },
|
||||
};
|
||||
const MapDataDefinition* const gCaveBorder_EasternHills_enter[] = {
|
||||
gCaveBorder_EasternHills_enter_start,
|
||||
gCaveBorder_EasternHills_enter_end,
|
||||
};
|
||||
|
||||
const MapDataDefinition gCaveBorder_EasternHills_leave_start[] = {
|
||||
{ offset_gCaveBorder_EasternHills_inside, gMapTop.mapData, MAP_COMPRESSED | 2040 },
|
||||
};
|
||||
const MapDataDefinition gCaveBorder_EasternHills_leave_end[] = {
|
||||
{ MAP_MULTIPLE | offset_gAreaRoomMap_HyruleField_EasternHillsNorth_bottom, gMapBottom.mapData,
|
||||
MAP_COMPRESSED | 2040 },
|
||||
{ offset_gAreaRoomMap_HyruleField_EasternHillsNorth_top, gMapTop.mapData, MAP_COMPRESSED | 2040 },
|
||||
};
|
||||
const MapDataDefinition* const gCaveBorder_EasternHills_leave[] = {
|
||||
gCaveBorder_EasternHills_leave_start,
|
||||
gCaveBorder_EasternHills_leave_end,
|
||||
};
|
||||
|
||||
const MapDataDefinition gCaveBorder_Crenel_enter_start[] = {
|
||||
{ offset_gCaveBorder_Crenel_outside, gMapTop.mapData, MAP_COMPRESSED | 1824 },
|
||||
};
|
||||
const MapDataDefinition gCaveBorder_Crenel_enter_end[] = {
|
||||
{ MAP_MULTIPLE | offset_gAreaRoomMap_CrenelDigCave_0_bottom, gMapBottom.mapData, MAP_COMPRESSED | 1984 },
|
||||
{ offset_gAreaRoomMap_CrenelDigCave_0_top, gMapTop.mapData, MAP_COMPRESSED | 1984 },
|
||||
};
|
||||
const MapDataDefinition* const gCaveBorder_Crenel_enter[] = {
|
||||
gCaveBorder_Crenel_enter_start,
|
||||
gCaveBorder_Crenel_enter_end,
|
||||
};
|
||||
|
||||
const MapDataDefinition gCaveBorder_Crenel_leave_start[] = {
|
||||
{ offset_gCaveBorder_Crenel_inside, gMapTop.mapData, MAP_COMPRESSED | 1984 },
|
||||
};
|
||||
const MapDataDefinition gCaveBorder_Crenel_leave_end[] = {
|
||||
{ MAP_MULTIPLE | offset_gAreaRoomMap_MtCrenel_WallClimb_bottom, gMapBottom.mapData, MAP_COMPRESSED | 1824 },
|
||||
{ offset_gAreaRoomMap_MtCrenel_WallClimb_top, gMapTop.mapData, MAP_COMPRESSED | 1824 },
|
||||
};
|
||||
const MapDataDefinition* const gCaveBorder_Crenel_leave[] = {
|
||||
gCaveBorder_Crenel_leave_start,
|
||||
gCaveBorder_Crenel_leave_end,
|
||||
};
|
||||
|
||||
const MapDataDefinition gCaveBorder_VeilFalls_enter_start[] = {
|
||||
{ offset_gCaveBorder_VeilFalls_outside, gMapTop.mapData, MAP_COMPRESSED | 3780 },
|
||||
};
|
||||
const MapDataDefinition gCaveBorder_VeilFalls_enter_end[] = {
|
||||
{ MAP_MULTIPLE | offset_gAreaRoomMap_VeilFallsDigCave_0_bottom, gMapBottom.mapData, MAP_COMPRESSED | 3780 },
|
||||
{ offset_gAreaRoomMap_VeilFallsDigCave_0_top, gMapTop.mapData, MAP_COMPRESSED | 3780 },
|
||||
};
|
||||
const MapDataDefinition* const gCaveBorder_VeilFalls_enter[] = {
|
||||
gCaveBorder_VeilFalls_enter_start,
|
||||
gCaveBorder_VeilFalls_enter_end,
|
||||
};
|
||||
|
||||
const MapDataDefinition gCaveBorder_VeilFalls_leave_start[] = {
|
||||
{ offset_gCaveBorder_VeilFalls_inside, gMapTop.mapData, MAP_COMPRESSED | 3780 },
|
||||
};
|
||||
const MapDataDefinition gCaveBorder_VeilFalls_leave_end[] = {
|
||||
{ MAP_MULTIPLE | offset_gAreaRoomMap_VeilFalls_Main_bottom, gMapBottom.mapData, MAP_COMPRESSED | 3780 },
|
||||
{ offset_gAreaRoomMap_VeilFalls_Main_top, gMapTop.mapData, MAP_COMPRESSED | 3780 },
|
||||
};
|
||||
const MapDataDefinition* const gCaveBorder_VeilFalls_leave[] = {
|
||||
gCaveBorder_VeilFalls_leave_start,
|
||||
gCaveBorder_VeilFalls_leave_end,
|
||||
};
|
||||
|
||||
const MapDataDefinition gCaveBorder_TrilbyHighlands_enter_start[] = {
|
||||
{ offset_gCaveBorder_TrilbyHighlands_outside, gMapTop.mapData, MAP_COMPRESSED | 3600 },
|
||||
};
|
||||
const MapDataDefinition gCaveBorder_TrilbyHighlands_enter_end[] = {
|
||||
{ MAP_MULTIPLE | offset_gAreaRoomMap_DigCaves_TrilbyHighlands_bottom, gMapBottom.mapData, MAP_COMPRESSED | 3600 },
|
||||
{ offset_gAreaRoomMap_DigCaves_TrilbyHighlands_top, gMapTop.mapData, MAP_COMPRESSED | 3600 },
|
||||
};
|
||||
const MapDataDefinition* const gCaveBorder_TrilbyHighlands_enter[] = {
|
||||
gCaveBorder_TrilbyHighlands_enter_start,
|
||||
gCaveBorder_TrilbyHighlands_enter_end,
|
||||
};
|
||||
|
||||
const MapDataDefinition gCaveBorder_TrilbyHighlands_leave_start[] = {
|
||||
{ offset_gCaveBorder_TrilbyHighlands_inside, gMapTop.mapData, MAP_COMPRESSED | 3600 },
|
||||
};
|
||||
const MapDataDefinition gCaveBorder_TrilbyHighlands_leave_end[] = {
|
||||
{ MAP_MULTIPLE | offset_gAreaRoomMap_HyruleField_TrilbyHighlands_bottom, gMapBottom.mapData,
|
||||
MAP_COMPRESSED | 3600 },
|
||||
{ offset_gAreaRoomMap_HyruleField_TrilbyHighlands_top, gMapTop.mapData, MAP_COMPRESSED | 3600 },
|
||||
};
|
||||
const MapDataDefinition* const gCaveBorder_TrilbyHighlands_leave[] = {
|
||||
gCaveBorder_TrilbyHighlands_leave_start,
|
||||
gCaveBorder_TrilbyHighlands_leave_end,
|
||||
};
|
||||
|
||||
const MapDataDefinition gCaveBorder_CastorWilds_enter_start[] = {
|
||||
{ offset_gCaveBorder_CastorWilds_outside, gMapTop.mapData, MAP_COMPRESSED | 7560 },
|
||||
};
|
||||
const MapDataDefinition gCaveBorder_CastorWilds_enter_end[] = {
|
||||
{ MAP_MULTIPLE | offset_gAreaRoomMap_CastorWildsDigCave_0_bottom, gMapBottom.mapData, MAP_COMPRESSED | 7560 },
|
||||
{ offset_gAreaRoomMap_CastorWildsDigCave_0_top, gMapTop.mapData, MAP_COMPRESSED | 7560 },
|
||||
};
|
||||
const MapDataDefinition* const gCaveBorder_CastorWilds_enter[] = {
|
||||
gCaveBorder_CastorWilds_enter_start,
|
||||
gCaveBorder_CastorWilds_enter_end,
|
||||
};
|
||||
|
||||
const MapDataDefinition gCaveBorder_CastorWilds_leave_start[] = {
|
||||
{ offset_gCaveBorder_CastorWilds_inside, gMapTop.mapData, MAP_COMPRESSED | 7560 },
|
||||
};
|
||||
const MapDataDefinition gCaveBorder_CastorWilds_leave_end[] = {
|
||||
{ MAP_MULTIPLE | offset_gAreaRoomMap_CastorWilds_Main_bottom, gMapBottom.mapData, MAP_COMPRESSED | 7560 },
|
||||
{ offset_gAreaRoomMap_CastorWilds_Main_top, gMapTop.mapData, MAP_COMPRESSED | 7560 },
|
||||
};
|
||||
const MapDataDefinition* const gCaveBorder_CastorWilds_leave[] = {
|
||||
gCaveBorder_CastorWilds_leave_start,
|
||||
gCaveBorder_CastorWilds_leave_end,
|
||||
};
|
||||
|
||||
const MapDataDefinition gCaveBorder_LakeHyliaNorth_enter_start[] = {
|
||||
{ offset_gCaveBorder_LakeHyliaNorth_outside, gMapTop.mapData, MAP_COMPRESSED | 5760 },
|
||||
};
|
||||
const MapDataDefinition gCaveBorder_LakeHyliaNorth_enter_end[] = {
|
||||
{ MAP_MULTIPLE | offset_gAreaRoomMap_HyliaDigCaves_1_bottom, gMapBottom.mapData, MAP_COMPRESSED | 3402 },
|
||||
{ offset_gAreaRoomMap_HyliaDigCaves_1_top, gMapTop.mapData, MAP_COMPRESSED | 3402 },
|
||||
};
|
||||
const MapDataDefinition* const gCaveBorder_LakeHyliaNorth_enter[] = {
|
||||
gCaveBorder_LakeHyliaNorth_enter_start,
|
||||
gCaveBorder_LakeHyliaNorth_enter_end,
|
||||
};
|
||||
|
||||
const MapDataDefinition gCaveBorder_LakeHyliaNorth_leave_start[] = {
|
||||
{ offset_gCaveBorder_LakeHyliaNorth_inside, gMapTop.mapData, MAP_COMPRESSED | 3402 },
|
||||
};
|
||||
const MapDataDefinition gCaveBorder_LakeHyliaNorth_leave_end[] = {
|
||||
{ MAP_MULTIPLE | offset_gAreaRoomMap_LakeHylia_Main_bottom, gMapBottom.mapData, MAP_COMPRESSED | 5760 },
|
||||
{ offset_gAreaRoomMap_LakeHylia_Main_top, gMapTop.mapData, MAP_COMPRESSED | 5760 },
|
||||
};
|
||||
const MapDataDefinition* const gCaveBorder_LakeHyliaNorth_leave[] = {
|
||||
gCaveBorder_LakeHyliaNorth_leave_start,
|
||||
gCaveBorder_LakeHyliaNorth_leave_end,
|
||||
};
|
||||
|
||||
const MapDataDefinition gCaveBorder_LonLonRanch_enter_start[] = {
|
||||
{ offset_gCaveBorder_LonLonRanch_outside, gMapTop.mapData, MAP_COMPRESSED | 7938 },
|
||||
};
|
||||
const MapDataDefinition* const gCaveBorder_LonLonRanch_enter[] = {
|
||||
gCaveBorder_LonLonRanch_enter_start,
|
||||
gCaveBorder_LakeHyliaNorth_enter_end,
|
||||
};
|
||||
|
||||
const MapDataDefinition gCaveBorder_LonLonRanch_leave_end[] = {
|
||||
{ MAP_MULTIPLE | offset_gAreaRoomMap_HyruleField_LonLonRanch_bottom, gMapBottom.mapData, MAP_COMPRESSED | 5400 },
|
||||
{ offset_gAreaRoomMap_HyruleField_LonLonRanch_top, gMapTop.mapData, MAP_COMPRESSED | 5400 },
|
||||
};
|
||||
const MapDataDefinition* const gCaveBorder_LonLonRanch_leave[] = {
|
||||
gCaveBorder_LakeHyliaNorth_leave_start,
|
||||
gCaveBorder_LonLonRanch_leave_end,
|
||||
};
|
||||
|
||||
const MapDataDefinition gCaveBorder_LakeHyliaCenter_enter_end[] = {
|
||||
{ MAP_MULTIPLE | offset_gAreaRoomMap_HyliaDigCaves_0_bottom, gMapBottom.mapData, MAP_COMPRESSED | 544 },
|
||||
{ offset_gAreaRoomMap_HyliaDigCaves_0_top, gMapTop.mapData, MAP_COMPRESSED | 544 },
|
||||
};
|
||||
const MapDataDefinition* const gCaveBorder_LakeHyliaCenter_enter[] = {
|
||||
gCaveBorder_LakeHyliaNorth_enter_start,
|
||||
gCaveBorder_LakeHyliaCenter_enter_end,
|
||||
};
|
||||
|
||||
const MapDataDefinition gCaveBorder_LakeHyliaCenter_leave_start[] = {
|
||||
{ offset_gCaveBorder_LakeHyliaCenter_inside, gMapTop.mapData, MAP_COMPRESSED | 544 },
|
||||
};
|
||||
const MapDataDefinition* const gCaveBorder_LakeHyliaCenter_leave[] = {
|
||||
gCaveBorder_LakeHyliaCenter_leave_start,
|
||||
gCaveBorder_LakeHyliaNorth_leave_end,
|
||||
};
|
||||
|
||||
const MapDataDefinition* const* const gCaveBorderMapData[] = {
|
||||
gCaveBorder_LakeWoods_enter, gCaveBorder_LakeWoods_leave, gCaveBorder_HyruleTown_enter,
|
||||
gCaveBorder_HyruleTown_leave, gCaveBorder_EasternHills_enter, gCaveBorder_EasternHills_leave,
|
||||
gCaveBorder_Crenel_enter, gCaveBorder_Crenel_leave, gCaveBorder_VeilFalls_enter,
|
||||
gCaveBorder_VeilFalls_leave, gCaveBorder_TrilbyHighlands_enter, gCaveBorder_TrilbyHighlands_leave,
|
||||
gCaveBorder_CastorWilds_enter, gCaveBorder_CastorWilds_leave, gCaveBorder_LakeHyliaNorth_enter,
|
||||
gCaveBorder_LakeHyliaNorth_leave, gCaveBorder_LonLonRanch_enter, gCaveBorder_LonLonRanch_leave,
|
||||
gCaveBorder_LakeHyliaCenter_enter, gCaveBorder_LakeHyliaCenter_leave,
|
||||
};
|
||||
@@ -0,0 +1,99 @@
|
||||
#include "asm.h"
|
||||
#include "player.h"
|
||||
|
||||
const KeyValuePair gUnk_080046A4[] = {
|
||||
{ 63, 1 }, { 80, 2 }, { 69, 8 }, { 70, 9 }, { 71, 10 }, { 72, 11 }, { 73, 12 }, { 74, 13 },
|
||||
{ 75, 14 }, { 76, 15 }, { 77, 16 }, { 65, 1 }, { 82, 2 }, { 68, 17 }, { 79, 18 }, { 372, 19 },
|
||||
{ 117, 23 }, { 67, 3 }, { 66, 4 }, { 64, 5 }, { 81, 6 }, { 85, 20 }, { 92, 21 }, { 87, 20 },
|
||||
{ 94, 21 }, { 86, 28 }, { 93, 29 }, { 88, 30 }, { 89, 31 }, { 90, 32 }, { 91, 22 }, { 9, 36 },
|
||||
{ 12, 37 }, { 13, 36 }, { 15, 38 }, { 14, 39 }, { 16, 36 }, { 17, 36 }, { 18, 36 }, { 20, 37 },
|
||||
{ 21, 36 }, { 23, 38 }, { 22, 39 }, { 24, 36 }, { 25, 36 }, { 10, 40 }, { 39, 40 }, { 28, 36 },
|
||||
{ 42, 36 }, { 29, 36 }, { 43, 36 }, { 97, 44 }, { 101, 45 }, { 353, 47 }, { 355, 48 }, { 16384, 25 },
|
||||
{ 16480, 26 }, { 374, 49 }, { 843, 33 }, { 844, 34 }, { 375, 50 }, { 871, 51 }, { 872, 52 }, { 16490, 24 },
|
||||
{ 105, 41 }, { 106, 42 }, { 111, 43 }, { 109, 53 }, { 110, 54 }, { 78, 7 }, { 389, 36 }, { 390, 36 },
|
||||
{ 391, 36 }, { 392, 36 }, { 393, 36 }, { 394, 36 }, { 398, 36 }, { 399, 36 }, { 403, 36 }, { 404, 36 },
|
||||
{ 405, 36 }, { 406, 36 }, { 407, 36 }, { 408, 36 },
|
||||
};
|
||||
const u16 gUnk_080046A4End = 0;
|
||||
|
||||
const u16 gUnk_080047F6[] = {
|
||||
0, 255, 65280, 0, 65247, 783, 0, 28, 65247, 783, 0, 42, 65247, 783, 0, 121,
|
||||
65247, 783, 0, 119, 65247, 783, 0, 53, 65247, 783, 0, 53, 64735, 783, 0, 39,
|
||||
65247, 783, 0, 418, 65247, 783, 0, 419, 65247, 783, 0, 420, 65247, 783, 0, 421,
|
||||
65247, 783, 0, 422, 65247, 783, 0, 423, 65247, 783, 0, 424, 65247, 783, 0, 425,
|
||||
65247, 783, 0, 426, 65247, 783, 0, 360, 65247, 783, 0, 40, 39563, 15119, 65280, 31,
|
||||
59074, 1039, 256, 29, 59074, 1039, 256, 43, 59074, 1039, 256, 789, 34816, 298, 65280, 118,
|
||||
34816, 298, 65280, 16491, 33666, 255, 65280, 16389, 33666, 255, 65280, 16499, 33439, 4879, 65280, 53,
|
||||
59074, 1039, 256, 53, 59074, 1039, 256, 53, 59074, 1039, 256, 119, 59074, 1039, 256, 121,
|
||||
59074, 1039, 256, 360, 49323, 5647, 1024, 38, 49323, 5647, 1024, 52, 32768, 255, 65280, 804,
|
||||
40960, 255, 65280, 26, 40960, 255, 65280, 53, 40960, 255, 65280, 119, 40960, 255, 65280, 121,
|
||||
40960, 255, 65280, 27, 49192, 801, 768, 38, 49192, 801, 768, 789, 49192, 801, 768, 29,
|
||||
49192, 33, 768, 38, 49192, 33, 768, 121, 32832, 783, 0, 113, 43019, 5903, 65280, 29,
|
||||
43019, 5903, 65280, 53, 33859, 11535, 512, 30, 32776, 1039, 65280, 29, 32776, 1039, 65280, 38,
|
||||
32776, 1039, 65280, 52, 32779, 21263, 65280, 19, 32779, 21263, 65280, 789, 0, 30, 2, 18,
|
||||
64, 8, 0, 1, 128, 10, 0, 1, 128, 8, 384, 10, 128, 30, 1, 49152
|
||||
};
|
||||
|
||||
#define PLAYER_MACRO_JUMPTO 0x4000 // Jump
|
||||
#define PLAYER_MACRO_IGNORE 0x8000 // Do not set playerMacroWaiting and playerMacroHeldKeys?
|
||||
#define PLAYER_MACRO_END 0xC000 // End // 49152
|
||||
|
||||
// Link tries out the shield.
|
||||
const PlayerMacroEntry gPlayerMacroTryOutShield[] = {
|
||||
{ 4, DPAD_LEFT }, { 1, DPAD_DOWN }, { 60, A_BUTTON }, { 1, DPAD_LEFT },
|
||||
{ 60, A_BUTTON }, { 1, DPAD_RIGHT }, { 60, A_BUTTON }, { PLAYER_MACRO_JUMPTO, -4 },
|
||||
};
|
||||
|
||||
// Link holding his shield when the monsters escape or vaati attacks zelda.
|
||||
const PlayerMacroEntry gPlayerMacroProtectWithShield[] = {
|
||||
{ 0, A_BUTTON },
|
||||
{ PLAYER_MACRO_JUMPTO, -4 },
|
||||
};
|
||||
|
||||
const PlayerMacroEntry gPlayerMacroSanctuary[] = {
|
||||
{ 1, DPAD_UP },
|
||||
{ 120, B_BUTTON },
|
||||
{ 60, 0 },
|
||||
};
|
||||
const u16 gPlayerMacroSanctuaryEnd = PLAYER_MACRO_END;
|
||||
|
||||
const PlayerMacroEntry gPlayerMacroBladeBrothers0[] = {
|
||||
{ 120, B_BUTTON },
|
||||
{ 60, 0 },
|
||||
};
|
||||
const u16 gPlayerMacroBladeBrothers0End = PLAYER_MACRO_END;
|
||||
const PlayerMacroEntry gPlayerMacroBladeBrothers1[] = {
|
||||
{ 60, DPAD_RIGHT },
|
||||
{ 4, B_BUTTON },
|
||||
{ 60, 0 },
|
||||
};
|
||||
const u16 gPlayerMacroBladeBrothers1End = PLAYER_MACRO_END;
|
||||
const PlayerMacroEntry gPlayerMacroBladeBrothers2[] = {
|
||||
{ 4, DPAD_LEFT },
|
||||
{ 120, A_BUTTON },
|
||||
{ 60, 0 },
|
||||
};
|
||||
const u16 gPlayerMacroBladeBrothers2End = PLAYER_MACRO_END;
|
||||
const PlayerMacroEntry gPlayerMacroBladeBrothers3[] = {
|
||||
{ 1, DPAD_DOWN }, { 4, A_BUTTON }, { 10, 0 }, { 10, B_BUTTON }, { 60, 0 },
|
||||
};
|
||||
const u16 gPlayerMacroBladeBrothers3End = PLAYER_MACRO_END;
|
||||
const PlayerMacroEntry gPlayerMacroBladeBrothers4[] = {
|
||||
{ 4, DPAD_RIGHT }, { 8, R_BUTTON + DPAD_RIGHT }, { 30, 0 }, { 1, DPAD_LEFT }, { 30, 0 },
|
||||
{ 4, DPAD_LEFT }, { 4, R_BUTTON + DPAD_LEFT }, { 20, 0 }, { 6, B_BUTTON }, { 60, 0 },
|
||||
};
|
||||
const u16 gPlayerMacroBladeBrothers4End = PLAYER_MACRO_END;
|
||||
const PlayerMacroEntry gPlayerMacroBladeBrothers5[] = {
|
||||
{ 1, DPAD_LEFT }, { 30, 0 }, { 4, B_BUTTON }, { 60, 0 }, { 4, B_BUTTON }, { 60, 0 },
|
||||
};
|
||||
const u16 gPlayerMacroBladeBrothers5End = PLAYER_MACRO_END;
|
||||
const PlayerMacroEntry gPlayerMacroBladeBrothers6[] = {
|
||||
{ 1, DPAD_LEFT }, { 30, 0 }, { 4, B_BUTTON }, { 60, 0 }, { 4, B_BUTTON }, { 60, 0 },
|
||||
};
|
||||
const u16 gPlayerMacroBladeBrothers6End = PLAYER_MACRO_END;
|
||||
const PlayerMacroEntry gPlayerMacroBladeBrothers7[] = {
|
||||
{ 1, DPAD_LEFT }, { 120, B_BUTTON }, { 10, 0 }, { 4, B_BUTTON }, { 4, 0 }, { 4, B_BUTTON },
|
||||
{ 4, 0 }, { 4, B_BUTTON }, { 4, 0 }, { 4, B_BUTTON }, { 4, 0 }, { 4, B_BUTTON },
|
||||
{ 4, 0 }, { 4, B_BUTTON }, { 4, 0 }, { 4, B_BUTTON }, { 30, 0 },
|
||||
};
|
||||
const u16 gPlayerMacroBladeBrothers7End = PLAYER_MACRO_END;
|
||||
@@ -0,0 +1,75 @@
|
||||
#include "asm.h"
|
||||
#include "player.h"
|
||||
#include "tiles.h"
|
||||
|
||||
const KeyValuePair gMapActTileToSurfaceType[] = {
|
||||
{ ACT_TILE_13, SURFACE_PIT },
|
||||
{ ACT_TILE_38, SURFACE_SLOPE_GNDGND_V },
|
||||
{ ACT_TILE_39, SURFACE_SLOPE_GNDGND_H },
|
||||
{ ACT_TILE_82, SURFACE_26 },
|
||||
{ ACT_TILE_99, SURFACE_24 },
|
||||
{ ACT_TILE_116, SURFACE_EDGE },
|
||||
{ ACT_TILE_8, SURFACE_7 },
|
||||
{ ACT_TILE_31, SURFACE_MINISH_DOOR_FRONT },
|
||||
{ ACT_TILE_32, SURFACE_MINISH_DOOR_BACK },
|
||||
{ ACT_TILE_33, SURFACE_A },
|
||||
{ ACT_TILE_34, SURFACE_B },
|
||||
{ ACT_TILE_24, SURFACE_16 },
|
||||
{ ACT_TILE_18, SURFACE_ICE },
|
||||
{ ACT_TILE_15, SURFACE_SHALLOW_WATER },
|
||||
{ ACT_TILE_14, SURFACE_SLOPE_GNDWATER },
|
||||
{ ACT_TILE_16, SURFACE_WATER },
|
||||
{ ACT_TILE_27, SURFACE_BUTTON },
|
||||
{ ACT_TILE_29, SURFACE_BUTTON },
|
||||
{ ACT_TILE_97, SURFACE_1B },
|
||||
{ ACT_TILE_90, SURFACE_1C },
|
||||
{ ACT_TILE_17, SURFACE_14 },
|
||||
{ ACT_TILE_98, SURFACE_21 },
|
||||
{ ACT_TILE_101, SURFACE_6 },
|
||||
{ ACT_TILE_102, SURFACE_6 },
|
||||
{ ACT_TILE_103, SURFACE_6 },
|
||||
{ ACT_TILE_104, SURFACE_6 },
|
||||
{ ACT_TILE_105, SURFACE_6 },
|
||||
{ ACT_TILE_106, SURFACE_6 },
|
||||
{ ACT_TILE_108, SURFACE_6 },
|
||||
{ ACT_TILE_109, SURFACE_6 },
|
||||
{ ACT_TILE_110, SURFACE_6 },
|
||||
{ ACT_TILE_111, SURFACE_6 },
|
||||
{ ACT_TILE_107, SURFACE_6 },
|
||||
{ ACT_TILE_48, SURFACE_22 },
|
||||
{ ACT_TILE_49, SURFACE_22 },
|
||||
{ ACT_TILE_50, SURFACE_22 },
|
||||
{ ACT_TILE_51, SURFACE_22 },
|
||||
{ ACT_TILE_22, SURFACE_DUST },
|
||||
{ ACT_TILE_25, SURFACE_HOLE },
|
||||
{ ACT_TILE_240, SURFACE_HOLE },
|
||||
{ ACT_TILE_87, SURFACE_CLONE_TILE },
|
||||
{ ACT_TILE_83, SURFACE_LADDER },
|
||||
{ ACT_TILE_241, SURFACE_LADDER },
|
||||
{ ACT_TILE_63, SURFACE_AUTO_LADDER },
|
||||
{ ACT_TILE_80, SURFACE_CLIMB_WALL },
|
||||
{ ACT_TILE_81, SURFACE_2C },
|
||||
{ ACT_TILE_52, SURFACE_LIGHT_GRADE },
|
||||
{ ACT_TILE_53, SURFACE_29 },
|
||||
{ ACT_TILE_42, SURFACE_E },
|
||||
{ ACT_TILE_43, SURFACE_D },
|
||||
{ ACT_TILE_44, SURFACE_10 },
|
||||
{ ACT_TILE_45, SURFACE_F },
|
||||
{ ACT_TILE_64, SURFACE_E },
|
||||
{ ACT_TILE_65, SURFACE_D },
|
||||
{ ACT_TILE_66, SURFACE_10 },
|
||||
{ ACT_TILE_67, SURFACE_F },
|
||||
{ ACT_TILE_72, SURFACE_10 },
|
||||
{ ACT_TILE_74, SURFACE_E },
|
||||
{ ACT_TILE_69, SURFACE_E },
|
||||
{ ACT_TILE_71, SURFACE_E },
|
||||
{ ACT_TILE_70, SURFACE_D },
|
||||
{ ACT_TILE_73, SURFACE_D },
|
||||
{ ACT_TILE_68, SURFACE_D },
|
||||
{ ACT_TILE_75, SURFACE_D },
|
||||
{ ACT_TILE_19, SURFACE_SWAMP },
|
||||
{ ACT_TILE_41, SURFACE_DOOR },
|
||||
{ ACT_TILE_23, SURFACE_2D },
|
||||
{ ACT_TILE_40, SURFACE_DOOR_13 },
|
||||
};
|
||||
// const u16 gMapActTileToSurfaceTypeEnd = 0;
|
||||
+10
-10
@@ -46,9 +46,9 @@ const Transition gExitList_MinishWoods_Main[] = {
|
||||
{ WARP_TYPE_AREA, 0x00, 0x0088, 0x0218, 0x0218, 0x0118, 0x00, AREA_MINISH_CAVES,
|
||||
ROOM_MINISH_CAVES_MINISH_WOODS_SOUTHWEST, 1, TRANSITION_TYPE_NORMAL, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ WARP_TYPE_BORDER, 0x00, 0x0000, 0x0000, 0x01d8, 0x0fff, 0x40, AREA_HYRULE_FIELD,
|
||||
ROOM_HYRULE_FIELD_EASTERN_HILLLS_NORTH, 1, TRANSITION_TYPE_NORMAL, 0x06, 0x00, 0x00, 0x00, 0x00 },
|
||||
ROOM_HYRULE_FIELD_EASTERN_HILLS_NORTH, 1, TRANSITION_TYPE_NORMAL, 0x06, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ WARP_TYPE_BORDER, 0x00, 0x0000, 0x0000, 0x01d8, 0x00a0, 0x80, AREA_HYRULE_FIELD,
|
||||
ROOM_HYRULE_FIELD_EASTERN_HILLLS_SOUTH, 1, TRANSITION_TYPE_NORMAL, 0x06, 0x00, 0x00, 0x00, 0x00 },
|
||||
ROOM_HYRULE_FIELD_EASTERN_HILLS_SOUTH, 1, TRANSITION_TYPE_NORMAL, 0x06, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ WARP_TYPE_BORDER, 0x00, 0x0000, 0x0000, 0x0fff, 0x03b8, 0x01, AREA_LAKE_HYLIA, ROOM_LAKE_HYLIA_MAIN, 1,
|
||||
TRANSITION_TYPE_NORMAL, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ WARP_TYPE_BORDER, 0x00, 0x0000, 0x0000, 0x0fff, 0x03ac, 0x02, AREA_LAKE_HYLIA, ROOM_LAKE_HYLIA_MAIN, 1,
|
||||
@@ -446,9 +446,9 @@ const Transition gExitList_HyruleField_WesternWoodsCenter[] = {
|
||||
const Transition* const gExitLists_HyruleField[] = {
|
||||
[ROOM_HYRULE_FIELD_WESTERN_WOODS_SOUTH] = gExitList_HyruleField_WesternWoodSouth,
|
||||
[ROOM_HYRULE_FIELD_SOUTH_HYRULE_FIELD] = gExitList_HyruleField_SouthHyruleField,
|
||||
[ROOM_HYRULE_FIELD_EASTERN_HILLLS_SOUTH] = gExitList_HyruleField_EasternHillsSouth,
|
||||
[ROOM_HYRULE_FIELD_EASTERN_HILLLS_CENTER] = gExitList_HyruleField_EasternHillsCenter,
|
||||
[ROOM_HYRULE_FIELD_EASTERN_HILLLS_NORTH] = gExitList_HyruleField_EasternHillsNorth,
|
||||
[ROOM_HYRULE_FIELD_EASTERN_HILLS_SOUTH] = gExitList_HyruleField_EasternHillsSouth,
|
||||
[ROOM_HYRULE_FIELD_EASTERN_HILLS_CENTER] = gExitList_HyruleField_EasternHillsCenter,
|
||||
[ROOM_HYRULE_FIELD_EASTERN_HILLS_NORTH] = gExitList_HyruleField_EasternHillsNorth,
|
||||
[ROOM_HYRULE_FIELD_LON_LON_RANCH] = gExitList_HyruleField_LonLonRanch,
|
||||
[ROOM_HYRULE_FIELD_NORTH_HYRULE_FIELD] = gExitList_HyruleField_NorthHyruleField,
|
||||
[ROOM_HYRULE_FIELD_TRILBY_HIGHLANDS] = gExitList_HyruleField_TrilbyHighlands,
|
||||
@@ -628,7 +628,7 @@ const Transition gExitList_Beanstalks_RuinsClimb[] = {
|
||||
const Transition gExitList_Beanstalks_EasternHillsClimb[] = {
|
||||
{ WARP_TYPE_BORDER, 0x0, 0x0, 0x0, 0x58, 0x68, 0x3, AREA_BEANSTALKS, ROOM_BEANSTALKS_EASTERN_HILLS, 1,
|
||||
TRANSITION_TYPE_NORMAL, 0x0, 0x0, 0x0, 0x0, 0x0 },
|
||||
{ WARP_TYPE_BORDER, 0x0, 0x0, 0x0, 0x48, 0x18, 0x30, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_EASTERN_HILLLS_CENTER,
|
||||
{ WARP_TYPE_BORDER, 0x0, 0x0, 0x0, 0x48, 0x18, 0x30, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_EASTERN_HILLS_CENTER,
|
||||
1, TRANSITION_TYPE_NORMAL, 0x0, 0x0, 0x0, 0x0, 0x0 },
|
||||
TransitionListEnd,
|
||||
};
|
||||
@@ -923,7 +923,7 @@ const Transition gExitList_MinishHouseInteriors_Librari[] = {
|
||||
TransitionListEnd,
|
||||
};
|
||||
const Transition gExitList_MinishHouseInteriors_HyruleFieldExit[] = {
|
||||
{ WARP_TYPE_BORDER, 0x0, 0x0, 0x0, 0x38, 0x35, 0x30, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_EASTERN_HILLLS_SOUTH,
|
||||
{ WARP_TYPE_BORDER, 0x0, 0x0, 0x0, 0x38, 0x35, 0x30, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_EASTERN_HILLS_SOUTH,
|
||||
1, TRANSITION_TYPE_INSTANT_MINISH, 0x4, 0x0, 0x0, 0x0, 0x0 },
|
||||
TransitionListEnd,
|
||||
};
|
||||
@@ -1108,7 +1108,7 @@ const Transition gExitList_HouseInteriors2_DrLeft[] = {
|
||||
TransitionListEnd,
|
||||
};
|
||||
const Transition gExitList_HouseInteriors2_NULL1[] = {
|
||||
{ WARP_TYPE_BORDER, 0x0, 0x0, 0x0, 0x40, 0x5c, 0x30, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_EASTERN_HILLLS_NORTH,
|
||||
{ WARP_TYPE_BORDER, 0x0, 0x0, 0x0, 0x40, 0x5c, 0x30, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_EASTERN_HILLS_NORTH,
|
||||
1, TRANSITION_TYPE_NORMAL, 0x4, 0x0, 0x0, 0x0, 0x0 },
|
||||
TransitionListEnd,
|
||||
};
|
||||
@@ -1244,7 +1244,7 @@ const Transition gExitList_HouseInteriors4_RanchHouseEast[] = {
|
||||
TransitionListEnd,
|
||||
};
|
||||
const Transition gExitList_HouseInteriors4_FarmHouse[] = {
|
||||
{ WARP_TYPE_BORDER, 0x0, 0x0, 0x0, 0x40, 0x5c, 0x30, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_EASTERN_HILLLS_NORTH,
|
||||
{ WARP_TYPE_BORDER, 0x0, 0x0, 0x0, 0x40, 0x5c, 0x30, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_EASTERN_HILLS_NORTH,
|
||||
1, TRANSITION_TYPE_NORMAL, 0x4, 0x0, 0x0, 0x0, 0x0 },
|
||||
TransitionListEnd,
|
||||
};
|
||||
@@ -2273,7 +2273,7 @@ const Transition gExitList_Caves_TrilbyMittsFairyFountain[] = {
|
||||
TransitionListEnd,
|
||||
};
|
||||
const Transition gExitList_Caves_HillsKeeseChest[] = {
|
||||
{ WARP_TYPE_BORDER, 0x0, 0x0, 0x0, 0xa8, 0xa8, 0x30, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_EASTERN_HILLLS_CENTER,
|
||||
{ WARP_TYPE_BORDER, 0x0, 0x0, 0x0, 0xa8, 0xa8, 0x30, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_EASTERN_HILLS_CENTER,
|
||||
1, TRANSITION_TYPE_NORMAL, 0x4, 0x0, 0x0, 0x0, 0x0 },
|
||||
TransitionListEnd,
|
||||
};
|
||||
|
||||
+2
-3
@@ -24,7 +24,6 @@ void sub_080A2F8C(void);
|
||||
extern u8 gUnk_02000004;
|
||||
void sub_080A3198(u32, u32);
|
||||
|
||||
extern u8 gUnk_02017760[];
|
||||
extern u8 gUnk_08A05751[];
|
||||
|
||||
// sprite_table
|
||||
@@ -59,8 +58,8 @@ void sub_080A2E40(void) {
|
||||
LoadGfxGroups();
|
||||
LoadPaletteGroup(0xb5);
|
||||
LoadGfxGroup(0x56);
|
||||
MemCopy(&gUnk_089FD1B4, &gUnk_02017760[0], 0x100);
|
||||
MemCopy(&gUnk_089FD1B4, &gUnk_02017760[0x200], 0x100);
|
||||
MemCopy(&gUnk_089FD1B4, gPaletteBuffer + 96, 0x100);
|
||||
MemCopy(&gUnk_089FD1B4, gPaletteBuffer + 352, 0x100);
|
||||
MemCopy(&gUnk_089FD2F4, (void*)0x6000000, 0x8000);
|
||||
MemCopy(&gUnk_089FD2F4, (void*)0x6010000, 0x8000);
|
||||
MemCopy(&gUnk_08A05751, &gBG1Buffer, 0x800);
|
||||
|
||||
@@ -190,11 +190,11 @@ void AcroBandit_Type0Action1(AcroBanditEntity* this) {
|
||||
if (super->timer != 0) {
|
||||
super->timer--;
|
||||
} else {
|
||||
if (sub_08049FDC(super, 1)) {
|
||||
if (sub_08049FDC(super, 1) != 0) {
|
||||
rand = Random();
|
||||
x = this->unk_74.HWORD + ((s32)rand % 5) * 0x10 - 0x20;
|
||||
y = this->unk_76.HWORD + ((s32)(rand >> 4) % 5) * 0x10 - 0x20;
|
||||
if (sub_080B1B18(x, y, super->collisionLayer) == 0) {
|
||||
if (GetCollisionDataAtWorldCoords(x, y, super->collisionLayer) == 0) {
|
||||
super->action = 2;
|
||||
super->spriteSettings.draw = 1;
|
||||
super->x.HALF.HI = x;
|
||||
|
||||
+12
-11
@@ -9,7 +9,9 @@
|
||||
#include "enemy.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
#include "hitbox.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -401,19 +403,18 @@ void sub_080307D4(ArmosEntity* this) {
|
||||
}
|
||||
|
||||
void sub_080307EC(ArmosEntity* this) {
|
||||
u32 position = COORD_TO_TILE(super);
|
||||
this->unk_78 = GetTileIndex(position, super->collisionLayer);
|
||||
SetBottomTile(0x4022, position, (u32)super->collisionLayer);
|
||||
u32 tilePos = COORD_TO_TILE(super);
|
||||
this->unk_78 = GetTileIndex(tilePos, super->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_34, tilePos, (u32)super->collisionLayer);
|
||||
}
|
||||
|
||||
void sub_08030834(ArmosEntity* this) {
|
||||
SetBottomTile(this->unk_78, COORD_TO_TILE(super), super->collisionLayer);
|
||||
SetTile(this->unk_78, COORD_TO_TILE(super), super->collisionLayer);
|
||||
}
|
||||
|
||||
bool32 sub_0803086C(ArmosEntity* this) {
|
||||
u32 uVar2;
|
||||
u32 pos;
|
||||
u32 pos2;
|
||||
u32 tilePos;
|
||||
u16 centerY;
|
||||
u16 centerX;
|
||||
FORCE_REGISTER(u32 r2, r2);
|
||||
@@ -423,10 +424,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)) |
|
||||
(((((super)->y.HALF.HI) - gRoomControls.origin_y) >> 4) & r2) << 6);
|
||||
tilePos = ((((((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 (GetTileTypeAtTilePos(tilePos, super->collisionLayer) == SPECIAL_TILE_73) {
|
||||
if (CheckPlayerInRegion(centerX, centerY, 2, 0xc) != 0) {
|
||||
if (CheckPlayerInRegion(centerX, centerY - 4, 2, 4) != 0) {
|
||||
gPlayerEntity.base.spritePriority.b0 = 3;
|
||||
@@ -435,11 +436,11 @@ bool32 sub_0803086C(ArmosEntity* this) {
|
||||
return TRUE;
|
||||
}
|
||||
} else {
|
||||
SetBottomTile(0x4022, pos, super->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_34, tilePos, super->collisionLayer);
|
||||
}
|
||||
} else {
|
||||
if (CheckPlayerInRegion(centerX, centerY + 6, 2, 5) != 0) {
|
||||
SetBottomTile(0x4049, COORD_TO_TILE(super), super->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_73, COORD_TO_TILE(super), super->collisionLayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ void sub_0802AAC0(BombPeahatEntity* this) {
|
||||
super->child = NULL;
|
||||
#ifdef EU
|
||||
} else if (entity->timer == 0) {
|
||||
if (sub_080B1B44(COORD_TO_TILE(super), 1) == 0) {
|
||||
if (GetCollisionDataAtTilePos(COORD_TO_TILE(super), 1) == 0) {
|
||||
if (EntityInRectRadius(super, &gPlayerEntity.base, 0x10, 0x10) && entity->subtimer <= 0x50) {
|
||||
this->unk_81 = 0;
|
||||
}
|
||||
@@ -685,7 +685,7 @@ void sub_0802B204(BombPeahatEntity* this) {
|
||||
|
||||
bool32 sub_0802B234(BombPeahatEntity* this) {
|
||||
bool32 ret = FALSE;
|
||||
if (GetTileTypeByEntity(super) - 0x1c4 > 1)
|
||||
if (GetTileTypeAtEntity(super) - 0x1c4 > 1)
|
||||
ret = TRUE;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "message.h"
|
||||
#include "npc.h"
|
||||
#include "save.h"
|
||||
#include "tiles.h"
|
||||
|
||||
struct SalesOffering {
|
||||
u8 field_0x0;
|
||||
@@ -442,7 +443,7 @@ void sub_08028FFC(BusinessScrubEntity* this) {
|
||||
super->x.HALF.HI = this->unk_78;
|
||||
super->y.HALF.HI = this->unk_7a;
|
||||
InitializeAnimation(super, 0);
|
||||
SetBottomTile(0x4022, this->unk_76, super->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_34, this->unk_76, super->collisionLayer);
|
||||
}
|
||||
|
||||
void sub_08029078(BusinessScrubEntity* this) {
|
||||
@@ -456,7 +457,7 @@ void sub_08029078(BusinessScrubEntity* this) {
|
||||
super->spriteIndex = 0xd0;
|
||||
sub_08028FDC(this);
|
||||
sub_080290E0(this, 1);
|
||||
SetBottomTile(this->unk_74, this->unk_76, super->collisionLayer);
|
||||
SetTile(this->unk_74, this->unk_76, super->collisionLayer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-4
@@ -7,6 +7,7 @@
|
||||
#include "asm.h"
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -714,11 +715,11 @@ void sub_0801FB68(ChuchuEntity* this) {
|
||||
super->zVelocity = 0;
|
||||
}
|
||||
|
||||
u32 CheckWaterTile(ChuchuEntity* this) {
|
||||
if (GetActTile(super) == 0x10) {
|
||||
return 1;
|
||||
bool32 CheckWaterTile(ChuchuEntity* this) {
|
||||
if (GetActTileAtEntity(super) == ACT_TILE_16) {
|
||||
return TRUE;
|
||||
} else {
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
u8 unk_00;
|
||||
@@ -561,7 +562,7 @@ void sub_080262A8(ChuchuBossEntity* this) {
|
||||
gPlayerEntity.base.animationState = 0;
|
||||
gRoomControls.camera_target = super;
|
||||
gRoomControls.scrollSpeed = 1;
|
||||
SetBottomTile(0x4022, 0x2c8, 1);
|
||||
SetTile(SPECIAL_TILE_34, TILE_POS(8, 11), LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
#include "physics.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -238,18 +239,18 @@ void sub_080387F0(CloudPiranhaEntity* this) {
|
||||
};
|
||||
u8 bVar1;
|
||||
u8 bVar2;
|
||||
s32 iVar4;
|
||||
s32 collisionData;
|
||||
const s8* ptr;
|
||||
|
||||
if ((super->action != 4) && (this->unk_82 == 0)) {
|
||||
iVar4 = sub_080B1B44(COORD_TO_TILE(super), super->collisionLayer);
|
||||
if ((iVar4 == 0xf) || (iVar4 == 0x2a)) {
|
||||
collisionData = GetCollisionDataAtTilePos(COORD_TO_TILE(super), super->collisionLayer);
|
||||
if ((collisionData == COLLISION_DATA_15) || (collisionData == COLLISION_DATA_42)) {
|
||||
this->unk_82 = 0x20;
|
||||
}
|
||||
ptr = &gUnk_080CF520[super->direction >> 1];
|
||||
bVar1 = super->direction;
|
||||
iVar4 = sub_080B1AF0(super, ptr[0], ptr[1]);
|
||||
if ((iVar4 == 0xf) || (iVar4 == 0x2a)) {
|
||||
collisionData = GetCollisionDataRelativeTo(super, ptr[0], ptr[1]);
|
||||
if ((collisionData == COLLISION_DATA_15) || (collisionData == COLLISION_DATA_42)) {
|
||||
super->direction = (super->direction + 0x10) & 0x1f;
|
||||
} else {
|
||||
if (super->collisions != COL_NONE) {
|
||||
|
||||
+10
-9
@@ -7,6 +7,7 @@
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
#include "sound.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -48,7 +49,7 @@ void DoorMimic_OnCollision(DoorMimicEntity* this) {
|
||||
}
|
||||
|
||||
void DoorMimic_OnDeath(DoorMimicEntity* this) {
|
||||
SetBottomTile(this->unk_7c, this->unk_7e, super->collisionLayer);
|
||||
SetTile(this->unk_7c, this->unk_7e, super->collisionLayer);
|
||||
CreateFx(super, FX_POT_SHATTER, 0);
|
||||
EnemyDisableRespawn(super);
|
||||
DeleteThisEntity();
|
||||
@@ -122,10 +123,10 @@ void sub_08022198(DoorMimicEntity* this) {
|
||||
}
|
||||
|
||||
void sub_080221C0(DoorMimicEntity* this) {
|
||||
u32 tile = COORD_TO_TILE(super) + gUnk_080B4488[super->type2];
|
||||
this->unk_7e = tile;
|
||||
this->unk_7c = GetTileIndex(tile, super->collisionLayer);
|
||||
SetBottomTile(gUnk_080CB79C[super->type2], tile, super->collisionLayer);
|
||||
u32 tilePos = COORD_TO_TILE(super) + gUnk_080B4488[super->type2];
|
||||
this->unk_7e = tilePos;
|
||||
this->unk_7c = GetTileIndex(tilePos, super->collisionLayer);
|
||||
SetTile(gUnk_080CB79C[super->type2], tilePos, super->collisionLayer);
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
@@ -190,10 +191,10 @@ const PosOffset gUnk_080CB76C[][6] = {
|
||||
};
|
||||
|
||||
const u16 gUnk_080CB79C[] = {
|
||||
0x4023,
|
||||
0x4025,
|
||||
0x4026,
|
||||
0x4024,
|
||||
SPECIAL_TILE_35,
|
||||
SPECIAL_TILE_37,
|
||||
SPECIAL_TILE_38,
|
||||
SPECIAL_TILE_36,
|
||||
};
|
||||
|
||||
|
||||
|
||||
+22
-21
@@ -7,6 +7,7 @@
|
||||
#include "enemy.h"
|
||||
#include "fade.h"
|
||||
#include "functions.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -85,16 +86,16 @@ void Enemy64_Init(Enemy64Entity* this) {
|
||||
Entity* tail;
|
||||
|
||||
if (CheckFlags(0x7c)) {
|
||||
SetBottomTile(0x4081, 10, 2);
|
||||
SetBottomTile(0x4081, 0x4a, 2);
|
||||
SetBottomTile(0x4081, 0x8a, 2);
|
||||
SetBottomTile(0x4081, 0xca, 2);
|
||||
SetTile(SPECIAL_TILE_129, TILE_POS(10, 0), LAYER_TOP);
|
||||
SetTile(SPECIAL_TILE_129, TILE_POS(10, 1), LAYER_TOP);
|
||||
SetTile(SPECIAL_TILE_129, TILE_POS(10, 2), LAYER_TOP);
|
||||
SetTile(SPECIAL_TILE_129, TILE_POS(10, 3), LAYER_TOP);
|
||||
DeleteThisEntity();
|
||||
} else {
|
||||
sub_0807B7D8(0x323, 10, 1);
|
||||
sub_0807B7D8(0x323, 0x4a, 1);
|
||||
sub_0807B7D8(0x323, 0x8a, 1);
|
||||
sub_0807B7D8(0x323, 0xca, 1);
|
||||
sub_0807B7D8(0x323, TILE_POS(10, 0), LAYER_BOTTOM);
|
||||
sub_0807B7D8(0x323, TILE_POS(10, 1), LAYER_BOTTOM);
|
||||
sub_0807B7D8(0x323, TILE_POS(10, 2), LAYER_BOTTOM);
|
||||
sub_0807B7D8(0x323, TILE_POS(10, 3), LAYER_BOTTOM);
|
||||
}
|
||||
tail = CreateProjectile(GYORG_TAIL);
|
||||
if (tail != NULL) {
|
||||
@@ -189,7 +190,7 @@ void Enemy64_Action2_SubAction0(Enemy64Entity* this) {
|
||||
}
|
||||
|
||||
void Enemy64_Action2_SubAction1(Enemy64Entity* this) {
|
||||
u32 tmp = CalcOffsetAngle(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI);
|
||||
u32 tmp = CalculateDirectionFromOffsets(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI);
|
||||
if (4 < (((super->direction - tmp) + 2) & 0xff)) {
|
||||
if (((tmp - super->direction) & 0x80) != 0) {
|
||||
super->direction--;
|
||||
@@ -290,8 +291,8 @@ void Enemy64_Action3(Enemy64Entity* this) {
|
||||
}
|
||||
|
||||
void Enemy64_Action3_SubAction0(Enemy64Entity* this) {
|
||||
u32 tmp = CalcOffsetAngle(gRoomControls.origin_x + 0xa8 - super->x.HALF.HI,
|
||||
gRoomControls.origin_y + 0x80 - super->y.HALF.HI);
|
||||
u32 tmp = CalculateDirectionFromOffsets(gRoomControls.origin_x + 0xa8 - super->x.HALF.HI,
|
||||
gRoomControls.origin_y + 0x80 - super->y.HALF.HI);
|
||||
if (tmp != super->direction) {
|
||||
if (((tmp - super->direction) & 0x80) != 0) {
|
||||
super->direction--;
|
||||
@@ -439,20 +440,20 @@ void Enemy64_Action4_SubAction7(Enemy64Entity* this) {
|
||||
if (--super->timer == 0) {
|
||||
DeleteThisEntity();
|
||||
} else if (super->timer == 16) {
|
||||
sub_0807B7D8(0x36, 0xca, 1);
|
||||
SetBottomTile(0x4081, 0xca, 2);
|
||||
sub_0807B7D8(0x36, TILE_POS(10, 3), LAYER_BOTTOM);
|
||||
SetTile(SPECIAL_TILE_129, TILE_POS(10, 3), LAYER_TOP);
|
||||
SoundReq(SFX_HEART_GET);
|
||||
} else if (super->timer == 24) {
|
||||
sub_0807B7D8(0x36, 0x8a, 1);
|
||||
SetBottomTile(0x4081, 0x8a, 2);
|
||||
sub_0807B7D8(0x36, TILE_POS(10, 2), LAYER_BOTTOM);
|
||||
SetTile(SPECIAL_TILE_129, TILE_POS(10, 2), LAYER_TOP);
|
||||
SoundReq(SFX_HEART_GET);
|
||||
} else if (super->timer == 32) {
|
||||
sub_0807B7D8(0x36, 0x4a, 1);
|
||||
SetBottomTile(0x4081, 0x4a, 2);
|
||||
sub_0807B7D8(0x36, TILE_POS(10, 1), LAYER_BOTTOM);
|
||||
SetTile(SPECIAL_TILE_129, TILE_POS(10, 1), LAYER_TOP);
|
||||
SoundReq(SFX_HEART_GET);
|
||||
} else if (super->timer == 40) {
|
||||
sub_0807B7D8(0x36, 10, 1);
|
||||
SetBottomTile(0x4081, 10, 2);
|
||||
sub_0807B7D8(0x36, TILE_POS(10, 0), LAYER_BOTTOM);
|
||||
SetTile(SPECIAL_TILE_129, TILE_POS(10, 0), LAYER_TOP);
|
||||
SoundReq(SFX_HEART_GET);
|
||||
}
|
||||
}
|
||||
@@ -490,8 +491,8 @@ void sub_080499F0(Enemy64Entity* this) {
|
||||
((this->unk_7c & 1) == 0)) {
|
||||
if (EntityWithinDistance(&gPlayerEntity.base, super->x.HALF.HI, super->y.HALF.HI, 0x24) &&
|
||||
((this->unk_7c & 2) == 0)) {
|
||||
tmp = CalcOffsetAngle((s32)gPlayerEntity.base.x.HALF.HI - super->x.HALF.HI,
|
||||
(s32)gPlayerEntity.base.y.HALF.HI - super->y.HALF.HI);
|
||||
tmp = CalculateDirectionFromOffsets((s32)gPlayerEntity.base.x.HALF.HI - super->x.HALF.HI,
|
||||
(s32)gPlayerEntity.base.y.HALF.HI - super->y.HALF.HI);
|
||||
gPlayerEntity.base.x.WORD = super->x.WORD + gSineTable[tmp] * 0x2400;
|
||||
gPlayerEntity.base.y.WORD = super->y.WORD + gSineTable[tmp + 0x40] * -0x2400;
|
||||
}
|
||||
|
||||
+29
-28
@@ -9,6 +9,7 @@
|
||||
#include "functions.h"
|
||||
#include "hitbox.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -24,16 +25,16 @@ typedef struct {
|
||||
/*0x7c*/ u16 unk_7c;
|
||||
/*0x7e*/ u8 unk_7e;
|
||||
/*0x7f*/ u8 unk_7f;
|
||||
/*0x80*/ u16 unk_80;
|
||||
/*0x82*/ u16 unk_82;
|
||||
/*0x84*/ u16 unk_84;
|
||||
/*0x86*/ u16 unk_86;
|
||||
/*0x80*/ u16 tileIndex1;
|
||||
/*0x82*/ u16 tileIndex2;
|
||||
/*0x84*/ u16 tileIndex3;
|
||||
/*0x86*/ u16 tileIndex4;
|
||||
} EyegoreEntity;
|
||||
|
||||
extern Entity* sub_08017A90(Entity*, Entity*);
|
||||
|
||||
extern Entity* gUnk_020000B0;
|
||||
extern const u8 gUnk_080B3E80[];
|
||||
extern const u8 gMapTileTypeToCollisionData[];
|
||||
|
||||
void sub_08031344(EyegoreEntity*);
|
||||
void sub_08031344(EyegoreEntity*);
|
||||
@@ -326,27 +327,27 @@ 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);
|
||||
this->unk_80 = tileIndex;
|
||||
tileIndex = GetTileIndex(position + 1, super->collisionLayer);
|
||||
this->unk_82 = tileIndex;
|
||||
tileIndex = GetTileIndex(position + 0x40, super->collisionLayer);
|
||||
this->unk_84 = tileIndex;
|
||||
tileIndex = GetTileIndex(position + 0x41, super->collisionLayer);
|
||||
this->unk_86 = tileIndex;
|
||||
SetBottomTile(0x4022, position, super->collisionLayer);
|
||||
SetBottomTile(0x4022, position + 1, super->collisionLayer);
|
||||
SetBottomTile(0x4022, position + 0x40, super->collisionLayer);
|
||||
SetBottomTile(0x4022, position + 0x41, super->collisionLayer);
|
||||
u32 tilePos = COORD_TO_TILE_OFFSET(super, 8, 20);
|
||||
u16 tileIndex = GetTileIndex(tilePos + TILE_POS(0, 0), super->collisionLayer);
|
||||
this->tileIndex1 = tileIndex;
|
||||
tileIndex = GetTileIndex(tilePos + TILE_POS(1, 0), super->collisionLayer);
|
||||
this->tileIndex2 = tileIndex;
|
||||
tileIndex = GetTileIndex(tilePos + TILE_POS(0, 1), super->collisionLayer);
|
||||
this->tileIndex3 = tileIndex;
|
||||
tileIndex = GetTileIndex(tilePos + TILE_POS(1, 1), super->collisionLayer);
|
||||
this->tileIndex4 = tileIndex;
|
||||
SetTile(SPECIAL_TILE_34, tilePos, super->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_34, tilePos + 1, super->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_34, tilePos + TILE_POS(0, 1), super->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_34, tilePos + TILE_POS(1, 1), super->collisionLayer);
|
||||
}
|
||||
|
||||
void sub_08030FB4(EyegoreEntity* this) {
|
||||
u32 position = COORD_TO_TILE_OFFSET(super, 8, 0x14);
|
||||
SetBottomTile(this->unk_80, position, super->collisionLayer);
|
||||
SetBottomTile(this->unk_82, position + 1, super->collisionLayer);
|
||||
SetBottomTile(this->unk_84, position + 0x40, super->collisionLayer);
|
||||
SetBottomTile(this->unk_86, position + 0x41, super->collisionLayer);
|
||||
u32 tilePos = COORD_TO_TILE_OFFSET(super, 8, 20);
|
||||
SetTile(this->tileIndex1, tilePos + TILE_POS(0, 0), super->collisionLayer);
|
||||
SetTile(this->tileIndex2, tilePos + TILE_POS(1, 0), super->collisionLayer);
|
||||
SetTile(this->tileIndex3, tilePos + TILE_POS(0, 1), super->collisionLayer);
|
||||
SetTile(this->tileIndex4, tilePos + TILE_POS(1, 1), super->collisionLayer);
|
||||
}
|
||||
|
||||
void sub_08031024(EyegoreEntity* this) {
|
||||
@@ -399,11 +400,11 @@ void sub_08031024(EyegoreEntity* this) {
|
||||
}
|
||||
} else {
|
||||
tmp2 = this->unk_7b >> 1;
|
||||
uVar5 = GetTileTypeByPos(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],
|
||||
super->y.HALF.HI + gUnk_080CE2C0[tmp2 + 3], super->collisionLayer);
|
||||
if (!(((gUnk_080B3E80[uVar5] == 0) && (gUnk_080B3E80[uVar8] == 0)) ||
|
||||
uVar5 = GetTileTypeAtWorldCoords(super->x.HALF.HI + gUnk_080CE2C0[tmp2],
|
||||
super->y.HALF.HI + gUnk_080CE2C0[tmp2 + 1], super->collisionLayer);
|
||||
uVar8 = GetTileTypeAtWorldCoords(super->x.HALF.HI + gUnk_080CE2C0[tmp2 + 2],
|
||||
super->y.HALF.HI + gUnk_080CE2C0[tmp2 + 3], super->collisionLayer);
|
||||
if (!(((gMapTileTypeToCollisionData[uVar5] == 0) && (gMapTileTypeToCollisionData[uVar8] == 0)) ||
|
||||
((this->unk_7b | 1) & 1) == 0)) {
|
||||
if (super->direction >> 3 == super->animationState) {
|
||||
this->unk_78 |= 0x20;
|
||||
|
||||
+28
-27
@@ -9,6 +9,7 @@
|
||||
#include "functions.h"
|
||||
#include "player.h"
|
||||
#include "room.h"
|
||||
#include "tiles.h"
|
||||
|
||||
extern Hitbox gUnk_080FD34C;
|
||||
|
||||
@@ -38,26 +39,26 @@ enum FlyingPotSubActions {
|
||||
};
|
||||
|
||||
// Functions
|
||||
void FlyingPot_OnTick(FlyingPotEntity*); // 0803708C
|
||||
void FlyingPot_OnCollision(FlyingPotEntity*); // 080370A4
|
||||
void FlyingPot_OnGrabbed(FlyingPotEntity*); // 0803712C
|
||||
void FlyingPot_OnTick(FlyingPotEntity*);
|
||||
void FlyingPot_OnCollision(FlyingPotEntity*);
|
||||
void FlyingPot_OnGrabbed(FlyingPotEntity*);
|
||||
|
||||
// Subactions
|
||||
void FlyingPot_SubAction0(FlyingPotEntity*); // 08037144
|
||||
void FlyingPot_SubAction1(FlyingPotEntity*); // 0803715C
|
||||
void FlyingPot_SubAction2(FlyingPotEntity*); // 0803718C
|
||||
void FlyingPot_SubAction3(FlyingPotEntity*); // 080371F8
|
||||
void FlyingPot_SubAction0(FlyingPotEntity*);
|
||||
void FlyingPot_SubAction1(FlyingPotEntity*);
|
||||
void FlyingPot_SubAction2(FlyingPotEntity*);
|
||||
void FlyingPot_SubAction3(FlyingPotEntity*);
|
||||
void FlyingPot_SubActionDoNothing(FlyingPotEntity*);
|
||||
void FlyingPot_SubAction5(FlyingPotEntity*); // 08037218
|
||||
void FlyingPot_SubAction5(FlyingPotEntity*);
|
||||
|
||||
// Actions
|
||||
void FlyingPot_Init(FlyingPotEntity*); // ? // 08037220
|
||||
void FlyingPot_Action1(FlyingPotEntity*); // 08037280
|
||||
void FlyingPot_Action2(FlyingPotEntity*); // 080372E8
|
||||
void FlyingPot_Action3(FlyingPotEntity*); // 0803737C
|
||||
void FlyingPot_Action4(FlyingPotEntity*); // 080373B0
|
||||
void FlyingPot_Action5(FlyingPotEntity*); // 080373C8
|
||||
void FlyingPot_Action6(FlyingPotEntity*); // 080373E0
|
||||
void FlyingPot_Init(FlyingPotEntity*);
|
||||
void FlyingPot_Action1(FlyingPotEntity*);
|
||||
void FlyingPot_Action2(FlyingPotEntity*);
|
||||
void FlyingPot_Action3(FlyingPotEntity*);
|
||||
void FlyingPot_Action4(FlyingPotEntity*);
|
||||
void FlyingPot_Action5(FlyingPotEntity*);
|
||||
void FlyingPot_Action6(FlyingPotEntity*);
|
||||
|
||||
void sub_08037408(FlyingPotEntity*);
|
||||
void sub_08037418(FlyingPotEntity*);
|
||||
@@ -99,7 +100,7 @@ void FlyingPot_OnCollision(FlyingPotEntity* this) {
|
||||
super->zVelocity = Q_16_16(2.625);
|
||||
super->spritePriority.b1 = 1;
|
||||
|
||||
SetBottomTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
|
||||
SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
|
||||
} else if (super->z.HALF.HI != 0) {
|
||||
sub_08037408(this);
|
||||
}
|
||||
@@ -145,7 +146,7 @@ void FlyingPot_SubAction2(FlyingPotEntity* this) {
|
||||
COLLISION_OFF(super);
|
||||
super->spriteOffsetX = 0;
|
||||
|
||||
SetBottomTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
|
||||
SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
|
||||
}
|
||||
|
||||
if (sub_0806F520(super)) {
|
||||
@@ -169,23 +170,23 @@ void FlyingPot_SubAction5(FlyingPotEntity* this) {
|
||||
}
|
||||
|
||||
void FlyingPot_Init(FlyingPotEntity* this) {
|
||||
u32 tile;
|
||||
u32 tilePos;
|
||||
|
||||
super->action = FLYING_POT_ACTION_1;
|
||||
super->gustJarFlags = 2;
|
||||
super->y.HALF.HI += 3;
|
||||
|
||||
tile = TILE(super->x.HALF.HI, super->y.HALF.HI);
|
||||
this->tileIndex = GetTileIndex(tile, super->collisionLayer);
|
||||
SetBottomTile(0x4000, tile, super->collisionLayer);
|
||||
tilePos = TILE(super->x.HALF.HI, super->y.HALF.HI);
|
||||
this->tileIndex = GetTileIndex(tilePos, super->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_0, tilePos, super->collisionLayer);
|
||||
InitializeAnimation(super, 5);
|
||||
}
|
||||
|
||||
void FlyingPot_Action1(FlyingPotEntity* this) {
|
||||
sub_08037418(this);
|
||||
|
||||
if (GetTileTypeByEntity(super) != 0x4000) {
|
||||
SetBottomTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
|
||||
if (GetTileTypeAtEntity(super) != SPECIAL_TILE_0) {
|
||||
SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
|
||||
sub_08037408(this);
|
||||
}
|
||||
|
||||
@@ -210,7 +211,7 @@ void FlyingPot_Action2(FlyingPotEntity* this) {
|
||||
super->collisionMask = 0xF;
|
||||
super->hitbox = &gUnk_080FD34C;
|
||||
|
||||
SetBottomTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
|
||||
SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,10 +255,10 @@ void sub_08037408(FlyingPotEntity* this) {
|
||||
}
|
||||
|
||||
void sub_08037418(FlyingPotEntity* this) {
|
||||
u32 tile = COORD_TO_TILE(super);
|
||||
u32 tilePos = COORD_TO_TILE(super);
|
||||
|
||||
if (GetTileIndex(tile, super->collisionLayer) == 0x4067) {
|
||||
SetBottomTile(this->tileIndex, tile, super->collisionLayer);
|
||||
if (GetTileIndex(tilePos, super->collisionLayer) == SPECIAL_TILE_103) {
|
||||
SetTile(this->tileIndex, tilePos, super->collisionLayer);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
+16
-15
@@ -9,11 +9,12 @@
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "hitbox.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
Entity base;
|
||||
u8 filler[0xc];
|
||||
u16 unk_0x74;
|
||||
u16 tileIndex;
|
||||
u8 unk_0x76;
|
||||
} FlyingSkullEntity;
|
||||
|
||||
@@ -50,7 +51,7 @@ void FlyingSkull_OnCollision(FlyingSkullEntity* this) {
|
||||
COLLISION_OFF(super);
|
||||
super->zVelocity = Q_16_16(2.625);
|
||||
super->spritePriority.b1 = 1;
|
||||
SetBottomTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
|
||||
SetTile(this->tileIndex, COORD_TO_TILE(super), super->collisionLayer);
|
||||
} else if (super->z.HALF.HI) {
|
||||
sub_0803A0E0(this);
|
||||
}
|
||||
@@ -89,7 +90,7 @@ void sub_08039CE0(FlyingSkullEntity* this) {
|
||||
super->timer = 1;
|
||||
super->z.HALF.HI = -1;
|
||||
super->spriteOffsetX = 0;
|
||||
SetBottomTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
|
||||
SetTile(this->tileIndex, COORD_TO_TILE(super), super->collisionLayer);
|
||||
}
|
||||
|
||||
if (sub_0806F520(super)) {
|
||||
@@ -113,15 +114,15 @@ void sub_08039D6C(FlyingSkullEntity* this) {
|
||||
}
|
||||
|
||||
void sub_08039D74(FlyingSkullEntity* this) {
|
||||
u32 tmp;
|
||||
u32 tilePos;
|
||||
super->action = 1;
|
||||
super->gustJarFlags = 2;
|
||||
super->carryFlags = 0;
|
||||
super->y.HALF.HI += 3;
|
||||
|
||||
tmp = COORD_TO_TILE(super);
|
||||
this->unk_0x74 = GetTileIndex(tmp, super->collisionLayer);
|
||||
SetBottomTile(0x4060, tmp, super->collisionLayer);
|
||||
tilePos = COORD_TO_TILE(super);
|
||||
this->tileIndex = GetTileIndex(tilePos, super->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_96, tilePos, super->collisionLayer);
|
||||
InitializeAnimation(super, 0);
|
||||
}
|
||||
|
||||
@@ -129,8 +130,8 @@ void sub_08039DD8(FlyingSkullEntity* this) {
|
||||
sub_0803A100(this);
|
||||
|
||||
if (super->type == 0) {
|
||||
if (GetTileTypeByEntity(super) == 0x4073) {
|
||||
SetBottomTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
|
||||
if (GetTileTypeAtEntity(super) == SPECIAL_TILE_115) {
|
||||
SetTile(this->tileIndex, COORD_TO_TILE(super), super->collisionLayer);
|
||||
sub_0803A0E0(this);
|
||||
}
|
||||
|
||||
@@ -147,7 +148,7 @@ void sub_08039DD8(FlyingSkullEntity* this) {
|
||||
if (player != NULL) {
|
||||
player->type2 = 1;
|
||||
CopyPosition(super, player);
|
||||
SetBottomTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
|
||||
SetTile(this->tileIndex, COORD_TO_TILE(super), super->collisionLayer);
|
||||
DeleteEntity(super);
|
||||
}
|
||||
}
|
||||
@@ -167,7 +168,7 @@ void sub_08039EE4(FlyingSkullEntity* this) {
|
||||
super->hitbox = (Hitbox*)&gUnk_080FD340;
|
||||
gPlayerEntity.base.animationState;
|
||||
this->unk_0x76 = gPlayerEntity.base.animationState;
|
||||
SetBottomTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
|
||||
SetTile(this->tileIndex, COORD_TO_TILE(super), super->collisionLayer);
|
||||
}
|
||||
|
||||
void sub_08039F4C(FlyingSkullEntity* this) {
|
||||
@@ -200,7 +201,7 @@ void sub_08039FAC(FlyingSkullEntity* this) {
|
||||
super->hitType = 0xa0;
|
||||
super->collisionMask = 0xf;
|
||||
super->hitbox = (Hitbox*)&gUnk_080FD34C;
|
||||
SetBottomTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
|
||||
SetTile(this->tileIndex, COORD_TO_TILE(super), super->collisionLayer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,9 +248,9 @@ void sub_0803A0E0(FlyingSkullEntity* this) {
|
||||
}
|
||||
|
||||
void sub_0803A100(FlyingSkullEntity* this) {
|
||||
u32 tile = COORD_TO_TILE(super);
|
||||
if (GetTileIndex(tile, super->collisionLayer) == 0x4067) {
|
||||
SetBottomTile(this->unk_0x74, tile, super->collisionLayer);
|
||||
u32 tilePos = COORD_TO_TILE(super);
|
||||
if (GetTileIndex(tilePos, super->collisionLayer) == SPECIAL_TILE_103) {
|
||||
SetTile(this->tileIndex, tilePos, super->collisionLayer);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
+39
-96
@@ -5,20 +5,20 @@
|
||||
* @brief Gyorg Female enemy
|
||||
*/
|
||||
#include "asm.h"
|
||||
#include "beanstalkSubtask.h"
|
||||
#include "collision.h"
|
||||
#include "enemy.h"
|
||||
#include "enemy/gyorg.h"
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "sound.h"
|
||||
#include "assets/map_offsets.h"
|
||||
|
||||
extern u8 gEntCount;
|
||||
extern u8 gMapDataTopSpecial[];
|
||||
|
||||
extern u16 gMapDataBottomSpecial[];
|
||||
|
||||
extern void sub_080197D4(const void*);
|
||||
|
||||
extern u32 sub_08000E62(u32);
|
||||
extern void RegisterTransitionManager(void*, void (*)(), void (*)());
|
||||
|
||||
@@ -33,12 +33,12 @@ void sub_08046518(void);
|
||||
void sub_080467DC(GyorgFemaleEntity*);
|
||||
|
||||
extern u8 gUpdateVisibleTiles;
|
||||
extern u8 gUnk_080B3E80[];
|
||||
extern u8 gMapTileTypeToCollisionData[];
|
||||
|
||||
extern const u8 gUnk_080D1A94[];
|
||||
extern const u8 gUnk_080D1AAC[];
|
||||
extern const u8 gUnk_080D1AC4[];
|
||||
extern const u8 gUnk_080D1ADC[];
|
||||
extern const MapDataDefinition gGyorgMapping0[];
|
||||
extern const MapDataDefinition gGyorgMapping1[];
|
||||
extern const MapDataDefinition gGyorgMapping2[];
|
||||
extern const MapDataDefinition gGyorgMapping3[];
|
||||
|
||||
void GyorgFemale_Setup(GyorgFemaleEntity* this);
|
||||
void GyorgFemale_Action1(GyorgFemaleEntity* this);
|
||||
@@ -225,16 +225,16 @@ void sub_08046498(GyorgFemaleEntity* this) {
|
||||
#endif
|
||||
|
||||
void sub_080464C0(GyorgFemaleEntity* this) {
|
||||
static const void* const gUnk_080D1A74[] = {
|
||||
gUnk_080D1A94,
|
||||
gUnk_080D1AAC,
|
||||
gUnk_080D1AC4,
|
||||
gUnk_080D1ADC,
|
||||
static const MapDataDefinition* const gyorgMappings[] = {
|
||||
gGyorgMapping0,
|
||||
gGyorgMapping1,
|
||||
gGyorgMapping2,
|
||||
gGyorgMapping3,
|
||||
};
|
||||
s32 i;
|
||||
u8* src;
|
||||
u8* dst;
|
||||
sub_080197D4(gUnk_080D1A74[super->animationState >> 6]);
|
||||
LoadMapData((MapDataDefinition*)gyorgMappings[super->animationState >> 6]);
|
||||
sub_08046518();
|
||||
for (i = 0x20, src = ((u8*)&gMapDataBottomSpecial), dst = ((u8*)&gMapDataBottomSpecial) + 0x3260; i != 0; i--) {
|
||||
MemCopy(src, dst, 0x40);
|
||||
@@ -248,25 +248,25 @@ void sub_080464C0(GyorgFemaleEntity* this) {
|
||||
#define sub_08046518_offset 0x658
|
||||
|
||||
void sub_08046518(void) {
|
||||
u16* ptr = gMapTop.metatileTypes;
|
||||
u16* sl = &gMapTop.mapData[sub_08046518_offset];
|
||||
u16* stack1 = &gMapTop.mapDataOriginal[sub_08046518_offset];
|
||||
u8* stack2 = &gMapTop.unkData3[sub_08046518_offset];
|
||||
u8* r6 = &gMapTop.collisionData[sub_08046518_offset];
|
||||
u16* tileTypes = gMapTop.tileTypes;
|
||||
u16* mapData = &gMapTop.mapData[sub_08046518_offset];
|
||||
u16* mapDataOriginal = &gMapTop.mapDataOriginal[sub_08046518_offset];
|
||||
u8* actTiles = &gMapTop.actTiles[sub_08046518_offset];
|
||||
u8* collisionData = &gMapTop.collisionData[sub_08046518_offset];
|
||||
u32 i;
|
||||
for (i = 0x10; i != 0; i--) {
|
||||
u32 j;
|
||||
for (j = 0x10; j != 0; j--) {
|
||||
u16 new_var;
|
||||
stack1[j] = sl[j];
|
||||
new_var = ptr[sl[j]];
|
||||
stack2[j] = gUnk_080B37A0[new_var];
|
||||
r6[j] = gUnk_080B3E80[new_var];
|
||||
u16 tileType;
|
||||
mapDataOriginal[j] = mapData[j];
|
||||
tileType = tileTypes[mapData[j]];
|
||||
actTiles[j] = gMapTileTypeToActTile[tileType];
|
||||
collisionData[j] = gMapTileTypeToCollisionData[tileType];
|
||||
}
|
||||
sl += 0x40;
|
||||
stack1 += 0x40;
|
||||
stack2 += 0x40;
|
||||
r6 += 0x40;
|
||||
mapData += 0x40;
|
||||
mapDataOriginal += 0x40;
|
||||
actTiles += 0x40;
|
||||
collisionData += 0x40;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,81 +290,24 @@ void sub_0804660C(GyorgFemaleEntity* this, u32 unk1) {
|
||||
super->y.HALF.HI = p[1] + gRoomControls.origin_y;
|
||||
}
|
||||
|
||||
// todo: correct type
|
||||
const u8 gUnk_080D1A94[] = {
|
||||
#if defined(JP) || defined(DEMO_JP)
|
||||
0x7C,
|
||||
#elif defined(EU)
|
||||
0x50,
|
||||
#else
|
||||
0x08,
|
||||
#endif
|
||||
0x41, 0x22, 0x80, 0xE0, 0x9E, 0x01, 0x02, 0x00, 0x08, 0x00, 0x80,
|
||||
#if defined(JP) || defined(DEMO_JP)
|
||||
0x2C, 0xD3,
|
||||
#elif defined(EU)
|
||||
0x00, 0xD3,
|
||||
#else
|
||||
0xB8, 0xD2,
|
||||
#endif
|
||||
0x22, 0x00, 0x54, 0xB6, 0x00, 0x02, 0x80, 0x1F, 0x00, 0x80,
|
||||
const MapDataDefinition gGyorgMapping0[] = {
|
||||
{ MAP_MULTIPLE | offset_gyorgMapping_0_bottom, gMapDataBottomSpecial, MAP_COMPRESSED | 2048 },
|
||||
{ offset_gAreaRoomMap_PalaceOfWindsBoss_0_top, gMapTop.mapData, MAP_COMPRESSED | 8064 },
|
||||
};
|
||||
|
||||
const u8 gUnk_080D1AAC[] = {
|
||||
#if defined(JP) || defined(DEMO_JP)
|
||||
0xFC,
|
||||
#elif defined(EU)
|
||||
0xD0,
|
||||
#else
|
||||
0x88,
|
||||
#endif
|
||||
0x3D, 0x22, 0x80, 0xE0, 0x9E, 0x01, 0x02, 0x00, 0x08, 0x00, 0x80,
|
||||
#if defined(JP) || defined(DEMO_JP)
|
||||
0xF8,
|
||||
#elif defined(EU)
|
||||
0xCC,
|
||||
#else
|
||||
0x84,
|
||||
#endif
|
||||
0xD6, 0x22, 0x00, 0x54, 0xB6, 0x00, 0x02, 0x80, 0x1F, 0x00, 0x80,
|
||||
const MapDataDefinition gGyorgMapping1[] = {
|
||||
{ MAP_MULTIPLE | offset_gyorgMapping_1_bottom, gMapDataBottomSpecial, MAP_COMPRESSED | 2048 },
|
||||
{ offset_gyorgRoomMap_1_top, gMapTop.mapData, MAP_COMPRESSED | 8064 },
|
||||
};
|
||||
|
||||
const u8 gUnk_080D1AC4[] = {
|
||||
#if defined(JP) || defined(DEMO_JP)
|
||||
0xE4,
|
||||
#elif defined(EU)
|
||||
0xB8,
|
||||
#else
|
||||
0x70,
|
||||
#endif
|
||||
0x36, 0x22, 0x80, 0xE0, 0x9E, 0x01, 0x02, 0x00, 0x08, 0x00, 0x80,
|
||||
#if defined(JP) || defined(DEMO_JP)
|
||||
0xC0,
|
||||
#elif defined(EU)
|
||||
0x94,
|
||||
#else
|
||||
0x4C,
|
||||
#endif
|
||||
0xDA, 0x22, 0x00, 0x54, 0xB6, 0x00, 0x02, 0x80, 0x1F, 0x00, 0x80,
|
||||
const MapDataDefinition gGyorgMapping2[] = {
|
||||
{ MAP_MULTIPLE | offset_gyorgMapping_2_bottom, gMapDataBottomSpecial, MAP_COMPRESSED | 2048 },
|
||||
{ offset_gyorgRoomMap_2_top, gMapTop.mapData, MAP_COMPRESSED | 8064 },
|
||||
};
|
||||
|
||||
const u8 gUnk_080D1ADC[] = {
|
||||
#if defined(JP) || defined(DEMO_JP)
|
||||
0x78,
|
||||
#elif defined(EU)
|
||||
0x4C,
|
||||
#else
|
||||
0x04,
|
||||
#endif
|
||||
0x3A, 0x22, 0x80, 0xE0, 0x9E, 0x01, 0x02, 0x00, 0x08, 0x00, 0x80,
|
||||
#if defined(JP) || defined(DEMO_JP)
|
||||
0x88,
|
||||
#elif defined(EU)
|
||||
0x5C,
|
||||
#else
|
||||
0x14,
|
||||
#endif
|
||||
0xDE, 0x22, 0x00, 0x54, 0xB6, 0x00, 0x02, 0x80, 0x1F, 0x00, 0x80,
|
||||
const MapDataDefinition gGyorgMapping3[] = {
|
||||
{ MAP_MULTIPLE | offset_gyorgMapping_3_bottom, gMapDataBottomSpecial, MAP_COMPRESSED | 2048 },
|
||||
{ offset_gyorgRoomMap_3_top, gMapTop.mapData, MAP_COMPRESSED | 8064 },
|
||||
};
|
||||
|
||||
void GyorgFemale_SpawnChildren(GyorgFemaleEntity* this, bool32 unlimit_tmp) {
|
||||
|
||||
+18
-14
@@ -260,7 +260,7 @@ void sub_08046AE8(GyorgMaleEntity* this) {
|
||||
}
|
||||
|
||||
void sub_08046B18(GyorgMaleEntity* this) {
|
||||
u32 tmp = CalcOffsetAngle(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI);
|
||||
u32 tmp = CalculateDirectionFromOffsets(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI);
|
||||
if (tmp != super->direction) {
|
||||
if (((tmp - super->direction) & 0xFF) > 0x80) {
|
||||
this->unk_76 -= 0x100;
|
||||
@@ -283,13 +283,14 @@ void sub_08046B8C(GyorgMaleEntity* this) {
|
||||
this->unk_82 = gRoomControls.origin_y + 0x210;
|
||||
sub_08047D88(this);
|
||||
} else {
|
||||
super->direction = CalcOffsetAngle(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI);
|
||||
super->direction =
|
||||
CalculateDirectionFromOffsets(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI);
|
||||
sub_08047DF0(this, ((0x100 - super->direction) & 0xFF) << 8);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08046C04(GyorgMaleEntity* this) {
|
||||
u32 tmp = CalcOffsetAngle(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI);
|
||||
u32 tmp = CalculateDirectionFromOffsets(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI);
|
||||
if (tmp != super->direction) {
|
||||
if (((tmp - super->direction) & 0xFF) > 0x80) {
|
||||
this->unk_76 -= 0x100;
|
||||
@@ -311,7 +312,8 @@ void sub_08046C88(GyorgMaleEntity* this) {
|
||||
sub_08048178(this, sub_08048158(this->unk_70));
|
||||
sub_08047D88(this);
|
||||
} else {
|
||||
super->direction = CalcOffsetAngle(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI);
|
||||
super->direction =
|
||||
CalculateDirectionFromOffsets(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI);
|
||||
sub_08047DF0(this, ((0x100 - super->direction) & 0xFF) << 8);
|
||||
}
|
||||
}
|
||||
@@ -348,7 +350,7 @@ void sub_08046D44(GyorgMaleEntity* this) {
|
||||
}
|
||||
|
||||
void sub_08046D98(GyorgMaleEntity* this) {
|
||||
u32 tmp = CalcOffsetAngle(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI);
|
||||
u32 tmp = CalculateDirectionFromOffsets(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI);
|
||||
if (tmp != super->direction) {
|
||||
if (((tmp - super->direction) & 0xFF) > 0x80) {
|
||||
this->unk_76 -= 0x100;
|
||||
@@ -369,7 +371,8 @@ void sub_08046E0C(GyorgMaleEntity* this) {
|
||||
this->unk_76 = super->direction << 8;
|
||||
sub_08047D88(this);
|
||||
} else {
|
||||
super->direction = CalcOffsetAngle(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI);
|
||||
super->direction =
|
||||
CalculateDirectionFromOffsets(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI);
|
||||
sub_08047DF0(this, ((0x100 - super->direction) & 0xFF) << 8);
|
||||
}
|
||||
}
|
||||
@@ -456,7 +459,7 @@ void sub_08046FE8(GyorgMaleEntity* this) {
|
||||
}
|
||||
|
||||
void sub_0804702C(GyorgMaleEntity* this) {
|
||||
u32 tmp = CalcOffsetAngle(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI);
|
||||
u32 tmp = CalculateDirectionFromOffsets(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI);
|
||||
if (((super->direction - tmp + 2) & 0xFF) > 4) {
|
||||
if ((tmp - super->direction) & 0x80) {
|
||||
super->direction--;
|
||||
@@ -607,7 +610,7 @@ void sub_080473B8(GyorgMaleEntity* this) {
|
||||
}
|
||||
|
||||
void sub_080473F0(GyorgMaleEntity* this) {
|
||||
u32 tmp = CalcOffsetAngle(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI);
|
||||
u32 tmp = CalculateDirectionFromOffsets(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI);
|
||||
if (((super->direction - tmp + 2) & 0xFF) > 4) {
|
||||
s32 tmp2 = tmp - super->direction;
|
||||
if (tmp2 & 0x80) {
|
||||
@@ -791,7 +794,7 @@ void sub_080477F0(GyorgMaleEntity* this) {
|
||||
if (super->speed < 0x300) {
|
||||
super->speed += 8;
|
||||
}
|
||||
super->direction = CalcOffsetAngle(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI);
|
||||
super->direction = CalculateDirectionFromOffsets(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI);
|
||||
sub_08047E48(this);
|
||||
if (!EntityWithinDistance(super, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI, 0x80)) {
|
||||
super->action = 2;
|
||||
@@ -896,7 +899,7 @@ void sub_08047978(GyorgMaleEntity* this) {
|
||||
|
||||
void sub_08047B08(GyorgMaleEntity* this) {
|
||||
sub_08047D88(this);
|
||||
super->direction = CalcOffsetAngle(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI);
|
||||
super->direction = CalculateDirectionFromOffsets(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI);
|
||||
super->speed = 0x200;
|
||||
sub_08047E58(this);
|
||||
if (!EntityWithinDistance(super, this->unk_80, this->unk_82, 4))
|
||||
@@ -1066,8 +1069,9 @@ void sub_08047EA4(GyorgMaleEntity* this, u32 unk1) {
|
||||
return;
|
||||
if (this->unk_7c & 1) {
|
||||
tmp2 = sub_08047F68(this) << 8;
|
||||
dir = CalcOffsetAngle(gPlayerEntity.base.x.HALF.HI - super->x.HALF.HI,
|
||||
gPlayerEntity.base.y.HALF.HI - super->y.HALF.HI);
|
||||
dir = CalculateDirectionFromOffsets(gPlayerEntity.base.x.HALF.HI - super->x.HALF.HI,
|
||||
|
||||
gPlayerEntity.base.y.HALF.HI - super->y.HALF.HI);
|
||||
tmp = dir - (tmp / 256);
|
||||
tmp &= 0xFF;
|
||||
gPlayerEntity.base.x.WORD += (gSineTable[tmp] - gSineTable[dir]) * tmp2;
|
||||
@@ -1149,8 +1153,8 @@ void sub_08048004(GyorgMaleEntity* this) {
|
||||
if (b != 3) {
|
||||
if (EntityWithinDistance(&gPlayerEntity.base, super->x.HALF.HI, super->y.HALF.HI, 0x24)) {
|
||||
if (!(this->unk_7c & 2)) {
|
||||
u32 tmp = CalcOffsetAngle(gPlayerEntity.base.x.HALF.HI - super->x.HALF.HI,
|
||||
gPlayerEntity.base.y.HALF.HI - super->y.HALF.HI);
|
||||
u32 tmp = CalculateDirectionFromOffsets(gPlayerEntity.base.x.HALF.HI - super->x.HALF.HI,
|
||||
gPlayerEntity.base.y.HALF.HI - super->y.HALF.HI);
|
||||
gPlayerEntity.base.x.WORD = super->x.WORD + (gSineTable[tmp] * 9216);
|
||||
gPlayerEntity.base.y.WORD = super->y.WORD - (gSineTable[tmp + 0x40] * 9216);
|
||||
}
|
||||
|
||||
@@ -344,15 +344,15 @@ bool32 sub_0802C0E8(HelmasaurEntity* this) {
|
||||
s32 y = super->y.HALF.HI + super->hitbox->offset_y + ptr[1] * 6;
|
||||
|
||||
u8* layer = super->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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+14
-15
@@ -4,8 +4,10 @@
|
||||
*
|
||||
* @brief Leever enemy
|
||||
*/
|
||||
#include "asm.h"
|
||||
#include "enemy.h"
|
||||
#include "physics.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -13,9 +15,6 @@ typedef struct {
|
||||
/*0x74*/ u16 unk_74;
|
||||
} LeeverEntity;
|
||||
|
||||
extern u32 sub_080B1B18(s32, s32, u32);
|
||||
extern u32 sub_080B1AB4(s32, s32, u32);
|
||||
|
||||
extern Entity* gUnk_020000B0;
|
||||
|
||||
bool32 Leever_PlayerInRange(Entity*, s32);
|
||||
@@ -126,23 +125,23 @@ void Leever_DigDown(LeeverEntity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_0801FDE4(Entity* entity, s32 x, s32 y) {
|
||||
u32 uVar3;
|
||||
bool32 sub_0801FDE4(Entity* entity, s32 x, s32 y) {
|
||||
u32 actTile;
|
||||
const u16* puVar4;
|
||||
|
||||
if (sub_080B1B18(x, y, gUnk_020000B0->collisionLayer) != 0) {
|
||||
return 0;
|
||||
if (GetCollisionDataAtWorldCoords(x, y, gUnk_020000B0->collisionLayer) != 0) {
|
||||
return FALSE;
|
||||
} else {
|
||||
uVar3 = sub_080B1AB4(x, y, gUnk_020000B0->collisionLayer);
|
||||
actTile = GetActTileAtWorldCoords(x, y, gUnk_020000B0->collisionLayer);
|
||||
for (puVar4 = gUnk_080CA4CA; *puVar4 != (u16)-1;) {
|
||||
if (*puVar4++ == uVar3) {
|
||||
if (*puVar4++ == actTile) {
|
||||
entity->x.HALF.HI = (x & 0xfff0) + 8;
|
||||
entity->y.HALF.HI = (y & 0xfff0) + 8;
|
||||
entity->collisionLayer = gUnk_020000B0->collisionLayer;
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,10 +211,10 @@ const s8 gLeeverDrift[] = {
|
||||
};
|
||||
|
||||
const u16 gUnk_080CA4CA[] = {
|
||||
0x000A,
|
||||
0x0009,
|
||||
0x000C,
|
||||
0x000B,
|
||||
ACT_TILE_10,
|
||||
ACT_TILE_9,
|
||||
ACT_TILE_12,
|
||||
ACT_TILE_11,
|
||||
0xFFFF,
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
@@ -345,7 +345,7 @@ void sub_08029DE4(MadderpillarEntity* this) {
|
||||
}
|
||||
|
||||
void sub_08029E0C(MadderpillarEntity* this) {
|
||||
u32 tile;
|
||||
u32 tilePos;
|
||||
s32 uVar4;
|
||||
s32 iVar3;
|
||||
u32 i;
|
||||
@@ -358,10 +358,10 @@ void sub_08029E0C(MadderpillarEntity* this) {
|
||||
ptr = &gUnk_080CCDC8[uVar2];
|
||||
uVar4 = (Random() & 1) * 2 - 1;
|
||||
iVar3 = ((s32)Random() & 0xf) % 3;
|
||||
tile = COORD_TO_TILE(super);
|
||||
tilePos = COORD_TO_TILE(super);
|
||||
for (i = 0; i < 3; i++) {
|
||||
dir = ptr[iVar3];
|
||||
if (sub_080B1B44(gUnk_080B4488[dir >> 3] + tile, super->collisionLayer) == 0) {
|
||||
if (GetCollisionDataAtTilePos(gUnk_080B4488[dir >> 3] + tilePos, super->collisionLayer) == 0) {
|
||||
local_24 = dir;
|
||||
if (super->direction - this->unk_74 != dir - super->direction)
|
||||
break;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "screenTransitions.h"
|
||||
#include "script.h"
|
||||
#include "structures.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -96,7 +97,7 @@ void sub_08034CC4(MazaalMacroEntity* this) {
|
||||
this->unk_78 = 0x4b0;
|
||||
sub_08034F70(this);
|
||||
InitializeAnimation(super, super->type);
|
||||
SetBottomTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_34, COORD_TO_TILE(super), super->collisionLayer);
|
||||
entity = CreateEnemy(MAZAAL_MACRO, 2);
|
||||
if (entity != NULL) {
|
||||
super->child = entity;
|
||||
@@ -284,11 +285,11 @@ u32 sub_08035084(MazaalMacroEntity* this) {
|
||||
}
|
||||
|
||||
void sub_08035120(MazaalMacroEntity* this) {
|
||||
s32 tile;
|
||||
s32 tilePos;
|
||||
u32 i;
|
||||
|
||||
tile = COORD_TO_TILE(super);
|
||||
tilePos = COORD_TO_TILE(super);
|
||||
for (i = 0; i < 0x18; i++) {
|
||||
sub_0807B600(tile + gUnk_080CEED8[i]);
|
||||
sub_0807B600(tilePos + gUnk_080CEED8[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "collision.h"
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -36,7 +37,7 @@ typedef struct {
|
||||
} MoldwormEntity;
|
||||
|
||||
extern void SoundReqClipped(Entity*, u32);
|
||||
extern bool32 sub_08023A38(u32);
|
||||
extern bool32 sub_08023A38(u32 tileType);
|
||||
|
||||
void sub_08023990(MoldwormEntity*, u32, u32);
|
||||
void sub_08023A88(MoldwormEntity*, u32);
|
||||
@@ -185,7 +186,7 @@ void sub_08023288(MoldwormEntity* this) {
|
||||
for (i = 0; i < 0x10; i++) {
|
||||
u32 x = gPlayerEntity.base.x.HALF.HI + gUnk_080CBC70[idx + 0];
|
||||
u32 y = gPlayerEntity.base.y.HALF.HI + gUnk_080CBC70[idx + 1];
|
||||
if (sub_08023A38(GetTileTypeByPos(x, y, gPlayerEntity.base.collisionLayer))) {
|
||||
if (sub_08023A38(GetTileTypeAtWorldCoords(x, y, gPlayerEntity.base.collisionLayer))) {
|
||||
sub_08023990(this, x, y);
|
||||
return;
|
||||
}
|
||||
@@ -220,7 +221,7 @@ void sub_08023398(MoldwormEntity* this) {
|
||||
}
|
||||
|
||||
if (--this->unk_78.HWORD == 0) {
|
||||
if (sub_08023A38(GetTileTypeByEntity(super))) {
|
||||
if (sub_08023A38(GetTileTypeAtEntity(super))) {
|
||||
super->action = 5;
|
||||
this->unk_7f = 0;
|
||||
COLLISION_OFF(super);
|
||||
@@ -513,11 +514,11 @@ void sub_080239F0(MoldwormEntity* this) {
|
||||
}
|
||||
|
||||
bool32 sub_08023A38(u32 tileType) {
|
||||
if (tileType == 0x1a || tileType == 0x29) {
|
||||
if (tileType == TILE_TYPE_26 || tileType == TILE_TYPE_41) {
|
||||
return TRUE;
|
||||
} else {
|
||||
tileType = gUnk_080B37A0[tileType];
|
||||
if (tileType == 9 || tileType == 11 || tileType == 10 || tileType == 12) {
|
||||
tileType = gMapTileTypeToActTile[tileType];
|
||||
if (tileType == ACT_TILE_9 || tileType == ACT_TILE_11 || tileType == ACT_TILE_10 || tileType == ACT_TILE_12) {
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
|
||||
+19
-15
@@ -167,12 +167,13 @@ void OctorokBoss_Hit_SubAction1(OctorokBossEntity* this) {
|
||||
if (diffX > 8 || diffY > 8) {
|
||||
this->heap->field_0x2 = 1;
|
||||
#if defined(JP) || defined(DEMO_JP) || defined(EU)
|
||||
super->direction = ((s32)CalcOffsetAngle((((gRoomControls.origin_x + 0x108) << 0x10) - super->x.WORD),
|
||||
(((gRoomControls.origin_y + 0x88) << 0x10) - super->y.WORD))) >>
|
||||
3;
|
||||
super->direction =
|
||||
((s32)CalculateDirectionFromOffsets((((gRoomControls.origin_x + 0x108) << 0x10) - super->x.WORD),
|
||||
(((gRoomControls.origin_y + 0x88) << 0x10) - super->y.WORD))) >>
|
||||
3;
|
||||
#else
|
||||
super->direction = ((s32)CalcOffsetAngle(gRoomControls.origin_x + 0x108 - super->x.HALF.HI,
|
||||
gRoomControls.origin_y + 0x88 - super->y.HALF.HI)) >>
|
||||
super->direction = ((s32)CalculateDirectionFromOffsets(gRoomControls.origin_x + 0x108 - super->x.HALF.HI,
|
||||
gRoomControls.origin_y + 0x88 - super->y.HALF.HI)) >>
|
||||
3;
|
||||
#endif
|
||||
super->speed = 0x100;
|
||||
@@ -689,7 +690,8 @@ void OctorokBoss_Action1_AimTowardsPlayer(OctorokBossEntity* this) {
|
||||
s32 tmp1;
|
||||
s32 tmp2;
|
||||
|
||||
tmp1 = (u8)(CalcOffsetAngle(gPlayerEntity.base.x.WORD - super->x.WORD, gPlayerEntity.base.y.WORD - super->y.WORD) -
|
||||
tmp1 = (u8)(CalculateDirectionFromOffsets(gPlayerEntity.base.x.WORD - super->x.WORD,
|
||||
gPlayerEntity.base.y.WORD - super->y.WORD) -
|
||||
(((u8)(-this->angle.HALF.HI) ^ 0x80)));
|
||||
if (IS_FROZEN(this) == FALSE) {
|
||||
tmp2 = 8;
|
||||
@@ -898,7 +900,9 @@ void OctorokBoss_ExecuteAttackVacuum(OctorokBossEntity* this) {
|
||||
|
||||
if (this->unk_80 == 0) {
|
||||
super->direction =
|
||||
CalcOffsetAngle(gPlayerEntity.base.x.WORD - super->x.WORD, gPlayerEntity.base.y.WORD - super->y.WORD);
|
||||
|
||||
CalculateDirectionFromOffsets(gPlayerEntity.base.x.WORD - super->x.WORD,
|
||||
gPlayerEntity.base.y.WORD - super->y.WORD);
|
||||
tmp = ((u8) - (this->angle.HALF.HI + 0x80)) - super->direction;
|
||||
if (tmp < 0) {
|
||||
tmp = -tmp;
|
||||
@@ -911,9 +915,9 @@ void OctorokBoss_ExecuteAttackVacuum(OctorokBossEntity* this) {
|
||||
if (sub_0806FC80(super, &gPlayerEntity.base, 0x48) != 0) {
|
||||
this->unk_80 = 1;
|
||||
this->timer = 2;
|
||||
this->heap->targetAngle =
|
||||
CalcOffsetAngle((gRoomControls.origin_x + 0x108) * 0x10000 - super->x.WORD,
|
||||
(gRoomControls.origin_y + 0x88) * 0x10000 - super->y.WORD);
|
||||
this->heap->targetAngle = CalculateDirectionFromOffsets(
|
||||
(gRoomControls.origin_x + 0x108) * 0x10000 - super->x.WORD,
|
||||
(gRoomControls.origin_y + 0x88) * 0x10000 - super->y.WORD);
|
||||
this->heap->targetAngle = (u8) - (this->heap->targetAngle + 0x80);
|
||||
SoundReq(SFX_ED);
|
||||
}
|
||||
@@ -956,7 +960,8 @@ void OctorokBoss_ExecuteAttackVacuum(OctorokBossEntity* this) {
|
||||
} else {
|
||||
this->timer--;
|
||||
if ((gPlayerState.flags == PL_FROZEN) && (this->timer == 0x3c)) {
|
||||
tmp = CalcOffsetAngle(gPlayerEntity.base.x.WORD - super->x.WORD, gPlayerEntity.base.y.WORD - super->y.WORD);
|
||||
tmp = CalculateDirectionFromOffsets(gPlayerEntity.base.x.WORD - super->x.WORD,
|
||||
gPlayerEntity.base.y.WORD - super->y.WORD);
|
||||
if ((u8)((tmp - ((u8) - this->angle.HALF.HI ^ 0x80))) > 0x80) {
|
||||
this->heap->targetAngle = this->angle.HALF.HI + 0x30;
|
||||
} else {
|
||||
@@ -1111,7 +1116,6 @@ void sub_08036998(OctorokBossEntity* this) {
|
||||
s32 tmp3;
|
||||
s32 a, b;
|
||||
|
||||
// TODO regalloc in this awful structure here
|
||||
tmp2 = &this->timer;
|
||||
tmp = super->subtimer + (tmp3 = (u8)*tmp2);
|
||||
*tmp2 = tmp;
|
||||
@@ -1177,9 +1181,9 @@ void sub_08036AF0(OctorokBossEntity* this, s32 radius, s32 angleSpeed) {
|
||||
heap->tailObjects[index - 1]->base.y.HALF.HI)) {
|
||||
continue;
|
||||
} else {
|
||||
heap->tailObjects[index - 1]->angle.HALF.HI =
|
||||
CalcOffsetAngle(heap->tailObjects[index - 1]->base.x.WORD - heap->tailObjects[index]->base.x.WORD,
|
||||
heap->tailObjects[index - 1]->base.y.WORD - heap->tailObjects[index]->base.y.WORD);
|
||||
heap->tailObjects[index - 1]->angle.HALF.HI = CalculateDirectionFromOffsets(
|
||||
heap->tailObjects[index - 1]->base.x.WORD - heap->tailObjects[index]->base.x.WORD,
|
||||
heap->tailObjects[index - 1]->base.y.WORD - heap->tailObjects[index]->base.y.WORD);
|
||||
tmp = FixedMul(gSineTable[heap->tailObjects[index - 1]->angle.HALF.HI], radius << 4);
|
||||
tmp = FixedDiv(tmp, 0x100);
|
||||
heap->tailObjects[index - 1]->base.x.WORD = heap->tailObjects[index]->base.x.WORD + ((s32)tmp << 8);
|
||||
|
||||
@@ -112,16 +112,16 @@ static void sub_08037D54(Entity* this) {
|
||||
|
||||
void sub_08037E14(Entity* this) {
|
||||
u32 dir;
|
||||
u8* layer;
|
||||
u8* collisionData;
|
||||
const s8* ptr;
|
||||
s32 x, y;
|
||||
this->timer = 8;
|
||||
dir = (GetFacingDirection(this, &gPlayerEntity.base) + 4) & 0x18;
|
||||
layer = (u8*)GetTileBuffer(this->collisionLayer)->collisionData;
|
||||
collisionData = GetLayerByIndex(this->collisionLayer)->collisionData;
|
||||
ptr = gUnk_080CF498 + (dir >> 2);
|
||||
x = this->x.HALF.HI + *ptr;
|
||||
y = this->y.HALF.HI + *(ptr + 1);
|
||||
if (IsTileCollision(layer, x, y, 0)) {
|
||||
if (IsTileCollision(collisionData, x, y, 0)) {
|
||||
this->direction = Random() & 0x18;
|
||||
} else {
|
||||
this->direction = dir;
|
||||
|
||||
+2
-3
@@ -352,7 +352,7 @@ void sub_080244E8(PestoEntity* this) {
|
||||
switch (this->unk_80) {
|
||||
case 0:
|
||||
if (--super->timer == 0) {
|
||||
if (sub_080B1B44(COORD_TO_TILE(super), 1) == 0) {
|
||||
if (GetCollisionDataAtTilePos(COORD_TO_TILE(super), 1) == 0) {
|
||||
this->unk_80++;
|
||||
this->unk_82++;
|
||||
super->subtimer = 0;
|
||||
@@ -446,8 +446,7 @@ void sub_080244E8(PestoEntity* this) {
|
||||
super->timer = 12;
|
||||
this->unk_83 &= ~0x80;
|
||||
entity = super->child;
|
||||
SetBottomTile(((PestoEntity*)entity)->unk_70, COORD_TO_TILE(entity),
|
||||
entity->collisionLayer);
|
||||
SetTile(((PestoEntity*)entity)->unk_70, COORD_TO_TILE(entity), entity->collisionLayer);
|
||||
DeleteEntity(entity);
|
||||
super->z.HALF.HI -= 0xe;
|
||||
this->unk_78 -= 0xe;
|
||||
|
||||
+41
-37
@@ -7,6 +7,7 @@
|
||||
#include "collision.h"
|
||||
#include "enemy.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -21,10 +22,10 @@ typedef struct {
|
||||
/*0x82*/ u8 unk_82;
|
||||
/*0x83*/ u8 unused2[1];
|
||||
/*0x84*/ u16 unk_84;
|
||||
/*0x86*/ u16 unk_86;
|
||||
/*0x86*/ u16 tilePos;
|
||||
} PuffstoolEntity;
|
||||
|
||||
extern u8 gUnk_080B3E80[];
|
||||
extern u8 gMapTileTypeToCollisionData[];
|
||||
|
||||
bool32 sub_080258C4(PuffstoolEntity*);
|
||||
void sub_08025B18(PuffstoolEntity*);
|
||||
@@ -182,7 +183,7 @@ void sub_08025230(PuffstoolEntity* this) {
|
||||
if (sub_0802571C(this)) {
|
||||
super->action = 2;
|
||||
super->timer = 240;
|
||||
this->unk_86 = COORD_TO_TILE(super);
|
||||
this->tilePos = COORD_TO_TILE(super);
|
||||
}
|
||||
} else {
|
||||
this->unk_78--;
|
||||
@@ -190,20 +191,20 @@ void sub_08025230(PuffstoolEntity* this) {
|
||||
}
|
||||
|
||||
void sub_080252E0(PuffstoolEntity* this) {
|
||||
u32 tile;
|
||||
u32 tilePos;
|
||||
|
||||
super->direction = CalculateDirectionTo(super->x.HALF.HI, super->y.HALF.HI, this->unk_7c, this->unk_7e);
|
||||
|
||||
sub_08025C44(this);
|
||||
GetNextFrame(super);
|
||||
|
||||
tile = COORD_TO_TILE(super);
|
||||
if (tile == this->unk_86) {
|
||||
tilePos = COORD_TO_TILE(super);
|
||||
if (tilePos == this->tilePos) {
|
||||
if (--super->timer == 0) {
|
||||
sub_080256B4(this);
|
||||
}
|
||||
} else {
|
||||
this->unk_86 = tile;
|
||||
this->tilePos = tilePos;
|
||||
super->timer = 240;
|
||||
}
|
||||
|
||||
@@ -400,14 +401,14 @@ void sub_080256B4(PuffstoolEntity* this) {
|
||||
|
||||
bool32 sub_0802571C(PuffstoolEntity* this) {
|
||||
RoomControls* ctrl = &gRoomControls;
|
||||
u16 xDiff = (super->x.HALF.HI - ctrl->origin_x + 8) & -0x10;
|
||||
u16 yDiff = (super->y.HALF.HI - ctrl->origin_y + 8) & -0x10;
|
||||
u16 roomX = (super->x.HALF.HI - ctrl->origin_x + 8) & -0x10;
|
||||
u16 roomY = (super->y.HALF.HI - ctrl->origin_y + 8) & -0x10;
|
||||
u16 unk = this->unk_7a;
|
||||
u16 i;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
u16 sVar3 = xDiff + gUnk_080CC020[unk + 0];
|
||||
u16 sVar4 = yDiff + gUnk_080CC020[unk + 1];
|
||||
u16 sVar3 = roomX + gUnk_080CC020[unk + 0];
|
||||
u16 sVar4 = roomY + gUnk_080CC020[unk + 1];
|
||||
|
||||
if (sub_080257EC(this, sVar3, sVar4)) {
|
||||
this->unk_7c = sVar3 + ctrl->origin_x;
|
||||
@@ -427,23 +428,27 @@ bool32 sub_0802571C(PuffstoolEntity* this) {
|
||||
}
|
||||
|
||||
bool32 sub_080257EC(PuffstoolEntity* this, u32 x, u32 y) {
|
||||
u16 tileType = sub_080B1A48(x - 0x00, y - 0x00, super->collisionLayer);
|
||||
if (tileType != 0x312 && gUnk_080B37A0[tileType] != 0x16 && gUnk_080B3E80[tileType] == 0) {
|
||||
u16 tileType = GetTileTypeAtRoomCoords(x - 0x00, y - 0x00, super->collisionLayer);
|
||||
if (tileType != TILE_TYPE_786 && gMapTileTypeToActTile[tileType] != ACT_TILE_22 &&
|
||||
gMapTileTypeToCollisionData[tileType] == 0) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
tileType = sub_080B1A48(x - 0x10, y - 0x00, super->collisionLayer);
|
||||
if (tileType != 0x312 && gUnk_080B37A0[tileType] != 0x16 && gUnk_080B3E80[tileType] == 0) {
|
||||
tileType = GetTileTypeAtRoomCoords(x - 0x10, y - 0x00, super->collisionLayer);
|
||||
if (tileType != TILE_TYPE_786 && gMapTileTypeToActTile[tileType] != ACT_TILE_22 &&
|
||||
gMapTileTypeToCollisionData[tileType] == 0) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
tileType = sub_080B1A48(x - 0x00, y - 0x10, super->collisionLayer);
|
||||
if (tileType != 0x312 && gUnk_080B37A0[tileType] != 0x16 && gUnk_080B3E80[tileType] == 0) {
|
||||
tileType = GetTileTypeAtRoomCoords(x - 0x00, y - 0x10, super->collisionLayer);
|
||||
if (tileType != TILE_TYPE_786 && gMapTileTypeToActTile[tileType] != ACT_TILE_22 &&
|
||||
gMapTileTypeToCollisionData[tileType] == 0) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
tileType = sub_080B1A48(x - 0x10, y - 0x10, super->collisionLayer);
|
||||
if (tileType != 0x312 && gUnk_080B37A0[tileType] != 0x16 && gUnk_080B3E80[tileType] == 0) {
|
||||
tileType = GetTileTypeAtRoomCoords(x - 0x10, y - 0x10, super->collisionLayer);
|
||||
if (tileType != TILE_TYPE_786 && gMapTileTypeToActTile[tileType] != ACT_TILE_22 &&
|
||||
gMapTileTypeToCollisionData[tileType] == 0) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -477,37 +482,36 @@ bool32 sub_080258C4(PuffstoolEntity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
// regalloc
|
||||
bool32 sub_0802594C(PuffstoolEntity* this, u32 param_2) {
|
||||
s16 xDiff;
|
||||
s16 yDiff;
|
||||
s16 iVar9;
|
||||
u32 uVar1;
|
||||
s16 x;
|
||||
u32 layer;
|
||||
const s8* unk = gUnk_080CC090[param_2];
|
||||
uVar1 = super->collisionLayer;
|
||||
layer = super->collisionLayer;
|
||||
xDiff = (super->x.HALF.HI - gRoomControls.origin_x + 8) & -0x10;
|
||||
yDiff = (super->y.HALF.HI - gRoomControls.origin_y + 8) & -0x10;
|
||||
do {
|
||||
u8 bVar7;
|
||||
u8 bVar4;
|
||||
s16 iVar11;
|
||||
s16 y;
|
||||
u8 bVar5;
|
||||
u8 bVar6;
|
||||
iVar9 = xDiff + unk[0];
|
||||
iVar11 = yDiff + unk[1];
|
||||
bVar4 = sub_080B1B18(iVar9 - 0x00, iVar11 - 0x00, uVar1);
|
||||
bVar5 = sub_080B1B18(iVar9 - 0x10, iVar11 - 0x00, uVar1);
|
||||
bVar6 = sub_080B1B18(iVar9 - 0x00, iVar11 - 0x10, uVar1);
|
||||
bVar7 = sub_080B1B18(iVar9 - 0x10, iVar11 - 0x10, uVar1);
|
||||
x = xDiff + unk[0];
|
||||
y = yDiff + unk[1];
|
||||
bVar4 = GetCollisionDataAtWorldCoords(x - 0x00, y - 0x00, layer);
|
||||
bVar5 = GetCollisionDataAtWorldCoords(x - 0x10, y - 0x00, layer);
|
||||
bVar6 = GetCollisionDataAtWorldCoords(x - 0x00, y - 0x10, layer);
|
||||
bVar7 = GetCollisionDataAtWorldCoords(x - 0x10, y - 0x10, layer);
|
||||
if ((bVar4 | bVar5 | bVar6 | bVar7) == 0) {
|
||||
this->unk_7c = gRoomControls.origin_x + iVar9;
|
||||
this->unk_7e = gRoomControls.origin_y + iVar11;
|
||||
this->unk_7c = gRoomControls.origin_x + x;
|
||||
this->unk_7e = gRoomControls.origin_y + y;
|
||||
return TRUE;
|
||||
}
|
||||
unk += 2;
|
||||
} while (unk[0] != 0x7f);
|
||||
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void sub_08025A54(PuffstoolEntity* this) {
|
||||
@@ -523,12 +527,12 @@ void sub_08025A54(PuffstoolEntity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
bool32 sub_08025AB8(u32 tile, u32 layer) {
|
||||
if (sub_080B1B44(tile, layer))
|
||||
bool32 sub_08025AB8(u32 tilePos, u32 layer) {
|
||||
if (GetCollisionDataAtTilePos(tilePos, layer))
|
||||
return FALSE;
|
||||
|
||||
if (sub_080B1AE0(tile, layer) == 10) {
|
||||
sub_0807B7D8(0x61, tile, layer);
|
||||
if (GetActTileAtTilePos(tilePos, layer) == ACT_TILE_10) {
|
||||
sub_0807B7D8(0x61, tilePos, layer);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "physics.h"
|
||||
#include "player.h"
|
||||
#include "room.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -249,11 +250,11 @@ void sub_08020A30(RollobiteEntity* this) {
|
||||
}
|
||||
|
||||
void sub_08020A7C(RollobiteEntity* this) {
|
||||
int tmp = Random();
|
||||
s32 tmp = Random();
|
||||
u32 state = DirectionRound(super->direction + gUnk_080CA6D4[tmp % 3]);
|
||||
|
||||
if (sub_08049FA0(super) == 0) {
|
||||
int tmp = DirectionRoundUp(sub_08049EE4(super));
|
||||
u32 tmp = DirectionRoundUp(sub_08049EE4(super));
|
||||
if ((state ^ DirectionSouth) == tmp)
|
||||
state ^= DirectionSouth;
|
||||
}
|
||||
@@ -265,9 +266,9 @@ void sub_08020A7C(RollobiteEntity* this) {
|
||||
|
||||
bool32 Rollobite_TryToHoleUp(RollobiteEntity* this) {
|
||||
if (Rollobite_IsRolledUp(this) && super->z.HALF.HI == 0) {
|
||||
int tile = COORD_TO_TILE(super);
|
||||
int iVar1 = GetTileType(tile, super->collisionLayer);
|
||||
if ((iVar1 * 0x10000 - 0x710000U) >> 0x10 < 2) {
|
||||
u32 tilePos = COORD_TO_TILE(super);
|
||||
u32 tileType = GetTileTypeAtTilePos(tilePos, super->collisionLayer);
|
||||
if ((tileType * 0x10000 - 0x710000U) >> 0x10 < 2) {
|
||||
super->action = 6;
|
||||
COLLISION_OFF(super);
|
||||
super->x.HALF.HI &= 0xfff0;
|
||||
@@ -276,7 +277,7 @@ bool32 Rollobite_TryToHoleUp(RollobiteEntity* this) {
|
||||
super->y.HALF.HI += 13;
|
||||
super->zVelocity = Q_16_16(2.0);
|
||||
InitializeAnimation(super, super->animationState + 0x14);
|
||||
SetBottomTile(0x4034, tile, super->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_52, tilePos, super->collisionLayer);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
#include "enemy.h"
|
||||
#include "physics.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -208,7 +209,7 @@ void sub_08031600(RopeEntity* this) {
|
||||
|
||||
u32 sub_0803163C(RopeEntity* this) {
|
||||
u32 h;
|
||||
if (GetActTile(super) == 0x13) {
|
||||
if (GetActTileAtEntity(super) == ACT_TILE_19) {
|
||||
h = this->unk_7a / 2;
|
||||
} else {
|
||||
h = this->unk_7a;
|
||||
|
||||
+4
-4
@@ -143,21 +143,21 @@ void sub_080450A8(SlimeEntity* this) {
|
||||
DeleteEntity(super);
|
||||
}
|
||||
|
||||
void sub_08045178(SlimeEntity* this, Entity* child, int h, int v) {
|
||||
void sub_08045178(SlimeEntity* this, Entity* child, int offsetX, int offsetY) {
|
||||
int x, y;
|
||||
|
||||
if (child == NULL)
|
||||
return;
|
||||
|
||||
EnemyCopyParams(super, child);
|
||||
if (sub_080B1AF0(child, h, v))
|
||||
if (GetCollisionDataRelativeTo(child, offsetX, offsetY))
|
||||
return;
|
||||
|
||||
x = child->x.HALF.HI + h;
|
||||
x = child->x.HALF.HI + offsetX;
|
||||
if (0 <= x && x < (gRoomControls.origin_x + gRoomControls.width))
|
||||
child->x.HALF.HI = x;
|
||||
|
||||
y = child->y.HALF.HI + v;
|
||||
y = child->y.HALF.HI + offsetY;
|
||||
if (0 <= y && y < (gRoomControls.origin_y + gRoomControls.height))
|
||||
child->y.HALF.HI = y;
|
||||
}
|
||||
|
||||
+15
-14
@@ -8,11 +8,12 @@
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
Entity base;
|
||||
u8 filler[0xc];
|
||||
u16 tile;
|
||||
u16 tilePos;
|
||||
u16 tileIndex;
|
||||
u8 unk_78;
|
||||
u8 unk_79;
|
||||
@@ -92,9 +93,9 @@ void SpinyBeetle_Init(SpinyBeetleEntity* this) {
|
||||
this->unk_7a = 0;
|
||||
this->unk_78 = 0;
|
||||
this->unk_7b = 0;
|
||||
this->tile = COORD_TO_TILE(super);
|
||||
this->tileIndex = GetTileIndex(this->tile, super->collisionLayer);
|
||||
SetBottomTile(0x4022, this->tile, super->collisionLayer);
|
||||
this->tilePos = COORD_TO_TILE(super);
|
||||
this->tileIndex = GetTileIndex(this->tilePos, super->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_34, this->tilePos, super->collisionLayer);
|
||||
obj = CreateObject(OBJECT_ON_BEETLE, super->type, 0);
|
||||
|
||||
if (obj == NULL) {
|
||||
@@ -116,7 +117,7 @@ void sub_08033958(SpinyBeetleEntity* this) {
|
||||
u32 direction;
|
||||
if (sub_08033DF0(this)) {
|
||||
sub_08033E1C(this);
|
||||
sub_0807B9B8(this->tileIndex, this->tile, super->collisionLayer);
|
||||
SetTileByIndex(this->tileIndex, this->tilePos, super->collisionLayer);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -165,7 +166,7 @@ void sub_08033958(SpinyBeetleEntity* this) {
|
||||
COLLISION_ON(super);
|
||||
|
||||
super->y.WORD = (super->y.WORD & 0xfff00000) | 0xC0000;
|
||||
sub_0807B9B8(this->tileIndex, this->tile, super->collisionLayer);
|
||||
SetTileByIndex(this->tileIndex, this->tilePos, super->collisionLayer);
|
||||
InitializeAnimation(super, 2);
|
||||
}
|
||||
|
||||
@@ -236,10 +237,10 @@ void sub_08033B44(SpinyBeetleEntity* this) {
|
||||
this->unk_80 = super->y.WORD;
|
||||
super->spritePriority.b1 = 0;
|
||||
this->unk_7b = 0x78;
|
||||
this->tile = COORD_TO_TILE(super);
|
||||
this->tileIndex = GetTileIndex(this->tile, super->collisionLayer);
|
||||
this->tilePos = COORD_TO_TILE(super);
|
||||
this->tileIndex = GetTileIndex(this->tilePos, super->collisionLayer);
|
||||
|
||||
if (this->tileIndex != 0x4022) {
|
||||
if (this->tileIndex != SPECIAL_TILE_34) {
|
||||
stop++;
|
||||
} else {
|
||||
switch (DirectionRound(super->direction) >> 2) {
|
||||
@@ -259,7 +260,7 @@ void sub_08033B44(SpinyBeetleEntity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
SetBottomTile(0x4022, this->tile, super->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_34, this->tilePos, super->collisionLayer);
|
||||
InitializeAnimation(super, 0);
|
||||
}
|
||||
|
||||
@@ -318,17 +319,17 @@ void sub_08033C94(SpinyBeetleEntity* this) {
|
||||
void sub_08033D78(SpinyBeetleEntity* this) {
|
||||
u32 dir = DirectionRound(super->direction) >> 2;
|
||||
const s8* ptr = gUnk_080CEC1C + dir;
|
||||
s32 tile;
|
||||
s32 tilePos;
|
||||
u32 type;
|
||||
tile = COORD_TO_TILE_OFFSET(super, -ptr[0], -ptr[1]);
|
||||
type = GetTileType(tile, super->collisionLayer);
|
||||
tilePos = COORD_TO_TILE_OFFSET(super, -ptr[0], -ptr[1]);
|
||||
type = GetTileTypeAtTilePos(tilePos, super->collisionLayer);
|
||||
|
||||
switch (type) {
|
||||
case 0x1c4:
|
||||
case 0x1c5:
|
||||
break;
|
||||
default:
|
||||
if (sub_080B1B44(tile, super->collisionLayer) - 1 > 0x3e)
|
||||
if (GetCollisionDataAtTilePos(tilePos, super->collisionLayer) - 1 > 0x3e)
|
||||
ProcessMovement0(super);
|
||||
break;
|
||||
}
|
||||
|
||||
+3
-2
@@ -7,6 +7,7 @@
|
||||
#include "collision.h"
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -437,7 +438,7 @@ void sub_08039AD4(StalfosEntity* this) {
|
||||
super->action = 0xb;
|
||||
super->child = projectile;
|
||||
InitAnimationForceUpdate(super, super->animationState + 0x18);
|
||||
SetBottomTile(0x4067, position, super->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_103, position, super->collisionLayer);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -455,7 +456,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 = GetTileTypeAtTilePos(pos, (u32)super->collisionLayer);
|
||||
ptr = gUnk_080CF938;
|
||||
|
||||
do {
|
||||
|
||||
+1
-1
@@ -164,7 +164,7 @@ void sub_0802F300(TektiteEntity* this) {
|
||||
return;
|
||||
} else if (super->collisions != COL_NONE) {
|
||||
sub_0800417E(super, super->collisions);
|
||||
} else if ((GetActTile(super) & 0xf0) == 0x50) {
|
||||
} else if ((GetActTileAtEntity(super) & 0xf0) == 0x50) { // ACT_TILE_240 and ACT_TILE_241?
|
||||
super->direction = (super->direction + 0x10) & (0x3 | DirectionNorthWest);
|
||||
}
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ void sub_08038048(TektiteGoldenEntity* this) {
|
||||
return;
|
||||
} else if (super->collisions != COL_NONE) {
|
||||
sub_0800417E(super, super->collisions);
|
||||
} else if ((GetActTile(super) & 0xf0) == 0x50) {
|
||||
} else if ((GetActTileAtEntity(super) & 0xf0) == 0x50) { // ACT_TILE_240 and ACT_TILE_241?
|
||||
super->direction = (super->direction + 0x10) & (0x3 | DirectionNorthWest);
|
||||
}
|
||||
|
||||
|
||||
+19
-19
@@ -9,11 +9,12 @@
|
||||
#include "physics.h"
|
||||
#include "player.h"
|
||||
#include "room.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
Entity base;
|
||||
u8 filler[0xc];
|
||||
u16 unk_74;
|
||||
u16 tilePos;
|
||||
u16 filler2;
|
||||
u16 unk_78;
|
||||
u16 projectileTimer;
|
||||
@@ -45,7 +46,7 @@ void TorchTrap_Init(TorchTrapEntity* this) {
|
||||
this->unk_84 &= 0xfff;
|
||||
sub_0804A720(super);
|
||||
super->action = 1;
|
||||
this->unk_74 = this->unk_82 & 0xfff;
|
||||
this->tilePos = this->unk_82 & 0xfff;
|
||||
super->x.HALF.HI = ((this->unk_82 & 0x3f) << 4) + 8 + gRoomControls.origin_x;
|
||||
super->y.HALF.HI = ((this->unk_82 & 0xfc0) >> 2) + (gRoomControls.origin_y + 8);
|
||||
super->direction = ((s16)this->unk_82 & 0xf000) >> 10;
|
||||
@@ -75,7 +76,7 @@ void sub_0803CF38(TorchTrapEntity* this) {
|
||||
}
|
||||
|
||||
void sub_0803CF94(TorchTrapEntity* this) {
|
||||
if (GetTileType(this->unk_74, super->collisionLayer) == 0x76) {
|
||||
if (GetTileTypeAtTilePos(this->tilePos, super->collisionLayer) == TILE_TYPE_118) {
|
||||
this->unk_80 = 0;
|
||||
TorchTrap_Reset(this);
|
||||
} else if (this->unk_7c && sub_0803CFD8(this)) {
|
||||
@@ -84,35 +85,34 @@ void sub_0803CF94(TorchTrapEntity* this) {
|
||||
}
|
||||
|
||||
bool32 sub_0803CFD8(TorchTrapEntity* this) {
|
||||
u32 rv;
|
||||
u32 result;
|
||||
if (this->unk_7c == 0) {
|
||||
rv = 1;
|
||||
result = TRUE;
|
||||
} else {
|
||||
rv = CheckFlags(this->unk_7c);
|
||||
result = CheckFlags(this->unk_7c);
|
||||
}
|
||||
return rv;
|
||||
return result;
|
||||
}
|
||||
|
||||
bool32 sub_0803CFF0(TorchTrapEntity* this) {
|
||||
u32 rv;
|
||||
u32 result;
|
||||
if (this->unk_80 != 0) {
|
||||
if (this->unk_80 == this->unk_7c) {
|
||||
u32 val = CheckFlags(this->unk_80);
|
||||
rv = 0;
|
||||
result = FALSE;
|
||||
if (val == 0) {
|
||||
rv = 1;
|
||||
result = TRUE;
|
||||
}
|
||||
return rv;
|
||||
return result;
|
||||
} else {
|
||||
return CheckFlags(this->unk_80);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TorchTrap_Reset(TorchTrapEntity* this) {
|
||||
u32 val;
|
||||
super->action = 2;
|
||||
if (this->unk_78) {
|
||||
this->projectileTimer = this->unk_78;
|
||||
@@ -141,7 +141,7 @@ void TorchTrap_CreateProjectile(TorchTrapEntity* this) {
|
||||
|
||||
void sub_0803D0B0(TorchTrapEntity* this) {
|
||||
super->action = 3;
|
||||
sub_0807B7D8(0x75, this->unk_74, super->collisionLayer);
|
||||
sub_0807B7D8(TILE_TYPE_117, this->tilePos, super->collisionLayer);
|
||||
}
|
||||
|
||||
void (*const gTorchTrapActions[])(TorchTrapEntity*) = {
|
||||
@@ -152,12 +152,12 @@ void (*const gTorchTrapActions[])(TorchTrapEntity*) = {
|
||||
};
|
||||
|
||||
const u16 gTorchTrapTimerLengths[] = {
|
||||
0x3c, 0x3c, 0x5a, 0x5a, 0x5a, 0x78, 0x78, 0x96,
|
||||
60, 60, 90, 90, 90, 120, 120, 150,
|
||||
};
|
||||
|
||||
const u16 gTorchTrapProjectileSpeeds[] = {
|
||||
0x80,
|
||||
0x100,
|
||||
0x180,
|
||||
0x200,
|
||||
128,
|
||||
256,
|
||||
384,
|
||||
512,
|
||||
};
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
* @brief Tree Item enemy
|
||||
*/
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
#include "object.h"
|
||||
|
||||
@@ -15,8 +16,6 @@ typedef struct {
|
||||
|
||||
static bool32 ShouldSpawnTreeItem(TreeItemEntity*);
|
||||
|
||||
extern void EnemyDisableRespawn(Entity*);
|
||||
|
||||
const u8 gTreeItemDropTables[][16] = {
|
||||
{ 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF },
|
||||
{ 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF },
|
||||
|
||||
@@ -231,7 +231,7 @@ void sub_0802EFB8(VaatiEyesMacroEntity* this) {
|
||||
u32 uVar1;
|
||||
u32 rand;
|
||||
u32 uVar3;
|
||||
int iVar4;
|
||||
u32 collisionData;
|
||||
|
||||
rand = Random();
|
||||
if ((rand >> 0x10 & 3) != 0) {
|
||||
@@ -240,8 +240,9 @@ void sub_0802EFB8(VaatiEyesMacroEntity* this) {
|
||||
uVar3 = GetFacingDirection(&gPlayerEntity.base, super);
|
||||
uVar1 = (uVar3 + 4) & 0x18;
|
||||
}
|
||||
iVar4 = sub_080B1B44(TILE(super->x.HALF.HI, super->y.HALF.HI) + gUnk_080B4488[((uVar1) >> 3)], 1);
|
||||
if (iVar4 != 0) {
|
||||
collisionData =
|
||||
GetCollisionDataAtTilePos(TILE(super->x.HALF.HI, super->y.HALF.HI) + gUnk_080B4488[((uVar1) >> 3)], 1);
|
||||
if (collisionData != 0) {
|
||||
super->direction = DIR_NONE;
|
||||
} else {
|
||||
super->timer = (rand & 3) + 1;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
#include "screenTransitions.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -281,10 +282,8 @@ bool32 sub_0803E4A0(VaatiProjectileEntity* this) {
|
||||
}
|
||||
|
||||
void sub_0803E4D8(VaatiProjectileEntity* this) {
|
||||
u32 tile;
|
||||
|
||||
tile = TILE(super->x.HALF.HI, super->y.HALF.HI + 8);
|
||||
if (sub_080B1B44(tile, gPlayerEntity.base.collisionLayer) != 0xff) {
|
||||
SetBottomTile(0x4074, tile, gPlayerEntity.base.collisionLayer);
|
||||
u32 tilePos = TILE(super->x.HALF.HI, super->y.HALF.HI + 8);
|
||||
if (GetCollisionDataAtTilePos(tilePos, gPlayerEntity.base.collisionLayer) != COLLISION_DATA_255) {
|
||||
SetTile(SPECIAL_TILE_116, tilePos, gPlayerEntity.base.collisionLayer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ void WizzrobeFire_OnCollision(WizzrobeEntity* this) {
|
||||
}
|
||||
EnemyFunctionHandlerAfterCollision(super, WizzrobeFire_Functions);
|
||||
if (super->health == 0) {
|
||||
SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
|
||||
SetTile(this->tileIndex, this->tilePos, super->collisionLayer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ void WizzrobeFire_Action2(WizzrobeEntity* this) {
|
||||
super->timer = 40;
|
||||
super->subtimer = 0;
|
||||
super->flags &= ~0x80;
|
||||
SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
|
||||
SetTile(this->tileIndex, this->tilePos, super->collisionLayer);
|
||||
EnqueueSFX(SFX_156);
|
||||
InitializeAnimation(super, super->direction >> 3);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ void WizzrobeIce_OnCollision(WizzrobeEntity* this) {
|
||||
}
|
||||
}
|
||||
if (super->health == 0) {
|
||||
SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
|
||||
SetTile(this->tileIndex, this->tilePos, super->collisionLayer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ void WizzrobeIce_Action2(WizzrobeEntity* this) {
|
||||
super->timer = 40;
|
||||
super->subtimer = 0;
|
||||
super->flags &= ~0x80;
|
||||
SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
|
||||
SetTile(this->tileIndex, this->tilePos, super->collisionLayer);
|
||||
EnqueueSFX(SFX_156);
|
||||
InitializeAnimation(super, super->direction >> 3);
|
||||
}
|
||||
|
||||
@@ -5,10 +5,12 @@
|
||||
* @brief Wizzrobe Wind enemy
|
||||
*/
|
||||
#include "enemy/wizzrobe.h"
|
||||
|
||||
#include "collision.h"
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
extern void (*const WizzrobeWind_Functions[])(WizzrobeEntity*);
|
||||
extern void (*const WizzrobeWind_Actions[])(WizzrobeEntity*);
|
||||
@@ -42,7 +44,7 @@ void WizzrobeWind_OnCollision(WizzrobeEntity* this) {
|
||||
}
|
||||
}
|
||||
if (super->health == 0) {
|
||||
SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
|
||||
SetTile(this->tileIndex, this->tilePos, super->collisionLayer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,7 +137,7 @@ void WizzrobeWind_Action2(WizzrobeEntity* this) {
|
||||
super->subtimer = 0;
|
||||
super->flags &= ~0x80;
|
||||
EnqueueSFX(SFX_156);
|
||||
SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
|
||||
SetTile(this->tileIndex, this->tilePos, super->collisionLayer);
|
||||
InitializeAnimation(super, super->direction >> 3);
|
||||
}
|
||||
break;
|
||||
@@ -206,15 +208,15 @@ 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);
|
||||
SetBottomTile(0x4071, this->tilePosition, super->collisionLayer);
|
||||
this->tilePos = COORD_TO_TILE(super);
|
||||
this->tileIndex = GetTileIndex(this->tilePos, super->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_113, this->tilePos, super->collisionLayer);
|
||||
}
|
||||
|
||||
void sub_0802F8E4(WizzrobeEntity* this) {
|
||||
u16 uVar1;
|
||||
s32 iVar4;
|
||||
u32 uVar6;
|
||||
u32 tilePos;
|
||||
u32 uVar7;
|
||||
u32 uVar8;
|
||||
|
||||
@@ -232,9 +234,9 @@ void sub_0802F8E4(WizzrobeEntity* this) {
|
||||
uVar1 = this->unk_72;
|
||||
iVar4 = ((s32)(rand)&0x7ff0) % (this->unk_6f << 3);
|
||||
uVar7 = (uVar1 + iVar4) | 8;
|
||||
uVar6 = TILE(uVar8, uVar7);
|
||||
if ((sub_080B1B44(uVar6, super->collisionLayer) == 0) &&
|
||||
(GetTileIndex(uVar6, super->collisionLayer) != 0x4071)) {
|
||||
tilePos = TILE(uVar8, uVar7);
|
||||
if ((GetCollisionDataAtTilePos(tilePos, super->collisionLayer) == 0) &&
|
||||
(GetTileIndex(tilePos, super->collisionLayer) != SPECIAL_TILE_113)) {
|
||||
super->x.HALF.HI = (s16)uVar8;
|
||||
super->y.HALF.HI = (s16)uVar7;
|
||||
if (sub_08049FA0(super) != 0) {
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
extern void ClearArmosData(void);
|
||||
extern void sub_080300C4(void);
|
||||
|
||||
extern u8 gUnk_02017700[];
|
||||
|
||||
bool32 sub_0804AD18(void);
|
||||
void sub_0804AD6C(RoomControls*);
|
||||
bool32 sub_0804ACA8(void);
|
||||
@@ -185,8 +183,8 @@ void Subtask_PortalCutscene_0(void) {
|
||||
ptr = &gUnk_080D4138[portalId];
|
||||
LoadPaletteGroup(ptr->paletteGroup);
|
||||
LoadGfxGroup(ptr->gfxGroup);
|
||||
MemCopy(&gUnk_02017700, gUnk_02017700 + 0x240, 0x20);
|
||||
gUsedPalettes |= 0x200000;
|
||||
MemCopy(gPaletteBuffer + 3 * 16, gPaletteBuffer + 21 * 16, 16 * 2);
|
||||
gUsedPalettes |= 1 << 21;
|
||||
EraseAllEntities();
|
||||
LoadRoomEntityList(gUnk_080D4110[portalId]);
|
||||
ClearEventPriority();
|
||||
|
||||
+21
-20
@@ -10,6 +10,7 @@ typedef struct Temp {
|
||||
void* next;
|
||||
u8 _0[0x38];
|
||||
} Temp;
|
||||
#include "tiles.h"
|
||||
|
||||
extern u8 gUpdateVisibleTiles;
|
||||
extern Manager gUnk_02033290;
|
||||
@@ -46,29 +47,29 @@ const u8 gEntityListLUT[] = {
|
||||
|
||||
// TODO: wrong file, maybe an "enter.c" according to lexicographical order
|
||||
void sub_0805E248(void) {
|
||||
s32 idx;
|
||||
s32 tilePos;
|
||||
|
||||
idx = gDiggingCaveEntranceTransition.entrance->targetTilePosition;
|
||||
tilePos = gDiggingCaveEntranceTransition.entrance->targetTilePos;
|
||||
if (gRoomControls.area == AREA_VEIL_FALLS || gRoomControls.area == AREA_VEIL_FALLS_DIG_CAVE) {
|
||||
SetTileType(0x27c, idx + TILE_POS(-1, -1), 1);
|
||||
SetTileType(0x283, idx + TILE_POS(-1, -1), 2);
|
||||
SetTileType(0x27d, idx + TILE_POS(0, -1), 1);
|
||||
SetTileType(0x284, idx + TILE_POS(0, -1), 2);
|
||||
SetTileType(0x27e, idx + TILE_POS(1, -1), 1);
|
||||
SetTileType(0x285, idx + TILE_POS(1, -1), 2);
|
||||
SetTileType(0x27f, idx + TILE_POS(-1, 0), 1);
|
||||
SetTileType(0x280, idx + TILE_POS(0, 0), 1);
|
||||
SetTileType(0x282, idx + TILE_POS(1, 0), 1);
|
||||
SetTileType(TILE_TYPE_636, tilePos + TILE_POS(-1, -1), LAYER_BOTTOM);
|
||||
SetTileType(TILE_TYPE_643, tilePos + TILE_POS(-1, -1), LAYER_TOP);
|
||||
SetTileType(TILE_TYPE_637, tilePos + TILE_POS(0, -1), LAYER_BOTTOM);
|
||||
SetTileType(TILE_TYPE_644, tilePos + TILE_POS(0, -1), LAYER_TOP);
|
||||
SetTileType(TILE_TYPE_638, tilePos + TILE_POS(1, -1), LAYER_BOTTOM);
|
||||
SetTileType(TILE_TYPE_645, tilePos + TILE_POS(1, -1), LAYER_TOP);
|
||||
SetTileType(TILE_TYPE_639, tilePos + TILE_POS(-1, 0), LAYER_BOTTOM);
|
||||
SetTileType(TILE_TYPE_640, tilePos + TILE_POS(0, 0), LAYER_BOTTOM);
|
||||
SetTileType(TILE_TYPE_642, tilePos + TILE_POS(1, 0), LAYER_BOTTOM);
|
||||
} else {
|
||||
SetTileType(0x26c, idx + TILE_POS(-1, -1), 1);
|
||||
SetTileType(0x273, idx + TILE_POS(-1, -1), 2);
|
||||
SetTileType(0x26d, idx + TILE_POS(0, -1), 1);
|
||||
SetTileType(0x274, idx + TILE_POS(0, -1), 2);
|
||||
SetTileType(0x26e, idx + TILE_POS(1, -1), 1);
|
||||
SetTileType(0x275, idx + TILE_POS(1, -1), 2);
|
||||
SetTileType(0x26f, idx + TILE_POS(-1, 0), 1);
|
||||
SetTileType(0x270, idx + TILE_POS(0, 0), 1);
|
||||
SetTileType(0x272, idx + TILE_POS(1, 0), 1);
|
||||
SetTileType(TILE_TYPE_620, tilePos + TILE_POS(-1, -1), LAYER_BOTTOM);
|
||||
SetTileType(TILE_TYPE_627, tilePos + TILE_POS(-1, -1), LAYER_TOP);
|
||||
SetTileType(TILE_TYPE_621, tilePos + TILE_POS(0, -1), LAYER_BOTTOM);
|
||||
SetTileType(TILE_TYPE_628, tilePos + TILE_POS(0, -1), LAYER_TOP);
|
||||
SetTileType(TILE_TYPE_622, tilePos + TILE_POS(1, -1), LAYER_BOTTOM);
|
||||
SetTileType(TILE_TYPE_629, tilePos + TILE_POS(1, -1), LAYER_TOP);
|
||||
SetTileType(TILE_TYPE_623, tilePos + TILE_POS(-1, 0), LAYER_BOTTOM);
|
||||
SetTileType(TILE_TYPE_624, tilePos + TILE_POS(0, 0), LAYER_BOTTOM);
|
||||
SetTileType(TILE_TYPE_626, tilePos + TILE_POS(1, 0), LAYER_BOTTOM);
|
||||
}
|
||||
gUpdateVisibleTiles = 0;
|
||||
}
|
||||
|
||||
+7
-7
@@ -350,7 +350,7 @@ void LoadOptionsFromSave(u32 idx) {
|
||||
|
||||
gSaveHeader->msg_speed = msg_speed;
|
||||
gSaveHeader->brightness = brightness;
|
||||
gUsedPalettes = 0xFFFFFFFF;
|
||||
gUsedPalettes = 0xffffffff;
|
||||
}
|
||||
|
||||
void SetActiveSave(u32 idx) {
|
||||
@@ -400,10 +400,10 @@ static void HandleFileScreenEnter(void) {
|
||||
MemClear((void*)VRAM, 0x80); // clear palettes
|
||||
MessageInitialize();
|
||||
EraseAllEntities();
|
||||
ClearTilemaps();
|
||||
ClearTileMaps();
|
||||
ResetPalettes();
|
||||
ResetPaletteTable(0);
|
||||
MemClear(&gUnk_0200AF00, sizeof(gUnk_0200AF00));
|
||||
MemClear(&gHUD, sizeof(gHUD));
|
||||
MemClear(&gMapDataBottomSpecial, sizeof(gMapDataBottomSpecial));
|
||||
gMapDataBottomSpecial.unk3 = 7;
|
||||
gMapDataBottomSpecial.unk6 = gSaveHeader->language > LANGUAGE_EN ? 3 : 0;
|
||||
@@ -542,13 +542,13 @@ void sub_08050790(void) {
|
||||
}
|
||||
|
||||
static void HideButtonR(void) {
|
||||
gUnk_0200AF00.buttonX[2] = 0x140;
|
||||
gUnk_0200AF00.buttonY[2] = 0x24;
|
||||
gHUD.buttonX[2] = 0x140;
|
||||
gHUD.buttonY[2] = 0x24;
|
||||
}
|
||||
|
||||
static void ShowButtonR(void) {
|
||||
gUnk_0200AF00.buttonX[2] = 0xD0;
|
||||
gUnk_0200AF00.buttonY[2] = 0x24;
|
||||
gHUD.buttonX[2] = 0xD0;
|
||||
gHUD.buttonY[2] = 0x24;
|
||||
}
|
||||
|
||||
static void HandleFileSelect(void) {
|
||||
|
||||
+8
-8
@@ -40,20 +40,20 @@ u32 CheckRoomFlag(u32 flag) {
|
||||
return ReadBit(&gRoomVars.flags, flag);
|
||||
}
|
||||
|
||||
u32 CheckLocalFlagsByBank(u32 offset, u32 flag, u32 length) {
|
||||
return CheckBits(gSave.flags, offset + flag, length);
|
||||
u32 CheckLocalFlagsByBank(u32 offset, u32 flag, u32 count) {
|
||||
return CheckBits(gSave.flags, offset + flag, count);
|
||||
}
|
||||
|
||||
u32 CheckLocalFlags(u32 flag, u32 length) {
|
||||
return CheckLocalFlagsByBank(gArea.localFlagOffset, flag, length);
|
||||
u32 CheckLocalFlags(u32 flag, u32 count) {
|
||||
return CheckLocalFlagsByBank(gArea.localFlagOffset, flag, count);
|
||||
}
|
||||
|
||||
u32 CheckGlobalFlags(u32 flag, u32 length) {
|
||||
return CheckLocalFlagsByBank(FLAG_BANK_0, flag, length);
|
||||
u32 CheckGlobalFlags(u32 flag, u32 count) {
|
||||
return CheckLocalFlagsByBank(FLAG_BANK_0, flag, count);
|
||||
}
|
||||
|
||||
u32 CheckRoomFlags(u32 flag, u32 length) {
|
||||
return CheckBits(&gRoomVars.flags, flag, length);
|
||||
u32 CheckRoomFlags(u32 flag, u32 count) {
|
||||
return CheckBits(&gRoomVars.flags, flag, count);
|
||||
}
|
||||
|
||||
void SetLocalFlagByBank(u32 offset, u32 flag) {
|
||||
|
||||
+5
-5
@@ -138,7 +138,7 @@ static void GameTask_Init(void) {
|
||||
MemClear(&gUI, sizeof(gUI));
|
||||
EraseAllEntities();
|
||||
SetBGDefaults();
|
||||
ClearTilemaps();
|
||||
ClearTileMaps();
|
||||
ResetPalettes();
|
||||
ResetPaletteTable(1);
|
||||
sub_0806FD8C();
|
||||
@@ -384,7 +384,7 @@ static void sub_08051DCC(void) {
|
||||
|
||||
static void UpdateWindcrests(void) {
|
||||
if (AreaIsOverworld()) {
|
||||
struct_08127F94* i;
|
||||
const OverworldLocation* location;
|
||||
u32 hi_x, hi_y;
|
||||
s32 x, y;
|
||||
|
||||
@@ -398,9 +398,9 @@ static void UpdateWindcrests(void) {
|
||||
y += 0xf;
|
||||
hi_y = y >> 4;
|
||||
|
||||
for (i = gUnk_08127F94; i->_0 != 0xFF; i++) {
|
||||
if (i->_0 <= hi_x && i->_2 >= hi_x && i->_1 <= hi_y && i->_3 >= hi_y) {
|
||||
gSave.windcrests |= 1 << i->_4;
|
||||
for (location = gOverworldLocations; location->minX != 0xFF; location++) {
|
||||
if (location->minX <= hi_x && location->maxX >= hi_x && location->minY <= hi_y && location->maxY >= hi_y) {
|
||||
gSave.windcrests |= 1 << location->windcrestId;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -85,7 +85,7 @@ const WorldEvent gWorldEvents[] = {
|
||||
OUGONTEKI_B },
|
||||
{ WORLD_EVENT_TYPE_1, 2, AREA_CASTOR_WILDS, ROOM_CASTOR_WILDS_MAIN, 480, 80, 600, 168, 600, 1848, CND_1,
|
||||
LOCAL_BANK_0, OUGONTEKI_C },
|
||||
{ WORLD_EVENT_TYPE_1, 3, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_EASTERN_HILLLS_NORTH, 0, 352, 120, 440, 2616, 2600,
|
||||
{ WORLD_EVENT_TYPE_1, 3, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_EASTERN_HILLS_NORTH, 0, 352, 120, 440, 2616, 2600,
|
||||
CND_1, LOCAL_BANK_0, OUGONTEKI_D },
|
||||
{ WORLD_EVENT_TYPE_1, 4, AREA_CASTLE_GARDEN, ROOM_CASTLE_GARDEN_MAIN, 768, 160, 936, 248, 2424, 440, CND_1,
|
||||
LOCAL_BANK_0, OUGONTEKI_E },
|
||||
@@ -97,7 +97,7 @@ const WorldEvent gWorldEvents[] = {
|
||||
LOCAL_BANK_0, OUGONTEKI_H },
|
||||
{ WORLD_EVENT_TYPE_1, 8, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_WESTERN_WOODS_CENTER, 176, 0, 312, 88, 1320, 2888,
|
||||
CND_1, LOCAL_BANK_0, OUGONTEKI_I },
|
||||
{ WORLD_EVENT_TYPE_2, 0, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_EASTERN_HILLLS_NORTH, 80, 288, 200, 376, 2696, 2536,
|
||||
{ WORLD_EVENT_TYPE_2, 0, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_EASTERN_HILLS_NORTH, 80, 288, 200, 376, 2696, 2536,
|
||||
CND_1, LOCAL_BANK_1, KAKERA_TAKARA_A },
|
||||
{ WORLD_EVENT_TYPE_2, 0, AREA_CRENEL_MINISH_PATHS, ROOM_CRENEL_MINISH_PATHS_RAIN, 272, 16, 392, 88, 744, 152, CND_1,
|
||||
LOCAL_BANK_3, KAKERA_TAKARA_B },
|
||||
@@ -228,7 +228,7 @@ const WorldEvent gWorldEvents[] = {
|
||||
LOCAL_BANK_1, BEANDEMO_01 }, // uses different flags due to CND_6
|
||||
{ WORLD_EVENT_TYPE_BEANSTALK, 0, AREA_RUINS, ROOM_RUINS_BEANSTALK, 0, 0, 72, 72, 312, 2712, CND_7, LOCAL_BANK_1,
|
||||
BEANDEMO_02 }, // uses different flags due to CND_7
|
||||
{ WORLD_EVENT_TYPE_BEANSTALK, 0, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_EASTERN_HILLLS_CENTER, 0, 0, 72, 56, 2568,
|
||||
{ WORLD_EVENT_TYPE_BEANSTALK, 0, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_EASTERN_HILLS_CENTER, 0, 0, 72, 56, 2568,
|
||||
2760, CND_8, LOCAL_BANK_1, BEANDEMO_03 }, // uses different flags due to CND_8
|
||||
{ WORLD_EVENT_TYPE_BEANSTALK, 0, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_WESTERN_WOODS_SOUTH, 0, 0, 56, 56, 1064, 3016,
|
||||
CND_9, LOCAL_BANK_1, BEANDEMO_04 }, // uses different flags due to CND_9
|
||||
@@ -245,7 +245,7 @@ const WorldEvent gWorldEvents[] = {
|
||||
LOCAL_BANK_1, BEANDEMO_01 }, // uses different flags due to CND_6
|
||||
{ WORLD_EVENT_TYPE_BEANSTALK, 0, AREA_RUINS, ROOM_RUINS_BEANSTALK, 0, 0, 72, 72, 312, 2712, CND_0, LOCAL_BANK_1,
|
||||
BEANDEMO_02 }, // uses different flags due to CND_7
|
||||
{ WORLD_EVENT_TYPE_BEANSTALK, 0, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_EASTERN_HILLLS_CENTER, 0, 0, 72, 56, 2568,
|
||||
{ WORLD_EVENT_TYPE_BEANSTALK, 0, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_EASTERN_HILLS_CENTER, 0, 0, 72, 56, 2568,
|
||||
2760, CND_0, LOCAL_BANK_1, BEANDEMO_03 }, // uses different flags due to CND_8
|
||||
{ WORLD_EVENT_TYPE_BEANSTALK, 0, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_WESTERN_WOODS_SOUTH, 0, 0, 56, 56, 1064, 3016,
|
||||
CND_0, LOCAL_BANK_1, BEANDEMO_04 }, // uses different flags due to CND_9
|
||||
@@ -341,7 +341,7 @@ const WorldEvent gWorldEvents[] = {
|
||||
LOCAL_BANK_1, BEANDEMO_01 }, // uses different flags due to CND_6
|
||||
{ WORLD_EVENT_TYPE_BEANSTALK, 0, AREA_RUINS, ROOM_RUINS_BEANSTALK, 0, 0, 72, 72, 312, 2712, CND_7, LOCAL_BANK_1,
|
||||
BEANDEMO_02 }, // uses different flags due to CND_7
|
||||
{ WORLD_EVENT_TYPE_BEANSTALK, 0, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_EASTERN_HILLLS_CENTER, 0, 0, 72, 56, 2568,
|
||||
{ WORLD_EVENT_TYPE_BEANSTALK, 0, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_EASTERN_HILLS_CENTER, 0, 0, 72, 56, 2568,
|
||||
2760, CND_8, LOCAL_BANK_1, BEANDEMO_03 }, // uses different flags due to CND_8
|
||||
{ WORLD_EVENT_TYPE_BEANSTALK, 0, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_WESTERN_WOODS_SOUTH, 0, 0, 56, 56, 1064, 3016,
|
||||
CND_9, LOCAL_BANK_1, BEANDEMO_04 }, // uses different flags due to CND_9
|
||||
|
||||
+24
-24
@@ -3,6 +3,7 @@
|
||||
*
|
||||
* @brief Game Utils
|
||||
*/
|
||||
#include "area.h"
|
||||
#include "backgroundAnimations.h"
|
||||
#include "enemy.h"
|
||||
#include "entity.h"
|
||||
@@ -32,9 +33,9 @@ void InitRoomResInfo(RoomResInfo* info, RoomHeader* hdr, u32 area, u32 room);
|
||||
void sub_080532E4(void);
|
||||
void ResetTimerFlags(void);
|
||||
|
||||
extern void** gAreaTilesets[];
|
||||
extern void** gAreaTileSets[];
|
||||
extern void** gAreaRoomMaps[];
|
||||
extern void* gAreaMetatiles[];
|
||||
extern void* gAreaTiles[];
|
||||
extern void** gAreaTable[];
|
||||
|
||||
typedef struct {
|
||||
@@ -162,17 +163,17 @@ void InitializePlayer(void) {
|
||||
|
||||
bool32 AreaIsOverworld(void) {
|
||||
#ifdef EU
|
||||
return gArea.areaMetadata == 0x01;
|
||||
return gArea.areaMetadata == AR_IS_OVERWORLD;
|
||||
#else
|
||||
return gArea.areaMetadata == 0x81;
|
||||
return gArea.areaMetadata == (AR_ALLOWS_WARP | AR_IS_OVERWORLD);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool32 CheckAreaOverworld(u32 area) {
|
||||
#if EU
|
||||
return gAreaMetadata[area].flags == 0x01;
|
||||
return gAreaMetadata[area].flags == AR_IS_OVERWORLD;
|
||||
#else
|
||||
return gAreaMetadata[area].flags == 0x81;
|
||||
return gAreaMetadata[area].flags == (AR_ALLOWS_WARP | AR_IS_OVERWORLD);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -272,20 +273,20 @@ bool32 HasDungeonMap(void) {
|
||||
}
|
||||
|
||||
extern u8 gPaletteBufferBackup[];
|
||||
void RestoreGameTask(u32 a1) {
|
||||
void RestoreGameTask(bool32 loadGfx) {
|
||||
LoadGfxGroups();
|
||||
#ifndef EU
|
||||
CleanUpGFXSlots();
|
||||
#endif
|
||||
sub_080ADE24();
|
||||
InitUI(TRUE);
|
||||
sub_0801AE44(a1);
|
||||
sub_0801AE44(loadGfx);
|
||||
MemCopy(gPaletteBufferBackup, gPaletteBuffer, 1024);
|
||||
gUsedPalettes = 0xffffffff;
|
||||
}
|
||||
|
||||
void LoadRoomBgm(void) {
|
||||
gArea.queued_bgm = gAreaMetadata[gRoomControls.area]._3;
|
||||
gArea.queued_bgm = gAreaMetadata[gRoomControls.area].queueBgm;
|
||||
if (CheckLocalFlagByBank(FLAG_BANK_10, LV6_KANE_START)) {
|
||||
gArea.queued_bgm = BGM_FIGHT_THEME2;
|
||||
}
|
||||
@@ -429,7 +430,7 @@ bool32 CanDispEzloMessage(void) {
|
||||
s32 tmp = PL_STATE_WALK;
|
||||
|
||||
if (!(gInput.heldKeys & SELECT_BUTTON) || gPlayerState.controlMode != CONTROL_ENABLED ||
|
||||
gPauseMenuOptions.disabled || gUnk_0200AF00.unk_1)
|
||||
gPauseMenuOptions.disabled || gHUD.hideFlags != HUD_HIDE_NONE)
|
||||
return FALSE;
|
||||
|
||||
if ((gPlayerState.flags & (PL_NO_CAP | PL_CAPTURED | PL_DISABLE_ITEMS)) || (gPlayerState.framestate_last > tmp) ||
|
||||
@@ -510,7 +511,7 @@ void SetDungeonMapPos(u32 area, u32 room, u32 x, u32 y) {
|
||||
}
|
||||
|
||||
void InitRoom(void) {
|
||||
AreaHeader* a_hdr = NULL;
|
||||
const AreaHeader* a_hdr = NULL;
|
||||
|
||||
MemClear(&gArea, sizeof gArea);
|
||||
a_hdr = &gAreaMetadata[gRoomControls.area];
|
||||
@@ -526,7 +527,7 @@ void InitRoom(void) {
|
||||
}
|
||||
|
||||
u32 GetFlagBankOffset(u32 idx) {
|
||||
AreaHeader* a_hdr = &gAreaMetadata[idx];
|
||||
const AreaHeader* a_hdr = &gAreaMetadata[idx];
|
||||
return gLocalFlagBanks[a_hdr->flag_bank];
|
||||
}
|
||||
|
||||
@@ -543,7 +544,7 @@ void InitAllRoomResInfo(void) {
|
||||
RoomResInfo* info = gArea.roomResInfos;
|
||||
u32 i;
|
||||
for (i = 0; i < MAX_ROOMS && *(u16*)r_hdr != 0xFFFF; i++, r_hdr++) {
|
||||
if (r_hdr->tileset_id != 0xFFFF)
|
||||
if (r_hdr->tileSet_id != 0xFFFF)
|
||||
InitRoomResInfo(info, r_hdr, gRoomControls.area, i);
|
||||
info++;
|
||||
}
|
||||
@@ -555,9 +556,9 @@ void InitRoomResInfo(RoomResInfo* info, RoomHeader* r_hdr, u32 area, u32 room) {
|
||||
info->map_y = r_hdr->map_y;
|
||||
info->pixel_width = r_hdr->pixel_width;
|
||||
info->pixel_height = r_hdr->pixel_height;
|
||||
info->tileset = *(gAreaTilesets[area] + r_hdr->tileset_id);
|
||||
info->tileSet = *(gAreaTileSets[area] + r_hdr->tileSet_id);
|
||||
info->map = *(gAreaRoomMaps[area] + room);
|
||||
info->metatiles = gAreaMetatiles[area];
|
||||
info->tiles = gAreaTiles[area];
|
||||
info->bg_anim = (void*)gUnk_080B755C[area];
|
||||
info->exits = gExitLists[area][room];
|
||||
if (gAreaTable[area] != NULL) {
|
||||
@@ -586,7 +587,7 @@ void sub_08052EA0(void) {
|
||||
}
|
||||
|
||||
u32 sub_08052EF4(s32 idx) {
|
||||
AreaHeader* a_hdr = NULL;
|
||||
const AreaHeader* a_hdr = NULL;
|
||||
u32 i = idx < 0 ? gRoomControls.area : idx;
|
||||
a_hdr = &gAreaMetadata[i];
|
||||
return gLocalFlagBanks[a_hdr->flag_bank];
|
||||
@@ -647,7 +648,7 @@ void LoadAuxiliaryRoom(u32 area, u32 room) {
|
||||
void sub_08052FF4(u32 area, u32 room) {
|
||||
RoomHeader* r_hdr = NULL;
|
||||
|
||||
ClearTilemaps();
|
||||
ClearTileMaps();
|
||||
SetBGDefaults();
|
||||
gRoomControls.area = area;
|
||||
gRoomControls.room = room;
|
||||
@@ -659,9 +660,9 @@ void sub_08052FF4(u32 area, u32 room) {
|
||||
gArea.currentRoomInfo.map_y = r_hdr->map_y;
|
||||
gArea.currentRoomInfo.pixel_width = r_hdr->pixel_width;
|
||||
gArea.currentRoomInfo.pixel_height = r_hdr->pixel_height;
|
||||
gArea.currentRoomInfo.tileset = *(gAreaTilesets[area] + r_hdr->tileset_id);
|
||||
gArea.currentRoomInfo.tileSet = *(gAreaTileSets[area] + r_hdr->tileSet_id);
|
||||
gArea.currentRoomInfo.map = *(gAreaRoomMaps[area] + room);
|
||||
gArea.currentRoomInfo.metatiles = gAreaMetatiles[area];
|
||||
gArea.currentRoomInfo.tiles = gAreaTiles[area];
|
||||
gArea.currentRoomInfo.bg_anim = (void*)gUnk_080B755C[area];
|
||||
}
|
||||
|
||||
@@ -817,16 +818,15 @@ void LoadItemGfx(void) {
|
||||
LoadGfxGroup(GetInventoryValue(ITEM_MAGIC_BOOMERANG) ? 28 : 27);
|
||||
}
|
||||
|
||||
extern u16 gUnk_020178E0[];
|
||||
void sub_080533CC(void) {
|
||||
u16* p1 = gUnk_020178E0;
|
||||
u16* p2 = gUnk_020178E0 - 0x100;
|
||||
u16* p1 = gPaletteBuffer + 288;
|
||||
u16* p2 = gPaletteBuffer + 32;
|
||||
*p2++ = *p1++;
|
||||
*p2++ = *p1++;
|
||||
*p2++ = *p1++;
|
||||
*p2++ = *p1++;
|
||||
*p2++ = *p1++;
|
||||
gUsedPalettes |= 8;
|
||||
gUsedPalettes |= 1 << 3;
|
||||
}
|
||||
|
||||
void UpdateTimerCallbacks(void) {
|
||||
@@ -848,7 +848,7 @@ void DummyHandler(u32* timer) {
|
||||
}
|
||||
|
||||
void DarknutTimerHandler(u32* timer) {
|
||||
if (gArea.locationIndex == 29 && *timer) {
|
||||
if (gArea.locationIndex == 29 && *timer) { // AREA_DARK_HYRULE_CASTLE
|
||||
if (!--*timer) {
|
||||
ResetTimerFlags();
|
||||
MenuFadeIn(5, 6);
|
||||
|
||||
+8
-8
@@ -87,11 +87,11 @@ void UpdateDisplayControls(void) {
|
||||
}
|
||||
|
||||
void sub_08016CA8(BgSettings* bg) {
|
||||
if (bg->updated && bg->tilemap != NULL) {
|
||||
if (bg->updated && bg->subTileMap != NULL) {
|
||||
u32 dest;
|
||||
bg->updated = 0;
|
||||
dest = bg->control;
|
||||
DmaCopy32(3, bg->tilemap, ((dest << 3) & 0xF800) + VRAM, gUnk_080B2CD8[dest >> 14]);
|
||||
DmaCopy32(3, bg->subTileMap, ((dest << 3) & 0xF800) + VRAM, gUnk_080B2CD8[dest >> 14]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,9 +233,9 @@ void PlayerUpdate(PlayerEntity* this) {
|
||||
static void HandlePlayerLife(Entity* this) {
|
||||
u32 threshold;
|
||||
|
||||
gUnk_0200AF00.rActionPlayerState = R_ACTION_NONE;
|
||||
gUnk_0200AF00.rActionInteractTile = R_ACTION_NONE;
|
||||
gUnk_0200AF00.rActionGrabbing = R_ACTION_NONE;
|
||||
gHUD.rActionPlayerState = R_ACTION_NONE;
|
||||
gHUD.rActionInteractTile = R_ACTION_NONE;
|
||||
gHUD.rActionGrabbing = R_ACTION_NONE;
|
||||
|
||||
if ((gPlayerEntity.base.contactFlags & CONTACT_NOW) && (gPlayerEntity.base.iframes > 0))
|
||||
SoundReq(SFX_86);
|
||||
@@ -263,7 +263,7 @@ static void HandlePlayerLife(Entity* this) {
|
||||
return;
|
||||
|
||||
#ifdef EU
|
||||
if ((gUnk_0200AF00.unk_1 == 0) && gRoomTransition.frameCount % 90 == 0) {
|
||||
if ((gHUD.hideFlags == HUD_HIDE_NONE) && gRoomTransition.frameCount % 90 == 0) {
|
||||
threshold = gSave.stats.maxHealth / 4;
|
||||
if (threshold > 24)
|
||||
threshold = 24;
|
||||
@@ -285,7 +285,7 @@ static void HandlePlayerLife(Entity* this) {
|
||||
|
||||
if (gSave.stats.health <= threshold) {
|
||||
gRoomVars.needHealthDrop = TRUE;
|
||||
if ((gUnk_0200AF00.unk_1 == 0) && gRoomTransition.frameCount % 90 == 0) {
|
||||
if ((gHUD.hideFlags == HUD_HIDE_NONE) && gRoomTransition.frameCount % 90 == 0) {
|
||||
EnqueueSFX(SFX_LOW_HEALTH);
|
||||
}
|
||||
}
|
||||
@@ -332,7 +332,7 @@ static void sub_080171F0(void) {
|
||||
sub_080028E0(&gPlayerEntity.base);
|
||||
|
||||
if (gPlayerState.flags & PL_CLONING)
|
||||
gUnk_0200AF00.rActionPlayerState = R_ACTION_CANCEL;
|
||||
gHUD.rActionPlayerState = R_ACTION_CANCEL;
|
||||
|
||||
DetermineRButtonInteraction();
|
||||
gPlayerState.field_0x7 &= ~0x80;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
#include "playeritem.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void (*const ItemGustJar_StateFunctions[])(ItemBehavior* this, u32);
|
||||
|
||||
@@ -11,7 +12,7 @@ void ItemGustJar(ItemBehavior* this, u32 index) {
|
||||
}
|
||||
|
||||
void sub_08076DF4(ItemBehavior* this, u32 index) {
|
||||
if (GetCollisionTileInFront(&gPlayerEntity.base) != 0x29 && gPlayerState.floor_type != SURFACE_DOOR &&
|
||||
if (GetActTileInFront(&gPlayerEntity.base) != ACT_TILE_41 && gPlayerState.floor_type != SURFACE_DOOR &&
|
||||
gPlayerState.floor_type != SURFACE_DOOR_13 && gPlayerState.jump_status == 0) {
|
||||
sub_08077D38(this, index);
|
||||
this->timer = 0;
|
||||
|
||||
+12
-11
@@ -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 DoItemTileInteraction(Entity*, u32, ItemBehavior*);
|
||||
@@ -175,19 +176,19 @@ 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 collisionData;
|
||||
u32 tilePos;
|
||||
|
||||
uVar3 = COORD_TO_TILE_OFFSET((&gPlayerEntity.base), -gUnk_0811BE1E[gPlayerEntity.base.animationState & 6],
|
||||
-gUnk_0811BE1E[(gPlayerEntity.base.animationState & 6) + 1]);
|
||||
tilePos = COORD_TO_TILE_OFFSET((&gPlayerEntity.base), -gUnk_0811BE1E[gPlayerEntity.base.animationState & 6],
|
||||
-gUnk_0811BE1E[(gPlayerEntity.base.animationState & 6) + 1]);
|
||||
|
||||
iVar2 = sub_080B1B44(uVar3, gPlayerEntity.base.collisionLayer);
|
||||
collisionData = GetCollisionDataAtTilePos(tilePos, gPlayerEntity.base.collisionLayer);
|
||||
|
||||
if (iVar2 > 0x16)
|
||||
if (collisionData > 0x16)
|
||||
return 0;
|
||||
if (iVar2 < 0xf)
|
||||
if (collisionData < 0xf)
|
||||
return 0;
|
||||
if (sub_080B1AE0(uVar3, gPlayerEntity.base.collisionLayer) != 0x56) {
|
||||
if (GetActTileAtTilePos(tilePos, gPlayerEntity.base.collisionLayer) != ACT_TILE_86) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0x56;
|
||||
|
||||
@@ -100,7 +100,7 @@ void ItemPickupCheck(ItemBehavior* this, u32 index) {
|
||||
carried->subAction = 5;
|
||||
gPlayerState.framestate = PL_STATE_THROW;
|
||||
sub_080762C4(this, carried, 2, index);
|
||||
gUnk_0200AF00.rActionGrabbing = R_ACTION_GRAB;
|
||||
gHUD.rActionGrabbing = R_ACTION_GRAB;
|
||||
SoundReq(SFX_102);
|
||||
break;
|
||||
case 1:
|
||||
@@ -157,7 +157,7 @@ void sub_080762D8(ItemBehavior* this, u32 index) {
|
||||
}
|
||||
|
||||
gPlayerState.framestate = PL_STATE_THROW;
|
||||
gUnk_0200AF00.rActionGrabbing = 8;
|
||||
gHUD.rActionGrabbing = 8;
|
||||
} else {
|
||||
if (this->field_0x18 != NULL) {
|
||||
this->field_0x18->subAction = 6;
|
||||
|
||||
+2
-2
@@ -309,8 +309,8 @@ void ForceEquipItem(u32 itemId, u32 equipSlot) {
|
||||
}
|
||||
gSave.stats.equipped[equipSlot] = itemId;
|
||||
gSave.stats.equipped[otherItemSlot] = otherItem;
|
||||
gUnk_0200AF00.unk_13 = 0x7f;
|
||||
gUnk_0200AF00.unk_14 = 0x7f;
|
||||
gHUD.unk_13 = 0x7f;
|
||||
gHUD.unk_14 = 0x7f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+52
-52
@@ -2,7 +2,6 @@
|
||||
#include "asm.h"
|
||||
#include "common.h"
|
||||
#include "flags.h"
|
||||
#include "global.h"
|
||||
#include "item.h"
|
||||
#include "kinstone.h"
|
||||
#include "manager.h"
|
||||
@@ -10,6 +9,7 @@
|
||||
#include "player.h"
|
||||
#include "room.h"
|
||||
#include "subtask.h"
|
||||
#include "tiles.h"
|
||||
|
||||
extern const struct_gUnk_080B3D20 gUnk_080B3D20[];
|
||||
extern const EntityData gUnk_080FEC28[];
|
||||
@@ -335,7 +335,7 @@ void sub_0801876C(u32 worldEventId, bool32 isKinstoneFused) {
|
||||
if (isKinstoneFused == 0) {
|
||||
return;
|
||||
}
|
||||
SetTileType(0x168, (ptr->x >> 4 & 0x3f) | (ptr->y >> 4 & 0x3f) << 6, 1);
|
||||
SetTileType(TILE_TYPE_360, (ptr->x >> 4 & 0x3f) | (ptr->y >> 4 & 0x3f) << 6, LAYER_BOTTOM);
|
||||
break;
|
||||
case WORLD_EVENT_TYPE_11:
|
||||
if (isKinstoneFused != 0) {
|
||||
@@ -354,12 +354,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);
|
||||
SetTileType(TILE_TYPE_141, (ptr->x >> 4 & 0x3f) | (ptr->y >> 4 & 0x3f) << 6, LAYER_BOTTOM);
|
||||
} else {
|
||||
uVar5 = (ptr->x >> 4 & 0x3f) | (ptr->y >> 4 & 0x3f) << 6;
|
||||
SetTileType(0x8c, uVar5 - 1, 1);
|
||||
uVar3 = 0x8e;
|
||||
SetTileType(uVar3, uVar5, 1);
|
||||
SetTileType(TILE_TYPE_140, uVar5 - 1, LAYER_BOTTOM);
|
||||
uVar3 = TILE_TYPE_142;
|
||||
SetTileType(uVar3, uVar5, LAYER_BOTTOM);
|
||||
}
|
||||
break;
|
||||
case WORLD_EVENT_TYPE_24:
|
||||
@@ -390,67 +390,67 @@ void sub_0801876C(u32 worldEventId, bool32 isKinstoneFused) {
|
||||
void sub_080189EC(u32 worldEventId) {
|
||||
u32 i;
|
||||
int iVar1;
|
||||
int tilePosition;
|
||||
int tilePos;
|
||||
const WorldEvent* ptr;
|
||||
|
||||
ptr = &gWorldEvents[worldEventId];
|
||||
|
||||
tilePosition = (ptr->x >> 4) & 0x3f;
|
||||
tilePosition |= ((ptr->y >> 4) & 0x3f) << 6;
|
||||
tilePosition -= 0x42;
|
||||
tilePos = (ptr->x >> 4) & 0x3f;
|
||||
tilePos |= ((ptr->y >> 4) & 0x3f) << 6;
|
||||
tilePos -= TILE_POS(2, 1);
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
SetTileType(i + 0x1df, tilePosition + i, 2);
|
||||
SetTileType(i + TILE_TYPE_479, tilePos + i, LAYER_TOP);
|
||||
}
|
||||
|
||||
tilePosition += 0x40;
|
||||
tilePos += TILE_POS(0, 1);
|
||||
for (i = 0; i < 4; i++) {
|
||||
SetTileType(i + 0x1e3, tilePosition + i, 2);
|
||||
SetTileType(i + 0x1db, tilePosition + i, 1);
|
||||
SetTileType(i + TILE_TYPE_483, tilePos + i, LAYER_TOP);
|
||||
SetTileType(i + TILE_TYPE_475, tilePos + i, LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08018A58(u32 worldEventId) {
|
||||
u32 i;
|
||||
int iVar2;
|
||||
int tileType;
|
||||
u32 j;
|
||||
int tilePosition;
|
||||
int tilePos;
|
||||
const WorldEvent* ptr;
|
||||
|
||||
ptr = &gWorldEvents[worldEventId];
|
||||
|
||||
tilePosition = (ptr->x >> 4) & 0x3f;
|
||||
tilePosition |= ((ptr->y >> 4) & 0x3f) << 6;
|
||||
tilePosition -= 0x43;
|
||||
iVar2 = 0x232;
|
||||
tilePos = (ptr->x >> 4) & 0x3f;
|
||||
tilePos |= ((ptr->y >> 4) & 0x3f) << 6;
|
||||
tilePos -= TILE_POS(3, 1);
|
||||
tileType = TILE_TYPE_562;
|
||||
|
||||
for (i = 0; i < 4; tilePosition += 0x40, i++) {
|
||||
for (i = 0; i < 4; tilePos += TILE_POS(0, 1), i++) {
|
||||
for (j = 0; j < 7; j++) {
|
||||
SetTileType(iVar2++, tilePosition + j, 1);
|
||||
SetTileType(tileType++, tilePos + j, LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08018AB4(int param_1) {
|
||||
void sub_08018AB4(int tilePos) {
|
||||
u32 i;
|
||||
int iVar2;
|
||||
u32 j;
|
||||
int iVar6;
|
||||
|
||||
iVar2 = 0x1e8;
|
||||
iVar6 = 500;
|
||||
iVar2 = TILE_TYPE_488;
|
||||
iVar6 = TILE_TYPE_500;
|
||||
|
||||
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);
|
||||
SetTileType(iVar2++, tilePos + j, LAYER_BOTTOM);
|
||||
SetTileType(iVar6++, tilePos + TILE_POS(0, -1) + j, LAYER_TOP);
|
||||
}
|
||||
param_1 += 0x40;
|
||||
tilePos += TILE_POS(0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08018B10(int param_1) {
|
||||
void sub_08018B10(int tilePos) {
|
||||
int iVar1;
|
||||
u32 index;
|
||||
int iVar3;
|
||||
@@ -459,34 +459,34 @@ void sub_08018B10(int param_1) {
|
||||
iVar4 = 0x1f0;
|
||||
iVar3 = 0x1fc;
|
||||
index = 0;
|
||||
iVar1 = param_1 - 0x40;
|
||||
iVar1 = tilePos - TILE_POS(0, 1);
|
||||
for (; index < 4; iVar1++, index++) {
|
||||
SetTileType(iVar4++, param_1 + index, 1);
|
||||
SetTileType(iVar3++, iVar1, 2);
|
||||
SetTileType(iVar4++, tilePos + index, LAYER_BOTTOM);
|
||||
SetTileType(iVar3++, iVar1, LAYER_TOP);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08018B50(u32 worldEventId) {
|
||||
u32 i;
|
||||
int iVar2;
|
||||
int tileType;
|
||||
u32 j;
|
||||
int tilePosition;
|
||||
int tilePos;
|
||||
const WorldEvent* ptr;
|
||||
|
||||
ptr = &gWorldEvents[worldEventId];
|
||||
if ((ptr->entity_idx & 0x80) == 0) {
|
||||
iVar2 = 0x200;
|
||||
tileType = TILE_TYPE_512;
|
||||
} else {
|
||||
iVar2 = 0x219;
|
||||
tileType = TILE_TYPE_537;
|
||||
}
|
||||
|
||||
tilePosition = (ptr->x >> 4) & 0x3f;
|
||||
tilePosition |= ((ptr->y >> 4) & 0x3f) << 6;
|
||||
tilePosition -= 0x82;
|
||||
tilePos = (ptr->x >> 4) & 0x3f;
|
||||
tilePos |= ((ptr->y >> 4) & 0x3f) << 6;
|
||||
tilePos -= TILE_POS(2, 2);
|
||||
|
||||
for (i = 0; i < 5; tilePosition += 0x40, i++) {
|
||||
for (i = 0; i < 5; tilePos += 0x40, i++) {
|
||||
for (j = 0; j < 5; j++) {
|
||||
SetTileType(iVar2++, tilePosition + j, 1);
|
||||
SetTileType(tileType++, tilePos + j, LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -494,22 +494,22 @@ void sub_08018B50(u32 worldEventId) {
|
||||
// TODO world event that loads tile entity
|
||||
void sub_08018BB4(u32 worldEventId) {
|
||||
u32 layer;
|
||||
TileEntity tile;
|
||||
TileEntity tileEntity;
|
||||
const WorldEvent* ptr;
|
||||
u32 position;
|
||||
|
||||
MemCopy(gUnk_080FEAC8 + worldEventId, &tile, sizeof(TileEntity));
|
||||
MemCopy(gUnk_080FEAC8 + worldEventId, &tileEntity, sizeof(TileEntity));
|
||||
ptr = &gWorldEvents[worldEventId];
|
||||
tile.tilePos = (ptr->x >> 4 & 0x3f) | (((ptr->y) >> 4 & 0x3f) << 6);
|
||||
LoadSmallChestTile2(&tile);
|
||||
if (CheckLocalFlag(tile.localFlag) == 0) {
|
||||
position = tile.tilePos;
|
||||
if ((tile._6 & 1) == 0) {
|
||||
tileEntity.tilePos = (ptr->x >> 4 & 0x3f) | (((ptr->y) >> 4 & 0x3f) << 6);
|
||||
LoadSmallChestTile2(&tileEntity);
|
||||
if (CheckLocalFlag(tileEntity.localFlag) == 0) {
|
||||
position = tileEntity.tilePos;
|
||||
if ((tileEntity._6 & 1) == 0) {
|
||||
layer = 1;
|
||||
} else {
|
||||
layer = 2;
|
||||
}
|
||||
SetTileType(0x73, position, layer);
|
||||
SetTileType(TILE_TYPE_115, position, layer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -519,7 +519,7 @@ void CreateMinishEntrance(u32 tilePos) {
|
||||
|
||||
for (y = 0; y <= 3; y++) {
|
||||
for (x = 0; x <= 4; x++) {
|
||||
SetTileType(tileID++, tilePos + x, 1);
|
||||
SetTileType(tileID++, tilePos + x, LAYER_BOTTOM);
|
||||
}
|
||||
tilePos += 0x40;
|
||||
}
|
||||
@@ -529,7 +529,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);
|
||||
SetTileType(TILE_TYPE_608 + i, tilePos, LAYER_BOTTOM);
|
||||
SetTileType(TILE_TYPE_609 + i, tilePos + 1, LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
|
||||
+60
-58
@@ -1,64 +1,66 @@
|
||||
#include "manager.h"
|
||||
|
||||
// TODO: change all manager arguments to be Entity* and cast to specific type later.
|
||||
void (*const gMiscManagerunctions[])() = { NULL,
|
||||
LightRayManager_Main,
|
||||
VerticalMinishPathBackgroundManager_Main,
|
||||
MinishPortalManager_Main,
|
||||
DiggingCaveEntranceManager_Main,
|
||||
BridgeManager_Main,
|
||||
SpecialWarpManager_Main,
|
||||
MinishVillageTilesetManager_Main,
|
||||
HorizontalMinishPathBackgroundManager_Main,
|
||||
MinishRaftersBackgroundManager_Main,
|
||||
EzloHintManager_Main,
|
||||
FightManager_Main,
|
||||
RollingBarrelManager_Main,
|
||||
TileChangeObserveManager_Main,
|
||||
EntitySpawnManager_Main,
|
||||
MiscManager_Main,
|
||||
WeatherChangeManager_Main,
|
||||
FlagAndOperatorManager_Main,
|
||||
HyruleTownTilesetManager_Main,
|
||||
HouseSignManager_Main,
|
||||
SteamOverlayManager_Main,
|
||||
TempleOfDropletsManager_Main,
|
||||
DelayedEntityLoadManager_Main,
|
||||
FallingItemManager_Main,
|
||||
CloudOverlayManager_Main,
|
||||
PowBackgroundManager_Main,
|
||||
HoleManager_Main,
|
||||
StaticBackgroundManager_Main,
|
||||
RainfallManager_Main,
|
||||
AnimatedBackgroundManager_Main,
|
||||
RegionTriggerManager_Main,
|
||||
RailIntersectionManager_Main,
|
||||
MoveableObjectManager_Main,
|
||||
MinishSizedEntranceManager_Main,
|
||||
LightManager_Main,
|
||||
LightLevelSetManager_Main,
|
||||
BombableWallManager_Main,
|
||||
FlameManager_Main,
|
||||
PushableFurnitureManager_Main,
|
||||
ArmosInteriorManager_Main,
|
||||
EnemyInteractionManager_Main,
|
||||
Manager29_Main,
|
||||
DestructibleTileObserveManager_Main,
|
||||
AngryStatueManager_Main,
|
||||
CloudStaircaseTransitionManager_Main,
|
||||
WaterfallBottomManager_Main,
|
||||
SecretManager_Main,
|
||||
Vaati3BackgroundManager_Main,
|
||||
TilePuzzleManager_Main,
|
||||
GoronMerchantShopManager_Main,
|
||||
VaatiAppearingManager_Main,
|
||||
HyruleTownBellManager_Main,
|
||||
Vaati3InsideArmManager_Main,
|
||||
CameraTargetManager_Main,
|
||||
RepeatedSoundManager_Main,
|
||||
Vaati3StartManager_Main,
|
||||
FloatingPlatformManager_Main,
|
||||
EnterRoomTextboxManager_Main };
|
||||
void (*const gMiscManagerunctions[])() = {
|
||||
NULL,
|
||||
LightRayManager_Main,
|
||||
VerticalMinishPathBackgroundManager_Main,
|
||||
MinishPortalManager_Main,
|
||||
DiggingCaveEntranceManager_Main,
|
||||
BridgeManager_Main,
|
||||
SpecialWarpManager_Main,
|
||||
MinishVillageTileSetManager_Main,
|
||||
HorizontalMinishPathBackgroundManager_Main,
|
||||
MinishRaftersBackgroundManager_Main,
|
||||
EzloHintManager_Main,
|
||||
FightManager_Main,
|
||||
RollingBarrelManager_Main,
|
||||
TileChangeObserveManager_Main,
|
||||
EntitySpawnManager_Main,
|
||||
MiscManager_Main,
|
||||
WeatherChangeManager_Main,
|
||||
FlagAndOperatorManager_Main,
|
||||
HyruleTownTileSetManager_Main,
|
||||
HouseSignManager_Main,
|
||||
SteamOverlayManager_Main,
|
||||
TempleOfDropletsManager_Main,
|
||||
DelayedEntityLoadManager_Main,
|
||||
FallingItemManager_Main,
|
||||
CloudOverlayManager_Main,
|
||||
PowBackgroundManager_Main,
|
||||
HoleManager_Main,
|
||||
StaticBackgroundManager_Main,
|
||||
RainfallManager_Main,
|
||||
AnimatedBackgroundManager_Main,
|
||||
RegionTriggerManager_Main,
|
||||
RailIntersectionManager_Main,
|
||||
MoveableObjectManager_Main,
|
||||
MinishSizedEntranceManager_Main,
|
||||
LightManager_Main,
|
||||
LightLevelSetManager_Main,
|
||||
BombableWallManager_Main,
|
||||
FlameManager_Main,
|
||||
PushableFurnitureManager_Main,
|
||||
ArmosInteriorManager_Main,
|
||||
EnemyInteractionManager_Main,
|
||||
Manager29_Main,
|
||||
DestructibleTileObserveManager_Main,
|
||||
AngryStatueManager_Main,
|
||||
CloudStaircaseTransitionManager_Main,
|
||||
WaterfallBottomManager_Main,
|
||||
SecretManager_Main,
|
||||
Vaati3BackgroundManager_Main,
|
||||
TilePuzzleManager_Main,
|
||||
GoronMerchantShopManager_Main,
|
||||
VaatiAppearingManager_Main,
|
||||
HyruleTownBellManager_Main,
|
||||
Vaati3InsideArmManager_Main,
|
||||
CameraTargetManager_Main,
|
||||
RepeatedSoundManager_Main,
|
||||
Vaati3StartManager_Main,
|
||||
FloatingPlatformManager_Main,
|
||||
EnterRoomTextboxManager_Main,
|
||||
};
|
||||
|
||||
void ManagerUpdate(Entity* this) {
|
||||
if (!EntityDisabled(this))
|
||||
|
||||
+140
-141
@@ -11,21 +11,20 @@
|
||||
#include "game.h"
|
||||
#include "object.h"
|
||||
#include "sound.h"
|
||||
#include "tiles.h"
|
||||
|
||||
u32 sub_0805BFC4(u32, u32);
|
||||
void sub_0805C02C(BombableWallManager*);
|
||||
|
||||
extern u32 sub_080B1AE0(u16, u8);
|
||||
u32 BombableWallManager_GetBombableType(u32 tilePos, 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*) = {
|
||||
@@ -38,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->tilePos = (this->x >> 4 & 0x3fU) | (((this->y << 0x10) >> 0x14 & 0x3fU) << 6);
|
||||
super->type = BombableWallManager_GetBombableType(this->tilePos, this->layer);
|
||||
if (CheckLocalFlag(this->flag) != 0) {
|
||||
BombableWallManager_DestroyWall(this);
|
||||
DeleteManager(super);
|
||||
}
|
||||
}
|
||||
|
||||
void BombableWallManager_Action1(BombableWallManager* this) {
|
||||
if (sub_080B1AE0(this->tile, this->field_0x35) != 0x2e) {
|
||||
if (GetActTileAtTilePos(this->tilePos, this->layer) != ACT_TILE_46) {
|
||||
super->action = 2;
|
||||
super->timer = 90;
|
||||
sub_0805C02C(this);
|
||||
SetLocalFlag(this->field_0x3e);
|
||||
BombableWallManager_DestroyWall(this);
|
||||
SetLocalFlag(this->flag);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,155 +61,155 @@ void BombableWallManager_Action2(BombableWallManager* this) {
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_0805BFC4(u32 pos, u32 layer) {
|
||||
u32 tileType = GetTileType(pos, layer);
|
||||
u32 BombableWallManager_GetBombableType(u32 tilePos, u32 layer) {
|
||||
u32 tileType = GetTileTypeAtTilePos(tilePos, layer);
|
||||
|
||||
switch (tileType) {
|
||||
case 0xec:
|
||||
case TILE_TYPE_236:
|
||||
return 1;
|
||||
case 0xbf:
|
||||
case TILE_TYPE_191:
|
||||
return 4;
|
||||
case 0xaf:
|
||||
case TILE_TYPE_175:
|
||||
return 0;
|
||||
case 0xcc:
|
||||
case TILE_TYPE_204:
|
||||
return 2;
|
||||
case 0xdf:
|
||||
case TILE_TYPE_223:
|
||||
return 3;
|
||||
case 0xff:
|
||||
case TILE_TYPE_255:
|
||||
return 0;
|
||||
case 0x115:
|
||||
case TILE_TYPE_277:
|
||||
return 1;
|
||||
case 0x108:
|
||||
case TILE_TYPE_264:
|
||||
return 2;
|
||||
case 0x110:
|
||||
case TILE_TYPE_272:
|
||||
return 3;
|
||||
case 0x105:
|
||||
case 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->tilePos, 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 tilePos, u32 layer) {
|
||||
SetTileType(TILE_TYPE_177, tilePos + TILE_POS(-1, -1), layer);
|
||||
SetTileType(TILE_TYPE_178, tilePos + TILE_POS(0, -1), layer);
|
||||
SetTileType(TILE_TYPE_179, tilePos + TILE_POS(1, -1), layer);
|
||||
SetTileType(TILE_TYPE_180, tilePos + TILE_POS(-1, 0), layer);
|
||||
SetTileType(TILE_TYPE_183, tilePos + TILE_POS(1, 0), 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 = ((tilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x;
|
||||
object->y.HALF.HI = ((tilePos & 0xfc0) >> 2) - 8 + gRoomControls.origin_y;
|
||||
}
|
||||
SetTileType(0xb5, pos, 1);
|
||||
SetTileType(TILE_TYPE_181, tilePos, LAYER_BOTTOM);
|
||||
} else {
|
||||
if (AreaIsDungeon() != 0) {
|
||||
SetTileType(0xb5, pos, 1);
|
||||
if (AreaIsDungeon()) {
|
||||
SetTileType(TILE_TYPE_181, tilePos, LAYER_BOTTOM);
|
||||
} else {
|
||||
SetTileType(0xb6, pos, 1);
|
||||
SetTileType(TILE_TYPE_182, tilePos, LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
|
||||
SetTileType(0xb8, pos - 0x41, 2);
|
||||
SetTileType(0xb9, pos - 0x40, 2);
|
||||
SetTileType(0xba, pos - 0x3f, 2);
|
||||
SetTileType(TILE_TYPE_184, tilePos + TILE_POS(-1, -1), LAYER_TOP);
|
||||
SetTileType(TILE_TYPE_185, tilePos + TILE_POS(0, -1), LAYER_TOP);
|
||||
SetTileType(TILE_TYPE_186, tilePos + TILE_POS(1, -1), LAYER_TOP);
|
||||
} else {
|
||||
Entity* object;
|
||||
SetTileType(0xb5, pos, 2);
|
||||
if (AreaIsDungeon() == 0) {
|
||||
SetTileType(TILE_TYPE_181, tilePos, 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 = ((tilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x;
|
||||
object->y.HALF.HI = ((tilePos & 0xfc0) >> 2) - 0x10 + gRoomControls.origin_y;
|
||||
object->collisionLayer = LAYER_TOP;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805C178(u32 pos, u32 layer) {
|
||||
void BombableWallManager_DestroyWall1(u32 tilePos, 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) {
|
||||
SetTileType(TILE_TYPE_241, tilePos + TILE_POS(0, -1), layer);
|
||||
SetTileType(TILE_TYPE_245, tilePos + TILE_POS(1, -1), layer);
|
||||
SetTileType(TILE_TYPE_246, tilePos + TILE_POS(1, 0), layer);
|
||||
SetTileType(TILE_TYPE_244, tilePos + TILE_POS(0, 1), layer);
|
||||
SetTileType(TILE_TYPE_247, tilePos + TILE_POS(1, 1), 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 = ((tilePos & 0x3f) << 4) + 0x18 + gRoomControls.origin_x;
|
||||
object->y.HALF.HI = ((tilePos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y;
|
||||
}
|
||||
SetTileType(0xf2, pos, 1);
|
||||
SetTileType(TILE_TYPE_242, tilePos, LAYER_BOTTOM);
|
||||
} else {
|
||||
if (AreaIsDungeon() != 0) {
|
||||
SetTileType(0xf2, pos, 1);
|
||||
if (AreaIsDungeon()) {
|
||||
SetTileType(TILE_TYPE_242, tilePos, LAYER_BOTTOM);
|
||||
} else {
|
||||
SetTileType(0xf3, pos, 1);
|
||||
SetTileType(TILE_TYPE_243, tilePos, LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
SetTileType(0xf8, pos - 0x3f, 2);
|
||||
SetTileType(0xf9, pos + 1, 2);
|
||||
SetTileType(0xfa, pos + 0x41, 2);
|
||||
SetTileType(TILE_TYPE_248, tilePos + TILE_POS(1, -1), LAYER_TOP);
|
||||
SetTileType(TILE_TYPE_249, tilePos + 1, LAYER_TOP);
|
||||
SetTileType(TILE_TYPE_250, tilePos + TILE_POS(1, 1), LAYER_TOP);
|
||||
} else {
|
||||
SetTileType(0xf2, pos, 2);
|
||||
if (AreaIsDungeon() == 0) {
|
||||
SetTileType(TILE_TYPE_242, tilePos, 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 = ((tilePos & 0x3f) << 4) + 0x20 + gRoomControls.origin_x;
|
||||
object->y.HALF.HI = ((tilePos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y;
|
||||
object->collisionLayer = LAYER_TOP;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805C294(u32 pos, u32 layer) {
|
||||
void BombableWallManager_DestroyWall2(u32 tilePos, 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) {
|
||||
SetTileType(TILE_TYPE_209, tilePos + TILE_POS(-1, 0), layer);
|
||||
SetTileType(TILE_TYPE_212, tilePos + TILE_POS(1, 0), layer);
|
||||
SetTileType(TILE_TYPE_213, tilePos + TILE_POS(-1, 1), layer);
|
||||
SetTileType(TILE_TYPE_214, tilePos + TILE_POS(0, 1), layer);
|
||||
SetTileType(TILE_TYPE_215, tilePos + TILE_POS(1, 1), 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 = ((tilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x;
|
||||
object->y.HALF.HI = ((tilePos & 0xfc0) >> 2) + 0x20 + gRoomControls.origin_y;
|
||||
}
|
||||
SetTileType(0xd2, pos, 1);
|
||||
SetTileType(TILE_TYPE_210, tilePos, LAYER_BOTTOM);
|
||||
} else {
|
||||
if (AreaIsDungeon() != 0) {
|
||||
SetTileType(0xd2, pos, 1);
|
||||
if (AreaIsDungeon()) {
|
||||
SetTileType(TILE_TYPE_210, tilePos, LAYER_BOTTOM);
|
||||
} else {
|
||||
SetTileType(0xd3, pos, 1);
|
||||
SetTileType(TILE_TYPE_211, tilePos, LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
SetTileType(0xd8, pos + 0x3f, 2);
|
||||
SetTileType(0xd9, pos + 0x40, 2);
|
||||
SetTileType(0xda, pos + 0x41, 2);
|
||||
SetTileType(TILE_TYPE_216, tilePos + TILE_POS(-1, 1), LAYER_TOP);
|
||||
SetTileType(TILE_TYPE_217, tilePos + TILE_POS(0, 1), LAYER_TOP);
|
||||
SetTileType(TILE_TYPE_218, tilePos + TILE_POS(1, 1), LAYER_TOP);
|
||||
} else {
|
||||
SetTileType(0xd2, pos, 2);
|
||||
SetTileType(TILE_TYPE_210, tilePos, LAYER_TOP);
|
||||
if (AreaIsDungeon() == 0) {
|
||||
return;
|
||||
}
|
||||
@@ -218,41 +217,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 = ((tilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x;
|
||||
object->y.HALF.HI = ((tilePos & 0xfc0) >> 2) + 0x20 + gRoomControls.origin_y;
|
||||
object->collisionLayer = LAYER_TOP;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805C3B4(u32 pos, u32 layer) {
|
||||
void BombableWallManager_DestroyWall3(u32 tilePos, 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) {
|
||||
SetTileType(TILE_TYPE_225, tilePos + TILE_POS(-1, -1), layer);
|
||||
SetTileType(TILE_TYPE_228, tilePos + TILE_POS(0, -1), layer);
|
||||
SetTileType(TILE_TYPE_226, tilePos + TILE_POS(-1, 0), layer);
|
||||
SetTileType(TILE_TYPE_227, tilePos + TILE_POS(-1, 1), layer);
|
||||
SetTileType(TILE_TYPE_231, tilePos + TILE_POS(0, 1), 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 = ((tilePos & 0x3f) << 4) + -0x10 + gRoomControls.origin_x;
|
||||
object->y.HALF.HI = ((tilePos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y;
|
||||
}
|
||||
SetTileType(0xe5, pos, 1);
|
||||
SetTileType(TILE_TYPE_229, tilePos, LAYER_BOTTOM);
|
||||
} else {
|
||||
if (AreaIsDungeon() != 0) {
|
||||
SetTileType(0xe5, pos, 1);
|
||||
if (AreaIsDungeon()) {
|
||||
SetTileType(TILE_TYPE_229, tilePos, LAYER_BOTTOM);
|
||||
} else {
|
||||
SetTileType(0xe6, pos, 1);
|
||||
SetTileType(TILE_TYPE_230, tilePos, LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
SetTileType(0xe8, pos - 0x41, 2);
|
||||
SetTileType(0xe9, pos - 1, 2);
|
||||
SetTileType(0xea, pos + 0x3f, 2);
|
||||
SetTileType(TILE_TYPE_232, tilePos + TILE_POS(-1, -1), LAYER_TOP);
|
||||
SetTileType(TILE_TYPE_233, tilePos + TILE_POS(-1, 0), LAYER_TOP);
|
||||
SetTileType(TILE_TYPE_234, tilePos + TILE_POS(-1, 1), LAYER_TOP);
|
||||
} else {
|
||||
SetTileType(0xe5, pos, 2);
|
||||
if (AreaIsDungeon() == 0) {
|
||||
SetTileType(TILE_TYPE_229, tilePos, LAYER_TOP);
|
||||
if (!AreaIsDungeon()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -260,41 +259,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 = ((tilePos & 0x3f) << 4) + -0x10 + gRoomControls.origin_x;
|
||||
object->y.HALF.HI = ((tilePos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y;
|
||||
object->collisionLayer = LAYER_TOP;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805C4E0(u32 pos, u32 layer) {
|
||||
void BombableWallManager_DestroyWall4(u32 tilePos, 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) {
|
||||
SetTileType(TILE_TYPE_193, tilePos + TILE_POS(-1, -1), layer);
|
||||
SetTileType(TILE_TYPE_194, tilePos + TILE_POS(0, -1), layer);
|
||||
SetTileType(TILE_TYPE_195, tilePos + TILE_POS(1, -1), layer);
|
||||
SetTileType(TILE_TYPE_196, tilePos + TILE_POS(-1, 0), layer);
|
||||
SetTileType(TILE_TYPE_199, tilePos + TILE_POS(1, 0), 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 = ((tilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x;
|
||||
object->y.HALF.HI = ((tilePos & 0xfc0) >> 2) + -0x10 + gRoomControls.origin_y;
|
||||
}
|
||||
SetTileType(0xc5, pos, 1);
|
||||
SetTileType(TILE_TYPE_197, tilePos, LAYER_BOTTOM);
|
||||
} else {
|
||||
if (AreaIsDungeon() != 0) {
|
||||
SetTileType(0xc5, pos, 1);
|
||||
if (AreaIsDungeon()) {
|
||||
SetTileType(TILE_TYPE_197, tilePos, LAYER_BOTTOM);
|
||||
} else {
|
||||
SetTileType(0xc6, pos, 1);
|
||||
SetTileType(TILE_TYPE_198, tilePos, LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
SetTileType(0xc8, pos - 0x41, 2);
|
||||
SetTileType(0xc9, pos - 0x40, 2);
|
||||
SetTileType(0xca, pos - 0x3f, 2);
|
||||
SetTileType(TILE_TYPE_200, tilePos + TILE_POS(-1, -1), LAYER_TOP);
|
||||
SetTileType(TILE_TYPE_201, tilePos + TILE_POS(0, -1), LAYER_TOP);
|
||||
SetTileType(TILE_TYPE_202, tilePos + TILE_POS(1, -1), LAYER_TOP);
|
||||
} else {
|
||||
SetTileType(0xc5, pos, 2);
|
||||
if (AreaIsDungeon() == 0) {
|
||||
SetTileType(TILE_TYPE_197, tilePos, LAYER_TOP);
|
||||
if (!AreaIsDungeon()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -302,9 +301,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 = ((tilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x;
|
||||
object->y.HALF.HI = ((tilePos & 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 = GetTileTypeAtTilePos(param_1->tilePos, param_1->tileLayer);
|
||||
if (param_1->tileType == tileType) {
|
||||
SetLocalFlag(param_1->flag);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "player.h"
|
||||
#include "room.h"
|
||||
#include "scroll.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void DiggingCaveEntranceManager_Main(DiggingCaveEntranceManager*);
|
||||
void DiggingCaveEntranceManager_Init(DiggingCaveEntranceManager*);
|
||||
@@ -31,7 +32,7 @@ void DiggingCaveEntranceManager_Init(DiggingCaveEntranceManager* this) {
|
||||
const DiggingCaveEntrance* entrance;
|
||||
u8 room;
|
||||
u8 area;
|
||||
u16 tile = 0x81 << 7;
|
||||
u16 tileIndex = SPECIAL_TILE_128;
|
||||
UpdateIsDiggingCave();
|
||||
if (gDiggingCaveEntranceTransition.isDiggingCave) {
|
||||
if (gDiggingCaveEntranceTransition.entrance == NULL) {
|
||||
@@ -50,12 +51,12 @@ void DiggingCaveEntranceManager_Init(DiggingCaveEntranceManager* this) {
|
||||
}
|
||||
room = gRoomControls.room;
|
||||
entrance = diggingCaveEntrances[gRoomControls.area];
|
||||
tile = 0x81 << 7; // 0x4080
|
||||
tileIndex = SPECIAL_TILE_128;
|
||||
for (entrance = GetDiggingCaveEntranceForRoom(entrance, room); entrance != 0;
|
||||
entrance = GetDiggingCaveEntranceForRoom(entrance, room)) {
|
||||
SetBottomTile(tile, entrance->sourceTilePosition + TILE_POS(-1, 1), 1);
|
||||
SetBottomTile(tile, entrance->sourceTilePosition + TILE_POS(0, 1), 1);
|
||||
SetBottomTile(tile, entrance->sourceTilePosition + TILE_POS(1, 1), 1);
|
||||
SetTile(tileIndex, entrance->sourceTilePos + TILE_POS(-1, 1), LAYER_BOTTOM);
|
||||
SetTile(tileIndex, entrance->sourceTilePos + TILE_POS(0, 1), LAYER_BOTTOM);
|
||||
SetTile(tileIndex, entrance->sourceTilePos + TILE_POS(1, 1), LAYER_BOTTOM);
|
||||
entrance++;
|
||||
}
|
||||
}
|
||||
@@ -79,8 +80,8 @@ bool32 DiggingCaveEntranceManager_CheckEnterEntrance(DiggingCaveEntranceManager*
|
||||
if (gDiggingCaveEntranceTransition.isDiggingCave) {
|
||||
offsetX = gPlayerEntity.base.x.HALF.HI - gRoomControls.origin_x;
|
||||
offsetY = gPlayerEntity.base.y.HALF.HI - gRoomControls.origin_y;
|
||||
offsetX2 = (entr->sourceTilePosition & TILE_POS_X_COMPONENT) * 16 + 8;
|
||||
offsetY2 = ((entr->sourceTilePosition & TILE_POS_Y_COMPONENT) >> 6) * 16 + 0x18;
|
||||
offsetX2 = (entr->sourceTilePos & TILE_POS_X_COMPONENT) * 16 + 8;
|
||||
offsetY2 = ((entr->sourceTilePos & TILE_POS_Y_COMPONENT) >> 6) * 16 + 0x18;
|
||||
tmp = offsetX - offsetX2;
|
||||
if (tmp + 0x18 > 0x30 || offsetY - offsetY2 + 8 > 0x10U)
|
||||
return FALSE;
|
||||
@@ -89,9 +90,9 @@ bool32 DiggingCaveEntranceManager_CheckEnterEntrance(DiggingCaveEntranceManager*
|
||||
DiggingCaveEntranceManager_EnterEntrance(this, entr);
|
||||
return TRUE;
|
||||
} else {
|
||||
if (COORD_TO_TILE(&gPlayerEntity.base) != entr->sourceTilePosition)
|
||||
if (COORD_TO_TILE(&gPlayerEntity.base) != entr->sourceTilePos)
|
||||
return FALSE;
|
||||
offsetY2 = gRoomControls.origin_y + ((entr->sourceTilePosition >> 6) << 4) + 6;
|
||||
offsetY2 = gRoomControls.origin_y + ((entr->sourceTilePos >> 6) << 4) + 6;
|
||||
if (gPlayerEntity.base.y.HALF.HI >= offsetY2)
|
||||
return FALSE;
|
||||
DiggingCaveEntranceManager_EnterEntrance(this, entr);
|
||||
@@ -109,10 +110,10 @@ void DiggingCaveEntranceManager_EnterEntrance(DiggingCaveEntranceManager* this,
|
||||
gRoomControls.area = entr->targetArea;
|
||||
gRoomControls.room = entr->targetRoom;
|
||||
gDiggingCaveEntranceTransition.entrance = entr;
|
||||
gDiggingCaveEntranceTransition.offsetX = gPlayerEntity.base.x.HALF.HI - gRoomControls.origin_x -
|
||||
((entr->sourceTilePosition & TILE_POS_X_COMPONENT) * 16);
|
||||
gDiggingCaveEntranceTransition.offsetY = gPlayerEntity.base.y.HALF.HI - gRoomControls.origin_y -
|
||||
((entr->sourceTilePosition & TILE_POS_Y_COMPONENT) >> 2);
|
||||
gDiggingCaveEntranceTransition.offsetX =
|
||||
gPlayerEntity.base.x.HALF.HI - gRoomControls.origin_x - ((entr->sourceTilePos & TILE_POS_X_COMPONENT) * 16);
|
||||
gDiggingCaveEntranceTransition.offsetY =
|
||||
gPlayerEntity.base.y.HALF.HI - gRoomControls.origin_y - ((entr->sourceTilePos & TILE_POS_Y_COMPONENT) >> 2);
|
||||
|
||||
#ifndef EU
|
||||
isDiggingCave = gDiggingCaveEntranceTransition.isDiggingCave;
|
||||
@@ -129,7 +130,7 @@ void DiggingCaveEntranceManager_EnterEntrance(DiggingCaveEntranceManager* this,
|
||||
}
|
||||
|
||||
const DiggingCaveEntrance* GetDiggingCaveEntranceForRoom(const DiggingCaveEntrance* entr, int room) {
|
||||
for (; entr->sourceTilePosition != 0xffff; entr++) {
|
||||
for (; entr->sourceTilePos != 0xffff; entr++) {
|
||||
if (entr->sourceRoom == room)
|
||||
return entr;
|
||||
}
|
||||
@@ -141,85 +142,94 @@ const DiggingCaveEntrance* GetDiggingCaveEntranceForRoom(const DiggingCaveEntran
|
||||
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesEmpty[] = { END_OF_LIST };
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesMinishWoods[] = {
|
||||
{ TILE_POS(37, 19), ROOM_MINISH_WOODS_MAIN, 0x0, AREA_LAKE_WOODS_CAVE, ROOM_LAKE_WOODS_CAVE_MAIN,
|
||||
{ TILE_POS(37, 19), ROOM_MINISH_WOODS_MAIN, CAVE_LAKE_WOODS_ENTER, AREA_LAKE_WOODS_CAVE, ROOM_LAKE_WOODS_CAVE_MAIN,
|
||||
TILE_POS(37, 51) },
|
||||
{ TILE_POS(31, 15), ROOM_MINISH_WOODS_MAIN, 0x0, AREA_LAKE_WOODS_CAVE, ROOM_LAKE_WOODS_CAVE_MAIN,
|
||||
{ TILE_POS(31, 15), ROOM_MINISH_WOODS_MAIN, CAVE_LAKE_WOODS_ENTER, AREA_LAKE_WOODS_CAVE, ROOM_LAKE_WOODS_CAVE_MAIN,
|
||||
TILE_POS(31, 47) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesHyruleField[] = {
|
||||
{ TILE_POS(3, 11), ROOM_HYRULE_FIELD_EASTERN_HILLLS_NORTH, 0x4, AREA_DIG_CAVES, ROOM_DIG_CAVES_EASTERN_HILLS,
|
||||
TILE_POS(3, 11) },
|
||||
{ TILE_POS(35, 5), ROOM_HYRULE_FIELD_LON_LON_RANCH, 0x10, AREA_HYLIA_DIG_CAVES, ROOM_HYLIA_DIG_CAVES_1,
|
||||
TILE_POS(8, 17) },
|
||||
{ TILE_POS(5, 14), ROOM_HYRULE_FIELD_TRILBY_HIGHLANDS, 0xa, AREA_DIG_CAVES, ROOM_DIG_CAVES_TRILBY_HIGHLANDS,
|
||||
TILE_POS(5, 14) },
|
||||
{ TILE_POS(16, 14), ROOM_HYRULE_FIELD_TRILBY_HIGHLANDS, 0xa, AREA_DIG_CAVES, ROOM_DIG_CAVES_TRILBY_HIGHLANDS,
|
||||
TILE_POS(16, 14) },
|
||||
{ TILE_POS(3, 11), ROOM_HYRULE_FIELD_EASTERN_HILLS_NORTH, CAVE_EASTERN_HILL_ENTER, AREA_DIG_CAVES,
|
||||
ROOM_DIG_CAVES_EASTERN_HILLS, TILE_POS(3, 11) },
|
||||
{ TILE_POS(35, 5), ROOM_HYRULE_FIELD_LON_LON_RANCH, CAVE_LON_LON_RANCH_ENTER, AREA_HYLIA_DIG_CAVES,
|
||||
ROOM_HYLIA_DIG_CAVES_1, TILE_POS(8, 17) },
|
||||
{ TILE_POS(5, 14), ROOM_HYRULE_FIELD_TRILBY_HIGHLANDS, CAVE_TRILBY_HIGHLANDS_ENTER, AREA_DIG_CAVES,
|
||||
ROOM_DIG_CAVES_TRILBY_HIGHLANDS, TILE_POS(5, 14) },
|
||||
{ TILE_POS(16, 14), ROOM_HYRULE_FIELD_TRILBY_HIGHLANDS, CAVE_TRILBY_HIGHLANDS_ENTER, AREA_DIG_CAVES,
|
||||
ROOM_DIG_CAVES_TRILBY_HIGHLANDS, TILE_POS(16, 14) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesHyruleTown[] = { { TILE_POS(45, 24), ROOM_HYRULE_TOWN_MAIN, 0x2,
|
||||
AREA_HYRULE_DIG_CAVES,
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesHyruleTown[] = { { TILE_POS(45, 24), ROOM_HYRULE_TOWN_MAIN,
|
||||
CAVE_HYRULE_TOWN_ENTER, AREA_HYRULE_DIG_CAVES,
|
||||
ROOM_HYRULE_DIG_CAVES_TOWN, TILE_POS(45, 40) },
|
||||
END_OF_LIST };
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesMtCrenel[] = {
|
||||
{ TILE_POS(3, 5), ROOM_MT_CRENEL_WALL_CLIMB, 0x6, AREA_CRENEL_DIG_CAVE, ROOM_CRENEL_DIG_CAVE_0, TILE_POS(3, 25) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesMtCrenel[] = { { TILE_POS(3, 5), ROOM_MT_CRENEL_WALL_CLIMB,
|
||||
CAVE_CRENEL_ENTER, AREA_CRENEL_DIG_CAVE,
|
||||
ROOM_CRENEL_DIG_CAVE_0, TILE_POS(3, 25) },
|
||||
END_OF_LIST };
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesVeilFalls[] = {
|
||||
{ TILE_POS(26, 37), ROOM_VEIL_FALLS_MAIN, 0x8, AREA_VEIL_FALLS_DIG_CAVE, ROOM_VEIL_FALLS_DIG_CAVE_0,
|
||||
TILE_POS(26, 37) },
|
||||
{ TILE_POS(14, 39), ROOM_VEIL_FALLS_MAIN, 0x8, AREA_VEIL_FALLS_DIG_CAVE, ROOM_VEIL_FALLS_DIG_CAVE_0,
|
||||
TILE_POS(14, 39) },
|
||||
{ TILE_POS(26, 37), ROOM_VEIL_FALLS_MAIN, CAVE_VEIL_FALLS_ENTER, AREA_VEIL_FALLS_DIG_CAVE,
|
||||
ROOM_VEIL_FALLS_DIG_CAVE_0, TILE_POS(26, 37) },
|
||||
{ TILE_POS(14, 39), ROOM_VEIL_FALLS_MAIN, CAVE_VEIL_FALLS_ENTER, AREA_VEIL_FALLS_DIG_CAVE,
|
||||
ROOM_VEIL_FALLS_DIG_CAVE_0, TILE_POS(14, 39) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesCastorWilds[] = {
|
||||
{ TILE_POS(48, 25), ROOM_CASTOR_WILDS_MAIN, 0xc, AREA_CASTOR_WILDS_DIG_CAVE, ROOM_CASTOR_WILDS_DIG_CAVE_0,
|
||||
TILE_POS(48, 25) },
|
||||
{ TILE_POS(48, 25), ROOM_CASTOR_WILDS_MAIN, CAVE_CASTOR_WILDS_ENTER, AREA_CASTOR_WILDS_DIG_CAVE,
|
||||
ROOM_CASTOR_WILDS_DIG_CAVE_0, TILE_POS(48, 25) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesLakeHylia[] = {
|
||||
{ TILE_POS(30, 5), ROOM_LAKE_HYLIA_MAIN, 0xe, AREA_HYLIA_DIG_CAVES, ROOM_HYLIA_DIG_CAVES_1, TILE_POS(46, 17) },
|
||||
{ TILE_POS(30, 30), ROOM_LAKE_HYLIA_MAIN, 0x12, AREA_HYLIA_DIG_CAVES, ROOM_HYLIA_DIG_CAVES_0, TILE_POS(8, 9) },
|
||||
{ TILE_POS(30, 5), ROOM_LAKE_HYLIA_MAIN, CAVE_LAKE_HYLIA_NORTH_ENTER, AREA_HYLIA_DIG_CAVES, ROOM_HYLIA_DIG_CAVES_1,
|
||||
TILE_POS(46, 17) },
|
||||
{ TILE_POS(30, 30), ROOM_LAKE_HYLIA_MAIN, CAVE_LAKE_HYLIA_CENTER_ENTER, AREA_HYLIA_DIG_CAVES,
|
||||
ROOM_HYLIA_DIG_CAVES_0, TILE_POS(8, 9) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesLakeWoodsCave[] = {
|
||||
{ TILE_POS(37, 51), ROOM_LAKE_WOODS_CAVE_MAIN, 0x1, AREA_MINISH_WOODS, ROOM_MINISH_WOODS_MAIN, TILE_POS(37, 19) },
|
||||
{ TILE_POS(31, 47), ROOM_LAKE_WOODS_CAVE_MAIN, 0x1, AREA_MINISH_WOODS, ROOM_MINISH_WOODS_MAIN, TILE_POS(31, 15) },
|
||||
{ TILE_POS(37, 51), ROOM_LAKE_WOODS_CAVE_MAIN, CAVE_LAKE_WOODS_LEAVE, AREA_MINISH_WOODS, ROOM_MINISH_WOODS_MAIN,
|
||||
TILE_POS(37, 19) },
|
||||
{ TILE_POS(31, 47), ROOM_LAKE_WOODS_CAVE_MAIN, CAVE_LAKE_WOODS_LEAVE, AREA_MINISH_WOODS, ROOM_MINISH_WOODS_MAIN,
|
||||
TILE_POS(31, 15) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesHyruleDigCaves[] = {
|
||||
{ TILE_POS(45, 40), ROOM_HYRULE_DIG_CAVES_TOWN, 0x3, AREA_HYRULE_TOWN, ROOM_HYRULE_TOWN_MAIN, TILE_POS(45, 24) },
|
||||
{ TILE_POS(45, 40), ROOM_HYRULE_DIG_CAVES_TOWN, CAVE_HYRULE_TOWN_LEAVE, AREA_HYRULE_TOWN, ROOM_HYRULE_TOWN_MAIN,
|
||||
TILE_POS(45, 24) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesAreaDigCaves[] = {
|
||||
{ TILE_POS(3, 11), ROOM_DIG_CAVES_EASTERN_HILLS, 0x5, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_EASTERN_HILLLS_NORTH,
|
||||
TILE_POS(3, 11) },
|
||||
{ TILE_POS(5, 14), ROOM_DIG_CAVES_TRILBY_HIGHLANDS, 0xb, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_TRILBY_HIGHLANDS,
|
||||
TILE_POS(5, 14) },
|
||||
{ TILE_POS(16, 14), ROOM_DIG_CAVES_TRILBY_HIGHLANDS, 0xb, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_TRILBY_HIGHLANDS,
|
||||
TILE_POS(16, 14) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesCrenelDigCave[] = {
|
||||
{ TILE_POS(3, 25), ROOM_CRENEL_DIG_CAVE_0, 0x7, AREA_MT_CRENEL, ROOM_MT_CRENEL_WALL_CLIMB, TILE_POS(3, 5) },
|
||||
{ TILE_POS(3, 11), ROOM_DIG_CAVES_EASTERN_HILLS, CAVE_EASTERN_HILL_LEAVE, AREA_HYRULE_FIELD,
|
||||
ROOM_HYRULE_FIELD_EASTERN_HILLS_NORTH, TILE_POS(3, 11) },
|
||||
{ TILE_POS(5, 14), ROOM_DIG_CAVES_TRILBY_HIGHLANDS, CAVE_TRILBY_HIGHLANDS_LEAVE, AREA_HYRULE_FIELD,
|
||||
ROOM_HYRULE_FIELD_TRILBY_HIGHLANDS, TILE_POS(5, 14) },
|
||||
{ TILE_POS(16, 14), ROOM_DIG_CAVES_TRILBY_HIGHLANDS, CAVE_TRILBY_HIGHLANDS_LEAVE, AREA_HYRULE_FIELD,
|
||||
ROOM_HYRULE_FIELD_TRILBY_HIGHLANDS, TILE_POS(16, 14) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesCrenelDigCave[] = { { TILE_POS(3, 25), ROOM_CRENEL_DIG_CAVE_0,
|
||||
CAVE_CRENEL_LEAVE, AREA_MT_CRENEL,
|
||||
ROOM_MT_CRENEL_WALL_CLIMB, TILE_POS(3, 5) },
|
||||
END_OF_LIST };
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesVeilFallsDigCave[] = {
|
||||
{ TILE_POS(26, 37), ROOM_VEIL_FALLS_DIG_CAVE_0, 0x9, AREA_VEIL_FALLS, ROOM_VEIL_FALLS_MAIN, TILE_POS(26, 37) },
|
||||
{ TILE_POS(14, 39), ROOM_VEIL_FALLS_DIG_CAVE_0, 0x9, AREA_VEIL_FALLS, ROOM_VEIL_FALLS_MAIN, TILE_POS(14, 39) },
|
||||
{ TILE_POS(26, 37), ROOM_VEIL_FALLS_DIG_CAVE_0, CAVE_VEIL_FALLS_LEAVE, AREA_VEIL_FALLS, ROOM_VEIL_FALLS_MAIN,
|
||||
TILE_POS(26, 37) },
|
||||
{ TILE_POS(14, 39), ROOM_VEIL_FALLS_DIG_CAVE_0, CAVE_VEIL_FALLS_LEAVE, AREA_VEIL_FALLS, ROOM_VEIL_FALLS_MAIN,
|
||||
TILE_POS(14, 39) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesCastorWildsDigCave[] = {
|
||||
{ TILE_POS(48, 25), ROOM_CASTOR_WILDS_DIG_CAVE_0, 0xd, AREA_CASTOR_WILDS, ROOM_CASTOR_WILDS_MAIN,
|
||||
TILE_POS(48, 25) },
|
||||
{ TILE_POS(48, 25), ROOM_CASTOR_WILDS_DIG_CAVE_0, CAVE_CASTOR_WILDS_LEAVE, AREA_CASTOR_WILDS,
|
||||
ROOM_CASTOR_WILDS_MAIN, TILE_POS(48, 25) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesHyliaDigCaves[] = {
|
||||
{ TILE_POS(46, 17), ROOM_HYLIA_DIG_CAVES_1, 0xf, AREA_LAKE_HYLIA, ROOM_LAKE_HYLIA_MAIN, TILE_POS(30, 5) },
|
||||
{ TILE_POS(8, 17), ROOM_HYLIA_DIG_CAVES_1, 0x11, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_LON_LON_RANCH,
|
||||
TILE_POS(35, 5) },
|
||||
{ TILE_POS(8, 9), ROOM_HYLIA_DIG_CAVES_0, 0x13, AREA_LAKE_HYLIA, ROOM_LAKE_HYLIA_MAIN, TILE_POS(30, 30) },
|
||||
{ TILE_POS(46, 17), ROOM_HYLIA_DIG_CAVES_1, CAVE_LAKE_HYLIA_NORTH_LEAVE, AREA_LAKE_HYLIA, ROOM_LAKE_HYLIA_MAIN,
|
||||
TILE_POS(30, 5) },
|
||||
{ TILE_POS(8, 17), ROOM_HYLIA_DIG_CAVES_1, CAVE_LON_LON_RANCH_LEAVE, AREA_HYRULE_FIELD,
|
||||
ROOM_HYRULE_FIELD_LON_LON_RANCH, TILE_POS(35, 5) },
|
||||
{ TILE_POS(8, 9), ROOM_HYLIA_DIG_CAVES_0, CAVE_LAKE_HYLIA_CENTER_LEAVE, AREA_LAKE_HYLIA, ROOM_LAKE_HYLIA_MAIN,
|
||||
TILE_POS(30, 30) },
|
||||
END_OF_LIST
|
||||
};
|
||||
|
||||
|
||||
@@ -10,23 +10,24 @@
|
||||
#include "asm.h"
|
||||
#include "functions.h"
|
||||
#include "room.h"
|
||||
#include "tiles.h"
|
||||
|
||||
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) {
|
||||
this->x = TILE(this->x, this->y);
|
||||
if (GetTileTypeAtTilePos(this->x, LAYER_TOP) == TILE_TYPE_117) {
|
||||
super->action = 1;
|
||||
SetBottomTile(0x406a, this->field_0x38, 1);
|
||||
SetTile(SPECIAL_TILE_106, this->x, LAYER_BOTTOM);
|
||||
} else {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
if (GetTileType(this->field_0x38, 1) == 0x406b) {
|
||||
sub_0807B7D8(0x76, this->field_0x38, 2);
|
||||
if (GetTileTypeAtTilePos(this->x, LAYER_BOTTOM) == SPECIAL_TILE_107) {
|
||||
sub_0807B7D8(TILE_TYPE_118, this->x, LAYER_TOP);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (GetTileType(this->field_0x38, 2) == 0x76) {
|
||||
SetBottomTile(0x406b, this->field_0x38, 1);
|
||||
if (GetTileTypeAtTilePos(this->x, LAYER_TOP) == TILE_TYPE_118) {
|
||||
SetTile(SPECIAL_TILE_107, this->x, LAYER_BOTTOM);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
|
||||
extern void (*const HoleManager_Actions[])(HoleManager*);
|
||||
|
||||
extern u8 gGlobalGfxAndPalettes[];
|
||||
|
||||
void HoleManager_Main(HoleManager* this) {
|
||||
HoleManager_Actions[super->action](this);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ void sub_08057F20(HorizontalMinishPathBackgroundManager* this) {
|
||||
tmp = tmp + (tmp >> 3) + ((0x400 - gRoomControls.width) / 2);
|
||||
gScreen.bg3.xOffset = tmp & 0xF;
|
||||
gScreen.bg3.yOffset = 0x30 - ((0x30 - (gRoomControls.scroll_y - gRoomControls.origin_y)) >> 2);
|
||||
gScreen.bg3.tilemap = gBG3Buffer;
|
||||
gScreen.bg3.subTileMap = gBG3Buffer;
|
||||
sub_08058004(tmp, gUnk_02006F00, gBG3Buffer);
|
||||
tmp = ((tmp >> 4) << 1);
|
||||
if (this->unk_38 != tmp) {
|
||||
@@ -53,7 +53,7 @@ void sub_08057F20(HorizontalMinishPathBackgroundManager* this) {
|
||||
tmp = tmp + (tmp >> 2) + ((0x400 - gRoomControls.width) / 2);
|
||||
gScreen.bg1.xOffset = tmp & 0xF;
|
||||
gScreen.bg1.yOffset = 0x30 - ((0x30 - (gRoomControls.scroll_y - gRoomControls.origin_y)) >> 1);
|
||||
gScreen.bg1.tilemap = gBG3Buffer + 0x400;
|
||||
gScreen.bg1.subTileMap = gBG3Buffer + 0x400;
|
||||
sub_08058004(tmp, gUnk_02006F00 + 0x2000, gBG3Buffer + 0x400);
|
||||
tmp = ((tmp >> 4) << 1);
|
||||
if (this->unk_3c != tmp) {
|
||||
@@ -111,7 +111,7 @@ void sub_080580B0(u32 unk1) {
|
||||
gScreen.bg3.xOffset = tmp & 0xF;
|
||||
gScreen.bg3.yOffset = 0x30 - ((0x30 - (gRoomControls.scroll_y - gRoomControls.origin_y)) >> 1); //?
|
||||
gScreen.bg3.control = 0x1D09;
|
||||
gScreen.bg3.tilemap = gBG3Buffer;
|
||||
gScreen.bg3.subTileMap = gBG3Buffer;
|
||||
gScreen.bg3.updated = 1;
|
||||
tmp = gRoomControls.scroll_x - gRoomControls.origin_x;
|
||||
tmp = tmp + (tmp >> 2) + (0x400 - gRoomControls.width) / 2;
|
||||
@@ -119,7 +119,7 @@ void sub_080580B0(u32 unk1) {
|
||||
gScreen.bg1.xOffset = tmp & 0xF;
|
||||
gScreen.bg1.yOffset = 0x30 - ((0x30 - (gRoomControls.scroll_y - gRoomControls.origin_y)) >> 1); //?
|
||||
gScreen.bg1.control = 0x1E09;
|
||||
gScreen.bg1.tilemap = gBG3Buffer + 0x400;
|
||||
gScreen.bg1.subTileMap = gBG3Buffer + 0x400;
|
||||
gScreen.bg1.updated = 1;
|
||||
gScreen.controls.layerFXControl = 0x3C48;
|
||||
gScreen.controls.alphaBlend = 0x609;
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
/**
|
||||
* @file hyruleTownTilesetManager.c
|
||||
* @file hyruleTownTileSetManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Swap tileset data in hyrule town depending on the position.
|
||||
* @brief Swap tileSet data in hyrule town depending on the position.
|
||||
*/
|
||||
#include "manager/hyruleTownTilesetManager.h"
|
||||
#include "manager/hyruleTownTileSetManager.h"
|
||||
#include "area.h"
|
||||
#include "asm.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "main.h"
|
||||
#include "room.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void sub_08059A58(HyruleTownTilesetManager*);
|
||||
void sub_08059A2C(HyruleTownTilesetManager*);
|
||||
void sub_08059A58(HyruleTownTileSetManager*);
|
||||
void sub_08059A2C(HyruleTownTileSetManager*);
|
||||
|
||||
static const u16 gUnk_08108398[] = { 0x0, 0x0, 0x0, 0x3f0, 0x200, 0x1, 0x0, 0x280, 0x3f0, 0x140, 0xff };
|
||||
static const u16 gUnk_081083AE[] = { 0x2, 0x0, 0x0, 0x180, 0x3c0, 0x3, 0x280, 0x0, 0x170, 0x3c0, 0xff };
|
||||
@@ -24,7 +25,7 @@ static const u16 gUnk_081083F2[] = { 0x5, 0x0, 0x1b0, 0x190, 0x140, 0x4, 0x0, 0x
|
||||
void sub_08059CC0(u32, u32);
|
||||
void sub_08059B18(void);
|
||||
|
||||
bool32 sub_08059C8C(HyruleTownTilesetManager*, u32, u8*, const u16*);
|
||||
bool32 sub_08059C8C(HyruleTownTileSetManager*, u32, u8*, const u16*);
|
||||
|
||||
extern u32 gUnk_086E8460;
|
||||
|
||||
@@ -59,7 +60,7 @@ static const Unknown gUnk_08108468[] = {
|
||||
};
|
||||
extern const u8 gGlobalGfxAndPalettes[];
|
||||
|
||||
void HyruleTownTilesetManager_Main(HyruleTownTilesetManager* this) {
|
||||
void HyruleTownTileSetManager_Main(HyruleTownTileSetManager* this) {
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
this->field_0x22 = 0xff;
|
||||
@@ -71,7 +72,7 @@ void HyruleTownTilesetManager_Main(HyruleTownTilesetManager* this) {
|
||||
sub_08059A58(this);
|
||||
}
|
||||
|
||||
void sub_08059A2C(HyruleTownTilesetManager* this) {
|
||||
void sub_08059A2C(HyruleTownTileSetManager* this) {
|
||||
gRoomVars.graphicsGroups[2] = 0xff;
|
||||
gRoomVars.graphicsGroups[1] = 0xff;
|
||||
gRoomVars.graphicsGroups[0] = 0xff;
|
||||
@@ -81,7 +82,7 @@ void sub_08059A2C(HyruleTownTilesetManager* this) {
|
||||
sub_08059A58(this);
|
||||
}
|
||||
|
||||
void sub_08059A58(HyruleTownTilesetManager* this) {
|
||||
void sub_08059A58(HyruleTownTileSetManager* this) {
|
||||
if (gRoomControls.area != AREA_FESTIVAL_TOWN) {
|
||||
if (sub_08059C8C(this, 0, &this->field_0x20, gUnk_08108398) != 0) {
|
||||
sub_08059CC0(0, (u32)this->field_0x20);
|
||||
@@ -113,37 +114,37 @@ void sub_08059B18(void) {
|
||||
if (CheckGlobalFlag(TATEKAKE_HOUSE) != 0) {
|
||||
for (loopVar = 0; loopVar < 4; ++loopVar) {
|
||||
for (innerLoopVar = 0; innerLoopVar < 4; ++innerLoopVar) {
|
||||
sub_0807B9B8(loopVar * 0x10 + 0x4ab + innerLoopVar, COMMON(0x28 + 0x10 * innerLoopVar, loopVar * 0x10),
|
||||
1);
|
||||
SetTileByIndex(loopVar * 0x10 + TILE_TYPE_1195 + innerLoopVar,
|
||||
COMMON(0x28 + 0x10 * innerLoopVar, loopVar * 0x10), 1);
|
||||
}
|
||||
}
|
||||
|
||||
for (loopVar = 0; loopVar < 3; ++loopVar) {
|
||||
for (innerLoopVar = 0; innerLoopVar < 4; ++innerLoopVar) {
|
||||
sub_0807B9B8(loopVar * 0x10 + 0x440 + innerLoopVar, COMMON(0x28 + 0x10 * innerLoopVar, loopVar * 0x10),
|
||||
2);
|
||||
SetTileByIndex(loopVar * 0x10 + TILE_TYPE_1088 + innerLoopVar,
|
||||
COMMON(0x28 + 0x10 * innerLoopVar, loopVar * 0x10), 2);
|
||||
}
|
||||
}
|
||||
sub_0807B9B8(0xd6, 0x5c2, 2);
|
||||
sub_0807B9B8(0xd7, 0x5c3, 2);
|
||||
SetTileByIndex(TILE_TYPE_214, TILE_POS(2, 23), LAYER_TOP);
|
||||
SetTileByIndex(TILE_TYPE_215, TILE_POS(3, 23), LAYER_TOP);
|
||||
LoadResourceAsync(&gUnk_086E8460, 0x6001800, 0x800);
|
||||
} else {
|
||||
if (CheckGlobalFlag(TATEKAKE_TOCHU) != 0) {
|
||||
for (loopVar = 0; loopVar < 5; ++loopVar) {
|
||||
for (innerLoopVar = 0; innerLoopVar < 4; ++innerLoopVar) {
|
||||
sub_0807B9B8(loopVar * 0x10 + 0x4a6 + innerLoopVar,
|
||||
COMMON(0x28 + 0x10 * innerLoopVar, loopVar * 0x10), 1);
|
||||
SetTileByIndex(loopVar * 0x10 + TILE_TYPE_1190 + innerLoopVar,
|
||||
COMMON(0x28 + 0x10 * innerLoopVar, loopVar * 0x10), 1);
|
||||
}
|
||||
}
|
||||
sub_0807B9B8(0x444, 0x602, 2);
|
||||
sub_0807B9B8(0x445, 0x605, 2);
|
||||
sub_0807B9B8(0x454, 0x642, 2);
|
||||
sub_0807B9B8(0x455, 0x645, 2);
|
||||
SetTileByIndex(TILE_TYPE_1092, TILE_POS(2, 24), LAYER_TOP);
|
||||
SetTileByIndex(TILE_TYPE_1093, TILE_POS(5, 24), LAYER_TOP);
|
||||
SetTileByIndex(TILE_TYPE_1108, TILE_POS(2, 25), LAYER_TOP);
|
||||
SetTileByIndex(TILE_TYPE_1109, TILE_POS(5, 25), LAYER_TOP);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool32 sub_08059C8C(HyruleTownTilesetManager* this, u32 param_2, u8* param_3, const u16* param_4) {
|
||||
bool32 sub_08059C8C(HyruleTownTileSetManager* this, u32 param_2, u8* param_3, const u16* param_4) {
|
||||
bool32 bVar2;
|
||||
|
||||
*param_3 = CheckRegionsOnScreen(param_4);
|
||||
@@ -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 tileType);
|
||||
|
||||
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, 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, 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, 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 (GetTileTypeAtTilePos(this->field_0x20, super->type2) == TILE_TYPE_118) {
|
||||
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 (GetTileTypeAtTilePos(this->field_0x20, super->type2) != TILE_TYPE_118) {
|
||||
return;
|
||||
}
|
||||
SetFlag(this->field_0x3e);
|
||||
@@ -130,14 +131,15 @@ void LightLevelSetManager_Type3(LightLevelSetManager* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805BE70(LightLevelSetManager* this, u32 param_2) {
|
||||
SetTileType(param_2,
|
||||
void sub_0805BE70(LightLevelSetManager* this, u32 tileType) {
|
||||
SetTileType(tileType,
|
||||
((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,
|
||||
SetTileType(TILE_TYPE_118,
|
||||
((this->field_0x38 << 0x10) >> 0x14 & 0x3fU) | ((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6,
|
||||
super->type2);
|
||||
ChangeLightLevel(super->timer);
|
||||
DeleteThisEntity();
|
||||
|
||||
@@ -215,9 +215,9 @@ void sub_08057450(LightRayManager* this) {
|
||||
y >>= 2;
|
||||
|
||||
gScreen.bg3.yOffset = y & 0x3f;
|
||||
gScreen.bg3.tilemap = &gBG3Buffer[(y / 0x40) << 8];
|
||||
if (this->unk_34 != gScreen.bg3.tilemap) {
|
||||
this->unk_34 = gScreen.bg3.tilemap;
|
||||
gScreen.bg3.subTileMap = &gBG3Buffer[(y / 0x40) << 8];
|
||||
if (this->unk_34 != gScreen.bg3.subTileMap) {
|
||||
this->unk_34 = gScreen.bg3.subTileMap;
|
||||
gScreen.bg3.updated = 1;
|
||||
}
|
||||
|
||||
|
||||
+66
-66
@@ -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->unk_34);
|
||||
layer = GetTileBuffer(this->unk_34);
|
||||
this->unk_28 = (u16*)layer->metatileTypes;
|
||||
this->unk_2c = &layer->mapData[(s16)this->unk_3a];
|
||||
this->unk_3c = GetTileTypeAtTilePos(this->unk_38, this->layer);
|
||||
mapLayer = GetLayerByIndex(this->layer);
|
||||
this->unk_28 = (u16*)mapLayer->tileTypes;
|
||||
this->unk_2c = &mapLayer->mapData[(s16)this->unk_3a];
|
||||
}
|
||||
|
||||
void sub_0805CC3C(Manager29* this) {
|
||||
@@ -46,7 +46,7 @@ void sub_0805CC3C(Manager29* this) {
|
||||
iVar3 = this->unk_38;
|
||||
iVar2 = (short)this->unk_3a;
|
||||
|
||||
if (this->unk_34 == 1) {
|
||||
if (this->layer == 1) {
|
||||
uVar4 = 0x321;
|
||||
} else {
|
||||
uVar4 = 0x322;
|
||||
@@ -54,74 +54,74 @@ void sub_0805CC3C(Manager29* this) {
|
||||
|
||||
switch (super->type) {
|
||||
default:
|
||||
sub_0807B7D8(uVar4, iVar3, this->unk_34);
|
||||
sub_0807B7D8(0x365, iVar2, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3, this->layer);
|
||||
sub_0807B7D8(0x365, iVar2, this->layer);
|
||||
break;
|
||||
case 1:
|
||||
sub_0807B7D8(uVar4, iVar3, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 1, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x40, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x41, this->unk_34);
|
||||
sub_0807B7D8(this->unk_3c, iVar2, this->unk_34);
|
||||
sub_0807B7D8(0x36f, iVar2 + 1, this->unk_34);
|
||||
sub_0807B7D8(0x370, iVar2 + 0x40, this->unk_34);
|
||||
sub_0807B7D8(0x371, iVar2 + 0x41, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 1, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x40, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x41, this->layer);
|
||||
sub_0807B7D8(this->unk_3c, iVar2, this->layer);
|
||||
sub_0807B7D8(0x36f, iVar2 + 1, this->layer);
|
||||
sub_0807B7D8(0x370, iVar2 + 0x40, this->layer);
|
||||
sub_0807B7D8(0x371, iVar2 + 0x41, this->layer);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
sub_0807B7D8(uVar4, iVar3, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 1, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 2, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x40, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x41, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x42, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x80, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x81, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x82, this->unk_34);
|
||||
sub_0807B7D8(this->unk_3c, iVar2, this->unk_34);
|
||||
sub_0807B7D8(0x372, iVar2 + 1, this->unk_34);
|
||||
sub_0807B7D8(0x36f, iVar2 + 2, this->unk_34);
|
||||
sub_0807B7D8(0x374, iVar2 + 0x40, this->unk_34);
|
||||
sub_0807B7D8(0x376, iVar2 + 0x41, this->unk_34);
|
||||
sub_0807B7D8(0x375, iVar2 + 0x42, this->unk_34);
|
||||
sub_0807B7D8(0x370, iVar2 + 0x80, this->unk_34);
|
||||
sub_0807B7D8(0x373, iVar2 + 0x81, this->unk_34);
|
||||
sub_0807B7D8(0x371, iVar2 + 0x82, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 1, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 2, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x40, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x41, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x42, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x80, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x81, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x82, this->layer);
|
||||
sub_0807B7D8(this->unk_3c, iVar2, this->layer);
|
||||
sub_0807B7D8(0x372, iVar2 + 1, this->layer);
|
||||
sub_0807B7D8(0x36f, iVar2 + 2, this->layer);
|
||||
sub_0807B7D8(0x374, iVar2 + 0x40, this->layer);
|
||||
sub_0807B7D8(0x376, iVar2 + 0x41, this->layer);
|
||||
sub_0807B7D8(0x375, iVar2 + 0x42, this->layer);
|
||||
sub_0807B7D8(0x370, iVar2 + 0x80, this->layer);
|
||||
sub_0807B7D8(0x373, iVar2 + 0x81, this->layer);
|
||||
sub_0807B7D8(0x371, iVar2 + 0x82, this->layer);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
sub_0807B7D8(uVar4, iVar3, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 1, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 2, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 3, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x40, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x41, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x42, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x43, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x80, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x81, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x82, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x83, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0xc0, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0xc1, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0xc2, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0xc3, this->unk_34);
|
||||
sub_0807B7D8(this->unk_3c, iVar2, this->unk_34);
|
||||
sub_0807B7D8(0x372, iVar2 + 1, this->unk_34);
|
||||
sub_0807B7D8(0x372, iVar2 + 2, this->unk_34);
|
||||
sub_0807B7D8(0x36f, iVar2 + 3, this->unk_34);
|
||||
sub_0807B7D8(0x374, iVar2 + 0x40, this->unk_34);
|
||||
sub_0807B7D8(0x376, iVar2 + 0x41, this->unk_34);
|
||||
sub_0807B7D8(0x376, iVar2 + 0x42, this->unk_34);
|
||||
sub_0807B7D8(0x375, iVar2 + 0x43, this->unk_34);
|
||||
sub_0807B7D8(0x374, iVar2 + 0x80, this->unk_34);
|
||||
sub_0807B7D8(0x376, iVar2 + 0x81, this->unk_34);
|
||||
sub_0807B7D8(0x376, iVar2 + 0x82, this->unk_34);
|
||||
sub_0807B7D8(0x375, iVar2 + 0x83, this->unk_34);
|
||||
sub_0807B7D8(0x370, iVar2 + 0xc0, this->unk_34);
|
||||
sub_0807B7D8(0x373, iVar2 + 0xc1, this->unk_34);
|
||||
sub_0807B7D8(0x373, iVar2 + 0xc2, this->unk_34);
|
||||
sub_0807B7D8(0x371, iVar2 + 0xc3, this->unk_34);
|
||||
sub_0807B7D8(uVar4, iVar3, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 1, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 2, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 3, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x40, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x41, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x42, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x43, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x80, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x81, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x82, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0x83, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0xc0, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0xc1, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0xc2, this->layer);
|
||||
sub_0807B7D8(uVar4, iVar3 + 0xc3, this->layer);
|
||||
sub_0807B7D8(this->unk_3c, iVar2, this->layer);
|
||||
sub_0807B7D8(0x372, iVar2 + 1, this->layer);
|
||||
sub_0807B7D8(0x372, iVar2 + 2, this->layer);
|
||||
sub_0807B7D8(0x36f, iVar2 + 3, this->layer);
|
||||
sub_0807B7D8(0x374, iVar2 + 0x40, this->layer);
|
||||
sub_0807B7D8(0x376, iVar2 + 0x41, this->layer);
|
||||
sub_0807B7D8(0x376, iVar2 + 0x42, this->layer);
|
||||
sub_0807B7D8(0x375, iVar2 + 0x43, this->layer);
|
||||
sub_0807B7D8(0x374, iVar2 + 0x80, this->layer);
|
||||
sub_0807B7D8(0x376, iVar2 + 0x81, this->layer);
|
||||
sub_0807B7D8(0x376, iVar2 + 0x82, this->layer);
|
||||
sub_0807B7D8(0x375, iVar2 + 0x83, this->layer);
|
||||
sub_0807B7D8(0x370, iVar2 + 0xc0, this->layer);
|
||||
sub_0807B7D8(0x373, iVar2 + 0xc1, this->layer);
|
||||
sub_0807B7D8(0x373, iVar2 + 0xc2, this->layer);
|
||||
sub_0807B7D8(0x371, iVar2 + 0xc3, this->layer);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,8 +13,7 @@
|
||||
#include "player.h"
|
||||
#include "room.h"
|
||||
#include "sound.h"
|
||||
|
||||
extern u32 sub_080B1AC8(u16, u16, u8);
|
||||
#include "tiles.h"
|
||||
|
||||
bool32 PortalReadyForMinish(void);
|
||||
|
||||
@@ -43,7 +42,7 @@ void MinishPortalManager_Main(MinishPortalManager* this) {
|
||||
gArea.portal_mode = 3;
|
||||
}
|
||||
}
|
||||
if (sub_080B1AC8(this->unk_38, this->unk_3a, super->timer) == 0x3d) {
|
||||
if (GetActTileAtRoomCoords(this->unk_38, this->unk_3a, super->timer) == ACT_TILE_61) {
|
||||
CreateMagicSparkles(this->unk_38 + gRoomControls.origin_x, this->unk_3a + gRoomControls.origin_y,
|
||||
super->timer);
|
||||
if (super->subtimer == 0) {
|
||||
|
||||
@@ -87,7 +87,7 @@ void sub_08058324(u32 unk) {
|
||||
sub_080582D0();
|
||||
sub_080582A0(sub_08058244(unk), gUnk_02006F00, gBG3Buffer);
|
||||
gScreen.bg1.control = 0x1D47;
|
||||
gScreen.bg1.tilemap = gBG3Buffer;
|
||||
gScreen.bg1.subTileMap = gBG3Buffer;
|
||||
gScreen.bg1.updated = 1;
|
||||
gScreen.lcd.displayControl |= 0x200;
|
||||
}
|
||||
|
||||
+7
-7
@@ -1,17 +1,17 @@
|
||||
/**
|
||||
* @file minishVillageTilesetManager.c
|
||||
* @file minishVillageTileSetManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Swap tileset data in minish village depending on the position
|
||||
* @brief Swap tileSet data in minish village depending on the position
|
||||
*/
|
||||
#include "manager/minishVillageTilesetManager.h"
|
||||
#include "manager/minishVillageTileSetManager.h"
|
||||
#include "asm.h"
|
||||
#include "common.h"
|
||||
#include "functions.h"
|
||||
#include "main.h"
|
||||
|
||||
void sub_08057E30(void*);
|
||||
bool32 sub_08057E40(MinishVillageTilesetManager*);
|
||||
bool32 sub_08057E40(MinishVillageTileSetManager*);
|
||||
void sub_08057E7C(u32);
|
||||
|
||||
extern const u8 gGlobalGfxAndPalettes[];
|
||||
@@ -54,7 +54,7 @@ const u32 gUnk_081080A4[0x50] = {
|
||||
const u8 gUnk_081081E4[] = { 0x16, 0x17, 0x17, 0x18, 0x18 };
|
||||
|
||||
#ifdef EU
|
||||
void MinishVillageTilesetManager_Main(MinishVillageTilesetManager* this) {
|
||||
void MinishVillageTileSetManager_Main(MinishVillageTileSetManager* this) {
|
||||
u32 tmp;
|
||||
const u32* tmp2;
|
||||
s32 tmp3;
|
||||
@@ -103,7 +103,7 @@ void MinishVillageTilesetManager_Main(MinishVillageTilesetManager* this) {
|
||||
}
|
||||
}
|
||||
#else
|
||||
void MinishVillageTilesetManager_Main(MinishVillageTilesetManager* this) {
|
||||
void MinishVillageTileSetManager_Main(MinishVillageTileSetManager* this) {
|
||||
u32 tmp;
|
||||
const u32* tmp2;
|
||||
if (super->action == 0) {
|
||||
@@ -156,7 +156,7 @@ void sub_08057E30(void* this) {
|
||||
sub_08057E7C(gRoomVars.graphicsGroups[0]);
|
||||
}
|
||||
|
||||
bool32 sub_08057E40(MinishVillageTilesetManager* this) {
|
||||
bool32 sub_08057E40(MinishVillageTileSetManager* this) {
|
||||
u32 tmp = CheckRegionsOnScreen(gUnk_08108050);
|
||||
if (tmp != 0xFF) {
|
||||
gRoomVars.graphicsGroups[0] = tmp;
|
||||
+26
-26
@@ -121,9 +121,9 @@ void MiscManager_Type0(MiscManager* this) {
|
||||
void sub_08058F44(u32 x, u32 y, u32 flag) {
|
||||
if (CheckRoomFlag(flag))
|
||||
return;
|
||||
if (sub_080B1A48(x, y, 1) != 0x61)
|
||||
if (GetTileTypeAtRoomCoords(x, y, LAYER_BOTTOM) != TILE_TYPE_97)
|
||||
return;
|
||||
SetTileType(0x26, ((x >> 4) & 0x3F) | (((y >> 4) & 0x3F) << 6), 1);
|
||||
SetTileType(TILE_TYPE_38, ((x >> 4) & 0x3F) | (((y >> 4) & 0x3F) << 6), LAYER_BOTTOM);
|
||||
sub_08058F84(x, y);
|
||||
}
|
||||
|
||||
@@ -179,13 +179,13 @@ void MiscManager_Type1(MiscManager* this) {
|
||||
}
|
||||
|
||||
void sub_08059064(MiscManager* this) {
|
||||
Entity* tmp;
|
||||
tmp = CreateObject(GROUND_ITEM, ITEM_SMALL_KEY, 0);
|
||||
if (!tmp)
|
||||
Entity* key;
|
||||
key = CreateObject(GROUND_ITEM, ITEM_SMALL_KEY, 0);
|
||||
if (!key)
|
||||
return;
|
||||
tmp->timer = 2;
|
||||
tmp->x.HALF.HI = this->unk_38 + gRoomControls.origin_x;
|
||||
tmp->y.HALF.HI = this->unk_3a + gRoomControls.origin_y;
|
||||
key->timer = 2;
|
||||
key->x.HALF.HI = this->x + gRoomControls.origin_x;
|
||||
key->y.HALF.HI = this->y + gRoomControls.origin_y;
|
||||
}
|
||||
|
||||
void MiscManager_Type3(MiscManager* this) {
|
||||
@@ -229,8 +229,8 @@ void MiscManager_Type5(MiscManager* this) {
|
||||
switch (super->action) {
|
||||
default:
|
||||
if (!--super->timer) {
|
||||
CreateDustAt(this->unk_38, this->unk_3a, super->type2);
|
||||
RestorePrevTileEntity(((this->unk_38 >> 4) & 0x3f) | ((this->unk_3a >> 4) & 0x3f) << 6, super->type2);
|
||||
CreateDustAt(this->x, this->y, super->type2);
|
||||
RestorePrevTileEntity(TILE_LOCAL(this->x, this->y), super->type2);
|
||||
SoundReq(SFX_TASK_COMPLETE);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
@@ -240,7 +240,7 @@ void MiscManager_Type5(MiscManager* this) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
super->action = 1;
|
||||
SetTileType(0x365, ((this->unk_38 >> 4) & 0x3f) | ((this->unk_3a >> 4) & 0x3f) << 6, super->type2);
|
||||
SetTileType(TILE_TYPE_869, TILE_LOCAL(this->x, this->y), super->type2);
|
||||
break;
|
||||
case 1:
|
||||
if (CheckFlags(this->flags)) {
|
||||
@@ -256,18 +256,18 @@ void MiscManager_Type6(MiscManager* this) {
|
||||
super->action = 1;
|
||||
super->type2 = CheckFlags(this->flags);
|
||||
if (super->type2) {
|
||||
gRoomVars.lightLevel = this->unk_3a;
|
||||
gRoomVars.lightLevel = this->y;
|
||||
} else {
|
||||
gRoomVars.lightLevel = this->unk_38;
|
||||
gRoomVars.lightLevel = this->x;
|
||||
}
|
||||
} else {
|
||||
u32 tmp = CheckFlags(this->flags);
|
||||
if (super->type2 != tmp) {
|
||||
super->type2 = tmp;
|
||||
if (tmp) {
|
||||
gRoomVars.lightLevel = this->unk_3a;
|
||||
gRoomVars.lightLevel = this->y;
|
||||
} else {
|
||||
gRoomVars.lightLevel = this->unk_38;
|
||||
gRoomVars.lightLevel = this->x;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -321,7 +321,7 @@ void MiscManager_Type9(MiscManager* this) {
|
||||
}
|
||||
|
||||
void sub_080592EC(MiscManager* this) {
|
||||
SetDirtTile(((this->unk_38 >> 4) & 0x3F) | (((this->unk_3a >> 4) & 0x3F) << 6));
|
||||
SetDirtTile(TILE_LOCAL(this->x, this->y));
|
||||
}
|
||||
|
||||
void sub_0805930C(MiscManager* this) {
|
||||
@@ -333,15 +333,15 @@ void sub_0805930C(MiscManager* this) {
|
||||
#endif
|
||||
if (!tmp)
|
||||
return;
|
||||
tmp->x.HALF.HI = this->unk_38 + gRoomControls.origin_x;
|
||||
tmp->y.HALF.HI = this->unk_3a + gRoomControls.origin_y;
|
||||
tmp->x.HALF.HI = this->x + gRoomControls.origin_x;
|
||||
tmp->y.HALF.HI = this->y + gRoomControls.origin_y;
|
||||
tmp->collisionLayer = 1;
|
||||
}
|
||||
|
||||
void SetDirtTile(u32 tile) {
|
||||
SetTileType(CUT_GRASS, tile, 1);
|
||||
SetTileType(0, tile, 2);
|
||||
SetTileType(0, tile - 0x40, 2);
|
||||
void SetDirtTile(u32 tilePos) {
|
||||
SetTileType(TILE_TYPE_29, tilePos, LAYER_BOTTOM);
|
||||
SetTileType(TILE_TYPE_0, tilePos, LAYER_TOP);
|
||||
SetTileType(TILE_TYPE_0, tilePos + TILE_POS(0, -1), LAYER_TOP);
|
||||
}
|
||||
|
||||
void MiscManager_TypeA(MiscManager* this) {
|
||||
@@ -355,7 +355,7 @@ void MiscManager_TypeA(MiscManager* this) {
|
||||
void MiscManager_TypeB(MiscManager* this) {
|
||||
if (sub_080593CC(this)) {
|
||||
if (++super->timer >= 8) {
|
||||
sub_080806BC(this->unk_38 - gRoomControls.origin_x, this->unk_3a - gRoomControls.origin_y, 0xFF, 0xA);
|
||||
sub_080806BC(this->x - gRoomControls.origin_x, this->y - gRoomControls.origin_y, 0xFF, 0xA);
|
||||
}
|
||||
} else {
|
||||
super->timer = 0;
|
||||
@@ -365,7 +365,7 @@ void MiscManager_TypeB(MiscManager* this) {
|
||||
bool32 sub_080593CC(MiscManager* this) {
|
||||
if (!(gPlayerState.flags & PL_MINISH) && gPlayerState.swim_state != 0 && gPlayerEntity.base.animationState == 0 &&
|
||||
(gPlayerState.playerInput.heldInput & INPUT_ANY_DIRECTION) == INPUT_UP) {
|
||||
return EntityWithinDistance(&gPlayerEntity.base, this->unk_38, this->unk_3a + 0xC, 6);
|
||||
return EntityWithinDistance(&gPlayerEntity.base, this->x, this->y + 12, 6);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
@@ -381,8 +381,8 @@ void MiscManager_TypeC(MiscManager* this) {
|
||||
if (!tmp)
|
||||
return;
|
||||
tmp->collisionLayer = 2;
|
||||
tmp->x.HALF.HI = this->unk_38 + gRoomControls.origin_x;
|
||||
tmp->y.HALF.HI = this->unk_3a + gRoomControls.origin_y;
|
||||
tmp->x.HALF.HI = this->x + gRoomControls.origin_x;
|
||||
tmp->y.HALF.HI = this->y + gRoomControls.origin_y;
|
||||
EnqueueSFX(SFX_1B0);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "manager/railIntersectionManager.h"
|
||||
#include "flags.h"
|
||||
#include "room.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void sub_0805B778(RailIntersectionManager*);
|
||||
void RailIntersectionManager_Init(RailIntersectionManager*);
|
||||
@@ -25,7 +26,7 @@ void RailIntersectionManager_Init(RailIntersectionManager* this) {
|
||||
super->type2 = 1;
|
||||
}
|
||||
super->action = 1;
|
||||
this->field_0x38 = (this->field_0x38 >> 4 & 0x3fU) | (((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6);
|
||||
this->tilePos = (this->tilePos >> 4 & 0x3fU) | (((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6);
|
||||
sub_0805B778(this);
|
||||
}
|
||||
|
||||
@@ -44,6 +45,7 @@ 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);
|
||||
static const u16 gUnk_08108C9C[] = { TILE_TYPE_856, TILE_TYPE_857, TILE_TYPE_854,
|
||||
TILE_TYPE_858, TILE_TYPE_858, TILE_TYPE_855 };
|
||||
SetTileType(gUnk_08108C9C[super->type * 2 + super->type2], this->tilePos, this->layer);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
extern struct BgAffineDstData gUnk_02017AA0[];
|
||||
extern struct BgAffineDstData gUnk_02017BA0[];
|
||||
extern u8 gUnk_02017700[];
|
||||
extern u8 gUpdateVisibleTiles;
|
||||
extern u32 gUsedPalettes;
|
||||
|
||||
@@ -261,8 +260,8 @@ void sub_08058D34(void) {
|
||||
u16 tmp;
|
||||
u32 tmp2;
|
||||
LoadPaletteGroup(0x28);
|
||||
MemCopy(gUnk_02017700, gUnk_02017700 + 0x240, 0x20);
|
||||
gUsedPalettes |= 0x200000;
|
||||
MemCopy(gPaletteBuffer + 3 * 16, gPaletteBuffer + 21 * 16, 16 * 2);
|
||||
gUsedPalettes |= 1 << 21;
|
||||
LoadGfxGroup(0x16);
|
||||
tmp = gScreen.lcd.displayControl;
|
||||
tmp2 = 0;
|
||||
|
||||
@@ -480,7 +480,7 @@ void sub_0805A9CC(TempleOfDropletsManager* this) {
|
||||
tmp1 = gRoomControls.scroll_y - this->unk_26 + this->unk_36;
|
||||
gScreen.bg3.yOffset = tmp1 & 0x3F;
|
||||
tmp3 = (&gBG3Buffer[((tmp1 / 0x40) << 8)]);
|
||||
gScreen.bg3.tilemap = (u32*)tmp3;
|
||||
gScreen.bg3.subTileMap = (u32*)tmp3;
|
||||
gScreen.controls.window1VerticalDimensions = DISPLAY_HEIGHT;
|
||||
if (this->unk_28 == tmp3)
|
||||
return;
|
||||
@@ -522,7 +522,7 @@ void sub_0805AAF0(u32 unk0) {
|
||||
gScreen.controls.layerFXControl = 0x3E48;
|
||||
gScreen.controls.alphaBlend = BLDALPHA_BLEND(8, 16);
|
||||
gScreen.bg3.control = BGCNT_SCREENBASE(30) | BGCNT_CHARBASE(1);
|
||||
gScreen.bg3.tilemap = &gBG3Buffer;
|
||||
gScreen.bg3.subTileMap = &gBG3Buffer;
|
||||
gScreen.bg3.xOffset = 0;
|
||||
gScreen.bg3.yOffset = 0;
|
||||
gScreen.bg3.updated = 1;
|
||||
|
||||
@@ -26,14 +26,14 @@ void TileChangeObserveManager_Main(TileChangeObserveManager* this) {
|
||||
}
|
||||
|
||||
void TileChangeObserveManager_Init(TileChangeObserveManager* this) {
|
||||
u16* tile;
|
||||
u16* tileIndex;
|
||||
if (CheckFlags(this->flag) != 0) {
|
||||
DeleteThisEntity();
|
||||
} else {
|
||||
super->action = 1;
|
||||
tile = &GetTileBuffer(this->field_0x3a)->mapData[this->tilePosition];
|
||||
this->observedTile = tile;
|
||||
this->initialTile = tile[0];
|
||||
tileIndex = &GetLayerByIndex(this->field_0x3a)->mapData[this->tilePos];
|
||||
this->observedTile = tileIndex;
|
||||
this->initialTile = tileIndex[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "sound.h"
|
||||
#include "tiles.h"
|
||||
|
||||
enum { INIT, IN_PROGRESS, FAILED, SUCCEEDED };
|
||||
|
||||
@@ -30,16 +31,16 @@ void TilePuzzleManager_Main(TilePuzzleManager* this) {
|
||||
this->player_current_tile = COORD_TO_TILE((&gPlayerEntity.base));
|
||||
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)) {
|
||||
case 0x317:
|
||||
switch (GetTileTypeAtTilePos(this->player_current_tile, super->type2)) {
|
||||
case TILE_TYPE_791:
|
||||
// stepped on a red tile again
|
||||
super->action = FAILED;
|
||||
SoundReq(SFX_MENU_ERROR);
|
||||
break;
|
||||
case 0x318:
|
||||
case TILE_TYPE_792:
|
||||
// stepped on a blue tile
|
||||
// turn the tile into a red tile
|
||||
sub_0807B7D8(0x317, this->player_current_tile, super->type2);
|
||||
sub_0807B7D8(TILE_TYPE_791, this->player_current_tile, super->type2);
|
||||
SoundReq(SFX_6B);
|
||||
// decrease the number of remaining tiles and check if we're done
|
||||
if (--super->timer == 0) {
|
||||
|
||||
@@ -30,17 +30,17 @@ void sub_0805754C(VerticalMinishPathBackgroundManager* this) {
|
||||
bgOffset = (gRoomControls.scroll_y - gRoomControls.origin_y);
|
||||
bgOffset += bgOffset >> 3;
|
||||
gScreen.bg3.yOffset = bgOffset & 0x3f;
|
||||
gScreen.bg3.tilemap = gMapDataTopSpecial + (bgOffset / 0x40) * 0x200;
|
||||
if (this->field_0x38 != gScreen.bg3.tilemap) {
|
||||
this->field_0x38 = gScreen.bg3.tilemap;
|
||||
gScreen.bg3.subTileMap = gMapDataTopSpecial + (bgOffset / 0x40) * 0x200;
|
||||
if (this->field_0x38 != gScreen.bg3.subTileMap) {
|
||||
this->field_0x38 = gScreen.bg3.subTileMap;
|
||||
gScreen.bg3.updated = 1;
|
||||
}
|
||||
bgOffset = (gRoomControls.scroll_y - gRoomControls.origin_y);
|
||||
bgOffset += bgOffset >> 2;
|
||||
gScreen.bg1.yOffset = bgOffset & 0x3f;
|
||||
gScreen.bg1.tilemap = gMapDataTopSpecial + 0x2000 + (bgOffset / 0x40) * 0x200;
|
||||
if (this->field_0x3c != gScreen.bg1.tilemap) {
|
||||
this->field_0x3c = gScreen.bg1.tilemap;
|
||||
gScreen.bg1.subTileMap = gMapDataTopSpecial + 0x2000 + (bgOffset / 0x40) * 0x200;
|
||||
if (this->field_0x3c != gScreen.bg1.subTileMap) {
|
||||
this->field_0x3c = gScreen.bg1.subTileMap;
|
||||
gScreen.bg1.updated = 1;
|
||||
}
|
||||
}
|
||||
@@ -57,7 +57,7 @@ void sub_080575C8(u32 param) {
|
||||
bgOffset += bgOffset >> 3;
|
||||
gScreen.bg3.yOffset = bgOffset & 0x3f;
|
||||
gScreen.bg3.xOffset = 0;
|
||||
gScreen.bg3.tilemap = &gMapDataTopSpecial[(bgOffset / 0x40) * 0x200];
|
||||
gScreen.bg3.subTileMap = &gMapDataTopSpecial[(bgOffset / 0x40) * 0x200];
|
||||
gScreen.bg3.control = BGCNT_SCREENBASE(29) | BGCNT_PRIORITY(1) | BGCNT_CHARBASE(2) | BGCNT_MOSAIC;
|
||||
gScreen.bg3.updated = 1;
|
||||
|
||||
@@ -65,7 +65,7 @@ void sub_080575C8(u32 param) {
|
||||
bgOffset += bgOffset >> 2;
|
||||
gScreen.bg1.yOffset = bgOffset & 0x3f;
|
||||
gScreen.bg1.xOffset = 0;
|
||||
gScreen.bg1.tilemap = &gMapDataTopSpecial[0x2000 + (bgOffset / 0x40) * 0x200];
|
||||
gScreen.bg1.subTileMap = &gMapDataTopSpecial[0x2000 + (bgOffset / 0x40) * 0x200];
|
||||
gScreen.bg1.control = BGCNT_SCREENBASE(30) | BGCNT_PRIORITY(1) | BGCNT_CHARBASE(2) | BGCNT_MOSAIC;
|
||||
gScreen.bg1.updated = 1;
|
||||
gScreen.controls.layerFXControl =
|
||||
|
||||
@@ -8,9 +8,10 @@
|
||||
#include "asm.h"
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void WaterfallBottomManager_Main(WaterfallBottomManager* this) {
|
||||
SetBottomTile(0x4014, 0x5c3, 1);
|
||||
SetTile(SPECIAL_TILE_20, TILE_POS(3, 23), LAYER_BOTTOM);
|
||||
if ((gRoomControls.origin_y + 200 < gPlayerEntity.base.y.HALF.HI) &&
|
||||
((u32)(gPlayerEntity.base.x.HALF.HI - gRoomControls.origin_x) - 0x30 < 0x11)) {
|
||||
gPlayerEntity.base.collisionLayer = 3;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "common.h"
|
||||
#include "fileselect.h"
|
||||
#include "functions.h"
|
||||
#include "main.h"
|
||||
#include "room.h"
|
||||
#include "screen.h"
|
||||
#include "sound.h"
|
||||
@@ -21,16 +22,13 @@ void sub_080596E0(WeatherChangeManager*);
|
||||
u32 sub_08059844(void);
|
||||
u32 sub_0805986C(void);
|
||||
void sub_08059894(const u16*, const u16*, u32);
|
||||
u32 sub_080598F8(u32, u32, u32);
|
||||
void sub_08059960(const u16*, const u16*, u16*, u8);
|
||||
u32 MixColors(u32, u32, u32);
|
||||
void MixPalettes(const u16*, const u16*, u16*, u8);
|
||||
|
||||
const u8 gUnk_08108390[6] = {
|
||||
0x0F, 0x1E, 0x2D, 0x3C, 0x01, 0x01,
|
||||
};
|
||||
|
||||
extern u16 gUnk_020176E0[];
|
||||
extern u8 gUnk_02017700[];
|
||||
|
||||
extern const u16 gPalette_549[];
|
||||
|
||||
void WeatherChangeManager_Main(WeatherChangeManager* this) {
|
||||
@@ -160,54 +158,56 @@ u32 sub_0805986C(void) {
|
||||
return gPlayerEntity.base.x.HALF.HI - gRoomControls.origin_x > 0x200;
|
||||
}
|
||||
|
||||
void sub_08059894(const u16* unk1, const u16* unk2, u32 unk3) {
|
||||
void sub_08059894(const u16* palette1, const u16* palette2, u32 factor) {
|
||||
const u16* tmp1;
|
||||
const u16* tmp2;
|
||||
u16* tmp3;
|
||||
u32 tmp4;
|
||||
u32 i;
|
||||
tmp1 = unk1;
|
||||
tmp2 = unk2;
|
||||
tmp3 = gUnk_020176E0;
|
||||
tmp1 = palette1;
|
||||
tmp2 = palette2;
|
||||
tmp3 = gPaletteBuffer + 2 * 16;
|
||||
for (i = 0; i < 13; i++) {
|
||||
sub_08059960(tmp1, tmp2, tmp3, unk3);
|
||||
MixPalettes(tmp1, tmp2, tmp3, factor);
|
||||
tmp1 += 0x10;
|
||||
tmp2 += 0x10;
|
||||
tmp3 += 0x10;
|
||||
}
|
||||
MemCopy(gUnk_02017700, gUnk_02017700 + 0x240, 0x20);
|
||||
gUsedPalettes |= 0x207ffc;
|
||||
MemCopy(gPaletteBuffer + 3 * 16, gPaletteBuffer + 21 * 16, 16 * 2);
|
||||
// Use palettes 2 to 14 and 21.
|
||||
gUsedPalettes |= 1 << 2 | 1 << 3 | 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7 | 1 << 8 | 1 << 9 | 1 << 10 | 1 << 11 |
|
||||
1 << 12 | 1 << 13 | 1 << 14 | 1 << 21;
|
||||
}
|
||||
|
||||
u32 sub_080598F8(u32 unk1, u32 unk2, u32 unk3) {
|
||||
u32 MixColors(u32 color1, u32 color2, u32 factor) {
|
||||
u32 tmp1, tmp2, tmp3;
|
||||
u32 tmp4, tmp5, tmp6;
|
||||
|
||||
tmp1 = (unk1 & 0x1F) << 8;
|
||||
tmp1 = (tmp1 * unk3) >> 5;
|
||||
tmp4 = (unk2 & 0x1F) << 8;
|
||||
tmp4 = (tmp4 * (0x20 - unk3)) >> 5;
|
||||
tmp1 = (color1 & 0x1F) << 8;
|
||||
tmp1 = (tmp1 * factor) >> 5;
|
||||
tmp4 = (color2 & 0x1F) << 8;
|
||||
tmp4 = (tmp4 * (0x20 - factor)) >> 5;
|
||||
tmp1 = (tmp1 + tmp4) >> 8;
|
||||
|
||||
tmp2 = (unk1 & 0x3E0) << 3;
|
||||
tmp2 = (tmp2 * unk3) >> 5;
|
||||
tmp5 = (unk2 & 0x3E0) << 3;
|
||||
tmp5 = (tmp5 * (0x20 - unk3)) >> 5;
|
||||
tmp2 = (color1 & 0x3E0) << 3;
|
||||
tmp2 = (tmp2 * factor) >> 5;
|
||||
tmp5 = (color2 & 0x3E0) << 3;
|
||||
tmp5 = (tmp5 * (0x20 - factor)) >> 5;
|
||||
tmp2 = (tmp2 + tmp5) >> 8;
|
||||
|
||||
tmp3 = (unk1 & 0x7C00) >> 2;
|
||||
tmp3 = (tmp3 * unk3) >> 5;
|
||||
tmp6 = (unk2 & 0x7C00) >> 2;
|
||||
tmp6 = (tmp6 * (0x20 - unk3)) >> 5;
|
||||
tmp3 = (color1 & 0x7C00) >> 2;
|
||||
tmp3 = (tmp3 * factor) >> 5;
|
||||
tmp6 = (color2 & 0x7C00) >> 2;
|
||||
tmp6 = (tmp6 * (0x20 - factor)) >> 5;
|
||||
tmp3 = (tmp3 + tmp6) >> 8;
|
||||
|
||||
return tmp1 | (tmp2 << 5) | (tmp3 << 10);
|
||||
}
|
||||
|
||||
void sub_08059960(const u16* unk1, const u16* unk2, u16* unk3, u8 unk4) {
|
||||
void MixPalettes(const u16* srcPalette1, const u16* srcPalette2, u16* destPalette, u8 factor) {
|
||||
u32 i;
|
||||
for (i = 0; i < 0x10; i++) {
|
||||
*unk3++ = sub_080598F8(*unk1++, *unk2++, unk4);
|
||||
*destPalette++ = MixColors(*srcPalette1++, *srcPalette2++, factor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -98,8 +98,8 @@ void FigurineMenu_080A4608(void) {
|
||||
|
||||
SetBgmVolume(0x80);
|
||||
sub_080A4DA8(3);
|
||||
SetColor(0, gPaletteBuffer[0xfb]);
|
||||
SetColor(0x15c, gPaletteBuffer[0xd3]);
|
||||
SetColor(0, gPaletteBuffer[251]);
|
||||
SetColor(0x15c, gPaletteBuffer[211]);
|
||||
MemClear(&gBG0Buffer, sizeof(gBG0Buffer));
|
||||
MemClear(&gBG3Buffer, sizeof(gBG3Buffer));
|
||||
gScreen.controls.window0HorizontalDimensions = DISPLAY_WIDTH;
|
||||
@@ -592,7 +592,7 @@ void sub_080A4DB8(u32 param_1) {
|
||||
MemClear(&gBG0Buffer, sizeof(gBG0Buffer));
|
||||
MemClear(&gBG1Buffer, sizeof(gBG1Buffer));
|
||||
MemClear(&gBG2Buffer, sizeof(gBG2Buffer));
|
||||
MemClear(gUnk_0200AF00.elements, sizeof(gUnk_0200AF00.elements));
|
||||
MemClear(gHUD.elements, sizeof(gHUD.elements));
|
||||
MemClear(&gFigurineMenu, sizeof(gFigurineMenu));
|
||||
gFigurineMenu.unk2e = -1;
|
||||
gMenu.field_0x3 = gPauseMenuOptions.unk2[param_1];
|
||||
|
||||
+32
-32
@@ -57,14 +57,12 @@ void Subtask_PauseMenu(void) {
|
||||
}
|
||||
}
|
||||
|
||||
struct_08127F94* sub_080A6A80(u32, u32);
|
||||
|
||||
extern u8 gUnk_02034492[];
|
||||
void UpdateVisibleFusionMapMarkers(void);
|
||||
s32 sub_080A50A0(s32);
|
||||
|
||||
void PauseMenu_Variant0(void) {
|
||||
struct_08127F94* ptr;
|
||||
const OverworldLocation* location;
|
||||
int r0, r1;
|
||||
|
||||
UpdateVisibleFusionMapMarkers();
|
||||
@@ -74,9 +72,9 @@ void PauseMenu_Variant0(void) {
|
||||
gUnk_02034492[r1] = 0;
|
||||
r1++;
|
||||
} while (r1 <= 0xd);
|
||||
ptr = sub_080A6A80((u16)gRoomTransition.player_status.overworld_map_x,
|
||||
(u16)gRoomTransition.player_status.overworld_map_y);
|
||||
gPauseMenuOptions.unk2[4] = ptr->_4;
|
||||
location = GetOverworldLocation((u16)gRoomTransition.player_status.overworld_map_x,
|
||||
(u16)gRoomTransition.player_status.overworld_map_y);
|
||||
gPauseMenuOptions.unk2[4] = location->windcrestId;
|
||||
gPauseMenuOptions.unk2[5] = sub_0801DB94();
|
||||
if (IsItemEquipped(ITEM_LANTERN_ON) != EQUIP_SLOT_NONE) {
|
||||
r1 = 0x10;
|
||||
@@ -582,9 +580,8 @@ extern u32 gUnk_085C4620[];
|
||||
extern void (*const gUnk_08128D58[])(void);
|
||||
extern KeyButtonLayout gUnk_08128D60;
|
||||
|
||||
void sub_080A5D1C();
|
||||
void DrawDungeonMapActually();
|
||||
void sub_080A5CFC(u32, void*, u32);
|
||||
void sub_080A6FB4(u32, u32);
|
||||
void DrawDungeonFeatures(u32, void*, u32);
|
||||
extern void DrawDungeonMap(u32 floor, struct_02019EE0* data, u32 size);
|
||||
extern void LoadDungeonMap(void);
|
||||
@@ -766,13 +763,13 @@ void sub_080A56A0(void) {
|
||||
case 0:
|
||||
case 2:
|
||||
if (gGenericMenu.unk10.a[gMenu.field_0x3] != 0) {
|
||||
gUnk_0200AF00.buttonY[0] = 0x10;
|
||||
gHUD.buttonY[0] = 0x10;
|
||||
} else {
|
||||
gUnk_0200AF00.buttonY[0] = 0xfff0;
|
||||
gHUD.buttonY[0] = 0xfff0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
gUnk_0200AF00.buttonY[0] = 0xfff0;
|
||||
gHUD.buttonY[0] = 0xfff0;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1064,17 +1061,19 @@ void sub_080A5BB8(void) {
|
||||
|
||||
void PauseMenu_Screen_5(void) {
|
||||
extern void (*const gUnk_08128D30[])(void);
|
||||
u32 uVar1;
|
||||
u32 temp;
|
||||
u32 paletteColor;
|
||||
u32 ticks;
|
||||
|
||||
gUnk_08128D30[gMenu.menuType]();
|
||||
sub_080A5D1C();
|
||||
temp = gMain.ticks;
|
||||
if ((temp & 7) == 0) {
|
||||
uVar1 = *gUnk_02017830;
|
||||
MemCopy(gUnk_02017830 + 1, gUnk_02017830, 0xe);
|
||||
gUnk_02017830[7] = uVar1;
|
||||
gUsedPalettes |= 0x1000;
|
||||
DrawDungeonMapActually();
|
||||
ticks = gMain.ticks;
|
||||
// TODO gUnk_02017830 is gPaletteBuffer[200]
|
||||
if ((ticks & 7) == 0) {
|
||||
// Rotate these 8 palette colors.
|
||||
paletteColor = *gUnk_02017830;
|
||||
MemCopy(gUnk_02017830 + 1, gUnk_02017830, 7 * 2);
|
||||
gUnk_02017830[7] = paletteColor;
|
||||
gUsedPalettes |= 1 << 12;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1083,7 +1082,7 @@ void sub_080A5C44(u32 param_1, u32 param_2, u32 param_3) {
|
||||
gMenu.field_0xc = gUnk_08128D38;
|
||||
sub_080A5CFC(gMenu.field_0x3, &gMenu, param_3);
|
||||
LoadGfxGroup(0x81);
|
||||
sub_080A6FB4(gArea.dungeon_idx, 1);
|
||||
ShowAreaName(gArea.dungeon_idx, 1);
|
||||
SetMenuType(1);
|
||||
ptr = &gUnk_08128D43[(u32)gArea.dungeon_idx * 2];
|
||||
gScreen.bg1.xOffset += ptr[0];
|
||||
@@ -1092,10 +1091,10 @@ void sub_080A5C44(u32 param_1, u32 param_2, u32 param_3) {
|
||||
|
||||
void sub_080A5C9C(void) {
|
||||
s32 newChoice;
|
||||
const struct_080C9C6C* ptr;
|
||||
const DungeonFloorMetadata* floorMetadata;
|
||||
|
||||
if (sub_080A51F4()) {
|
||||
ptr = &gUnk_080C9C6C[gArea.dungeon_idx];
|
||||
floorMetadata = &gDungeonFloorMetadatas[gArea.dungeon_idx];
|
||||
newChoice = gMenu.field_0x3;
|
||||
switch (gInput.newKeys) {
|
||||
case DPAD_UP:
|
||||
@@ -1104,7 +1103,7 @@ void sub_080A5C9C(void) {
|
||||
}
|
||||
break;
|
||||
case DPAD_DOWN:
|
||||
if (ptr->unk_0 - 1 > newChoice) {
|
||||
if (floorMetadata->numFloors - 1 > newChoice) {
|
||||
newChoice++;
|
||||
}
|
||||
break;
|
||||
@@ -1130,7 +1129,7 @@ void sub_080A5CFC(u32 menuType, void* param_2, u32 param_3) {
|
||||
#endif
|
||||
|
||||
// Actually draw the sprites for the dungeon map.
|
||||
void sub_080A5D1C(void) {
|
||||
void DrawDungeonMapActually(void) {
|
||||
extern u8 gUnk_08128D3C[];
|
||||
u32 bVar1;
|
||||
int frameIndex;
|
||||
@@ -1138,10 +1137,10 @@ void sub_080A5D1C(void) {
|
||||
u32 uVar6;
|
||||
u32 index;
|
||||
u8* puVar8;
|
||||
const struct_080C9C6C* pbVar9;
|
||||
const DungeonFloorMetadata* pbVar9;
|
||||
|
||||
pbVar9 = &gUnk_080C9C6C[gArea.dungeon_idx];
|
||||
bVar1 = gUnk_08128D3C[pbVar9->unk_0];
|
||||
pbVar9 = &gDungeonFloorMetadatas[gArea.dungeon_idx];
|
||||
bVar1 = gUnk_08128D3C[pbVar9->numFloors];
|
||||
uVar4 = sub_0801DB94();
|
||||
gOamCmd._4 = 0x400;
|
||||
gOamCmd._6 = 0;
|
||||
@@ -1172,7 +1171,7 @@ void sub_080A5D1C(void) {
|
||||
if (sub_080A5F24()) {
|
||||
gOamCmd._8 = 0;
|
||||
gOamCmd.x = 0x46;
|
||||
gOamCmd.y = bVar1 + (pbVar9->unk_1 - pbVar9->unk_2) * 0xc;
|
||||
gOamCmd.y = bVar1 + (pbVar9->highestFloor - pbVar9->unk_2) * 0xc;
|
||||
if ((gMain.ticks & 0x20) != 0) {
|
||||
uVar6 = 0x7a;
|
||||
} else {
|
||||
@@ -1184,9 +1183,10 @@ void sub_080A5D1C(void) {
|
||||
gOamCmd._8 = 0;
|
||||
gOamCmd.x = 0x34;
|
||||
gOamCmd.y = bVar1;
|
||||
frameIndex = pbVar9->unk_1 + 0x82;
|
||||
frameIndex = pbVar9->highestFloor + 0x82;
|
||||
|
||||
for (index = 0; index < pbVar9->unk_0; index++) {
|
||||
// Floor number sprites?
|
||||
for (index = 0; index < pbVar9->numFloors; index++) {
|
||||
DrawDirect(DRAW_DIRECT_SPRITE_INDEX, frameIndex);
|
||||
frameIndex--;
|
||||
gOamCmd.y = gOamCmd.y + 0xc;
|
||||
@@ -1460,7 +1460,7 @@ void sub_080A62E0(void) {
|
||||
gMenu.field_0x3 = windcrest;
|
||||
SoundReq(SFX_TEXTBOX_CHOICE);
|
||||
}
|
||||
sub_080A6FB4(gMenu.field_0x3, 0);
|
||||
ShowAreaName(gMenu.field_0x3, 0);
|
||||
}
|
||||
|
||||
void sub_080A6378(void) {
|
||||
|
||||
+15
-15
@@ -75,7 +75,7 @@ void sub_080A667C(void) {
|
||||
}
|
||||
|
||||
gMenu.field_0xa = uVar2;
|
||||
sub_080A6FB4(gMenu.field_0x3, 0);
|
||||
ShowAreaName(gMenu.field_0x3, 0);
|
||||
}
|
||||
|
||||
void sub_080A66D0(void) {
|
||||
@@ -217,7 +217,7 @@ void sub_080A698C(u32 param_1, u32 param_2, u32 param_3, u32 param_4) {
|
||||
int iVar1;
|
||||
|
||||
iVar1 = sub_080A69E0(param_1, param_2);
|
||||
if (0 < iVar1) {
|
||||
if (iVar1 > 0) {
|
||||
((struct_sub_080A698C*)&gMapDataBottomSpecial)[gGenericMenu.unk2d].unk0 = param_4 >> 8;
|
||||
((struct_sub_080A698C*)&gMapDataBottomSpecial)[gGenericMenu.unk2d].unk1 = param_4;
|
||||
((struct_sub_080A698C*)&gMapDataBottomSpecial)[gGenericMenu.unk2d].unk2 = param_3;
|
||||
@@ -228,17 +228,17 @@ void sub_080A698C(u32 param_1, u32 param_2, u32 param_3, u32 param_4) {
|
||||
}
|
||||
|
||||
s32 sub_080A69E0(u32 param_1, u32 param_2) {
|
||||
const struct_08127F94* pbVar1;
|
||||
const OverworldLocation* location;
|
||||
int iVar3;
|
||||
|
||||
if ((param_1 | param_2) == 0)
|
||||
return -1;
|
||||
|
||||
pbVar1 = sub_080A6A80(param_1, param_2);
|
||||
if (pbVar1 == NULL)
|
||||
location = GetOverworldLocation(param_1, param_2);
|
||||
if (location == NULL)
|
||||
return -1;
|
||||
|
||||
if (gMenu.field_0x3 != pbVar1->_4)
|
||||
if (gMenu.field_0x3 != location->windcrestId)
|
||||
return -1;
|
||||
|
||||
switch (gMenu.field_0x3) {
|
||||
@@ -257,19 +257,19 @@ s32 sub_080A69E0(u32 param_1, u32 param_2) {
|
||||
break;
|
||||
}
|
||||
|
||||
param_1 = (s32)((param_1 - pbVar1->_0 * 0x10) * 100) / 0x23a;
|
||||
param_2 = (s32)((param_2 - pbVar1->_1 * 0x10) * 100) / 0x23a;
|
||||
param_1 = (s32)((param_1 - location->minX * 0x10) * 100) / 0x23a;
|
||||
param_2 = (s32)((param_2 - location->minY * 0x10) * 100) / 0x23a;
|
||||
return (param_2 << 0x10) | param_1;
|
||||
}
|
||||
|
||||
struct_08127F94* sub_080A6A80(u32 param_1, u32 param_2) {
|
||||
struct_08127F94* pbVar1;
|
||||
param_1 >>= 4;
|
||||
param_2 >>= 4;
|
||||
const OverworldLocation* GetOverworldLocation(u32 x, u32 y) {
|
||||
const OverworldLocation* location;
|
||||
x >>= 4;
|
||||
y >>= 4;
|
||||
|
||||
for (pbVar1 = gUnk_08127F94; pbVar1->_0 != 0xff; pbVar1++) {
|
||||
if (pbVar1->_0 <= param_1 && pbVar1->_2 >= param_1 && pbVar1->_1 <= param_2 && pbVar1->_3 >= param_2) {
|
||||
return pbVar1;
|
||||
for (location = gOverworldLocations; location->minX != 0xff; location++) {
|
||||
if (location->minX <= x && location->maxX >= x && location->minY <= y && location->maxY >= y) {
|
||||
return location;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
|
||||
+27
-27
@@ -1603,7 +1603,7 @@ bool32 IsTileCollision(const u8* collisionData, s32 x, s32 y, u32 collisionType)
|
||||
}
|
||||
|
||||
void CalculateEntityTileCollisions(Entity* this, u32 direction, u32 collisionType) {
|
||||
u8* layer;
|
||||
u8* collisionData;
|
||||
u32 colResult;
|
||||
Hitbox* hb;
|
||||
s32 xMin;
|
||||
@@ -1612,7 +1612,7 @@ void CalculateEntityTileCollisions(Entity* this, u32 direction, u32 collisionTyp
|
||||
u32 hitboxUnkX;
|
||||
u32 hitboxUnkY;
|
||||
|
||||
layer = GetTileBuffer(this->collisionLayer)->collisionData;
|
||||
collisionData = GetLayerByIndex(this->collisionLayer)->collisionData;
|
||||
hb = this->hitbox;
|
||||
xMin = this->x.HALF.HI + hb->offset_x;
|
||||
yMin = this->y.HALF.HI + hb->offset_y;
|
||||
@@ -1621,35 +1621,35 @@ void CalculateEntityTileCollisions(Entity* this, u32 direction, u32 collisionTyp
|
||||
if ((direction & 0xf) != 0) {
|
||||
if (0xf >= direction) {
|
||||
temp = xMin + hitboxUnkX;
|
||||
colResult = IsTileCollision(layer, temp, yMin, collisionType);
|
||||
colResult = IsTileCollision(collisionData, temp, yMin, collisionType);
|
||||
colResult <<= 1;
|
||||
colResult |= IsTileCollision(layer, temp, yMin + hitboxUnkY, collisionType);
|
||||
colResult |= IsTileCollision(collisionData, temp, yMin + hitboxUnkY, collisionType);
|
||||
colResult <<= 1;
|
||||
colResult |= IsTileCollision(layer, temp, yMin - hitboxUnkY, collisionType);
|
||||
colResult |= IsTileCollision(collisionData, temp, yMin - hitboxUnkY, collisionType);
|
||||
colResult <<= 6;
|
||||
} else {
|
||||
temp = xMin - hitboxUnkX;
|
||||
colResult = IsTileCollision(layer, temp, yMin, collisionType);
|
||||
colResult = IsTileCollision(collisionData, temp, yMin, collisionType);
|
||||
colResult <<= 1;
|
||||
colResult |= IsTileCollision(layer, temp, yMin + hitboxUnkY, collisionType);
|
||||
colResult |= IsTileCollision(collisionData, temp, yMin + hitboxUnkY, collisionType);
|
||||
colResult <<= 1;
|
||||
colResult |= IsTileCollision(layer, temp, yMin - hitboxUnkY, collisionType);
|
||||
colResult |= IsTileCollision(collisionData, temp, yMin - hitboxUnkY, collisionType);
|
||||
colResult <<= 2;
|
||||
}
|
||||
} else {
|
||||
temp = xMin + hitboxUnkX;
|
||||
colResult = IsTileCollision(layer, temp, yMin, collisionType);
|
||||
colResult = IsTileCollision(collisionData, temp, yMin, collisionType);
|
||||
colResult <<= 1;
|
||||
colResult |= IsTileCollision(layer, temp, yMin + hitboxUnkY, collisionType);
|
||||
colResult |= IsTileCollision(collisionData, temp, yMin + hitboxUnkY, collisionType);
|
||||
colResult <<= 1;
|
||||
colResult |= IsTileCollision(layer, temp, yMin - hitboxUnkY, collisionType);
|
||||
colResult |= IsTileCollision(collisionData, temp, yMin - hitboxUnkY, collisionType);
|
||||
colResult <<= 2;
|
||||
temp = xMin - hitboxUnkX;
|
||||
colResult |= IsTileCollision(layer, temp, yMin, collisionType);
|
||||
colResult |= IsTileCollision(collisionData, temp, yMin, collisionType);
|
||||
colResult <<= 1;
|
||||
colResult |= IsTileCollision(layer, temp, yMin + hitboxUnkY, collisionType);
|
||||
colResult |= IsTileCollision(collisionData, temp, yMin + hitboxUnkY, collisionType);
|
||||
colResult <<= 1;
|
||||
colResult |= IsTileCollision(layer, temp, yMin - hitboxUnkY, collisionType);
|
||||
colResult |= IsTileCollision(collisionData, temp, yMin - hitboxUnkY, collisionType);
|
||||
colResult <<= 2;
|
||||
}
|
||||
|
||||
@@ -1660,36 +1660,36 @@ void CalculateEntityTileCollisions(Entity* this, u32 direction, u32 collisionTyp
|
||||
if (((direction)&0xf) != 0) {
|
||||
if (direction < 0x10) {
|
||||
temp = yMin + hitboxUnkY;
|
||||
colResult |= IsTileCollision(layer, xMin, temp, collisionType);
|
||||
colResult |= IsTileCollision(collisionData, xMin, temp, collisionType);
|
||||
colResult <<= 1;
|
||||
colResult |= IsTileCollision(layer, xMin + hitboxUnkX, temp, collisionType);
|
||||
colResult |= IsTileCollision(collisionData, xMin + hitboxUnkX, temp, collisionType);
|
||||
colResult <<= 1;
|
||||
colResult |= IsTileCollision(layer, xMin - hitboxUnkX, temp, collisionType);
|
||||
colResult |= IsTileCollision(collisionData, xMin - hitboxUnkX, temp, collisionType);
|
||||
colResult <<= 5;
|
||||
} else {
|
||||
temp = yMin - hitboxUnkY;
|
||||
colResult <<= 4;
|
||||
colResult |= IsTileCollision(layer, xMin, temp, collisionType);
|
||||
colResult |= IsTileCollision(collisionData, xMin, temp, collisionType);
|
||||
colResult <<= 1;
|
||||
colResult |= IsTileCollision(layer, xMin + hitboxUnkX, temp, collisionType);
|
||||
colResult |= IsTileCollision(collisionData, xMin + hitboxUnkX, temp, collisionType);
|
||||
colResult <<= 1;
|
||||
colResult |= IsTileCollision(layer, xMin - hitboxUnkX, temp, collisionType);
|
||||
colResult |= IsTileCollision(collisionData, xMin - hitboxUnkX, temp, collisionType);
|
||||
colResult <<= 1;
|
||||
}
|
||||
} else {
|
||||
temp = yMin + hitboxUnkY;
|
||||
colResult |= IsTileCollision(layer, xMin, temp, collisionType);
|
||||
colResult |= IsTileCollision(collisionData, xMin, temp, collisionType);
|
||||
colResult <<= 1;
|
||||
colResult |= IsTileCollision(layer, xMin + hitboxUnkX, temp, collisionType);
|
||||
colResult |= IsTileCollision(collisionData, xMin + hitboxUnkX, temp, collisionType);
|
||||
colResult <<= 1;
|
||||
colResult |= IsTileCollision(layer, xMin - hitboxUnkX, temp, collisionType);
|
||||
colResult |= IsTileCollision(collisionData, xMin - hitboxUnkX, temp, collisionType);
|
||||
colResult <<= 2;
|
||||
temp = yMin - hitboxUnkY;
|
||||
colResult |= IsTileCollision(layer, xMin, temp, collisionType);
|
||||
colResult |= IsTileCollision(collisionData, xMin, temp, collisionType);
|
||||
colResult <<= 1;
|
||||
colResult |= IsTileCollision(layer, xMin + hitboxUnkX, temp, collisionType);
|
||||
colResult |= IsTileCollision(collisionData, xMin + hitboxUnkX, temp, collisionType);
|
||||
colResult <<= 1;
|
||||
colResult |= IsTileCollision(layer, xMin - hitboxUnkX, temp, collisionType);
|
||||
colResult |= IsTileCollision(collisionData, xMin - hitboxUnkX, temp, collisionType);
|
||||
colResult <<= 1;
|
||||
}
|
||||
this->collisions = colResult;
|
||||
@@ -2162,7 +2162,7 @@ bool32 ProcessMovement3(Entity* this) {
|
||||
}
|
||||
|
||||
bool32 sub_080AF0C8(Entity* this) {
|
||||
u32 tileType = GetTileTypeByEntity(this);
|
||||
u32 tileType = GetTileTypeAtEntity(this);
|
||||
switch (tileType) {
|
||||
case 0x87:
|
||||
if (((this->direction + 7) & (0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth |
|
||||
|
||||
+3
-3
@@ -153,7 +153,7 @@ void sub_0806D0B0(Entity* this) {
|
||||
sub_0806D164(this);
|
||||
}
|
||||
gScreen.bg1.control = 0x1d47;
|
||||
gScreen.bg1.tilemap = &gMapDataTopSpecial;
|
||||
gScreen.bg1.subTileMap = &gMapDataTopSpecial;
|
||||
gScreen.bg1.updated = 1;
|
||||
}
|
||||
|
||||
@@ -546,7 +546,7 @@ void sub_0806D7C4(Entity* this, ScriptExecutionContext* context) {
|
||||
this->y.HALF.HI = gPlayerEntity.base.y.HALF.HI - 0x18;
|
||||
entity = FindEntity(NPC, BIG_GORON, 7, 2, 0);
|
||||
if (entity != NULL) {
|
||||
sub_0807DEDC(this, context, entity->x.HALF.HI, entity->y.HALF.HI);
|
||||
LookAt(this, context, entity->x.HALF.HI, entity->y.HALF.HI);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -557,7 +557,7 @@ void sub_0806D804(Entity* this, ScriptExecutionContext* context) {
|
||||
this->y.HALF.HI = entity->y.HALF.HI - 0x10;
|
||||
this->spritePriority.b1 = 0;
|
||||
}
|
||||
sub_0807DEDC(this, context, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI - 0x10);
|
||||
LookAt(this, context, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI - 0x10);
|
||||
}
|
||||
|
||||
void sub_0806D858(Entity* this) {
|
||||
|
||||
+19
-11
@@ -44,18 +44,26 @@ void (*const gUnk_081115D0[])(BladeBrothersEntity*) = {
|
||||
|
||||
const u16 gUnk_081115DC[] = { 183, 184, 185, 186, 187, 188, 189, 190 };
|
||||
|
||||
// TODO extract macros
|
||||
extern const PlayerMacroEntry gUnk_08004A0C;
|
||||
extern const PlayerMacroEntry gUnk_08004A16;
|
||||
extern const PlayerMacroEntry gUnk_08004A24;
|
||||
extern const PlayerMacroEntry gUnk_08004A32;
|
||||
extern const PlayerMacroEntry gUnk_08004A48;
|
||||
extern const PlayerMacroEntry gUnk_08004A72;
|
||||
extern const PlayerMacroEntry gUnk_08004A8C;
|
||||
extern const PlayerMacroEntry gUnk_08004AA6;
|
||||
extern const PlayerMacroEntry gPlayerMacroBladeBrothers0;
|
||||
extern const PlayerMacroEntry gPlayerMacroBladeBrothers1;
|
||||
extern const PlayerMacroEntry gPlayerMacroBladeBrothers2;
|
||||
extern const PlayerMacroEntry gPlayerMacroBladeBrothers3;
|
||||
extern const PlayerMacroEntry gPlayerMacroBladeBrothers4;
|
||||
extern const PlayerMacroEntry gPlayerMacroBladeBrothers5;
|
||||
extern const PlayerMacroEntry gPlayerMacroBladeBrothers6;
|
||||
extern const PlayerMacroEntry gPlayerMacroBladeBrothers7;
|
||||
const PlayerMacroEntry* const BladeBrothers_PlayerMacros[] = {
|
||||
&gUnk_08004A0C, &gUnk_08004A16, &gUnk_08004A24, &gUnk_08004A32, &gUnk_08004A48, &gUnk_08004A72,
|
||||
&gUnk_08004A8C, &gUnk_08004AA6, NULL, NULL, NULL,
|
||||
&gPlayerMacroBladeBrothers0,
|
||||
&gPlayerMacroBladeBrothers1,
|
||||
&gPlayerMacroBladeBrothers2,
|
||||
&gPlayerMacroBladeBrothers3,
|
||||
&gPlayerMacroBladeBrothers4,
|
||||
&gPlayerMacroBladeBrothers5,
|
||||
&gPlayerMacroBladeBrothers6,
|
||||
&gPlayerMacroBladeBrothers7,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
};
|
||||
|
||||
const u8 BladeBrothers_EquippedItem[] = {
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
#include "npc.h"
|
||||
#include "script.h"
|
||||
#include "sound.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
/*0x68*/ u8 unused[12];
|
||||
@@ -78,20 +80,20 @@ void sub_08067418(CastorWildsStatueEntity* this) {
|
||||
this->tilePos = COORD_TO_TILE(super);
|
||||
if (super->type == 0) {
|
||||
super->hitbox = (Hitbox*)&gUnk_08110E94;
|
||||
SetBottomTile(0x4022, this->tilePos - 1, super->collisionLayer);
|
||||
SetBottomTile(0x4022, this->tilePos, super->collisionLayer);
|
||||
SetBottomTile(0x4022, this->tilePos + 0x3f, super->collisionLayer);
|
||||
SetBottomTile(0x4022, this->tilePos + 0x40, super->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_34, this->tilePos - 1, super->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_34, this->tilePos, super->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_34, this->tilePos + 0x3f, super->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_34, this->tilePos + 0x40, super->collisionLayer);
|
||||
} else {
|
||||
super->collisionLayer = 3;
|
||||
super->spriteOrientation.flipY = 1;
|
||||
super->spriteRendering.b3 = 1;
|
||||
super->spritePriority.b0 = 2;
|
||||
if (CheckLocalFlag(HIKYOU_00_SEKIZOU) == 0) {
|
||||
SetBottomTile(0x4022, 0xe81, 1);
|
||||
SetBottomTile(0x4022, 0xe82, 1);
|
||||
SetBottomTile(0x4022, 0xe83, 1);
|
||||
SetBottomTile(0x4022, 0xec3, 1);
|
||||
SetTile(SPECIAL_TILE_34, TILE_POS(1, 58), LAYER_BOTTOM);
|
||||
SetTile(SPECIAL_TILE_34, TILE_POS(2, 58), LAYER_BOTTOM);
|
||||
SetTile(SPECIAL_TILE_34, TILE_POS(3, 58), LAYER_BOTTOM);
|
||||
SetTile(SPECIAL_TILE_34, TILE_POS(3, 59), LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
InitScriptForNPC(super);
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
* @brief Clothes Rack NPC
|
||||
*/
|
||||
#include "npc.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void sub_0806DD90(Entity*);
|
||||
void sub_0806DEC8(Entity*);
|
||||
@@ -36,12 +37,12 @@ void sub_0806DD90(Entity* this) {
|
||||
InitializeAnimation(this, animIndex);
|
||||
x = this->x.HALF.HI;
|
||||
y = this->y.HALF.HI;
|
||||
SetBottomTile(0x4072, TILE(x - 0x18, y - 0x10), this->collisionLayer);
|
||||
SetBottomTile(0x4072, TILE(x - 0x18, y), this->collisionLayer);
|
||||
SetBottomTile(0x4072, TILE(x - 0x18, y + 0x10), this->collisionLayer);
|
||||
SetBottomTile(0x4072, TILE(x + 0x18, y - 0x10), this->collisionLayer);
|
||||
SetBottomTile(0x4072, TILE(x + 0x18, y), this->collisionLayer);
|
||||
SetBottomTile(0x4072, TILE(x + 0x18, y + 0x10), this->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_114, TILE(x - 24, y - 16), this->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_114, TILE(x - 24, y), this->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_114, TILE(x - 24, y + 16), this->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_114, TILE(x + 24, y - 16), this->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_114, TILE(x + 24, y), this->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_114, TILE(x + 24, y + 16), this->collisionLayer);
|
||||
}
|
||||
|
||||
void sub_0806DEC8(Entity* this) {
|
||||
|
||||
+6
-4
@@ -7,10 +7,12 @@
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "item.h"
|
||||
#include "map.h"
|
||||
#include "message.h"
|
||||
#include "npc.h"
|
||||
#include "player.h"
|
||||
#include "room.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -104,10 +106,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);
|
||||
SetTileType(TILE_TYPE_382, TILE_POS(14, 22), LAYER_BOTTOM);
|
||||
SetTileType(TILE_TYPE_383, TILE_POS(15, 22), LAYER_BOTTOM);
|
||||
SetTileType(TILE_TYPE_384, TILE_POS(14, 23), LAYER_BOTTOM);
|
||||
SetTileType(TILE_TYPE_385, TILE_POS(15, 23), LAYER_BOTTOM);
|
||||
}
|
||||
|
||||
void sub_0806BF44(Entity* this, ScriptExecutionContext* context) {
|
||||
|
||||
+2
-1
@@ -9,6 +9,7 @@
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
#include "npc.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -235,7 +236,7 @@ void sub_08069B44(DogEntity* this) {
|
||||
super->action = 4;
|
||||
}
|
||||
if ((super->type == 2) && (CheckLocalFlag(MACHI_02_DOG) == 0)) {
|
||||
SetBottomTile(0x4072, TILE(super->x.HALF.HI, super->y.HALF.HI - 8), super->collisionLayer);
|
||||
SetTile(SPECIAL_TILE_114, TILE(super->x.HALF.HI, super->y.HALF.HI - 8), super->collisionLayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ void sub_0806D8A0(Entity* this, ScriptExecutionContext* context) {
|
||||
context->y.HALF.HI = yOffset;
|
||||
|
||||
xOffset -= this->x.HALF.HI;
|
||||
this->direction = CalcOffsetAngle(xOffset, yOffset - this->y.HALF.HI);
|
||||
this->direction = CalculateDirectionFromOffsets(xOffset, yOffset - this->y.HALF.HI);
|
||||
this->animationState = (this->animationState & 0x80) | gUnk_08114134[this->direction >> 4];
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -154,7 +154,7 @@ void sub_0806991C(GormanEntity* this, ScriptExecutionContext* context) {
|
||||
context->unk_19 = 8;
|
||||
context->postScriptActions |= 2;
|
||||
context->condition = 0;
|
||||
tmp = CalcOffsetAngle(context->x.HALF.HI - super->x.HALF.HI, context->y.HALF.HI - super->y.HALF.HI);
|
||||
tmp = CalculateDirectionFromOffsets(context->x.HALF.HI - super->x.HALF.HI, context->y.HALF.HI - super->y.HALF.HI);
|
||||
super->direction = tmp;
|
||||
super->animationState = (super->animationState & 0x80) | gUnk_08111C74[(tmp << 0x18) >> 0x1c];
|
||||
gActiveScriptInfo.flags |= 1;
|
||||
@@ -170,7 +170,7 @@ void sub_080699AC(GormanEntity* this, ScriptExecutionContext* context) {
|
||||
context->unk_19 = 8;
|
||||
context->postScriptActions |= 2;
|
||||
context->condition = 0;
|
||||
tmp = CalcOffsetAngle(context->x.HALF.HI - super->x.HALF.HI, context->y.HALF.HI - super->y.HALF.HI);
|
||||
tmp = CalculateDirectionFromOffsets(context->x.HALF.HI - super->x.HALF.HI, context->y.HALF.HI - super->y.HALF.HI);
|
||||
super->direction = tmp;
|
||||
super->animationState = (super->animationState & 0x80) | gUnk_08111C8C[(tmp << 0x18) >> 0x1c];
|
||||
gActiveScriptInfo.flags |= 1;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user