Merge pull request #220 from DizzyEggg/code_803D110

code_803D110
This commit is contained in:
AnonymousRandomPerson
2024-09-24 09:08:27 -04:00
committed by GitHub
9 changed files with 1189 additions and 1815 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -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];
@@ -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
@@ -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;
@@ -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
@@ -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];
@@ -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;
@@ -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
@@ -274,21 +325,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;
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;

View File

@@ -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);

View File

@@ -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) {
@@ -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++)
@@ -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;
@@ -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;
}

1091
src/code_803D110.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -98,38 +98,30 @@ void sub_8045C18(u8 *buffer, Item *item)
sub_8090E14(buffer, item, &gUnknown_80F6990);
}
void sub_8045C28(Item *Item, u8 itemID, u32 param_3)
void sub_8045C28(Item *item, u8 itemID, u32 param_3)
{
bool8 stickyFlag;
u32 total;
bool8 stickyFlag;
xxx_init_itemslot_8090A8C(Item,itemID,0);
stickyFlag = FALSE;
if (IsNotSpecialItem(itemID)) {
if (param_3 == 0) {
if (DungeonRandInt(100) >= gDungeon->unk1C57E)
{
goto _short;
xxx_init_itemslot_8090A8C(item,itemID,0);
stickyFlag = FALSE;
if (IsNotSpecialItem(itemID)) {
if (param_3 == 0) {
if (DungeonRandInt(100) < gDungeon->unk1C574.unkA)
stickyFlag = TRUE;
else
stickyFlag = FALSE;
}
else
{
goto _store;
else if (param_3 == 1) {
stickyFlag = TRUE;
}
}
else if (param_3 == 1) {
stickyFlag = TRUE;
if (stickyFlag) {
item->flags |= ITEM_FLAG_STICKY;
}
if (GetItemCategory(itemID) == CATEGORY_POKE) {
sub_8046CE4(item, gDungeon->unk1C574.unk17 * 40);
}
}
_short:
if (stickyFlag)
_store:
Item->flags = Item->flags | ITEM_FLAG_STICKY;
if (GetItemCategory(itemID) == CATEGORY_POKE) {
// FIXME: total hack but too lazy to figure out array for now
total = (gDungeon->unk1C58B << 2) + gDungeon->unk1C58B;
total <<= 3;
sub_8046CE4(Item, total);
}
}
void sub_8045CB0(void)

View File

@@ -80,7 +80,7 @@ static u8 sub_8094528(s16 moveID)
}
}
void sub_8094558(u32 param_1,u8 *param_2,unkDungeonGlobal_unk1CE98_sub *param_3)
void sub_8094558(u32 param_1,u8 *param_2,UnkDungeonGlobal_unk1CE98_sub *param_3)
{
u8 buffer [200];
s32 x, y;

View File

@@ -34,7 +34,7 @@ void sub_8083AB0(s16 param_0, Entity * target, Entity * entity)
EntityInfo * targetEntityInfo;
u8 *spAttPtr;
u8 buffer [0x14];
unkDungeonGlobal_unk1CE98_sub *temp;
UnkDungeonGlobal_unk1CE98_sub *temp;
u8 *id;
s32 param_0_s32 = param_0;
@@ -96,7 +96,7 @@ void sub_8083AB0(s16 param_0, Entity * target, Entity * entity)
bool8 sub_8083C24(void)
{
unkDungeonGlobal_unk1CE98_sub *temp;
UnkDungeonGlobal_unk1CE98_sub *temp;
temp = &gDungeon->unk1CE98;
@@ -110,7 +110,7 @@ bool8 sub_8083C24(void)
bool8 sub_8083C50(void)
{
unkDungeonGlobal_unk1CE98_sub *temp;
UnkDungeonGlobal_unk1CE98_sub *temp;
temp = &gDungeon->unk1CE98;
@@ -124,7 +124,7 @@ bool8 sub_8083C50(void)
bool8 sub_8083C88(u8 param_1)
{
unkDungeonGlobal_unk1CE98_sub *temp;
UnkDungeonGlobal_unk1CE98_sub *temp;
temp = &gDungeon->unk1CE98;

View File

@@ -25,7 +25,7 @@ u8 GetApparentWeather(Entity *pokemon)
void sub_807E5AC(void)
{
u8 weather;
weather = gDungeon->unk1C578;
weather = gDungeon->unk1C574.unk4;
if(weather == WEATHER_RANDOM)
weather = DungeonRandInt(WEATHER_RANDOM);
sub_807E5E4(weather);