Wonder mail Pt. 1 (#11)

Some work on decomping/labeling wonder mail. Renamed corresponding assembly/C files. Labeled a few strings in data too.
This commit is contained in:
Seth Barberee
2020-12-15 16:28:03 -06:00
committed by GitHub
parent 4a5c6cd7d3
commit f90f3affeb
7 changed files with 1555 additions and 1994 deletions

View File

@@ -1734,226 +1734,4 @@ _08028AFC: .4byte gUnknown_80DE93C
_08028B00: .4byte 0x0000010d
thumb_func_end sub_8028348
thumb_func_start sub_8028B04
sub_8028B04:
push {lr}
ldr r1, _08028B18
ldr r1, [r1]
str r0, [r1, 0x4]
bl nullsub_130
bl sub_8028348
pop {r0}
bx r0
.align 2, 0
_08028B18: .4byte gUnknown_203B2C0
thumb_func_end sub_8028B04
thumb_func_start sub_8028B1C
sub_8028B1C:
push {lr}
cmp r0, 0xF
bhi _08028BE0
lsls r0, 2
ldr r1, _08028B2C
adds r0, r1
ldr r0, [r0]
mov pc, r0
.align 2, 0
_08028B2C: .4byte _08028B30
.align 2, 0
_08028B30:
.4byte _08028BE0
.4byte _08028BA8
.4byte _08028BA8
.4byte _08028B70
.4byte _08028B78
.4byte _08028BA8
.4byte _08028B80
.4byte _08028B88
.4byte _08028BE0
.4byte _08028B90
.4byte _08028BE0
.4byte _08028B98
.4byte _08028BE0
.4byte _08028BA0
.4byte _08028BA8
.4byte _08028BCC
_08028B70:
ldr r0, _08028B74
b _08028BAA
.align 2, 0
_08028B74: .4byte gUnknown_80DE98C
_08028B78:
ldr r0, _08028B7C
b _08028BAA
.align 2, 0
_08028B7C: .4byte gUnknown_80DE9F0
_08028B80:
ldr r0, _08028B84
b _08028BAA
.align 2, 0
_08028B84: .4byte gUnknown_80DEA58
_08028B88:
ldr r0, _08028B8C
b _08028BAA
.align 2, 0
_08028B8C: .4byte gUnknown_80DEAB4
_08028B90:
ldr r0, _08028B94
b _08028BAA
.align 2, 0
_08028B94: .4byte gUnknown_80DEB18
_08028B98:
ldr r0, _08028B9C
b _08028BAA
.align 2, 0
_08028B9C: .4byte gUnknown_80DEB18
_08028BA0:
ldr r0, _08028BA4
b _08028BAA
.align 2, 0
_08028BA4: .4byte gUnknown_80DEB54
_08028BA8:
ldr r0, _08028BC0
_08028BAA:
ldr r1, _08028BC4
ldr r2, [r1]
movs r1, 0x84
lsls r1, 3
adds r2, r1
ldr r3, _08028BC8
movs r1, 0
bl sub_80141B4
b _08028BE0
.align 2, 0
_08028BC0: .4byte gUnknown_80DE954
_08028BC4: .4byte gUnknown_203B2C0
_08028BC8: .4byte 0x0000010d
_08028BCC:
ldr r0, _08028BE4
ldr r1, _08028BE8
ldr r2, [r1]
movs r1, 0x84
lsls r1, 3
adds r2, r1
ldr r3, _08028BEC
movs r1, 0
bl sub_80141B4
_08028BE0:
pop {r0}
bx r0
.align 2, 0
_08028BE4: .4byte gUnknown_80DEC00
_08028BE8: .4byte gUnknown_203B2C0
_08028BEC: .4byte 0x0000010d
thumb_func_end sub_8028B1C
thumb_func_start sub_8028BF0
sub_8028BF0:
push {lr}
sub sp, 0x4
mov r0, sp
bl sub_80144A4
cmp r0, 0
bne _08028CDA
ldr r2, _08028C20
ldr r0, [r2]
movs r1, 0x8
str r1, [r0, 0x40]
ldr r1, _08028C24
adds r0, r1
ldr r1, _08028C28
strh r1, [r0]
ldr r0, [sp]
cmp r0, 0xA
bhi _08028CDA
lsls r0, 2
ldr r1, _08028C2C
adds r0, r1
ldr r0, [r0]
mov pc, r0
.align 2, 0
_08028C20: .4byte gUnknown_203B2C0
_08028C24: .4byte 0x00000544
_08028C28: .4byte 0x0000ffff
_08028C2C: .4byte _08028C30
.align 2, 0
_08028C30:
.4byte _08028C5C
.4byte _08028C88
.4byte _08028CA2
.4byte _08028CCC
.4byte _08028CDA
.4byte _08028CDA
.4byte _08028CDA
.4byte _08028CDA
.4byte _08028CDA
.4byte _08028CDA
.4byte _08028CD4
_08028C5C:
ldr r0, [r2]
movs r1, 0x3
str r1, [r0, 0x40]
movs r1, 0xA7
lsls r1, 3
adds r0, r1
movs r1, 0
str r1, [r0]
bl sub_8095190
movs r1, 0x1
negs r1, r1
cmp r0, r1
beq _08028C80
movs r0, 0x8
bl sub_8028B04
b _08028CDA
_08028C80:
movs r0, 0x9
bl sub_8028B04
b _08028CDA
_08028C88:
movs r0, 0x2
bl sub_8095324
cmp r0, 0
beq _08028C9A
movs r0, 0x1E
bl sub_8028B04
b _08028CDA
_08028C9A:
movs r0, 0x1A
bl sub_8028B04
b _08028CDA
_08028CA2:
ldr r0, [r2]
movs r1, 0x4
str r1, [r0, 0x40]
movs r1, 0xA7
lsls r1, 3
adds r0, r1
movs r1, 0x2
str r1, [r0]
movs r0, 0x4
bl sub_8095324
cmp r0, 0
beq _08028CC4
movs r0, 0x29
bl sub_8028B04
b _08028CDA
_08028CC4:
movs r0, 0x2F
bl sub_8028B04
b _08028CDA
_08028CCC:
movs r0, 0xB
bl sub_8028B04
b _08028CDA
_08028CD4:
movs r0, 0x2
bl sub_8028B04
_08028CDA:
add sp, 0x4
pop {r0}
bx r0
thumb_func_end sub_8028BF0
.align 2,0

File diff suppressed because it is too large Load Diff

View File

@@ -2383,23 +2383,116 @@ gUnknown_80DD958: @ 80DD958
.global gUnknown_80DD970
gUnknown_80DD970: @ 80DD970
.incbin "baserom.gba", 0xDD970, 0x7C
@ replacing .incbin "baserom.gba", 0x000dd970, 0x7c
.4byte gWonderMailReceiveSOSMail
.byte 0x00, 0x00, 0x00, 0x00
.4byte gWonderMailLeaveForRescue
.byte 0x01, 0x00, 0x00, 0x00
.4byte gWonderMailSendAOKMail
.byte 0x02, 0x00, 0x00, 0x00
.4byte gWonderMailDeleteMail
.byte 0x03, 0x00, 0x00, 0x00
.4byte gWonderMailCancel
.byte 0x0a, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x0a, 0x00, 0x00, 0x00
.global gWonderMailCancel @ 80DD9A0
gWonderMailCancel:
.string "Cancel\0"
.align 2,0
.global gWonderMailDeleteMail @ 80DD9A8
gWonderMailDeleteMail:
.string "Delete Mail\0"
.align 2,0
.global gWonderMailSendAOKMail @ 80DD9B4
gWonderMailSendAOKMail:
.string "Send A-OK Mail\0"
.align 2,0
.global gWonderMailLeaveForResuce @ 80DD9C4
gWonderMailLeaveForRescue:
.string "Leave for Rescue\0"
.align 2,0
.global gWonderMailReceiveSOSMail @ 80DD9D8
gWonderMailReceiveSOSMail:
.string "Receive SOS Mail\0"
.align 2,0
.global gUnknown_80DD9EC
gUnknown_80DD9EC: @ 80DD9EC
.incbin "baserom.gba", 0xDD9EC, 0x5C
@ replacing .incbin "baserom.gba", 0x000dd9ec, 0x5c
.4byte gWonderMailDeleteSOSMail
.byte 0x05, 0x00, 0x00, 0x00
.4byte gWonderMailDeleteAOKMail
.byte 0x06, 0x00, 0x00, 0x00
.4byte gWonderMailDeleteAllMail
.byte 0x07, 0x00, 0x00, 0x00
.4byte gWonderMailCancel
.byte 0x0a, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x0a, 0x00, 0x00, 0x00
.global gWonderMailDeleteAllMail @ 80DDA14
gWonderMailDeleteAllMail:
.string "Delete All Mail\0"
.align 2,0
.global gWonderMailDeleteAOKMail @ 80DDA24
gWonderMailDeleteAOKMail:
.string "Delete A-OK Mail\0"
.align 2,0
.global gWonderMailDeleteSOSMail @ 80DDA38
gWonderMailDeleteSOSMail:
.string "Delete SOS Mail\0"
.align 2,0
.global gUnknown_80DDA48
gUnknown_80DDA48: @ 80DDA48
.incbin "baserom.gba", 0xDDA48, 0x1C
@ Menu that shows up when you enter an incorrect Wonder Mail Password
@ replacing .incbin "baserom.gba", 0x000dda48, 0x1c
.4byte gWonderMailYes
.byte 0x08, 0x00, 0x00, 0x00
.4byte gWonderMailCancel
.byte 0x0a, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x0a, 0x00, 0x00, 0x00
.global gWonderMailYes @ (80DDA60)
gWonderMailYes:
.string "Yes\0"
.align 2,0
.global gUnknown_80DDA64
gUnknown_80DDA64: @ 80DDA64
.incbin "baserom.gba", 0xDDA64, 0x1C
@ replacing .incbin "baserom.gba", 0x000dda64, 0x1c
.4byte gWonderMailYes
.byte 0x08, 0x00, 0x00, 0x00
.4byte gWonderMailNo
.byte 0x09, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x0a, 0x00, 0x00, 0x00
.global gWonderMailNo @ (80DDA7C)
gWonderMailNo:
.string "No\0"
.align 2,0
.global gUnknown_80DDA80
gUnknown_80DDA80: @ 80DDA80
.incbin "baserom.gba", 0xDDA80, 0x20
@ replacing .incbin "baserom.gba", 0x000dda80, 0x20
.4byte gWonderMailYes
.byte 0x08, 0x00, 0x00, 0x00
.4byte gWonderMailNo
.byte 0x09, 0x00, 0x00, 0x00
.4byte gWonderMailCancel
.byte 0x0a, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x0a, 0x00, 0x00, 0x00
.global gUnknown_80DDAA0
gUnknown_80DDAA0: @ 80DDAA0

View File

@@ -244,41 +244,41 @@ gUnknown_80DE93C:: @ 80DE93C
.string " Come again anytime!\0"
.align 2, 0
gUnknown_80DE954:: @ 80DE954
gWonderMailErrorText:: @ 80DE954
.string " ...Uh~2c no?\n"
.string "Something~27s not working right here...\0"
.align 2, 0
gUnknown_80DE98C:: @ 80DE98C
gWonderMailNumGBAsText:: @ 80DE98C
.string " ...Uh~2c no?\n"
.string "The number of GBA systems isn~27t right.\n"
.string "You~27d better try this again from the top.\0"
.align 2, 0
gUnknown_80DE9F0:: @ 80DE9F0
gWonderMailWrongModeText:: @ 80DE9F0
.string " ...Uh~2c no? You~27re not in the\n"
.string "same mode as your friend.\n"
.string "You~27d better try this again from the top.\0"
.align 2, 0
gUnknown_80DEA58:: @ 80DEA58
gWonderMailStorageFullText:: @ 80DEA58
.string " ...Uh~2c no?\n"
.string "Your storage space is stuffed full.\n"
.string "You~27d better make room and try again.\0"
.align 2, 0
gUnknown_80DEAB4:: @ 80DEAB4
gWonderMailDuplicateText:: @ 80DEAB4
.string " ...Uh~2c no? It looks like\n"
.string "you received this mail before.\n"
.string "You can~27t get the same mail twice. \0"
.align 2, 0
gUnknown_80DEB18:: @ 80DEB18
gWonderMailNotEligibleReceiveText:: @ 80DEB18
.string " ...Uh~2c no?\n"
.string "You~27re not eligible to receive this mail.\0"
.align 2, 0
gUnknown_80DEB54:: @ 80DEB54
gWonderMailNoRoomText:: @ 80DEB54
.string " ...Uh~2c no?\n"
.string "There~27s no room for you to \n"
.string "receive any more mail.#P"
@@ -287,24 +287,24 @@ gUnknown_80DEB54:: @ 80DEB54
.string "me again about receiving new mail.\0"
.align 2, 0
gUnknown_80DEC00:: @ 80DEC00
gWonderMailFriendErrorText:: @ 80DEC00
.string " ...Uh~2c no? Looks like your\n"
.string "friend didn~27t do what needed doing.\n"
.string "You~27d better do this again from the top.\0"
.align 2, 0
gUnknown_80DEC70:: @ 80DEC70
gWonderMailPasswordIncorrectText:: @ 80DEC70
.string " ...Uh~2c no?\n"
.string "This here password looks wrong.\n"
.string "Do you want to try that again?\0"
.align 2, 0
gUnknown_80DECC0:: @ 80DECC0
gWonderMailSOSPasswordIncorrectText:: @ 80DECC0
.string " ...Uh~2c no? This password~27s\n"
.string "not for any #CGSOS Mail#R.\0"
.align 2, 0
gUnknown_80DECFC:: @ 80DECFC
gWonderMailAOKMailReceivedText:: @ 80DECFC
.string ": I received the #CGSOS Mail#R.\n"
.string "Your adventure will be saved.\0"
.align 2, 0

View File

@@ -96,8 +96,8 @@ SECTIONS {
asm/code_801D760.o(.text);
src/code_8027C84_pre.o(.text);
asm/code_8027C84.o(.text);
src/code_8028DE8.o(.text);
asm/code_8028DE8.o(.text);
src/wonder_mail.o(.text);
asm/wonder_mail.o(.text);
asm/personality_test.o(.text);
src/personality_test.o(.text);
asm/code_803D110.o(.text);

View File

@@ -1,294 +0,0 @@
#include "global.h"
extern u32 sub_80144A4(s32 *r0);
extern void sub_8028B04(u32);
extern void sub_8011C28(u32);
extern void sub_8012574(u32);
extern u8 sub_8012600();
extern void sub_8012750();
extern void sub_8095240(u8);
extern void sub_809927C(u8);
extern u32 *gUnknown_203B2C0;
extern u8 sub_8030C20(u32);
extern u32 sub_8031050();
extern void sub_80310B4();
extern u32 sub_8095350();
void sub_8028CE0()
{
s32 temp;
if(sub_80144A4(&temp) != 0)
{
return;
}
sub_8028B04(3);
}
void sub_8028CFC()
{
s32 temp;
u32 temp2;
if(sub_80144A4(&temp) != 0)
{
return;
}
switch(sub_8031050())
{
case 2:
case 3:
temp2 = sub_8095350();
sub_80310B4();
if(temp2 != gUnknown_203B2C0[0xA8 << 1])
{
sub_8028B04(0x17);
}
else
{
sub_8028B04(0x19);
}
break;
default:
break;
}
}
void sub_8028D4C()
{
s32 temp;
if(sub_80144A4(&temp) != 0)
{
return;
}
gUnknown_203B2C0[0xA7 << 1] = temp;
switch((s32)gUnknown_203B2C0[0xA7 << 1])
{
case 5:
if(sub_8030C20(2) != 0)
{
sub_8028B04(12);
}
else
{
sub_8028B04(13);
}
break;
case 6:
if(sub_8030C20(4) != 0)
{
sub_8028B04(14);
}
else
{
sub_8028B04(15);
}
break;
case 7:
if(sub_8030C20(0) != 0)
{
sub_8028B04(16);
}
else
{
sub_8028B04(17);
}
break;
case 0xA:
sub_8028B04(1);
break;
default:
break;
}
}
void sub_8028DE8(u32 r0)
{
s32 temp;
if(sub_80144A4(&temp) != 0)
{
return;
}
sub_8028B04(r0);
}
void sub_8028E08()
{
s32 temp;
if(sub_80144A4(&temp) != 0)
{
return;
}
sub_8028B04(0x12);
}
void sub_8028E24()
{
s32 temp;
if(sub_80144A4(&temp) != 0)
{
return;
}
switch(temp)
{
case 0x8:
sub_8028B04(0x13);
break;
case 0xA:
sub_8028B04(1);
break;
default:
break;
}
}
void sub_8028E54()
{
s32 temp;
if(sub_80144A4(&temp) != 0)
{
return;
}
switch(temp)
{
case 0x8:
sub_8028B04(0x14);
break;
case 0xA:
sub_8028B04(1);
break;
default:
break;
}
}
void sub_8028E84()
{
s32 temp;
if(sub_80144A4(&temp) != 0)
{
return;
}
sub_8028B04(0x18);
sub_8011C28(1);
sub_8012574(0);
}
void sub_8028EAC()
{
s32 temp;
if(sub_80144A4(&temp) != 0)
{
return;
}
if(sub_8012600() == 0)
{
sub_8012750();
sub_8028B04(0x19);
}
}
void sub_8028ED4()
{
s32 temp;
if(sub_80144A4(&temp) != 0)
{
return;
}
if(temp == 8)
{
sub_8028B04(0xB);
}
else
{
switch(temp){
case 0x8:
sub_8028B04(0x2);
break;
case 0x9:
case 0xA:
sub_8028B04(0x2);
break;
default:
break;
}
}
}
void sub_8028F04()
{
s32 temp;
s32 counter;
if(sub_80144A4(&temp) != 0)
{
return;
}
for(counter = 0; counter <= 0x1F; counter++)
{
sub_8095240(counter);
}
sub_8028B04(0x15);
}
void sub_8028F30()
{
s32 temp;
if(sub_80144A4(&temp) != 0)
{
return;
}
sub_8028B04(0x16);
sub_8011C28(1);
sub_8012574(0);
}
void sub_8028F58()
{
s32 temp;
if(sub_80144A4(&temp) != 0)
{
return;
}
if(sub_8012600() == 0)
{
sub_8012750();
sub_8028B04(2);
}
}
void sub_8028F80()
{
s32 temp;
if(sub_80144A4(&temp) != 0)
{
return;
}
sub_809927C(gUnknown_203B2C0[0x86]);
gUnknown_203B2C0[335] = 1;
sub_8028B04(3);
}
void sub_8028FC0()
{
s32 temp;
if(sub_80144A4(&temp) != 0)
{
return;
}
sub_8028B04(1);
}

1444
src/wonder_mail.c Normal file

File diff suppressed because it is too large Load Diff