Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code_803D110 #220

Merged
merged 5 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,757 changes: 0 additions & 1,757 deletions asm/code_803D110.s

Large diffs are not rendered by default.

89 changes: 68 additions & 21 deletions include/structs/str_dungeon.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ typedef struct Weather
} Weather;

// size: 0x30
typedef struct unkDungeonGlobal_unk1CE98_sub
typedef struct UnkDungeonGlobal_unk1CE98_sub
{
/* 0x0 */ u8 buffer1[10];
/* 0xA */ u8 buffer2[10];
Expand All @@ -67,7 +67,7 @@ typedef struct unkDungeonGlobal_unk1CE98_sub
/* 0x2D */ u8 defBoost;
/* 0x2E */ u8 spDefBoost;
u8 unk2F; // speedBoost?
} unkDungeonGlobal_unk1CE98_sub;
} UnkDungeonGlobal_unk1CE98_sub;

// size: 0x10
typedef struct DungeonMusicPlayer
Expand All @@ -81,7 +81,7 @@ typedef struct DungeonMusicPlayer
} DungeonMusicPlayer;

// Size unknown?
typedef struct unkDungeonGlobal_unk181E8_sub
typedef struct UnkDungeonGlobal_unk181E8_sub
{
/* 0x181E8 */ Position cameraPos;
/* 0x181EC */ Position cameraPosMirror;
Expand Down Expand Up @@ -115,7 +115,51 @@ typedef struct unkDungeonGlobal_unk181E8_sub
u8 fill1821D;
u8 fill1821E;
u8 fill1821F;
} unkDungeonGlobal_unk181E8_sub;
} UnkDungeonGlobal_unk181E8_sub;

// Sizeof: 0x1C
typedef struct UnkDungeonGlobal_unk1C574
{
u8 unk0;
u8 unk1;
u8 unk2;
u8 unk3;
u8 unk4;
u8 unk5;
u8 unk6;
u8 unk7;
u8 unk8;
u8 unk9;
u8 unkA;
u8 unkB;
u8 unkC;
u8 unkD;
u8 unkE;
u8 unkF;
u8 unk10;
u8 unk11;
u8 unk12;
u8 unk13;
u8 unk14;
u8 unk15;
u8 unk16;
u8 unk17;
u8 unk18;
u8 unk19;
u8 unk1A;
} UnkDungeonGlobal_unk1C574;

typedef struct UnkDungeonGlobal_unk1C590
{
s16 unk0[NUM_ITEM_CATEGORIES];
s16 unk18[NUMBER_OF_ITEM_IDS];
} UnkDungeonGlobal_unk1C590;

typedef struct UnkDungeonGlobal_unk1CD98
{
s16 unk0; // species
s16 unk2[2];
} UnkDungeonGlobal_unk1CD98;

