mirror of
https://github.com/pret/pmd-red.git
synced 2024-11-26 22:40:33 +00:00
Split+data code_801602C
This commit is contained in:
parent
fdcef19d85
commit
c6bc80e6d8
@ -30,8 +30,6 @@ gUnknown_80DAFA0: @ 80DAFA0
|
||||
.byte 0x06, 0x00, 0x03, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
|
||||
|
||||
@ END code_80130A8 #3
|
||||
|
||||
@ START code_80130A8 #4
|
||||
@ -367,31 +365,4 @@ gUnknown_80DB664: @ 80DB664
|
||||
.string "%s\0"
|
||||
.align 2,0
|
||||
|
||||
@ END code_80130A8 #4
|
||||
|
||||
@ START code_8012A18_1
|
||||
.string "pksdir0\0"
|
||||
|
||||
.align 2,0
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
|
||||
.global gUnknown_80DB688
|
||||
gUnknown_80DB688: @ 80DB688
|
||||
.string "Is the name {COLOR_1 CYAN}{ARG_POKEMON_0}{END_COLOR_TEXT_1} OK?\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_80DB6A4
|
||||
gUnknown_80DB6A4: @ 80DB6A4
|
||||
.string "This name is too long.\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_80DB6BC
|
||||
gUnknown_80DB6BC: @ 80DB6BC
|
||||
.string "Please enter a name.\0"
|
||||
.align 2,0
|
||||
@ END code_8012A18_1
|
||||
@ END code_80130A8 #4
|
@ -1,8 +1,7 @@
|
||||
#ifndef GUARD_CODE_8012A18_H
|
||||
#define GUARD_CODE_8012A18_H
|
||||
#ifndef GUARD_CODE_8012A18_1_H
|
||||
#define GUARD_CODE_8012A18_1_H
|
||||
|
||||
u32 sub_801602C(u32, u8 *);
|
||||
u32 sub_8016080(void);
|
||||
void sub_80160D8(void);
|
||||
s32 sub_8015FEC(u8 *buffer, s32 size);
|
||||
s32 sub_8016028(void);
|
||||
|
||||
#endif // GUARD_CODE_8012A18_H
|
||||
#endif // GUARD_CODE_8012A18_1_H
|
@ -2,7 +2,7 @@
|
||||
#define GUARD_CODE_80130A8_H
|
||||
|
||||
#include "file_system.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
// code_80130A8.s
|
||||
@ -13,6 +13,9 @@ extern void sub_8014114(void);
|
||||
extern void sub_80141B4(const u8 *, u32, OpenedFile **, u32);
|
||||
extern void sub_8014248(const u8 *, u32, u32, const MenuItem *, void *, u32, u32, OpenedFile **, u32);
|
||||
extern s32 sub_80144A4(s32 *);
|
||||
extern void sub_80151C0(u32, u8 *);
|
||||
extern u32 sub_80154F0(void);
|
||||
extern void sub_80155F0(void);
|
||||
extern void xxx_draw_string_80144C4(void);
|
||||
extern void xxx_format_and_draw(u32, u32, const u8 *, u32, u32);
|
||||
extern void xxx_format_string(const u8 *, u8 *, u8 *, u32);
|
||||
|
21
include/code_801602C.h
Normal file
21
include/code_801602C.h
Normal file
@ -0,0 +1,21 @@
|
||||
#ifndef GUARD_CODE_801602C_H
|
||||
#define GUARD_CODE_801602C_H
|
||||
|
||||
#include "structs/menu.h"
|
||||
|
||||
// size: 0x50
|
||||
struct unkStruct_203B200
|
||||
{
|
||||
u32 unk0;
|
||||
u32 unk4;
|
||||
/* 0x8 */ u8 *pokeName;
|
||||
/* 0xC */ s32 state;
|
||||
/* 0x10 */ MenuItem menus[3];
|
||||
u8 fill[0x50 - 0x28];
|
||||
};
|
||||
|
||||
u32 sub_801602C(u32 mode, u8 *name);
|
||||
u32 sub_8016080(void);
|
||||
void sub_80160D8(void);
|
||||
|
||||
#endif // GUARD_CODE_801602C_H
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "global.h"
|
||||
#include "constants/move.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "pokemon.h"
|
||||
|
||||
// size: 0xA4
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define GUARD_CODE_801B60C_H
|
||||
|
||||
#include "items.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
// size: 0x154
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define GUARD_CODE_801BEEC_H
|
||||
|
||||
#include "constants/iq_skill.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "pokemon.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define GUARD_CODE_801C244_H
|
||||
|
||||
#include "constants/iq_skill.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "pokemon.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef GUARD_CODE_801C620_H
|
||||
#define GUARD_CODE_801C620_H
|
||||
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "structs/subStruct_203B240.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define GUARD_CODE_801C8C4_H
|
||||
|
||||
#include "constants/item.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
// size: 0x554
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef GUARD_CODE_801D014_H
|
||||
#define GUARD_CODE_801D014_H
|
||||
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "pokemon.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef GUARD_CODE_801D9E4_H
|
||||
#define GUARD_CODE_801D9E4_H
|
||||
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
// size: 0xA0
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "constants/iq_skill.h"
|
||||
#include "items.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "pokemon.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef GUARD_DEBUG_MENU1_H
|
||||
#define GUARD_DEBUG_MENU1_H
|
||||
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
// size: 0x1A4
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef GUARD_DEBUG_MENU2_H
|
||||
#define GUARD_DEBUG_MENU2_H
|
||||
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
// size: 0x138
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef GUARD_DEBUG_MENU3_H
|
||||
#define GUARD_DEBUG_MENU3_H
|
||||
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
// size: 0xFC
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define GUARD_DEBUG_MENU4_H
|
||||
|
||||
#include "pokemon.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
// size: 0x140
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define GUARD_FELICITY_BANK_H
|
||||
|
||||
#include "file_system.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
#define FELICITY_BANK_ACTION_WITHDRAW 0
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "constants/move.h"
|
||||
#include "items.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "pokemon.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "items.h"
|
||||
#include "pokemon.h"
|
||||
#include "wonder_mail.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
|
||||
// size: 0x568
|
||||
typedef struct WonderMailStruct_203B33C
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "constants/move.h"
|
||||
#include "file_system.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
// size: 0x18C
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "constants/move.h"
|
||||
#include "file_system.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "pokemon.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "file_system.h"
|
||||
#include "items.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
enum KangaskhanStorageStates
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define GUARD_KANGASKHAN_STORAGE2_H
|
||||
|
||||
#include "items.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
// size: 0x150
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "file_system.h"
|
||||
#include "items.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
enum KecleonStoreStates
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "file_system.h"
|
||||
#include "items.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "pokemon_3.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef GUARD_MAILBOX_H
|
||||
#define GUARD_MAILBOX_H
|
||||
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "structs/str_text.h"
|
||||
#include "constants/mailbox.h"
|
||||
#include "code_802C39C.h"
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef GUARD_MAIN_MENU1_H
|
||||
#define GUARD_MAIN_MENU1_H
|
||||
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
// size: 0x8
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef GUARD_MAIN_MENU2_H
|
||||
#define GUARD_MAIN_MENU2_H
|
||||
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
// size: 0x1A8
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define GUARD_MAKUHITA_DOJO1_H
|
||||
|
||||
#include "file_system.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
enum MakuhitaDojoInitMode
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef GUARD_MENU_INPUT_H
|
||||
#define GUARD_MENU_INPUT_H
|
||||
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
u32 sub_8012A64(MenuInputStructSub *r0, s32 r1);
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "code_8094F88.h"
|
||||
#include "main_menu1.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "pokemon.h"
|
||||
#include "sprite_oam.h"
|
||||
#include "structs/str_text.h"
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "constants/move.h"
|
||||
#include "items.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "pokemon.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef GUARD_RESCUE_PASSWORD_MENU_H
|
||||
#define GUARD_RESCUE_PASSWORD_MENU_H
|
||||
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "sprite.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "structs/str_text.h"
|
||||
#include "items.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
|
||||
// 11 was another saving too?
|
||||
enum TradeItemsScreens
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define GUARD_WIGGLYTUFF_SHOP1_H
|
||||
|
||||
#include "constants/friend_area.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
typedef struct WigglytuffShop1Work
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define GUARD_WIGGLYTUFF_SHOP3_H
|
||||
|
||||
#include "file_system.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
enum WigglytuffStates
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "constants/wonder_mail.h"
|
||||
#include "file_system.h"
|
||||
#include "items.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "pokemon.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "code_802C39C.h"
|
||||
#include "constants/mailbox.h"
|
||||
#include "input.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "structs/str_text.h"
|
||||
|
||||
// size: 0xA8
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "code_802C39C.h"
|
||||
#include "input.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "structs/str_text.h"
|
||||
#include "wonder_mail.h"
|
||||
|
||||
|
@ -95,6 +95,7 @@ SECTIONS {
|
||||
src/menu_input.o(.text);
|
||||
asm/code_80130A8.o(.text);
|
||||
src/code_8012A18_1.o(.text);
|
||||
src/code_801602C.o(.text);
|
||||
src/felicity_bank.o(.text);
|
||||
src/kangaskhan_storage1.o(.text);
|
||||
src/kangaskhan_storage2.o(.text);
|
||||
@ -412,6 +413,7 @@ SECTIONS {
|
||||
src/common_strings.o(.rodata);
|
||||
data/common_strings.o(.rodata);
|
||||
data/data_80DAF70.o(.rodata);
|
||||
src/code_801602C.o(.rodata);
|
||||
src/felicity_bank.o(.rodata);
|
||||
src/kangaskhan_storage1.o(.rodata);
|
||||
src/kangaskhan_storage2.o(.rodata);
|
||||
|
@ -1,269 +1,34 @@
|
||||
#include "global.h"
|
||||
#include "code_8012A18_1.h"
|
||||
#include "code_80130A8.h"
|
||||
#include "common_strings.h"
|
||||
#include "memory.h"
|
||||
#include "input.h"
|
||||
#include "text1.h"
|
||||
#include "text2.h"
|
||||
#include "text_util.h"
|
||||
#include "text2.h"
|
||||
|
||||
struct unkStruct_203B200
|
||||
{
|
||||
// size: 0x50
|
||||
u32 unk0;
|
||||
u32 unk4;
|
||||
u8 *pokeName;
|
||||
s32 state;
|
||||
/* 0x10 */ MenuItem menus[3];
|
||||
u8 fill[0x50 - 0x28];
|
||||
};
|
||||
extern struct unkStruct_203B200 *gUnknown_203B200;
|
||||
|
||||
extern const char gUnknown_80DB6A4;
|
||||
extern const char gUnknown_80DB6BC;
|
||||
extern const char gUnknown_80DB688;
|
||||
extern u8 gAvailablePokemonNames[0x58];
|
||||
|
||||
extern void sub_80151C0(u32, u8 *);
|
||||
extern void CreateConfirmNameMenu(void);
|
||||
extern void sub_80160F4(u32);
|
||||
bool8 IsNameEmpty(void);
|
||||
extern u32 sub_80154F0(void);
|
||||
extern void sub_80155F0(void);
|
||||
|
||||
void nullsub_36(void);
|
||||
void sub_8016110(void);
|
||||
extern void sub_80161F8(void);
|
||||
extern void HandleConfirmNameMenu(void);
|
||||
extern void sub_8016280(void);
|
||||
extern void sub_801629C(void);
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
MENU_ACTION_DEFAULT = 1,
|
||||
MENU_ACTION_YES,
|
||||
MENU_ACTION_NO,
|
||||
};
|
||||
// TODO: Above code is in code_80130A8.s
|
||||
|
||||
s32 sub_8015FEC(u8 *buffer, s32 size)
|
||||
{
|
||||
struct unkChar *iVar2;
|
||||
s32 currLength;
|
||||
s32 length;
|
||||
u8 *bufferPtr;
|
||||
struct unkChar *iVar2;
|
||||
s32 currLength;
|
||||
s32 length;
|
||||
u8 *bufferPtr;
|
||||
|
||||
length = 0;
|
||||
currLength = 0;
|
||||
length = 0;
|
||||
currLength = 0;
|
||||
|
||||
if(currLength < size && *buffer != '\0')
|
||||
{
|
||||
bufferPtr = buffer; // Had to have another variable to match..
|
||||
do {
|
||||
iVar2 = GetCharacter(ReturnIntFromChar2(*bufferPtr));
|
||||
length += iVar2->unk6;
|
||||
bufferPtr++;
|
||||
currLength++;
|
||||
} while (currLength < size && *bufferPtr != '\0');
|
||||
}
|
||||
return length;
|
||||
if (currLength < size && *buffer != '\0') {
|
||||
bufferPtr = buffer; // Had to have another variable to match..
|
||||
do {
|
||||
iVar2 = GetCharacter(ReturnIntFromChar2(*bufferPtr));
|
||||
length += iVar2->unk6;
|
||||
bufferPtr++;
|
||||
currLength++;
|
||||
} while (currLength < size && *bufferPtr != '\0');
|
||||
}
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
s32 sub_8016028(void)
|
||||
{
|
||||
return 60;
|
||||
}
|
||||
|
||||
///////////// THIS IS ITS OWN FILE
|
||||
|
||||
u32 sub_801602C(u32 r0, u8 *name)
|
||||
{
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(NULL, TRUE, TRUE);
|
||||
gUnknown_203B200 = MemoryAlloc(sizeof(struct unkStruct_203B200), 8);
|
||||
gUnknown_203B200->unk0 = r0;
|
||||
gUnknown_203B200->pokeName = name;
|
||||
switch(r0)
|
||||
{
|
||||
case 0:
|
||||
gUnknown_203B200->unk4 = 0;
|
||||
break;
|
||||
case 1:
|
||||
gUnknown_203B200->unk4 = 1;
|
||||
break;
|
||||
case 2:
|
||||
gUnknown_203B200->unk4 = 2;
|
||||
break;
|
||||
case 3:
|
||||
gUnknown_203B200->unk4 = 3;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
sub_80160F4(0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
u32 sub_8016080(void)
|
||||
{
|
||||
switch(gUnknown_203B200->state) {
|
||||
case 0:
|
||||
sub_80161F8();
|
||||
break;
|
||||
case 1:
|
||||
HandleConfirmNameMenu();
|
||||
break;
|
||||
case 2:
|
||||
sub_8016280();
|
||||
break;
|
||||
case 3:
|
||||
sub_801629C();
|
||||
break;
|
||||
case 4:
|
||||
return 3;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sub_80160D8(void)
|
||||
{
|
||||
if(gUnknown_203B200 != NULL)
|
||||
{
|
||||
MemoryFree(gUnknown_203B200);
|
||||
gUnknown_203B200 = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void sub_80160F4(u32 newState)
|
||||
{
|
||||
gUnknown_203B200->state = newState;
|
||||
nullsub_36();
|
||||
sub_8016110();
|
||||
}
|
||||
|
||||
void nullsub_36(void)
|
||||
{
|
||||
}
|
||||
|
||||
void sub_8016110(void)
|
||||
{
|
||||
switch(gUnknown_203B200->state)
|
||||
{
|
||||
case 0:
|
||||
sub_80151C0(gUnknown_203B200->unk4,gUnknown_203B200->pokeName);
|
||||
break;
|
||||
case 1:
|
||||
CreateConfirmNameMenu();
|
||||
if (gUnknown_203B200->unk4 == 1) {
|
||||
sub_80922B4(gAvailablePokemonNames,gUnknown_203B200->pokeName, POKEMON_NAME_LENGTH);
|
||||
}
|
||||
else {
|
||||
sub_80922B4(gAvailablePokemonNames,gUnknown_203B200->pokeName, POKEMON_NAME_LENGTH);
|
||||
}
|
||||
// Is the name {COLOR_1 CYAN}{ARG_POKEMON_0}{END_COLOR_TEXT_1} OK?
|
||||
sub_8014248(&gUnknown_80DB688,0,3,gUnknown_203B200->menus,0,4,0,0,0x20);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
// This name is too long
|
||||
sub_80141B4(&gUnknown_80DB6A4,0,0,0x121);
|
||||
break;
|
||||
case 3:
|
||||
// Please enter a name
|
||||
sub_80141B4(&gUnknown_80DB6BC,0,0,0x121);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void CreateConfirmNameMenu(void)
|
||||
{
|
||||
gUnknown_203B200->menus[0].text = *gCommonYes;
|
||||
gUnknown_203B200->menus[0].menuAction = MENU_ACTION_YES;
|
||||
gUnknown_203B200->menus[1].text = *gCommonNo;
|
||||
gUnknown_203B200->menus[1].menuAction = MENU_ACTION_NO;
|
||||
gUnknown_203B200->menus[2].text = NULL;
|
||||
gUnknown_203B200->menus[2].menuAction = MENU_ACTION_DEFAULT;
|
||||
}
|
||||
|
||||
void sub_80161F8(void)
|
||||
{
|
||||
s32 length;
|
||||
s32 maxLength;
|
||||
|
||||
if (sub_80154F0() == 3) {
|
||||
sub_80155F0();
|
||||
if (IsNameEmpty()) {
|
||||
sub_80160F4(3);
|
||||
}
|
||||
else{
|
||||
length = sub_8015FEC(gUnknown_203B200->pokeName, POKEMON_NAME_LENGTH);
|
||||
maxLength = sub_8016028(); // returns 60
|
||||
if (length > maxLength) {
|
||||
sub_80160F4(2);
|
||||
}
|
||||
else {
|
||||
sub_80160F4(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void HandleConfirmNameMenu(void)
|
||||
{
|
||||
s32 temp;
|
||||
|
||||
if (sub_80144A4(&temp) == 0) {
|
||||
switch(temp)
|
||||
{
|
||||
case MENU_ACTION_YES:
|
||||
sub_80160F4(4);
|
||||
break;
|
||||
case MENU_ACTION_NO:
|
||||
case MENU_ACTION_DEFAULT:
|
||||
sub_80160F4(0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8016280(void)
|
||||
{
|
||||
s32 temp;
|
||||
|
||||
if (sub_80144A4(&temp) == 0) {
|
||||
sub_80160F4(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void sub_801629C(void)
|
||||
{
|
||||
s32 temp;
|
||||
|
||||
if (sub_80144A4(&temp) == 0) {
|
||||
sub_80160F4(0);
|
||||
}
|
||||
}
|
||||
|
||||
bool8 IsNameEmpty(void)
|
||||
{
|
||||
u8 character;
|
||||
s32 index;
|
||||
s32 max;
|
||||
|
||||
max = POKEMON_NAME_LENGTH; // constant needed at top of loop to match
|
||||
index = 0;
|
||||
do {
|
||||
character = gUnknown_203B200->pokeName[index];
|
||||
if (character == '\0') break;
|
||||
if (character != ' ') return FALSE;
|
||||
index++;
|
||||
} while (index < max);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
215
src/code_801602C.c
Normal file
215
src/code_801602C.c
Normal file
@ -0,0 +1,215 @@
|
||||
#include "global.h"
|
||||
#include "code_8012A18_1.h"
|
||||
#include "code_80130A8.h"
|
||||
#include "code_801602C.h"
|
||||
#include "common_strings.h"
|
||||
#include "memory.h"
|
||||
#include "text_util.h"
|
||||
#include "text1.h"
|
||||
|
||||
extern u8 gAvailablePokemonNames[]; // 202DF98
|
||||
|
||||
static EWRAM_DATA_2 struct unkStruct_203B200 *sUnknown_203B200 = {0};
|
||||
|
||||
#include "data/code_801602C.h"
|
||||
|
||||
static void CreateConfirmNameMenu(void);
|
||||
static void HandleConfirmNameMenu(void);
|
||||
static bool8 IsNameEmpty(void);
|
||||
static void nullsub_36(void);
|
||||
|
||||
static void sub_80160F4(u32 newState);
|
||||
static void sub_8016110(void);
|
||||
static void sub_80161F8(void);
|
||||
static void sub_8016280(void);
|
||||
static void sub_801629C(void);
|
||||
|
||||
u32 sub_801602C(u32 mode, u8 *name)
|
||||
{
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(NULL, TRUE, TRUE);
|
||||
|
||||
sUnknown_203B200 = MemoryAlloc(sizeof(struct unkStruct_203B200), 8);
|
||||
sUnknown_203B200->unk0 = mode;
|
||||
sUnknown_203B200->pokeName = name;
|
||||
|
||||
switch (mode) {
|
||||
case 0:
|
||||
sUnknown_203B200->unk4 = 0;
|
||||
break;
|
||||
case 1:
|
||||
sUnknown_203B200->unk4 = 1;
|
||||
break;
|
||||
case 2:
|
||||
sUnknown_203B200->unk4 = 2;
|
||||
break;
|
||||
case 3:
|
||||
sUnknown_203B200->unk4 = 3;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
sub_80160F4(0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
u32 sub_8016080(void)
|
||||
{
|
||||
switch (sUnknown_203B200->state) {
|
||||
case 0:
|
||||
sub_80161F8();
|
||||
break;
|
||||
case 1:
|
||||
HandleConfirmNameMenu();
|
||||
break;
|
||||
case 2:
|
||||
sub_8016280();
|
||||
break;
|
||||
case 3:
|
||||
sub_801629C();
|
||||
break;
|
||||
case 4:
|
||||
return 3;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sub_80160D8(void)
|
||||
{
|
||||
if (sUnknown_203B200 != NULL) {
|
||||
MemoryFree(sUnknown_203B200);
|
||||
sUnknown_203B200 = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_80160F4(u32 newState)
|
||||
{
|
||||
sUnknown_203B200->state = newState;
|
||||
nullsub_36();
|
||||
sub_8016110();
|
||||
}
|
||||
|
||||
static void nullsub_36(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void sub_8016110(void)
|
||||
{
|
||||
switch (sUnknown_203B200->state) {
|
||||
case 0:
|
||||
sub_80151C0(sUnknown_203B200->unk4, sUnknown_203B200->pokeName);
|
||||
break;
|
||||
case 1:
|
||||
CreateConfirmNameMenu();
|
||||
if (sUnknown_203B200->unk4 == 1)
|
||||
sub_80922B4(gAvailablePokemonNames, sUnknown_203B200->pokeName, POKEMON_NAME_LENGTH);
|
||||
else
|
||||
sub_80922B4(gAvailablePokemonNames, sUnknown_203B200->pokeName, POKEMON_NAME_LENGTH);
|
||||
|
||||
sub_8014248(sIsNameOKPrompt, 0, 3, sUnknown_203B200->menus, 0, 4, 0, NULL, 32);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
sub_80141B4(sNameTooLong, 0, 0, 0x121);
|
||||
break;
|
||||
case 3:
|
||||
sub_80141B4(sEnterAName, 0, 0, 0x121);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void CreateConfirmNameMenu(void)
|
||||
{
|
||||
sUnknown_203B200->menus[0].text = gCommonYes[0];
|
||||
sUnknown_203B200->menus[0].menuAction = MENU_ACTION_YES;
|
||||
|
||||
sUnknown_203B200->menus[1].text = gCommonNo[0];
|
||||
sUnknown_203B200->menus[1].menuAction = MENU_ACTION_NO;
|
||||
|
||||
sUnknown_203B200->menus[2].text = NULL;
|
||||
sUnknown_203B200->menus[2].menuAction = MENU_ACTION_DEFAULT;
|
||||
}
|
||||
|
||||
static void sub_80161F8(void)
|
||||
{
|
||||
s32 length;
|
||||
s32 maxLength;
|
||||
|
||||
if (sub_80154F0() != 3)
|
||||
return;
|
||||
|
||||
sub_80155F0();
|
||||
|
||||
if (IsNameEmpty()) {
|
||||
sub_80160F4(3);
|
||||
}
|
||||
else {
|
||||
length = sub_8015FEC(sUnknown_203B200->pokeName, POKEMON_NAME_LENGTH);
|
||||
maxLength = sub_8016028(); // returns 60
|
||||
if (length > maxLength)
|
||||
sub_80160F4(2);
|
||||
else
|
||||
sub_80160F4(1);
|
||||
}
|
||||
}
|
||||
|
||||
static void HandleConfirmNameMenu(void)
|
||||
{
|
||||
s32 temp;
|
||||
|
||||
if (sub_80144A4(&temp))
|
||||
return;
|
||||
|
||||
switch (temp) {
|
||||
case MENU_ACTION_YES:
|
||||
sub_80160F4(4);
|
||||
break;
|
||||
case MENU_ACTION_NO:
|
||||
case MENU_ACTION_DEFAULT:
|
||||
sub_80160F4(0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8016280(void)
|
||||
{
|
||||
s32 temp;
|
||||
|
||||
if (sub_80144A4(&temp) == 0)
|
||||
sub_80160F4(0);
|
||||
}
|
||||
|
||||
static void sub_801629C(void)
|
||||
{
|
||||
s32 temp;
|
||||
|
||||
if (sub_80144A4(&temp) == 0)
|
||||
sub_80160F4(0);
|
||||
}
|
||||
|
||||
static bool8 IsNameEmpty(void)
|
||||
{
|
||||
u8 character;
|
||||
s32 index;
|
||||
s32 max;
|
||||
|
||||
max = POKEMON_NAME_LENGTH; // constant needed at top of loop to match
|
||||
index = 0;
|
||||
do {
|
||||
character = sUnknown_203B200->pokeName[index];
|
||||
|
||||
if (character == '\0')
|
||||
break;
|
||||
if (character != ' ')
|
||||
return FALSE;
|
||||
|
||||
index++;
|
||||
} while (index < max);
|
||||
|
||||
return TRUE;
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "code_8012A18_1.h"
|
||||
#include "code_803B050.h"
|
||||
#include "constants/colors.h"
|
||||
#include "constants/wonder_mail.h"
|
||||
@ -74,7 +75,6 @@ extern u8 *gUnknown_80E8B94[];
|
||||
|
||||
extern PokemonStruct1 *sub_808D378(void);
|
||||
|
||||
s32 sub_8016028(void);
|
||||
extern void PrintDungeonLocationtoBuffer(u8 *, void *);
|
||||
extern u8 sub_803C1D0(WonderMailSub *, u8);
|
||||
extern u8 *sub_803C1F0(u8);
|
||||
|
22
src/data/code_801602C.h
Normal file
22
src/data/code_801602C.h
Normal file
@ -0,0 +1,22 @@
|
||||
ALIGNED(4) static const u8 sFill[] = _("pksdir0");
|
||||
|
||||
enum
|
||||
{
|
||||
MENU_ACTION_DEFAULT = 1,
|
||||
MENU_ACTION_YES,
|
||||
MENU_ACTION_NO,
|
||||
};
|
||||
|
||||
UNUSED static const UnkTextStruct2 sUnknown_80DB670 =
|
||||
{
|
||||
0, 0, 0, 0,
|
||||
3,
|
||||
0, 0,
|
||||
0, 0,
|
||||
0, 0,
|
||||
NULL
|
||||
};
|
||||
|
||||
ALIGNED(4) static const u8 sIsNameOKPrompt[] = _("Is the name {COLOR_1 CYAN}{ARG_POKEMON_0}{END_COLOR_TEXT_1} OK?");
|
||||
ALIGNED(4) static const u8 sNameTooLong[] = _("This name is too long.");
|
||||
ALIGNED(4) static const u8 sEnterAName[] = _("Please enter a name.");
|
@ -1,6 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "code_8012A18_1.h"
|
||||
#include "code_80130A8.h"
|
||||
#include "code_801602C.h"
|
||||
#include "code_8023868.h"
|
||||
#include "debug_menu4.h"
|
||||
#include "memory.h"
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "code_80118A4.h"
|
||||
#include "code_8012A18_1.h"
|
||||
#include "code_80130A8.h"
|
||||
#include "code_801602C.h"
|
||||
#include "code_801B3C0.h"
|
||||
#include "code_801BEEC.h"
|
||||
#include "code_801EE10.h"
|
||||
@ -61,8 +61,6 @@ EWRAM_DATA_2 unkStruct_203B2B4 *gUnknown_203B2B4 = {0};
|
||||
extern u8 sub_8002658(s16);
|
||||
extern void sub_808ED00(void);
|
||||
|
||||
extern void sub_80160D8(void);
|
||||
extern u32 sub_8016080(void);
|
||||
extern s32 sub_80144A4(s32 *);
|
||||
|
||||
void sub_8025434(s32);
|
||||
|
@ -254,8 +254,6 @@ extern void sub_8035210(void);
|
||||
extern void sub_8035430(void);
|
||||
extern void sub_8034848(void);
|
||||
|
||||
extern u32 sub_80154F0();
|
||||
extern void sub_80155F0();
|
||||
extern u32 sub_8030DA0(void);
|
||||
extern void sub_8030DE4(void);
|
||||
extern void sub_803092C(void);
|
||||
@ -271,11 +269,9 @@ extern u32 sub_8039068(u32, u8 *passwordBuffer, unkStruct_203B480 *r0);
|
||||
|
||||
extern void sub_803084C(void);
|
||||
extern void sub_8031E10(void);
|
||||
extern void sub_80155F0(void);
|
||||
extern void sub_802F2C0(void);
|
||||
extern void sub_8030DE4(void);
|
||||
extern u8 sub_800D588(void);
|
||||
extern void sub_80151C0(u32, u8 *);
|
||||
extern u32 sub_8023CE8(void);
|
||||
extern void sub_802F204(unkStruct_802F204 *, u32);
|
||||
extern u32 sub_80306A8(u32 wonderMailType, u32, UnkTextStruct2_sub *, u32);
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "input.h"
|
||||
#include "main_menu1.h"
|
||||
#include "memory.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "menu_input.h"
|
||||
#include "play_time.h"
|
||||
#include "pokemon.h"
|
||||
|
@ -1,8 +1,8 @@
|
||||
#include "global.h"
|
||||
#include "code_80118A4.h"
|
||||
#include "code_8012A18_1.h"
|
||||
#include "code_80130A8.h"
|
||||
#include "code_80130A8.h"
|
||||
#include "code_801602C.h"
|
||||
#include "code_801B3C0.h"
|
||||
#include "code_8097670.h"
|
||||
#include "code_8098BDC.h"
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "memory.h"
|
||||
#include "text1.h"
|
||||
#include "text2.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "input.h"
|
||||
#include "mailbox.h"
|
||||
#include "wonder_mail.h"
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "memory.h"
|
||||
#include "text1.h"
|
||||
#include "text2.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "input.h"
|
||||
#include "wonder_mail.h"
|
||||
#include "menu_input.h"
|
||||
|
@ -1,8 +1,8 @@
|
||||
#include "global.h"
|
||||
#include "bg_palette_buffer.h"
|
||||
#include "code_80118A4.h"
|
||||
#include "code_8012A18_1.h"
|
||||
#include "code_80130A8.h"
|
||||
#include "code_801602C.h"
|
||||
#include "code_8098BDC.h"
|
||||
#include "constants/emotions.h"
|
||||
#include "constants/input.h"
|
||||
@ -682,7 +682,7 @@ void NicknamePartner(void)
|
||||
|
||||
void PrintEndIntroText(void)
|
||||
{
|
||||
if (sub_8016080() != 0) {
|
||||
if (sub_8016080()) {
|
||||
sub_80160D8();
|
||||
sub_80141B4(gEndIntroText, 0, 0, 0x301);
|
||||
gPersonalityTestTracker->TestState = PERSONALITY_ADVANCE_TO_TEST_END;
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "code_80130A8.h"
|
||||
#include "memory.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "pokemon.h"
|
||||
#include "post_office_guide1.h"
|
||||
#include "text1.h"
|
||||
|
@ -243,11 +243,8 @@ ALIGNED(4) const u8 sUnknown_80E75CC[] = _("{CENTER_ALIGN}There is no space for
|
||||
|
||||
static const u8 fill0[] = "pksdir0";
|
||||
|
||||
extern void sub_80151C0(u32, u8 *);
|
||||
extern void sub_8031D70(u32, u32);
|
||||
extern void sub_80155F0(void);
|
||||
extern void sub_8031E10(void);
|
||||
extern u32 sub_80154F0(void);
|
||||
extern u32 sub_8031DCC(void);
|
||||
extern void sub_8031E00(void);
|
||||
|
||||
|
@ -211,12 +211,10 @@ extern void sub_802A828();
|
||||
extern void sub_802A850();
|
||||
extern void sub_8030DE4();
|
||||
extern void sub_803084C();
|
||||
extern void sub_80155F0();
|
||||
extern void sub_8031E10();
|
||||
extern void sub_802F2C0();
|
||||
extern void SetThankYouMailMenuState(u32);
|
||||
extern void sub_802F204(unkStruct_802F204 *, u32);
|
||||
extern void sub_80151C0(u32, u8 *);
|
||||
extern void sub_803092C(void);
|
||||
extern s32 sub_8037B28(u32);
|
||||
extern u32 sub_8030894(void);
|
||||
@ -227,7 +225,6 @@ extern void sub_8031D70(u8, u32);
|
||||
|
||||
extern void sub_803092C(void);
|
||||
extern void sub_8011C28(u32);
|
||||
extern u32 sub_80154F0(void);
|
||||
extern u32 sub_8039068(u32, u8 *r1, unkStruct_203B480 *r0);
|
||||
|
||||
|
||||
|
@ -43,10 +43,8 @@ extern u32 sub_8030DA0(void);
|
||||
extern void sub_8030DE4(void);
|
||||
extern void sub_803092C(void);
|
||||
|
||||
extern u32 sub_80154F0();
|
||||
extern u32 sub_8039068(u32, u8 *r1, unkStruct_203B480 *r0);
|
||||
extern void sub_8095274(u32);
|
||||
extern void sub_80155F0();
|
||||
extern u32 sub_8031DCC();
|
||||
extern void sub_8031E10();
|
||||
extern void sub_8031E00();
|
||||
@ -56,7 +54,6 @@ extern void sub_8030DE4();
|
||||
extern void sub_80306A8(u32, u32, u32, u32);
|
||||
extern s32 sub_8037B28(u32);
|
||||
extern void sub_8031D70(u8, u32);
|
||||
extern void sub_80151C0(u32, u8 *);
|
||||
extern u32 sub_8023CE8(void);
|
||||
extern u32 sub_8030894(void);
|
||||
extern void sub_8030F58(u32);
|
||||
@ -113,7 +110,6 @@ extern void sub_8028CFC(void);
|
||||
extern void sub_8028D4C(void);
|
||||
extern void sub_8031E10(void);
|
||||
extern void sub_803084C(void);
|
||||
extern void sub_80155F0(void);
|
||||
extern void sub_80310B4(void);
|
||||
extern void sub_8030DE4(void);
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "memory.h"
|
||||
#include "text1.h"
|
||||
#include "text2.h"
|
||||
#include "menu.h"
|
||||
#include "structs/menu.h"
|
||||
#include "code_802C39C.h"
|
||||
#include "menu_input.h"
|
||||
#include "wonder_mail_2_1.h"
|
||||
|
@ -120,11 +120,9 @@ extern u32 sub_8011C1C(void);
|
||||
extern void SetWonderMailMainMenuState(u8);
|
||||
extern void sub_8030DE4(void);
|
||||
extern void sub_803084C(void);
|
||||
extern void sub_80155F0(void);
|
||||
extern void sub_8031E10(void);
|
||||
|
||||
extern u8 sub_800D588(void);
|
||||
extern void sub_80151C0(u32, u8 *);
|
||||
extern void sub_802EF48(void);
|
||||
|
||||
|
||||
@ -138,7 +136,6 @@ extern u32 sub_802D0E0();
|
||||
extern bool8 GetWonderMailAccepted();
|
||||
extern void sub_802D184();
|
||||
|
||||
extern s32 sub_80154F0();
|
||||
extern bool8 DecodeWonderMailPassword(u8 *, WonderMail *);
|
||||
extern bool8 IsValidWonderMail(WonderMail *WonderMailData);
|
||||
|
||||
|
@ -135,9 +135,7 @@ gUnknown_203B1F8: /* 203B1F8 (sub_8015080 - sub_80151A4) */
|
||||
gUnknown_203B1FC: /* 203B1FC (sub_80151C0 - sub_8015F84) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_203B200: /* 203B200 (sub_801602C - IsNameEmpty) */
|
||||
.space 0x4
|
||||
|
||||
.include "src/code_801602C.o"
|
||||
.include "src/felicity_bank.o"
|
||||
.include "src/kangaskhan_storage1.o"
|
||||
.include "src/kangaskhan_storage2.o"
|
||||
|
Loading…
Reference in New Issue
Block a user