From 76bbd1bd9a420ae665c72850cdf8169132d2c9b0 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Fri, 13 Jun 2025 17:47:38 +0200 Subject: [PATCH] move friends data to C --- data/friend_rescue.s | 513 --------------------------------- include/menu_input.h | 8 +- include/string_format.h | 8 - ld_script.ld | 1 - src/data/code_80140DC.h | 13 - src/dungeon_8067A80.c | 13 +- src/dungeon_menu_recruitment.c | 19 +- src/dungeon_menu_team.c | 29 +- src/dungeon_message.c | 1 - src/dungeon_message_log.c | 32 +- src/friend_rescue.c | 436 +++++++++++++++++++++++----- src/menu_input.c | 40 +++ src/quick_save_write.c | 1 + src/save_write.c | 1 + src/string_format.c | 75 ++--- 15 files changed, 473 insertions(+), 717 deletions(-) delete mode 100644 data/friend_rescue.s delete mode 100644 src/data/code_80140DC.h diff --git a/data/friend_rescue.s b/data/friend_rescue.s deleted file mode 100644 index 4586c99a4..000000000 --- a/data/friend_rescue.s +++ /dev/null @@ -1,513 +0,0 @@ - .section .rodata - - .global gUnknown_80E2BE0 -gUnknown_80E2BE0: @ 80E2BE0 -.string "Your own Pokémon will not disappear\n" -.string "if you send it as a helper.\n" -.string "Will you send a helper to your friend?\0" -.align 2,0 - - .global gUnknown_80E2C48 -gUnknown_80E2C48: @ 80E2C48 -.string "Pick the Pokémon to be sent as a helper.\n" -.string "(Any hold item will not be sent.)\0" -.align 2,0 - - .global gUnknown_80E2C94 -gUnknown_80E2C94: @ 80E2C94 -.string "No Pokémon are in your Friend Areas.\n" -.string "What would you like to do?\0" -.align 2,0 - - .global gUnknown_80E2CD4 -gUnknown_80E2CD4: @ 80E2CD4 -.string "Is this Pokémon OK?\0" -.align 2,0 - - .global gUnknown_80E2CE8 -gUnknown_80E2CE8: @ 80E2CE8 -.string "Please choose the {COLOR CYAN_G}A-OK Mail{RESET} that should\n" -.string "be sent to your friend.\0" -.align 2,0 - - .global gUnknown_80E2D30 -gUnknown_80E2D30: @ 80E2D30 -.string "This {COLOR CYAN_G}A-OK Mail{RESET} will be sent.\n" -.string "Is that OK?\0" -.align 2,0 - - .global gUnknown_80E2D60 -gUnknown_80E2D60: @ 80E2D60 - .string "There is no {COLOR CYAN_G}A-OK Mail{RESET}.\0" - .align 2,0 - - .global gUnknown_80E2D7C -gUnknown_80E2D7C: @ 80E2D7C -.string "Connect the {COLOR CYAN_G}Game Link cable{RESET}.\n" -.string "When your friend is ready, begin\n" -.string "communication.\0" -.align 2,0 - - .global gUnknown_80E2DD0 -gUnknown_80E2DD0: @ 80E2DD0 -.string "{CENTER_ALIGN}Communicating...\n" -.string "{CENTER_ALIGN}Please wait with the power on.\n" -.string "{CENTER_ALIGN}To cancel, press {B_BUTTON}.\0" -.align 2,0 - - .global gUnknown_80E2E20 -gUnknown_80E2E20: @ 80E2E20 -.string "The GBA Game Pak will be written to.\n" -.string "Is that OK?\0" -.align 2,0 - - .global gUnknown_80E2E54 -gUnknown_80E2E54: @ 80E2E54 -.string "{CENTER_ALIGN}Reading from GBA Game Pak.\n" -.string "{CENTER_ALIGN}Do not remove the GBA Game Pak.\n" -.string "{CENTER_ALIGN}Please wait with the power on.\0" -.align 2,0 - - .global gUnknown_80E2EB4 -gUnknown_80E2EB4: @ 80E2EB4 -.string "{CENTER_ALIGN}Writing to GBA Game Pak.\n" -.string "{CENTER_ALIGN}Do not remove the GBA Game Pak.\n" -.string "{CENTER_ALIGN}Please wait with the power on.\0" -.align 2,0 - - .global gUnknown_80E2F14 -gUnknown_80E2F14: @ 80E2F14 -.string "There is no {COLOR CYAN_G}SOS Mail{RESET} on\n" -.string "the GBA Game Pak.\0" -.align 2,0 - - .global gUnknown_80E2F44 -gUnknown_80E2F44: @ 80E2F44 -.string "Please choose an {COLOR CYAN_G}SOS Mail{RESET}\n" -.string "on the GBA Game Pak.\0" -.align 2,0 - - .global gUnknown_80E2F78 -gUnknown_80E2F78: @ 80E2F78 -.string "Is it OK to accept this {COLOR CYAN_G}SOS Mail{RESET}?\0" -.align 2,0 - - .global gUnknown_80E2FA0 -gUnknown_80E2FA0: @ 80E2FA0 -.string "There is no more space for accepting\n" -.string "new mail.\n" -.string "You must delete old mail.\0" -.align 2,0 - - .global gUnknown_80E2FEC -gUnknown_80E2FEC: @ 80E2FEC -.string "The {COLOR CYAN_G}SOS Mail{RESET} has been received.\n" -.string "Your adventure will be saved.\0" -.align 2,0 - - .global gUnknown_80E3030 -gUnknown_80E3030: @ 80E3030 -.string "Please embark on your rescue mission\n" -.string "from the Pelipper Post Office. \0" -.align 2,0 - - .global gUnknown_80E3078 -gUnknown_80E3078: @ 80E3078 -.string "Please enter the {COLOR CYAN_G}SOS Mail password{RESET}.\0" -.align 2,0 - - .global gUnknown_80E30A4 -gUnknown_80E30A4: @ 80E30A4 -.string "Is it OK to send this {COLOR CYAN_G}Thank-You Mail{RESET}?\0" -.align 2,0 - - .global gUnknown_80E30D0 -gUnknown_80E30D0: @ 80E30D0 -.string "Please choose the {COLOR CYAN_G}Thank-You Mail{RESET} that\n" -.string "should be sent to your friend.\0" -.align 2,0 - - .global gUnknown_80E311C -gUnknown_80E311C: @ 80E311C -.string "Please enter the {COLOR CYAN_G}Thank-You Mail password{RESET}.\0" -.align 2,0 - - .global gUnknown_80E314C -gUnknown_80E314C: @ 80E314C -.string "The {COLOR CYAN_G}Thank-You Mail password{RESET} will be\n" -.string "shown.\0" -.align 2,0 - - .global gUnknown_80E317C -gUnknown_80E317C: @ 80E317C - .string "Your adventure will be saved.\0" - .align 2,0 - - .global gUnknown_80E319C -gUnknown_80E319C: @ 80E319C - .string "Steps will now be taken to receive the\n" - .string "{COLOR CYAN_G}Thank-You Mail{RESET}.\0" - .align 2,0 - - .global gUnknown_80E31D8 -gUnknown_80E31D8: @ 80E31D8 - .string "All preparations have been made.\0" - .align 2,0 - - .global gUnknown_80E31FC -gUnknown_80E31FC: @ 80E31FC - .string "The {COLOR CYAN_G}Thank-You Mail{RESET} was sent.\0" - .align 2,0 - - .global gUnknown_80E3220 -gUnknown_80E3220: @ 80E3220 - .string "You received the {COLOR CYAN_G}Thank-You Mail{RESET}.\0" - .align 2,0 - - .global gUnknown_80E3248 -gUnknown_80E3248: @ 80E3248 - .string "The {COLOR CYAN_G}Thank-You Mail{RESET} was sent.\n" - .string "Your adventure will be saved.\0" - .align 2,0 - - .global gUnknown_80E3288 -gUnknown_80E3288: @ 80E3288 - .string "Steps will now be taken to send your\n" - .string "{COLOR CYAN_G}Thank-You Mail{RESET}.\0" - .align 2,0 - - .global gUnknown_80E32C4 -gUnknown_80E32C4: @ 80E32C4 - .string "OK. You're good to go.\n" - .string "{COLOR YELLOW_N}%s{RESET}, I hope your sense of\n" - .string "gratitude reaches your friend.\0" - .align 2,0 - - .global gUnknown_80E331C -gUnknown_80E331C: @ 80E331C - .string "The item chosen here can't be exchanged\n" - .string "with anything else.\n" - .string "Are you sure this item is OK?\0" - .align 2,0 - - .global gUnknown_80E3378 -gUnknown_80E3378: @ 80E3378 - .string "Please choose the item to be sent.\0" - .align 2,0 - - .global gUnknown_80E339C -gUnknown_80E339C: @ 80E339C -.string "There are no items in storage.\n" -.string "What would you like to do?\0" -.align 2,0 - - .global gUnknown_80E33D8 -gUnknown_80E33D8: @ 80E33D8 -.string "Would you like to choose\n" -.string "a {COLOR CYAN_G}reward item{RESET} from storage and\n" -.string "send it with your mail?\0" -.align 2,0 - - .global gUnknown_80E3430 -gUnknown_80E3430: @ 80E3430 -.string "This mail already has an attached\n" -.string "{COLOR CYAN_G}reward item{RESET}.{EXTRA_MSG}Once an item has been chosen, it may not\n" -.string "be exchanged with another item.\0" -.align 2,0 - - .global gUnknown_80E34B0 -gUnknown_80E34B0: @ 80E34B0 -.string "Would you like to resend the mail\n" -.string "with the same item attached?\0" -.align 2,0 - - .global gUnknown_80E34F0 -gUnknown_80E34F0: @ 80E34F0 -.string "Please select a {COLOR CYAN_G}Thank-You Mail{RESET}\n" -.string "from the GBA Game Pak.\0" -.align 2,0 - - .global gUnknown_80E352C -gUnknown_80E352C: @ 80E352C - .string "Is it OK to accept this {COLOR CYAN_G}Thank-You Mail{RESET}?\0" - .align 2,0 - - .global gUnknown_80E355C -gUnknown_80E355C: @ 80E355C - .string "Mail can't be sent to a GBA Game Pak\n" - .string "with the game quicksaved in a dungeon.\0" - .align 2,0 - - .global gUnknown_80E35AC -gUnknown_80E35AC: @ 80E35AC - .string "The GBA Game Pak does not have\n" - .string "a {COLOR CYAN_G}Thank-You Mail{RESET} on it.\0" - .align 2,0 - - .global gUnknown_80E35E8 -gUnknown_80E35E8: @ 80E35E8 - .string "There is no {COLOR CYAN_G}Thank-You Mail{RESET}.\0" - .align 2,0 - - .global gUnknown_80E360C -gUnknown_80E360C: @ 80E360C - .string "How would you like to send\n" - .string "your {COLOR CYAN_G}Thank-You Mail{RESET}?\0" - .align 2,0 - - .global gUnknown_80E3644 -gUnknown_80E3644: @ 80E3644 - .string "How would you like to receive\n" - .string "the {COLOR CYAN_G}Thank-You Mail{RESET}?\0" - .align 2,0 - - .global gUnknown_80E367C -gUnknown_80E367C: @ 80E367C - .string "Read which Info?\0" - .align 2,0 - - .global gUnknown_80E3690 -gUnknown_80E3690: @ 80E3690 -.string "If your team is defeated and in need\n" -.string "of rescuing, send an {COLOR CYAN_G}SOS Mail{RESET}\n" -.string "to a friend.{EXTRA_MSG}Once you send your mail, you must wait\n" -.string "for your friend to send you\n" -.string "an {COLOR CYAN_G}A-OK Mail{RESET}.{EXTRA_MSG}If the {COLOR CYAN_G}A-OK Mail{RESET} arrives, your\n" -.string "team can be revived to resume exploring\n" -.string "the dungeon it was in.{EXTRA_MSG}When your team is revived, don't forget\n" -.string "to send a {COLOR CYAN_G}Thank-You Mail{RESET} to the friend\n" -.string "who came to your rescue.\0" -.align 2,0 - - .global gUnknown_80E3818 -gUnknown_80E3818: @ 80E3818 -.string "If your team is defeated in\n" -.string "a dungeon, you may send a friend\n" -.string "an {COLOR CYAN_G}SOS Mail{RESET} for help.{EXTRA_MSG}However, there are some places\n" -.string "where it is impossible for you to\n" -.string "call for a rescue.{EXTRA_MSG}Also, if you send an {COLOR CYAN_G}SOS Mail{RESET},\n" -.string "you may not continue with your\n" -.string "adventure while awaiting rescue.{EXTRA_MSG}If you cannot wait to be rescued,\n" -.string "you will have to give up and return\n" -.string "to your rescue team base.\0" -.align 2,0 - - .global gUnknown_80E3998 -gUnknown_80E3998: @ 80E3998 -.string "If your friend successfully rescues\n" -.string "your team, accept your friend's\n" -.string "{COLOR CYAN_G}A-OK Mail{RESET}.{EXTRA_MSG}Once the {COLOR CYAN_G}A-OK Mail{RESET} is received,\n" -.string "you may revive your team and resume\n" -.string "exploring the dungeon you were in.{EXTRA_MSG}Using a {COLOR CYAN_G}Game Link cable{RESET},\n" -.string "your friend can also send you\n" -.string "a {COLOR CYAN_G}helper Pokémon{RESET}.{EXTRA_MSG}However, the {COLOR CYAN_G}helper Pokémon{RESET} will not\n" -.string "be able to bring an item with it when\n" -.string "joining your team.\0" -.align 2,0 - - .global gUnknown_80E3B1C -gUnknown_80E3B1C: @ 80E3B1C -.string "If your team has been rescued, be sure\n" -.string "to send a {COLOR CYAN_G}Thank-You Mail{RESET} to the friend\n" -.string "that came to your help.{EXTRA_MSG}You may also attach a {COLOR CYAN_G}reward item{RESET}\n" -.string "from storage to your {COLOR CYAN_G}Thank-You Mail{RESET}\n" -.string "and send it to your friend.\0" -.align 2,0 - - .global gUnknown_80E3BF8 -gUnknown_80E3BF8: @ 80E3BF8 -.string "If your friend's team needs rescuing,\n" -.string "you must first receive an {COLOR CYAN_G}SOS Mail{RESET}\n" -.string "from your friend.{EXTRA_MSG}When you get the mail, you may embark\n" -.string "on your rescue mission from the\n" -.string "{COLOR CYAN_G}Pelipper Post Office{RESET}.{EXTRA_MSG}If you rescue your friend's defeated\n" -.string "team, send an {COLOR CYAN_G}A-OK Mail{RESET} to your\n" -.string "friend.{EXTRA_MSG}If you rescue a friend, you will be eligible\n" -.string "to receive a {COLOR CYAN_G}Thank-You Mail{RESET}.{EXTRA_MSG}If you have quicksaved inside a dungeon,\n" -.string "you may not choose {COLOR CYAN_G}Go Rescue{RESET}.\n" -.string "Your last save must be out of a dungeon.\0" -.align 2,0 - - .global gUnknown_80E3DE4 -gUnknown_80E3DE4: @ 80E3DE4 -.string "You may receive an {COLOR CYAN_G}SOS Mail{RESET} from\n" -.string "a friend's team that lies defeated in\n" -.string "a dungeon.{EXTRA_MSG}If there is no space for new mail, delete\n" -.string "old mail at the {COLOR CYAN_G}Pelipper Post Office{RESET}.\0" -.align 2,0 - - .global gUnknown_80E3E98 -gUnknown_80E3E98: @ 80E3E98 -.string "If you successfully rescue your friend's\n" -.string "team, send your friend an {COLOR CYAN_G}A-OK Mail{RESET}.{EXTRA_MSG}Using a {COLOR CYAN_G}Game Link cable{RESET}, you may\n" -.string "also send your friend a Pokémon from\n" -.string "your Friend Area as a helper.{EXTRA_MSG}Don't worry--sending a Pokémon as\n" -.string "a helper will not make it disappear from\n" -.string "its Friend Area.{EXTRA_MSG}If there is no space for new mail, delete\n" -.string "old mail at the {COLOR CYAN_G}Pelipper Post Office{RESET}.\0" -.align 2,0 - - .global gUnknown_80E4014 -gUnknown_80E4014: @ 80E4014 -.string "When you receive an {COLOR CYAN_G}SOS Mail{RESET},\n" -.string "you may embark on your rescue mission\n" -.string "from the {COLOR CYAN_G}Pelipper Post Office{RESET}.{EXTRA_MSG}Beware--if you do not have access to\n" -.string "the dungeon they are in, you may not go\n" -.string "on a rescue mission there.{EXTRA_MSG}Accept challenging rescues only\n" -.string "if you are ready and qualified!\0" -.align 2,0 - - .global gUnknown_80E4130 -gUnknown_80E4130: @ 80E4130 -.string "If you send an {COLOR CYAN_G}A-OK Mail{RESET}, you may\n" -.string "receive a {COLOR CYAN_G}Thank-You Mail{RESET} in return\n" -.string "from your friend.{EXTRA_MSG}The {COLOR CYAN_G}Thank-You Mail{RESET} may also come\n" -.string "with a {COLOR CYAN_G}reward item{RESET} attached.\0" -.align 2,0 - - .global gUnknown_80E41DC -gUnknown_80E41DC: @ 80E41DC -.string "Using the {COLOR CYAN_G}Dual Slot{RESET} function,\n" -.string "you may perform rescue operations with\n" -.string "friends using the GBA Game Pak version.{EXTRA_MSG}Insert the DS Game Card and the GBA\n" -.string "Game Pak in your Nintendo DS system,\n" -.string "then turn on the power.{EXTRA_MSG}Friend Rescue missions using\n" -.string "the {COLOR CYAN_G}Dual Slot{RESET} function will be\n" -.string "available on the main menu. \0" -.align 2,0 - - .global gUnknown_80E4314 -gUnknown_80E4314: @ 80E4314 -.string "Friends can rescue each other's defeated\n" -.string "teams using a {COLOR CYAN_G}Game Link cable{RESET},\n" -.string "{COLOR CYAN_G}passwords{RESET}, and so on.{EXTRA_MSG}You may go on a rescue mission to save\n" -.string "your friend's team that has been defeated\n" -.string "in a dungeon.{EXTRA_MSG}Or, you may call for help from a friend\n" -.string "to save your fallen team in a dungeon.{EXTRA_MSG}Using {COLOR CYAN_G}passwords{RESET}, you can even\n" -.string "exchange help with faraway friends.\0" -.align 2,0 - - - .global gUnknown_80E4480 -gUnknown_80E4480: @ 80E4480 - .string "There was a communication error.\0" - .align 2,0 - - .global gUnknown_80E44A4 -gUnknown_80E44A4: @ 80E44A4 -.string "An incorrect number of GBA systems are\n" -.string "connected.\n" -.string "Please redo this process from the start.\0" -.align 2,0 - - .global gUnknown_80E4500 -gUnknown_80E4500: @ 80E4500 -.string "There is no response from your friend.\n" -.string "Please redo this process from the start.\0" -.align 2,0 - - .global gUnknown_80E4550 -gUnknown_80E4550: @ 80E4550 -.string "The sender and receiver appear to be\n" -.string "in different modes.\n" -.string "Please redo the process from the start.\0" -.align 2,0 - - .global gUnknown_80E45B4 -gUnknown_80E45B4: @ 80E45B4 -.string "Your storage space is full.\n" -.string "Please make room, then redo the\n" -.string "process from the start.\0" -.align 2,0 - - .global gUnknown_80E460C -gUnknown_80E460C: @ 80E460C -.string "This mail has been received before.\n" -.string "It cannot be received again.\0" -.align 2,0 - - .global gUnknown_80E4650 -gUnknown_80E4650: @ 80E4650 -.string "This mail has been sent already.\n" -.string "It cannot be sent again.\0" -.align 2,0 - - .global gUnknown_80E468C -gUnknown_80E468C: @ 80E468C -.string "You do not appear eligible to receive\n" -.string "this {COLOR CYAN_G}A-OK Mail{RESET}.\0" -.align 2,0 - - .global gUnknown_80E46C8 -gUnknown_80E46C8: @ 80E46C8 -.string "Your friend is not eligible to receive\n" -.string "this {COLOR CYAN_G}A-OK Mail{RESET}.\0" -.align 2,0 - - .global gUnknown_80E4704 -gUnknown_80E4704: @ 80E4704 -.string "You do not appear eligible to receive\n" -.string "this {COLOR CYAN_G}Thank-You Mail{RESET}.\0" -.align 2,0 - - .global gUnknown_80E4744 -gUnknown_80E4744: @ 80E4744 -.string "Your friend is not eligible to receive\n" -.string "this {COLOR CYAN_G}Thank-You Mail{RESET}.\0" -.align 2,0 - - .global gUnknown_80E4788 -gUnknown_80E4788: @ 80E4788 -.string "Something went wrong.\n" -.string "Please turn off the power and\n" -.string "reinsert the GBA Game Pak.\0" -.align 2,0 - - .global gUnknown_80E47D8 -gUnknown_80E47D8: @ 80E47D8 -.string "There is no space for receiving new\n" -.string "mail.\n" -.string "Please delete old mail, then try again.\0" -.align 2,0 - - .global gUnknown_80E482C -gUnknown_80E482C: @ 80E482C -.string "There is no response from your friend.\n" -.string "Please make sure the sender and receiver\n" -.string "are ready, then redo this from the start.\0" -.align 2,0 - - .global gUnknown_80E48A8 -gUnknown_80E48A8: @ 80E48A8 -.string "This password is incorrect.\n" -.string "Would you like to enter it again?\0" -.align 2,0 - - .global gUnknown_80E48E8 -gUnknown_80E48E8: @ 80E48E8 -.string "This password does not appear to be\n" -.string "that of an {COLOR CYAN_G}SOS Mail{RESET}.\0" -.align 2,0 - - .global gUnknown_80E4928 -gUnknown_80E4928: @ 80E4928 -.string "Received the {COLOR CYAN_G}SOS Mail{RESET}.\n" -.string "Your adventure will be saved.\0" -.align 2,0 - - .global gUnknown_80E4964 -gUnknown_80E4964: @ 80E4964 -.string "This password does not appear to be\n" -.string "an {COLOR CYAN_G}A-OK Mail{RESET}.\0" -.align 2,0 - - .global gUnknown_80E499C -gUnknown_80E499C: @ 80E499C -.string "This password can no longer be used.\0" -.align 2,0 - - .global gUnknown_80E49C4 -gUnknown_80E49C4: @ 80E49C4 -.string "This password does not appear to be\n" -.string "that of a {COLOR CYAN_G}Thank-You Mail{RESET}.\0" -.align 2,0 diff --git a/include/menu_input.h b/include/menu_input.h index 039398785..9b1e7381c 100644 --- a/include/menu_input.h +++ b/include/menu_input.h @@ -38,7 +38,6 @@ bool8 MenuCursorUpdateOnlyLeftRight(MenuInputStruct *param_1); void MenuUpdatePagesData(MenuInputStruct * param_1); void AddMenuCursorSprite_(MenuInputStruct *, u8 *); void GetTouchScreenMenuInput(TouchScreenMenuInput *touchScreen, s32 a1); - void sub_8013AA0(unkStructFor8013AA0 *); u32 sub_8013BBC(unkStructFor8013AA0 *); void sub_8013C68(unkStructFor8013AA0 *); @@ -46,6 +45,13 @@ void sub_8013D10(unkStructFor8013AA0 *); void sub_8013E54(void); void sub_8013F84(void); void sub_80140B4(WindowTemplates *); +void sub_80140DC(void); +void sub_80140F8(void); +void sub_8014114(void); + +#define TOUCH_SCREEN_ARROW_UP_PRESS 1 +#define TOUCH_SCREEN_ARROW_DOWN_PRESS 2 +u32 GetTouchScreenArrowPress(s32 a0, const void *a1); #define GET_CURRENT_MENU_ENTRY(menuInput)((menuInput.currPage * menuInput.entriesPerPage) + menuInput.menuIndex) diff --git a/include/string_format.h b/include/string_format.h index 3e25e36dc..0a5e1770c 100644 --- a/include/string_format.h +++ b/include/string_format.h @@ -7,14 +7,6 @@ #include "structs/str_mon_portrait.h" #include "structs/str_text.h" -// TODO: once the files close to string_format.c are decompiled, check if these should be included here. Most likely, they should be declared elsewhere. -// code_80130A8.s -void sub_80140DC(void); -void sub_8014114(void); -s32 sub_80144A4(s32 *); -u32 sub_80154F0(void); -void sub_80155F0(void); - #define FORMAT_BUFFER_LEN 80 #define FRIEND_AREA_BUFFER_LEN 184 diff --git a/ld_script.ld b/ld_script.ld index 75966b742..b9cc29a9d 100755 --- a/ld_script.ld +++ b/ld_script.ld @@ -527,7 +527,6 @@ SECTIONS { src/code_8031D70.o(.rodata); src/adventure_log.o(.rodata); src/friend_rescue.o(.rodata); - data/friend_rescue.o(.rodata); data/credits1.o(.rodata); src/credits2.o(.rodata); src/main_menu1.o(.rodata); diff --git a/src/data/code_80140DC.h b/src/data/code_80140DC.h deleted file mode 100644 index a19639132..000000000 --- a/src/data/code_80140DC.h +++ /dev/null @@ -1,13 +0,0 @@ -const MenuItem gUnknown_80D485C[] = -{ - {_("*Yes"), 1}, - {_("No"), 0}, - {NULL, -1} -}; - -const MenuItem gUnknown_80D4880[] = -{ - {_("Yes"), 1}, - {_("*No"), 0}, - {NULL, -1} -}; \ No newline at end of file diff --git a/src/dungeon_8067A80.c b/src/dungeon_8067A80.c index 449adafbd..609e02600 100644 --- a/src/dungeon_8067A80.c +++ b/src/dungeon_8067A80.c @@ -43,7 +43,6 @@ extern void sub_8068344(void); bool8 CanSubMenuItemBeChosen(s32 param_1); void sub_8068310(s32 n, PokemonStruct1 **monPtrs); void sub_8067F00(u8 a0, PokemonStruct1 **a1, s32 a2, s32 a3, s32 a4); -u32 sub_8014140(s32 a0, const void *a1); void sub_8083D1C(void); void PlayDungeonConfirmationSE(void); void PlayDungeonCancelSE(void); @@ -60,7 +59,7 @@ static EWRAM_DATA s32 gUnknown_202F30C = 0; static EWRAM_DATA s32 gUnknown_202F310 = 0; // It's likely a struct only used in Blue version. Touchpad maybe? -static const u8 gUnknown_8106DA4[] = { +static const u8 sTouchScreenArrowPressData[] = { 0x01, 0, 0x38, 0, 0, 0, 0x18, 0, 0x18, 0, 0, 0, 0x02, 0, 0x38, 0, 0x68, 0, 0x18, 0, 0x18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -135,7 +134,7 @@ void sub_8067A80(u8 a0, s32 a1, s32 a2, PokemonStruct1 **a3) ResetTouchScreenMenuInput(&gDungeonMenu.touchScreen); sub_80137B0(&gDungeonMenu, 0); while (1) { - s32 r4; + s32 touchScreenArrow; AddMenuCursorSprite(&gDungeonMenu); r5 = 0; @@ -149,9 +148,9 @@ void sub_8067A80(u8 a0, s32 a1, s32 a2, PokemonStruct1 **a3) sub_8068344(); } - r4 = sub_8014140(0, gUnknown_8106DA4); + touchScreenArrow = GetTouchScreenArrowPress(0, sTouchScreenArrowPressData); DungeonRunFrameActions(0x37); - if (r4 == 2 && r5) { + if (touchScreenArrow == TOUCH_SCREEN_ARROW_DOWN_PRESS && r5) { if (a2 - gUnknown_202F30C > 8) { s32 i; for (i = 0; i < 6; i++) { @@ -182,7 +181,7 @@ void sub_8067A80(u8 a0, s32 a1, s32 a2, PokemonStruct1 **a3) MoveMenuCursorDownWrapAround(&gDungeonMenu, 0); } - if (r4 == 1 && r7 != 0) { + if (touchScreenArrow == TOUCH_SCREEN_ARROW_UP_PRESS && r7 != 0) { if (gUnknown_202F30C != 0) { s32 i; for (i = 0; i < 6; i++) { @@ -450,7 +449,7 @@ void sub_806806C(PokemonStruct1 *a0) } } - r5 = sub_8014140(0, gUnknown_8106DA4); + r5 = GetTouchScreenArrowPress(0, sTouchScreenArrowPressData); DungeonRunFrameActions(0x1C); if ((gRealInputs.pressed & DPAD_RIGHT) || gDungeonMenu.touchScreen.dpad_right) { PlayDungeonCursorSE(0); diff --git a/src/dungeon_menu_recruitment.c b/src/dungeon_menu_recruitment.c index 46ae7247a..9df05780c 100644 --- a/src/dungeon_menu_recruitment.c +++ b/src/dungeon_menu_recruitment.c @@ -22,7 +22,6 @@ extern void PlayDungeonCancelSE(void); extern void PlayDungeonConfirmationSE(void); extern bool8 CanSubMenuItemBeChosen(s32 param_1); extern u16 GetLeaderActionId(void); -extern u32 sub_8014140(s32 a0, const void *a1); extern u8 sub_806F9BC(s32); extern bool8 sub_80860A8(u8 id); extern bool8 sub_806A564(s32 r0); @@ -78,7 +77,7 @@ static const WindowTemplates sRecruitmentSearchWindows = { } }; -static const u8 gUnknown_8106D68[] = {1, 0, 56, 0, 0, 0, 24, 0, 24, 0, 0, 0, 2, 0, 56, 0, 104, 0, 24, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +static const u8 sTouchScreenArrowPressData[] = {1, 0, 56, 0, 0, 0, 24, 0, 24, 0, 0, 0, 2, 0, 56, 0, 104, 0, 24, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; void ShowRecruitmentSearchMenu(void) { @@ -117,15 +116,15 @@ void ShowRecruitmentSearchMenu(void) gDungeonMenu.leftRightArrowsPos.y = ((gWindows[0].y + 1) * 8) - 2; while (1) { - s32 unkVar; + s32 touchScreenArrow; bool8 scroll = FALSE; sScrollFlags = 0; - unkVar = sub_8014140(0, gUnknown_8106D68); - if (TryScrollUp(currTabData, unkVar)) { + touchScreenArrow = GetTouchScreenArrowPress(0, sTouchScreenArrowPressData); + if (TryScrollUp(currTabData, touchScreenArrow)) { scroll = TRUE; } - if (TryScrollDown(currTabData, unkVar)) { + if (TryScrollDown(currTabData, touchScreenArrow)) { scroll = TRUE; } @@ -199,7 +198,7 @@ static void PrintAvailableMons(struct MonRecruitList *tabData, s32 tabId) sub_80073E0(0); } -static bool8 TryScrollUp(struct MonRecruitList *tabData, s32 a1) +static bool8 TryScrollUp(struct MonRecruitList *tabData, s32 touchScreenArrow) { s32 i; u8 text[64]; @@ -209,7 +208,7 @@ static bool8 TryScrollUp(struct MonRecruitList *tabData, s32 a1) menuMonId--; sScrollFlags |= FLAG_CAN_SCROLL_UP; - if (!(gRealInputs.repeated & DPAD_UP) && a1 != 1) { + if (!(gRealInputs.repeated & DPAD_UP) && touchScreenArrow != TOUCH_SCREEN_ARROW_UP_PRESS) { return FALSE; } else { @@ -230,7 +229,7 @@ static bool8 TryScrollUp(struct MonRecruitList *tabData, s32 a1) } } -static bool8 TryScrollDown(struct MonRecruitList *tabData, s32 a1) +static bool8 TryScrollDown(struct MonRecruitList *tabData, s32 touchScreenArrow) { s32 i; u8 text[64]; @@ -240,7 +239,7 @@ static bool8 TryScrollDown(struct MonRecruitList *tabData, s32 a1) return FALSE; sScrollFlags |= FLAG_CAN_SCROLL_DOWN; - if (!(gRealInputs.repeated & DPAD_DOWN) && a1 != 2) { + if (!(gRealInputs.repeated & DPAD_DOWN) && touchScreenArrow != TOUCH_SCREEN_ARROW_DOWN_PRESS) { return FALSE; } else { diff --git a/src/dungeon_menu_team.c b/src/dungeon_menu_team.c index 3e8670944..59cbc58bf 100644 --- a/src/dungeon_menu_team.c +++ b/src/dungeon_menu_team.c @@ -107,7 +107,6 @@ extern void sub_8045064(void); extern void sub_8070968(u8 *buffer, EntityInfo *entityInfo, s32 colorNum); extern bool8 CanLeaderSwitch(u8 dungeon); extern void GetAvailTacticsforLvl(u8 *tacticsBuffer, s32 pokeLevel); -extern u32 sub_8014140(s32 a0, const void *a1); extern char* sub_808E4FC(s32 a1); extern char* sub_808E51C(s32 a1); extern void sub_8045C18(u8 *buffer, Item *item); @@ -154,7 +153,7 @@ static void PrintItemNameOnBottomWindow(Entity *entity); static void ResetDungeonMenu(void); // Struct only used in Blue maybe? -static const u8 gUnknown_8106B8C[] = {1, 0, 56, 0, 0, 0, 24, 0, 24, 0, 0, 0, 2, 0, 56, 0, 104, 0, 24, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +static const u8 sTouchScreenArrowPressData[] = {1, 0, 56, 0, 0, 0, 24, 0, 24, 0, 0, 0, 2, 0, 56, 0, 104, 0, 24, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; bool8 ShowDungeonTeamMenu(Entity *a0) { @@ -840,30 +839,30 @@ void ShowDungeonSummaryOrIQMenu(ActionContainer *a0, bool8 showIq) } while (1) { - s32 unkVar; - bool8 r5, r6; + s32 touchScreenArrow; + bool8 downArrowShown, upArrowShown; AddMenuCursorSprite(&gDungeonMenu); - unkVar = sub_8014140(0, gUnknown_8106B8C); - r5 = FALSE; - r6 = FALSE; + touchScreenArrow = GetTouchScreenArrowPress(0, sTouchScreenArrowPressData); + downArrowShown = FALSE; + upArrowShown = FALSE; if (hasIqSkills) { if (unkInfoTabStruct.unk0[8] != 0) { - r5 = TRUE; + downArrowShown = TRUE; ShowDownArrowSprite(); } if (monSummaryInfo.unk40 != 0) { - r6 = TRUE; + upArrowShown = TRUE; ShowUpArrowSprite(); } } if (hasStatusProblems) { if (unkInfoTabStruct.unkC[8] != 0) { - r5 = TRUE; + downArrowShown = TRUE; ShowDownArrowSprite(); } if (monSummaryInfo.unk56 != 0) { - r6 = TRUE; + upArrowShown = TRUE; ShowUpArrowSprite(); } } @@ -892,7 +891,7 @@ void ShowDungeonSummaryOrIQMenu(ActionContainer *a0, bool8 showIq) } if (hasStatusProblems) { - if (unkVar == 2 && r5) { + if (touchScreenArrow == TOUCH_SCREEN_ARROW_DOWN_PRESS && downArrowShown) { PlayDungeonCursorSE(0); if (unkInfoTabStruct.unkC[8] != 0) { s32 i; @@ -924,7 +923,7 @@ void ShowDungeonSummaryOrIQMenu(ActionContainer *a0, bool8 showIq) } } - if (unkVar == 1 && r6) { + if (touchScreenArrow == TOUCH_SCREEN_ARROW_UP_PRESS && upArrowShown) { if (monSummaryInfo.unk56 != 0) { s32 i; for (i = 0; i < 6; i++) { @@ -956,7 +955,7 @@ void ShowDungeonSummaryOrIQMenu(ActionContainer *a0, bool8 showIq) } } else if (hasIqSkills) { - if (unkVar == 2 && r5) { + if (touchScreenArrow == TOUCH_SCREEN_ARROW_DOWN_PRESS && downArrowShown) { if (unkInfoTabStruct.unk0[8] != 0) { s32 i; for (i = 0; i < 6; i++) { @@ -987,7 +986,7 @@ void ShowDungeonSummaryOrIQMenu(ActionContainer *a0, bool8 showIq) } } - if (unkVar == 1 && r6) { + if (touchScreenArrow == TOUCH_SCREEN_ARROW_UP_PRESS && upArrowShown) { if (monSummaryInfo.unk40 != 0) { s32 i; for (i = 0; i < 6; i++) { diff --git a/src/dungeon_message.c b/src/dungeon_message.c index 57d335fbc..66855bc2e 100644 --- a/src/dungeon_message.c +++ b/src/dungeon_message.c @@ -35,7 +35,6 @@ static void DisplayMessageAddToLog(Entity *pokemon, const u8 *str, bool8 r2); extern bool8 sub_8045888(Entity *pokemon); extern void sub_805E804(void); extern void sub_8083E28(void); -extern u32 sub_8014140(s32 a0, const void *a1); extern void PlayDungeonCancelSE(void); extern void PlayDungeonConfirmationSE(void); diff --git a/src/dungeon_message_log.c b/src/dungeon_message_log.c index 98687cd9d..d69de2112 100644 --- a/src/dungeon_message_log.c +++ b/src/dungeon_message_log.c @@ -19,7 +19,7 @@ extern bool8 sub_8045888(Entity *pokemon); extern void sub_805E804(void); extern void sub_8083E28(void); -extern u32 sub_8014140(s32 a0, const void *a1); +extern u32 GetTouchScreenArrowPress(s32 a0, const void *a1); extern void PlayDungeonCancelSE(void); extern void PlayDungeonConfirmationSE(void); @@ -49,7 +49,7 @@ void ResetMessageLog(void) } // Unused in Red, used in Blue -void sub_8053200(void) +UNUSED static void sub_8053200(void) { gDungeon->unkB = 1; } @@ -79,8 +79,8 @@ void CopyStringToMessageLog(const u8 *src, u32 a1, u32 a2) } // Possibly something menu related? -// Unfortunately, this is passed to sub_8014140 which is a nullsub. It could be used for Blue and Nintendo DS' touch screen. -static const u8 sUnknownMessageLogData[] = +// Unfortunately, this is passed to GetTouchScreenArrowPress which is a nullsub. It could be used for Blue and Nintendo DS' touch screen. +static const u8 sTouchScreenArrowPressData[] = { 0x01, 0x00, 0x54, 0x00, 0xf0, 0xff, 0x18, 0x00, 0x18, 0x00, 0x00, 0x00, 0x02, 0x00, 0x54, 0x00, 0x6a, 0x00, 0x18, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -90,9 +90,9 @@ static const u8 sUnknownMessageLogData[] = bool32 DisplayMessageLog(void) { bool8 unkRet; - TouchScreenMenuInput menuInput; + TouchScreenMenuInput touchScreenInput; - ResetTouchScreenMenuInput(&menuInput); + ResetTouchScreenMenuInput(&touchScreenInput); sub_803EAF0(9, NULL); do { DungeonRunFrameActions(13); @@ -104,16 +104,16 @@ bool32 DisplayMessageLog(void) PutStringsOnMessageLog(); while (1) { - s32 unkVar; + s32 touchScreenArrow; bool32 scroll = FALSE; sMessageLogFlags = 0; - GetTouchScreenMenuInput(&menuInput, 0); - unkVar = sub_8014140(0, sUnknownMessageLogData); + GetTouchScreenMenuInput(&touchScreenInput, 0); + touchScreenArrow = GetTouchScreenArrowPress(0, sTouchScreenArrowPressData); - if (TryScrollLogUp(unkVar)) + if (TryScrollLogUp(touchScreenArrow)) scroll = TRUE; - if (TryScrollLogDown(unkVar)) + if (TryScrollLogDown(touchScreenArrow)) scroll = TRUE; if (!scroll) { @@ -128,7 +128,7 @@ bool32 DisplayMessageLog(void) } if (!sub_80048C8()) { - if (gRealInputs.pressed & B_BUTTON || menuInput.b_button) { + if (gRealInputs.pressed & B_BUTTON || touchScreenInput.b_button) { PlayDungeonCancelSE(); break; } @@ -172,7 +172,7 @@ static void PutStringsOnMessageLog(void) sub_8007334(0); } -static bool8 TryScrollLogUp(s32 a0) +static bool8 TryScrollLogUp(s32 touchScreenArrow) { s32 i; struct MessageLogString *msgLogString; @@ -195,7 +195,7 @@ static bool8 TryScrollLogUp(s32 a0) sMessageLogFlags |= FLAG_CAN_SCROLL_UP; if (gRealInputs.repeated & DPAD_UP) break; - if (a0 == 1) + if (touchScreenArrow == TOUCH_SCREEN_ARROW_UP_PRESS) break; } @@ -223,7 +223,7 @@ static bool8 TryScrollLogUp(s32 a0) return TRUE; } -static bool8 TryScrollLogDown(s32 a0) +static bool8 TryScrollLogDown(s32 touchScreenArrow) { s32 i; struct MessageLogString *msgLogString; @@ -245,7 +245,7 @@ static bool8 TryScrollLogDown(s32 a0) sMessageLogFlags |= FLAG_CAN_SCROLL_DOWN; if (gRealInputs.repeated & DPAD_DOWN) break; - if (a0 == 2) + if (touchScreenArrow == TOUCH_SCREEN_ARROW_DOWN_PRESS) break; } diff --git a/src/friend_rescue.c b/src/friend_rescue.c index 55b0c4040..1a2f345ef 100644 --- a/src/friend_rescue.c +++ b/src/friend_rescue.c @@ -136,83 +136,365 @@ ALIGNED(4) const u8 gUnknown_80E2B90[] = _( "you can send a {COLOR CYAN_G}helper Pokémon{RESET} to\n" "a friend."); -extern u8 gUnknown_80E2BE0[]; -extern u8 gUnknown_80E2C48[]; -extern u8 gUnknown_80E2C94[]; -extern u8 gUnknown_80E2CD4[]; -extern u8 gUnknown_80E2CE8[]; -extern u8 gUnknown_80E2D30[]; -extern u8 gUnknown_80E2D60[]; -extern u8 gUnknown_80E2D7C[]; -extern u8 gUnknown_80E2DD0[]; -extern u8 gUnknown_80E2E20[]; -extern u8 gUnknown_80E2E54[]; -extern u8 gUnknown_80E2EB4[]; -extern u8 gUnknown_80E2F14[]; -extern u8 gUnknown_80E2F44[]; -extern u8 gUnknown_80E2F78[]; -extern u8 gUnknown_80E2FA0[]; -extern u8 gUnknown_80E2FEC[]; -extern u8 gUnknown_80E3030[]; -extern u8 gUnknown_80E3078[]; -extern u8 gUnknown_80E30A4[]; -extern u8 gUnknown_80E30D0[]; -extern u8 gUnknown_80E311C[]; -extern u8 gUnknown_80E314C[]; -extern u8 gUnknown_80E317C[]; -extern u8 gUnknown_80E319C[]; -extern u8 gUnknown_80E31D8[]; -extern u8 gUnknown_80E31FC[]; -extern u8 gUnknown_80E31FC[]; -extern u8 gUnknown_80E3220[]; -extern u8 gUnknown_80E3248[]; -extern u8 gUnknown_80E3288[]; -extern u8 gUnknown_80E32C4[]; -extern u8 gUnknown_80E331C[]; -extern u8 gUnknown_80E3378[]; -extern u8 gUnknown_80E339C[]; -extern u8 gUnknown_80E33D8[]; -extern u8 gUnknown_80E3430[]; -extern u8 gUnknown_80E34B0[]; -extern u8 gUnknown_80E34F0[]; -extern u8 gUnknown_80E352C[]; -extern u8 gUnknown_80E355C[]; -extern u8 gUnknown_80E35AC[]; -extern u8 gUnknown_80E35E8[]; -extern u8 gUnknown_80E360C[]; -extern u8 gUnknown_80E3644[]; -extern u8 gUnknown_80E367C[]; -extern u8 gUnknown_80E3690[]; -extern u8 gUnknown_80E3818[]; -extern u8 gUnknown_80E3998[]; -extern u8 gUnknown_80E3B1C[]; -extern u8 gUnknown_80E3BF8[]; -extern u8 gUnknown_80E3DE4[]; -extern u8 gUnknown_80E3E98[]; -extern u8 gUnknown_80E4014[]; -extern u8 gUnknown_80E4130[]; -extern u8 gUnknown_80E41DC[]; -extern u8 gUnknown_80E4314[]; -extern u8 gUnknown_80E4480[]; -extern u8 gUnknown_80E44A4[]; -extern u8 gUnknown_80E4500[]; -extern u8 gUnknown_80E4550[]; -extern u8 gUnknown_80E45B4[]; -extern u8 gUnknown_80E460C[]; -extern u8 gUnknown_80E4650[]; -extern u8 gUnknown_80E468C[]; -extern u8 gUnknown_80E46C8[]; -extern u8 gUnknown_80E4704[]; -extern u8 gUnknown_80E4744[]; -extern u8 gUnknown_80E4788[]; -extern u8 gUnknown_80E47D8[]; -extern u8 gUnknown_80E482C[]; -extern u8 gUnknown_80E48A8[]; -extern u8 gUnknown_80E48E8[]; -extern u8 gUnknown_80E4928[]; -extern u8 gUnknown_80E4964[]; -extern u8 gUnknown_80E499C[]; -extern u8 gUnknown_80E49C4[]; +ALIGNED(4) const u8 gUnknown_80E2BE0[] = _( +"Your own Pokémon will not disappear\n" +"if you send it as a helper.\n" +"Will you send a helper to your friend?"); + +ALIGNED(4) const u8 gUnknown_80E2C48[] = _( +"Pick the Pokémon to be sent as a helper.\n" +"(Any hold item will not be sent.)"); + +ALIGNED(4) const u8 gUnknown_80E2C94[] = _( +"No Pokémon are in your Friend Areas.\n" +"What would you like to do?"); + +ALIGNED(4) const u8 gUnknown_80E2CD4[] = _( +"Is this Pokémon OK?"); + +ALIGNED(4) const u8 gUnknown_80E2CE8[] = _( +"Please choose the {COLOR CYAN_G}A-OK Mail{RESET} that should\n" +"be sent to your friend."); + +ALIGNED(4) const u8 gUnknown_80E2D30[] = _( +"This {COLOR CYAN_G}A-OK Mail{RESET} will be sent.\n" +"Is that OK?"); + +ALIGNED(4) const u8 gUnknown_80E2D60[] = _( +"There is no {COLOR CYAN_G}A-OK Mail{RESET}."); + +ALIGNED(4) const u8 gUnknown_80E2D7C[] = _( +"Connect the {COLOR CYAN_G}Game Link cable{RESET}.\n" +"When your friend is ready, begin\n" +"communication."); + +ALIGNED(4) const u8 gUnknown_80E2DD0[] = _( +"{CENTER_ALIGN}Communicating...\n" +"{CENTER_ALIGN}Please wait with the power on.\n" +"{CENTER_ALIGN}To cancel, press {B_BUTTON}."); + +ALIGNED(4) const u8 gUnknown_80E2E20[] = _( +"The GBA Game Pak will be written to.\n" +"Is that OK?"); + +ALIGNED(4) const u8 gUnknown_80E2E54[] = _( +"{CENTER_ALIGN}Reading from GBA Game Pak.\n" +"{CENTER_ALIGN}Do not remove the GBA Game Pak.\n" +"{CENTER_ALIGN}Please wait with the power on."); + +ALIGNED(4) const u8 gUnknown_80E2EB4[] = _( +"{CENTER_ALIGN}Writing to GBA Game Pak.\n" +"{CENTER_ALIGN}Do not remove the GBA Game Pak.\n" +"{CENTER_ALIGN}Please wait with the power on."); + +ALIGNED(4) const u8 gUnknown_80E2F14[] = _( +"There is no {COLOR CYAN_G}SOS Mail{RESET} on\n" +"the GBA Game Pak."); + +ALIGNED(4) const u8 gUnknown_80E2F44[] = _( +"Please choose an {COLOR CYAN_G}SOS Mail{RESET}\n" +"on the GBA Game Pak."); + +ALIGNED(4) const u8 gUnknown_80E2F78[] = _( +"Is it OK to accept this {COLOR CYAN_G}SOS Mail{RESET}?"); + +ALIGNED(4) const u8 gUnknown_80E2FA0[] = _( +"There is no more space for accepting\n" +"new mail.\n" +"You must delete old mail."); + +ALIGNED(4) const u8 gUnknown_80E2FEC[] = _( +"The {COLOR CYAN_G}SOS Mail{RESET} has been received.\n" +"Your adventure will be saved."); + +ALIGNED(4) const u8 gUnknown_80E3030[] = _( +"Please embark on your rescue mission\n" +"from the Pelipper Post Office. "); + +ALIGNED(4) const u8 gUnknown_80E3078[] = _( +"Please enter the {COLOR CYAN_G}SOS Mail password{RESET}."); + +ALIGNED(4) const u8 gUnknown_80E30A4[] = _( +"Is it OK to send this {COLOR CYAN_G}Thank-You Mail{RESET}?"); + +ALIGNED(4) const u8 gUnknown_80E30D0[] = _( +"Please choose the {COLOR CYAN_G}Thank-You Mail{RESET} that\n" +"should be sent to your friend."); + +ALIGNED(4) const u8 gUnknown_80E311C[] = _( +"Please enter the {COLOR CYAN_G}Thank-You Mail password{RESET}."); + +ALIGNED(4) const u8 gUnknown_80E314C[] = _( +"The {COLOR CYAN_G}Thank-You Mail password{RESET} will be\n" +"shown."); + +ALIGNED(4) const u8 gUnknown_80E317C[] = _( +"Your adventure will be saved."); + +ALIGNED(4) const u8 gUnknown_80E319C[] = _( +"Steps will now be taken to receive the\n" +"{COLOR CYAN_G}Thank-You Mail{RESET}."); + +ALIGNED(4) const u8 gUnknown_80E31D8[] = _( +"All preparations have been made."); + +ALIGNED(4) const u8 gUnknown_80E31FC[] = _( +"The {COLOR CYAN_G}Thank-You Mail{RESET} was sent."); + +ALIGNED(4) const u8 gUnknown_80E3220[] = _( +"You received the {COLOR CYAN_G}Thank-You Mail{RESET}."); + +ALIGNED(4) const u8 gUnknown_80E3248[] = _( +"The {COLOR CYAN_G}Thank-You Mail{RESET} was sent.\n" +"Your adventure will be saved."); + +ALIGNED(4) const u8 gUnknown_80E3288[] = _( +"Steps will now be taken to send your\n" +"{COLOR CYAN_G}Thank-You Mail{RESET}."); + +ALIGNED(4) const u8 gUnknown_80E32C4[] = _( +"OK. You're good to go.\n" +"{COLOR YELLOW_N}%s{RESET}, I hope your sense of\n" +"gratitude reaches your friend."); + +ALIGNED(4) const u8 gUnknown_80E331C[] = _( +"The item chosen here can't be exchanged\n" +"with anything else.\n" +"Are you sure this item is OK?"); + +ALIGNED(4) const u8 gUnknown_80E3378[] = _( +"Please choose the item to be sent."); + +ALIGNED(4) const u8 gUnknown_80E339C[] = _( +"There are no items in storage.\n" +"What would you like to do?"); + +ALIGNED(4) const u8 gUnknown_80E33D8[] = _( +"Would you like to choose\n" +"a {COLOR CYAN_G}reward item{RESET} from storage and\n" +"send it with your mail?"); + +ALIGNED(4) const u8 gUnknown_80E3430[] = _( +"This mail already has an attached\n" +"{COLOR CYAN_G}reward item{RESET}.{EXTRA_MSG}Once an item has been chosen, it may not\n" +"be exchanged with another item."); + +ALIGNED(4) const u8 gUnknown_80E34B0[] = _( +"Would you like to resend the mail\n" +"with the same item attached?"); + +ALIGNED(4) const u8 gUnknown_80E34F0[] = _( +"Please select a {COLOR CYAN_G}Thank-You Mail{RESET}\n" +"from the GBA Game Pak."); + +ALIGNED(4) const u8 gUnknown_80E352C[] = _( +"Is it OK to accept this {COLOR CYAN_G}Thank-You Mail{RESET}?"); + +ALIGNED(4) const u8 gUnknown_80E355C[] = _( +"Mail can't be sent to a GBA Game Pak\n" +"with the game quicksaved in a dungeon."); + +ALIGNED(4) const u8 gUnknown_80E35AC[] = _( +"The GBA Game Pak does not have\n" +"a {COLOR CYAN_G}Thank-You Mail{RESET} on it."); + +ALIGNED(4) const u8 gUnknown_80E35E8[] = _( +"There is no {COLOR CYAN_G}Thank-You Mail{RESET}."); + +ALIGNED(4) const u8 gUnknown_80E360C[] = _( +"How would you like to send\n" +"your {COLOR CYAN_G}Thank-You Mail{RESET}?"); + +ALIGNED(4) const u8 gUnknown_80E3644[] = _( +"How would you like to receive\n" +"the {COLOR CYAN_G}Thank-You Mail{RESET}?"); + +ALIGNED(4) const u8 gUnknown_80E367C[] = _( +"Read which Info?"); + +ALIGNED(4) const u8 gUnknown_80E3690[] = _( +"If your team is defeated and in need\n" +"of rescuing, send an {COLOR CYAN_G}SOS Mail{RESET}\n" +"to a friend.{EXTRA_MSG}Once you send your mail, you must wait\n" +"for your friend to send you\n" +"an {COLOR CYAN_G}A-OK Mail{RESET}.{EXTRA_MSG}If the {COLOR CYAN_G}A-OK Mail{RESET} arrives, your\n" +"team can be revived to resume exploring\n" +"the dungeon it was in.{EXTRA_MSG}When your team is revived, don't forget\n" +"to send a {COLOR CYAN_G}Thank-You Mail{RESET} to the friend\n" +"who came to your rescue."); + +ALIGNED(4) const u8 gUnknown_80E3818[] = _( +"If your team is defeated in\n" +"a dungeon, you may send a friend\n" +"an {COLOR CYAN_G}SOS Mail{RESET} for help.{EXTRA_MSG}However, there are some places\n" +"where it is impossible for you to\n" +"call for a rescue.{EXTRA_MSG}Also, if you send an {COLOR CYAN_G}SOS Mail{RESET},\n" +"you may not continue with your\n" +"adventure while awaiting rescue.{EXTRA_MSG}If you cannot wait to be rescued,\n" +"you will have to give up and return\n" +"to your rescue team base."); + +ALIGNED(4) const u8 gUnknown_80E3998[] = _( +"If your friend successfully rescues\n" +"your team, accept your friend's\n" +"{COLOR CYAN_G}A-OK Mail{RESET}.{EXTRA_MSG}Once the {COLOR CYAN_G}A-OK Mail{RESET} is received,\n" +"you may revive your team and resume\n" +"exploring the dungeon you were in.{EXTRA_MSG}Using a {COLOR CYAN_G}Game Link cable{RESET},\n" +"your friend can also send you\n" +"a {COLOR CYAN_G}helper Pokémon{RESET}.{EXTRA_MSG}However, the {COLOR CYAN_G}helper Pokémon{RESET} will not\n" +"be able to bring an item with it when\n" +"joining your team."); + +ALIGNED(4) const u8 gUnknown_80E3B1C[] = _( +"If your team has been rescued, be sure\n" +"to send a {COLOR CYAN_G}Thank-You Mail{RESET} to the friend\n" +"that came to your help.{EXTRA_MSG}You may also attach a {COLOR CYAN_G}reward item{RESET}\n" +"from storage to your {COLOR CYAN_G}Thank-You Mail{RESET}\n" +"and send it to your friend."); + +ALIGNED(4) const u8 gUnknown_80E3BF8[] = _( +"If your friend's team needs rescuing,\n" +"you must first receive an {COLOR CYAN_G}SOS Mail{RESET}\n" +"from your friend.{EXTRA_MSG}When you get the mail, you may embark\n" +"on your rescue mission from the\n" +"{COLOR CYAN_G}Pelipper Post Office{RESET}.{EXTRA_MSG}If you rescue your friend's defeated\n" +"team, send an {COLOR CYAN_G}A-OK Mail{RESET} to your\n" +"friend.{EXTRA_MSG}If you rescue a friend, you will be eligible\n" +"to receive a {COLOR CYAN_G}Thank-You Mail{RESET}.{EXTRA_MSG}If you have quicksaved inside a dungeon,\n" +"you may not choose {COLOR CYAN_G}Go Rescue{RESET}.\n" +"Your last save must be out of a dungeon."); + +ALIGNED(4) const u8 gUnknown_80E3DE4[] = _( +"You may receive an {COLOR CYAN_G}SOS Mail{RESET} from\n" +"a friend's team that lies defeated in\n" +"a dungeon.{EXTRA_MSG}If there is no space for new mail, delete\n" +"old mail at the {COLOR CYAN_G}Pelipper Post Office{RESET}."); + +ALIGNED(4) const u8 gUnknown_80E3E98[] = _( +"If you successfully rescue your friend's\n" +"team, send your friend an {COLOR CYAN_G}A-OK Mail{RESET}.{EXTRA_MSG}Using a {COLOR CYAN_G}Game Link cable{RESET}, you may\n" +"also send your friend a Pokémon from\n" +"your Friend Area as a helper.{EXTRA_MSG}Don't worry--sending a Pokémon as\n" +"a helper will not make it disappear from\n" +"its Friend Area.{EXTRA_MSG}If there is no space for new mail, delete\n" +"old mail at the {COLOR CYAN_G}Pelipper Post Office{RESET}."); + +ALIGNED(4) const u8 gUnknown_80E4014[] = _( +"When you receive an {COLOR CYAN_G}SOS Mail{RESET},\n" +"you may embark on your rescue mission\n" +"from the {COLOR CYAN_G}Pelipper Post Office{RESET}.{EXTRA_MSG}Beware--if you do not have access to\n" +"the dungeon they are in, you may not go\n" +"on a rescue mission there.{EXTRA_MSG}Accept challenging rescues only\n" +"if you are ready and qualified!"); + +ALIGNED(4) const u8 gUnknown_80E4130[] = _( +"If you send an {COLOR CYAN_G}A-OK Mail{RESET}, you may\n" +"receive a {COLOR CYAN_G}Thank-You Mail{RESET} in return\n" +"from your friend.{EXTRA_MSG}The {COLOR CYAN_G}Thank-You Mail{RESET} may also come\n" +"with a {COLOR CYAN_G}reward item{RESET} attached."); + +ALIGNED(4) const u8 gUnknown_80E41DC[] = _( +"Using the {COLOR CYAN_G}Dual Slot{RESET} function,\n" +"you may perform rescue operations with\n" +"friends using the GBA Game Pak version.{EXTRA_MSG}Insert the DS Game Card and the GBA\n" +"Game Pak in your Nintendo DS system,\n" +"then turn on the power.{EXTRA_MSG}Friend Rescue missions using\n" +"the {COLOR CYAN_G}Dual Slot{RESET} function will be\n" +"available on the main menu. "); + +ALIGNED(4) const u8 gUnknown_80E4314[] = _( +"Friends can rescue each other's defeated\n" +"teams using a {COLOR CYAN_G}Game Link cable{RESET},\n" +"{COLOR CYAN_G}passwords{RESET}, and so on.{EXTRA_MSG}You may go on a rescue mission to save\n" +"your friend's team that has been defeated\n" +"in a dungeon.{EXTRA_MSG}Or, you may call for help from a friend\n" +"to save your fallen team in a dungeon.{EXTRA_MSG}Using {COLOR CYAN_G}passwords{RESET}, you can even\n" +"exchange help with faraway friends."); + + +ALIGNED(4) const u8 gUnknown_80E4480[] = _( +"There was a communication error."); + +ALIGNED(4) const u8 gUnknown_80E44A4[] = _( +"An incorrect number of GBA systems are\n" +"connected.\n" +"Please redo this process from the start."); + +ALIGNED(4) const u8 gUnknown_80E4500[] = _( +"There is no response from your friend.\n" +"Please redo this process from the start."); + +ALIGNED(4) const u8 gUnknown_80E4550[] = _( +"The sender and receiver appear to be\n" +"in different modes.\n" +"Please redo the process from the start."); + +ALIGNED(4) const u8 gUnknown_80E45B4[] = _( +"Your storage space is full.\n" +"Please make room, then redo the\n" +"process from the start."); + +ALIGNED(4) const u8 gUnknown_80E460C[] = _( +"This mail has been received before.\n" +"It cannot be received again."); + +ALIGNED(4) const u8 gUnknown_80E4650[] = _( +"This mail has been sent already.\n" +"It cannot be sent again."); + +ALIGNED(4) const u8 gUnknown_80E468C[] = _( +"You do not appear eligible to receive\n" +"this {COLOR CYAN_G}A-OK Mail{RESET}."); + +ALIGNED(4) const u8 gUnknown_80E46C8[] = _( +"Your friend is not eligible to receive\n" +"this {COLOR CYAN_G}A-OK Mail{RESET}."); + +ALIGNED(4) const u8 gUnknown_80E4704[] = _( +"You do not appear eligible to receive\n" +"this {COLOR CYAN_G}Thank-You Mail{RESET}."); + +ALIGNED(4) const u8 gUnknown_80E4744[] = _( +"Your friend is not eligible to receive\n" +"this {COLOR CYAN_G}Thank-You Mail{RESET}."); + +ALIGNED(4) const u8 gUnknown_80E4788[] = _( +"Something went wrong.\n" +"Please turn off the power and\n" +"reinsert the GBA Game Pak."); + +ALIGNED(4) const u8 gUnknown_80E47D8[] = _( +"There is no space for receiving new\n" +"mail.\n" +"Please delete old mail, then try again."); + +ALIGNED(4) const u8 gUnknown_80E482C[] = _( +"There is no response from your friend.\n" +"Please make sure the sender and receiver\n" +"are ready, then redo this from the start."); + +ALIGNED(4) const u8 gUnknown_80E48A8[] = _( +"This password is incorrect.\n" +"Would you like to enter it again?"); + +ALIGNED(4) const u8 gUnknown_80E48E8[] = _( +"This password does not appear to be\n" +"that of an {COLOR CYAN_G}SOS Mail{RESET}."); + +ALIGNED(4) const u8 gUnknown_80E4928[] = _( +"Received the {COLOR CYAN_G}SOS Mail{RESET}.\n" +"Your adventure will be saved."); + +ALIGNED(4) const u8 gUnknown_80E4964[] = _( +"This password does not appear to be\n" +"an {COLOR CYAN_G}A-OK Mail{RESET}."); + +ALIGNED(4) const u8 gUnknown_80E499C[] = _( +"This password can no longer be used."); + +ALIGNED(4) const u8 gUnknown_80E49C4[] = _( +"This password does not appear to be\n" +"that of a {COLOR CYAN_G}Thank-You Mail{RESET}."); EWRAM_INIT WonderMailStruct_203B33C *gUnknown_203B33C = {NULL}; diff --git a/src/menu_input.c b/src/menu_input.c index 493916c19..a9a0c2c3b 100644 --- a/src/menu_input.c +++ b/src/menu_input.c @@ -1161,3 +1161,43 @@ void sub_80140B4(WindowTemplates *a0) for (i = 0; i < MAX_WINDOWS; i++) a0->id[i] = gUnknown_80D47C8[i]; } + +void sub_80140DC(void) +{ + DungeonPos pos = {200, 128}; + + SetSavingIconCoords(&pos); + StopBGMResetSoundEffectCounters(); +} + +void sub_80140F8(void) +{ + DungeonPos pos = {188, 64}; + + SetSavingIconCoords(&pos); + StopBGMResetSoundEffectCounters(); +} + +void sub_8014114(void) +{ + StartBGMusic(); + SetSavingIconCoords(NULL); +} + +UNUSED static void nullsub_201(void) {} + +UNUSED static bool8 sub_8014128(void) +{ + if (GetMenuInput() == INPUT_B_BUTTON) return FALSE; + else return TRUE; +} + +UNUSED static u32 sub_801413C(void) +{ + return 0; +} + +u32 GetTouchScreenArrowPress(s32 a0, const void *a1) +{ + return 0; +} diff --git a/src/quick_save_write.c b/src/quick_save_write.c index 841e6f460..189e52a8a 100644 --- a/src/quick_save_write.c +++ b/src/quick_save_write.c @@ -1,5 +1,6 @@ #include "global.h" #include "globaldata.h" +#include "menu_input.h" #include "string_format.h" #include "memory.h" #include "quick_save_write.h" diff --git a/src/save_write.c b/src/save_write.c index 3c1cd0333..055a43ee8 100644 --- a/src/save_write.c +++ b/src/save_write.c @@ -5,6 +5,7 @@ #include "save.h" #include "save_write.h" #include "string_format.h" +#include "menu_input.h" // size: 0x20 typedef struct SavePakWrite diff --git a/src/string_format.c b/src/string_format.c index 0029b02eb..f8df10db6 100644 --- a/src/string_format.c +++ b/src/string_format.c @@ -16,51 +16,20 @@ #include "text_2.h" #include "text_3.h" -#include "data/code_80140DC.h" - -void sub_80140DC(void) +static const MenuItem sYesNoMenuItems[] = { - DungeonPos pos; + {_("*Yes"), 1}, + {_("No"), 0}, + {NULL, -1} +}; - pos.x = 200; - pos.y = 128; - SetSavingIconCoords(&pos); - StopBGMResetSoundEffectCounters(); -} - -void sub_80140F8(void) +static const MenuItem sYesNoMenuItems_DefaultNo[] = { - DungeonPos pos; + {_("Yes"), 1}, + {_("*No"), 0}, + {NULL, -1} +}; - pos.x = 188; - pos.y = 64; - SetSavingIconCoords(&pos); - StopBGMResetSoundEffectCounters(); -} - -void sub_8014114(void) { - StartBGMusic(); - SetSavingIconCoords(NULL); -} - -void nullsub_201(void) {} - -u32 sub_8014128(void) { - if(GetMenuInput() == INPUT_B_BUTTON) return 0; - else return 1; -} - -u32 sub_801413C(void) -{ - return 0; -} - -u32 sub_8014140(void) -{ - return 0; -} - -// This kinda looks like the 'true' beginning of the file static const u32 gUnknown_80D48A0[] = {0x7, 0x2, 0x2}; static const WindowTemplate gUnknown_80D48AC = { 0x00, @@ -146,7 +115,7 @@ struct NeverWrittenToStruct202EC20 static EWRAM_DATA struct NeverWrittenToStruct202EC20 *sNeverWrittenToUnknownStructPtr = NULL; static UNUSED EWRAM_DATA u8 sUnusedEwram1[4] = {0}; -static EWRAM_DATA TouchScreenMenuInput gUnknown_202EC28 = {0}; +static EWRAM_DATA TouchScreenMenuInput sDialogueMenuTouchScreenInput = {0}; static EWRAM_INIT WindowTemplates sUnknown_203B198 = { .id = { @@ -203,12 +172,12 @@ void CreateDialogueBoxAndPortrait(const u8 *text, void *param_2, MonPortraitMsg void CreateYesNoDialogueBoxAndPortrait_DefaultYes(const u8 *text, MonPortraitMsg *monPortraitPtr, u16 flags) { - CreateMenuDialogueBoxAndPortrait(text, NULL, -1, gUnknown_80D485C, NULL, 3, 0, monPortraitPtr, flags | 0x300); + CreateMenuDialogueBoxAndPortrait(text, NULL, -1, sYesNoMenuItems, NULL, 3, 0, monPortraitPtr, flags | 0x300); } void CreateYesNoDialogueBoxAndPortrait_DefaultNo(const u8 *text, MonPortraitMsg *monPortraitPtr, u16 flags) { - CreateMenuDialogueBoxAndPortrait(text, NULL, -1, gUnknown_80D4880, NULL, 3, 0, monPortraitPtr, flags | 0x300); + CreateMenuDialogueBoxAndPortrait(text, NULL, -1, sYesNoMenuItems_DefaultNo, NULL, 3, 0, monPortraitPtr, flags | 0x300); } // arm9.bin::0201D700 @@ -223,7 +192,7 @@ void CreateMenuDialogueBoxAndPortrait(const u8 *text, void *a1, u32 r9, const Me sDialogueMenuItems = menuItems; gUnknown_202EC18 = arg_0; gUnknown_202EC1C = r9; - ResetTouchScreenMenuInput(&gUnknown_202EC28); + ResetTouchScreenMenuInput(&sDialogueMenuTouchScreenInput); if (flags & 0x10) { sUnknown_203B198.id[0] = gUnknown_80D48DC; } @@ -388,7 +357,7 @@ void DrawDialogueBoxString(void) } sub_80073E0(0); gUnknown_202E794 = str; - ResetTouchScreenMenuInput(&gUnknown_202EC28); + ResetTouchScreenMenuInput(&sDialogueMenuTouchScreenInput); if (gUnknown_202E794[0] == '\0') { if (sDialogueMenuItems != NULL) { gUnknown_202E744 = 3; @@ -459,14 +428,12 @@ void DrawDialogueBoxString(void) case 9: { bool8 buttonPress = FALSE; gUnknown_202E748.unk20 = 0; - GetTouchScreenMenuInput(&gUnknown_202EC28, 0); + GetTouchScreenMenuInput(&sDialogueMenuTouchScreenInput, 0); if (!(sUnknownTextFlags & 1)) { buttonPress = TRUE; } - else - { - if (sUnknownTextFlags & 2) - { + else { + if (sUnknownTextFlags & 2) { if (gUnknown_202E780 > 0) { gUnknown_202E780--; } @@ -474,13 +441,13 @@ void DrawDialogueBoxString(void) buttonPress = TRUE; } } - else if (gRealInputs.pressed & AB_BUTTONS || gUnknown_202EC28.a_button) { + else if (gRealInputs.pressed & AB_BUTTONS || sDialogueMenuTouchScreenInput.a_button) { buttonPress = TRUE; } else if ((gRealInputs.held & (DPAD_ANY | B_BUTTON)) == B_BUTTON) { buttonPress = TRUE; } - else if (gUnknown_202EC28.unk5) { + else if (sDialogueMenuTouchScreenInput.unk5) { buttonPress = TRUE; } } @@ -865,5 +832,3 @@ void PrintFormattedStringOnWindow2(s32 x, s32 y, const u8 *str, u32 windowId, u3 formattedString[FORMAT_STR_MAX_LEN - 1] = '\0'; PrintStringOnWindow2(x, y, formattedString, windowId, terminatingChr, lineSpacing); } - -//