// size: 0x1CEDC
typedef struct Dungeon
Expand All @@ -136,7 +180,8 @@ typedef struct Dungeon
u8 unk10;
u8 unk11;
s16 unk12;
u8 fill14[0xB8 - 0x14];
s16 unk14;
u8 fill14[0xB8 - 0x16];
Entity *unkB8;
Entity *unkBC;
u8 fillC0[0x13C - 0xC0];
Expand All @@ -154,7 +199,8 @@ typedef struct Dungeon
/* 0x5C0 */ s32 unk5C0;
/* 0x5C4 */ u8 fill5C4[0x644 - 0x5C4];
/* 0x644 */ DungeonLocation dungeonLocation;
u8 fill646[0x654 - 0x648];
/* 0x648 */ DungeonLocation dungeonLocation2;
u8 fill64C[0x654 - 0x64C];
u8 unk654;
u8 fill655[0x65B - 0x655];
u8 unk65B;
Expand Down Expand Up @@ -196,9 +242,14 @@ typedef struct Dungeon
u8 fill69A[0x69C - 0x69A];
EntityInfo unk69C[4];
EntityInfo unkEBC[1]; // Unsure about the size... See sub_8082A08()
u8 fill10C4[0x363C - 0x10C4];
u8 fill10C4[0x343C - 0x10C4];
/* 0x343C */ UnkDungeonGlobal_unk1CD98 unk343C[32];
u8 fill353C[0x363c-0x353c];
/* 0x363C */ u8 expYieldRankings[NUM_MONSTERS];
u8 fill37D9[0x37F0 - 0x37D9];
u8 fill37D9[0x37E4 - 0x37D9];
/* 0x37E4 */ s32 unk37E4;
u8 fill37E8[4];
/* 0x37EC */ u8 unk37EC;
/* 0x37F0 */ u32 unk37F0;
/* 0x37F4 */ s32 unk37F4;
/* 0x37F8 */ bool8 plusIsActive[2]; // Index 0: Enemy , Index 1: Team
Expand Down Expand Up @@ -269,21 +320,17 @@ typedef struct Dungeon
/* 0x17B3C */ u32 unk17B40;
/* 0x17B44 */ OpenedFile *sprites[MONSTER_MAX];
/* 0x181E4 */ OpenedFile *paletFile;
/* 0x181E8 */ unkDungeonGlobal_unk181E8_sub unk181e8;
/* 0x181E8 */ UnkDungeonGlobal_unk181E8_sub unk181e8;
u8 fill18220[0x1C06C - 0x18220];
u32 unk1C06C;
u32 unk1C06C;
u8 fill1C070[0x1C570 - 0x1C070];
u8 unk1C570;
u8 unk1C571;
u8 fill1C572[0x1C578 - 0x1C572];
u8 unk1C578;
u8 fill1C579[0x1C57E - 0x1C579];
u8 unk1C57E;
u8 fill1C57F[0x1C58B - 0x1C57F];
u8 unk1C58B;
u8 fill1C58C[0x1CE98 - 0x1C58C];
unkDungeonGlobal_unk1CE98_sub unk1CE98; // TODO: not sure how large this is
u32 unk1CEC8;
/* 0x1C570 */ DungeonLocation unk1C570;
/* 0x1C574 */ UnkDungeonGlobal_unk1C574 unk1C574;
/* 0x1C590 */ UnkDungeonGlobal_unk1C590 unk1C590[4];
u16 unk1CD70[20];
UnkDungeonGlobal_unk1CD98 unk1CD98[32];
UnkDungeonGlobal_unk1CE98_sub unk1CE98; // TODO: not sure how large this is
u8 unk1CEC8;
/* 0x1CECC */ DungeonMusicPlayer musPlayer;
} Dungeon;

Expand Down
1 change: 1 addition & 0 deletions ld_script.txt
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ SECTIONS {
src/personality_test1.o(.text);
src/personality_test2.o(.text);
src/code_803D0D8.o(.text);
src/code_803D110.o(.text);
asm/code_803D110.o(.text);
src/code_803E46C.o(.text);
asm/code_803E724.o(.text);
Expand Down
12 changes: 6 additions & 6 deletions src/code_803D0D8.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ u8 sub_803D110(u8 *param_1, u8 *param_2, s32 size)
auStack_40[index1] = 0;
}

for (index1 = 0; index1 < size; index1++)
for (index1 = 0; index1 < size; index1++)
{
local_78[index1] = sub_803D0F0(*param_1);
if (local_78[index1] == 0xff) {
Expand Down Expand Up @@ -107,7 +107,7 @@ bool8 sub_803D204(u8 *buffer,unkStruct_203B480 *param_2)
u8 localBuffer [PASSWORD_BUFFER_SIZE];
unkStruct_8094924 uStack_30;
s32 index;

checksum = 0;
MemoryCopy8(localBuffer,buffer,sizeof(localBuffer));
for(index = 0; index < PASSWORD_BUFFER_SIZE; index++)
Expand All @@ -119,9 +119,9 @@ bool8 sub_803D204(u8 *buffer,unkStruct_203B480 *param_2)
translateBuffer[index] = localBuffer[innerIndex];
}


if (sub_803D110(translateBuffer,local_c4,sizeof(translateBuffer)) != 0) {

for(index = 1; index < 34; index++)
{
checksum += local_c4[index] + index;
Expand Down Expand Up @@ -242,6 +242,6 @@ void sub_803D414(u8 *buffer,WonderMail *mail)

void sub_803D4AC(void)
{
gDungeon->unk1C570 = 0x63;
gDungeon->unk1C571 = 0xFF;
gDungeon->unk1C570.id = 0x63;
gDungeon->unk1C570.floor = 0xFF;
}
Loading