Skip to content

Commit

Permalink
Grossly complete rescue_password_menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Kermalis committed Jul 17, 2023
1 parent 4675abc commit 1ce7c46
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 108 deletions.
70 changes: 0 additions & 70 deletions asm/rescue_password_menu.s

This file was deleted.

9 changes: 5 additions & 4 deletions include/rescue_password_menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@

struct unkSprite
{
u16 unk208;
u16 unk20A;
u16 unk20C;
u16 unk20E;
u16 unk0;
u16 unk2;
u16 unk4;
u16 unk6;
};

// Similar to unkStruct_203B360
struct RescuePasswordMenu
{
// size: 0x214
Expand Down
2 changes: 0 additions & 2 deletions ld_script.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,6 @@ SECTIONS {
src/unk_menu_203B360.o(.text);
src/save_menu.o(.text);
src/rescue_password_menu.o(.text);
asm/rescue_password_menu.o(.text);
src/rescue_password_menu_1.o(.text);
src/load_screen.o(.text);
src/wonder_mail_main_menu.o(.text);
src/ds_menus.o(.text);
Expand Down
71 changes: 71 additions & 0 deletions src/rescue_password_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ bool8 sub_8095298(s32);
bool8 sub_803D204(u8 *, struct unkStruct_203B480 *);
extern s32 GetDungeonFloorCount(u8);

extern void AddSprite(struct unkSprite *, u32, u32, u32);
extern void xxx_draw_string_80144C4(void);


void CreateRescuePasswordMenu(u32 currMenu)
{
Expand Down Expand Up @@ -701,3 +704,71 @@ u32 sub_8039068(u32 mailMode, u8 *passwordBuffer, struct unkStruct_203B480 *para
return -1;
}
}

void sub_8039174(void)
{
u16 temp;
#ifndef NONMATCHING
register u32 r2 asm("r2");
#else
u32 r2; // r4 but should be r2
#endif //NONMATCHING
struct unkSprite* spr; // r2 but should be r3
u16 r4; // r3 but should be r4

spr = &gRescuePasswordMenu->unk208;

spr->unk0 &= ~0x100;
spr->unk0 &= ~0x200;
r4 = ~(0x800 | 0x400);
spr->unk0 &= r4;
spr->unk0 &= ~0x1000;
spr->unk0 &= ~0x2000;
r2 = 0x4000;
temp = 0x8000;
temp = ~(temp | 0x4000);
spr->unk0 &= temp;
spr->unk0 |= r2;

r2 = 0x200 | 0x100 | 0x80 | 0x40 | 0x20 | 0x10;
spr->unk4 &= ~(0x200 | 0x100 | 0x80 | 0x40 | 0x20 | 0x10 | 0x8 | 0x4 | 0x2 | 0x1);
spr->unk4 |= r2;
spr->unk4 &= r4;
r2 = 0x1 | 0x2 | 0x4 | 0x8;
r4 = 0x1000 | 0x2000 | 0x4000 | 0x8000;
temp = ~r4;
spr->unk4 &= temp;
spr->unk4 |= r4;

#ifndef NONMATCHING
while (0) ;
#endif //NONMATCHING
spr->unk2 = 0; // Without the while(0), this 0 is loaded super early and also into r3

temp = 0x800 | 0x400;
r2 &= spr->unk6;
r2 |= temp;
spr->unk6 = r2;
}

void sub_80391F8(void)
{
struct unkSprite *iVar2;
u32 temp;
u32 temp2;

iVar2 = &gRescuePasswordMenu->unk208;

temp = (iVar2->unk2 & 0xfe00);
iVar2->unk2 = temp | 0x70;

temp2 = 0x700;
temp = (iVar2->unk6 & 0xf);
iVar2->unk6 = temp | temp2;

if ((gRescuePasswordMenu->unk210 & 8) != 0) {
AddSprite(iVar2,0x100,0,0);
}
xxx_draw_string_80144C4();
gRescuePasswordMenu->unk210 += 1;
}
32 changes: 0 additions & 32 deletions src/rescue_password_menu_1.c

This file was deleted.

1 change: 1 addition & 0 deletions src/unk_menu_203B360.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ struct unkSprite
u16 unk6;
};

// Similar to RescuePasswordMenu
struct unkStruct_203B360
{
// size: 0x1b4
Expand Down

0 comments on commit 1ce7c46

Please sign in to comment.