Skip to content

Decompile overlay_01_021F3D38 - #495

Open
PikalaxALT wants to merge 8 commits into
pret:masterfrom
PikalaxALT:decomp/overlay_01_021F3D38
Open

Decompile overlay_01_021F3D38#495
PikalaxALT wants to merge 8 commits into
pret:masterfrom
PikalaxALT:decomp/overlay_01_021F3D38

Conversation

@PikalaxALT

@PikalaxALT PikalaxALT commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Must come after #490
Must come before #493

PR checklist

  • This comment contains a description of changes (with reason).
  • The ROM compiles to matching locally (make compare_heartgold && make compare_soulsilver).
  • All C code is correctly formatted (git clang-format).
  • This pull request is labeled according to the kind of work it represents.
  • New or updated code labels follow the style guide
  • This work adheres to the AI policy.
  • The author has joined the pret discord server and sent a message in #pokeheartgold to verify that they are human

@PikalaxALT PikalaxALT self-assigned this Jul 29, 2026
@PikalaxALT PikalaxALT mentioned this pull request Jul 29, 2026
7 tasks
Comment thread include/unk_02037C94.h Outdated
void sub_02039B7C(void);
BOOL sub_020392A0(void);
UnkStruct_ov44_0223197C* sub_020396FC(SaveData*, int);
UnkStruct_ov44_0223197C *sub_020396FC(SaveData *, int);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
UnkStruct_ov44_0223197C *sub_020396FC(SaveData *, int);
UnkStruct_ov44_0223197C *sub_020396FC(SaveData *saveData, int arg1);

Comment thread include/battle/battle_input.h Outdated
struct {
const s16 *screenOffsets;
void *unk8;
const TouchscreenHitbox *unk8;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const TouchscreenHitbox *unk8;
const TouchscreenHitbox *touchscreenHitbox;

Will need to be changed in the corresponding c file as well.

Comment thread include/overlay_42.h Outdated
void ov42_022279FC(UnkStruct_ov42_02227060 *arg0, s32 arg1, enum HeapID heapID);
void ov42_02227B04(UnkStruct_ov42_02227060 *arg0);
s32 ov42_02227B5C(SpriteResource **arg0);
BOOL ov42_02227B5C(SpriteResource **arg0);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
BOOL ov42_02227B5C(SpriteResource **arg0);
BOOL ov42_02227B5C(SpriteResource **spriteResources);

or is it pSpriteResource?

Comment thread src/encounter.c Outdated
static BOOL Task_BugContestEncounter(TaskManager *taskManager);
static BOOL Task_TutorialBattle(TaskManager *taskManager);
static u32 sub_02051474(void *param0, u32 battleType);
static u32 sub_02051474(LinkBattleRuleset *param0, u32 battleType);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
static u32 sub_02051474(LinkBattleRuleset *param0, u32 battleType);
static u32 sub_02051474(LinkBattleRuleset *ruleset, u32 battleType);

Comment thread src/encounter.c Outdated
}

static u32 sub_02051474(void *param0, u32 battleType) {
static u32 sub_02051474(LinkBattleRuleset *param0, u32 battleType) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
static u32 sub_02051474(LinkBattleRuleset *param0, u32 battleType) {
static u32 sub_02051474(LinkBattleRuleset *ruleset, u32 battleType) {

Comment thread src/overlay_44_02231A14.c
ov42_02228F94(arg0->unk6EC);
}

void ov44_02232248(UnkStruct_ov44_02232DA0 *arg0, enum HeapID arg1, NARC *arg2, s32 arg3) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
void ov44_02232248(UnkStruct_ov44_02232DA0 *arg0, enum HeapID arg1, NARC *arg2, s32 arg3) {
void ov44_02232248(UnkStruct_ov44_02232DA0 *arg0, enum HeapID heapID, NARC *narc_unused, s32 offset) {

Needs to be changed in the corresponding header file as well.

Comment thread src/overlay_44_02231A14.c
};

sp0.fileId += arg3;
arg0->unk6F4 = ov42_022293B8(&arg0->unk14.unk4, arg0->unk10, &sp0, arg1);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
arg0->unk6F4 = ov42_022293B8(&arg0->unk14.unk4, arg0->unk10, &sp0, arg1);
arg0->unk6F4 = ov42_022293B8(&arg0->unk14.unk4, arg0->unk10, &sp0, heapID);

Comment thread src/overlay_44_02231A14.c
.compressed = FALSE,
};

sp0.fileId += arg3;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sp0.fileId += arg3;
sp0.fileId += offset;

Comment thread include/dialog_box.h Outdated
u8 DialogBox_PrintMessage(Window *window, String *string, Options *options, BOOL speedupFlag);
u32 DialogBox_PrintMessageEx(Window *window, String *message, FontID fontId, u32 textSpeed, u8 speedUpEnabled, u32 autoScrollParam);
u8 DialogBox_IsPrintFinished(u8 printerId);
void DialogBox_AddWindowToLayer3WithXOffset(BgConfig *bgConfig, Window *window, u8 a2, GFBgLayer a3);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
void DialogBox_AddWindowToLayer3WithXOffset(BgConfig *bgConfig, Window *window, u8 a2, GFBgLayer a3);
void DialogBox_AddWindowToLayer3WithXOffset(BgConfig *bgConfig, Window *window, u8 type, GFBgLayer layer);

Comment thread include/field_system.h
@PikalaxALT
PikalaxALT requested a review from Pixelstyx July 31, 2026 00:04
@PikalaxALT
PikalaxALT marked this pull request as ready for review July 31, 2026 00:04

@Pixelstyx Pixelstyx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to actually give this a thumbs-up, I did the review earlier and didn't click submit.

@adrienntindall adrienntindall left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small thing that might be a bigger thing unless I misunderstood something

Comment thread include/scrcmd.h Outdated
Comment on lines +75 to +79
BOOL SetSignpostMap(ScriptContext *ctx);
BOOL SetSignpostAction(ScriptContext *ctx);
BOOL WaitSignpostAction(ScriptContext *ctx);
BOOL ScrCmd_TrainerTips(ScriptContext *ctx);
BOOL ScrCmd_060(ScriptContext *ctx);
BOOL WaitSignpost(ScriptContext *ctx);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add ScrCmd_ prefixes back

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait these are also defined in script_cmd_table.h, why do we have them twice?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...huh. never acknowledged that include/scrcmd.h existed. fixed.

@adrienntindall adrienntindall left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will merge on resolution of conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants