mirror of
https://github.com/pret/pmd-red.git
synced 2026-09-13 03:25:43 -05:00
Split kangaskhan storage and kecleon bros
This commit is contained in:
4
Makefile
4
Makefile
@@ -124,10 +124,6 @@ $(C_BUILDDIR)/agb_flash_mx.o: CC1FLAGS := -O -mthumb-interwork
|
||||
|
||||
$(C_BUILDDIR)/m4a.o: CC1 := tools/agbcc/bin/old_agbcc
|
||||
|
||||
# Stack size in sub_801A9E0 is funky with an unused var
|
||||
$(C_BUILDDIR)/kecleon_bros.o: CC1FLAGS := -mthumb-interwork -Wimplicit -Wparentheses -Werror -O2 -fhex-asm
|
||||
|
||||
|
||||
#### Main Rules ####
|
||||
|
||||
|
||||
|
||||
@@ -298,6 +298,7 @@ END_COLOR_TEXT_2 = 23 72 @ #r
|
||||
WHITE = 30 @ 0
|
||||
BLUE = 31 @ 1
|
||||
RED = 32 @ 2
|
||||
UNK_COLOR_2 = 02
|
||||
BLACK = 33 @ 3
|
||||
GREEN = 34 @ 4
|
||||
UNK_COLOR_4 = 04
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
.section .rodata
|
||||
|
||||
@ START code_80130A8 #1
|
||||
|
||||
.global UnkData_80D47C4
|
||||
UnkData_80D47C4:
|
||||
@@ -13,7 +14,6 @@ gUnknown_80D47C8: @ 80D47C8
|
||||
.byte 0x02, 0x00, 0x02, 0x00
|
||||
.byte 0x1a, 0x00, 0x0c, 0x00
|
||||
.byte 0x0c, 0x00, 0x00, 0x00
|
||||
|
||||
.4byte UnkData_80D47C4
|
||||
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
@@ -48,6 +48,9 @@ gUnknown_80D4830: @ 80D4830
|
||||
.byte 0x00, 0xe1, 0xf5, 0x05
|
||||
.asciz "pksdir0"
|
||||
|
||||
@ END code_80130A8 #1
|
||||
|
||||
@ START code_80130A8 #2
|
||||
|
||||
.global gUnknown_80D485C
|
||||
gUnknown_80D485C: @ 80D485C
|
||||
@@ -147,6 +150,10 @@ gUnknown_80D4910: @ 80D4910
|
||||
.align 2,0
|
||||
.string "pksdir0\0"
|
||||
|
||||
@ END code_80130A8 #2
|
||||
|
||||
@ START [some global strings]
|
||||
|
||||
.global Yes_80D491C
|
||||
Yes_80D491C:
|
||||
.string "Yes\0"
|
||||
@@ -547,8 +554,10 @@ gUnknown_80D53E0:
|
||||
.string "This is Felicity Bank.\0"
|
||||
.align 2, 0
|
||||
|
||||
@ START_EARLY kangaskhan #1
|
||||
|
||||
.global gKangaskhanStorageDialogue
|
||||
gKangaskhanStorageDialogue: @ 80D5404 (Kangaskhan Storage Dialogue)
|
||||
gKangaskhanStorageDialogue: @ 80D5404
|
||||
.4byte gUnknown_80D5E9C
|
||||
.4byte gUnknown_80D5E84
|
||||
.4byte gUnknown_80D5E60
|
||||
@@ -860,7 +869,7 @@ gUnknown_80D5E9C:
|
||||
.align 2, 0
|
||||
|
||||
.global gKecleonShopDialogue
|
||||
gKecleonShopDialogue: @ 80D5EC8 (Kecleon Wares Dialogue)
|
||||
gKecleonShopDialogue: @ 80D5EC8
|
||||
.4byte gUnknown_80D797C
|
||||
.4byte gUnknown_80D7958
|
||||
.4byte gUnknown_80D7934
|
||||
@@ -2766,6 +2775,10 @@ gUnknown_80DAF54:
|
||||
|
||||
.string "pksdir0\0"
|
||||
|
||||
@ END [some global strings]
|
||||
|
||||
@ START code_80130A8 #3
|
||||
|
||||
.global gUnknown_80DAF70
|
||||
gUnknown_80DAF70: @ 80DAF70
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
@@ -2794,6 +2807,11 @@ gUnknown_80DAFA0: @ 80DAFA0
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
|
||||
.string "pksdir0\0"
|
||||
|
||||
@ END code_80130A8 #3
|
||||
|
||||
@ START code_80130A8 #4
|
||||
|
||||
.global gUnknown_80DAFC0
|
||||
gUnknown_80DAFC0: @ 80DAFC0
|
||||
.2byte 3, 0xD
|
||||
@@ -3124,6 +3142,11 @@ gUnknown_80DB664: @ 80DB664
|
||||
.string "%s\0"
|
||||
.align 2,0
|
||||
.string "pksdir0\0"
|
||||
|
||||
@ END code_80130A8 #4
|
||||
|
||||
@ START code_8012A18_1
|
||||
|
||||
.align 2,0
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00
|
||||
@@ -3149,6 +3172,10 @@ gUnknown_80DB6BC: @ 80DB6BC
|
||||
.string "pksdir0\0"
|
||||
.align 2,0
|
||||
|
||||
@ END code_8012A18_1
|
||||
|
||||
@ START felicity_bank
|
||||
|
||||
.global gUnknown_80DB6DC
|
||||
gUnknown_80DB6DC: @ 80DB6DC
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
@@ -3192,272 +3219,4 @@ gUnknown_80DB738: @ 80DB738
|
||||
.align 2,0
|
||||
.string "pksdir0\0"
|
||||
|
||||
.global gUnknown_80DB748
|
||||
gUnknown_80DB748: @ 80DB748
|
||||
.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_80DB760
|
||||
gUnknown_80DB760: @ 80DB760
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x14, 0x00, 0x04, 0x00
|
||||
.byte 0x06, 0x00, 0x03, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
|
||||
.global gUnknown_80DB778
|
||||
gUnknown_80DB778: @ 80DB778
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x14, 0x00, 0x09, 0x00
|
||||
.byte 0x06, 0x00, 0x03, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
|
||||
.global gUnknown_80DB790
|
||||
gUnknown_80DB790: @ 80DB790
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x14, 0x00, 0x0e, 0x00
|
||||
.byte 0x06, 0x00, 0x04, 0x00
|
||||
.byte 0x04, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
|
||||
.global gUnknown_80DB7A8
|
||||
gUnknown_80DB7A8: @ 80DB7A8
|
||||
.string "Number?\0"
|
||||
.align 2,0
|
||||
.string "pksdir0\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_80DB7B8
|
||||
gUnknown_80DB7B8: @ 80DB7B8
|
||||
.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_80DB7D0
|
||||
gUnknown_80DB7D0: @ 80DB7D0
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x03, 0x00, 0x03, 0x00
|
||||
.byte 0x06, 0x00, 0x03, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
|
||||
.global gUnknown_80DB7E8
|
||||
gUnknown_80DB7E8: @ 80DB7E8
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x14, 0x00, 0x04, 0x00
|
||||
.byte 0x06, 0x00, 0x03, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
|
||||
.global gUnknown_80DB800
|
||||
gUnknown_80DB800: @ 80DB800
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x14, 0x00, 0x09, 0x00
|
||||
.byte 0x06, 0x00, 0x03, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
|
||||
.global gUnknown_80DB818
|
||||
gUnknown_80DB818: @ 80DB818
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x14, 0x00, 0x0e, 0x00
|
||||
.byte 0x06, 0x00, 0x04, 0x00
|
||||
.byte 0x04, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
|
||||
.global gUnknown_80DB830
|
||||
gUnknown_80DB830: @ 80DB830
|
||||
.string "Number?\0"
|
||||
.align 2,0
|
||||
.string "pksdir0\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_80DB840
|
||||
gUnknown_80DB840: @ 80DB840
|
||||
.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_80DB858
|
||||
gUnknown_80DB858: @ 80DB858
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x14, 0x00, 0x04, 0x00
|
||||
.byte 0x06, 0x00, 0x03, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
|
||||
.global gUnknown_80DB870
|
||||
gUnknown_80DB870: @ 80DB870
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x14, 0x00, 0x09, 0x00
|
||||
.byte 0x06, 0x00, 0x03, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
|
||||
.global gUnknown_80DB888
|
||||
gUnknown_80DB888: @ 80DB888
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x14, 0x00, 0x0e, 0x00
|
||||
.byte 0x06, 0x00, 0x03, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
|
||||
.global gUnknown_80DB8A0
|
||||
gUnknown_80DB8A0: @ 80DB8A0
|
||||
.string "Sell All\0"
|
||||
.align 2,0
|
||||
.string "pksdir0\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_80DB8B4
|
||||
gUnknown_80DB8B4: @ 80DB8B4
|
||||
.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_80DB8CC
|
||||
gUnknown_80DB8CC: @ 80DB8CC
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x06, 0x00, 0x00, 0x00
|
||||
.byte 0x02, 0x00, 0x02, 0x00
|
||||
.byte 0x10, 0x00, 0x04, 0x00
|
||||
.byte 0x06, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
|
||||
.global gUnknown_80DB8E4
|
||||
gUnknown_80DB8E4: @ 80DB8E4
|
||||
.string "Goods\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_80DB8EC
|
||||
gUnknown_80DB8EC: @ 80DB8EC
|
||||
.string "{COLOR_1 RED}%s{END_COLOR_TEXT_1}\0"
|
||||
.string "pksdir0\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_80DB8FC
|
||||
gUnknown_80DB8FC: @ 80DB8FC
|
||||
.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_80DB914
|
||||
gUnknown_80DB914: @ 80DB914
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x06, 0x00, 0x00, 0x00
|
||||
.byte 0x02, 0x00, 0x02, 0x00
|
||||
.byte 0x10, 0x00, 0x04, 0x00
|
||||
.byte 0x06, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
|
||||
.global gUnknown_80DB92C
|
||||
gUnknown_80DB92C: @ 80DB92C
|
||||
.string "Goods\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_80DB934
|
||||
gUnknown_80DB934: @ 80DB934
|
||||
.string "{COLOR_1 RED}%s{END_COLOR_TEXT_1}\0"
|
||||
.string "pksdir0\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_80DB944
|
||||
gUnknown_80DB944: @ 80DB944
|
||||
.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_80DB95C
|
||||
gUnknown_80DB95C: @ 80DB95C
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x06, 0x00, 0x00, 0x00
|
||||
.byte 0x02, 0x00, 0x02, 0x00
|
||||
.byte 0x10, 0x00, 0x11, 0x00
|
||||
.byte 0x13, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
|
||||
|
||||
.global gTeamToolboxA
|
||||
gTeamToolboxA: @ 80DB974
|
||||
.string "Team Toolbox A\0"
|
||||
.align 2,0
|
||||
|
||||
.global gTeamToolboxB
|
||||
gTeamToolboxB: @ 80DB984
|
||||
.string "Team Toolbox B\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_80DB994
|
||||
gUnknown_80DB994: @ 80DB994
|
||||
.string "{COLOR_1}"
|
||||
.byte 0x02
|
||||
.string "{ARG_MOVE_ITEM_0}{END_COLOR_TEXT_1}\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_80DB9A0
|
||||
gUnknown_80DB9A0: @ 80DB9A0
|
||||
.string "{COLOR_1 RED}%s{END_COLOR_TEXT_1}\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_80DB9A8
|
||||
gUnknown_80DB9A8: @ 80DB9A8
|
||||
.string "Items\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_80DB9B0
|
||||
gUnknown_80DB9B0: @ 80DB9B0
|
||||
.string "/\0"
|
||||
.align 2,0
|
||||
.string "pksdir0\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_80DB9BC
|
||||
gUnknown_80DB9BC: @ 80DB9BC
|
||||
.string "{CENTER_ALIGN}Who will learn the move\n"
|
||||
.string "{CENTER_ALIGN}{COLOR_1 CYAN}{ARG_POKEMON_7}{END_COLOR_TEXT_1}?\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_80DB9E4
|
||||
gUnknown_80DB9E4: @ 80DB9E4
|
||||
.string "{CENTER_ALIGN}{COLOR_1 CYAN_3}{ARG_POKEMON_8}{END_COLOR_TEXT_1} learned\n"
|
||||
.string "{CENTER_ALIGN}the move {COLOR_1 CYAN}{ARG_POKEMON_7}{END_COLOR_TEXT_1}!\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_80DBA0C
|
||||
gUnknown_80DBA0C: @ 80DBA0C
|
||||
.string "{CENTER_ALIGN}No one in the current team\n"
|
||||
.string "{CENTER_ALIGN}can learn this move. \0"
|
||||
.align 2,0
|
||||
.string "pksdir0\0"
|
||||
.align 2,0
|
||||
@ END FELICITY BANK
|
||||
29
include/code_801AFA4.h
Normal file
29
include/code_801AFA4.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef GUARD_CODE_801AFA4_H
|
||||
#define GUARD_CODE_801AFA4_H
|
||||
|
||||
#include "global.h"
|
||||
#include "constants/move.h"
|
||||
#include "menu.h"
|
||||
#include "pokemon.h"
|
||||
|
||||
// size: 0xA4
|
||||
typedef struct unkStruct_203B22C
|
||||
{
|
||||
/* 0x0 */ s32 state;
|
||||
/* 0x4 */ u32 teamItemIndex;
|
||||
/* 0x8 */ u8 id; // item index
|
||||
/* 0xA */ u16 moveID; // item move??
|
||||
/* 0xC */ Move moves[MAX_MON_MOVES * 2];
|
||||
/* 0x4C */ s32 monsAbleToLearnMove; // number of party members able to learn move
|
||||
/* 0x50 */ s16 unk50[MAX_TEAM_MEMBERS]; // species IDs of each member able to learn move
|
||||
/* 0x58 */ s16 chosenPokemon; // species of pokemon that will learn move
|
||||
/* 0x5C */ PokemonStruct1 *pokeStruct; // PokemonStruct of said pokemon
|
||||
u32 unk60;
|
||||
/* 0x64 */ MenuItem menuItems[8];
|
||||
} unkStruct_203B22C;
|
||||
|
||||
bool8 sub_801AFA4(u32);
|
||||
u32 sub_801B00C(void);
|
||||
void sub_801B048(void);
|
||||
|
||||
#endif // GUARD_CODE_801AFA4_H
|
||||
@@ -1,11 +1,21 @@
|
||||
#ifndef GUARD_KANGASKHAN_STORAGE_H
|
||||
#define GUARD_KANGASKHAN_STORAGE_H
|
||||
#ifndef GUARD_KANGASKHAN_STORAGE1_H
|
||||
#define GUARD_KANGASKHAN_STORAGE1_H
|
||||
|
||||
#include "file_system.h"
|
||||
#include "items.h"
|
||||
#include "menu.h"
|
||||
#include "text.h"
|
||||
|
||||
enum KangaskhanStorageStates
|
||||
{
|
||||
KANGASKHAN_STORAGE_INIT = 0,
|
||||
KANGASKHAN_STORAGE_MAIN_MENU = 1,
|
||||
KANGASKHAN_STORAGE_EXIT = 4,
|
||||
KANGASKHAN_STORAGE_NO_INV_ITEMS = 5,
|
||||
KANGASKHAN_STORAGE_TOO_MANY_ITEMS = 6,
|
||||
KANGASKHAN_STORAGE_IS_MONEY_USED_TM = 9,
|
||||
};
|
||||
|
||||
// size: 0x14C
|
||||
struct KangaskhanStorageWork
|
||||
{
|
||||
@@ -44,45 +54,8 @@ struct KangaskhanStorageWork
|
||||
UnkTextStruct2 unkEC[4];
|
||||
};
|
||||
|
||||
// size: 0x150
|
||||
struct unkStruct_203B20C
|
||||
{
|
||||
/* 0x0 */ u32 state;
|
||||
u8 unk4[4];
|
||||
/* 0x8 */ Item item;
|
||||
/* 0xC */ u32 itemIndex;
|
||||
/* 0x10 */ u8 id;
|
||||
/* 0x14 */ u32 menuAction1;
|
||||
/* 0x18 */ u32 menuAction2;
|
||||
/* 0x1C */ u32 menuAction3;
|
||||
MenuItem unk20[8];
|
||||
u16 unk60[8];
|
||||
MenuStruct unk70;
|
||||
u32 unkC0;
|
||||
u32 unkC4;
|
||||
u32 unkC8;
|
||||
u32 unkCC;
|
||||
u32 unkD0;
|
||||
u32 unkD4;
|
||||
UnkTextStruct2 *unkD8;
|
||||
u32 unkDC;
|
||||
u32 unkE0;
|
||||
u8 fillE4[0xF0 - 0xE4];
|
||||
UnkTextStruct2 unkF0[4];
|
||||
};
|
||||
|
||||
enum KangaskhanStorageStates
|
||||
{
|
||||
KANGASKHAN_STORAGE_INIT = 0,
|
||||
KANGASKHAN_STORAGE_MAIN_MENU = 1,
|
||||
KANGASKHAN_STORAGE_EXIT = 4,
|
||||
KANGASKHAN_STORAGE_NO_INV_ITEMS = 5,
|
||||
KANGASKHAN_STORAGE_TOO_MANY_ITEMS = 6,
|
||||
KANGASKHAN_STORAGE_IS_MONEY_USED_TM = 9,
|
||||
};
|
||||
|
||||
u32 CreateKangaskhanStorage(bool32 isAsleep);
|
||||
bool8 CreateKangaskhanStorage(u32);
|
||||
void DeleteKangaskhanStorage(void);
|
||||
u32 KangaskhanStorageCallback(void);
|
||||
|
||||
#endif
|
||||
#endif // GUARD_KANGASKHAN_STORAGE1_H
|
||||
39
include/kangaskhan_storage2.h
Normal file
39
include/kangaskhan_storage2.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#ifndef GUARD_KANGASKHAN_STORAGE2_H
|
||||
#define GUARD_KANGASKHAN_STORAGE2_H
|
||||
|
||||
#include "items.h"
|
||||
#include "menu.h"
|
||||
#include "text.h"
|
||||
|
||||
// size: 0x150
|
||||
struct unkStruct_203B20C
|
||||
{
|
||||
/* 0x0 */ u32 state;
|
||||
u8 unk4[4];
|
||||
/* 0x8 */ Item item;
|
||||
/* 0xC */ u32 itemIndex;
|
||||
/* 0x10 */ u8 id;
|
||||
/* 0x14 */ u32 menuAction1;
|
||||
/* 0x18 */ u32 menuAction2;
|
||||
/* 0x1C */ u32 menuAction3;
|
||||
MenuItem unk20[8];
|
||||
u16 unk60[8];
|
||||
MenuStruct unk70;
|
||||
u32 unkC0;
|
||||
u32 unkC4;
|
||||
u32 unkC8;
|
||||
u32 unkCC;
|
||||
u32 unkD0;
|
||||
u32 unkD4;
|
||||
UnkTextStruct2 *unkD8;
|
||||
u32 unkDC;
|
||||
u32 unkE0;
|
||||
u8 fillE4[0xF0 - 0xE4];
|
||||
UnkTextStruct2 unkF0[4];
|
||||
};
|
||||
|
||||
bool8 sub_8017E1C(void);
|
||||
u32 sub_8017E54(void);
|
||||
void sub_8017EF4(void);
|
||||
|
||||
#endif // GUARD_KANGASKHAN_STORAGE2_H
|
||||
@@ -1,13 +1,35 @@
|
||||
#ifndef GUARD_KECLEON_BROS_H
|
||||
#define GUARD_KECLEON_BROS_H
|
||||
#ifndef GUARD_KECLEON_BROS1_H
|
||||
#define GUARD_KECLEON_BROS1_H
|
||||
|
||||
#include "file_system.h"
|
||||
#include "items.h"
|
||||
#include "menu.h"
|
||||
#include "text.h"
|
||||
|
||||
enum KecleonBrosMode
|
||||
{
|
||||
KECLEON_BROS_MODE_ITEMS_AWAKE,
|
||||
KECLEON_BROS_MODE_ITEMS_ASLEEP,
|
||||
KECLEON_BROS_MODE_WARES_AWAKE,
|
||||
KECLEON_BROS_MODE_WARES_ASLEEP,
|
||||
KECLEON_BROS_MODE_COUNT
|
||||
};
|
||||
|
||||
enum KecleonStoreStates
|
||||
{
|
||||
KECLEON_STORE_INIT = 0,
|
||||
KECLEON_STORE_MAIN_MENU = 1,
|
||||
KECLEON_STORE_EXIT = 4,
|
||||
KECLEON_STORE_NO_STORE_ITEMS = 5,
|
||||
KECLEON_STORE_NO_MONEY = 6,
|
||||
KECLEON_STORE_NO_ITEMS_TO_SELL = 9,
|
||||
KECLEON_STORE_TOO_MANY_ITEMS = 10,
|
||||
KECLEON_STORE_NOT_ENOUGH_MONEY = 12,
|
||||
KECLEON_STORE_CANT_SELL_ITEM = 13,
|
||||
};
|
||||
|
||||
// size: 0x148
|
||||
struct KecleonBrosWork
|
||||
typedef struct KecleonBrosWork1
|
||||
{
|
||||
/* 0x0 */ u32 mode; // Corresponds to the enum: KecleonBrosMode
|
||||
/* 0x4 */ bool8 isKecleonItemShop; // FALSE indicates it is Kecleon TM Shop
|
||||
@@ -36,68 +58,11 @@ struct KecleonBrosWork
|
||||
u8 unkE3;
|
||||
OpenedFile **unkE4;
|
||||
UnkTextStruct2 unkE8[4];
|
||||
};
|
||||
|
||||
// size: 0xA0
|
||||
struct unkStruct_203B214
|
||||
{
|
||||
/* 0x0 */ MenuInputStruct input;
|
||||
u32 unk34;
|
||||
UnkTextStruct2 *unk38;
|
||||
UnkTextStruct2 unk3C[4];
|
||||
u8 unk9C[4];
|
||||
};
|
||||
|
||||
// size: 0xF4
|
||||
struct unkStruct_203B224
|
||||
{
|
||||
u32 unk0;
|
||||
u32 unk4[INVENTORY_SIZE];
|
||||
/* 0x54 */ MenuInputStruct input;
|
||||
u32 unk88;
|
||||
UnkTextStruct2 *unk8C;
|
||||
UnkTextStruct2 unk90[4];
|
||||
u8 unkF0[4];
|
||||
};
|
||||
|
||||
enum KecleonBrosMode
|
||||
{
|
||||
KECLEON_BROS_MODE_ITEMS_AWAKE,
|
||||
KECLEON_BROS_MODE_ITEMS_ASLEEP,
|
||||
KECLEON_BROS_MODE_WARES_AWAKE,
|
||||
KECLEON_BROS_MODE_WARES_ASLEEP,
|
||||
KECLEON_BROS_MODE_COUNT
|
||||
};
|
||||
|
||||
enum KecleonStoreStates
|
||||
{
|
||||
KECLEON_STORE_INIT = 0,
|
||||
KECLEON_STORE_MAIN_MENU = 1,
|
||||
KECLEON_STORE_EXIT = 4,
|
||||
KECLEON_STORE_NO_STORE_ITEMS = 5,
|
||||
KECLEON_STORE_NO_MONEY = 6,
|
||||
KECLEON_STORE_NO_ITEMS_TO_SELL = 9,
|
||||
KECLEON_STORE_TOO_MANY_ITEMS = 10,
|
||||
KECLEON_STORE_NOT_ENOUGH_MONEY = 12,
|
||||
KECLEON_STORE_CANT_SELL_ITEM = 13,
|
||||
};
|
||||
} KecleonBrosWork1;
|
||||
|
||||
// mode corresponds to the enum: KecleonBrosMode
|
||||
u32 CreateKecleonBros(u32 mode);
|
||||
bool8 CreateKecleonBros(u32 mode);
|
||||
void DeleteKecleonBros(void);
|
||||
u32 KecleonBrosCallback(void);
|
||||
|
||||
bool8 sub_801A5D8(u32, s32, UnkTextStruct2_sub *, u32);
|
||||
u32 sub_801A6E8(bool8);
|
||||
s32 sub_801A8AC(void);
|
||||
void sub_801A8D0(u8);
|
||||
void sub_801A928(void);
|
||||
void sub_801A9E0(void);
|
||||
void sub_801AD34(u32);
|
||||
bool8 sub_801ADA0(s32);
|
||||
void sub_801AE84(void);
|
||||
s32 sub_801AEA8(void);
|
||||
s32 sub_801AED0(s32);
|
||||
void sub_801AEE4(s32, s32);
|
||||
|
||||
#endif // GUARD_KECLEON_BROS_H
|
||||
#endif // GUARD_KECLEON_BROS1_H
|
||||
24
include/kecleon_bros2.h
Normal file
24
include/kecleon_bros2.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef GUARD_KECLEON_BROS2_H
|
||||
#define GUARD_KECLEON_BROS2_H
|
||||
|
||||
#include "input.h"
|
||||
#include "text.h"
|
||||
|
||||
// size: 0xA0
|
||||
struct unkStruct_203B214
|
||||
{
|
||||
/* 0x0 */ MenuInputStruct input;
|
||||
u32 unk34;
|
||||
UnkTextStruct2 *unk38;
|
||||
UnkTextStruct2 unk3C[4];
|
||||
u8 unk9C[4];
|
||||
};
|
||||
|
||||
bool8 sub_8019E40(u32);
|
||||
u32 sub_8019EDC(u8);
|
||||
u8 sub_8019FB0(void);
|
||||
void sub_8019FCC(bool8);
|
||||
void sub_801A010(void);
|
||||
void sub_801A0D8(void);
|
||||
|
||||
#endif // GUARD_KECLEON_BROS2_H
|
||||
24
include/kecleon_bros3.h
Normal file
24
include/kecleon_bros3.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef GUARD_KECLEON_BROS3_H
|
||||
#define GUARD_KECLEON_BROS3_H
|
||||
|
||||
#include "input.h"
|
||||
#include "text.h"
|
||||
|
||||
// size: 0xA0
|
||||
struct unkStruct_203B21C
|
||||
{
|
||||
/* 0x0 */ MenuInputStruct input;
|
||||
u32 unk34;
|
||||
UnkTextStruct2 *unk38;
|
||||
UnkTextStruct2 unk3C[4];
|
||||
u8 unk9C[4];
|
||||
};
|
||||
|
||||
u8 sub_801A20C(u32);
|
||||
u32 sub_801A2A8(u8);
|
||||
u8 sub_801A37C(void);
|
||||
void sub_801A398(u8);
|
||||
void sub_801A3DC(void);
|
||||
void sub_801A4A4(void);
|
||||
|
||||
#endif // GUARD_KECLEON_BROS3_H
|
||||
33
include/kecleon_bros4.h
Normal file
33
include/kecleon_bros4.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef GUARD_KECLEON_BROS4_H
|
||||
#define GUARD_KECLEON_BROS4_H
|
||||
|
||||
#include "constants/item.h"
|
||||
#include "input.h"
|
||||
#include "text.h"
|
||||
|
||||
// size: 0xF4
|
||||
struct unkStruct_203B224
|
||||
{
|
||||
u32 unk0;
|
||||
u32 unk4[INVENTORY_SIZE];
|
||||
/* 0x54 */ MenuInputStruct input;
|
||||
u32 unk88;
|
||||
UnkTextStruct2 *unk8C;
|
||||
UnkTextStruct2 unk90[4];
|
||||
u8 unkF0[4];
|
||||
};
|
||||
|
||||
bool8 sub_801A5D8(u32, s32, UnkTextStruct2_sub *, u32);
|
||||
u32 sub_801A6E8(bool8);
|
||||
s32 sub_801A8AC(void);
|
||||
void sub_801A8D0(bool8);
|
||||
void sub_801A928(void);
|
||||
void sub_801A9E0(void);
|
||||
void sub_801AD34(u32);
|
||||
bool8 sub_801ADA0(s32);
|
||||
void sub_801AE84(void);
|
||||
s32 sub_801AEA8(void);
|
||||
s32 sub_801AED0(s32);
|
||||
void sub_801AEE4(s32, s32);
|
||||
|
||||
#endif // GUARD_KECLEON_BROS4_H
|
||||
@@ -251,5 +251,6 @@ extern PokemonStruct1 *GetPlayerPokemonStruct(void);
|
||||
extern void sub_808CFD0(u8 *, s16, u8 *, u8, u32 *, u16 *);
|
||||
extern u32 sub_808D1DC(u8 *);
|
||||
extern s32 sub_808D544(u32);
|
||||
extern s32 sub_808D580(s32 *);
|
||||
|
||||
#endif // GUARD_POKEMON_H
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#ifndef GUARD_POKEMON_MID_H
|
||||
#define GUARD_POKEMON_MID_H
|
||||
|
||||
#include "pokemon.h"
|
||||
|
||||
void PrintPokeNameToBuffer(u8 *, PokemonStruct1 *);
|
||||
|
||||
bool8 sub_808DA44(s32, u32);
|
||||
|
||||
#endif // GUARD_POKEMON_MID_H
|
||||
@@ -33,7 +33,7 @@ typedef struct UnkTextStruct2_sub
|
||||
{
|
||||
// I haven't found a func that reads these separately yet, but simply making an arr[2] will cause assignments to break.
|
||||
// Some funcs only match with this union for some reason even though they don't access the variables separately...
|
||||
// The first func to break is currently sub_801A5D8 in kecleon_bros.c
|
||||
// The first func to break is currently sub_801A5D8 in kecleon_bros4.c
|
||||
// The first func I matched that uses the array is sub_8006554 in text2.c (using the separated fields doesn't match or get even close)
|
||||
union {
|
||||
struct {
|
||||
|
||||
@@ -21,7 +21,7 @@ SECTIONS {
|
||||
*libc.a:impure.o(.data);
|
||||
*libc.a:locale.o(.data);
|
||||
*libc.a:mallocr.o(.data);
|
||||
gUnknown_203BC04 = .;
|
||||
ewram2_end = .;
|
||||
. = 0x40000;
|
||||
}
|
||||
|
||||
@@ -90,8 +90,12 @@ SECTIONS {
|
||||
asm/code_80130A8.o(.text);
|
||||
src/code_8012A18_1.o(.text);
|
||||
src/felicity_bank.o(.text);
|
||||
src/kangaskhan_storage.o(.text);
|
||||
src/kecleon_bros.o(.text);
|
||||
src/kangaskhan_storage1.o(.text);
|
||||
src/kangaskhan_storage2.o(.text);
|
||||
src/kecleon_bros1.o(.text);
|
||||
src/kecleon_bros2.o(.text);
|
||||
src/kecleon_bros3.o(.text);
|
||||
src/kecleon_bros4.o(.text);
|
||||
src/code_801AFA4.o(.text);
|
||||
src/code_801B3C0.o(.text);
|
||||
src/code_801B60C.o(.text);
|
||||
@@ -384,6 +388,13 @@ SECTIONS {
|
||||
src/save.o(.rodata);
|
||||
src/menu_input.o(.rodata);
|
||||
data/data_80D47B8.o(.rodata);
|
||||
src/kangaskhan_storage1.o(.rodata);
|
||||
src/kangaskhan_storage2.o(.rodata);
|
||||
src/kecleon_bros1.o(.rodata);
|
||||
src/kecleon_bros2.o(.rodata);
|
||||
src/kecleon_bros3.o(.rodata);
|
||||
src/kecleon_bros4.o(.rodata);
|
||||
src/code_801AFA4.o(.rodata);
|
||||
src/code_801B3C0.o(.rodata);
|
||||
src/code_801B60C.o(.rodata);
|
||||
data/data_80DBD98.o(.rodata);
|
||||
|
||||
@@ -1,81 +1,52 @@
|
||||
#include "global.h"
|
||||
#include "code_80118A4.h"
|
||||
#include "code_80130A8.h"
|
||||
#include "code_801AFA4.h"
|
||||
#include "code_8098DBC.h"
|
||||
#include "gulpin_shop.h"
|
||||
#include "items.h"
|
||||
#include "memory.h"
|
||||
#include "menu.h"
|
||||
#include "moves.h"
|
||||
#include "pokemon.h"
|
||||
#include "text.h"
|
||||
#include "pokemon_mid.h"
|
||||
|
||||
extern s32 GetNumMonsAbleToLearnItemMove(void);
|
||||
extern void sub_801B064(s32);
|
||||
extern u8 gAvailablePokemonNames[]; // 202DF98
|
||||
extern u8 gUnknown_202E1C8[];
|
||||
extern u8 gUnknown_202E218[160];
|
||||
|
||||
static EWRAM_DATA_2 unkStruct_203B22C *sUnknown_203B22C = {0};
|
||||
|
||||
extern void sub_801B200(void);
|
||||
extern void sub_801B2AC(void);
|
||||
extern void sub_801B2D8(void);
|
||||
extern void nullsub_37();
|
||||
extern void sub_801B080();
|
||||
#include "data/code_801AFA4.h"
|
||||
|
||||
extern const u8 gUnknown_80DB9BC[];
|
||||
extern const u8 gUnknown_80DB9E4[];
|
||||
extern const u8 gUnknown_80DBA0C[];
|
||||
static s32 GetNumMonsAbleToLearnItemMove(void);
|
||||
static void nullsub_37(void);
|
||||
|
||||
extern u8 gUnknown_202E1C8[0x50];
|
||||
extern u8 gAvailablePokemonNames[0x50];
|
||||
extern u8 gUnknown_202E218[0x50];
|
||||
static void sub_801B064(s32);
|
||||
static void sub_801B080(void);
|
||||
static void sub_801B178(void);
|
||||
static void sub_801B200(void);
|
||||
static void sub_801B2AC(void);
|
||||
static void sub_801B2D8(void);
|
||||
|
||||
extern bool8 IsHMItem(u8);
|
||||
extern void sub_801B178(void);
|
||||
extern void PrintPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon);
|
||||
|
||||
extern bool8 CanMonLearnMove(u16 moveID, s16 _species);
|
||||
extern s32 sub_808D580(s32*);
|
||||
|
||||
struct unkStruct_203B22C
|
||||
bool8 sub_801AFA4(u32 index)
|
||||
{
|
||||
// size: 0xa4
|
||||
/* 0x0 */ s32 state;
|
||||
/* 0x4 */ u32 teamItemIndex;
|
||||
/* 0x8 */ u8 id; // item index
|
||||
/* 0xA */ u16 moveID; // item move??
|
||||
/* 0xC */ Move moves[MAX_MON_MOVES * 2];
|
||||
/* 0x4C */ s32 monsAbleToLearnMove; // number of party members able to learn move
|
||||
/* 0x50 */ s16 unk50[MAX_TEAM_MEMBERS]; // species IDs of each member able to learn move
|
||||
/* 0x58 */ s16 chosenPokemon; // species of pokemon that will learn move
|
||||
/* 0x5C */ PokemonStruct1 *pokeStruct; // PokemonStruct of said pokemon
|
||||
u32 unk60;
|
||||
/* 0x64 */ MenuItem menuItems[8];
|
||||
};
|
||||
extern struct unkStruct_203B22C *gUnknown_203B22C;
|
||||
|
||||
u32 sub_801AFA4(u32 index)
|
||||
{
|
||||
gUnknown_203B22C = MemoryAlloc(sizeof(struct unkStruct_203B22C), 8);
|
||||
gUnknown_203B22C->teamItemIndex = index;
|
||||
gUnknown_203B22C->id = gTeamInventoryRef->teamItems[index].id;
|
||||
gUnknown_203B22C->moveID = GetItemMoveID(gUnknown_203B22C->id);
|
||||
sub_8092C84(gUnknown_202E1C8, gUnknown_203B22C->moveID);
|
||||
sUnknown_203B22C = MemoryAlloc(sizeof(unkStruct_203B22C), 8);
|
||||
sUnknown_203B22C->teamItemIndex = index;
|
||||
sUnknown_203B22C->id = gTeamInventoryRef->teamItems[index].id;
|
||||
sUnknown_203B22C->moveID = GetItemMoveID(sUnknown_203B22C->id);
|
||||
sub_8092C84(gUnknown_202E1C8, sUnknown_203B22C->moveID);
|
||||
sub_8099690(0);
|
||||
if(GetNumMonsAbleToLearnItemMove() == 0)
|
||||
{
|
||||
|
||||
if (GetNumMonsAbleToLearnItemMove() == 0)
|
||||
sub_801B064(3);
|
||||
}
|
||||
else
|
||||
{
|
||||
gUnknown_203B22C->unk60 = 4;
|
||||
else {
|
||||
sUnknown_203B22C->unk60 = 4;
|
||||
sub_801B064(0);
|
||||
}
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u32 sub_801B00C(void)
|
||||
{
|
||||
switch(gUnknown_203B22C->state)
|
||||
{
|
||||
switch (sUnknown_203B22C->state) {
|
||||
case 4:
|
||||
return 3;
|
||||
case 0:
|
||||
@@ -93,53 +64,44 @@ u32 sub_801B00C(void)
|
||||
|
||||
void sub_801B048(void)
|
||||
{
|
||||
if(gUnknown_203B22C != NULL)
|
||||
{
|
||||
MemoryFree(gUnknown_203B22C);
|
||||
gUnknown_203B22C = NULL;
|
||||
if (sUnknown_203B22C != NULL) {
|
||||
MemoryFree(sUnknown_203B22C);
|
||||
sUnknown_203B22C = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_801B064(s32 newState)
|
||||
static void sub_801B064(s32 newState)
|
||||
{
|
||||
gUnknown_203B22C->state = newState;
|
||||
sUnknown_203B22C->state = newState;
|
||||
nullsub_37();
|
||||
sub_801B080();
|
||||
}
|
||||
|
||||
void nullsub_37(void)
|
||||
static void nullsub_37(void)
|
||||
{
|
||||
}
|
||||
|
||||
void sub_801B080(void)
|
||||
static void sub_801B080(void)
|
||||
{
|
||||
switch(gUnknown_203B22C->state)
|
||||
{
|
||||
switch (sUnknown_203B22C->state) {
|
||||
case 0:
|
||||
sub_801B178();
|
||||
// {CENTER_ALIGN}Who will learn the move
|
||||
// {CENTER_ALIGN}{COLOR_1 CYAN}{ARG_POKEMON_7}{END_COLOR_TEXT_1}?
|
||||
sub_8014248(gUnknown_80DB9BC, 0, gUnknown_203B22C->unk60, gUnknown_203B22C->menuItems, 0, 4, 0, 0, 0x20);
|
||||
sub_8014248(sFmtWhoWillLearnTheMove, 0, sUnknown_203B22C->unk60, sUnknown_203B22C->menuItems, 0, 4, 0, NULL, 32);
|
||||
break;
|
||||
case 1:
|
||||
CreateGulpinShop(2, gUnknown_203B22C->chosenPokemon, gUnknown_203B22C->moves);
|
||||
CreateGulpinShop(2, sUnknown_203B22C->chosenPokemon, sUnknown_203B22C->moves);
|
||||
break;
|
||||
case 2:
|
||||
sub_8094060(gUnknown_203B22C->moves, gUnknown_203B22C->pokeStruct->moves);
|
||||
if(!IsHMItem(gUnknown_203B22C->id))
|
||||
{
|
||||
gTeamInventoryRef->teamItems[gUnknown_203B22C->teamItemIndex].quantity = gUnknown_203B22C->id - 0x7D;
|
||||
gTeamInventoryRef->teamItems[gUnknown_203B22C->teamItemIndex].id = ITEM_TM_USED_TM;
|
||||
sub_8094060(sUnknown_203B22C->moves, sUnknown_203B22C->pokeStruct->moves);
|
||||
if (!IsHMItem(sUnknown_203B22C->id)) {
|
||||
gTeamInventoryRef->teamItems[sUnknown_203B22C->teamItemIndex].quantity = sUnknown_203B22C->id - 125;
|
||||
gTeamInventoryRef->teamItems[sUnknown_203B22C->teamItemIndex].id = ITEM_TM_USED_TM;
|
||||
}
|
||||
PlaySound(0x9C << 1);
|
||||
// {CENTER_ALIGN}CM{ARG_POKEMON_8}{END_COLOR_TEXT_1} learned
|
||||
// {CENTER_ALIGN}the move {COLOR_1 CYAN}{ARG_POKEMON_7}{END_COLOR_TEXT_1}!
|
||||
sub_80141B4(gUnknown_80DB9E4, 0, 0, 0x121);
|
||||
PlaySound(312);
|
||||
sub_80141B4(sFmtLearnedTheMove, 0, 0, 0x121);
|
||||
break;
|
||||
case 3:
|
||||
// {CENTER_ALIGN}No one in the current team
|
||||
// {CENTER_ALIGN}can learn this move.
|
||||
sub_80141B4(gUnknown_80DBA0C, 0, 0, 0x121);
|
||||
sub_80141B4(sFmtNoOneCanLearnThisMove, 0, 0, 0x121);
|
||||
break;
|
||||
default:
|
||||
case 4:
|
||||
@@ -147,65 +109,64 @@ void sub_801B080(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_801B178(void)
|
||||
static void sub_801B178(void)
|
||||
{
|
||||
int monIndex;
|
||||
s32 monIndex;
|
||||
u8 *bufferPtr;
|
||||
|
||||
for(monIndex = 0; monIndex < gUnknown_203B22C->monsAbleToLearnMove; monIndex++)
|
||||
{
|
||||
bufferPtr = gAvailablePokemonNames + (0x50 * monIndex);
|
||||
PrintPokeNameToBuffer(bufferPtr, &gRecruitedPokemonRef->pokemon[gUnknown_203B22C->unk50[monIndex]]);
|
||||
gUnknown_203B22C->menuItems[monIndex].text = bufferPtr;
|
||||
gUnknown_203B22C->menuItems[monIndex].menuAction = monIndex + 4;
|
||||
for (monIndex = 0; monIndex < sUnknown_203B22C->monsAbleToLearnMove; monIndex++) {
|
||||
bufferPtr = gAvailablePokemonNames + (80 * monIndex);
|
||||
PrintPokeNameToBuffer(bufferPtr, &gRecruitedPokemonRef->pokemon[sUnknown_203B22C->unk50[monIndex]]);
|
||||
sUnknown_203B22C->menuItems[monIndex].text = bufferPtr;
|
||||
sUnknown_203B22C->menuItems[monIndex].menuAction = monIndex + 4;
|
||||
}
|
||||
gUnknown_203B22C->menuItems[monIndex].text = NULL;
|
||||
gUnknown_203B22C->menuItems[monIndex].menuAction = 1;
|
||||
|
||||
sUnknown_203B22C->menuItems[monIndex].text = NULL;
|
||||
sUnknown_203B22C->menuItems[monIndex].menuAction = 1;
|
||||
}
|
||||
|
||||
void sub_801B200(void)
|
||||
static void sub_801B200(void)
|
||||
{
|
||||
s32 temp;
|
||||
s32 moveIndex;
|
||||
Move *pokeMove;
|
||||
|
||||
if(sub_80144A4(&temp) == 0)
|
||||
{
|
||||
gUnknown_203B22C->unk60 = temp;
|
||||
switch(temp)
|
||||
{
|
||||
case 1:
|
||||
sub_801B064(4);
|
||||
break;
|
||||
default:
|
||||
gUnknown_203B22C->chosenPokemon = gUnknown_203B22C->unk50[temp - 4];
|
||||
gUnknown_203B22C->pokeStruct = &gRecruitedPokemonRef->pokemon[gUnknown_203B22C->chosenPokemon];
|
||||
PrintPokeNameToBuffer(gUnknown_202E218, gUnknown_203B22C->pokeStruct);
|
||||
unk_CopyMoves4To8(gUnknown_203B22C->moves, gUnknown_203B22C->pokeStruct->moves);
|
||||
for(moveIndex = 0; moveIndex < MAX_MON_MOVES * 2; moveIndex++)
|
||||
{
|
||||
pokeMove = &gUnknown_203B22C->moves[moveIndex];
|
||||
if((pokeMove->moveFlags & MOVE_FLAG_EXISTS) == 0)
|
||||
{
|
||||
InitZeroedPPPokemonMove(pokeMove, gUnknown_203B22C->moveID);
|
||||
break;
|
||||
}
|
||||
if (sub_80144A4(&temp))
|
||||
return;
|
||||
|
||||
sUnknown_203B22C->unk60 = temp;
|
||||
switch (temp) {
|
||||
case 1:
|
||||
sub_801B064(4);
|
||||
break;
|
||||
default:
|
||||
sUnknown_203B22C->chosenPokemon = sUnknown_203B22C->unk50[temp - 4];
|
||||
sUnknown_203B22C->pokeStruct = &gRecruitedPokemonRef->pokemon[sUnknown_203B22C->chosenPokemon];
|
||||
PrintPokeNameToBuffer(gUnknown_202E218, sUnknown_203B22C->pokeStruct);
|
||||
unk_CopyMoves4To8(sUnknown_203B22C->moves, sUnknown_203B22C->pokeStruct->moves);
|
||||
|
||||
for (moveIndex = 0; moveIndex < MAX_MON_MOVES * 2; moveIndex++) {
|
||||
pokeMove = &sUnknown_203B22C->moves[moveIndex];
|
||||
|
||||
if ((pokeMove->moveFlags & MOVE_FLAG_EXISTS) == 0) {
|
||||
InitZeroedPPPokemonMove(pokeMove, sUnknown_203B22C->moveID);
|
||||
break;
|
||||
}
|
||||
if(moveIndex >= MAX_MON_MOVES)
|
||||
sub_801B064(1);
|
||||
else
|
||||
sub_801B064(2);
|
||||
break;
|
||||
case 0:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (moveIndex >= MAX_MON_MOVES)
|
||||
sub_801B064(1);
|
||||
else
|
||||
sub_801B064(2);
|
||||
break;
|
||||
case 0:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_801B2AC(void)
|
||||
static void sub_801B2AC(void)
|
||||
{
|
||||
switch(sub_801E8C0())
|
||||
{
|
||||
switch (sub_801E8C0()) {
|
||||
case 3:
|
||||
DestroyGulpinShop();
|
||||
sub_801B064(2);
|
||||
@@ -220,56 +181,52 @@ void sub_801B2AC(void)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void sub_801B2D8(void)
|
||||
static void sub_801B2D8(void)
|
||||
{
|
||||
s32 temp;
|
||||
|
||||
if(sub_80144A4(&temp) == 0)
|
||||
{
|
||||
if (sub_80144A4(&temp) == 0)
|
||||
sub_801B064(4);
|
||||
}
|
||||
}
|
||||
|
||||
s32 GetNumMonsAbleToLearnItemMove(void)
|
||||
static s32 GetNumMonsAbleToLearnItemMove(void)
|
||||
{
|
||||
s32 length;
|
||||
s32 numMons;
|
||||
s32 index;
|
||||
s32 team [MAX_TEAM_MEMBERS];
|
||||
s32 i;
|
||||
s32 team[MAX_TEAM_MEMBERS];
|
||||
PokemonStruct1 *preload;
|
||||
|
||||
length = sub_808D580(team);
|
||||
gUnknown_203B22C->monsAbleToLearnMove = 0;
|
||||
sUnknown_203B22C->monsAbleToLearnMove = 0;
|
||||
|
||||
for(index = 0; index < length; index++)
|
||||
{
|
||||
preload = &gRecruitedPokemonRef->pokemon[team[index]];
|
||||
if (CanMonLearnMove(gUnknown_203B22C->moveID, preload->speciesNum)) {
|
||||
gUnknown_203B22C->unk50[gUnknown_203B22C->monsAbleToLearnMove] = team[index];
|
||||
numMons = gUnknown_203B22C->monsAbleToLearnMove;
|
||||
if (numMons >= MAX_TEAM_MEMBERS) break;
|
||||
gUnknown_203B22C->monsAbleToLearnMove = numMons + 1;
|
||||
for (i = 0; i < length; i++) {
|
||||
preload = &gRecruitedPokemonRef->pokemon[team[i]];
|
||||
|
||||
if (CanMonLearnMove(sUnknown_203B22C->moveID, preload->speciesNum)) {
|
||||
sUnknown_203B22C->unk50[sUnknown_203B22C->monsAbleToLearnMove] = team[i];
|
||||
numMons = sUnknown_203B22C->monsAbleToLearnMove;
|
||||
if (numMons >= MAX_TEAM_MEMBERS)
|
||||
break;
|
||||
sUnknown_203B22C->monsAbleToLearnMove = numMons + 1;
|
||||
}
|
||||
}
|
||||
return gUnknown_203B22C->monsAbleToLearnMove;
|
||||
return sUnknown_203B22C->monsAbleToLearnMove;
|
||||
}
|
||||
|
||||
// Unused
|
||||
bool8 sub_801B374(u8 id)
|
||||
UNUSED static bool8 sub_801B374(u8 id)
|
||||
{
|
||||
u16 moveID;
|
||||
PokemonStruct1 *pokeStruct;
|
||||
s32 index;
|
||||
u16 moveID;
|
||||
PokemonStruct1 *pokeStruct;
|
||||
s32 i;
|
||||
|
||||
pokeStruct = &gRecruitedPokemonRef->pokemon[0];
|
||||
moveID = GetItemMoveID(id);
|
||||
pokeStruct = &gRecruitedPokemonRef->pokemon[0];
|
||||
moveID = GetItemMoveID(id);
|
||||
|
||||
for(index = 0; index < NUM_MONSTERS; index++, pokeStruct++)
|
||||
{
|
||||
if((pokeStruct->unk0 >> 1 & 1) != 0)
|
||||
if(CanMonLearnMove(moveID, pokeStruct->speciesNum))
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
for (i = 0; i < NUM_MONSTERS; i++, pokeStruct++) {
|
||||
if ((pokeStruct->unk0 >> 1) & 1)
|
||||
if (CanMonLearnMove(moveID, pokeStruct->speciesNum))
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "code_8098DBC.h"
|
||||
#include "constants/colors.h"
|
||||
#include "items.h"
|
||||
#include "kecleon_bros.h"
|
||||
#include "kecleon_bros4.h"
|
||||
#include "memory.h"
|
||||
#include "menu_input.h"
|
||||
#include "pokemon.h"
|
||||
@@ -243,10 +243,10 @@ store:
|
||||
sub_8014248(sFmtConfirmThrowAway, 0, 3, sUnknown_203B234->unkCC, 0, 4, 0, 0, 0);
|
||||
break;
|
||||
case 8:
|
||||
sub_801A5D8(1, 3, 0, 10);
|
||||
sub_801A5D8(1, 3, NULL, 10);
|
||||
break;
|
||||
case 9:
|
||||
sub_801A8D0(1);
|
||||
sub_801A8D0(TRUE);
|
||||
break;
|
||||
case 10:
|
||||
sub_801A9E0();
|
||||
|
||||
@@ -1,23 +1,24 @@
|
||||
#include "global.h"
|
||||
#include "code_800D090.h"
|
||||
#include "code_80118A4.h"
|
||||
#include "code_80130A8.h"
|
||||
#include "code_801AFA4.h"
|
||||
#include "code_801B3C0.h"
|
||||
#include "code_8023144.h"
|
||||
#include "code_8098DBC.h"
|
||||
#include "constants/colors.h"
|
||||
#include "constants/input.h"
|
||||
#include "constants/iq_skill.h"
|
||||
#include "exclusive_pokemon.h"
|
||||
#include "friend_area.h"
|
||||
#include "items.h"
|
||||
#include "kecleon_bros4.h"
|
||||
#include "memory.h"
|
||||
#include "menu_input.h"
|
||||
#include "pokemon.h"
|
||||
#include "pokemon_3.h"
|
||||
#include "code_801B3C0.h"
|
||||
#include "text1.h"
|
||||
#include "text2.h"
|
||||
#include "items.h"
|
||||
#include "menu_input.h"
|
||||
#include "friend_area.h"
|
||||
#include "kecleon_bros.h"
|
||||
#include "code_80130A8.h"
|
||||
#include "code_80118A4.h"
|
||||
#include "exclusive_pokemon.h"
|
||||
#include "code_8098DBC.h"
|
||||
|
||||
IWRAM_DATA unkStruct_3001B5C *gUnknown_3001B5C;
|
||||
unkStruct_203B294 *gUnknown_203B294;
|
||||
@@ -44,8 +45,6 @@ extern u8 gUnknown_80DC8F8[];
|
||||
extern u8 *gUnknown_80D4940[];
|
||||
extern u8 *gUnknown_80D4970[];
|
||||
extern void sub_8022924(s32);
|
||||
extern u32 sub_801B00C(void);
|
||||
extern void sub_801B048(void);
|
||||
|
||||
void GetGummiItemStatBoost(PokemonStruct1* pokemon, u8 id, bool8 checkBoostFlags, Gummi *gummi);
|
||||
|
||||
@@ -363,7 +362,7 @@ void sub_80233A0(void)
|
||||
}
|
||||
}
|
||||
|
||||
NAKED
|
||||
NAKED // sub_80095E4 memes
|
||||
void sub_8023420(void)
|
||||
{
|
||||
asm_unified(
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#include "global.h"
|
||||
#include "code_8094F88.h"
|
||||
#include "constants/wonder_mail.h"
|
||||
#include "dungeon.h"
|
||||
#include "memory.h"
|
||||
#include "moves.h"
|
||||
#include "dungeon.h"
|
||||
#include "pokemon_mid.h"
|
||||
#include "random.h"
|
||||
#include "save.h"
|
||||
#include "text_util.h"
|
||||
@@ -25,7 +26,6 @@ extern void xxx_save_poke_sub_c_808F41C(struct unkStruct_8094924* a1, struct unk
|
||||
extern void xxx_restore_poke_sub_c_808F410(struct unkStruct_8094924*, struct unkPokeSubStruct_C*);
|
||||
|
||||
extern s32 sub_8094E4C(void);
|
||||
extern void PrintPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon);
|
||||
extern void sub_8094D28(s32);
|
||||
|
||||
void sub_80950BC(void)
|
||||
|
||||
@@ -6,7 +6,7 @@ extern void sub_80A7094(struct axPokemon *, u32, u32, u32);
|
||||
extern void sub_80A7310(struct axPokemon *, u32, u32, u32);
|
||||
extern void sub_80A7784();
|
||||
|
||||
static EWRAM_DATA_2 s16 sUnknown_2039DE0;
|
||||
static EWRAM_DATA s16 sUnknown_2039DE0;
|
||||
|
||||
extern const u32 gUnknown_8117EFC;
|
||||
extern const u32 *gMapScriptTable[]; // 811E2F8
|
||||
@@ -65,7 +65,7 @@ bool8 sub_80A77A0(s16 a0)
|
||||
}
|
||||
|
||||
// TODO review this later
|
||||
u32 *sub_80A77D0(s16 a0)
|
||||
const u32 *sub_80A77D0(s16 a0)
|
||||
{
|
||||
if (a0 != -1)
|
||||
return gMapScriptTable[a0];
|
||||
|
||||
10
src/data/code_801AFA4.h
Normal file
10
src/data/code_801AFA4.h
Normal file
@@ -0,0 +1,10 @@
|
||||
ALIGNED(4) static const u8 sFmtWhoWillLearnTheMove[] = _(
|
||||
"{CENTER_ALIGN}Who will learn the move\n"
|
||||
"{CENTER_ALIGN}{COLOR_1 CYAN}{ARG_POKEMON_7}{END_COLOR_TEXT_1}?");
|
||||
ALIGNED(4) static const u8 sFmtLearnedTheMove[] = _(
|
||||
"{CENTER_ALIGN}{COLOR_1 CYAN_3}{ARG_POKEMON_8}{END_COLOR_TEXT_1} learned\n"
|
||||
"{CENTER_ALIGN}the move {COLOR_1 CYAN}{ARG_POKEMON_7}{END_COLOR_TEXT_1}!");
|
||||
ALIGNED(4) static const u8 sFmtNoOneCanLearnThisMove[] = _(
|
||||
"{CENTER_ALIGN}No one in the current team\n"
|
||||
"{CENTER_ALIGN}can learn this move. ");
|
||||
ALIGNED(4) static const u8 sFill[] = _("pksdir0");
|
||||
38
src/data/kangaskhan_storage1.h
Normal file
38
src/data/kangaskhan_storage1.h
Normal file
@@ -0,0 +1,38 @@
|
||||
static const UnkTextStruct2 sUnknown_80DB748 = {
|
||||
0, 0, 0, 0,
|
||||
3,
|
||||
0, 0,
|
||||
0, 0,
|
||||
0, 0,
|
||||
NULL
|
||||
};
|
||||
|
||||
static const UnkTextStruct2 sUnknown_80DB760 = {
|
||||
0, 0, 0, 0,
|
||||
3,
|
||||
20, 4,
|
||||
6, 3,
|
||||
3, 0,
|
||||
NULL
|
||||
};
|
||||
|
||||
static const UnkTextStruct2 sUnknown_80DB778 = {
|
||||
0, 0, 0, 0,
|
||||
3,
|
||||
20, 9,
|
||||
6, 3,
|
||||
3, 0,
|
||||
NULL
|
||||
};
|
||||
|
||||
static const UnkTextStruct2 sUnknown_80DB790 = {
|
||||
0, 0, 0, 0,
|
||||
3,
|
||||
20, 14,
|
||||
6, 4,
|
||||
4, 0,
|
||||
NULL
|
||||
};
|
||||
|
||||
ALIGNED(4) static const u8 sNumber[] = _("Number?");
|
||||
ALIGNED(4) static const u8 sFill[] = _("pksdir0");
|
||||
47
src/data/kangaskhan_storage2.h
Normal file
47
src/data/kangaskhan_storage2.h
Normal file
@@ -0,0 +1,47 @@
|
||||
static const UnkTextStruct2 sUnknown_80DB7B8 = {
|
||||
0, 0, 0, 0,
|
||||
3,
|
||||
0, 0,
|
||||
0, 0,
|
||||
0, 0,
|
||||
NULL
|
||||
};
|
||||
|
||||
static const UnkTextStruct2 sUnknown_80DB7D0 = {
|
||||
0, 0, 0, 0,
|
||||
3,
|
||||
3, 3,
|
||||
6, 3,
|
||||
3, 0,
|
||||
NULL
|
||||
};
|
||||
|
||||
static const UnkTextStruct2 sUnknown_80DB7E8 = {
|
||||
0, 0, 0, 0,
|
||||
3,
|
||||
20, 4,
|
||||
6, 3,
|
||||
3, 0,
|
||||
NULL
|
||||
};
|
||||
|
||||
static const UnkTextStruct2 sUnknown_80DB800 = {
|
||||
0, 0, 0, 0,
|
||||
3,
|
||||
20, 9,
|
||||
6, 3,
|
||||
3, 0,
|
||||
NULL
|
||||
};
|
||||
|
||||
static const UnkTextStruct2 sUnknown_80DB818 = {
|
||||
0, 0, 0, 0,
|
||||
3,
|
||||
20, 14,
|
||||
6, 4,
|
||||
4, 0,
|
||||
NULL
|
||||
};
|
||||
|
||||
ALIGNED(4) static const u8 sNumber[] = _("Number?");
|
||||
ALIGNED(4) static const u8 sFill[] = _("pksdir0");
|
||||
38
src/data/kecleon_bros1.h
Normal file
38
src/data/kecleon_bros1.h
Normal file
@@ -0,0 +1,38 @@
|
||||
static const UnkTextStruct2 sUnknown_80DB840 = {
|
||||
0, 0, 0, 0,
|
||||
3,
|
||||
0, 0,
|
||||
0, 0,
|
||||
0, 0,
|
||||
NULL
|
||||
};
|
||||
|
||||
static const UnkTextStruct2 sUnknown_80DB858 = {
|
||||
0, 0, 0, 0,
|
||||
3,
|
||||
20, 4,
|
||||
6, 3,
|
||||
3, 0,
|
||||
NULL
|
||||
};
|
||||
|
||||
static const UnkTextStruct2 sUnknown_80DB870 = {
|
||||
0, 0, 0, 0,
|
||||
3,
|
||||
20, 9,
|
||||
6, 3,
|
||||
3, 0,
|
||||
NULL
|
||||
};
|
||||
|
||||
static const UnkTextStruct2 sUnknown_80DB888 = {
|
||||
0, 0, 0, 0,
|
||||
3,
|
||||
20, 14,
|
||||
6, 3,
|
||||
3, 0,
|
||||
NULL
|
||||
};
|
||||
|
||||
ALIGNED(4) static const u8 sSellAll[] = _("Sell All");
|
||||
ALIGNED(4) static const u8 sFill[] = _("pksdir0");
|
||||
21
src/data/kecleon_bros2.h
Normal file
21
src/data/kecleon_bros2.h
Normal file
@@ -0,0 +1,21 @@
|
||||
static const UnkTextStruct2 sUnknown_80DB8B4 = {
|
||||
0, 0, 0, 0,
|
||||
3,
|
||||
0, 0,
|
||||
0, 0,
|
||||
0, 0,
|
||||
NULL
|
||||
};
|
||||
|
||||
static const UnkTextStruct2 sUnknown_80DB8CC = {
|
||||
0, 0, 0, 0,
|
||||
6,
|
||||
2, 2,
|
||||
16, 4,
|
||||
6, 0,
|
||||
NULL
|
||||
};
|
||||
|
||||
ALIGNED(4) static const u8 sGoods[] = _("Goods");
|
||||
ALIGNED(4) static const u8 sFmtRed[] = _("{COLOR_1 RED}%s{END_COLOR_TEXT_1}");
|
||||
ALIGNED(4) static const u8 sFill[] = _("pksdir0");
|
||||
21
src/data/kecleon_bros3.h
Normal file
21
src/data/kecleon_bros3.h
Normal file
@@ -0,0 +1,21 @@
|
||||
static const UnkTextStruct2 sUnknown_80DB8FC = {
|
||||
0, 0, 0, 0,
|
||||
3,
|
||||
0, 0,
|
||||
0, 0,
|
||||
0, 0,
|
||||
NULL
|
||||
};
|
||||
|
||||
static const UnkTextStruct2 sUnknown_80DB914 = {
|
||||
0, 0, 0, 0,
|
||||
6,
|
||||
2, 2,
|
||||
16, 4,
|
||||
6, 0,
|
||||
NULL
|
||||
};
|
||||
|
||||
ALIGNED(4) static const u8 sGoods[] = _("Goods");
|
||||
ALIGNED(4) static const u8 sFmtRed[] = _("{COLOR_1 RED}%s{END_COLOR_TEXT_1}");
|
||||
ALIGNED(4) static const u8 sFill[] = _("pksdir0");
|
||||
25
src/data/kecleon_bros4.h
Normal file
25
src/data/kecleon_bros4.h
Normal file
@@ -0,0 +1,25 @@
|
||||
static const UnkTextStruct2 sUnknown_80DB944 = {
|
||||
0, 0, 0, 0,
|
||||
3,
|
||||
0, 0,
|
||||
0, 0,
|
||||
0, 0,
|
||||
NULL
|
||||
};
|
||||
|
||||
static const UnkTextStruct2 sUnknown_80DB95C = {
|
||||
0, 0, 0, 0,
|
||||
6,
|
||||
2, 2,
|
||||
16, 17,
|
||||
19, 0,
|
||||
NULL
|
||||
};
|
||||
|
||||
ALIGNED(4) static const u8 sTeamToolboxA[] = _("Team Toolbox A");
|
||||
ALIGNED(4) static const u8 sTeamToolboxB[] = _("Team Toolbox B");
|
||||
ALIGNED(4) static const u8 sFmtMoveItem0[] = _("{COLOR_1 UNK_COLOR_2}{ARG_MOVE_ITEM_0}{END_COLOR_TEXT_1}");
|
||||
ALIGNED(4) static const u8 sFmtRed[] = _("{COLOR_1 RED}%s{END_COLOR_TEXT_1}");
|
||||
ALIGNED(4) static const u8 sItems[] = _("Items");
|
||||
ALIGNED(4) static const u8 sSlash[] = _("/");
|
||||
ALIGNED(4) static const u8 sFill[] = _("pksdir0");
|
||||
@@ -11,5 +11,5 @@ ALIGNED(4) static const u8 sReceivedBonslyDoll[] = _(
|
||||
"{CENTER_ALIGN}{COLOR_1 YELLOW_5}$n0{END_COLOR_TEXT_1} received the {COLOR_1 GREEN_2}Bonsly Doll{END_COLOR_TEXT_1}!\n"
|
||||
"{CENTER_ALIGN}It has been placed outside your\n"
|
||||
"{CENTER_ALIGN}rescue team base.");
|
||||
ALIGNED(4) static const u8 sGoTrain[] = "Go Train";
|
||||
ALIGNED(4) static const u8 sFill[] = "pksdir0";
|
||||
ALIGNED(4) static const u8 sGoTrain[] = _("Go Train");
|
||||
ALIGNED(4) static const u8 sFill[] = _("pksdir0");
|
||||
@@ -16,7 +16,7 @@ static const UnkTextStruct2 sUnknown_80E0804 = {
|
||||
NULL
|
||||
};
|
||||
|
||||
ALIGNED(4) static const u8 sCourses[] = "Courses";
|
||||
ALIGNED(4) static const u8 sCourses[] = _("Courses");
|
||||
ALIGNED(4) static const u8 sStarBullet[] = _("{STAR_BULLET}");
|
||||
ALIGNED(4) static const u8 sFmtColor[] = _("{COLOR_2}%c%s{END_COLOR_TEXT_2}");
|
||||
ALIGNED(4) static const u8 sFill[] = "pksdir0";
|
||||
ALIGNED(4) static const u8 sFill[] = _("pksdir0");
|
||||
@@ -1,22 +1,22 @@
|
||||
#include "global.h"
|
||||
#include "code_8098DBC.h"
|
||||
#include "constants/dungeon.h"
|
||||
#include "memory.h"
|
||||
#include "text1.h"
|
||||
#include "text2.h"
|
||||
#include "items.h"
|
||||
#include "pokemon.h"
|
||||
#include "friend_area_action_menu.h"
|
||||
#include "menu_input.h"
|
||||
#include "kecleon_bros.h"
|
||||
#include "sprite.h"
|
||||
#include "code_80130A8.h"
|
||||
#include "code_801B3C0.h"
|
||||
#include "code_801EE10.h"
|
||||
#include "code_801EE10_1.h"
|
||||
#include "code_801B3C0.h"
|
||||
#include "event_flag.h"
|
||||
#include "moves.h"
|
||||
#include "code_801EE10_mid.h"
|
||||
#include "code_8098DBC.h"
|
||||
#include "constants/dungeon.h"
|
||||
#include "event_flag.h"
|
||||
#include "friend_area_action_menu.h"
|
||||
#include "items.h"
|
||||
#include "kecleon_bros4.h"
|
||||
#include "memory.h"
|
||||
#include "menu_input.h"
|
||||
#include "moves.h"
|
||||
#include "pokemon.h"
|
||||
#include "sprite.h"
|
||||
#include "text1.h"
|
||||
#include "text2.h"
|
||||
|
||||
extern struct unkStruct_203B2BC *gUnknown_203B2BC;
|
||||
|
||||
@@ -203,10 +203,10 @@ void sub_8027274(void)
|
||||
sub_801BEEC(gUnknown_203B2BC->targetPoke);
|
||||
break;
|
||||
case 10:
|
||||
sub_801A5D8(1, 0, 0, 10);
|
||||
sub_801A5D8(1, 0, NULL, 10);
|
||||
break;
|
||||
case 0xb:
|
||||
sub_801A8D0(1);
|
||||
sub_801A8D0(TRUE);
|
||||
break;
|
||||
case 0xc:
|
||||
sub_801A9E0();
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
#include "global.h"
|
||||
#include "code_80118A4.h"
|
||||
#include "code_8012A18_1.h"
|
||||
#include "code_80130A8.h"
|
||||
#include "code_801B3C0.h"
|
||||
#include "code_801EE10.h"
|
||||
#include "code_801EE10_1.h"
|
||||
#include "code_801EE10_mid.h"
|
||||
#include "code_8098DBC.h"
|
||||
#include "constants/dungeon.h"
|
||||
#include "event_flag.h"
|
||||
#include "items.h"
|
||||
#include "kecleon_bros4.h"
|
||||
#include "memory.h"
|
||||
#include "menu_input.h"
|
||||
#include "moves.h"
|
||||
#include "pokemon.h"
|
||||
#include "text1.h"
|
||||
#include "text2.h"
|
||||
#include "items.h"
|
||||
#include "pokemon.h"
|
||||
#include "moves.h"
|
||||
#include "menu_input.h"
|
||||
#include "code_801EE10.h"
|
||||
#include "kecleon_bros.h"
|
||||
#include "code_80130A8.h"
|
||||
#include "code_801EE10_1.h"
|
||||
#include "code_8012A18_1.h"
|
||||
#include "code_801B3C0.h"
|
||||
#include "code_80118A4.h"
|
||||
#include "event_flag.h"
|
||||
#include "code_801EE10_mid.h"
|
||||
|
||||
// there might be more overlap with unkStruct_203B2BC
|
||||
// I was working on the moves and put the data that seemed to correspond to that
|
||||
@@ -247,10 +247,10 @@ void sub_8025518(void)
|
||||
sub_801BEEC(gUnknown_203B2B4->species);
|
||||
break;
|
||||
case 0xb:
|
||||
sub_801A5D8(1,0,0,10);
|
||||
sub_801A5D8(1, 0, NULL, 10);
|
||||
break;
|
||||
case 0xc:
|
||||
sub_801A8D0(1);
|
||||
sub_801A8D0(TRUE);
|
||||
break;
|
||||
case 0xd:
|
||||
sub_801A9E0();
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "menu_input.h"
|
||||
#include "moves.h"
|
||||
#include "pokemon_3.h"
|
||||
#include "pokemon_mid.h"
|
||||
#include "text1.h"
|
||||
#include "text2.h"
|
||||
|
||||
@@ -59,7 +60,6 @@ void sub_801F5F0(u8 r0);
|
||||
void sub_8024458(u32, u32);
|
||||
extern void sub_801BEEC(s16);
|
||||
void sub_80208B0(void);
|
||||
void PrintPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon);
|
||||
extern void sub_801FDA8(s32);
|
||||
extern void sub_8020A80(void);
|
||||
extern void sub_8020B38(void);
|
||||
|
||||
@@ -3,9 +3,8 @@
|
||||
#include "code_801B3C0.h"
|
||||
#include "code_801C620.h"
|
||||
#include "code_8098DBC.h"
|
||||
#include "items.h"
|
||||
#include "kangaskhan_storage.h"
|
||||
#include "kecleon_bros.h"
|
||||
#include "kangaskhan_storage1.h"
|
||||
#include "kecleon_bros4.h"
|
||||
#include "memory.h"
|
||||
#include "menu_input.h"
|
||||
#include "pokemon.h"
|
||||
@@ -15,8 +14,8 @@
|
||||
extern u8 gUnknown_202DE58[];
|
||||
extern u8 gUnknown_202E1C8[];
|
||||
extern u8 gUnknown_202E5D8[];
|
||||
|
||||
EWRAM_DATA_2 struct KangaskhanStorageWork *gKangaskhanStorageWork = {0};
|
||||
EWRAM_DATA_2 struct unkStruct_203B20C *gUnknown_203B20C = {0};
|
||||
|
||||
extern const u8 *gUnknown_80D4920[];
|
||||
extern const u8 *gUnknown_80D4928[];
|
||||
@@ -24,71 +23,45 @@ extern const u8 *gUnknown_80D4934[];
|
||||
extern const u8 *gUnknown_80D4958[];
|
||||
extern const u8 *gUnknown_80D4964[];
|
||||
extern const u8 *gUnknown_80D4970[];
|
||||
extern const u8 *gUnknown_80D4984[];
|
||||
extern UnkTextStruct2 gUnknown_80DB748;
|
||||
extern UnkTextStruct2 gUnknown_80DB760;
|
||||
extern UnkTextStruct2 gUnknown_80DB778;
|
||||
extern UnkTextStruct2 gUnknown_80DB790;
|
||||
extern const u8 gUnknown_80DB7A8[]; // "Number?\0"
|
||||
extern UnkTextStruct2 gUnknown_80DB7B8;
|
||||
extern UnkTextStruct2 gUnknown_80DB7D0;
|
||||
extern UnkTextStruct2 gUnknown_80DB7E8;
|
||||
extern UnkTextStruct2 gUnknown_80DB800;
|
||||
extern UnkTextStruct2 gUnknown_80DB818;
|
||||
extern const u8 gUnknown_80DB830[]; // "Number?\0"
|
||||
extern const u8 *gKangaskhanStorageDialogue[2][20]; // 80D5404
|
||||
|
||||
extern const u8 *gKangaskhanStorageDialogue[2][20];
|
||||
#include "data/kangaskhan_storage1.h" // 80DB748
|
||||
|
||||
void sub_8016E80(void);
|
||||
void sub_8016FF8(void);
|
||||
void sub_8017598(void);
|
||||
void sub_80175FC(void);
|
||||
void sub_80176B8(void);
|
||||
void sub_8017758(void);
|
||||
void sub_80177F8(void);
|
||||
void sub_8017828(void);
|
||||
void sub_80178D0(void);
|
||||
void sub_8017928(void);
|
||||
void sub_80179A8(void);
|
||||
void sub_8017A1C(void);
|
||||
void sub_8017AF8(void);
|
||||
void sub_8017B88(void);
|
||||
void sub_8017C28(void);
|
||||
void sub_8017C7C(void);
|
||||
void sub_8017D24(void);
|
||||
void sub_8017DC0(void);
|
||||
void sub_8017DDC(void);
|
||||
void sub_8017F10(u32);
|
||||
void sub_8017F28(void);
|
||||
void sub_8018100(void);
|
||||
void sub_8018280(void);
|
||||
void sub_80182E4(void);
|
||||
void sub_801841C(void);
|
||||
void sub_80184D4(void);
|
||||
void sub_8018588(void);
|
||||
void sub_8018620(void);
|
||||
void sub_80186F8(void);
|
||||
void sub_8018854(void);
|
||||
void sub_8018904(void);
|
||||
void sub_80189C8(void);
|
||||
void sub_8018AC8(void);
|
||||
void sub_8018AE4(void);
|
||||
static void AdvanceToKangaskhanStorageFallbackState(void);
|
||||
static void UpdateKangaskhanStorageState(u32);
|
||||
|
||||
void AdvanceToKangaskhanStorageFallbackState(void);
|
||||
void UpdateKangaskhanStorageState(u32);
|
||||
static void sub_8016E80(void);
|
||||
static void sub_8016FF8(void);
|
||||
static void sub_8017598(void);
|
||||
static void sub_80175FC(void);
|
||||
static void sub_80176B8(void);
|
||||
static void sub_8017758(void);
|
||||
static void sub_80177F8(void);
|
||||
static void sub_8017828(void);
|
||||
static void sub_80178D0(void);
|
||||
static void sub_8017928(void);
|
||||
static void sub_80179A8(void);
|
||||
static void sub_8017A1C(void);
|
||||
static void sub_8017AF8(void);
|
||||
static void sub_8017B88(void);
|
||||
static void sub_8017C28(void);
|
||||
static void sub_8017C7C(void);
|
||||
static void sub_8017D24(void);
|
||||
static void sub_8017DC0(void);
|
||||
static void sub_8017DDC(void);
|
||||
|
||||
u32 CreateKangaskhanStorage(bool32 isAsleep)
|
||||
bool8 CreateKangaskhanStorage(u32 mode)
|
||||
{
|
||||
char *monName;
|
||||
u8 *monName;
|
||||
OpenedFile *faceFile;
|
||||
|
||||
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(NULL, TRUE, TRUE);
|
||||
gKangaskhanStorageWork = MemoryAlloc(sizeof(struct KangaskhanStorageWork), 8);
|
||||
gKangaskhanStorageWork->menuAction1 = 0;
|
||||
gKangaskhanStorageWork->menuAction2 = 0;
|
||||
gKangaskhanStorageWork->menuAction3 = 0;
|
||||
gKangaskhanStorageWork->isAsleep = isAsleep;
|
||||
gKangaskhanStorageWork->isAsleep = mode;
|
||||
CopyYellowMonsterNametoBuffer(gUnknown_202E5D8, MONSTER_KANGASKHAN);
|
||||
CopyYellowMonsterNametoBuffer(gUnknown_202E1C8, MONSTER_KANGASKHAN);
|
||||
monName = GetMonSpecies(MONSTER_KANGASKHAN);
|
||||
@@ -108,7 +81,7 @@ u32 CreateKangaskhanStorage(bool32 isAsleep)
|
||||
gKangaskhanStorageWork->unkE0 = 2;
|
||||
gKangaskhanStorageWork->unkE2 = 8;
|
||||
UpdateKangaskhanStorageState(KANGASKHAN_STORAGE_INIT);
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u32 KangaskhanStorageCallback(void)
|
||||
@@ -171,14 +144,14 @@ void DeleteKangaskhanStorage(void)
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateKangaskhanStorageState(u32 newState)
|
||||
static void UpdateKangaskhanStorageState(u32 newState)
|
||||
{
|
||||
gKangaskhanStorageWork->currState = newState;
|
||||
sub_8016E80();
|
||||
sub_8016FF8();
|
||||
}
|
||||
|
||||
void sub_8016E80(void)
|
||||
static void sub_8016E80(void)
|
||||
{
|
||||
s32 index;
|
||||
|
||||
@@ -187,28 +160,28 @@ void sub_8016E80(void)
|
||||
switch (gKangaskhanStorageWork->currState) {
|
||||
case 13:
|
||||
case 14:
|
||||
gKangaskhanStorageWork->unkEC[0] = gUnknown_80DB748;
|
||||
gKangaskhanStorageWork->unkEC[1] = gUnknown_80DB748;
|
||||
gKangaskhanStorageWork->unkEC[2] = gUnknown_80DB748;
|
||||
gKangaskhanStorageWork->unkEC[0] = gUnknown_80DB748;
|
||||
gKangaskhanStorageWork->unkEC[0] = sUnknown_80DB748;
|
||||
gKangaskhanStorageWork->unkEC[1] = sUnknown_80DB748;
|
||||
gKangaskhanStorageWork->unkEC[2] = sUnknown_80DB748;
|
||||
gKangaskhanStorageWork->unkEC[0] = sUnknown_80DB748;
|
||||
break;
|
||||
case 22:
|
||||
case 23:
|
||||
gKangaskhanStorageWork->unkEC[0] = gUnknown_80DB748;
|
||||
gKangaskhanStorageWork->unkEC[1] = gUnknown_80DB748;
|
||||
gKangaskhanStorageWork->unkEC[2] = gUnknown_80DB748;
|
||||
gKangaskhanStorageWork->unkEC[0] = gUnknown_80DB778;
|
||||
gKangaskhanStorageWork->unkEC[0] = sUnknown_80DB748;
|
||||
gKangaskhanStorageWork->unkEC[1] = sUnknown_80DB748;
|
||||
gKangaskhanStorageWork->unkEC[2] = sUnknown_80DB748;
|
||||
gKangaskhanStorageWork->unkEC[0] = sUnknown_80DB778;
|
||||
break;
|
||||
case 24:
|
||||
gKangaskhanStorageWork->unkEC[1] = gUnknown_80DB790;
|
||||
gKangaskhanStorageWork->unkEC[1] = sUnknown_80DB790;
|
||||
break;
|
||||
case 15:
|
||||
case 25:
|
||||
gKangaskhanStorageWork->unkEC[2] = gUnknown_80DB760;
|
||||
gKangaskhanStorageWork->unkEC[2] = sUnknown_80DB760;
|
||||
break;
|
||||
default:
|
||||
for (index = 0; index < 4; index++)
|
||||
gKangaskhanStorageWork->unkEC[index] = gUnknown_80DB748;
|
||||
gKangaskhanStorageWork->unkEC[index] = sUnknown_80DB748;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -216,7 +189,7 @@ void sub_8016E80(void)
|
||||
sub_800641C(gKangaskhanStorageWork->unkEC, TRUE, TRUE);
|
||||
}
|
||||
|
||||
void sub_8016FF8(void)
|
||||
static void sub_8016FF8(void)
|
||||
{
|
||||
switch (gKangaskhanStorageWork->currState) {
|
||||
case KANGASKHAN_STORAGE_INIT:
|
||||
@@ -283,10 +256,10 @@ void sub_8016FF8(void)
|
||||
sub_80141B4(gKangaskhanStorageDialogue[gKangaskhanStorageWork->isAsleep][4], 0, gKangaskhanStorageWork->unkE8, 0x30D);
|
||||
break;
|
||||
case 13:
|
||||
sub_801A5D8(3, 3, 0, 10);
|
||||
sub_801A5D8(3, 3, NULL, 10);
|
||||
break;
|
||||
case 14:
|
||||
sub_801A8D0(1);
|
||||
sub_801A8D0(TRUE);
|
||||
break;
|
||||
case 15:
|
||||
sub_801A9E0();
|
||||
@@ -389,11 +362,11 @@ void sub_8016FF8(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8017598(void)
|
||||
static void sub_8017598(void)
|
||||
{
|
||||
sub_8008C54(gKangaskhanStorageWork->unkBC);
|
||||
sub_80073B8(gKangaskhanStorageWork->unkBC);
|
||||
xxx_call_draw_string(4, 0, gUnknown_80DB7A8, gKangaskhanStorageWork->unkBC, 0);
|
||||
xxx_call_draw_string(4, 0, sNumber, gKangaskhanStorageWork->unkBC, 0);
|
||||
sub_8013C68(&gKangaskhanStorageWork->unkA8);
|
||||
sub_80073E0(gKangaskhanStorageWork->unkBC);
|
||||
sub_801CCD8();
|
||||
@@ -401,7 +374,7 @@ void sub_8017598(void)
|
||||
sub_8012EA4(&gKangaskhanStorageWork->unk58, 0);
|
||||
}
|
||||
|
||||
void sub_80175FC(void)
|
||||
static void sub_80175FC(void)
|
||||
{
|
||||
s32 index;
|
||||
s32 loopMax;
|
||||
@@ -442,7 +415,7 @@ void sub_80175FC(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80176B8(void)
|
||||
static void sub_80176B8(void)
|
||||
{
|
||||
s32 index;
|
||||
s32 loopMax;
|
||||
@@ -475,7 +448,7 @@ void sub_80176B8(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8017758(void)
|
||||
static void sub_8017758(void)
|
||||
{
|
||||
s32 index;
|
||||
s32 loopMax;
|
||||
@@ -508,7 +481,7 @@ void sub_8017758(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80177F8(void)
|
||||
static void sub_80177F8(void)
|
||||
{
|
||||
s32 loopMax;
|
||||
|
||||
@@ -525,7 +498,7 @@ void sub_80177F8(void)
|
||||
gKangaskhanStorageWork->unk24[loopMax].menuAction = 1;
|
||||
}
|
||||
|
||||
void sub_8017828(void)
|
||||
static void sub_8017828(void)
|
||||
{
|
||||
s32 menuAction;
|
||||
|
||||
@@ -561,7 +534,7 @@ void sub_8017828(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80178D0(void)
|
||||
static void sub_80178D0(void)
|
||||
{
|
||||
s32 menuAction;
|
||||
|
||||
@@ -582,7 +555,7 @@ void sub_80178D0(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8017928(void)
|
||||
static void sub_8017928(void)
|
||||
{
|
||||
s32 menuAction;
|
||||
BulkItem item;
|
||||
@@ -605,7 +578,7 @@ void sub_8017928(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80179A8(void)
|
||||
static void sub_80179A8(void)
|
||||
{
|
||||
s32 index;
|
||||
s32 menuAction;
|
||||
@@ -634,10 +607,10 @@ void sub_80179A8(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8017A1C(void)
|
||||
static void sub_8017A1C(void)
|
||||
{
|
||||
s32 itemID;
|
||||
int menuAction;
|
||||
s32 menuAction;
|
||||
BulkItem item;
|
||||
|
||||
if (sub_80144A4(&menuAction) != 0)
|
||||
@@ -672,7 +645,7 @@ void sub_8017A1C(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8017AF8(void)
|
||||
static void sub_8017AF8(void)
|
||||
{
|
||||
switch (sub_801A6E8(TRUE)) {
|
||||
case 3:
|
||||
@@ -698,7 +671,7 @@ void sub_8017AF8(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8017B88(void)
|
||||
static void sub_8017B88(void)
|
||||
{
|
||||
switch (sub_801CA08(TRUE)) {
|
||||
case 3:
|
||||
@@ -727,7 +700,7 @@ void sub_8017B88(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8017C28(void)
|
||||
static void sub_8017C28(void)
|
||||
{
|
||||
sub_801CA08(FALSE);
|
||||
sub_8012FD8(&gKangaskhanStorageWork->unk58);
|
||||
@@ -749,7 +722,7 @@ void sub_8017C28(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8017C7C(void)
|
||||
static void sub_8017C7C(void)
|
||||
{
|
||||
s32 menuAction;
|
||||
menuAction = 0;
|
||||
@@ -781,7 +754,7 @@ void sub_8017C7C(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8017D24(void)
|
||||
static void sub_8017D24(void)
|
||||
{
|
||||
s32 menuAction;
|
||||
menuAction = 0;
|
||||
@@ -813,7 +786,7 @@ void sub_8017D24(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8017DC0(void)
|
||||
static void sub_8017DC0(void)
|
||||
{
|
||||
switch (sub_801B410()) {
|
||||
case 0:
|
||||
@@ -828,7 +801,7 @@ void sub_8017DC0(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8017DDC(void)
|
||||
static void sub_8017DDC(void)
|
||||
{
|
||||
switch (sub_801B410()) {
|
||||
case 0:
|
||||
@@ -843,601 +816,10 @@ void sub_8017DDC(void)
|
||||
}
|
||||
}
|
||||
|
||||
void AdvanceToKangaskhanStorageFallbackState(void)
|
||||
static void AdvanceToKangaskhanStorageFallbackState(void)
|
||||
{
|
||||
s32 temp;
|
||||
|
||||
if (sub_80144A4(&temp) == 0)
|
||||
UpdateKangaskhanStorageState(gKangaskhanStorageWork->fallbackState);
|
||||
}
|
||||
|
||||
u32 sub_8017E1C(void)
|
||||
{
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(NULL, TRUE, TRUE);
|
||||
gUnknown_203B20C = MemoryAlloc(sizeof(struct unkStruct_203B20C), 8);
|
||||
gUnknown_203B20C->menuAction1 = 0;
|
||||
gUnknown_203B20C->menuAction2 = 0;
|
||||
gUnknown_203B20C->menuAction3 = 0;
|
||||
sub_8017F10(0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
u32 sub_8017E54(void)
|
||||
{
|
||||
switch (gUnknown_203B20C->state) {
|
||||
case 0:
|
||||
sub_8017F10(1);
|
||||
break;
|
||||
case 1:
|
||||
sub_8018588();
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
sub_8018620();
|
||||
break;
|
||||
case 6:
|
||||
sub_8018904();
|
||||
break;
|
||||
case 7:
|
||||
sub_8018AC8();
|
||||
break;
|
||||
case 10:
|
||||
case 11:
|
||||
sub_80186F8();
|
||||
break;
|
||||
case 12:
|
||||
sub_8018854();
|
||||
break;
|
||||
case 13:
|
||||
sub_80189C8();
|
||||
break;
|
||||
case 14:
|
||||
sub_8018AE4();
|
||||
break;
|
||||
case 3:
|
||||
return 3;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sub_8017EF4(void)
|
||||
{
|
||||
if (gUnknown_203B20C != NULL) {
|
||||
MemoryFree(gUnknown_203B20C);
|
||||
gUnknown_203B20C = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8017F10(u32 newState)
|
||||
{
|
||||
gUnknown_203B20C->state = newState;
|
||||
sub_8017F28();
|
||||
sub_8018100();
|
||||
}
|
||||
|
||||
void sub_8017F28(void)
|
||||
{
|
||||
s32 index;
|
||||
|
||||
sub_8006518(gUnknown_203B20C->unkF0);
|
||||
|
||||
switch (gUnknown_203B20C->state) {
|
||||
case 1:
|
||||
gUnknown_203B20C->unkF0[0] = gUnknown_80DB7B8;
|
||||
gUnknown_203B20C->unkF0[1] = gUnknown_80DB7B8;
|
||||
gUnknown_203B20C->unkF0[0] = gUnknown_80DB7B8;
|
||||
sub_80182E4();
|
||||
gUnknown_203B20C->unkF0[2] = gUnknown_80DB7D0;
|
||||
sub_8012CAC(&gUnknown_203B20C->unkF0[2], gUnknown_203B20C->unk20);
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
gUnknown_203B20C->unkF0[0] = gUnknown_80DB7B8;
|
||||
gUnknown_203B20C->unkF0[1] = gUnknown_80DB7B8;
|
||||
gUnknown_203B20C->unkF0[2] = gUnknown_80DB7B8;
|
||||
gUnknown_203B20C->unkF0[0] = gUnknown_80DB7B8;
|
||||
break;
|
||||
case 10:
|
||||
case 11:
|
||||
gUnknown_203B20C->unkF0[0] = gUnknown_80DB7B8;
|
||||
gUnknown_203B20C->unkF0[1] = gUnknown_80DB7B8;
|
||||
gUnknown_203B20C->unkF0[2] = gUnknown_80DB7B8;
|
||||
gUnknown_203B20C->unkF0[0] = gUnknown_80DB800;
|
||||
break;
|
||||
case 12:
|
||||
gUnknown_203B20C->unkF0[1] = gUnknown_80DB818;
|
||||
break;
|
||||
case 6:
|
||||
case 13:
|
||||
gUnknown_203B20C->unkF0[2] = gUnknown_80DB7E8;
|
||||
break;
|
||||
default:
|
||||
case 0:
|
||||
for (index = 0; index < 4; index++)
|
||||
gUnknown_203B20C->unkF0[index] = gUnknown_80DB7B8;
|
||||
break;
|
||||
}
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(gUnknown_203B20C->unkF0, TRUE, TRUE);
|
||||
}
|
||||
|
||||
void sub_8018100(void)
|
||||
{
|
||||
switch (gUnknown_203B20C->state) {
|
||||
case 1:
|
||||
sub_8012D60(&gUnknown_203B20C->unk70, gUnknown_203B20C->unk20, 0, gUnknown_203B20C->unk60, gUnknown_203B20C->menuAction1, 2);
|
||||
break;
|
||||
case 4:
|
||||
sub_801A5D8(3, 3, 0, 10);
|
||||
break;
|
||||
case 5:
|
||||
sub_801A8D0(1);
|
||||
break;
|
||||
case 6:
|
||||
sub_801A9E0();
|
||||
sub_801841C();
|
||||
sub_8012D60(&gUnknown_203B20C->unk70, gUnknown_203B20C->unk20, 0, gUnknown_203B20C->unk60, gUnknown_203B20C->menuAction2, 2);
|
||||
break;
|
||||
case 7:
|
||||
sub_801B3C0(&gUnknown_203B20C->item);
|
||||
break;
|
||||
case 10:
|
||||
sub_801C8C4(1, 3, 0, 10);
|
||||
sub_801AD34(0);
|
||||
break;
|
||||
case 11:
|
||||
sub_801CB5C(TRUE);
|
||||
sub_801AD34(0);
|
||||
break;
|
||||
case 12:
|
||||
gUnknown_203B20C->unkD0 = 2;
|
||||
gUnknown_203B20C->unkC8 = 1;
|
||||
|
||||
if (gTeamInventoryRef->teamStorage[gUnknown_203B20C->item.id] > 99)
|
||||
gUnknown_203B20C->unkCC = 99;
|
||||
else
|
||||
gUnknown_203B20C->unkCC = gTeamInventoryRef->teamStorage[gUnknown_203B20C->item.id];
|
||||
|
||||
gUnknown_203B20C->unkC4 = gUnknown_203B20C->unkCC;
|
||||
gUnknown_203B20C->unkD4 = 1;
|
||||
gUnknown_203B20C->unkD8 = &gUnknown_203B20C->unkF0[1];
|
||||
gUnknown_203B20C->unkDC = 40;
|
||||
gUnknown_203B20C->unkE0 = 18;
|
||||
sub_8013AA0(&gUnknown_203B20C->unkC0);
|
||||
sub_8018280();
|
||||
break;
|
||||
case 13:
|
||||
sub_801CCD8();
|
||||
sub_801AD34(0);
|
||||
sub_80184D4();
|
||||
sub_8012D60(&gUnknown_203B20C->unk70, gUnknown_203B20C->unk20, 0, gUnknown_203B20C->unk60, gUnknown_203B20C->menuAction3, 2);
|
||||
break;
|
||||
case 14:
|
||||
sub_801B3C0(&gUnknown_203B20C->item);
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8018280(void)
|
||||
{
|
||||
sub_8008C54(gUnknown_203B20C->unkD4);
|
||||
sub_80073B8(gUnknown_203B20C->unkD4);
|
||||
xxx_call_draw_string(4, 0, gUnknown_80DB830, gUnknown_203B20C->unkD4, 0);
|
||||
sub_8013C68(&gUnknown_203B20C->unkC0);
|
||||
sub_80073E0(gUnknown_203B20C->unkD4);
|
||||
sub_801CCD8();
|
||||
sub_801AD34(0);
|
||||
sub_8012EA4(&gUnknown_203B20C->unk70, 0);
|
||||
}
|
||||
|
||||
void sub_80182E4(void)
|
||||
{
|
||||
int index;
|
||||
s32 loopMax;
|
||||
|
||||
loopMax = 0;
|
||||
MemoryFill16(gUnknown_203B20C->unk60, 0, sizeof(gUnknown_203B20C->unk60));
|
||||
gUnknown_203B20C->unk20[0].text = *gUnknown_80D4958;
|
||||
gUnknown_203B20C->unk20[0].menuAction = 2;
|
||||
|
||||
if (GetNumberOfFilledInventorySlots() == 0 || sub_801CF50(0))
|
||||
gUnknown_203B20C->unk60[0] = 1;
|
||||
|
||||
loopMax += 1;
|
||||
gUnknown_203B20C->unk20[loopMax].text = *gUnknown_80D4964;
|
||||
gUnknown_203B20C->unk20[loopMax].menuAction = 3;
|
||||
|
||||
if (sub_801CF14(1) || INVENTORY_SIZE <= GetNumberOfFilledInventorySlots())
|
||||
gUnknown_203B20C->unk60[loopMax] = 1;
|
||||
|
||||
loopMax += 1;
|
||||
gUnknown_203B20C->unk20[loopMax].text = *gUnknown_80D4934;
|
||||
gUnknown_203B20C->unk20[loopMax].menuAction = 1;
|
||||
|
||||
loopMax += 1;
|
||||
gUnknown_203B20C->unk20[loopMax].text = NULL;
|
||||
gUnknown_203B20C->unk20[loopMax].menuAction = 1;
|
||||
|
||||
for (index = 0; index < loopMax; index++) {
|
||||
if (gUnknown_203B20C->unk60[index] == 0) {
|
||||
if (gUnknown_203B20C->unk20[index].menuAction == gUnknown_203B20C->menuAction1)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (index = 0; index < loopMax; index++) {
|
||||
if (gUnknown_203B20C->unk60[index] == 0) {
|
||||
gUnknown_203B20C->menuAction1 = gUnknown_203B20C->unk20[index].menuAction;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_801841C(void)
|
||||
{
|
||||
int index;
|
||||
s32 loopMax;
|
||||
|
||||
loopMax = 0;
|
||||
MemoryFill16(gUnknown_203B20C->unk60,0,sizeof(gUnknown_203B20C->unk60));
|
||||
gUnknown_203B20C->unk20[0].text = *gUnknown_80D4958;
|
||||
gUnknown_203B20C->unk20[0].menuAction = 2;
|
||||
if (!sub_801ADA0(gUnknown_203B20C->itemIndex))
|
||||
gUnknown_203B20C->unk60[0] = 1;
|
||||
|
||||
loopMax += 1;
|
||||
gUnknown_203B20C->unk20[loopMax].text = *gUnknown_80D4970;
|
||||
gUnknown_203B20C->unk20[loopMax].menuAction = 4;
|
||||
|
||||
loopMax += 1;
|
||||
gUnknown_203B20C->unk20[loopMax].text = NULL;
|
||||
gUnknown_203B20C->unk20[loopMax].menuAction = 1;
|
||||
|
||||
for (index = 0; index < loopMax; index++) {
|
||||
if (gUnknown_203B20C->unk60[index] == 0) {
|
||||
if (gUnknown_203B20C->unk20[index].menuAction == gUnknown_203B20C->menuAction2)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (index = 0; index < loopMax; index++) {
|
||||
if (gUnknown_203B20C->unk60[index] == 0) {
|
||||
gUnknown_203B20C->menuAction2 = gUnknown_203B20C->unk20[index].menuAction;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80184D4(void)
|
||||
{
|
||||
int index;
|
||||
s32 loopMax;
|
||||
|
||||
loopMax = 0;
|
||||
MemoryFill16(gUnknown_203B20C->unk60, 0, sizeof(gUnknown_203B20C->unk60));
|
||||
gUnknown_203B20C->unk20[0].text = *gUnknown_80D4964;
|
||||
gUnknown_203B20C->unk20[0].menuAction = 3;
|
||||
|
||||
if (GetNumberOfFilledInventorySlots() >= INVENTORY_SIZE)
|
||||
gUnknown_203B20C->unk60[0] = 1;
|
||||
|
||||
loopMax += 1;
|
||||
gUnknown_203B20C->unk20[loopMax].text = *gUnknown_80D4970;
|
||||
gUnknown_203B20C->unk20[loopMax].menuAction = 4;
|
||||
|
||||
loopMax += 1;
|
||||
gUnknown_203B20C->unk20[loopMax].text = NULL;
|
||||
gUnknown_203B20C->unk20[loopMax].menuAction = 1;
|
||||
|
||||
for (index = 0; index < loopMax; index++) {
|
||||
if (gUnknown_203B20C->unk60[index] == 0) {
|
||||
if (gUnknown_203B20C->unk20[index].menuAction == gUnknown_203B20C->menuAction3)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (index = 0; index < loopMax; index++) {
|
||||
if (gUnknown_203B20C->unk60[index] == 0) {
|
||||
gUnknown_203B20C->menuAction3 = gUnknown_203B20C->unk20[index].menuAction;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8018588(void)
|
||||
{
|
||||
s32 menuAction;
|
||||
menuAction = 0;
|
||||
|
||||
if (sub_8012FD8(&gUnknown_203B20C->unk70) == 0) {
|
||||
sub_8013114(&gUnknown_203B20C->unk70, &menuAction);
|
||||
if (menuAction != 1)
|
||||
gUnknown_203B20C->menuAction1 = menuAction;
|
||||
}
|
||||
|
||||
switch (menuAction) {
|
||||
case 2:
|
||||
if (GetNumberOfFilledInventorySlots() != 0 && !sub_801CF50(0))
|
||||
sub_8017F10(4);
|
||||
else
|
||||
sub_8012EA4(&gUnknown_203B20C->unk70, 1);
|
||||
break;
|
||||
case 3:
|
||||
if (sub_801CF14(1))
|
||||
sub_8012EA4(&gUnknown_203B20C->unk70, 1);
|
||||
else
|
||||
sub_8017F10(10);
|
||||
break;
|
||||
case 1:
|
||||
sub_8017F10(3);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8018620(void)
|
||||
{
|
||||
s32 index;
|
||||
|
||||
switch (sub_801A6E8(TRUE)) {
|
||||
case 3:
|
||||
if (sub_801AEA8() != 0) {
|
||||
for (index = 0; index < INVENTORY_SIZE; index++) {
|
||||
if (sub_801AED0(index) != 0) {
|
||||
MoveToStorage(&gTeamInventoryRef->teamItems[index]);
|
||||
gTeamInventoryRef->teamItems[index].id = 0;
|
||||
gTeamInventoryRef->teamItems[index].flags = 0;
|
||||
}
|
||||
}
|
||||
|
||||
FillInventoryGaps();
|
||||
sub_801AE84();
|
||||
|
||||
if (GetNumberOfFilledInventorySlots() == 0) {
|
||||
sub_801A928();
|
||||
sub_8017F10(1);
|
||||
}
|
||||
else
|
||||
sub_8017F10(5);
|
||||
}
|
||||
else {
|
||||
gUnknown_203B20C->itemIndex = sub_801A8AC();
|
||||
gUnknown_203B20C->item = gTeamInventoryRef->teamItems[gUnknown_203B20C->itemIndex];
|
||||
sub_8017F10(6);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
gUnknown_203B20C->itemIndex = sub_801A8AC();
|
||||
gUnknown_203B20C->item = gTeamInventoryRef->teamItems[gUnknown_203B20C->itemIndex];
|
||||
sub_8017F10(7);
|
||||
break;
|
||||
case 2:
|
||||
sub_801A928();
|
||||
sub_8017F10(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80186F8(void)
|
||||
{
|
||||
BulkItem item;
|
||||
s32 itemID;
|
||||
|
||||
switch (sub_801CA08(TRUE)) {
|
||||
case 3:
|
||||
if (sub_801CFB8() != 0) {
|
||||
for (itemID = 0; itemID < NUMBER_OF_ITEM_IDS; itemID++) {
|
||||
if (sub_801CFE0(itemID) != 0) {
|
||||
item.id = itemID;
|
||||
|
||||
if (IsThrowableItem(item.id)) {
|
||||
if (gTeamInventoryRef->teamStorage[item.id] > 99)
|
||||
item.quantity = 99;
|
||||
else
|
||||
item.quantity = gTeamInventoryRef->teamStorage[item.id];
|
||||
}
|
||||
else
|
||||
item.quantity = 1;
|
||||
|
||||
gTeamInventoryRef->teamStorage[item.id] -= item.quantity;
|
||||
AddHeldItemToInventory(&item);
|
||||
}
|
||||
}
|
||||
|
||||
FillInventoryGaps();
|
||||
sub_801CF94();
|
||||
|
||||
if (!sub_801CF14(1) && GetNumberOfFilledInventorySlots() < INVENTORY_SIZE)
|
||||
sub_8017F10(11);
|
||||
else {
|
||||
sub_801CBB8();
|
||||
sub_8017F10(1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
gUnknown_203B20C->id = sub_801CB24();
|
||||
xxx_init_itemslot_8090A8C(&gUnknown_203B20C->item, gUnknown_203B20C->id, 0);
|
||||
gUnknown_203B20C->item.quantity = 1;
|
||||
sub_8017F10(13);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
gUnknown_203B20C->id = sub_801CB24();
|
||||
xxx_init_itemslot_8090A8C(&gUnknown_203B20C->item, gUnknown_203B20C->id, 0);
|
||||
gUnknown_203B20C->item.quantity = 1;
|
||||
sub_8017F10(14);
|
||||
break;
|
||||
case 2:
|
||||
sub_801CBB8();
|
||||
sub_8017F10(1);
|
||||
break;
|
||||
case 1:
|
||||
sub_801AD34(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8018854(void)
|
||||
{
|
||||
BulkItem item;
|
||||
|
||||
sub_801CA08(FALSE);
|
||||
sub_8012FD8(&gUnknown_203B20C->unk70);
|
||||
|
||||
switch (sub_8013BBC(&gUnknown_203B20C->unkC0)) {
|
||||
case 3:
|
||||
gUnknown_203B20C->item.quantity = gUnknown_203B20C->unkC0;
|
||||
gTeamInventoryRef->teamStorage[gUnknown_203B20C->item.id] -= gUnknown_203B20C->item.quantity;
|
||||
item.id = gUnknown_203B20C->item.id;
|
||||
item.quantity = gUnknown_203B20C->item.quantity;
|
||||
AddHeldItemToInventory(&item);
|
||||
|
||||
if (!sub_801CF14(1)) {
|
||||
if (GetNumberOfFilledInventorySlots() >= INVENTORY_SIZE) {
|
||||
error:
|
||||
sub_801CBB8();
|
||||
sub_8017F10(1);
|
||||
}
|
||||
else
|
||||
sub_8017F10(11);
|
||||
}
|
||||
else
|
||||
goto error;
|
||||
break;
|
||||
case 2:
|
||||
sub_8017F10(11);
|
||||
break;
|
||||
case 1:
|
||||
sub_8018280();
|
||||
break;
|
||||
case 0:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8018904(void)
|
||||
{
|
||||
s32 menuAction;
|
||||
|
||||
menuAction = 0;
|
||||
|
||||
sub_801A6E8(FALSE);
|
||||
if (sub_8012FD8(&gUnknown_203B20C->unk70) == 0) {
|
||||
sub_8013114(&gUnknown_203B20C->unk70, &menuAction);
|
||||
if (menuAction != 1)
|
||||
gUnknown_203B20C->menuAction2 = menuAction;
|
||||
}
|
||||
|
||||
switch (menuAction) {
|
||||
case 2:
|
||||
if (IsNotMoneyOrUsedTMItem(gUnknown_203B20C->item.id)) {
|
||||
if (sub_801ADA0(gUnknown_203B20C->itemIndex) == 0) {
|
||||
error:
|
||||
sub_8012EA4(&gUnknown_203B20C->unk70, 1);
|
||||
}
|
||||
else {
|
||||
MoveToStorage(&gUnknown_203B20C->item);
|
||||
ShiftItemsDownFrom(gUnknown_203B20C->itemIndex);
|
||||
FillInventoryGaps();
|
||||
|
||||
if (GetNumberOfFilledInventorySlots() == 0) {
|
||||
sub_801A928();
|
||||
sub_8017F10(1);
|
||||
}
|
||||
else
|
||||
sub_8017F10(5);
|
||||
}
|
||||
}
|
||||
else
|
||||
goto error;
|
||||
break;
|
||||
case 4:
|
||||
sub_8099690(0);
|
||||
sub_8017F10(7);
|
||||
break;
|
||||
case 1:
|
||||
sub_8017F10(5);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80189C8(void)
|
||||
{
|
||||
BulkItem item;
|
||||
s32 menuAction;
|
||||
|
||||
menuAction = 0;
|
||||
|
||||
sub_801CA08(FALSE);
|
||||
if (sub_8012FD8(&gUnknown_203B20C->unk70) == 0) {
|
||||
sub_8013114(&gUnknown_203B20C->unk70, &menuAction);
|
||||
if (menuAction != 1)
|
||||
gUnknown_203B20C->menuAction3 = menuAction;
|
||||
}
|
||||
|
||||
switch (menuAction) {
|
||||
case 3:
|
||||
if (GetNumberOfFilledInventorySlots() >= INVENTORY_SIZE)
|
||||
sub_8012EA4(&gUnknown_203B20C->unk70, 1);
|
||||
else if (IsThrowableItem(gUnknown_203B20C->item.id))
|
||||
sub_8017F10(12);
|
||||
else {
|
||||
gTeamInventoryRef->teamStorage[gUnknown_203B20C->item.id] -= gUnknown_203B20C->item.quantity;
|
||||
item.id = gUnknown_203B20C->item.id;
|
||||
item.quantity = gUnknown_203B20C->item.quantity;
|
||||
AddHeldItemToInventory(&item);
|
||||
|
||||
if (!sub_801CF14(1)) {
|
||||
if (GetNumberOfFilledInventorySlots() >= INVENTORY_SIZE)
|
||||
{
|
||||
error:
|
||||
sub_801CBB8();
|
||||
sub_8017F10(1);
|
||||
}
|
||||
else
|
||||
sub_8017F10(11);
|
||||
}
|
||||
else
|
||||
goto error;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
sub_8017F10(14);
|
||||
break;
|
||||
case 1:
|
||||
sub_8017F10(11);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8018AC8(void)
|
||||
{
|
||||
switch (sub_801B410()) {
|
||||
case 2:
|
||||
case 3:
|
||||
sub_801B450();
|
||||
sub_8017F10(5);
|
||||
break;
|
||||
case 0:
|
||||
case 1:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8018AE4(void)
|
||||
{
|
||||
switch (sub_801B410()) {
|
||||
case 2:
|
||||
case 3:
|
||||
sub_801B450();
|
||||
sub_8017F10(11);
|
||||
break;
|
||||
case 0:
|
||||
case 1:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
628
src/kangaskhan_storage2.c
Normal file
628
src/kangaskhan_storage2.c
Normal file
@@ -0,0 +1,628 @@
|
||||
#include "global.h"
|
||||
#include "code_80130A8.h"
|
||||
#include "code_801B3C0.h"
|
||||
#include "code_801C620.h"
|
||||
#include "code_8098DBC.h"
|
||||
#include "kangaskhan_storage2.h"
|
||||
#include "kecleon_bros4.h"
|
||||
#include "memory.h"
|
||||
#include "menu_input.h"
|
||||
#include "text1.h"
|
||||
#include "text2.h"
|
||||
|
||||
EWRAM_DATA_2 struct unkStruct_203B20C *gUnknown_203B20C = {0};
|
||||
|
||||
extern const u8 *gUnknown_80D4934[];
|
||||
extern const u8 *gUnknown_80D4958[];
|
||||
extern const u8 *gUnknown_80D4964[];
|
||||
extern const u8 *gUnknown_80D4970[];
|
||||
|
||||
#include "data/kangaskhan_storage2.h" // 80DB7B8
|
||||
|
||||
static void sub_8017F10(u32);
|
||||
static void sub_8017F28(void);
|
||||
static void sub_8018100(void);
|
||||
static void sub_8018280(void);
|
||||
static void sub_80182E4(void);
|
||||
static void sub_801841C(void);
|
||||
static void sub_80184D4(void);
|
||||
static void sub_8018588(void);
|
||||
static void sub_8018620(void);
|
||||
static void sub_80186F8(void);
|
||||
static void sub_8018854(void);
|
||||
static void sub_8018904(void);
|
||||
static void sub_80189C8(void);
|
||||
static void sub_8018AC8(void);
|
||||
static void sub_8018AE4(void);
|
||||
|
||||
bool8 sub_8017E1C(void)
|
||||
{
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(NULL, TRUE, TRUE);
|
||||
gUnknown_203B20C = MemoryAlloc(sizeof(struct unkStruct_203B20C), 8);
|
||||
gUnknown_203B20C->menuAction1 = 0;
|
||||
gUnknown_203B20C->menuAction2 = 0;
|
||||
gUnknown_203B20C->menuAction3 = 0;
|
||||
sub_8017F10(0);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u32 sub_8017E54(void)
|
||||
{
|
||||
switch (gUnknown_203B20C->state) {
|
||||
case 0:
|
||||
sub_8017F10(1);
|
||||
break;
|
||||
case 1:
|
||||
sub_8018588();
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
sub_8018620();
|
||||
break;
|
||||
case 6:
|
||||
sub_8018904();
|
||||
break;
|
||||
case 7:
|
||||
sub_8018AC8();
|
||||
break;
|
||||
case 10:
|
||||
case 11:
|
||||
sub_80186F8();
|
||||
break;
|
||||
case 12:
|
||||
sub_8018854();
|
||||
break;
|
||||
case 13:
|
||||
sub_80189C8();
|
||||
break;
|
||||
case 14:
|
||||
sub_8018AE4();
|
||||
break;
|
||||
case 3:
|
||||
return 3;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sub_8017EF4(void)
|
||||
{
|
||||
if (gUnknown_203B20C != NULL) {
|
||||
MemoryFree(gUnknown_203B20C);
|
||||
gUnknown_203B20C = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8017F10(u32 newState)
|
||||
{
|
||||
gUnknown_203B20C->state = newState;
|
||||
sub_8017F28();
|
||||
sub_8018100();
|
||||
}
|
||||
|
||||
static void sub_8017F28(void)
|
||||
{
|
||||
s32 index;
|
||||
|
||||
sub_8006518(gUnknown_203B20C->unkF0);
|
||||
|
||||
switch (gUnknown_203B20C->state) {
|
||||
case 1:
|
||||
gUnknown_203B20C->unkF0[0] = sUnknown_80DB7B8;
|
||||
gUnknown_203B20C->unkF0[1] = sUnknown_80DB7B8;
|
||||
gUnknown_203B20C->unkF0[0] = sUnknown_80DB7B8;
|
||||
sub_80182E4();
|
||||
gUnknown_203B20C->unkF0[2] = sUnknown_80DB7D0;
|
||||
sub_8012CAC(&gUnknown_203B20C->unkF0[2], gUnknown_203B20C->unk20);
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
gUnknown_203B20C->unkF0[0] = sUnknown_80DB7B8;
|
||||
gUnknown_203B20C->unkF0[1] = sUnknown_80DB7B8;
|
||||
gUnknown_203B20C->unkF0[2] = sUnknown_80DB7B8;
|
||||
gUnknown_203B20C->unkF0[0] = sUnknown_80DB7B8;
|
||||
break;
|
||||
case 10:
|
||||
case 11:
|
||||
gUnknown_203B20C->unkF0[0] = sUnknown_80DB7B8;
|
||||
gUnknown_203B20C->unkF0[1] = sUnknown_80DB7B8;
|
||||
gUnknown_203B20C->unkF0[2] = sUnknown_80DB7B8;
|
||||
gUnknown_203B20C->unkF0[0] = sUnknown_80DB800;
|
||||
break;
|
||||
case 12:
|
||||
gUnknown_203B20C->unkF0[1] = sUnknown_80DB818;
|
||||
break;
|
||||
case 6:
|
||||
case 13:
|
||||
gUnknown_203B20C->unkF0[2] = sUnknown_80DB7E8;
|
||||
break;
|
||||
default:
|
||||
case 0:
|
||||
for (index = 0; index < 4; index++)
|
||||
gUnknown_203B20C->unkF0[index] = sUnknown_80DB7B8;
|
||||
break;
|
||||
}
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(gUnknown_203B20C->unkF0, TRUE, TRUE);
|
||||
}
|
||||
|
||||
static void sub_8018100(void)
|
||||
{
|
||||
switch (gUnknown_203B20C->state) {
|
||||
case 1:
|
||||
sub_8012D60(&gUnknown_203B20C->unk70, gUnknown_203B20C->unk20, 0, gUnknown_203B20C->unk60, gUnknown_203B20C->menuAction1, 2);
|
||||
break;
|
||||
case 4:
|
||||
sub_801A5D8(3, 3, NULL, 10);
|
||||
break;
|
||||
case 5:
|
||||
sub_801A8D0(TRUE);
|
||||
break;
|
||||
case 6:
|
||||
sub_801A9E0();
|
||||
sub_801841C();
|
||||
sub_8012D60(&gUnknown_203B20C->unk70, gUnknown_203B20C->unk20, 0, gUnknown_203B20C->unk60, gUnknown_203B20C->menuAction2, 2);
|
||||
break;
|
||||
case 7:
|
||||
sub_801B3C0(&gUnknown_203B20C->item);
|
||||
break;
|
||||
case 10:
|
||||
sub_801C8C4(1, 3, 0, 10);
|
||||
sub_801AD34(0);
|
||||
break;
|
||||
case 11:
|
||||
sub_801CB5C(TRUE);
|
||||
sub_801AD34(0);
|
||||
break;
|
||||
case 12:
|
||||
gUnknown_203B20C->unkD0 = 2;
|
||||
gUnknown_203B20C->unkC8 = 1;
|
||||
|
||||
if (gTeamInventoryRef->teamStorage[gUnknown_203B20C->item.id] > 99)
|
||||
gUnknown_203B20C->unkCC = 99;
|
||||
else
|
||||
gUnknown_203B20C->unkCC = gTeamInventoryRef->teamStorage[gUnknown_203B20C->item.id];
|
||||
|
||||
gUnknown_203B20C->unkC4 = gUnknown_203B20C->unkCC;
|
||||
gUnknown_203B20C->unkD4 = 1;
|
||||
gUnknown_203B20C->unkD8 = &gUnknown_203B20C->unkF0[1];
|
||||
gUnknown_203B20C->unkDC = 40;
|
||||
gUnknown_203B20C->unkE0 = 18;
|
||||
sub_8013AA0(&gUnknown_203B20C->unkC0);
|
||||
sub_8018280();
|
||||
break;
|
||||
case 13:
|
||||
sub_801CCD8();
|
||||
sub_801AD34(0);
|
||||
sub_80184D4();
|
||||
sub_8012D60(&gUnknown_203B20C->unk70, gUnknown_203B20C->unk20, 0, gUnknown_203B20C->unk60, gUnknown_203B20C->menuAction3, 2);
|
||||
break;
|
||||
case 14:
|
||||
sub_801B3C0(&gUnknown_203B20C->item);
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8018280(void)
|
||||
{
|
||||
sub_8008C54(gUnknown_203B20C->unkD4);
|
||||
sub_80073B8(gUnknown_203B20C->unkD4);
|
||||
xxx_call_draw_string(4, 0, sNumber, gUnknown_203B20C->unkD4, 0);
|
||||
sub_8013C68(&gUnknown_203B20C->unkC0);
|
||||
sub_80073E0(gUnknown_203B20C->unkD4);
|
||||
sub_801CCD8();
|
||||
sub_801AD34(0);
|
||||
sub_8012EA4(&gUnknown_203B20C->unk70, 0);
|
||||
}
|
||||
|
||||
static void sub_80182E4(void)
|
||||
{
|
||||
int index;
|
||||
s32 loopMax;
|
||||
|
||||
loopMax = 0;
|
||||
MemoryFill16(gUnknown_203B20C->unk60, 0, sizeof(gUnknown_203B20C->unk60));
|
||||
gUnknown_203B20C->unk20[0].text = *gUnknown_80D4958;
|
||||
gUnknown_203B20C->unk20[0].menuAction = 2;
|
||||
|
||||
if (GetNumberOfFilledInventorySlots() == 0 || sub_801CF50(0))
|
||||
gUnknown_203B20C->unk60[0] = 1;
|
||||
|
||||
loopMax += 1;
|
||||
gUnknown_203B20C->unk20[loopMax].text = *gUnknown_80D4964;
|
||||
gUnknown_203B20C->unk20[loopMax].menuAction = 3;
|
||||
|
||||
if (sub_801CF14(1) || INVENTORY_SIZE <= GetNumberOfFilledInventorySlots())
|
||||
gUnknown_203B20C->unk60[loopMax] = 1;
|
||||
|
||||
loopMax += 1;
|
||||
gUnknown_203B20C->unk20[loopMax].text = *gUnknown_80D4934;
|
||||
gUnknown_203B20C->unk20[loopMax].menuAction = 1;
|
||||
|
||||
loopMax += 1;
|
||||
gUnknown_203B20C->unk20[loopMax].text = NULL;
|
||||
gUnknown_203B20C->unk20[loopMax].menuAction = 1;
|
||||
|
||||
for (index = 0; index < loopMax; index++) {
|
||||
if (gUnknown_203B20C->unk60[index] == 0) {
|
||||
if (gUnknown_203B20C->unk20[index].menuAction == gUnknown_203B20C->menuAction1)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (index = 0; index < loopMax; index++) {
|
||||
if (gUnknown_203B20C->unk60[index] == 0) {
|
||||
gUnknown_203B20C->menuAction1 = gUnknown_203B20C->unk20[index].menuAction;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_801841C(void)
|
||||
{
|
||||
s32 index;
|
||||
s32 loopMax;
|
||||
|
||||
loopMax = 0;
|
||||
MemoryFill16(gUnknown_203B20C->unk60,0,sizeof(gUnknown_203B20C->unk60));
|
||||
gUnknown_203B20C->unk20[0].text = *gUnknown_80D4958;
|
||||
gUnknown_203B20C->unk20[0].menuAction = 2;
|
||||
if (!sub_801ADA0(gUnknown_203B20C->itemIndex))
|
||||
gUnknown_203B20C->unk60[0] = 1;
|
||||
|
||||
loopMax += 1;
|
||||
gUnknown_203B20C->unk20[loopMax].text = *gUnknown_80D4970;
|
||||
gUnknown_203B20C->unk20[loopMax].menuAction = 4;
|
||||
|
||||
loopMax += 1;
|
||||
gUnknown_203B20C->unk20[loopMax].text = NULL;
|
||||
gUnknown_203B20C->unk20[loopMax].menuAction = 1;
|
||||
|
||||
for (index = 0; index < loopMax; index++) {
|
||||
if (gUnknown_203B20C->unk60[index] == 0) {
|
||||
if (gUnknown_203B20C->unk20[index].menuAction == gUnknown_203B20C->menuAction2)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (index = 0; index < loopMax; index++) {
|
||||
if (gUnknown_203B20C->unk60[index] == 0) {
|
||||
gUnknown_203B20C->menuAction2 = gUnknown_203B20C->unk20[index].menuAction;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_80184D4(void)
|
||||
{
|
||||
s32 index;
|
||||
s32 loopMax;
|
||||
|
||||
loopMax = 0;
|
||||
MemoryFill16(gUnknown_203B20C->unk60, 0, sizeof(gUnknown_203B20C->unk60));
|
||||
gUnknown_203B20C->unk20[0].text = *gUnknown_80D4964;
|
||||
gUnknown_203B20C->unk20[0].menuAction = 3;
|
||||
|
||||
if (GetNumberOfFilledInventorySlots() >= INVENTORY_SIZE)
|
||||
gUnknown_203B20C->unk60[0] = 1;
|
||||
|
||||
loopMax += 1;
|
||||
gUnknown_203B20C->unk20[loopMax].text = *gUnknown_80D4970;
|
||||
gUnknown_203B20C->unk20[loopMax].menuAction = 4;
|
||||
|
||||
loopMax += 1;
|
||||
gUnknown_203B20C->unk20[loopMax].text = NULL;
|
||||
gUnknown_203B20C->unk20[loopMax].menuAction = 1;
|
||||
|
||||
for (index = 0; index < loopMax; index++) {
|
||||
if (gUnknown_203B20C->unk60[index] == 0) {
|
||||
if (gUnknown_203B20C->unk20[index].menuAction == gUnknown_203B20C->menuAction3)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (index = 0; index < loopMax; index++) {
|
||||
if (gUnknown_203B20C->unk60[index] == 0) {
|
||||
gUnknown_203B20C->menuAction3 = gUnknown_203B20C->unk20[index].menuAction;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8018588(void)
|
||||
{
|
||||
s32 menuAction;
|
||||
menuAction = 0;
|
||||
|
||||
if (sub_8012FD8(&gUnknown_203B20C->unk70) == 0) {
|
||||
sub_8013114(&gUnknown_203B20C->unk70, &menuAction);
|
||||
if (menuAction != 1)
|
||||
gUnknown_203B20C->menuAction1 = menuAction;
|
||||
}
|
||||
|
||||
switch (menuAction) {
|
||||
case 2:
|
||||
if (GetNumberOfFilledInventorySlots() != 0 && !sub_801CF50(0))
|
||||
sub_8017F10(4);
|
||||
else
|
||||
sub_8012EA4(&gUnknown_203B20C->unk70, 1);
|
||||
break;
|
||||
case 3:
|
||||
if (sub_801CF14(1))
|
||||
sub_8012EA4(&gUnknown_203B20C->unk70, 1);
|
||||
else
|
||||
sub_8017F10(10);
|
||||
break;
|
||||
case 1:
|
||||
sub_8017F10(3);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8018620(void)
|
||||
{
|
||||
s32 index;
|
||||
|
||||
switch (sub_801A6E8(TRUE)) {
|
||||
case 3:
|
||||
if (sub_801AEA8() != 0) {
|
||||
for (index = 0; index < INVENTORY_SIZE; index++) {
|
||||
if (sub_801AED0(index) != 0) {
|
||||
MoveToStorage(&gTeamInventoryRef->teamItems[index]);
|
||||
gTeamInventoryRef->teamItems[index].id = 0;
|
||||
gTeamInventoryRef->teamItems[index].flags = 0;
|
||||
}
|
||||
}
|
||||
|
||||
FillInventoryGaps();
|
||||
sub_801AE84();
|
||||
|
||||
if (GetNumberOfFilledInventorySlots() == 0) {
|
||||
sub_801A928();
|
||||
sub_8017F10(1);
|
||||
}
|
||||
else
|
||||
sub_8017F10(5);
|
||||
}
|
||||
else {
|
||||
gUnknown_203B20C->itemIndex = sub_801A8AC();
|
||||
gUnknown_203B20C->item = gTeamInventoryRef->teamItems[gUnknown_203B20C->itemIndex];
|
||||
sub_8017F10(6);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
gUnknown_203B20C->itemIndex = sub_801A8AC();
|
||||
gUnknown_203B20C->item = gTeamInventoryRef->teamItems[gUnknown_203B20C->itemIndex];
|
||||
sub_8017F10(7);
|
||||
break;
|
||||
case 2:
|
||||
sub_801A928();
|
||||
sub_8017F10(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_80186F8(void)
|
||||
{
|
||||
BulkItem item;
|
||||
s32 itemID;
|
||||
|
||||
switch (sub_801CA08(TRUE)) {
|
||||
case 3:
|
||||
if (sub_801CFB8() != 0) {
|
||||
for (itemID = 0; itemID < NUMBER_OF_ITEM_IDS; itemID++) {
|
||||
if (sub_801CFE0(itemID) != 0) {
|
||||
item.id = itemID;
|
||||
|
||||
if (IsThrowableItem(item.id)) {
|
||||
if (gTeamInventoryRef->teamStorage[item.id] > 99)
|
||||
item.quantity = 99;
|
||||
else
|
||||
item.quantity = gTeamInventoryRef->teamStorage[item.id];
|
||||
}
|
||||
else
|
||||
item.quantity = 1;
|
||||
|
||||
gTeamInventoryRef->teamStorage[item.id] -= item.quantity;
|
||||
AddHeldItemToInventory(&item);
|
||||
}
|
||||
}
|
||||
|
||||
FillInventoryGaps();
|
||||
sub_801CF94();
|
||||
|
||||
if (!sub_801CF14(1) && GetNumberOfFilledInventorySlots() < INVENTORY_SIZE)
|
||||
sub_8017F10(11);
|
||||
else {
|
||||
sub_801CBB8();
|
||||
sub_8017F10(1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
gUnknown_203B20C->id = sub_801CB24();
|
||||
xxx_init_itemslot_8090A8C(&gUnknown_203B20C->item, gUnknown_203B20C->id, 0);
|
||||
gUnknown_203B20C->item.quantity = 1;
|
||||
sub_8017F10(13);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
gUnknown_203B20C->id = sub_801CB24();
|
||||
xxx_init_itemslot_8090A8C(&gUnknown_203B20C->item, gUnknown_203B20C->id, 0);
|
||||
gUnknown_203B20C->item.quantity = 1;
|
||||
sub_8017F10(14);
|
||||
break;
|
||||
case 2:
|
||||
sub_801CBB8();
|
||||
sub_8017F10(1);
|
||||
break;
|
||||
case 1:
|
||||
sub_801AD34(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8018854(void)
|
||||
{
|
||||
BulkItem item;
|
||||
|
||||
sub_801CA08(FALSE);
|
||||
sub_8012FD8(&gUnknown_203B20C->unk70);
|
||||
|
||||
switch (sub_8013BBC(&gUnknown_203B20C->unkC0)) {
|
||||
case 3:
|
||||
gUnknown_203B20C->item.quantity = gUnknown_203B20C->unkC0;
|
||||
gTeamInventoryRef->teamStorage[gUnknown_203B20C->item.id] -= gUnknown_203B20C->item.quantity;
|
||||
item.id = gUnknown_203B20C->item.id;
|
||||
item.quantity = gUnknown_203B20C->item.quantity;
|
||||
AddHeldItemToInventory(&item);
|
||||
|
||||
if (!sub_801CF14(1)) {
|
||||
if (GetNumberOfFilledInventorySlots() >= INVENTORY_SIZE) {
|
||||
error:
|
||||
sub_801CBB8();
|
||||
sub_8017F10(1);
|
||||
}
|
||||
else
|
||||
sub_8017F10(11);
|
||||
}
|
||||
else
|
||||
goto error;
|
||||
break;
|
||||
case 2:
|
||||
sub_8017F10(11);
|
||||
break;
|
||||
case 1:
|
||||
sub_8018280();
|
||||
break;
|
||||
case 0:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8018904(void)
|
||||
{
|
||||
s32 menuAction;
|
||||
|
||||
menuAction = 0;
|
||||
|
||||
sub_801A6E8(FALSE);
|
||||
if (sub_8012FD8(&gUnknown_203B20C->unk70) == 0) {
|
||||
sub_8013114(&gUnknown_203B20C->unk70, &menuAction);
|
||||
if (menuAction != 1)
|
||||
gUnknown_203B20C->menuAction2 = menuAction;
|
||||
}
|
||||
|
||||
switch (menuAction) {
|
||||
case 2:
|
||||
if (IsNotMoneyOrUsedTMItem(gUnknown_203B20C->item.id)) {
|
||||
if (!sub_801ADA0(gUnknown_203B20C->itemIndex)) {
|
||||
error:
|
||||
sub_8012EA4(&gUnknown_203B20C->unk70, 1);
|
||||
}
|
||||
else {
|
||||
MoveToStorage(&gUnknown_203B20C->item);
|
||||
ShiftItemsDownFrom(gUnknown_203B20C->itemIndex);
|
||||
FillInventoryGaps();
|
||||
|
||||
if (GetNumberOfFilledInventorySlots() == 0) {
|
||||
sub_801A928();
|
||||
sub_8017F10(1);
|
||||
}
|
||||
else
|
||||
sub_8017F10(5);
|
||||
}
|
||||
}
|
||||
else
|
||||
goto error;
|
||||
break;
|
||||
case 4:
|
||||
sub_8099690(0);
|
||||
sub_8017F10(7);
|
||||
break;
|
||||
case 1:
|
||||
sub_8017F10(5);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_80189C8(void)
|
||||
{
|
||||
BulkItem item;
|
||||
s32 menuAction;
|
||||
|
||||
menuAction = 0;
|
||||
|
||||
sub_801CA08(FALSE);
|
||||
if (sub_8012FD8(&gUnknown_203B20C->unk70) == 0) {
|
||||
sub_8013114(&gUnknown_203B20C->unk70, &menuAction);
|
||||
if (menuAction != 1)
|
||||
gUnknown_203B20C->menuAction3 = menuAction;
|
||||
}
|
||||
|
||||
switch (menuAction) {
|
||||
case 3:
|
||||
if (GetNumberOfFilledInventorySlots() >= INVENTORY_SIZE)
|
||||
sub_8012EA4(&gUnknown_203B20C->unk70, 1);
|
||||
else if (IsThrowableItem(gUnknown_203B20C->item.id))
|
||||
sub_8017F10(12);
|
||||
else {
|
||||
gTeamInventoryRef->teamStorage[gUnknown_203B20C->item.id] -= gUnknown_203B20C->item.quantity;
|
||||
item.id = gUnknown_203B20C->item.id;
|
||||
item.quantity = gUnknown_203B20C->item.quantity;
|
||||
AddHeldItemToInventory(&item);
|
||||
|
||||
if (!sub_801CF14(1)) {
|
||||
if (GetNumberOfFilledInventorySlots() >= INVENTORY_SIZE)
|
||||
{
|
||||
error:
|
||||
sub_801CBB8();
|
||||
sub_8017F10(1);
|
||||
}
|
||||
else
|
||||
sub_8017F10(11);
|
||||
}
|
||||
else
|
||||
goto error;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
sub_8017F10(14);
|
||||
break;
|
||||
case 1:
|
||||
sub_8017F10(11);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8018AC8(void)
|
||||
{
|
||||
switch (sub_801B410()) {
|
||||
case 2:
|
||||
case 3:
|
||||
sub_801B450();
|
||||
sub_8017F10(5);
|
||||
break;
|
||||
case 0:
|
||||
case 1:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8018AE4(void)
|
||||
{
|
||||
switch (sub_801B410()) {
|
||||
case 2:
|
||||
case 3:
|
||||
sub_801B450();
|
||||
sub_8017F10(11);
|
||||
break;
|
||||
case 0:
|
||||
case 1:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
1800
src/kecleon_bros.c
1800
src/kecleon_bros.c
File diff suppressed because it is too large
Load Diff
907
src/kecleon_bros1.c
Normal file
907
src/kecleon_bros1.c
Normal file
@@ -0,0 +1,907 @@
|
||||
#include "global.h"
|
||||
#include "code_80118A4.h"
|
||||
#include "code_80130A8.h"
|
||||
#include "code_801B3C0.h"
|
||||
#include "code_8098DBC.h"
|
||||
#include "felicity_bank.h"
|
||||
#include "items.h"
|
||||
#include "kecleon_bros1.h"
|
||||
#include "kecleon_bros2.h"
|
||||
#include "kecleon_bros3.h"
|
||||
#include "kecleon_bros4.h"
|
||||
#include "memory.h"
|
||||
#include "menu_input.h"
|
||||
#include "pokemon.h"
|
||||
#include "text1.h"
|
||||
#include "text2.h"
|
||||
|
||||
extern u32 gUnknown_202DE30;
|
||||
extern u8 gUnknown_202DE58[];
|
||||
extern u8 gUnknown_202E1C8[];
|
||||
extern u8 gUnknown_202E5D8[];
|
||||
|
||||
static EWRAM_DATA_2 KecleonBrosWork1 *sKecleonBrosWork1 = {0};
|
||||
|
||||
extern const u8 *gUnknown_80D4920[];
|
||||
extern const u8 *gUnknown_80D4928[];
|
||||
extern const u8 *gUnknown_80D4934[];
|
||||
extern const u8 *gUnknown_80D4970[];
|
||||
extern const u8 *gUnknown_80D4978[];
|
||||
extern const u8 *gUnknown_80D4984[];
|
||||
extern const u8 *gKecleonShopDialogue[KECLEON_BROS_MODE_COUNT][23]; // 80D5EC8
|
||||
|
||||
#include "data/kecleon_bros1.h"
|
||||
|
||||
static u32 CountKecleonItems(void);
|
||||
static void SetKecleonBrosState(u32);
|
||||
static void UpdateKecleonStoreDialogue(void);
|
||||
|
||||
static void sub_8018D30(void);
|
||||
static void sub_80194F8(void);
|
||||
static void sub_80195C0(void);
|
||||
static void sub_8019660(void);
|
||||
static void sub_8019700(void);
|
||||
static void sub_8019730(void);
|
||||
static void sub_8019850(void);
|
||||
static void sub_80198E8(void);
|
||||
static void sub_8019944(void);
|
||||
static void sub_80199CC(void);
|
||||
static void sub_8019B08(void);
|
||||
static void sub_8019BBC(void);
|
||||
static void sub_8019C78(void);
|
||||
static void sub_8019D30(void);
|
||||
static void sub_8019D4C(void);
|
||||
static void sub_8019D68(void);
|
||||
static void sub_8019DAC(void);
|
||||
static void sub_8019E04(bool32);
|
||||
|
||||
bool8 CreateKecleonBros(u32 mode)
|
||||
{
|
||||
u8 *monName;
|
||||
OpenedFile *faceFile;
|
||||
|
||||
sKecleonBrosWork1 = MemoryAlloc(sizeof(KecleonBrosWork1), 8);
|
||||
sKecleonBrosWork1->menuAction1 = 0;
|
||||
sKecleonBrosWork1->menuAction2 = 0;
|
||||
sKecleonBrosWork1->menuAction3 = 0;
|
||||
sKecleonBrosWork1->mode = mode;
|
||||
|
||||
switch (mode) {
|
||||
case KECLEON_BROS_MODE_ITEMS_AWAKE:
|
||||
sKecleonBrosWork1->isKecleonItemShop = TRUE;
|
||||
sKecleonBrosWork1->unkE4 = &sKecleonBrosWork1->faceFile;
|
||||
CopyYellowMonsterNametoBuffer(gUnknown_202E5D8, MONSTER_KECLEON);
|
||||
CopyYellowMonsterNametoBuffer(gUnknown_202E1C8, MONSTER_KECLEON);
|
||||
monName = GetMonSpecies(MONSTER_KECLEON);
|
||||
strcpy(gUnknown_202E1C8 - 0x50, monName);
|
||||
break;
|
||||
case KECLEON_BROS_MODE_ITEMS_ASLEEP:
|
||||
sKecleonBrosWork1->isKecleonItemShop = TRUE;
|
||||
sKecleonBrosWork1->unkE4 = NULL;
|
||||
CopyYellowMonsterNametoBuffer(gUnknown_202E5D8, MONSTER_KECLEON);
|
||||
CopyYellowMonsterNametoBuffer(gUnknown_202E1C8, MONSTER_KECLEON);
|
||||
monName = GetMonSpecies(MONSTER_KECLEON);
|
||||
strcpy(gUnknown_202E1C8 - 0x50, monName);
|
||||
break;
|
||||
case KECLEON_BROS_MODE_WARES_AWAKE:
|
||||
sKecleonBrosWork1->isKecleonItemShop = FALSE;
|
||||
sKecleonBrosWork1->unkE4 = &sKecleonBrosWork1->faceFile;
|
||||
CopyYellowMonsterNametoBuffer(gUnknown_202E5D8, MONSTER_KECLEON);
|
||||
CopyYellowMonsterNametoBuffer(gUnknown_202E1C8, MONSTER_KECLEON);
|
||||
monName = GetMonSpecies(MONSTER_KECLEON);
|
||||
strcpy(gUnknown_202E1C8 - 0x50, monName);
|
||||
break;
|
||||
case KECLEON_BROS_MODE_WARES_ASLEEP:
|
||||
sKecleonBrosWork1->isKecleonItemShop = FALSE;
|
||||
sKecleonBrosWork1->unkE4 = NULL;
|
||||
CopyYellowMonsterNametoBuffer(gUnknown_202E5D8, MONSTER_KECLEON);
|
||||
CopyYellowMonsterNametoBuffer(gUnknown_202E1C8, MONSTER_KECLEON);
|
||||
monName = GetMonSpecies(MONSTER_KECLEON);
|
||||
strcpy(gUnknown_202E1C8 - 0x50, monName);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
faceFile = GetDialogueSpriteDataPtr(MONSTER_KECLEON);
|
||||
sKecleonBrosWork1->faceFile = faceFile;
|
||||
sKecleonBrosWork1->faceData = faceFile->data;
|
||||
sKecleonBrosWork1->unkE0 = 0;
|
||||
sKecleonBrosWork1->unkE1 = 0;
|
||||
sKecleonBrosWork1->unkE2 = 0;
|
||||
sKecleonBrosWork1->unkDC = 2;
|
||||
sKecleonBrosWork1->unkDE = 8;
|
||||
SetKecleonBrosState(KECLEON_STORE_INIT);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u32 KecleonBrosCallback(void)
|
||||
{
|
||||
switch (sKecleonBrosWork1->currState) {
|
||||
case KECLEON_STORE_INIT:
|
||||
case KECLEON_STORE_MAIN_MENU:
|
||||
sub_8019730();
|
||||
break;
|
||||
case 0x12:
|
||||
case 0x13:
|
||||
sub_80199CC();
|
||||
break;
|
||||
case 0x1a:
|
||||
case 0x1b:
|
||||
sub_8019B08();
|
||||
break;
|
||||
case 0x14:
|
||||
sub_8019BBC();
|
||||
break;
|
||||
case 0x1c:
|
||||
sub_8019C78();
|
||||
break;
|
||||
case 0x16:
|
||||
sub_8019850();
|
||||
break;
|
||||
case 0x1e:
|
||||
sub_80198E8();
|
||||
break;
|
||||
case 0x1f:
|
||||
sub_8019944();
|
||||
break;
|
||||
case 0x15:
|
||||
sub_8019D30();
|
||||
break;
|
||||
case 0x1d:
|
||||
sub_8019D4C();
|
||||
break;
|
||||
case KECLEON_STORE_EXIT:
|
||||
return 3;
|
||||
default:
|
||||
sub_8019D68();
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void DeleteKecleonBros(void)
|
||||
{
|
||||
if (sKecleonBrosWork1 != NULL) {
|
||||
CloseFile(sKecleonBrosWork1->faceFile);
|
||||
MemoryFree(sKecleonBrosWork1);
|
||||
sKecleonBrosWork1 = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void SetKecleonBrosState(u32 newState)
|
||||
{
|
||||
sKecleonBrosWork1->currState = newState;
|
||||
sub_8018D30();
|
||||
UpdateKecleonStoreDialogue();
|
||||
}
|
||||
|
||||
static void sub_8018D30(void)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
sub_8006518(sKecleonBrosWork1->unkE8);
|
||||
|
||||
switch (sKecleonBrosWork1->currState) {
|
||||
case 18:
|
||||
case 19:
|
||||
sKecleonBrosWork1->unkE8[0] = sUnknown_80DB840;
|
||||
sKecleonBrosWork1->unkE8[2] = sUnknown_80DB840;
|
||||
sKecleonBrosWork1->unkE8[0] = sUnknown_80DB870;
|
||||
sKecleonBrosWork1->unkE8[1] = sUnknown_80DB888;
|
||||
break;
|
||||
case 26:
|
||||
case 27:
|
||||
sKecleonBrosWork1->unkE8[0] = sUnknown_80DB840;
|
||||
sKecleonBrosWork1->unkE8[1] = sUnknown_80DB840;
|
||||
sKecleonBrosWork1->unkE8[2] = sUnknown_80DB840;
|
||||
sKecleonBrosWork1->unkE8[1] = sUnknown_80DB888;
|
||||
break;
|
||||
case 20:
|
||||
case 28:
|
||||
sKecleonBrosWork1->unkE8[2] = sUnknown_80DB858;
|
||||
break;
|
||||
default:
|
||||
case 21:
|
||||
case 22:
|
||||
case 23:
|
||||
case 24:
|
||||
case 25:
|
||||
for (i = 0; i < 4; i++)
|
||||
sKecleonBrosWork1->unkE8[i] = sUnknown_80DB840;
|
||||
break;
|
||||
}
|
||||
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(sKecleonBrosWork1->unkE8, TRUE, TRUE);
|
||||
}
|
||||
|
||||
static void UpdateKecleonStoreDialogue(void)
|
||||
{
|
||||
switch (sKecleonBrosWork1->currState) {
|
||||
case 0:
|
||||
sub_8019DAC();
|
||||
sub_80194F8();
|
||||
sub_8019E04(FALSE);
|
||||
sub_8014248(gKecleonShopDialogue[sKecleonBrosWork1->mode][0], 0, sKecleonBrosWork1->menuAction1,
|
||||
sKecleonBrosWork1->menuItems, sKecleonBrosWork1->unk74, 4, 0, sKecleonBrosWork1->unkE4, 12);
|
||||
break;
|
||||
case 1:
|
||||
sub_8019DAC();
|
||||
sub_80194F8();
|
||||
sub_8019E04(FALSE);
|
||||
sub_8014248(gKecleonShopDialogue[sKecleonBrosWork1->mode][1], 0, sKecleonBrosWork1->menuAction1,
|
||||
sKecleonBrosWork1->menuItems, sKecleonBrosWork1->unk74, 4, 0, sKecleonBrosWork1->unkE4, 12);
|
||||
break;
|
||||
case 2:
|
||||
sKecleonBrosWork1->fallbackState = 1;
|
||||
sub_8019E04(FALSE);
|
||||
sub_80141B4(gKecleonShopDialogue[sKecleonBrosWork1->mode][22], 0, sKecleonBrosWork1->unkE4, 0x10D);
|
||||
break;
|
||||
case 3:
|
||||
sKecleonBrosWork1->fallbackState = 4;
|
||||
sub_8019E04(FALSE);
|
||||
sub_80141B4(gKecleonShopDialogue[sKecleonBrosWork1->mode][2], 0, sKecleonBrosWork1->unkE4, 0x30D);
|
||||
break;
|
||||
case 5:
|
||||
sKecleonBrosWork1->fallbackState = 1;
|
||||
sub_8019E04(FALSE);
|
||||
sub_80141B4(gKecleonShopDialogue[sKecleonBrosWork1->mode][12], 0, sKecleonBrosWork1->unkE4, 0x10D);
|
||||
break;
|
||||
case 6:
|
||||
sKecleonBrosWork1->fallbackState = 16;
|
||||
sub_8019E04(TRUE);
|
||||
sub_80141B4(gKecleonShopDialogue[sKecleonBrosWork1->mode][13], 0, sKecleonBrosWork1->unkE4, 0x10D);
|
||||
break;
|
||||
case 7:
|
||||
sKecleonBrosWork1->fallbackState = 1;
|
||||
sub_8019E04(TRUE);
|
||||
sub_80141B4(gKecleonShopDialogue[sKecleonBrosWork1->mode][14], 0, sKecleonBrosWork1->unkE4, 0x10D);
|
||||
break;
|
||||
case 8:
|
||||
sKecleonBrosWork1->fallbackState = 1;
|
||||
sub_8019E04(TRUE);
|
||||
sub_80141B4(gKecleonShopDialogue[sKecleonBrosWork1->mode][15], 0, sKecleonBrosWork1->unkE4, 0x10D);
|
||||
break;
|
||||
case 9:
|
||||
sKecleonBrosWork1->fallbackState = 1;
|
||||
sub_8019E04(TRUE);
|
||||
sub_80141B4(gKecleonShopDialogue[sKecleonBrosWork1->mode][16], 0, sKecleonBrosWork1->unkE4, 0x10D);
|
||||
break;
|
||||
case 10:
|
||||
sKecleonBrosWork1->fallbackState = 1;
|
||||
sub_8019E04(TRUE);
|
||||
sub_80141B4(gKecleonShopDialogue[sKecleonBrosWork1->mode][17], 0, sKecleonBrosWork1->unkE4, 0x10D);
|
||||
break;
|
||||
case 11:
|
||||
sKecleonBrosWork1->fallbackState = 1;
|
||||
sub_8019E04(FALSE);
|
||||
sub_80141B4(gKecleonShopDialogue[sKecleonBrosWork1->mode][18], 0, sKecleonBrosWork1->unkE4, 0x10D);
|
||||
break;
|
||||
case 12:
|
||||
sKecleonBrosWork1->fallbackState = 16;
|
||||
sub_8019E04(TRUE);
|
||||
sub_80141B4(gKecleonShopDialogue[sKecleonBrosWork1->mode][19], 0, sKecleonBrosWork1->unkE4, 0x10D);
|
||||
break;
|
||||
case 13:
|
||||
sub_8090E14(gUnknown_202DE58, &sKecleonBrosWork1->soldItem, NULL);
|
||||
sKecleonBrosWork1->fallbackState = 24;
|
||||
sub_8019E04(TRUE);
|
||||
sub_80141B4(gKecleonShopDialogue[sKecleonBrosWork1->mode][20], 0, sKecleonBrosWork1->unkE4, 0x10D);
|
||||
break;
|
||||
case 14:
|
||||
sKecleonBrosWork1->fallbackState = 24;
|
||||
sub_8019E04(TRUE);
|
||||
sub_80141B4(gKecleonShopDialogue[sKecleonBrosWork1->mode][21], 0, sKecleonBrosWork1->unkE4, 0x10D);
|
||||
break;
|
||||
case 15:
|
||||
sKecleonBrosWork1->fallbackState = 18;
|
||||
sub_8019E04(FALSE);
|
||||
sub_80141B4(gKecleonShopDialogue[sKecleonBrosWork1->mode][3], 0, sKecleonBrosWork1->unkE4, 0x10D);
|
||||
break;
|
||||
case 16:
|
||||
sKecleonBrosWork1->fallbackState = 19;
|
||||
sub_8019E04(FALSE);
|
||||
sub_80141B4(gKecleonShopDialogue[sKecleonBrosWork1->mode][4], 0, sKecleonBrosWork1->unkE4, 0x10D);
|
||||
break;
|
||||
case 18:
|
||||
if (sKecleonBrosWork1->isKecleonItemShop)
|
||||
sub_8019E40(3);
|
||||
else
|
||||
sub_801A20C(3);
|
||||
|
||||
sub_801AD34(0);
|
||||
DrawTeamMoneyBox(1);
|
||||
break;
|
||||
case 19:
|
||||
if (sKecleonBrosWork1->isKecleonItemShop)
|
||||
sub_8019FCC(TRUE);
|
||||
else
|
||||
sub_801A398(1);
|
||||
|
||||
sub_801AD34(0);
|
||||
DrawTeamMoneyBox(1);
|
||||
break;
|
||||
case 20:
|
||||
if (sKecleonBrosWork1->isKecleonItemShop)
|
||||
sub_801A0D8();
|
||||
else
|
||||
sub_801A4A4();
|
||||
|
||||
sub_801AD34(0);
|
||||
DrawTeamMoneyBox(1);
|
||||
sub_80195C0();
|
||||
sub_8012D60(&sKecleonBrosWork1->menu, sKecleonBrosWork1->menuItems, 0, sKecleonBrosWork1->unk74, sKecleonBrosWork1->menuAction3, 2);
|
||||
break;
|
||||
case 22:
|
||||
sub_8019700();
|
||||
sub_8090E14(gUnknown_202DE58, &sKecleonBrosWork1->soldItem, 0);
|
||||
gUnknown_202DE30 = sKecleonBrosWork1->itemSellPrice;
|
||||
sub_8019E04(FALSE);
|
||||
sub_8014248(gKecleonShopDialogue[sKecleonBrosWork1->mode][5], 0, 5,sKecleonBrosWork1->menuItems, NULL, 4, 0, sKecleonBrosWork1->unkE4, 12);
|
||||
break;
|
||||
case 17:
|
||||
if (CountKecleonItems() == 0) {
|
||||
if (sKecleonBrosWork1->isKecleonItemShop != FALSE)
|
||||
sub_801A010();
|
||||
else
|
||||
sub_801A3DC();
|
||||
sKecleonBrosWork1->fallbackState = 11;
|
||||
}
|
||||
else {
|
||||
if (GetNumberOfFilledInventorySlots() >= INVENTORY_SIZE) {
|
||||
if (sKecleonBrosWork1->isKecleonItemShop != FALSE)
|
||||
sub_801A010();
|
||||
else
|
||||
sub_801A3DC();
|
||||
sKecleonBrosWork1->fallbackState = 1;
|
||||
}
|
||||
else
|
||||
sKecleonBrosWork1->fallbackState = 16;
|
||||
}
|
||||
sub_8019E04(FALSE);
|
||||
sub_80141B4(gKecleonShopDialogue[sKecleonBrosWork1->mode][6], 0, sKecleonBrosWork1->unkE4, 0x10D);
|
||||
break;
|
||||
case 23:
|
||||
sKecleonBrosWork1->fallbackState = 26;
|
||||
sub_8019E04(FALSE);
|
||||
sub_80141B4(gKecleonShopDialogue[sKecleonBrosWork1->mode][7], 0, sKecleonBrosWork1->unkE4, 0x10D);
|
||||
break;
|
||||
case 24:
|
||||
sKecleonBrosWork1->fallbackState = 27;
|
||||
sub_8019E04(FALSE);
|
||||
sub_80141B4(gKecleonShopDialogue[sKecleonBrosWork1->mode][8], 0, sKecleonBrosWork1->unkE4, 0x10D);
|
||||
break;
|
||||
case 26:
|
||||
sub_801A5D8(4, 3, NULL, 10);
|
||||
DrawTeamMoneyBox(1);
|
||||
break;
|
||||
case 27:
|
||||
sub_801A8D0(TRUE);
|
||||
DrawTeamMoneyBox(1);
|
||||
break;
|
||||
case 28:
|
||||
sub_801A9E0();
|
||||
DrawTeamMoneyBox(1);
|
||||
sub_8019660();
|
||||
sub_8012D60(&sKecleonBrosWork1->menu, sKecleonBrosWork1->menuItems, 0, sKecleonBrosWork1->unk74, sKecleonBrosWork1->menuAction2, 2);
|
||||
break;
|
||||
case 30:
|
||||
sub_8019700();
|
||||
sub_8090E14(gUnknown_202DE58, &sKecleonBrosWork1->soldItem, NULL);
|
||||
gUnknown_202DE30 = sKecleonBrosWork1->itemSellPrice;
|
||||
sub_8019E04(FALSE);
|
||||
sub_8014248(gKecleonShopDialogue[sKecleonBrosWork1->mode][9], 0, 5, sKecleonBrosWork1->menuItems, NULL, 4, 0, sKecleonBrosWork1->unkE4, 12);
|
||||
break;
|
||||
case 21:
|
||||
case 29:
|
||||
sub_801B3C0(&sKecleonBrosWork1->soldItem);
|
||||
break;
|
||||
case 25:
|
||||
if (GetNumberOfFilledInventorySlots() == 0 || gTeamInventoryRef->teamMoney >= MAX_TEAM_MONEY) {
|
||||
sub_801A928();
|
||||
sKecleonBrosWork1->fallbackState = 1;
|
||||
}
|
||||
else
|
||||
sKecleonBrosWork1->fallbackState = 24;
|
||||
|
||||
sub_8019E04(FALSE);
|
||||
sub_80141B4(gKecleonShopDialogue[sKecleonBrosWork1->mode][11], 0, sKecleonBrosWork1->unkE4, 0x10D);
|
||||
break;
|
||||
case 31:
|
||||
sub_8019700();
|
||||
gUnknown_202DE30 = sKecleonBrosWork1->inventoryItemSellPrice;
|
||||
sub_8019E04(FALSE);
|
||||
sub_8014248(gKecleonShopDialogue[sKecleonBrosWork1->mode][10], 0, 5, sKecleonBrosWork1->menuItems, NULL, 4, 0, sKecleonBrosWork1->unkE4, 12);
|
||||
break;
|
||||
case 32:
|
||||
sKecleonBrosWork1->fallbackState = 1;
|
||||
sub_8019E04(FALSE);
|
||||
sub_80141B4(gKecleonShopDialogue[sKecleonBrosWork1->mode][11], 0, sKecleonBrosWork1->unkE4, 0x10D);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_80194F8(void)
|
||||
{
|
||||
s32 i;
|
||||
s32 loopMax;
|
||||
|
||||
MemoryFill16(sKecleonBrosWork1->unk74, 0, sizeof(sKecleonBrosWork1->unk74));
|
||||
|
||||
loopMax = 0;
|
||||
sKecleonBrosWork1->menuItems[loopMax].text = *gUnknown_80D4978;
|
||||
sKecleonBrosWork1->menuItems[loopMax].menuAction = 2;
|
||||
|
||||
loopMax += 1;
|
||||
sKecleonBrosWork1->menuItems[loopMax].text = *gUnknown_80D4984;
|
||||
sKecleonBrosWork1->menuItems[loopMax].menuAction = 3;
|
||||
|
||||
loopMax += 1;
|
||||
sKecleonBrosWork1->menuItems[loopMax].text = sSellAll;
|
||||
sKecleonBrosWork1->menuItems[loopMax].menuAction = 4;
|
||||
|
||||
loopMax += 1;
|
||||
sKecleonBrosWork1->menuItems[loopMax].text = *gUnknown_80D4970;
|
||||
sKecleonBrosWork1->menuItems[loopMax].menuAction = 7;
|
||||
|
||||
loopMax += 1;
|
||||
sKecleonBrosWork1->menuItems[loopMax].text = *gUnknown_80D4934;
|
||||
sKecleonBrosWork1->menuItems[loopMax].menuAction = 1;
|
||||
|
||||
loopMax += 1;
|
||||
sKecleonBrosWork1->menuItems[loopMax].text = NULL;
|
||||
sKecleonBrosWork1->menuItems[loopMax].menuAction = 1;
|
||||
|
||||
for (i = 0; i < loopMax; i++) {
|
||||
if (sKecleonBrosWork1->unk74[i] == 0) {
|
||||
if (sKecleonBrosWork1->menuItems[i].menuAction == sKecleonBrosWork1->menuAction1)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < loopMax; i++) {
|
||||
if (sKecleonBrosWork1->unk74[i] == 0) {
|
||||
sKecleonBrosWork1->menuAction1 = sKecleonBrosWork1->menuItems[i].menuAction;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_80195C0(void)
|
||||
{
|
||||
s32 i;
|
||||
s32 loopMax;
|
||||
|
||||
MemoryFill16(sKecleonBrosWork1->unk74, 0, sizeof(sKecleonBrosWork1->unk74));
|
||||
|
||||
loopMax = 0;
|
||||
sKecleonBrosWork1->menuItems[loopMax].text = *gUnknown_80D4978;
|
||||
sKecleonBrosWork1->menuItems[loopMax].menuAction = 2;
|
||||
|
||||
loopMax += 1;
|
||||
sKecleonBrosWork1->menuItems[loopMax].text = *gUnknown_80D4970;
|
||||
sKecleonBrosWork1->menuItems[loopMax].menuAction = 7;
|
||||
|
||||
loopMax += 1;
|
||||
sKecleonBrosWork1->menuItems[loopMax].text = NULL;
|
||||
sKecleonBrosWork1->menuItems[loopMax].menuAction = 1;
|
||||
|
||||
for (i = 0; i < loopMax; i++) {
|
||||
if (sKecleonBrosWork1->unk74[i] == 0) {
|
||||
if (sKecleonBrosWork1->menuItems[i].menuAction == sKecleonBrosWork1->menuAction3)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < loopMax; i++) {
|
||||
if (sKecleonBrosWork1->unk74[i] == 0) {
|
||||
sKecleonBrosWork1->menuAction3 = sKecleonBrosWork1->menuItems[i].menuAction;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8019660(void)
|
||||
{
|
||||
s32 i;
|
||||
s32 loopMax;
|
||||
|
||||
MemoryFill16(sKecleonBrosWork1->unk74, 0, sizeof(sKecleonBrosWork1->unk74));
|
||||
|
||||
loopMax = 0;
|
||||
sKecleonBrosWork1->menuItems[loopMax].text = *gUnknown_80D4984;
|
||||
sKecleonBrosWork1->menuItems[loopMax].menuAction = 3;
|
||||
|
||||
loopMax += 1;
|
||||
sKecleonBrosWork1->menuItems[loopMax].text = *gUnknown_80D4970;
|
||||
sKecleonBrosWork1->menuItems[loopMax].menuAction = 7;
|
||||
|
||||
loopMax += 1;
|
||||
sKecleonBrosWork1->menuItems[loopMax].text = NULL;
|
||||
sKecleonBrosWork1->menuItems[loopMax].menuAction = 1;
|
||||
|
||||
for (i = 0; i < loopMax; i++) {
|
||||
if (sKecleonBrosWork1->unk74[i] == 0) {
|
||||
if (sKecleonBrosWork1->menuItems[i].menuAction == sKecleonBrosWork1->menuAction2)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < loopMax; i++) {
|
||||
if (sKecleonBrosWork1->unk74[i] == 0) {
|
||||
sKecleonBrosWork1->menuAction2 = sKecleonBrosWork1->menuItems[i].menuAction;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8019700(void)
|
||||
{
|
||||
s32 loopMax = 0;
|
||||
sKecleonBrosWork1->menuItems[loopMax].text = *gUnknown_80D4920;
|
||||
sKecleonBrosWork1->menuItems[loopMax].menuAction = 5;
|
||||
|
||||
loopMax += 1;
|
||||
sKecleonBrosWork1->menuItems[loopMax].text = *gUnknown_80D4928;
|
||||
sKecleonBrosWork1->menuItems[loopMax].menuAction = 6;
|
||||
|
||||
loopMax += 1;
|
||||
sKecleonBrosWork1->menuItems[loopMax].text = NULL;
|
||||
sKecleonBrosWork1->menuItems[loopMax].menuAction = 1;
|
||||
}
|
||||
|
||||
static void sub_8019730(void)
|
||||
{
|
||||
s32 menuAction;
|
||||
|
||||
if (sub_80144A4(&menuAction) != 0)
|
||||
return;
|
||||
|
||||
if (menuAction != 1)
|
||||
sKecleonBrosWork1->menuAction1 = menuAction;
|
||||
|
||||
switch (menuAction) {
|
||||
case 2:
|
||||
if (CountKecleonItems() == 0)
|
||||
SetKecleonBrosState(KECLEON_STORE_NO_STORE_ITEMS);
|
||||
else if (GetNumberOfFilledInventorySlots() >= INVENTORY_SIZE)
|
||||
SetKecleonBrosState(KECLEON_STORE_TOO_MANY_ITEMS);
|
||||
else
|
||||
SetKecleonBrosState(15);
|
||||
break;
|
||||
case 3:
|
||||
if (GetNumberOfFilledInventorySlots() == 0)
|
||||
SetKecleonBrosState(KECLEON_STORE_NO_ITEMS_TO_SELL);
|
||||
else if (sKecleonBrosWork1->numInventoryItemToSell == 0)
|
||||
SetKecleonBrosState(8);
|
||||
else if (gTeamInventoryRef->teamMoney < MAX_TEAM_MONEY)
|
||||
SetKecleonBrosState(23);
|
||||
else
|
||||
SetKecleonBrosState(7);
|
||||
break;
|
||||
case 4:
|
||||
if (GetNumberOfFilledInventorySlots() == 0)
|
||||
SetKecleonBrosState(KECLEON_STORE_NO_ITEMS_TO_SELL);
|
||||
else if (sKecleonBrosWork1->numInventoryItemToSell == 0)
|
||||
SetKecleonBrosState(8);
|
||||
else if (sKecleonBrosWork1->inventoryItemSellPrice + gTeamInventoryRef->teamMoney > MAX_TEAM_MONEY)
|
||||
SetKecleonBrosState(7);
|
||||
else
|
||||
SetKecleonBrosState(31);
|
||||
break;
|
||||
case 7:
|
||||
SetKecleonBrosState(2);
|
||||
break;
|
||||
case 1:
|
||||
SetKecleonBrosState(3);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8019850(void)
|
||||
{
|
||||
s32 menuAction;
|
||||
|
||||
if (sub_80144A4(&menuAction) == 0) {
|
||||
switch (menuAction) {
|
||||
case 5:
|
||||
AddToTeamMoney(-sKecleonBrosWork1->itemSellPrice);
|
||||
|
||||
if (sKecleonBrosWork1->isKecleonItemShop) {
|
||||
AddHeldItemToInventory(GetKecleonShopItem(sKecleonBrosWork1->itemShopItemIndex));
|
||||
InitKecleonShopItem(sKecleonBrosWork1->itemShopItemIndex);
|
||||
FillKecleonShopGaps();
|
||||
}
|
||||
else {
|
||||
AddHeldItemToInventory(GetKecleonWareItem(sKecleonBrosWork1->wareShopItemIndex));
|
||||
InitKecleonWareItem(sKecleonBrosWork1->wareShopItemIndex);
|
||||
FillKecleonWareGaps();
|
||||
}
|
||||
|
||||
PlaySound(332);
|
||||
SetKecleonBrosState(17);
|
||||
break;
|
||||
case 6:
|
||||
case 1:
|
||||
SetKecleonBrosState(16);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_80198E8(void)
|
||||
{
|
||||
s32 menuAction;
|
||||
|
||||
if (sub_80144A4(&menuAction) == 0) {
|
||||
switch (menuAction) {
|
||||
case 5:
|
||||
AddToTeamMoney(sKecleonBrosWork1->itemSellPrice);
|
||||
ShiftItemsDownFrom(sKecleonBrosWork1->soldItemInventoryIndex);
|
||||
PlaySound(332);
|
||||
SetKecleonBrosState(25);
|
||||
break;
|
||||
case 6:
|
||||
case 1:
|
||||
SetKecleonBrosState(24);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8019944(void)
|
||||
{
|
||||
s32 slotIndex;
|
||||
s32 menuAction;
|
||||
Item *item;
|
||||
|
||||
if (sub_80144A4(&menuAction) == 0) {
|
||||
switch (menuAction) {
|
||||
case 5:
|
||||
for (slotIndex = 0; slotIndex < INVENTORY_SIZE; slotIndex++) {
|
||||
item = &gTeamInventoryRef->teamItems[slotIndex];
|
||||
|
||||
if ((item->flags & ITEM_FLAG_EXISTS) && CanSellItem(item->id))
|
||||
ClearItemSlotAt(slotIndex);
|
||||
}
|
||||
|
||||
FillInventoryGaps();
|
||||
AddToTeamMoney(sKecleonBrosWork1->inventoryItemSellPrice);
|
||||
PlaySound(0x14c);
|
||||
SetKecleonBrosState(32);
|
||||
break;
|
||||
case 1:
|
||||
case 6:
|
||||
SetKecleonBrosState(KECLEON_STORE_MAIN_MENU);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_80199CC(void)
|
||||
{
|
||||
u32 menuAction;
|
||||
BulkItem *item;
|
||||
|
||||
if (sKecleonBrosWork1->isKecleonItemShop)
|
||||
menuAction = sub_8019EDC(1);
|
||||
else
|
||||
menuAction = sub_801A2A8(1);
|
||||
|
||||
switch (menuAction) {
|
||||
case 3:
|
||||
if (sKecleonBrosWork1->isKecleonItemShop) {
|
||||
sKecleonBrosWork1->itemShopItemIndex = sub_8019FB0();
|
||||
item = GetKecleonShopItem(sKecleonBrosWork1->itemShopItemIndex);
|
||||
}
|
||||
else {
|
||||
sKecleonBrosWork1->wareShopItemIndex = sub_801A37C();
|
||||
item = GetKecleonWareItem(sKecleonBrosWork1->wareShopItemIndex);
|
||||
}
|
||||
|
||||
xxx_init_itemslot_8090A8C(&sKecleonBrosWork1->soldItem, item->id, 0);
|
||||
sKecleonBrosWork1->soldItem.quantity = item->quantity;
|
||||
sKecleonBrosWork1->itemSellPrice = GetStackBuyPrice(&sKecleonBrosWork1->soldItem);
|
||||
SetKecleonBrosState(20);
|
||||
break;
|
||||
case 4:
|
||||
if (sKecleonBrosWork1->isKecleonItemShop) {
|
||||
sKecleonBrosWork1->itemShopItemIndex = sub_8019FB0();
|
||||
item = GetKecleonShopItem(sKecleonBrosWork1->itemShopItemIndex);
|
||||
}
|
||||
else {
|
||||
sKecleonBrosWork1->wareShopItemIndex = sub_801A37C();
|
||||
item = GetKecleonWareItem(sKecleonBrosWork1->wareShopItemIndex);
|
||||
}
|
||||
|
||||
xxx_init_itemslot_8090A8C(&sKecleonBrosWork1->soldItem, item->id, 0);
|
||||
sKecleonBrosWork1->soldItem.quantity = item->quantity;
|
||||
sKecleonBrosWork1->itemSellPrice = GetStackBuyPrice(&sKecleonBrosWork1->soldItem);
|
||||
SetKecleonBrosState(21);
|
||||
break;
|
||||
case 2:
|
||||
if (sKecleonBrosWork1->isKecleonItemShop)
|
||||
sub_801A010();
|
||||
else
|
||||
sub_801A3DC();
|
||||
|
||||
SetKecleonBrosState(KECLEON_STORE_MAIN_MENU);
|
||||
break;
|
||||
case 1:
|
||||
sub_801AD34(0);
|
||||
DrawTeamMoneyBox(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8019B08(void)
|
||||
{
|
||||
switch (sub_801A6E8(TRUE)) {
|
||||
case 0:
|
||||
break;
|
||||
case 3:
|
||||
sKecleonBrosWork1->soldItemInventoryIndex = sub_801A8AC();
|
||||
sKecleonBrosWork1->soldItem = gTeamInventoryRef->teamItems[sKecleonBrosWork1->soldItemInventoryIndex];
|
||||
sKecleonBrosWork1->itemSellPrice = GetStackSellPrice(&sKecleonBrosWork1->soldItem);
|
||||
SetKecleonBrosState(28);
|
||||
break;
|
||||
case 4:
|
||||
sKecleonBrosWork1->soldItemInventoryIndex = sub_801A8AC();
|
||||
sKecleonBrosWork1->soldItem = gTeamInventoryRef->teamItems[sKecleonBrosWork1->soldItemInventoryIndex];
|
||||
sKecleonBrosWork1->itemSellPrice = GetStackSellPrice(&sKecleonBrosWork1->soldItem);
|
||||
sub_8099690(0);
|
||||
SetKecleonBrosState(29);
|
||||
break;
|
||||
case 2:
|
||||
sub_801A928();
|
||||
SetKecleonBrosState(KECLEON_STORE_MAIN_MENU);
|
||||
break;
|
||||
case 1:
|
||||
default:
|
||||
DrawTeamMoneyBox(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8019BBC(void)
|
||||
{
|
||||
s32 menuAction;
|
||||
|
||||
menuAction = 0;
|
||||
|
||||
if (sKecleonBrosWork1->isKecleonItemShop)
|
||||
sub_8019EDC(0);
|
||||
else
|
||||
sub_801A2A8(0);
|
||||
|
||||
if (sub_8012FD8(&sKecleonBrosWork1->menu) == 0 && (sub_8013114(&sKecleonBrosWork1->menu, &menuAction), menuAction != 1))
|
||||
sKecleonBrosWork1->menuAction3 = menuAction;
|
||||
|
||||
switch (menuAction) {
|
||||
case 2:
|
||||
if (gTeamInventoryRef->teamMoney == 0)
|
||||
SetKecleonBrosState(KECLEON_STORE_NO_MONEY);
|
||||
else if (sKecleonBrosWork1->itemSellPrice > gTeamInventoryRef->teamMoney)
|
||||
SetKecleonBrosState(KECLEON_STORE_NOT_ENOUGH_MONEY);
|
||||
else
|
||||
SetKecleonBrosState(22);
|
||||
break;
|
||||
case 7:
|
||||
SetKecleonBrosState(21);
|
||||
break;
|
||||
case 1:
|
||||
SetKecleonBrosState(19);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8019C78(void)
|
||||
{
|
||||
s32 menuAction;
|
||||
|
||||
menuAction = 0;
|
||||
sub_801A6E8(FALSE);
|
||||
|
||||
if (sub_8012FD8(&sKecleonBrosWork1->menu) == FALSE && (sub_8013114(&sKecleonBrosWork1->menu, &menuAction), menuAction != 1))
|
||||
sKecleonBrosWork1->menuAction2 = menuAction;
|
||||
|
||||
switch (menuAction) {
|
||||
case 3:
|
||||
sub_8099690(0);
|
||||
|
||||
if (!CanSellItem(sKecleonBrosWork1->soldItem.id))
|
||||
SetKecleonBrosState(KECLEON_STORE_CANT_SELL_ITEM);
|
||||
else if (sKecleonBrosWork1->itemSellPrice + gTeamInventoryRef->teamMoney > MAX_TEAM_MONEY)
|
||||
SetKecleonBrosState(14);
|
||||
else
|
||||
SetKecleonBrosState(30);
|
||||
break;
|
||||
case 7:
|
||||
sub_8099690(0);
|
||||
SetKecleonBrosState(29);
|
||||
break;
|
||||
case 1:
|
||||
SetKecleonBrosState(27);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8019D30(void)
|
||||
{
|
||||
switch (sub_801B410()) {
|
||||
case 2:
|
||||
case 3:
|
||||
sub_801B450();
|
||||
SetKecleonBrosState(19);
|
||||
break;
|
||||
case 0:
|
||||
case 1:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8019D4C(void)
|
||||
{
|
||||
switch (sub_801B410()) {
|
||||
case 2:
|
||||
case 3:
|
||||
sub_801B450();
|
||||
SetKecleonBrosState(27);
|
||||
break;
|
||||
case 0:
|
||||
case 1:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8019D68(void)
|
||||
{
|
||||
s32 temp;
|
||||
|
||||
if (sub_80144A4(&temp) == 0)
|
||||
SetKecleonBrosState(sKecleonBrosWork1->fallbackState);
|
||||
}
|
||||
|
||||
static u32 CountKecleonItems(void)
|
||||
{
|
||||
if (sKecleonBrosWork1->isKecleonItemShop)
|
||||
return CountKecleonShopItems();
|
||||
else
|
||||
return CountKecleonWareItems();
|
||||
}
|
||||
|
||||
static void sub_8019DAC(void)
|
||||
{
|
||||
s32 sellPrice;
|
||||
Item *item;
|
||||
s32 index;
|
||||
|
||||
sKecleonBrosWork1->numInventoryItemToSell = 0;
|
||||
sKecleonBrosWork1->inventoryItemSellPrice = 0;
|
||||
for (index = 0; index < INVENTORY_SIZE; index++) {
|
||||
item = &gTeamInventoryRef->teamItems[index];
|
||||
|
||||
if ((item->flags & ITEM_FLAG_EXISTS) != 0 && CanSellItem(item->id)) {
|
||||
sellPrice = GetStackSellPrice(item);
|
||||
sKecleonBrosWork1->inventoryItemSellPrice += sellPrice;
|
||||
sKecleonBrosWork1->numInventoryItemToSell++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8019E04(bool32 a0)
|
||||
{
|
||||
if (sKecleonBrosWork1->isKecleonItemShop) {
|
||||
if (a0 == TRUE)
|
||||
sKecleonBrosWork1->unkE0 = 1;
|
||||
else
|
||||
sKecleonBrosWork1->unkE0 = 0;
|
||||
}
|
||||
else {
|
||||
if (a0 == TRUE)
|
||||
sKecleonBrosWork1->unkE0 = 7;
|
||||
else
|
||||
sKecleonBrosWork1->unkE0 = 6;
|
||||
}
|
||||
}
|
||||
225
src/kecleon_bros2.c
Normal file
225
src/kecleon_bros2.c
Normal file
@@ -0,0 +1,225 @@
|
||||
#include "global.h"
|
||||
#include "code_800D090.h"
|
||||
#include "code_80118A4.h"
|
||||
#include "constants/input.h"
|
||||
#include "items.h"
|
||||
#include "kecleon_bros2.h"
|
||||
#include "memory.h"
|
||||
#include "menu_input.h"
|
||||
#include "text1.h"
|
||||
#include "text2.h"
|
||||
|
||||
static EWRAM_DATA_2 struct unkStruct_203B214 *gUnknown_203B214 = {0};
|
||||
static EWRAM_DATA_2 u16 gUnknown_203B218;
|
||||
|
||||
#include "data/kecleon_bros2.h"
|
||||
|
||||
static void sub_801A064(void);
|
||||
|
||||
bool8 sub_8019E40(u32 r0)
|
||||
{
|
||||
if (CountKecleonShopItems() == 0)
|
||||
return FALSE;
|
||||
|
||||
gUnknown_203B214 = MemoryAlloc(sizeof(struct unkStruct_203B214), 8);
|
||||
gUnknown_203B214->unk34 = r0;
|
||||
gUnknown_203B214->unk38 = &gUnknown_203B214->unk3C[gUnknown_203B214->unk34];
|
||||
sub_8006518(gUnknown_203B214->unk3C);
|
||||
gUnknown_203B214->unk3C[gUnknown_203B214->unk34] = sUnknown_80DB8CC;
|
||||
gUnknown_203B214->unk38->unk14 = gUnknown_203B214->unk9C;
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(gUnknown_203B214->unk3C, TRUE, TRUE);
|
||||
sub_8013818(&gUnknown_203B214->input, CountKecleonShopItems(), 10, r0);
|
||||
gUnknown_203B214->input.menuIndex = gUnknown_203B218;
|
||||
sub_8013984(&gUnknown_203B214->input);
|
||||
sub_801A064();
|
||||
sub_801A0D8();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u32 sub_8019EDC(u8 r0)
|
||||
{
|
||||
Item slot;
|
||||
BulkItem *item;
|
||||
|
||||
if (r0 == 0) {
|
||||
sub_8013660(&gUnknown_203B214->input);
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (GetKeyPress(&gUnknown_203B214->input)) {
|
||||
case INPUT_B_BUTTON:
|
||||
PlayMenuSoundEffect(1);
|
||||
return 2;
|
||||
case INPUT_A_BUTTON:
|
||||
item = GetKecleonShopItem(sub_8019FB0());
|
||||
slot.id = item->id;
|
||||
slot.quantity = item->quantity;
|
||||
|
||||
if (GetStackBuyPrice(&slot) > gTeamInventoryRef->teamMoney)
|
||||
PlayMenuSoundEffect(2);
|
||||
else
|
||||
PlayMenuSoundEffect(0);
|
||||
return 3;
|
||||
case INPUT_START_BUTTON:
|
||||
PlayMenuSoundEffect(4);
|
||||
return 4;
|
||||
default:
|
||||
if (sub_80138B8(&gUnknown_203B214->input, 1) != FALSE) {
|
||||
sub_801A064();
|
||||
sub_801A0D8();
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
u8 sub_8019FB0(void)
|
||||
{
|
||||
return (gUnknown_203B214->input.unk1E * gUnknown_203B214->input.unk1C) + (u8)gUnknown_203B214->input.menuIndex;
|
||||
}
|
||||
|
||||
void sub_8019FCC(bool8 r0)
|
||||
{
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(gUnknown_203B214->unk3C, FALSE, FALSE);
|
||||
gUnknown_203B214->input.unk22 = CountKecleonShopItems();
|
||||
sub_8013984(&gUnknown_203B214->input);
|
||||
sub_801A064();
|
||||
sub_801A0D8();
|
||||
if (r0)
|
||||
AddMenuCursorSprite(&gUnknown_203B214->input);
|
||||
}
|
||||
|
||||
void sub_801A010(void)
|
||||
{
|
||||
if (gUnknown_203B214 != NULL) {
|
||||
gUnknown_203B218 = gUnknown_203B214->input.menuIndex;
|
||||
gUnknown_203B214->unk3C[gUnknown_203B214->unk34] = sUnknown_80DB8B4;
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(gUnknown_203B214->unk3C, TRUE, TRUE);
|
||||
MemoryFree(gUnknown_203B214);
|
||||
gUnknown_203B214 = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#if NONMATCHING // sub_80095E4 memes https://decomp.me/scratch/VjeuO
|
||||
static void sub_801A064(void)
|
||||
{
|
||||
s16 val;
|
||||
|
||||
gUnknown_203B214->unk9C[0] = gUnknown_203B214->input.unk20;
|
||||
gUnknown_203B214->unk9C[1] = gUnknown_203B214->input.unk1E;
|
||||
gUnknown_203B214->unk9C[2] = 10;
|
||||
gUnknown_203B214->unk9C[3] = 0;
|
||||
|
||||
val = sub_80095E4(gUnknown_203B214->input.unk1A, 12) + 2;
|
||||
gUnknown_203B214->unk3C[gUnknown_203B214->unk34].unkE = val;
|
||||
gUnknown_203B214->unk3C[gUnknown_203B214->unk34].unk10 = val + 2;
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(gUnknown_203B214->unk3C, TRUE, TRUE);
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
static void sub_801A064(void)
|
||||
{
|
||||
asm_unified(
|
||||
"\tpush {r4,lr}\n"
|
||||
"\tldr r4, _0801A0D4\n"
|
||||
"\tldr r0, [r4]\n"
|
||||
"\tldrh r1, [r0, 0x20]\n"
|
||||
"\tadds r0, 0x9C\n"
|
||||
"\tmovs r2, 0\n"
|
||||
"\tstrb r1, [r0]\n"
|
||||
"\tldr r0, [r4]\n"
|
||||
"\tldrh r1, [r0, 0x1E]\n"
|
||||
"\tadds r0, 0x9D\n"
|
||||
"\tstrb r1, [r0]\n"
|
||||
"\tldr r0, [r4]\n"
|
||||
"\tadds r0, 0x9E\n"
|
||||
"\tmovs r1, 0xA\n"
|
||||
"\tstrb r1, [r0]\n"
|
||||
"\tldr r0, [r4]\n"
|
||||
"\tadds r0, 0x9F\n"
|
||||
"\tstrb r2, [r0]\n"
|
||||
"\tldr r0, [r4]\n"
|
||||
"\tmovs r1, 0x1A\n"
|
||||
"\tldrsh r0, [r0, r1]\n"
|
||||
"\tmovs r1, 0xC\n"
|
||||
"\tbl sub_80095E4\n"
|
||||
"\tadds r0, 0x2\n"
|
||||
"\tlsls r0, 16\n"
|
||||
"\tldr r2, [r4]\n"
|
||||
"\tldr r3, [r2, 0x34]\n"
|
||||
"\tlsls r1, r3, 1\n"
|
||||
"\tadds r1, r3\n"
|
||||
"\tlsls r1, 3\n"
|
||||
"\tadds r1, r2, r1\n"
|
||||
"\tadds r1, 0x4A\n"
|
||||
"\tasrs r3, r0, 16\n"
|
||||
"\tlsrs r0, 16\n"
|
||||
"\tstrh r0, [r1]\n"
|
||||
"\tldr r1, [r2, 0x34]\n"
|
||||
"\tlsls r0, r1, 1\n"
|
||||
"\tadds r0, r1\n"
|
||||
"\tlsls r0, 3\n"
|
||||
"\tadds r2, r0\n"
|
||||
"\tadds r3, 0x2\n"
|
||||
"\tadds r2, 0x4C\n"
|
||||
"\tstrh r3, [r2]\n"
|
||||
"\tbl ResetUnusedInputStruct\n"
|
||||
"\tldr r0, [r4]\n"
|
||||
"\tadds r0, 0x3C\n"
|
||||
"\tmovs r1, 0x1\n"
|
||||
"\tmovs r2, 0x1\n"
|
||||
"\tbl sub_800641C\n"
|
||||
"\tpop {r4}\n"
|
||||
"\tpop {r0}\n"
|
||||
"\tbx r0\n"
|
||||
"\t.align 2, 0\n"
|
||||
"_0801A0D4: .4byte gUnknown_203B214");
|
||||
}
|
||||
#endif // NONMATCHING
|
||||
|
||||
void sub_801A0D8(void)
|
||||
{
|
||||
BulkItem *heldItem;
|
||||
s32 buyPrice;
|
||||
s32 y;
|
||||
s32 index;
|
||||
u8 auStack204[80];
|
||||
struct unkStruct_8090F58 local_7c;
|
||||
u8 auStack112[80];
|
||||
Item item;
|
||||
u8 temp_calc;
|
||||
|
||||
sub_8008C54(gUnknown_203B214->unk34);
|
||||
sub_80073B8(gUnknown_203B214->unk34);
|
||||
xxx_call_draw_string((gUnknown_203B214->input.unk1E * 8) + 10, 0, sGoods, gUnknown_203B214->unk34, 0);
|
||||
|
||||
for (index = 0; index < gUnknown_203B214->input.unk1A; index++) {
|
||||
temp_calc = (gUnknown_203B214->input.unk1E * gUnknown_203B214->input.unk1C) + index;
|
||||
heldItem = GetKecleonShopItem(temp_calc);
|
||||
item.id = heldItem->id;
|
||||
item.quantity = heldItem->quantity;
|
||||
item.flags = (ITEM_FLAG_EXISTS | ITEM_FLAG_IN_SHOP);
|
||||
local_7c.unk0 = 1;
|
||||
local_7c.unk4 = 0;
|
||||
local_7c.unk6 = 88;
|
||||
local_7c.unk8 = 1;
|
||||
sub_8090E14(auStack204, &item, &local_7c);
|
||||
buyPrice = GetStackBuyPrice(&item);
|
||||
|
||||
if (buyPrice <= gTeamInventoryRef->teamMoney) {
|
||||
y = sub_8013800(&gUnknown_203B214->input, index);
|
||||
xxx_call_draw_string(8, y, auStack204, gUnknown_203B214->unk34, 0);
|
||||
}
|
||||
else {
|
||||
sprintfStatic(auStack112, sFmtRed, auStack204);
|
||||
y = sub_8013800(&gUnknown_203B214->input, index);
|
||||
xxx_call_draw_string(8, y, auStack112, gUnknown_203B214->unk34, 0);
|
||||
}
|
||||
}
|
||||
|
||||
sub_80073E0(gUnknown_203B214->unk34);
|
||||
}
|
||||
225
src/kecleon_bros3.c
Normal file
225
src/kecleon_bros3.c
Normal file
@@ -0,0 +1,225 @@
|
||||
#include "global.h"
|
||||
#include "code_800D090.h"
|
||||
#include "code_80118A4.h"
|
||||
#include "constants/input.h"
|
||||
#include "items.h"
|
||||
#include "kecleon_bros3.h"
|
||||
#include "memory.h"
|
||||
#include "menu_input.h"
|
||||
#include "text1.h"
|
||||
#include "text2.h"
|
||||
|
||||
static EWRAM_DATA_2 struct unkStruct_203B21C *gUnknown_203B21C = {0};
|
||||
static EWRAM_DATA_2 u16 gUnknown_203B220;
|
||||
|
||||
#include "data/kecleon_bros3.h"
|
||||
|
||||
static void sub_801A430(void);
|
||||
|
||||
u8 sub_801A20C(u32 r0)
|
||||
{
|
||||
if (CountKecleonWareItems() == 0)
|
||||
return 0;
|
||||
|
||||
gUnknown_203B21C = MemoryAlloc(sizeof(struct unkStruct_203B21C), 8);
|
||||
gUnknown_203B21C->unk34 = r0;
|
||||
gUnknown_203B21C->unk38 = &gUnknown_203B21C->unk3C[gUnknown_203B21C->unk34];
|
||||
sub_8006518(gUnknown_203B21C->unk3C);
|
||||
gUnknown_203B21C->unk3C[gUnknown_203B21C->unk34] = sUnknown_80DB914;
|
||||
gUnknown_203B21C->unk38->unk14 = gUnknown_203B21C->unk9C;
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(gUnknown_203B21C->unk3C, TRUE, TRUE);
|
||||
sub_8013818(&gUnknown_203B21C->input, CountKecleonWareItems(), 10, r0);
|
||||
gUnknown_203B21C->input.menuIndex = gUnknown_203B220;
|
||||
sub_8013984(&gUnknown_203B21C->input);
|
||||
sub_801A430();
|
||||
sub_801A4A4();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u32 sub_801A2A8(u8 r0)
|
||||
{
|
||||
Item slot;
|
||||
BulkItem *item;
|
||||
|
||||
if (r0 == 0) {
|
||||
sub_8013660(&gUnknown_203B21C->input);
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (GetKeyPress(&gUnknown_203B21C->input)) {
|
||||
case INPUT_B_BUTTON:
|
||||
PlayMenuSoundEffect(1);
|
||||
return 2;
|
||||
case INPUT_A_BUTTON:
|
||||
item = GetKecleonWareItem(sub_801A37C());
|
||||
|
||||
slot.id = item->id;
|
||||
slot.quantity = item->quantity;
|
||||
|
||||
if (GetStackBuyPrice(&slot) > gTeamInventoryRef->teamMoney)
|
||||
PlayMenuSoundEffect(2);
|
||||
else
|
||||
PlayMenuSoundEffect(0);
|
||||
return 3;
|
||||
case INPUT_START_BUTTON:
|
||||
PlayMenuSoundEffect(4);
|
||||
return 4;
|
||||
default:
|
||||
if (sub_80138B8(&gUnknown_203B21C->input, 1) != 0) {
|
||||
sub_801A430();
|
||||
sub_801A4A4();
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
u8 sub_801A37C(void)
|
||||
{
|
||||
return (gUnknown_203B21C->input.unk1E * gUnknown_203B21C->input.unk1C) + gUnknown_203B21C->input.menuIndex;
|
||||
}
|
||||
|
||||
void sub_801A398(u8 r0)
|
||||
{
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(gUnknown_203B21C->unk3C, FALSE, FALSE);
|
||||
gUnknown_203B21C->input.unk22 = CountKecleonWareItems();
|
||||
sub_8013984(&gUnknown_203B21C->input);
|
||||
sub_801A430();
|
||||
sub_801A4A4();
|
||||
if (r0)
|
||||
AddMenuCursorSprite(&gUnknown_203B21C->input);
|
||||
}
|
||||
|
||||
void sub_801A3DC(void)
|
||||
{
|
||||
if (gUnknown_203B21C != NULL) {
|
||||
gUnknown_203B220 = gUnknown_203B21C->input.menuIndex;
|
||||
gUnknown_203B21C->unk3C[gUnknown_203B21C->unk34] = sUnknown_80DB8FC;
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(gUnknown_203B21C->unk3C, TRUE, TRUE);
|
||||
MemoryFree(gUnknown_203B21C);
|
||||
gUnknown_203B21C = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#if NONMATCHING // sub_80095E4 memes https://decomp.me/scratch/L78xC
|
||||
static void sub_801A430(void)
|
||||
{
|
||||
s16 val;
|
||||
|
||||
gUnknown_203B21C->unk9C[0] = gUnknown_203B21C->input.unk20;
|
||||
gUnknown_203B21C->unk9C[1] = gUnknown_203B21C->input.unk1E;
|
||||
gUnknown_203B21C->unk9C[2] = 10;
|
||||
gUnknown_203B21C->unk9C[3] = 0;
|
||||
|
||||
val = sub_80095E4(gUnknown_203B21C->input.unk1A, 12) + 2;
|
||||
gUnknown_203B21C->unk3C[gUnknown_203B21C->unk34].unkE = val;
|
||||
gUnknown_203B21C->unk3C[gUnknown_203B21C->unk34].unk10 = val + 2;
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(gUnknown_203B21C->unk3C, TRUE, TRUE);
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
static void sub_801A430(void)
|
||||
{
|
||||
asm_unified("\tpush {r4,lr}\n"
|
||||
"\tldr r4, _0801A4A0\n"
|
||||
"\tldr r0, [r4]\n"
|
||||
"\tldrh r1, [r0, 0x20]\n"
|
||||
"\tadds r0, 0x9C\n"
|
||||
"\tmovs r2, 0\n"
|
||||
"\tstrb r1, [r0]\n"
|
||||
"\tldr r0, [r4]\n"
|
||||
"\tldrh r1, [r0, 0x1E]\n"
|
||||
"\tadds r0, 0x9D\n"
|
||||
"\tstrb r1, [r0]\n"
|
||||
"\tldr r0, [r4]\n"
|
||||
"\tadds r0, 0x9E\n"
|
||||
"\tmovs r1, 0xA\n"
|
||||
"\tstrb r1, [r0]\n"
|
||||
"\tldr r0, [r4]\n"
|
||||
"\tadds r0, 0x9F\n"
|
||||
"\tstrb r2, [r0]\n"
|
||||
"\tldr r0, [r4]\n"
|
||||
"\tmovs r1, 0x1A\n"
|
||||
"\tldrsh r0, [r0, r1]\n"
|
||||
"\tmovs r1, 0xC\n"
|
||||
"\tbl sub_80095E4\n"
|
||||
"\tadds r0, 0x2\n"
|
||||
"\tlsls r0, 16\n"
|
||||
"\tldr r2, [r4]\n"
|
||||
"\tldr r3, [r2, 0x34]\n"
|
||||
"\tlsls r1, r3, 1\n"
|
||||
"\tadds r1, r3\n"
|
||||
"\tlsls r1, 3\n"
|
||||
"\tadds r1, r2, r1\n"
|
||||
"\tadds r1, 0x4A\n"
|
||||
"\tasrs r3, r0, 16\n"
|
||||
"\tlsrs r0, 16\n"
|
||||
"\tstrh r0, [r1]\n"
|
||||
"\tldr r1, [r2, 0x34]\n"
|
||||
"\tlsls r0, r1, 1\n"
|
||||
"\tadds r0, r1\n"
|
||||
"\tlsls r0, 3\n"
|
||||
"\tadds r2, r0\n"
|
||||
"\tadds r3, 0x2\n"
|
||||
"\tadds r2, 0x4C\n"
|
||||
"\tstrh r3, [r2]\n"
|
||||
"\tbl ResetUnusedInputStruct\n"
|
||||
"\tldr r0, [r4]\n"
|
||||
"\tadds r0, 0x3C\n"
|
||||
"\tmovs r1, 0x1\n"
|
||||
"\tmovs r2, 0x1\n"
|
||||
"\tbl sub_800641C\n"
|
||||
"\tpop {r4}\n"
|
||||
"\tpop {r0}\n"
|
||||
"\tbx r0\n"
|
||||
"\t.align 2, 0\n"
|
||||
"_0801A4A0: .4byte gUnknown_203B21C");
|
||||
}
|
||||
#endif // NONMATCHING
|
||||
|
||||
void sub_801A4A4(void)
|
||||
{
|
||||
BulkItem *heldItem;
|
||||
s32 buyPrice;
|
||||
s32 y;
|
||||
s32 index;
|
||||
u8 buffer1[80];
|
||||
struct unkStruct_8090F58 local_7c;
|
||||
u8 buffer2[80];
|
||||
Item item;
|
||||
u8 temp_calc;
|
||||
|
||||
sub_8008C54(gUnknown_203B21C->unk34);
|
||||
sub_80073B8(gUnknown_203B21C->unk34);
|
||||
xxx_call_draw_string(gUnknown_203B21C->input.unk1E * 8 + 10, 0, sGoods, gUnknown_203B21C->unk34, 0);
|
||||
|
||||
for (index = 0; index < gUnknown_203B21C->input.unk1A; index++) {
|
||||
temp_calc = (gUnknown_203B21C->input.unk1E * gUnknown_203B21C->input.unk1C) + index;
|
||||
heldItem = GetKecleonWareItem(temp_calc);
|
||||
item.id = heldItem->id;
|
||||
item.quantity = heldItem->quantity;
|
||||
item.flags = (ITEM_FLAG_EXISTS | ITEM_FLAG_IN_SHOP);
|
||||
local_7c.unk0 = 1;
|
||||
local_7c.unk4 = 0;
|
||||
local_7c.unk6 = 88;
|
||||
local_7c.unk8 = 1;
|
||||
sub_8090E14(buffer1, &item, &local_7c);
|
||||
buyPrice = GetStackBuyPrice(&item);
|
||||
|
||||
if (buyPrice <= gTeamInventoryRef->teamMoney) {
|
||||
y = sub_8013800(&gUnknown_203B21C->input, index);
|
||||
xxx_call_draw_string(8, y, buffer1, gUnknown_203B21C->unk34, 0);
|
||||
}
|
||||
else {
|
||||
sprintfStatic(buffer2, sFmtRed, buffer1);
|
||||
y = sub_8013800(&gUnknown_203B21C->input, index);
|
||||
xxx_call_draw_string(8, y, buffer2, gUnknown_203B21C->unk34, 0);
|
||||
}
|
||||
}
|
||||
|
||||
sub_80073E0(gUnknown_203B21C->unk34);
|
||||
}
|
||||
431
src/kecleon_bros4.c
Normal file
431
src/kecleon_bros4.c
Normal file
@@ -0,0 +1,431 @@
|
||||
#include "global.h"
|
||||
#include "code_800D090.h"
|
||||
#include "code_80118A4.h"
|
||||
#include "code_80130A8.h"
|
||||
#include "code_8098DBC.h"
|
||||
#include "constants/input.h"
|
||||
#include "items.h"
|
||||
#include "kecleon_bros4.h"
|
||||
#include "memory.h"
|
||||
#include "menu_input.h"
|
||||
#include "text1.h"
|
||||
#include "text2.h"
|
||||
|
||||
extern u8 gUnknown_202DE58[];
|
||||
|
||||
static EWRAM_DATA_2 struct unkStruct_203B224 *gUnknown_203B224 = {0};
|
||||
static EWRAM_DATA_2 u16 gUnknown_203B228;
|
||||
static EWRAM_DATA_2 u16 gUnknown_203B22A;
|
||||
|
||||
#include "data/kecleon_bros4.h"
|
||||
|
||||
static void SortInventoryItems(void);
|
||||
|
||||
static void sub_801A998(void);
|
||||
static s32 sub_801AE24(u32);
|
||||
|
||||
bool8 sub_801A5D8(u32 param_1, s32 param_2, UnkTextStruct2_sub *param_3, u32 param_4)
|
||||
{
|
||||
if (GetNumberOfFilledInventorySlots() == 0)
|
||||
return FALSE;
|
||||
|
||||
if (gUnknown_203B224 == NULL)
|
||||
gUnknown_203B224 = MemoryAlloc(sizeof(struct unkStruct_203B224), 8);
|
||||
|
||||
gUnknown_203B224->unk0 = param_1;
|
||||
FillInventoryGaps();
|
||||
sub_801AE84();
|
||||
gUnknown_203B224->unk88 = param_2;
|
||||
gUnknown_203B224->unk8C = &gUnknown_203B224->unk90[param_2];
|
||||
sub_8006518(gUnknown_203B224->unk90);
|
||||
gUnknown_203B224->unk90[gUnknown_203B224->unk88] = sUnknown_80DB95C;
|
||||
gUnknown_203B224->unk8C->unk14 = gUnknown_203B224->unkF0;
|
||||
|
||||
if (param_3 != NULL)
|
||||
gUnknown_203B224->unk90[gUnknown_203B224->unk88].unk8 = *param_3;
|
||||
|
||||
sub_8012D08(gUnknown_203B224->unk8C, param_4);
|
||||
sub_8099690(1);
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(gUnknown_203B224->unk90, TRUE, TRUE);
|
||||
sub_8013818(&gUnknown_203B224->input, GetNumberOfFilledInventorySlots(), param_4, param_2);
|
||||
gUnknown_203B224->input.menuIndex = gUnknown_203B228;
|
||||
gUnknown_203B224->input.unk1E = gUnknown_203B22A;
|
||||
sub_8013984(&gUnknown_203B224->input);
|
||||
sub_801A998();
|
||||
sub_801A9E0();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u32 sub_801A6E8(bool8 param_1)
|
||||
{
|
||||
s32 index;
|
||||
Item item;
|
||||
|
||||
if (param_1 == FALSE) {
|
||||
sub_8013660(&gUnknown_203B224->input);
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (GetKeyPress(&gUnknown_203B224->input)) {
|
||||
case INPUT_B_BUTTON:
|
||||
PlayMenuSoundEffect(1);
|
||||
return 2;
|
||||
case INPUT_A_BUTTON:
|
||||
switch (gUnknown_203B224->unk0) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
if (gUnknown_203B224->unk4[sub_801A8AC()] != 0)
|
||||
PlayMenuSoundEffect(2);
|
||||
else
|
||||
PlayMenuSoundEffect(0);
|
||||
break;
|
||||
case 3:
|
||||
if (sub_801AEA8() != 0 || sub_801ADA0(sub_801A8AC()))
|
||||
PlayMenuSoundEffect(0);
|
||||
else
|
||||
PlayMenuSoundEffect(2);
|
||||
break;
|
||||
case 4:
|
||||
item = gTeamInventoryRef->teamItems[sub_801A8AC()];
|
||||
|
||||
if (CanSellItem(item.id) && GetStackSellPrice(&item) + gTeamInventoryRef->teamMoney <= MAX_TEAM_MONEY)
|
||||
PlayMenuSoundEffect(0);
|
||||
else
|
||||
PlayMenuSoundEffect(2);
|
||||
break;
|
||||
case 5:
|
||||
PlayMenuSoundEffect(0);
|
||||
break;
|
||||
}
|
||||
return 3;
|
||||
case INPUT_START_BUTTON:
|
||||
PlayMenuSoundEffect(4);
|
||||
return 4;
|
||||
case INPUT_L_BUTTON:
|
||||
case INPUT_R_BUTTON:
|
||||
if (gUnknown_203B224->unk0 != 3)
|
||||
goto _0801A87C;
|
||||
|
||||
index = sub_801A8AC();
|
||||
if (gUnknown_203B224->unk4[index] != 0 || sub_801ADA0(index)) {
|
||||
PlayMenuSoundEffect(6);
|
||||
gUnknown_203B224->unk4[index] ^= 1;
|
||||
sub_80138B8(&gUnknown_203B224->input, 0);
|
||||
sub_801A9E0();
|
||||
return 1;
|
||||
}
|
||||
|
||||
PlayMenuSoundEffect(2);
|
||||
goto _0801A87C;
|
||||
case INPUT_SELECT_BUTTON:
|
||||
if (gUnknown_203B224->unk0 != 2) {
|
||||
PlayMenuSoundEffect(5);
|
||||
SortInventoryItems();
|
||||
sub_801A9E0();
|
||||
}
|
||||
// NOTE: fallthrough needed here
|
||||
default:
|
||||
_0801A87C:
|
||||
if (sub_80138B8(&gUnknown_203B224->input, 1) != FALSE) {
|
||||
sub_801A998();
|
||||
sub_801A9E0();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
s32 sub_801A8AC(void)
|
||||
{
|
||||
return (gUnknown_203B224->input.unk1E * gUnknown_203B224->input.unk1C) + gUnknown_203B224->input.menuIndex;
|
||||
}
|
||||
|
||||
void sub_801A8D0(bool8 r0)
|
||||
{
|
||||
sub_8099690(1);
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(gUnknown_203B224->unk90, FALSE, FALSE);
|
||||
FillInventoryGaps();
|
||||
gUnknown_203B224->input.unk22 = GetNumberOfFilledInventorySlots();
|
||||
sub_8013984(&gUnknown_203B224->input);
|
||||
sub_801A998();
|
||||
sub_801A9E0();
|
||||
if (r0)
|
||||
AddMenuCursorSprite(&gUnknown_203B224->input);
|
||||
}
|
||||
|
||||
void sub_801A928(void)
|
||||
{
|
||||
if (gUnknown_203B224 != NULL) {
|
||||
gUnknown_203B228 = gUnknown_203B224->input.menuIndex;
|
||||
gUnknown_203B22A = gUnknown_203B224->input.unk1E;
|
||||
gUnknown_203B224->unk90[gUnknown_203B224->unk88] = sUnknown_80DB944;
|
||||
sub_8099690(0);
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(gUnknown_203B224->unk90, TRUE, TRUE);
|
||||
MemoryFree(gUnknown_203B224);
|
||||
gUnknown_203B224 = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_801A998(void)
|
||||
{
|
||||
gUnknown_203B224->unkF0[0] = gUnknown_203B224->input.unk20;
|
||||
gUnknown_203B224->unkF0[1] = gUnknown_203B224->input.unk1E;
|
||||
gUnknown_203B224->unkF0[2] = 11;
|
||||
gUnknown_203B224->unkF0[3] = 0;
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(gUnknown_203B224->unk90, TRUE, TRUE);
|
||||
}
|
||||
|
||||
void sub_801A9E0(void)
|
||||
{
|
||||
s32 teamItemIndex;
|
||||
s32 r7;
|
||||
s32 x;
|
||||
u8 buf1[80]; // sp4
|
||||
Item item; // spC8
|
||||
|
||||
sub_8008C54(gUnknown_203B224->unk88);
|
||||
sub_80073B8(gUnknown_203B224->unk88);
|
||||
x = gUnknown_203B224->input.unk1E * 8 + 10;
|
||||
|
||||
if (gUnknown_203B224->input.unk1E == 0)
|
||||
xxx_call_draw_string(x, 0, sTeamToolboxA, gUnknown_203B224->unk88, 0);
|
||||
else
|
||||
xxx_call_draw_string(x, 0, sTeamToolboxB, gUnknown_203B224->unk88, 0);
|
||||
|
||||
for (r7 = 0; r7 < gUnknown_203B224->input.unk1A; r7++) {
|
||||
teamItemIndex = (gUnknown_203B224->input.unk1E * gUnknown_203B224->input.unk1C) + r7;
|
||||
item = gTeamInventoryRef->teamItems[teamItemIndex];
|
||||
|
||||
switch (gUnknown_203B224->unk0) {
|
||||
case 0: {
|
||||
sub_8090E14(buf1, &item, 0);
|
||||
xxx_call_draw_string(8, sub_8013800(&gUnknown_203B224->input, r7), buf1, gUnknown_203B224->unk88, 0);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
case 2: {
|
||||
struct unkStruct_8090F58 thing; // sp54
|
||||
|
||||
thing.unk0 = 0;
|
||||
thing.unk4 = 0;
|
||||
thing.unk8 = 1;
|
||||
item.flags = 1;
|
||||
sub_8090E14(buf1, &item, &thing);
|
||||
|
||||
xxx_call_draw_string(8, sub_8013800(&gUnknown_203B224->input, r7), buf1, gUnknown_203B224->unk88, 0);
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
struct unkStruct_8090F58 thing; // sp60
|
||||
|
||||
thing.unk0 = 0;
|
||||
thing.unk4 = 0;
|
||||
thing.unk8 = 1;
|
||||
item.flags = 1;
|
||||
sub_8090E14(buf1, &item, &thing);
|
||||
|
||||
if (gUnknown_203B224->unk4[teamItemIndex] != 0 || sub_801ADA0(teamItemIndex))
|
||||
xxx_call_draw_string(8,sub_8013800(&gUnknown_203B224->input,r7), buf1, gUnknown_203B224->unk88, 0);
|
||||
else {
|
||||
strncpy(gUnknown_202DE58, buf1, 80);
|
||||
xxx_format_and_draw(8, sub_8013800(&gUnknown_203B224->input, r7), sFmtMoveItem0, gUnknown_203B224->unk88, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
struct unkStruct_8090F58 thing; // sp6C
|
||||
u8 buf2[80]; // sp78
|
||||
|
||||
if (CanSellItem(item.id)) {
|
||||
thing.unk0 = 3;
|
||||
thing.unk4 = 0;
|
||||
thing.unk6 = 88;
|
||||
thing.unk8 = 1;
|
||||
item.flags = 3;
|
||||
sub_8090E14(buf1, &item, &thing);
|
||||
|
||||
if (GetStackSellPrice(&item) + gTeamInventoryRef->teamMoney > MAX_TEAM_MONEY) {
|
||||
sprintfStatic(buf2, sFmtRed, buf1);
|
||||
xxx_call_draw_string(8, sub_8013800(&gUnknown_203B224->input, r7), buf2, gUnknown_203B224->unk88, 0);
|
||||
}
|
||||
else
|
||||
xxx_call_draw_string(8, sub_8013800(&gUnknown_203B224->input, r7), buf1, gUnknown_203B224->unk88, 0);
|
||||
}
|
||||
else {
|
||||
sub_8090E14(buf1, &item, 0);
|
||||
strncpy(gUnknown_202DE58, buf1, 80);
|
||||
xxx_format_and_draw(8, sub_8013800(&gUnknown_203B224->input, r7), sFmtMoveItem0, gUnknown_203B224->unk88, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
UNUSED struct unkStruct_8090F58 thingUnused; // sp6C
|
||||
struct unkStruct_8090F58 thing; // sp78
|
||||
|
||||
thing.unk0 = 0;
|
||||
thing.unk4 = 0;
|
||||
thing.unk8 = 1;
|
||||
item.flags = 1;
|
||||
sub_8090E14(buf1, &item, &thing);
|
||||
|
||||
if (IsGummiItem(item.id))
|
||||
xxx_call_draw_string(8, sub_8013800(&gUnknown_203B224->input, r7), buf1, gUnknown_203B224->unk88, 0);
|
||||
else {
|
||||
strncpy(gUnknown_202DE58, buf1, 80);
|
||||
xxx_format_and_draw(8, sub_8013800(&gUnknown_203B224->input, r7), sFmtMoveItem0, gUnknown_203B224->unk88, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (sub_801AED0(teamItemIndex) & 1)
|
||||
sub_8007B7C(gUnknown_203B224->unk88, 8, sub_8013800(&gUnknown_203B224->input, r7), (gUnknown_203B224->unk8C->unkC - 2) * 8, 10);
|
||||
}
|
||||
|
||||
sub_80073E0(gUnknown_203B224->unk88);
|
||||
}
|
||||
|
||||
void sub_801AD34(u32 param_1)
|
||||
{
|
||||
sub_8008C54(param_1);
|
||||
sub_80073B8(param_1);
|
||||
xxx_call_draw_string(6, 0, sItems, param_1, 0);
|
||||
sub_8012BC4(18, 13, GetNumberOfFilledInventorySlots(), 2, 7, param_1);
|
||||
xxx_call_draw_string(22, 13, sSlash, param_1, 0);
|
||||
sub_8012BC4(43, 13, INVENTORY_SIZE, 2, 7, param_1);
|
||||
sub_80073E0(param_1);
|
||||
}
|
||||
|
||||
bool8 sub_801ADA0(s32 param_1)
|
||||
{
|
||||
u16 uVar2;
|
||||
u32 uVar2_32;
|
||||
|
||||
u16 uVar3;
|
||||
u32 uVar3_32;
|
||||
s32 sum1;
|
||||
s32 sum2;
|
||||
Item item;
|
||||
|
||||
item = gTeamInventoryRef->teamItems[param_1];
|
||||
if (!IsNotMoneyOrUsedTMItem(item.id))
|
||||
return FALSE;
|
||||
|
||||
if (IsThrowableItem(item.id)) {
|
||||
uVar3_32 = sub_801AE24(item.id);
|
||||
sum1 = gTeamInventoryRef->teamStorage[item.id];
|
||||
uVar3 = uVar3_32;
|
||||
sum1 += uVar3;
|
||||
sum1 += (item.quantity);
|
||||
if (sum1 > 999)
|
||||
return FALSE;
|
||||
}
|
||||
else {
|
||||
uVar2_32 = sub_801AE24(item.id);
|
||||
sum2 = gTeamInventoryRef->teamStorage[item.id];
|
||||
uVar2 = uVar2_32;
|
||||
sum2 += uVar2;
|
||||
if (sum2 > 998)
|
||||
return FALSE;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static s32 sub_801AE24(u32 itemID)
|
||||
{
|
||||
Item item;
|
||||
u16 count;
|
||||
s32 invIndex;
|
||||
|
||||
count = 0;
|
||||
for (invIndex = 0; invIndex < GetNumberOfFilledInventorySlots(); invIndex++) {
|
||||
if (gUnknown_203B224->unk4[invIndex] != 0) {
|
||||
item = gTeamInventoryRef->teamItems[invIndex];
|
||||
|
||||
if (item.id == itemID) {
|
||||
if (IsThrowableItem(item.id))
|
||||
count += item.quantity;
|
||||
else
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
void sub_801AE84(void)
|
||||
{
|
||||
s32 index;
|
||||
|
||||
for (index = 0; index < INVENTORY_SIZE; index++)
|
||||
gUnknown_203B224->unk4[index] = 0;
|
||||
}
|
||||
|
||||
s32 sub_801AEA8(void)
|
||||
{
|
||||
s32 index;
|
||||
s32 count;
|
||||
|
||||
count = 0;
|
||||
for (index = 0; index < INVENTORY_SIZE; index++) {
|
||||
if (gUnknown_203B224->unk4[index] != 0)
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
s32 sub_801AED0(s32 index)
|
||||
{
|
||||
return gUnknown_203B224->unk4[index];
|
||||
}
|
||||
|
||||
void sub_801AEE4(s32 index, s32 value)
|
||||
{
|
||||
gUnknown_203B224->unk4[index] = value;
|
||||
}
|
||||
|
||||
static void SortInventoryItems(void)
|
||||
{
|
||||
Item *itemSlotR;
|
||||
u32 *itemIDR;
|
||||
u32 *base;
|
||||
s32 orderL;
|
||||
s32 orderR;
|
||||
u32 itemIDL;
|
||||
Item itemSlotL;
|
||||
s32 itemR;
|
||||
s32 itemL;
|
||||
|
||||
for (itemL = 0; itemL < GetNumberOfFilledInventorySlots() - 1; itemL++) {
|
||||
for (itemR = itemL + 1; itemR < GetNumberOfFilledInventorySlots(); itemR++) {
|
||||
orderL = GetItemOrder(gTeamInventoryRef->teamItems[itemL].id);
|
||||
orderR = GetItemOrder(gTeamInventoryRef->teamItems[itemR].id);
|
||||
|
||||
if (orderL > orderR
|
||||
|| (orderL == orderR && gTeamInventoryRef->teamItems[itemL].quantity < gTeamInventoryRef->teamItems[itemR].quantity)) {
|
||||
itemSlotL = gTeamInventoryRef->teamItems[itemL];
|
||||
itemSlotR = &gTeamInventoryRef->teamItems[itemR];
|
||||
gTeamInventoryRef->teamItems[itemL] = *itemSlotR;
|
||||
*itemSlotR = itemSlotL;
|
||||
|
||||
base = gUnknown_203B224->unk4;
|
||||
itemIDL = gUnknown_203B224->unk4[itemL];
|
||||
itemIDR = &base[itemR];
|
||||
base[itemL] = *itemIDR;
|
||||
*itemIDR = itemIDL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UNUSED static struct unkStruct_203B224 *sub_801AF98(void)
|
||||
{
|
||||
return gUnknown_203B224;
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "constants/colors.h"
|
||||
#include "constants/evolution_status.h"
|
||||
#include "input.h"
|
||||
#include "kecleon_bros.h"
|
||||
#include "kecleon_bros4.h"
|
||||
#include "luminous_cave.h"
|
||||
#include "memory.h"
|
||||
#include "menu_input.h"
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "text2.h"
|
||||
|
||||
extern u8 gAvailablePokemonNames[]; // 202DF98
|
||||
extern u8 gUnknown_202DFE8[];
|
||||
extern u8 gPlayerName[]; // 202E2B8
|
||||
|
||||
EWRAM_DATA_2 struct unkStruct_203B2B0 *gUnknown_203B2B0 = {0};
|
||||
@@ -242,34 +241,34 @@ static void UpdateLuminousCaveDialogue(void)
|
||||
sub_8014248(sLuminousCaveGiveItem,0,gUnknown_203B2B0->menuAction2,gUnknown_203B2B0->unk34,gUnknown_203B2B0->unk74,4,0,0,5);
|
||||
break;
|
||||
case 6:
|
||||
sub_801A5D8(2,3,0,10);
|
||||
sub_801A5D8(2,3,NULL,10);
|
||||
break;
|
||||
case 7:
|
||||
sub_801A8D0(1);
|
||||
sub_801A8D0(TRUE);
|
||||
break;
|
||||
case LUMINOUS_CAVE_GIVE_ITEM_2:
|
||||
sub_8024DBC();
|
||||
sub_8014248(sLuminousCaveGiveAnotherItem,0,gUnknown_203B2B0->menuAction2,gUnknown_203B2B0->unk34,gUnknown_203B2B0->unk74,4,0,0,5);
|
||||
break;
|
||||
case 0xb:
|
||||
sub_801A5D8(2,3,0,10);
|
||||
case 11:
|
||||
sub_801A5D8(2,3,NULL,10);
|
||||
sub_801AEE4(gUnknown_203B2B0->evoItem1_InvIndex,1);
|
||||
sub_801A9E0();
|
||||
break;
|
||||
case 0xc:
|
||||
sub_801A8D0(1);
|
||||
case 12:
|
||||
sub_801A8D0(TRUE);
|
||||
sub_801AEE4(gUnknown_203B2B0->evoItem1_InvIndex,1);
|
||||
sub_801A9E0();
|
||||
break;
|
||||
case 8:
|
||||
case 0xd:
|
||||
case 13:
|
||||
sub_801A9E0();
|
||||
sub_8024E30();
|
||||
sub_8012D60(&gUnknown_203B2B0->unk84,gUnknown_203B2B0->unk34,0,gUnknown_203B2B0->unk74,
|
||||
gUnknown_203B2B0->menuAction3,2);
|
||||
break;
|
||||
case 9:
|
||||
case 0xe:
|
||||
case 14:
|
||||
sub_801B3C0(&gUnknown_203B2B0->chosenItem);
|
||||
break;
|
||||
case LUMINOUS_CAVE_LACK_WHAT_NEEDED:
|
||||
|
||||
29
src/main.c
29
src/main.c
@@ -19,15 +19,14 @@ EWRAM_DATA u8 IntrMain_Buffer[0x120] = {0};
|
||||
EWRAM_DATA IntrCallback gIntrTable[6] = {0};
|
||||
EWRAM_DATA IntrCallback gIntrCallbacks[6] = {0};
|
||||
|
||||
extern char ewram_start[];
|
||||
extern char alt_203B038[];
|
||||
extern char gTitlePaletteFile[];
|
||||
extern char gUnknown_203BC04[];
|
||||
extern char iwram_start[];
|
||||
extern char alt_3001B58[];
|
||||
extern char unk_code[];
|
||||
extern char unk_code_ram[];
|
||||
extern char unk_code_ram_end[];
|
||||
extern u8 ewram_start[];
|
||||
extern u8 ewramClearEnd[];
|
||||
extern u8 ewram2_end[];
|
||||
extern u8 iwram_start[];
|
||||
extern u8 iwramClearEnd[];
|
||||
extern u8 unk_code[];
|
||||
extern u8 unk_code_ram[];
|
||||
extern u8 unk_code_ram_end[];
|
||||
|
||||
EWRAM_DATA_2 u8 gInterruptsEnabled = {0};
|
||||
|
||||
@@ -65,20 +64,20 @@ void AgbMain(void)
|
||||
DmaStop(2);
|
||||
DmaStop(3);
|
||||
|
||||
if (gUnknown_203BC04 - gTitlePaletteFile > 0)
|
||||
CpuCopy32(gUnknown_8270000, gTitlePaletteFile, gUnknown_203BC04 - gTitlePaletteFile);
|
||||
if (ewram2_end - ewramClearEnd > 0)
|
||||
CpuCopy32(gUnknown_8270000, ewramClearEnd, ewram2_end - ewramClearEnd);
|
||||
|
||||
if (alt_203B038 - ewram_start > 0) {
|
||||
if (ewramClearEnd - ewram_start > 0) {
|
||||
memset(value, 0, 4);
|
||||
CpuSet(&value, ewram_start, CPU_SET_SRC_FIXED | CPU_SET_32BIT | (((alt_203B038 - ewram_start) / 4) & 0x1FFFFF));
|
||||
CpuSet(&value, ewram_start, CPU_SET_SRC_FIXED | CPU_SET_32BIT | (((ewramClearEnd - ewram_start) / 4) & 0x1FFFFF));
|
||||
}
|
||||
|
||||
if (unk_code_ram_end - unk_code_ram > 0)
|
||||
CpuCopy32(unk_code, unk_code_ram, unk_code_ram_end - unk_code_ram);
|
||||
|
||||
if (alt_3001B58 - iwram_start > 0) {
|
||||
if (iwramClearEnd - iwram_start > 0) {
|
||||
memset(value, 0, 4);
|
||||
CpuSet(&value, iwram_start, CPU_SET_SRC_FIXED | CPU_SET_32BIT | (((alt_3001B58 - iwram_start) / 4) & 0x1FFFFF));
|
||||
CpuSet(&value, iwram_start, CPU_SET_SRC_FIXED | CPU_SET_32BIT | (((iwramClearEnd - iwram_start) / 4) & 0x1FFFFF));
|
||||
}
|
||||
|
||||
REG_WIN0H = 0;
|
||||
|
||||
13
src/memory.c
13
src/memory.c
@@ -2,12 +2,13 @@
|
||||
#include "cpu.h"
|
||||
#include "memory.h"
|
||||
|
||||
extern struct HeapFreeListElement gMainHeapFreeList[32];
|
||||
extern u8 gMainHeap[HEAP_SIZE];
|
||||
extern struct HeapDescriptor gMainHeapDescriptor;
|
||||
|
||||
EWRAM_DATA struct HeapDescriptor *gHeapDescriptorList[8] = {0};
|
||||
EWRAM_DATA u32 gHeapCount = {0};
|
||||
EWRAM_DATA struct HeapDescriptor *gHeapDescriptorList[8] = {0}; // 2000E88
|
||||
EWRAM_DATA u32 gHeapCount = {0}; // 2000EA8
|
||||
// space of 4?
|
||||
EWRAM_DATA struct HeapDescriptor gMainHeapDescriptor = {0}; // 2000EB0
|
||||
// space of 4?
|
||||
extern struct HeapFreeListElement gMainHeapFreeList[32]; // 2000ED0
|
||||
extern u8 gMainHeap[HEAP_SIZE]; // 20011D0
|
||||
|
||||
void InitHeapInternal(void);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "constants/dungeon.h"
|
||||
#include "event_flag.h"
|
||||
#include "items.h"
|
||||
#include "kecleon_bros.h"
|
||||
#include "kecleon_bros4.h"
|
||||
#include "memory.h"
|
||||
#include "menu_input.h"
|
||||
#include "moves.h"
|
||||
@@ -33,7 +33,7 @@ typedef struct unkStruct_203B2B8
|
||||
u32 moveIndex;
|
||||
/* 0x24 */ u16 moveID;
|
||||
Move moves[8];
|
||||
u16 moveIDs[4]; // some list of move IDs
|
||||
u16 moveIDs[4]; // some list of move IDs
|
||||
u32 menuAction1;
|
||||
u32 menuAction2;
|
||||
u32 menuAction3; // unused
|
||||
@@ -262,10 +262,10 @@ void sub_80261D0(void)
|
||||
sub_80227B8(gUnknown_203B2B8->pokeStruct);
|
||||
break;
|
||||
case 0x12:
|
||||
sub_801A5D8(1,0,0,10);
|
||||
sub_801A5D8(1,0,NULL,10);
|
||||
break;
|
||||
case 0x13:
|
||||
sub_801A8D0(1);
|
||||
sub_801A8D0(TRUE);
|
||||
break;
|
||||
case 0x14:
|
||||
sub_801A9E0();
|
||||
|
||||
@@ -634,8 +634,6 @@ u32 sub_808ECFC(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern s32 sub_808D580(s32*);
|
||||
|
||||
void sub_808ED00() {
|
||||
s32 team[4];
|
||||
s32 i;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "global.h"
|
||||
#include "pokemon.h"
|
||||
#include "pokemon_mail.h"
|
||||
#include "pokemon_mid.h"
|
||||
#include "memory.h"
|
||||
#include "text1.h"
|
||||
#include "text2.h"
|
||||
@@ -170,7 +171,6 @@ extern char gUnknown_202E5D8[0x50];
|
||||
extern char gAvailablePokemonNames[0x50];
|
||||
extern void sub_802BC7C(void);
|
||||
extern PokemonStruct1 *sub_808D3BC(void);
|
||||
extern void PrintPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon);
|
||||
|
||||
u32 sub_802B640(u32 r0, UnkTextStruct2_sub *r1, u32 r2)
|
||||
{
|
||||
|
||||
@@ -4,7 +4,13 @@
|
||||
#include "sprite.h"
|
||||
|
||||
static EWRAM_DATA u16 sOAMSpriteCount; // Written to but never read
|
||||
#ifndef NONMATCHING
|
||||
UNUSED // TODO: Remove the "UNUSED" attribute after sub_8004EA8 is done
|
||||
#endif
|
||||
static EWRAM_DATA s16 sUnknown_2025672[8];
|
||||
#ifndef NONMATCHING
|
||||
UNUSED // TODO: Remove the "UNUSED" attribute after sub_8004EA8 is done
|
||||
#endif
|
||||
static EWRAM_DATA s16 sUnknown_2025682[9];
|
||||
static EWRAM_DATA Position sUnknown_2025694;
|
||||
static EWRAM_DATA u32 sUnknown_2025698;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "menu_input.h"
|
||||
#include "code_80118A4.h"
|
||||
#include "code_803B050.h"
|
||||
#include "pokemon_mid.h"
|
||||
|
||||
bool8 IsMailSlotEmpty(u8);
|
||||
extern s32 CountPelipperBoardSlots(void);
|
||||
@@ -58,7 +59,6 @@ extern u16 gUnknown_203B2E4;
|
||||
extern WonderMail *GetMailboxSlotInfo(u8);
|
||||
extern u8 gMailboxText[];
|
||||
extern u8 gAvailablePokemonNames[];
|
||||
extern void PrintPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon);
|
||||
|
||||
void CreateMailMenu(void)
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "text2.h"
|
||||
#include "wonder_mail.h"
|
||||
#include "pokemon.h"
|
||||
#include "pokemon_mid.h"
|
||||
#include "rescue_team_info.h"
|
||||
#include "friend_area.h"
|
||||
#include "items.h"
|
||||
@@ -108,7 +109,6 @@ extern u32 sub_802CE5C(u32);
|
||||
extern void sub_802CF14(void);
|
||||
extern u32 sub_802DEE0(void);
|
||||
extern void sub_802DF24(void);
|
||||
extern void PrintPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon);
|
||||
extern void sub_802F6FC(void);
|
||||
extern void ProceedToNextRewardSceneState(void);
|
||||
extern void sub_802F300(void);
|
||||
|
||||
426
sym_ewram.txt
426
sym_ewram.txt
@@ -8,13 +8,7 @@ gUnknown_2000A88: /* 2000A88 (code / event_flag) */
|
||||
.space 0x400
|
||||
|
||||
.include "src/memory.o"
|
||||
|
||||
.align 4
|
||||
|
||||
gMainHeapDescriptor: /* 2000EB0 */
|
||||
.space 0x20
|
||||
|
||||
gMainHeapFreeList: /* 2000ED0 */
|
||||
gMainHeapFreeList: /* 2000ED0 (memory) */
|
||||
.space 0x300
|
||||
gMainHeap: /* 20011D0 (memory) */
|
||||
.space 0x24000
|
||||
@@ -59,73 +53,73 @@ gUnknown_2026E60: /* 2026E60 (code_800558C) */
|
||||
gUnknown_20270E8: /* 20270E8 (code_800558C) */
|
||||
.space 0x288
|
||||
|
||||
gUnknown_2027370: /* 2027370 */
|
||||
gUnknown_2027370: /* 2027370 (code_80130A8 / code_805D8C8 / code_80521D0 / code_8272724 / text / menu_input / text1 / text2) */
|
||||
.space 0x48
|
||||
|
||||
gUnknown_20273B8: /* 20273B8 */
|
||||
gUnknown_20273B8: /* 20273B8 (code_80130A8) */
|
||||
.space 0xD8
|
||||
|
||||
gCharmaps: /* 2027490 */
|
||||
gCharmaps: /* 2027490 (text / text1) */
|
||||
.space 0x8
|
||||
|
||||
gCharacterSpacing: /* 2027498 */
|
||||
gCharacterSpacing: /* 2027498 (text / text1 / text2) */
|
||||
.space 0x2
|
||||
|
||||
gUnknown_202749A: /* 202749A */
|
||||
gUnknown_202749A: /* 202749A (text / code_805D8C8) */
|
||||
.space 0xB
|
||||
|
||||
gUnknown_20274A5: /* 20274A5 */
|
||||
gUnknown_20274A5: /* 20274A5 (text / text1 / code_803D110) */
|
||||
.space 0x1
|
||||
|
||||
gUnknown_20274A6: /* 20274A6 */
|
||||
gUnknown_20274A6: /* 20274A6 (text) */
|
||||
.space 0x6
|
||||
|
||||
gCurrentCharmap: /* 20274AC */
|
||||
gCurrentCharmap: /* 20274AC (text / text1 / text2) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_20274B0: /* 20274B0 */
|
||||
gUnknown_20274B0: /* 20274B0 (text1) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_20274B4: /* 20274B4 */
|
||||
gUnknown_20274B4: /* 20274B4 (text1) */
|
||||
.space 0x3B00
|
||||
|
||||
gCharmapFiles: /* 202AFB4 */
|
||||
gCharmapFiles: /* 202AFB4 (text1) */
|
||||
.space 0x8
|
||||
|
||||
gUnknown_202AFBC: /* 202AFBC */
|
||||
gUnknown_202AFBC: /* 202AFBC [UNUSED] */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202AFC0: /* 202AFC0 */
|
||||
gUnknown_202AFC0: /* 202AFC0 (text1 / text2) */
|
||||
.space 0x60
|
||||
|
||||
gUnknown_202B020: /* 202B020 */
|
||||
gUnknown_202B020: /* 202B020 (text / text1) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202B024: /* 202B024 */
|
||||
gUnknown_202B024: /* 202B024 (text / text1) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202B028: /* 202B028 */
|
||||
gUnknown_202B028: /* 202B028 (text1 / text2) */
|
||||
.space 0x8
|
||||
|
||||
gUnknown_202B030: /* 202B030 */
|
||||
gUnknown_202B030: /* 202B030 (text1 / text2) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202B034: /* 202B034 */
|
||||
gUnknown_202B034: /* 202B034 (text1 / text2) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202B038: /* 202B038 */
|
||||
gUnknown_202B038: /* 202B038 (text1 / text2 / dungeon_map_access_1 / code_8009804 / code_8040094 / code_80521D0 / code_803D110 / code_80A26CC_1 / code_2) */
|
||||
.space 0x800
|
||||
|
||||
gUnknown_202B838: /* 202B838 */
|
||||
gUnknown_202B838: /* 202B838 [UNUSED] */
|
||||
.space 0x800
|
||||
|
||||
gUnknown_202C038: /* 202C038 */
|
||||
gUnknown_202C038: /* 202C038 (code_800DAC0 / code_80495E4) */
|
||||
.space 0x800
|
||||
|
||||
gUnknown_202C838: /* 202C838 */
|
||||
gUnknown_202C838: /* 202C838 (code_800DAC0 / code_80495E4) */
|
||||
.space 0x720
|
||||
|
||||
gUnknown_202CF58: /* 202CF58 */
|
||||
gUnknown_202CF58: /* 202CF58 (code_80130A8) */
|
||||
.space 0xE0
|
||||
|
||||
gUnknown_202D038: /* 202D038 */
|
||||
@@ -170,10 +164,10 @@ gUnknown_202D2A0: /* 202D2A0 */
|
||||
.include "src/file_system.o"
|
||||
.include "src/main.o"
|
||||
|
||||
gUnknown_202D608: /* 202D608 */
|
||||
gUnknown_202D608: /* 202D608 (reg_control / unused_vblank) */
|
||||
.space 0x40
|
||||
|
||||
gUnknown_202D648: /* 202D648 */
|
||||
gUnknown_202D648: /* 202D648 (reg_control / unused_vblank) */
|
||||
.space 0x40
|
||||
|
||||
.include "src/music.o"
|
||||
@@ -182,204 +176,204 @@ gUnknown_202D648: /* 202D648 */
|
||||
.include "src/bg_control.o"
|
||||
.space 0x140
|
||||
|
||||
gBldAlpha: /* 202D7FA */
|
||||
gBldAlpha: /* 202D7FA (bg_control / cpu) */
|
||||
.space 0x2
|
||||
|
||||
gBldCnt: /* 202D7FC */
|
||||
gBldCnt: /* 202D7FC (bg_control / cpu / main / reg_control) */
|
||||
.space 0x2
|
||||
|
||||
gUnknown_202D7FE: /* 202D7FE */
|
||||
gUnknown_202D7FE: /* 202D7FE (bg_control / main / reg_control) */
|
||||
.space 0x2
|
||||
|
||||
gUnknown_202D800: /* 202D800 */
|
||||
gUnknown_202D800: /* 202D800 (cpu) */
|
||||
.space 0x8
|
||||
|
||||
gUnknown_202D808: /* 202D808 */
|
||||
gUnknown_202D808: /* 202D808 (code_800D090) */
|
||||
.space 0x108
|
||||
|
||||
gUnknown_202D910: /* 202D910 */
|
||||
gUnknown_202D910: /* 202D910 (code_800D090) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202D914: /* 202D914 */
|
||||
gUnknown_202D914: /* 202D914 (code_800D090) */
|
||||
.space 0x20C
|
||||
|
||||
gUnknown_202DB20: /* 202DB20 */
|
||||
gUnknown_202DB20: /* 202DB20 (code_800D090) */
|
||||
.space 0x10
|
||||
|
||||
gUnknown_202DB30: /* 202DB30 */
|
||||
gUnknown_202DB30: /* 202DB30 (code_800D090) */
|
||||
.space 0x20
|
||||
|
||||
gUnknown_202DB50: /* 202DB50 */
|
||||
gUnknown_202DB50: /* 202DB50 (code_800D090) */
|
||||
.space 0x8
|
||||
|
||||
gUnknown_202DB58: /* 202DB58 */
|
||||
gUnknown_202DB58: /* 202DB58 (code_800D090) */
|
||||
.space 0x8
|
||||
|
||||
gUnknown_202DB60: /* 202DB60 */
|
||||
gUnknown_202DB60: /* 202DB60 (code_800D090) */
|
||||
.space 0x8
|
||||
|
||||
gUnknown_202DB68: /* 202DB68 */
|
||||
gUnknown_202DB68: /* 202DB68 (code_800D090) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202DB6C: /* 202DB6C */
|
||||
gUnknown_202DB6C: /* 202DB6C (code_800D090) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202DB70: /* 202DB70 */
|
||||
gUnknown_202DB70: /* 202DB70 (code_800D090) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202DB74: /* 202DB74 */
|
||||
gUnknown_202DB74: /* 202DB74 (code_800D090) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202DB78: /* 202DB78 */
|
||||
gUnknown_202DB78: /* 202DB78 (code_800D090) */
|
||||
.space 0x40
|
||||
|
||||
gUnknown_202DBB8: /* 202DBB8 */
|
||||
gUnknown_202DBB8: /* 202DBB8 (code_800D090 / data_80B9BB8) */
|
||||
.space 0x140
|
||||
|
||||
gUnknown_202DCF8: /* 202DCF8 */
|
||||
gUnknown_202DCF8: /* 202DCF8 (code_800D090 / arm_func) */
|
||||
.space 0x120
|
||||
|
||||
gUnknown_202DE18: /* 202DE18 */
|
||||
gUnknown_202DE18: /* 202DE18 (code_800DAC0) */
|
||||
.space 0x1
|
||||
|
||||
gUnknown_202DE19: /* 202DE19 */
|
||||
gUnknown_202DE19: /* 202DE19 (code_800DAC0) */
|
||||
.space 0x3
|
||||
|
||||
gUnknown_202DE1C: /* 202DE1C */
|
||||
gUnknown_202DE1C: /* 202DE1C (code_80118A4) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202DE20: /* 202DE20 */
|
||||
gUnknown_202DE20: /* 202DE20 (code_80118A4) */
|
||||
.space 0x2
|
||||
|
||||
gUnknown_202DE22: /* 202DE22 */
|
||||
gUnknown_202DE22: /* 202DE22 (code_80118A4) */
|
||||
.space 0x2
|
||||
|
||||
gUnknown_202DE24: /* 202DE24 */
|
||||
gUnknown_202DE24: /* 202DE24 (code_80118A4) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202DE28: /* 202DE28 */
|
||||
gUnknown_202DE28: /* 202DE28 (save) */
|
||||
.space 0x4
|
||||
.align 4
|
||||
|
||||
gUnknown_202DE30: /* 202DE30 */
|
||||
.space 0x28
|
||||
|
||||
/* Seems to be a general u8 buffer for text, mostly used with item names. Capacity of 80 chars..? */
|
||||
/* Seems to be a general u8 buffer for text, mostly used with item names */
|
||||
gUnknown_202DE58: /* 202DE58 */
|
||||
.space 0x50
|
||||
.space 80
|
||||
|
||||
gUnknown_202DEA8: /* 202DEA8 */
|
||||
.space 0xF0
|
||||
.space 240
|
||||
|
||||
gAvailablePokemonNames: /* 202DF98 */
|
||||
.space 0x50
|
||||
gAvailablePokemonNames: /* 202DF98 gAvailablePokemonNames[80][] */
|
||||
.space 80
|
||||
|
||||
gUnknown_202DFE8: /* 202DFE8 */
|
||||
.space 0x50
|
||||
gUnknown_202DFE8: /* 202DFE8 (code_805D8C8 / code_806CD90 / code_806E8B0 / code_8073CF0 / code_80521D0 / code_8057824 / code_8077274_1 / gulpin_shop_1 / status_actions) */
|
||||
.space 80
|
||||
|
||||
gUnknown_202E038: /* 202E038 ({ARG_POKEMON_2}) */
|
||||
.space 0x50
|
||||
gUnknown_202E038: /* 202E038 (code_8057824_1 / code_8086A3C / code_808417C / wonder_mail_3_mid) ({ARG_POKEMON_2}) */
|
||||
.space 80
|
||||
|
||||
gUnknown_202E088: /* 202E088 ({ARG_POKEMON_3})? */
|
||||
.space 0xA0
|
||||
gUnknown_202E088: /* 202E088 (code_8057824_1 / code_806E8B0 / code_808417C / wonder_mail_3_mid) [{ARG_POKEMON_3}]? */
|
||||
.space 160
|
||||
|
||||
gUnknown_202E128: /* 202E128 */
|
||||
.space 0xA0
|
||||
gUnknown_202E128: /* 202E128 (gulpin_shop_1) */
|
||||
.space 160
|
||||
|
||||
gUnknown_202E1C8: /* 202E1C8 */
|
||||
.space 0x50
|
||||
gUnknown_202E1C8: /* 202E1C8 (code_801AFA4 / felicity_bank / gulpin_shop_1 / kangaskhan_storage / kecleon_bros1 / makuhita_dojo1 / wigglytuff_shop / wonder_mail_802DF88) */
|
||||
.space 80
|
||||
|
||||
gUnknown_202E218: /* 202E218 */
|
||||
.space 0xA0
|
||||
gUnknown_202E218: /* 202E218 (code_801AFA4) */
|
||||
.space 160
|
||||
|
||||
gPlayerName: /* 202E2B8 */
|
||||
.space 0x320
|
||||
gPlayerName: /* 202E2B8 (ground_script / code_8098BDC / luminous_cave / makuhita_dojo1) */
|
||||
.space 800
|
||||
|
||||
gUnknown_202E5D8: /* 202E5D8 */
|
||||
.space 0x50
|
||||
gUnknown_202E5D8: /* 202E5D8 (code_80130A8 / code_8098BDC / code_80521D0 / felicity_bank / friend_rescue / gulpin_shop_1 / kangaskhan_storage / kecleon_bros1 / makuhita_dojo1 / pokemon_news / post_office_guide1 / thank_you_wonder_mail / wigglytuff_shop / wonder_mail_2 / wonder_mail_3_mid / wonder_mail_802DF88 / wonder_mail */
|
||||
.space 80
|
||||
|
||||
gUnknown_202E628: /* 202E628 */
|
||||
gUnknown_202E628: /* 202E628 (code_80130A8 / code_806E8B0 / ground_script / wigglytuff_shop / wonder_mail_3_mid) */
|
||||
.space 0xB8
|
||||
|
||||
gUnknown_202E6E0: /* 202E6E0 */
|
||||
gUnknown_202E6E0: /* 202E6E0 (code_80130A8) */
|
||||
.space 0x8
|
||||
|
||||
gTeamName: /* 202E6E8 */
|
||||
.space 0x50
|
||||
gTeamName: /* 202E6E8 (code_80130A8) */
|
||||
.space 80
|
||||
|
||||
gUnknown_202E738: /* 202E738 */
|
||||
gUnknown_202E738: /* 202E738 (code_80130A8) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202E73C: /* 202E73C */
|
||||
gUnknown_202E73C: /* 202E73C (code_80130A8) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202E740: /* 202E740 */
|
||||
gUnknown_202E740: /* 202E740 (code_80130A8) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202E744: /* 202E744 */
|
||||
gUnknown_202E744: /* 202E744 (code_80130A8) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202E748: /* 202E748 */
|
||||
gUnknown_202E748: /* 202E748 (code_80130A8) */
|
||||
.space 0x34
|
||||
|
||||
gUnknown_202E77C: /* 202E77C */
|
||||
gUnknown_202E77C: /* 202E77C (code_80130A8) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202E780: /* 202E780 */
|
||||
gUnknown_202E780: /* 202E780 (code_80130A8) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202E784: /* 202E784 */
|
||||
gUnknown_202E784: /* 202E784 (code_80130A8) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202E788: /* 202E788 */
|
||||
gUnknown_202E788: /* 202E788 (code_80130A8) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202E78C: /* 202E78C */
|
||||
gUnknown_202E78C: /* 202E78C (code_80130A8) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202E790: /* 202E790 */
|
||||
gUnknown_202E790: /* 202E790 (code_80130A8) */
|
||||
.space 0x1
|
||||
|
||||
gUnknown_202E791: /* 202E791 */
|
||||
gUnknown_202E791: /* 202E791 (code_80130A8) */
|
||||
.space 0x3
|
||||
|
||||
gUnknown_202E794: /* 202E794 */
|
||||
gUnknown_202E794: /* 202E794 (code_80130A8) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202E798: /* 202E798 (on screen dialogue text) */
|
||||
gUnknown_202E798: /* 202E798 (code_80130A8) [on screen dialogue text] */
|
||||
.space 0x3E8
|
||||
|
||||
gUnknown_202EB80: /* 202EB80 */
|
||||
gUnknown_202EB80: /* 202EB80 (code_80130A8) */
|
||||
.space 0x40
|
||||
|
||||
gUnknown_202EBC0: /* 202EBC0 */
|
||||
gUnknown_202EBC0: /* 202EBC0 (code_80130A8) */
|
||||
.space 0x50
|
||||
|
||||
gUnknown_202EC10: /* 202EC10 */
|
||||
gUnknown_202EC10: /* 202EC10 (code_80130A8) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202EC14: /* 202EC14 */
|
||||
gUnknown_202EC14: /* 202EC14 (code_80130A8) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202EC18: /* 202EC18 */
|
||||
gUnknown_202EC18: /* 202EC18 (code_80130A8) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202EC1C: /* 202EC1C */
|
||||
gUnknown_202EC1C: /* 202EC1C (code_80130A8) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202EC20: /* 202EC20 */
|
||||
gUnknown_202EC20: /* 202EC20 (code_80130A8) */
|
||||
.space 0x8
|
||||
|
||||
gUnknown_202EC28: /* 202EC28 */
|
||||
gUnknown_202EC28: /* 202EC28 (code_80130A8) */
|
||||
.space 0x10
|
||||
|
||||
gUnknown_202EC38: /* 202EC38 */
|
||||
gUnknown_202EC38: /* 202EC38 (other_menus) */
|
||||
.space 0x8
|
||||
|
||||
gUnknown_202EC40: /* 202EC40 */
|
||||
gUnknown_202EC40: /* 202EC40 (other_menus / other_menus_1) */
|
||||
.space 0x8
|
||||
|
||||
gUnknown_202EC48: /* 202EC48 */
|
||||
gUnknown_202EC48: /* 202EC48 (other_menus_1) */
|
||||
.space 0x4
|
||||
|
||||
.include "src/rescue_password_menu.o"
|
||||
@@ -427,58 +421,58 @@ gUnknown_202EDC8: /* 202EDC8 */
|
||||
gUnknown_202EDCC: /* 202EDCC */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202EDD0: /* 202EDD0 */
|
||||
gUnknown_202EDD0: /* 202EDD0 (code_803D110 / code_804AFAC / code_8040094) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202EDD4: /* 202EDD4 */
|
||||
gUnknown_202EDD4: /* 202EDD4 (code_803D110) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202EDD8: /* 202EDD8 */
|
||||
gUnknown_202EDD8: /* 202EDD8 (code_803D110) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202EDDC: /* 202EDDC */
|
||||
gUnknown_202EDDC: /* 202EDDC (code_803D110) */
|
||||
.space 0xC
|
||||
|
||||
gUnknown_202EDE8: /* 202EDE8 */
|
||||
gUnknown_202EDE8: /* 202EDE8 (code_803D110) */
|
||||
.space 0x14
|
||||
|
||||
gUnknown_202EDFC: /* 202EDFC */
|
||||
gUnknown_202EDFC: /* 202EDFC (code_803D110) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202EE00: /* 202EE00 */
|
||||
gUnknown_202EE00: /* 202EE00 (code_8040094 / code_805D8C8) */
|
||||
.space 0x1
|
||||
|
||||
gUnknown_202EE01: /* 202EE01 */
|
||||
gUnknown_202EE01: /* 202EE01 (code_8040094 / code_80521D0) */
|
||||
.space 0x1
|
||||
|
||||
gUnknown_202EE02: /* 202EE02 */
|
||||
gUnknown_202EE02: /* 202EE02 (code_8040094) */
|
||||
.space 0x2
|
||||
|
||||
gUnknown_202EE04: /* 202EE04 */
|
||||
gUnknown_202EE04: /* 202EE04 (code_8040094) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202EE08: /* 202EE08 */
|
||||
gUnknown_202EE08: /* 202EE08 (code_8040094) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202EE0C: /* 202EE0C */
|
||||
gUnknown_202EE0C: /* 202EE0C (code_805D8C8_1 / code_8069E0C) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202EE10: /* 202EE10 */
|
||||
.space 0x28
|
||||
|
||||
gUnknown_202EE38: /* 202EE38 */
|
||||
gUnknown_202EE38: /* 202EE38 (code_805D8C8) */
|
||||
.space 0x1
|
||||
|
||||
gUnknown_202EE39: /* 202EE39 */
|
||||
gUnknown_202EE39: /* 202EE39 (code_805D8C8) */
|
||||
.space 0x1
|
||||
|
||||
gUnknown_202EE3A: /* 202EE3A */
|
||||
gUnknown_202EE3A: /* 202EE3A (code_805D8C8) */
|
||||
.space 0xA
|
||||
|
||||
gUnknown_202EE44: /* 202EE44 */
|
||||
gUnknown_202EE44: /* 202EE44 (code_805D8C8 / code_8044CC8) */
|
||||
.space 0x28
|
||||
|
||||
gUnknown_202EE6C: /* 202EE6C */
|
||||
gUnknown_202EE6C: /* 202EE6C (code_805D8C8 / code_8044CC8) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202EE70: /* 202EE70 */
|
||||
@@ -493,109 +487,109 @@ gDungeonPaletteFile: /* 202EE88 */
|
||||
gUnknown_202EE8C: /* 202EE8C */
|
||||
.space 0x300
|
||||
|
||||
gUnknown_202F18C: /* 202F18C */
|
||||
gUnknown_202F18C: /* 202F18C (dungeon_map_access) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202F190: /* 202F190 */
|
||||
gUnknown_202F190: /* 202F190 (dungeon_map_access) */
|
||||
.space 0x18
|
||||
|
||||
gUnknown_202F1A8: /* 202F1A8 */
|
||||
gUnknown_202F1A8: /* 202F1A8 (code_804AFAC / code_80428A0) */
|
||||
.space 0x1
|
||||
|
||||
gUnknown_202F1A9: /* 202F1A9 */
|
||||
gUnknown_202F1A9: /* 202F1A9 (code_804AFAC) */
|
||||
.space 0x1
|
||||
|
||||
gUnknown_202F1AA: /* 202F1AA */
|
||||
gUnknown_202F1AA: /* 202F1AA (code_804AFAC) */
|
||||
.space 0x1
|
||||
|
||||
gUnknown_202F1AB: /* 202F1AB */
|
||||
gUnknown_202F1AB: /* 202F1AB (code_804AFAC) */
|
||||
.space 0x1
|
||||
|
||||
gUnknown_202F1AC: /* 202F1AC */
|
||||
gUnknown_202F1AC: /* 202F1AC (code_804AFAC) */
|
||||
.space 0x1
|
||||
|
||||
gUnknown_202F1AD: /* 202F1AD */
|
||||
gUnknown_202F1AD: /* 202F1AD (code_804AFAC) */
|
||||
.space 0x1
|
||||
|
||||
gUnknown_202F1AE: /* 202F1AE */
|
||||
gUnknown_202F1AE: /* 202F1AE (code_804AFAC) */
|
||||
.space 0x2
|
||||
|
||||
gUnknown_202F1B0: /* 202F1B0 */
|
||||
gUnknown_202F1B0: /* 202F1B0 (code_804AFAC) */
|
||||
.space 0x2
|
||||
|
||||
gUnknown_202F1B2: /* 202F1B2 */
|
||||
gUnknown_202F1B2: /* 202F1B2 (code_804AFAC) */
|
||||
.space 0x2
|
||||
|
||||
gUnknown_202F1B4: /* 202F1B4 */
|
||||
gUnknown_202F1B4: /* 202F1B4 (code_804AFAC) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202F1B8: /* 202F1B8 */
|
||||
gUnknown_202F1B8: /* 202F1B8 (code_804AFAC) */
|
||||
.space 0x10
|
||||
|
||||
gUnknown_202F1C8: /* 202F1C8 */
|
||||
gUnknown_202F1C8: /* 202F1C8 (code_804AFAC) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202F1CC: /* 202F1CC */
|
||||
gUnknown_202F1CC: /* 202F1CC (code_804AFAC) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202F1D0: /* 202F1D0 */
|
||||
gUnknown_202F1D0: /* 202F1D0 (code_804AFAC) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202F1D4: /* 202F1D4 */
|
||||
gUnknown_202F1D4: /* 202F1D4 (code_804AFAC) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202F1D8: /* 202F1D8 */
|
||||
gUnknown_202F1D8: /* 202F1D8 (code_804AFAC) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202F1DC: /* 202F1DC */
|
||||
gUnknown_202F1DC: /* 202F1DC (code_804AFAC) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202F1E0: /* 202F1E0 */
|
||||
gUnknown_202F1E0: /* 202F1E0 (code_804AFAC) */
|
||||
.space 0x1
|
||||
|
||||
gUnknown_202F1E1: /* 202F1E1 */
|
||||
gUnknown_202F1E1: /* 202F1E1 (code_804AFAC) */
|
||||
.space 0x7
|
||||
|
||||
gUnknown_202F1E8: /* 202F1E8 */
|
||||
gUnknown_202F1E8: /* 202F1E8 (code_804AFAC / code_80521D0) */
|
||||
.space 0x8
|
||||
|
||||
gUnknown_202F1F0: /* 202F1F0 */
|
||||
gUnknown_202F1F0: /* 202F1F0 (code_80521D0) */
|
||||
.space 0x8
|
||||
|
||||
gUnknown_202F1F8: /* 202F1F8 */
|
||||
gUnknown_202F1F8: /* 202F1F8 (code_80521D0) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202F1FC: /* 202F1FC */
|
||||
gUnknown_202F1FC: /* 202F1FC (code_80521D0) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202F200: /* 202F200 */
|
||||
gUnknown_202F200: /* 202F200 (code_80521D0) */
|
||||
.space 0x8
|
||||
|
||||
gUnknown_202F208: /* 202F208 */
|
||||
gUnknown_202F208: /* 202F208 (code_80521D0 / code_805D8C8) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202F20C: /* 202F20C */
|
||||
gUnknown_202F20C: /* 202F20C (code_80521D0) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202F210: /* 202F210 */
|
||||
gUnknown_202F210: /* 202F210 (code_80521D0 / code_805A120) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202F214: /* 202F214 */
|
||||
gUnknown_202F214: /* 202F214 (code_80521D0 / code_805A120) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202F218: /* 202F218 */
|
||||
gUnknown_202F218: /* 202F218 (code_80521D0 / code_805A120) */
|
||||
.space 0x1
|
||||
|
||||
gUnknown_202F219: /* 202F219 */
|
||||
gUnknown_202F219: /* 202F219 (code_80521D0 / code_8057824) */
|
||||
.space 0x1
|
||||
|
||||
gUnknown_202F21A: /* 202F21A */
|
||||
gUnknown_202F21A: /* 202F21A (code_80521D0 / code_8057824) */
|
||||
.space 0x2
|
||||
|
||||
gUnknown_202F21C: /* 202F21C */
|
||||
gUnknown_202F21C: /* 202F21C (code_80521D0 / code_8057824) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202F220: /* 202F220 */
|
||||
gUnknown_202F220: /* 202F220 (code_80521D0 / code_8057824) */
|
||||
.space 0x1
|
||||
|
||||
gUnknown_202F221: /* 202F221 */
|
||||
@@ -676,81 +670,77 @@ gUnknown_202F30C: /* 202F30C */
|
||||
gUnknown_202F310: /* 202F310 */
|
||||
.space 0x4
|
||||
|
||||
gWalkableTileToCrossableTerrain: /* 202F314 */
|
||||
gWalkableTileToCrossableTerrain: /* 202F314 (dungeon_map_access / dungeon_movement) */
|
||||
.space 0x8
|
||||
|
||||
gUnknown_202F31C: /* 202F31C */
|
||||
gUnknown_202F31C: /* 202F31C (code_80718D8) */
|
||||
.space 0x8
|
||||
|
||||
gUnknown_202F324: /* 202F324 */
|
||||
gUnknown_202F324: /* 202F324 (code_80718D8) */
|
||||
.space 0x8
|
||||
|
||||
gUnknown_202F32C: /* 202F32C */
|
||||
gUnknown_202F32C: /* 202F32C (code_8072CF4 / code_80428A0 / code_8069E0C) */
|
||||
.space 0x1
|
||||
|
||||
gUnknown_202F32D: /* 202F32D */
|
||||
gUnknown_202F32D: /* 202F32D (code_8072CF4 / code_8073CF0) */
|
||||
.space 0x3
|
||||
|
||||
gPotentialItemTargetDirections: /* 202F330 */
|
||||
gPotentialItemTargetDirections: /* 202F330 (dungeon_ai_items) */
|
||||
.space 0x20
|
||||
|
||||
gTargetAhead: /* 202F350 */
|
||||
gTargetAhead: /* 202F350 (dungeon_ai_items) */
|
||||
.space 0x8
|
||||
|
||||
gPotentialItemTargetWeights: /* 202F358 */
|
||||
gPotentialItemTargetWeights: /* 202F358 (dungeon_ai_items) */
|
||||
.space 0x20
|
||||
|
||||
gUnknown_202F378: /* 202F378 */
|
||||
gUnknown_202F378: /* 202F378 (code_8073CF0) */
|
||||
.space 0x8
|
||||
|
||||
gCanAttackInDirection: /* 202F380 */
|
||||
gCanAttackInDirection: /* 202F380 (dungeon_ai_attack) */
|
||||
.space 0x8
|
||||
|
||||
gPotentialAttackTargetDirections: /* 202F388 */
|
||||
gPotentialAttackTargetDirections: /* 202F388 (dungeon_ai_attack) */
|
||||
.space 0x8
|
||||
|
||||
gPotentialAttackTargetWeights: /* 202F390 */
|
||||
gPotentialAttackTargetWeights: /* 202F390 (dungeon_ai_attack) */
|
||||
.space 0x20
|
||||
|
||||
gPotentialTargets: /* 202F3B0 */
|
||||
gPotentialTargets: /* 202F3B0 (dungeon_ai_attack) */
|
||||
.space 0x20
|
||||
|
||||
gUnknown_202F3D0: /* 202F3D0 */
|
||||
gUnknown_202F3D0: /* 202F3D0 (code_80869E4) */
|
||||
.space 0x8
|
||||
|
||||
gUnknown_202F3D8: /* 202F3D8 */
|
||||
gUnknown_202F3D8: /* 202F3D8 (code_8085B0C) */
|
||||
.space 0x8
|
||||
|
||||
gMonsterParameters: /* 202F3E0 */
|
||||
gMonsterParameters: /* 202F3E0 (pokemon / pokemon_mid) */
|
||||
.space 0x4
|
||||
|
||||
gMonsterParametersFile: /* 202F3E4 */
|
||||
gMonsterParametersFile: /* 202F3E4 (pokemon) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_202F3E8: /* 202F3E8 */
|
||||
gUnknown_202F3E8: /* 202F3E8 (pokemon_2 / pokemon_3) */
|
||||
.space 0x18
|
||||
|
||||
gRecruitedPokemon: /* 202F400 */
|
||||
.space 0x90E8
|
||||
|
||||
gLevelCurrentPokeId: /* 20384E8 */
|
||||
gLevelCurrentPokeId: /* 20384E8 (pokemon / pokemon_mid) */
|
||||
.space 0x8
|
||||
|
||||
gLevelCurrentData: /* 20384F0 */
|
||||
gLevelCurrentData: /* 20384F0 (pokemon_mid) */
|
||||
.space 0x4B0
|
||||
|
||||
.include "src/items.o"
|
||||
|
||||
.include "src/rescue_team_info.o"
|
||||
.space 0x4
|
||||
|
||||
.include "src/friend_area.o"
|
||||
.space 0x2
|
||||
|
||||
.include "src/moves.o"
|
||||
.include "src/game_options.o"
|
||||
.include "src/play_time.o"
|
||||
|
||||
.include "src/code_8094F88.o"
|
||||
.space 0x4
|
||||
.include "src/code_80958E8.o"
|
||||
@@ -762,103 +752,103 @@ gLevelCurrentData: /* 20384F0 */
|
||||
.include "src/ground_main.o"
|
||||
.space 0x2
|
||||
|
||||
gUnknown_20398C8: /* 20398C8 */
|
||||
gUnknown_20398C8: /* 20398C8 (code_8098DBC) */
|
||||
.space 0x10
|
||||
|
||||
gUnknown_20398D8: /* 20398D8 */
|
||||
gUnknown_20398D8: /* 20398D8 (code_8098DBC) */
|
||||
.space 0x78
|
||||
|
||||
gUnknown_2039950: /* 2039950 */
|
||||
gUnknown_2039950: /* 2039950 (code_8098468 / code_8098DBC) */
|
||||
.space 0x8
|
||||
|
||||
gUnknown_2039958: /* 2039958 */
|
||||
gUnknown_2039958: /* 2039958 (code_8098DBC) */
|
||||
.space 0x10
|
||||
|
||||
gUnknown_2039968: /* 2039968 */
|
||||
gUnknown_2039968: /* 2039968 (code_8098DBC) */
|
||||
.space 0x10
|
||||
|
||||
gUnknown_2039978: /* 2039978 */
|
||||
gUnknown_2039978: /* 2039978 (code_8098DBC) */
|
||||
.space 0x8
|
||||
|
||||
gUnknown_2039980: /* 2039980 */
|
||||
gUnknown_2039980: /* 2039980 (code_8098DBC) */
|
||||
.space 0x10
|
||||
|
||||
gUnknown_2039990: /* 2039990 */
|
||||
gUnknown_2039990: /* 2039990 (code_8098DBC) */
|
||||
.space 0x2
|
||||
|
||||
gUnknown_2039992: /* 2039992 */
|
||||
gUnknown_2039992: /* 2039992 (code_8098DBC) */
|
||||
.space 0x6
|
||||
|
||||
gUnknown_2039998: /* 2039998 */
|
||||
gUnknown_2039998: /* 2039998 (code_8098DBC) */
|
||||
.space 0x44
|
||||
|
||||
gUnknown_20399DC: /* 20399DC */
|
||||
gUnknown_20399DC: /* 20399DC (code_8098DBC) */
|
||||
.space 0x2
|
||||
|
||||
gUnknown_20399DE: /* 20399DE */
|
||||
gUnknown_20399DE: /* 20399DE (code_8098DBC) */
|
||||
.space 0x2
|
||||
|
||||
gUnknown_20399E0: /* 20399E0 */
|
||||
gUnknown_20399E0: /* 20399E0 (code_8098DBC) */
|
||||
.space 0x8
|
||||
|
||||
gUnknown_20399E8: /* 20399E8 */
|
||||
gUnknown_20399E8: /* 20399E8 (code_809D148) */
|
||||
.space 0x14
|
||||
|
||||
gUnknown_20399FC: /* 20399FC */
|
||||
gUnknown_20399FC: /* 20399FC (code_809D148) */
|
||||
.space 0x34
|
||||
|
||||
gUnknown_2039A30: /* 2039A30 */
|
||||
gUnknown_2039A30: /* 2039A30 (code_809D148 / ground_script) */
|
||||
.space 0x2
|
||||
|
||||
gUnknown_2039A32: /* 2039A32 */
|
||||
gUnknown_2039A32: /* 2039A32 (code_809D148 / ground_script) */
|
||||
.space 0x2
|
||||
|
||||
gUnknown_2039A34: /* 2039A34 */
|
||||
gUnknown_2039A34: /* 2039A34 (code_809D148 / ground_script) */
|
||||
.space 0x2
|
||||
|
||||
gUnknown_2039A36: /* 2039A36 */
|
||||
gUnknown_2039A36: /* 2039A36 (code_809D148 / ground_script) */
|
||||
.space 0x2
|
||||
|
||||
gUnknown_2039A38: /* 2039A38 */
|
||||
gUnknown_2039A38: /* 2039A38 (code_809D148 / ground_script) */
|
||||
.space 0x88
|
||||
|
||||
gUnknown_2039AC0: /* 2039AC0 */
|
||||
gUnknown_2039AC0: /* 2039AC0 (code_809D148 / ground_script) */
|
||||
.space 0x88
|
||||
|
||||
gUnknown_2039B48: /* 2039B48 */
|
||||
gUnknown_2039B48: /* 2039B48 (code_809D148 / ground_script) */
|
||||
.space 0x208
|
||||
|
||||
gUnknown_2039D50: /* 2039D50 */
|
||||
gUnknown_2039D50: /* 2039D50 (ground_script) */
|
||||
.space 0x48
|
||||
|
||||
gUnknown_2039D98: /* 2039D98 (seems to be storage for strings.. used for both Team Name and Player Name) */
|
||||
gUnknown_2039D98: /* 2039D98 (ground_script) (seems to be storage for strings.. used for both Team Name and Player Name) */
|
||||
.space 0xC
|
||||
|
||||
gUnknown_2039DA4: /* 2039DA4 */
|
||||
gUnknown_2039DA4: /* 2039DA4 (ground_script) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_2039DA8: /* 2039DA8 */
|
||||
gUnknown_2039DA8: /* 2039DA8 (ground_script) */
|
||||
.space 0x8
|
||||
|
||||
gUnknown_2039DB0: /* 2039DB0 [unkStruct_2039DB0] */
|
||||
gUnknown_2039DB0: /* 2039DB0 (ground_sprite) [unkStruct_2039DB0] */
|
||||
.space 0x10
|
||||
|
||||
gUnknown_2039DC0: /* 2039DC0 [unkStruct_2039DB0] */
|
||||
gUnknown_2039DC0: /* 2039DC0 (ground_sprite) [unkStruct_2039DB0] */
|
||||
.space 0xC
|
||||
|
||||
gUnknown_2039DCC: /* 2039DCC */
|
||||
gUnknown_2039DCC: /* 2039DCC (ground_sprite) */
|
||||
.space 0x2
|
||||
|
||||
gUnknown_2039DCE: /* 2039DCE */
|
||||
gUnknown_2039DCE: /* 2039DCE (ground_sprite) */
|
||||
.space 0x2
|
||||
|
||||
gUnknown_2039DD0: /* 2039DD0 */
|
||||
gUnknown_2039DD0: /* 2039DD0 (ground_sprite) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_2039DD4: /* 2039DD4 */
|
||||
gUnknown_2039DD4: /* 2039DD4 (ground_sprite) */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_2039DD8: /* 2039DD8 */
|
||||
gUnknown_2039DD8: /* 2039DD8 (ground_sprite) */
|
||||
.space 0x8
|
||||
|
||||
.include "src/code_80A7714.o"
|
||||
.include "src/code_80A7714.o"
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
errno: /* 203B034 */
|
||||
.space 0x4
|
||||
|
||||
alt_203B038:
|
||||
|
||||
ewramClearEnd:
|
||||
gTitlePaletteFile: /* 203B038 */
|
||||
.space 0x4
|
||||
|
||||
@@ -137,35 +136,13 @@ gUnknown_203B200: /* 203B200 */
|
||||
.space 0x4
|
||||
|
||||
.include "src/felicity_bank.o"
|
||||
.include "src/kangaskhan_storage.o"
|
||||
|
||||
gKecleonBrosWork: /* 203B210 */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_203B214: /* 203B214 */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_203B218: /* 203B218 */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_203B21C: /* 203B21C */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_203B220: /* 203B220 */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_203B224: /* 203B224 */
|
||||
.space 0x4
|
||||
|
||||
gUnknown_203B228: /* 203B228 */
|
||||
.space 0x2
|
||||
|
||||
gUnknown_203B22A: /* 203B22A */
|
||||
.space 0x2
|
||||
|
||||
gUnknown_203B22C: /* 203B22C */
|
||||
.space 0x4
|
||||
|
||||
.include "src/kangaskhan_storage1.o"
|
||||
.include "src/kangaskhan_storage2.o"
|
||||
.include "src/kecleon_bros1.o"
|
||||
.include "src/kecleon_bros2.o"
|
||||
.include "src/kecleon_bros3.o"
|
||||
.include "src/kecleon_bros4.o"
|
||||
.include "src/code_801AFA4.o"
|
||||
.include "src/code_801B3C0.o"
|
||||
.include "src/code_801B60C.o"
|
||||
|
||||
|
||||
@@ -17,8 +17,7 @@ gUnknown_3001018: /* 3001018 */
|
||||
gUnknown_3001198: /* 3001198 */
|
||||
.space 0x9C0
|
||||
|
||||
alt_3001B58:
|
||||
|
||||
iwramClearEnd:
|
||||
unk_code_ram: /* 3001B58 */
|
||||
|
||||
gUnknown_3001B58: /* 3001B58 */
|
||||
|
||||
Reference in New Issue
Block a user