Skip to content

Decompile OAM and text functions#57

Draft
SpineSh4rk wants to merge 7 commits into
metroidret:mainfrom
SpineSh4rk:oam
Draft

Decompile OAM and text functions#57
SpineSh4rk wants to merge 7 commits into
metroidret:mainfrom
SpineSh4rk:oam

Conversation

@SpineSh4rk
Copy link
Copy Markdown
Contributor

Decompiles

and fixes a typo in the Kihunter functions.
./check_roms.sh returns OK

Comment thread src/text.c
* @param gfxSlot Graphics slot
* @param stage Stage
*/
void DisplayMessage(u8 gfxSlot, u8 stage)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The function is missing the Text prefix

Comment thread src/text.c
if (index)
index = sAbilityRamValues[index].messageNumber;
else
if ((u8)(gEquipment.securityHatchLevel - 1) < 4)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can change this to gEquipment.securityHatchLevel == 1 || gEquipment.securityHatchLevel == 2 || gEquipment.securityHatchLevel == 3 || gEquipment.securityHatchLevel == 4 it's more verbose but at least the values are clearer

Comment thread src/text.c
Comment on lines +107 to +108
else
if ((u8)(gEquipment.securityHatchLevel - 1) < 4)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can put the else and if on the same line

Comment thread src/text.c
Comment on lines +188 to +189
else
BitFill(3, 0, VRAM_BASE + 0x6000, 0x2000, 32);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Missing {} on the else for consistency with the linked else/ifs

Comment thread src/text.c
*
* @param action Type of clearing action
*/
void ClearTextGraphics(u8 action)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Missing Text prefix, you can swap Clear and Text

Comment thread src/new_file_intro.c
static u8 sBlob_79c5c0_79e6a0[] = INCBIN_U8("data/Blob_79c5c0_79e6a0.bin");
static u8 sBlob_79c5c0_79cdd8[] = INCBIN_U8("data/Blob_79c5c0_79cdd8.bin");

u16** sLocationTextPointers[LANGUAGE_COUNT] = {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Array should be const pointers

Comment thread src/new_file_intro.c
(u16**)0x879cd70
};

u16** sMessageTextPointers[LANGUAGE_COUNT] = {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Array should be const pointers

Comment thread src/new_file_intro.c
};

static u8 sBlob_79c5c0_79e6a0[] = INCBIN_U8("data/Blob_79c5c0_79e6a0.bin");
static u8 sBlob_79c5c0_79cdd8[] = INCBIN_U8("data/Blob_79c5c0_79cdd8.bin");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Array should be const

Comment thread src/new_file_intro.c
(u16**)0x879ccb0
};

static u8 sBlob_79ce10_79e6a0[] = INCBIN_U8("data/Blob_79ce10_79e6a0.bin");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Array should be const

@SpineSh4rk SpineSh4rk marked this pull request as draft May 24, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants