Prepare learn_move for merge

This commit is contained in:
Diegoisawesome 2018-08-12 12:54:07 -07:00
parent a000eb4f36
commit 2dd5fc23d4
39 changed files with 875 additions and 1902 deletions

View File

@ -11771,7 +11771,7 @@ sub_81A070C: @ 81A070C
ldrsh r0, [r4, r1]
cmp r0, 0
bne _081A0730
bl ProcessMenuInputNoWrapAround
bl Menu_ProcessInputNoWrapAround
b _081A0734
.pool
_081A0730:

View File

@ -1635,7 +1635,7 @@ _0811AF86:
thumb_func_start sub_811AF8C
sub_811AF8C: @ 811AF8C
push {lr}
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r1, r0, 24
cmp r1, 0
@ -1684,7 +1684,7 @@ _0811AFE6:
thumb_func_start sub_811AFEC
sub_811AFEC: @ 811AFEC
push {r4,lr}
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r1, r0, 24
cmp r1, 0
@ -1727,7 +1727,7 @@ _0811B03A:
thumb_func_start sub_811B040
sub_811B040: @ 811B040
push {lr}
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r1, r0, 24
cmp r1, 0
@ -1832,7 +1832,7 @@ sub_811B0E8: @ 811B0E8
thumb_func_start sub_811B0F8
sub_811B0F8: @ 811B0F8
push {r4,lr}
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r1, r0, 24
cmp r1, 0

File diff suppressed because it is too large Load Diff

View File

@ -2740,7 +2740,7 @@ sub_81B1708: @ 81B1708
push {r4,lr}
lsls r0, 24
lsrs r4, r0, 24
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r1, r0, 24
cmp r1, 0
@ -4196,7 +4196,7 @@ sub_81B227C: @ 81B227C
push {r4,lr}
lsls r0, 24
lsrs r4, r0, 24
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r1, r0, 24
cmp r1, 0
@ -6692,7 +6692,7 @@ sub_81B3730: @ 81B3730
ldrb r0, [r0, 0x17]
cmp r0, 0x3
bhi _081B3774
bl ProcessMenuInputNoWrapAround_other
bl Menu_ProcessInputNoWrapAround_other
b _081B3778
.pool
_081B3774:
@ -8138,7 +8138,7 @@ sub_81B43DC: @ 81B43DC
push {r4-r6,lr}
lsls r0, 24
lsrs r4, r0, 24
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r1, r0, 24
cmp r1, 0
@ -8671,7 +8671,7 @@ sub_81B48DC: @ 81B48DC
muls r1, r0
ldr r0, =gPlayerParty
adds r4, r1, r0
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r1, r0, 24
cmp r1, 0
@ -8963,7 +8963,7 @@ sub_81B4BA0: @ 81B4BA0
push {r4,lr}
lsls r0, 24
lsrs r4, r0, 24
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r1, r0, 24
cmp r1, 0
@ -9069,7 +9069,7 @@ sub_81B4C94: @ 81B4C94
push {r7}
lsls r0, 24
lsrs r5, r0, 24
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r1, r0, 24
cmp r1, 0
@ -9877,7 +9877,7 @@ sub_81B5430: @ 81B5430
push {r4,lr}
lsls r0, 24
lsrs r4, r0, 24
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r1, r0, 24
cmp r1, 0
@ -10171,7 +10171,7 @@ sub_81B56D8: @ 81B56D8
push {r4,lr}
lsls r0, 24
lsrs r4, r0, 24
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r1, r0, 24
cmp r1, 0
@ -13156,7 +13156,7 @@ sub_81B7028: @ 81B7028
push {r4,lr}
lsls r0, 24
lsrs r4, r0, 24
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r1, r0, 24
cmp r1, 0
@ -13235,7 +13235,7 @@ sub_81B70B8: @ 81B70B8
ldr r3, =sub_81B70F0
ldrh r4, [r4, 0xE]
str r4, [sp]
bl sub_81BFA38
bl ShowSelectMovePokemonSummaryScreen
add sp, 0x4
pop {r4}
pop {r0}
@ -13458,7 +13458,7 @@ sub_81B72C8: @ 81B72C8
muls r1, r0
ldr r0, =gPlayerParty
adds r4, r1, r0
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r5, r0, 24
cmp r5, 0
@ -15240,7 +15240,7 @@ sub_81B82D4: @ 81B82D4
push {r4-r7,lr}
lsls r0, 24
lsrs r5, r0, 24
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r1, r0, 24
cmp r1, 0

View File

@ -3409,7 +3409,7 @@ _080C8F0C:
adds r0, 0x1
strb r0, [r1]
_080C8F22:
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r1, r0, 24
cmp r1, 0
@ -4133,7 +4133,7 @@ _080C9584:
b _080C9664
.pool
_080C95A4:
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r1, r0, 24
cmp r1, 0
@ -4927,7 +4927,7 @@ _080C9C78:
b _080C9CAA
.pool
_080C9C8C:
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r1, r0, 24
cmp r1, 0
@ -5058,7 +5058,7 @@ _080C9DAC:
b _080C9DE0
.pool
_080C9DC0:
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r1, r0, 24
cmp r1, 0

View File

@ -3040,7 +3040,7 @@ sub_81C5F68: @ 81C5F68
lsrs r0, 24
cmp r0, 0x1
beq _081C5FD0
bl ProcessMenuInputNoWrapAround
bl Menu_ProcessInputNoWrapAround
lsls r0, 24
asrs r4, r0, 24
movs r0, 0x2

View File

@ -2920,7 +2920,7 @@ _080170E0:
negs r0, r0
b _08017110
_080170F2:
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r1, r0, 24
movs r2, 0x80
@ -6278,7 +6278,7 @@ _08018BD6:
b _08018C3E
.pool
_08018BE4:
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r6, r0, 24
movs r1, 0x80
@ -28890,7 +28890,7 @@ _0802426A:
bl sub_8197930
b _080242D0
_08024270:
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r4, r0, 24
movs r0, 0x2
@ -47811,7 +47811,7 @@ _0802DA84:
thumb_func_start sub_802DA8C
sub_802DA8C: @ 802DA8C
push {lr}
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r0, 24
pop {r1}

View File

@ -327,7 +327,7 @@ _080E2090:
ldrsh r0, [r5, r1]
cmp r0, 0
bne _080E209E
bl ProcessMenuInputNoWrapAround
bl Menu_ProcessInputNoWrapAround
b _080E20A2
_080E209E:
bl ProcessMenuInput
@ -444,7 +444,7 @@ task_yes_no_maybe: @ 80E215C
b _080E21C4
.pool
_080E2180:
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r1, r0, 24
movs r0, 0x1

View File

@ -137,7 +137,7 @@ Task_ShopMenu: @ 80DFB88
lsls r0, 24
lsrs r4, r0, 24
adds r5, r4, 0
bl ProcessMenuInputNoWrapAround
bl Menu_ProcessInputNoWrapAround
lsls r0, 24
asrs r2, r0, 24
movs r0, 0x2

View File

@ -1581,7 +1581,7 @@ sub_812B158: @ 812B158
thumb_func_start sub_812B1B0
sub_812B1B0: @ 812B1B0
push {lr}
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r1, r0, 24
cmp r1, 0

View File

@ -3349,7 +3349,7 @@ sub_8078EF8: @ 8078EF8
sub_8078F50: @ 8078F50
push {lr}
sub sp, 0x4
bl ProcessMenuInputNoWrapAround
bl Menu_ProcessInputNoWrapAround
lsls r0, 24
asrs r0, 24
movs r1, 0x1
@ -3695,7 +3695,7 @@ _0807920E:
thumb_func_start sub_8079218
sub_8079218: @ 8079218
push {lr}
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r1, r0, 24
cmp r1, 0
@ -3797,7 +3797,7 @@ _080792D8:
thumb_func_start sub_80792E4
sub_80792E4: @ 80792E4
push {lr}
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
asrs r1, r0, 24
cmp r1, 0

View File

@ -900,7 +900,7 @@ sub_8166D44: @ 8166D44
thumb_func_start sub_8166DE4
sub_8166DE4: @ 8166DE4
push {r4,lr}
bl ProcessMenuInputNoWrap_
bl Menu_ProcessInputNoWrap_
lsls r0, 24
lsrs r4, r0, 24
asrs r1, r0, 24

View File

@ -1,93 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
gUnknown_085CE9F8:: @ 85CE9F8
.incbin "graphics/interface/ui_learn_move.gbapal"
gUnknown_085CEA18:: @ 85CEA18
.incbin "graphics/interface/ui_learn_move.4bpp"
gUnknown_085CEB98:: @ 85CEB98
.2byte 0
.2byte 0
.2byte 0
.2byte 0
.2byte 0x8000
.2byte 0
.2byte 0
.2byte 0
.2byte 0x4000
.2byte 0
.2byte 0
.2byte 0
gUnknown_085CEBB0:: @ 85CEBB0
obj_tiles gUnknown_085CEA18, 0x180, 0x1595
gUnknown_085CEBB8:: @ 85CEBB8
obj_pal gUnknown_085CE9F8, 0x1596
gUnknown_085CEBC0:: @ 85CEBC0
.byte 0
.byte 0x1B
.byte 16
.byte 1
.byte 0x75
.byte 16
.2byte 0xFFFF
.2byte 0xFFFF
.2byte 0x14CD
.2byte 0x14CD
.byte 0, 0
gUnknown_085CEBD0:: @ 85CEBD0
.byte 2
.byte 0xC0
.byte 8
.byte 3
.byte 0xC0
.byte 0x68
.2byte 0
.2byte 0
.2byte 0x1531
.2byte 0x1531
.byte 0, 0
gUnknown_085CEBE0:: @ 85CEBE0
.2byte 8
.2byte 5
.2byte 0xFFFF
.2byte 0
gUnknown_085CEBE8:: @ 85CEBE8
.2byte 9
.2byte 5
.2byte 0xFFFF
.2byte 0
gUnknown_085CEBF0:: @ 85CEBF0
.2byte 10
.2byte 5
.2byte 0xFFFF
.2byte 0
gUnknown_085CEBF8:: @ 85CEBF8
.2byte 11
.2byte 5
.2byte 0xFFFF
.2byte 0
gUnknown_085CEC00:: @ 85CEC00
.4byte gUnknown_085CEBE0
.4byte gUnknown_085CEBE8
.4byte gUnknown_085CEBF0
.4byte gUnknown_085CEBF8
gUnknown_085CEC10:: @ 85CEC10
spr_template 0x1595, 0x1596, gUnknown_085CEB98, gUnknown_085CEC00, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
gUnknown_085CEC28:: @ 85CEC28
.4byte 0x1F0
.4byte 0x11E1

View File

@ -38,7 +38,7 @@ FallarborTown_House2_EventScript_2013D6:: @ 82013D6
FallarborTown_House2_EventScript_20140C:: @ 820140C
msgbox FallarborTown_House2_Text_2015C3, 4
special sub_8160638
special TeachMoveTutorMove
waitstate
compare VAR_0x8004, 0
goto_eq FallarborTown_House2_EventScript_2013D6

View File

@ -235,7 +235,7 @@ gSpecials:: @ 81DBA64
def_special sub_81B9770
def_special sub_81B9718
def_special sub_81B96D0
def_special sub_8160638
def_special TeachMoveTutorMove
def_special GetRecordedCyclingRoadResults
def_special Special_BeginCyclingRoadChallenge
def_special GetPlayerAvatarBike

View File

@ -1,7 +1,7 @@
#ifndef GUARD_LEARN_MOVE_H
#define GUARD_LEARN_MOVE_H
void sub_8160624(void);
void sub_8160638(void);
void VBlankCB_LearnMove(void);
void TeachMoveTutorMove(void);
#endif //GUARD_LEARN_MOVE_H

View File

@ -1,6 +1,8 @@
#ifndef GUARD_LIST_MENU_H
#define GUARD_LIST_MENU_H
#include "window.h"
#define LIST_NOTHING_CHOSEN -1
#define LIST_B_PRESSED -2
#define LIST_HEADER -3

View File

@ -46,7 +46,7 @@ void PrintMenuTable(u8 windowId, u8 itemCount, const struct MenuAction *strs);
u8 InitMenuInUpperLeftCornerPlaySoundWhenAPressed(u8 windowId, u8 numItems, u8 initialCursorPos);
u8 GetMenuCursorPos(void);
s8 ProcessMenuInput(void);
s8 ProcessMenuInputNoWrapAround(void);
s8 Menu_ProcessInputNoWrapAround(void);
void blit_move_info_icon(u8 winId, u8 a2, u16 x, u16 y);
void reset_temp_tile_data_buffers(void);
void *decompress_and_copy_tile_data_to_vram(u8 bgId, const void *src, int size, u16 offset, u8 mode);
@ -54,7 +54,7 @@ bool8 free_temp_tile_data_buffers_if_possible(void);
struct WindowTemplate CreateWindowTemplate(u8, u8, u8, u8, u8, u8, u16);
void CreateYesNoMenu(const struct WindowTemplate *windowTemplate, u16 borderFirstTileNum, u8 borderPalette, u8 initialCursorPos);
void copy_decompressed_tile_data_to_vram_autofree(u8 bgId, const void *src, int size, u16 offset, u8 mode);
s8 ProcessMenuInputNoWrap_(void);
s8 Menu_ProcessInputNoWrap_(void);
s8 ProcessMenuInput_other(void);
void do_scheduled_bg_tilemap_copies_to_vram(void);
void clear_scheduled_bg_copies_to_vram(void);

View File

@ -2,5 +2,6 @@
#define GUARD_POKEMON_SUMMARY_SCREEN_H
void sub_81C4F98(u8, void(*)(void));
void ShowSelectMovePokemonSummaryScreen(void *a, u8 b, u8 c, void *d, u16 e);
#endif // GUARD_POKEMON_SUMMARY_SCREEN_H

View File

@ -22,6 +22,9 @@ void sub_81D1D04(u8);
bool8 sub_81D1C44(u8);
void sub_81D5FB4(u16*);
bool8 sub_81D4A58(struct EventObject*);
void sub_81D2BF4(u8 *);
u16 sub_81D2C3C(void);
void sub_81D2C50(void);
u8 sub_81D28C8(const struct ListMenuItem *items, u16 numChoices);
#endif //GUARD_POKENAV_H

View File

@ -762,4 +762,14 @@ extern const u8 gText_Winona[];
extern const u8 gText_Phoebe[];
extern const u8 gText_Glacia[];
extern const u8 gText_PkmnLearnedMove4[];
extern const u8 gText_PkmnTryingToLearnMove[];
extern const u8 gText_WhichMoveToForget2[];
extern const u8 gText_StopTryingToTeachMove[];
extern const u8 gText_12AndPoof[];
extern const u8 gText_PkmnForgotMoveAndLearnedNew[];
extern const u8 gText_TeachWhichMoveToPkmn[];
extern const u8 gText_GiveUpTeachingNewMove[];
extern const u8 gText_TeachX[];
#endif //GUARD_STRINGS_H

View File

@ -486,7 +486,6 @@ SECTIONS {
data/contest_ai.o(.rodata);
src/battle_controller_safari.o(.rodata);
data/battle_anim_815A0D4.o(.rodata);
data/learn_move.o(.rodata);
src/learn_move.o(.rodata);
src/roamer.o(.rodata);
data/battle_tower.o(.rodata);

View File

@ -55,7 +55,7 @@ extern const u8* const gBattleScriptsForMoveEffects[];
// functions
extern void sub_81A5718(u8 battlerId); // battle frontier 2
extern void sub_81A56B4(void); // battle frontier 2
extern void sub_81BFA38(struct Pokemon* party, u8 monPartyId, u8 monCount, void (*callback)(void), u16 move); // pokemon summary screen
extern void ShowSelectMovePokemonSummaryScreen(struct Pokemon* party, u8 monPartyId, u8 monCount, void (*callback)(void), u16 move); // pokemon summary screen
extern u8 sub_81C1B94(void); // pokemon summary screen
extern void sub_81D388C(struct Pokemon* mon, void* statStoreLocation); // pokenav.s
extern void sub_81D3640(u8 arg0, void* statStoreLocation1, void* statStoreLocation2, u8 arg3, u8 arg4, u8 arg5); // pokenav.s
@ -5732,7 +5732,7 @@ static void atk5A_yesnoboxlearnmove(void)
if (!gPaletteFade.active)
{
FreeAllWindowBuffers();
sub_81BFA38(gPlayerParty, gBattleStruct->expGetterMonId, gPlayerPartyCount - 1, ReshowBattleScreenAfterMenu, gMoveToLearn);
ShowSelectMovePokemonSummaryScreen(gPlayerParty, gBattleStruct->expGetterMonId, gPlayerPartyCount - 1, ReshowBattleScreenAfterMenu, gMoveToLearn);
gBattleScripting.learnMoveState++;
}
break;

View File

@ -2436,7 +2436,7 @@ static void CB2_HandleBlenderEndGame(void)
sBerryBlenderData->gameEndState++;
break;
case 10:
switch (ProcessMenuInputNoWrap_())
switch (Menu_ProcessInputNoWrap_())
{
case 1:
case -1:

View File

@ -86,7 +86,7 @@ static void Task_DoClearSaveDataScreenYesNo(u8 taskId)
static void Task_ClearSaveDataScreenYesNoChoice(u8 taskId)
{
switch(ProcessMenuInputNoWrap_())
switch(Menu_ProcessInputNoWrap_())
{
case 0:
FillWindowPixelBuffer(0, 17);

View File

@ -659,7 +659,7 @@ static void CB2_EggHatch_1(void)
}
break;
case 10:
switch (ProcessMenuInputNoWrap_())
switch (Menu_ProcessInputNoWrap_())
{
case 0:
GetMonNick(&gPlayerParty[sEggHatchData->eggPartyID], gStringVar3);

View File

@ -66,7 +66,7 @@ extern void sub_807F19C(void);
extern void sub_807B140(void);
extern void EvolutionRenameMon(struct Pokemon *mon, u16 oldSpecies, u16 newSpecies);
extern void Overworld_PlaySpecialMapMusic(void);
extern void sub_81BFA38(struct Pokemon *party, u8 monId, u8 partyCount, void *CB2_ptr, u16 move);
extern void ShowSelectMovePokemonSummaryScreen(struct Pokemon *party, u8 monId, u8 partyCount, void *CB2_ptr, u16 move);
extern u8 sub_81C1B94(void);
extern void sub_807F1A8(u8 arg0, const u8 *arg1, u8 arg2);
extern void sub_800E084(void);
@ -918,7 +918,7 @@ static void Task_EvolutionScene(u8 taskID)
if (!gPaletteFade.active)
{
FreeAllWindowBuffers();
sub_81BFA38(gPlayerParty, gTasks[taskID].tPartyID,
ShowSelectMovePokemonSummaryScreen(gPlayerParty, gTasks[taskID].tPartyID,
gPlayerPartyCount - 1, CB2_EvolutionSceneLoadGraphics,
gMoveToLearn);
gTasks[taskID].tLearnMoveState++;
@ -1222,7 +1222,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
}
break;
case 4:
switch (ProcessMenuInputNoWrap_())
switch (Menu_ProcessInputNoWrap_())
{
case 0:
sEvoCursorPos = 0;
@ -1252,7 +1252,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
Free(GetBgTilemapBuffer(0));
FreeAllWindowBuffers();
sub_81BFA38(gPlayerParty, gTasks[taskID].tPartyID,
ShowSelectMovePokemonSummaryScreen(gPlayerParty, gTasks[taskID].tPartyID,
gPlayerPartyCount - 1, CB2_TradeEvolutionSceneLoadGraphics,
gMoveToLearn);
gTasks[taskID].tLearnMoveState++;

View File

@ -1369,7 +1369,7 @@ void Task_HandleInBattleItemMenuInput(u8 taskId)
{
if (sub_81221EC() != TRUE)
{
s8 r4 = ProcessMenuInputNoWrapAround();
s8 r4 = Menu_ProcessInputNoWrapAround();
switch (r4)
{
case -2:

View File

@ -1,26 +1,219 @@
#include "global.h"
#include "main.h"
#include "task.h"
#include "script.h"
#include "sprite.h"
#include "palette.h"
#include "menu.h"
#include "menu_helpers.h"
#include "list_menu.h"
#include "malloc.h"
#include "field_screen.h"
#include "event_data.h"
#include "bg.h"
#include "data2.h"
#include "event_data.h"
#include "field_screen.h"
#include "gpu_regs.h"
#include "learn_move.h"
#include "list_menu.h"
#include "malloc.h"
#include "menu.h"
#include "menu_helpers.h"
#include "overworld.h"
#include "palette.h"
#include "pokemon_summary_screen.h"
#include "pokenav.h"
#include "script.h"
#include "sound.h"
#include "sprite.h"
#include "string_util.h"
#include "strings.h"
#include "task.h"
#include "constants/rgb.h"
#include "constants/songs.h"
EWRAM_DATA u8 *gUnknown_0203BC34 = 0;
EWRAM_DATA u8 gUnknown_0203BC38[8] = {0};
struct LearnMoveStruct
{
u8 state;
u8 spriteIds[16]; /*0x001*/
u8 filler11; /*0x011*/
u16 movesToLearn[4]; /*0x012*/
u8 filler1A[0x44 - 0x1A]; /*0x01A*/
u8 partyMon; /*0x044*/
u8 unk045; /*0x045*/
u8 filler46[2]; /*0x046*/
struct ListMenuItem menuItems[4]; /*0x048*/
u8 filler68[0x110 - 0x68]; /*0x068*/
u8 numMenuChoices; /*0x110*/
u8 unk111; /*0x111*/
u8 listMenuTask; /*0x112*/
u8 unk113; /*0x113*/
u8 unk114; /*0x114*/
u16 unk116; /*0x116*/
};
EWRAM_DATA struct LearnMoveStruct *sLearnMoveStruct = {0};
EWRAM_DATA struct {
u16 listOffset;
u16 listRow;
u8 showContestInfo;
} gUnknown_0203BC38 = {0};
extern void (*gFieldCallback)(void);
extern const struct SpritePalette gUnknown_085CEBB8;
extern const struct SpriteSheet gUnknown_085CEBB0;
extern const struct BgTemplate gUnknown_085CEC28;
const u16 gUnknown_085CE9F8[] = INCBIN_U16("graphics/interface/ui_learn_move.gbapal");
const u8 gUnknown_085CEA18[] = INCBIN_U8("graphics/interface/ui_learn_move.4bpp");
const struct OamData gUnknown_085CEB98 =
{
.y = 0,
.affineMode = 0,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = ST_OAM_4BPP,
.shape = ST_OAM_SQUARE,
.x = 0,
.matrixNum = 0,
.size = 0,
.tileNum = 0,
.priority = 0,
.paletteNum = 0,
.affineParam = 0,
};
const struct OamData gUnknown_085CEBA0 =
{
.y = 0,
.affineMode = 0,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = ST_OAM_4BPP,
.shape = ST_OAM_V_RECTANGLE,
.x = 0,
.matrixNum = 0,
.size = 0,
.tileNum = 0,
.priority = 0,
.paletteNum = 0,
.affineParam = 0,
};
const struct OamData gUnknown_085CEBA8 =
{
.y = 0,
.affineMode = 0,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = ST_OAM_4BPP,
.shape = ST_OAM_H_RECTANGLE,
.x = 0,
.matrixNum = 0,
.size = 0,
.tileNum = 0,
.priority = 0,
.paletteNum = 0,
.affineParam = 0,
};
const struct SpriteSheet gUnknown_085CEBB0 =
{
.data = gUnknown_085CEA18,
.size = 0x180,
.tag = 5525
};
const struct SpritePalette gUnknown_085CEBB8 =
{
.data = gUnknown_085CE9F8,
.tag = 5526
};
const struct ScrollArrowsTemplate gUnknown_085CEBC0 =
{
.firstArrowType = 0,
.firstX = 27,
.firstY = 16,
.secondArrowType = 1,
.secondX = 117,
.secondY = 16,
.fullyUpThreshold = -1,
.fullyDownThreshold = -1,
.tileTag = 5325,
.palTag = 5325,
.palNum = 0,
};
const struct ScrollArrowsTemplate gUnknown_085CEBD0 =
{
.firstArrowType = 2,
.firstX = 192,
.firstY = 8,
.secondArrowType = 3,
.secondX = 192,
.secondY = 104,
.fullyUpThreshold = 0,
.fullyDownThreshold = 0,
.tileTag = 5425,
.palTag = 5425,
.palNum = 0,
};
const union AnimCmd gUnknown_085CEBE0[] =
{
ANIMCMD_FRAME(8, 5, FALSE, FALSE),
ANIMCMD_END
};
const union AnimCmd gUnknown_085CEBE8[] =
{
ANIMCMD_FRAME(9, 5, FALSE, FALSE),
ANIMCMD_END
};
const union AnimCmd gUnknown_085CEBF0[] =
{
ANIMCMD_FRAME(10, 5, FALSE, FALSE),
ANIMCMD_END
};
const union AnimCmd gUnknown_085CEBF8[] =
{
ANIMCMD_FRAME(11, 5, FALSE, FALSE),
ANIMCMD_END
};
const union AnimCmd *const gUnknown_085CEC00[] =
{
gUnknown_085CEBE0,
gUnknown_085CEBE8,
gUnknown_085CEBF0,
gUnknown_085CEBF8,
};
const struct SpriteTemplate gUnknown_085CEC10 =
{
.tileTag = 5525,
.paletteTag = 5526,
.oam = &gUnknown_085CEB98,
.anims = gUnknown_085CEC00,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy
};
const struct BgTemplate gUnknown_085CEC28[] =
{
{
.bg = 0,
.charBaseIndex = 0,
.mapBaseIndex = 31,
.screenSize = 0,
.paletteMode = 0,
.priority = 0,
.baseTile = 0,
},
{
.bg = 1,
.charBaseIndex = 0,
.mapBaseIndex = 30,
.screenSize = 0,
.paletteMode = 0,
.priority = 1,
.baseTile = 0,
},
};
extern void sub_81D2824(u16);
void sub_8160868(void);
@ -29,111 +222,621 @@ void sub_81610B8(void);
void sub_816082C(void);
static void sub_8160664(u8 taskId);
void sub_81606A0(void); //CB2_InitLearnMove
void CB2_InitLearnMove(void);
void sub_8160740(void);
void sub_81607EC(void);
void sub_816082C(void);
void sub_8160624(void) //VBlankCB_LearnMove
void VBlankCB_LearnMove(void)
{
LoadOam();
ProcessSpriteCopyRequests();
TransferPlttBuffer();
LoadOam();
ProcessSpriteCopyRequests();
TransferPlttBuffer();
}
void sub_8160638(void) //TeachMoveTutorMove
void TeachMoveTutorMove(void)
{
ScriptContext2_Enable();
CreateTask(sub_8160664, 0xA);
BeginNormalPaletteFade(-1, 0, 0, 0x10, 0);
ScriptContext2_Enable();
CreateTask(sub_8160664, 0xA);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0);
}
void sub_8160664(u8 taskId)
{
if (!gPaletteFade.active)
{
SetMainCallback2(sub_81606A0);
gFieldCallback = sub_80AF168;
DestroyTask(taskId);
}
if (!gPaletteFade.active)
{
SetMainCallback2(CB2_InitLearnMove);
gFieldCallback = sub_80AF168;
DestroyTask(taskId);
}
}
// Doesn't match
void sub_81606A0(void) //CB2_InitLearnMove
void CB2_InitLearnMove(void)
{
ResetSpriteData();
FreeAllSpritePalettes();
ResetTasks();
clear_scheduled_bg_copies_to_vram();
ResetSpriteData();
FreeAllSpritePalettes();
ResetTasks();
clear_scheduled_bg_copies_to_vram();
sLearnMoveStruct = AllocZeroed(sizeof(struct LearnMoveStruct));
sLearnMoveStruct->partyMon = gSpecialVar_0x8004;
SetVBlankCallback(VBlankCB_LearnMove);
gUnknown_0203BC34 = AllocZeroed(0x118); //gUnknown_0203BC34 ?
gUnknown_0203BC34[68] = gSpecialVar_0x8004;
sub_81607EC();
sub_81D2824(0);
SetVBlankCallback(sub_8160624);
sub_81607EC();
sub_81D2824(0);
gUnknown_0203BC38.listOffset = 0;
gUnknown_0203BC38.listRow = 0;
gUnknown_0203BC38.showContestInfo = 0;
//gUnknown_0203BC38 ?
gUnknown_0203BC38[0] = 0;
gUnknown_0203BC38[2] = 0;
gUnknown_0203BC38[4] = 0;
sub_8161280();
sub_8161280();
LoadSpriteSheet(&gUnknown_085CEBB0);
LoadSpritePalette(&gUnknown_085CEBB8);
sub_81610B8();
LoadSpriteSheet(&gUnknown_085CEBB0);
LoadSpritePalette(&gUnknown_085CEBB8);
sub_81610B8();
gUnknown_0203BC34[274] = ListMenuInit(&gMultiuseListMenuTemplate, gUnknown_0203BC38[0], gUnknown_0203BC38[2]);
FillPalette(0, 0, 2);
SetMainCallback2(sub_816082C);
sLearnMoveStruct->listMenuTask = ListMenuInit(&gMultiuseListMenuTemplate, gUnknown_0203BC38.listOffset, gUnknown_0203BC38.listRow);
FillPalette(RGB_BLACK, 0, 2);
SetMainCallback2(sub_816082C);
}
// Doesn't match
void sub_8160740(void)
{
ResetSpriteData();
FreeAllSpritePalettes();
ResetTasks();
clear_scheduled_bg_copies_to_vram();
ResetSpriteData();
FreeAllSpritePalettes();
ResetTasks();
clear_scheduled_bg_copies_to_vram();
sLearnMoveStruct = AllocZeroed(sizeof(struct LearnMoveStruct));
sLearnMoveStruct->state = 28;
sLearnMoveStruct->partyMon = gSpecialVar_0x8004;
sLearnMoveStruct->unk045 = gSpecialVar_0x8005;
SetVBlankCallback(VBlankCB_LearnMove);
gUnknown_0203BC34 = AllocZeroed(0x118); //gUnknown_0203BC34 ?
gUnknown_0203BC34[68] = gSpecialVar_0x8004;
gUnknown_0203BC34[69] = gSpecialVar_0x8005;
sub_81607EC();
sub_81D2824(gUnknown_0203BC38.showContestInfo);
sub_8161280();
SetVBlankCallback(sub_8160624);
sub_81607EC();
LoadSpriteSheet(&gUnknown_085CEBB0);
LoadSpritePalette(&gUnknown_085CEBB8);
sub_81610B8();
//gUnknown_0203BC38 ?
sub_81D2824(gUnknown_0203BC38[4]);
sub_8161280();
LoadSpriteSheet(&gUnknown_085CEBB0);
LoadSpritePalette(&gUnknown_085CEBB8);
gUnknown_0203BC34[274] = ListMenuInit(&gMultiuseListMenuTemplate, gUnknown_0203BC38[0], gUnknown_0203BC38[2]);
FillPalette(0, 0, 2);
SetMainCallback2(sub_816082C);
sLearnMoveStruct->listMenuTask = ListMenuInit(&gMultiuseListMenuTemplate, gUnknown_0203BC38.listOffset, gUnknown_0203BC38.listRow);
FillPalette(RGB_BLACK, 0, 2);
SetMainCallback2(sub_816082C);
}
void sub_81607EC(void)
{
ResetVramOamAndBgCntRegs();
ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, &gUnknown_085CEC28, 2);
ResetAllBgsCoordinates();
SetGpuReg(0, 0x1040);
ShowBg(0);
ShowBg(1);
SetGpuReg(0x50, 0);
ResetVramOamAndBgCntRegs();
ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, gUnknown_085CEC28, 2);
ResetAllBgsCoordinates();
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 |
DISPCNT_OBJ_1D_MAP |
DISPCNT_OBJ_ON);
ShowBg(0);
ShowBg(1);
SetGpuReg(REG_OFFSET_BLDCNT, 0);
}
void sub_816082C(void)
{
sub_8160868();
RunTasks();
AnimateSprites();
BuildOamBuffer();
do_scheduled_bg_tilemap_copies_to_vram();
UpdatePaletteFade();
sub_8160868();
RunTasks();
AnimateSprites();
BuildOamBuffer();
do_scheduled_bg_tilemap_copies_to_vram();
UpdatePaletteFade();
}
void sub_816084C(const u8 *src)
{
StringExpandPlaceholders(gStringVar4, src);
sub_81D2BF4(gStringVar4);
}
void sub_81611AC(void);
void sub_8160F50(u8);
void sub_8161074(u8);
s32 sub_8161054(void);
void sub_8160EA0(void);
void sub_8161234(void);
void render_previous_quest_text(bool8);
void sub_8160868(void)
{
switch (sLearnMoveStruct->state)
{
case 0:
sLearnMoveStruct->state++;
render_previous_quest_text(FALSE);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
break;
case 1:
if (!gPaletteFade.active)
{
sLearnMoveStruct->state = 4;
}
break;
case 2:
sLearnMoveStruct->state++;
break;
case 3:
render_previous_quest_text(FALSE);
sLearnMoveStruct->state++;
sub_81611AC();
break;
case 4:
sub_8160F50(0);
return;
case 5:
sub_8161074(0);
sLearnMoveStruct->state++;
sub_81611AC();
break;
case 6:
sub_8160F50(1);
break;
case 8:
if (!sub_81D2C3C())
{
sub_81D2C50();
sLearnMoveStruct->state++;
}
break;
case 9:
{
s8 selection = Menu_ProcessInputNoWrap_();
if (selection == 0)
{
if (GiveMoveToMon(&gPlayerParty[sLearnMoveStruct->partyMon], sub_8161054()) != 0xFFFF)
{
sub_816084C(gText_PkmnLearnedMove4);
gSpecialVar_0x8004 = 1;
sLearnMoveStruct->state = 31;
}
else
{
sLearnMoveStruct->state = 16;
}
}
else if (selection == -1 || selection == 1)
{
if (gUnknown_0203BC38.showContestInfo == FALSE)
{
sLearnMoveStruct->state = 3;
}
else if (gUnknown_0203BC38.showContestInfo == TRUE)
{
sLearnMoveStruct->state = 5;
}
}
}
break;
case 12:
if (!sub_81D2C3C())
{
sub_81D2C50();
sLearnMoveStruct->state++;
}
break;
case 13:
{
s8 selection = Menu_ProcessInputNoWrap_();
if (selection == 0)
{
gSpecialVar_0x8004 = selection;
sLearnMoveStruct->state = 14;
}
else if (selection == -1 || selection == 1)
{
if (gUnknown_0203BC38.showContestInfo == FALSE)
{
sLearnMoveStruct->state = 3;
}
else if (gUnknown_0203BC38.showContestInfo == TRUE)
{
sLearnMoveStruct->state = 5;
}
}
}
break;
case 16:
sub_816084C(gText_PkmnTryingToLearnMove);
sLearnMoveStruct->state++;
break;
case 17:
if (!sub_81D2C3C())
{
sub_81D2C50();
sLearnMoveStruct->state = 18;
}
break;
case 18:
{
s8 var = Menu_ProcessInputNoWrap_();
if (var == 0)
{
sub_816084C(gText_WhichMoveToForget2);
sLearnMoveStruct->state = 19;
}
else if (var == -1 || var == 1)
{
sLearnMoveStruct->state = 24;
}
}
break;
case 24:
StringCopy(gStringVar2, gMoveNames[sub_8161054()]);
sub_816084C(gText_StopTryingToTeachMove);
sLearnMoveStruct->state++;
break;
case 25:
if (!sub_81D2C3C())
{
sub_81D2C50();
sLearnMoveStruct->state++;
}
break;
case 26:
{
s8 var = Menu_ProcessInputNoWrap_();
if (var == 0)
{
sLearnMoveStruct->state = 27;
}
else if (var == -1 || var == 1)
{
// What's the point? It gets set to 16, anyway.
if (gUnknown_0203BC38.showContestInfo == FALSE)
{
sLearnMoveStruct->state = 3;
}
else if (gUnknown_0203BC38.showContestInfo == TRUE)
{
sLearnMoveStruct->state = 5;
}
sLearnMoveStruct->state = 16;
}
}
break;
case 27:
if (!sub_81D2C3C())
{
FillWindowPixelBuffer(3, 0x11);
if (gUnknown_0203BC38.showContestInfo == FALSE)
{
sLearnMoveStruct->state = 3;
}
else if (gUnknown_0203BC38.showContestInfo == TRUE)
{
sLearnMoveStruct->state = 5;
}
}
break;
case 19:
if (!sub_81D2C3C())
{
sLearnMoveStruct->state = 20;
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
}
break;
case 20:
if (!gPaletteFade.active)
{
ShowSelectMovePokemonSummaryScreen(gPlayerParty, sLearnMoveStruct->partyMon, gPlayerPartyCount - 1, sub_8160740, sub_8161054());
sub_8160EA0();
}
break;
case 21:
if (!sub_81D2C3C())
{
sLearnMoveStruct->state = 14;
}
break;
case 22:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
break;
case 14:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
sLearnMoveStruct->state++;
break;
case 15:
if (!gPaletteFade.active)
{
sub_8160EA0();
SetMainCallback2(CB2_ReturnToField);
}
break;
case 28:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
sLearnMoveStruct->state++;
if (gUnknown_0203BC38.showContestInfo == FALSE)
{
render_previous_quest_text(TRUE);
}
else if (gUnknown_0203BC38.showContestInfo == TRUE)
{
sub_8161074(1);
}
sub_8161234();
CopyWindowToVram(3, 2);
break;
case 29:
if (!gPaletteFade.active)
{
if (sLearnMoveStruct->unk045 == 4)
{
sLearnMoveStruct->state = 24;
}
else
{
u16 moveId = GetMonData(&gPlayerParty[sLearnMoveStruct->partyMon], MON_DATA_MOVE1 + sLearnMoveStruct->unk045);
StringCopy(gStringVar3, gMoveNames[moveId]);
RemoveMonPPBonus(&gPlayerParty[sLearnMoveStruct->partyMon], sLearnMoveStruct->unk045);
SetMonMoveSlot(&gPlayerParty[sLearnMoveStruct->partyMon], sub_8161054(), sLearnMoveStruct->unk045);
StringCopy(gStringVar2, gMoveNames[sub_8161054()]);
sub_816084C(gText_12AndPoof);
sLearnMoveStruct->state = 30;
gSpecialVar_0x8004 = 1;
}
}
break;
case 30:
if (!sub_81D2C3C())
{
sub_816084C(gText_PkmnForgotMoveAndLearnedNew);
sLearnMoveStruct->state = 31;
PlayFanfare(MUS_FANFA1);
}
break;
case 31:
if (!sub_81D2C3C())
{
PlayFanfare(MUS_FANFA1);
sLearnMoveStruct->state = 32;
}
break;
case 32:
if (IsFanfareTaskInactive())
{
sLearnMoveStruct->state = 33;
}
break;
case 33:
if (gMain.newKeys & A_BUTTON)
{
PlaySE(SE_SELECT);
sLearnMoveStruct->state = 14;
}
break;
}
}
void sub_8160EA0(void)
{
sub_8161234();
DestroyListMenuTask(sLearnMoveStruct->listMenuTask, &gUnknown_0203BC38.listOffset, &gUnknown_0203BC38.listRow);
FreeAllWindowBuffers();
FREE_AND_SET_NULL(sLearnMoveStruct);
ResetSpriteData();
FreeAllSpritePalettes();
}
void render_previous_quest_text(bool8 a)
{
s32 i;
for (i = 0; i < 16; i++)
{
gSprites[sLearnMoveStruct->spriteIds[i]].invisible = TRUE;
}
if (!a)
{
StringExpandPlaceholders(gStringVar4, gText_TeachWhichMoveToPkmn);
FillWindowPixelBuffer(3, 0x11);
PrintTextOnWindow(3, 1, gStringVar4, 0, 1, 0, NULL);
}
}
void sub_816137C(s32);
void sub_8160F50(u8 a0)
{
s32 itemId = ListMenuHandleInputGetItemId(sLearnMoveStruct->listMenuTask);
ListMenuGetScrollAndRow(sLearnMoveStruct->listMenuTask, &gUnknown_0203BC38.listOffset, &gUnknown_0203BC38.listRow);
switch (itemId)
{
case LIST_NOTHING_CHOSEN:
if (!(gMain.newKeys & (DPAD_LEFT | DPAD_RIGHT)) && !GetLRKeysState())
{
break;
}
PlaySE(SE_SELECT);
if (a0 == 0)
{
PutWindowTilemap(1);
sLearnMoveStruct->state = 5;
gUnknown_0203BC38.showContestInfo = TRUE;
}
else
{
PutWindowTilemap(0);
sLearnMoveStruct->state = 3;
gUnknown_0203BC38.showContestInfo = FALSE;
}
schedule_bg_copy_tilemap_to_vram(1);
sub_816137C(sub_8161054());
break;
case LIST_B_PRESSED:
PlaySE(SE_SELECT);
sub_8161234();
sLearnMoveStruct->state = 12;
StringExpandPlaceholders(gStringVar4, gText_GiveUpTeachingNewMove);
sub_81D2BF4(gStringVar4);
break;
default:
PlaySE(SE_SELECT);
sub_8161234();
sLearnMoveStruct->state = 8;
StringCopy(gStringVar2, gMoveNames[itemId]);
StringExpandPlaceholders(gStringVar4, gText_TeachX);
sub_81D2BF4(gStringVar4);
break;
}
}
s32 sub_8161054(void)
{
return sLearnMoveStruct->menuItems[gUnknown_0203BC38.listRow + gUnknown_0203BC38.listOffset].id;
}
void sub_8161074(u8 a0)
{
if (!a0)
{
StringExpandPlaceholders(gStringVar4, gText_TeachWhichMoveToPkmn);
FillWindowPixelBuffer(3, 0x11);
PrintTextOnWindow(3, 1, gStringVar4, 0, 1, 0, NULL);
}
}
void sub_81610B8(void)
{
int i;
sLearnMoveStruct->unk114 = 0xFF;
sLearnMoveStruct->unk113 = -1;
sub_81611AC();
for (i = 0; i < 8; i++)
{
sLearnMoveStruct->spriteIds[i] = CreateSprite(&gUnknown_085CEC10, (i - (i / 4) * 4) * 8 + 104, (i / 4) * 8 + 36, 0);
}
for (i = 0; i < 8; i++)
{
sLearnMoveStruct->spriteIds[i + 8] = CreateSprite(&gUnknown_085CEC10, (i - (i / 4) * 4) * 8 + 104, (i / 4) * 8 + 52, 0);
StartSpriteAnim(&gSprites[sLearnMoveStruct->spriteIds[i + 8]], 2);
}
for (i = 0; i < 16; i++)
{
gSprites[sLearnMoveStruct->spriteIds[i]].invisible = TRUE;
}
}
void sub_81611AC(void)
{
if (sLearnMoveStruct->unk114 == 0xFF)
{
sLearnMoveStruct->unk114 = AddScrollIndicatorArrowPair(&gUnknown_085CEBC0, &sLearnMoveStruct->unk116);
}
if (sLearnMoveStruct->unk113 == 0xFF)
{
gTempScrollArrowTemplate = gUnknown_085CEBD0;
gTempScrollArrowTemplate.fullyDownThreshold = sLearnMoveStruct->numMenuChoices - sLearnMoveStruct->unk111;
sLearnMoveStruct->unk113 = AddScrollIndicatorArrowPair(&gTempScrollArrowTemplate, &gUnknown_0203BC38.listOffset);
}
}
void sub_8161234(void)
{
if (sLearnMoveStruct->unk114 != 0xFF)
{
RemoveScrollIndicatorArrowPair(sLearnMoveStruct->unk114);
sLearnMoveStruct->unk114 = 0xFF;
}
if (sLearnMoveStruct->unk113 != 0xFF)
{
RemoveScrollIndicatorArrowPair(sLearnMoveStruct->unk113);
sLearnMoveStruct->unk113 = 0xFF;
}
}
void sub_8161280(void)
{
s32 i;
u8 nickname[POKEMON_NAME_LENGTH + 1];
sLearnMoveStruct->numMenuChoices = GetMoveRelearnerMoves(&gPlayerParty[sLearnMoveStruct->partyMon], sLearnMoveStruct->movesToLearn);
for (i = 0; i < sLearnMoveStruct->numMenuChoices; i++)
{
sLearnMoveStruct->menuItems[i].name = gMoveNames[sLearnMoveStruct->movesToLearn[i]];
sLearnMoveStruct->menuItems[i].id = sLearnMoveStruct->movesToLearn[i];
}
GetMonData(&gPlayerParty[sLearnMoveStruct->partyMon], MON_DATA_NICKNAME, nickname);
StringCopy10(gStringVar1, nickname);
sLearnMoveStruct->menuItems[sLearnMoveStruct->numMenuChoices].name = gText_Cancel;
sLearnMoveStruct->menuItems[sLearnMoveStruct->numMenuChoices].id = LIST_B_PRESSED;
sLearnMoveStruct->numMenuChoices++;
sLearnMoveStruct->unk111 = sub_81D28C8(sLearnMoveStruct->menuItems, sLearnMoveStruct->numMenuChoices);
}
void sub_816137C(s32 item)
{
u16 i;
if (!gUnknown_0203BC38.showContestInfo || item == LIST_NOTHING_CHOSEN)
{
for (i = 0; i < 16; i++)
{
gSprites[sLearnMoveStruct->spriteIds[i]].invisible = TRUE;
}
}
else
{
u8 temp1 = gContestEffects[gContestMoves[item].effect].appeal / 10;
if (temp1 == 0xFF)
{
temp1 = 0;
}
for (i = 0; i < 8; i++)
{
if (i < temp1)
{
StartSpriteAnim(&gSprites[sLearnMoveStruct->spriteIds[i]], 1);
}
else
{
StartSpriteAnim(&gSprites[sLearnMoveStruct->spriteIds[i]], 0);
}
gSprites[sLearnMoveStruct->spriteIds[i]].invisible = FALSE;
}
temp1 = gContestEffects[gContestMoves[item].effect].jam / 10;
if (temp1 == 0xFF)
{
temp1 = 0;
}
for (i = 0; i < 8; i++)
{
if (i < temp1)
{
StartSpriteAnim(&gSprites[sLearnMoveStruct->spriteIds[i]], 3);
}
else
{
StartSpriteAnim(&gSprites[sLearnMoveStruct->spriteIds[i]], 2);
}
gSprites[sLearnMoveStruct->spriteIds[i]].invisible = FALSE;
}
}
}

View File

@ -1362,7 +1362,7 @@ void task_new_game_prof_birch_speech_part2_3(u8 taskId)
void task_new_game_prof_birch_speech_part2_4(u8 taskId)
{
switch (ProcessMenuInputNoWrap_())
switch (Menu_ProcessInputNoWrap_())
{
case 0:
PlaySE(SE_SELECT);
@ -1802,7 +1802,7 @@ void sub_8031D74(void)
s8 sub_8031DB4(void)
{
return ProcessMenuInputNoWrapAround();
return Menu_ProcessInputNoWrapAround();
}
void set_default_player_name(u8 nameId)

View File

@ -986,7 +986,7 @@ s8 ProcessMenuInput(void)
return MENU_NOTHING_CHOSEN;
}
s8 ProcessMenuInputNoWrapAround(void)
s8 Menu_ProcessInputNoWrapAround(void)
{
u8 oldPos = gUnknown_0203CD90.cursorPos;
@ -1044,7 +1044,7 @@ s8 ProcessMenuInput_other(void)
return MENU_NOTHING_CHOSEN;
}
s8 ProcessMenuInputNoWrapAround_other(void)
s8 Menu_ProcessInputNoWrapAround_other(void)
{
u8 oldPos = gUnknown_0203CD90.cursorPos;
@ -1187,9 +1187,9 @@ void sub_8198C34(const struct WindowTemplate *window, u8 fontId, u16 baseTileNum
sub_8198AF8(window, fontId, 0, 1, baseTileNum, paletteNum, 0);
}
s8 ProcessMenuInputNoWrap_(void)
s8 Menu_ProcessInputNoWrap_(void)
{
s8 result = ProcessMenuInputNoWrapAround();
s8 result = Menu_ProcessInputNoWrapAround();
if (result != MENU_NOTHING_CHOSEN)
sub_8198C78();
return result;

View File

@ -169,7 +169,7 @@ void CreateYesNoMenuWithCallbacks(u8 taskId, const struct WindowTemplate *templa
static void Task_CallYesOrNoCallback(u8 taskId)
{
switch (ProcessMenuInputNoWrap_())
switch (Menu_ProcessInputNoWrap_())
{
case 0:
PlaySE(SE_SELECT);

View File

@ -272,7 +272,7 @@ static void PlayerPCProcessMenuInput(u8 taskId)
if(gPcItemMenuOptionsNum > 3)
inputOptionId = ProcessMenuInput();
else
inputOptionId = ProcessMenuInputNoWrapAround();
inputOptionId = Menu_ProcessInputNoWrapAround();
switch(inputOptionId)
{
@ -686,7 +686,7 @@ static void Mailbox_DrawYesNoBeforeMove(u8 taskId)
static void Mailbox_MoveToBagYesNoPrompt(u8 taskId)
{
switch(ProcessMenuInputNoWrap_())
switch(Menu_ProcessInputNoWrap_())
{
case 0:
Mailbox_DoMailMoveToBag(taskId);

View File

@ -1042,7 +1042,7 @@ static void Task_HandlePokeblockOptionsInput(u8 taskId)
if (sub_81221EC() == TRUE)
return;
itemId = ProcessMenuInputNoWrapAround();
itemId = Menu_ProcessInputNoWrapAround();
if (itemId == MENU_NOTHING_CHOSEN)
{
return;

View File

@ -384,7 +384,7 @@ void sub_81BF8EC(u8 a, void *b, u8 c, u8 d, void *e)
SetMainCallback2(sub_81BFAE4);
}
void sub_81BFA38(void *a, u8 b, u8 c, void *d, u16 e)
void ShowSelectMovePokemonSummaryScreen(void *a, u8 b, u8 c, void *d, u16 e)
{
sub_81BF8EC(3, a, b, c, d);
gUnknown_0203CF1C->unk40C4 = e;

View File

@ -997,7 +997,7 @@ void sub_80E9FB0(u8 taskId)
{
s8 input;
input = ProcessMenuInputNoWrapAround();
input = Menu_ProcessInputNoWrapAround();
switch (input)
{
case -1:

View File

@ -985,7 +985,7 @@ static u8 SaveYesNoCallback(void)
static u8 SaveConfirmInputCallback(void)
{
switch (ProcessMenuInputNoWrap_())
switch (Menu_ProcessInputNoWrap_())
{
case 0: // Yes
switch (gSaveFileStatus)
@ -1045,7 +1045,7 @@ static u8 SaveConfirmOverwriteCallback(void)
static u8 SaveOverwriteInputCallback(void)
{
switch (ProcessMenuInputNoWrap_())
switch (Menu_ProcessInputNoWrap_())
{
case 0: // Yes
sSaveDialogCallback = SaveSavingMessageCallback;
@ -1169,7 +1169,7 @@ static u8 BattlePyramidRetireYesNoCallback(void)
static u8 BattlePyramidRetireInputCallback(void)
{
switch (ProcessMenuInputNoWrap_())
switch (Menu_ProcessInputNoWrap_())
{
case 0: // Yes
return SAVE_CANCELED;

View File

@ -258,7 +258,7 @@ static void Task_StarterChoose5(u8 taskId)
{
u8 spriteId;
switch (ProcessMenuInputNoWrap_())
switch (Menu_ProcessInputNoWrap_())
{
case 0: // YES
// Return the starter choice and exit.

View File

@ -763,7 +763,7 @@ static void Task_SetClock3(u8 taskId)
static void Task_SetClock4(u8 taskId)
{
switch (ProcessMenuInputNoWrap_())
switch (Menu_ProcessInputNoWrap_())
{
case 0:
PlaySE(SE_SELECT);