Merge branch 'learn_move' of git://github.com/Edwearth/pokeemerald into Edwearth-learn_move

This commit is contained in:
Diegoisawesome 2018-08-11 19:03:38 -07:00
commit a000eb4f36
6 changed files with 167 additions and 10 deletions

View File

@ -5,6 +5,7 @@
.text .text
/*
thumb_func_start sub_8160624 thumb_func_start sub_8160624
sub_8160624: @ 8160624 sub_8160624: @ 8160624
push {lr} push {lr}
@ -14,7 +15,9 @@ sub_8160624: @ 8160624
pop {r0} pop {r0}
bx r0 bx r0
thumb_func_end sub_8160624 thumb_func_end sub_8160624
*/
/*
thumb_func_start sub_8160638 thumb_func_start sub_8160638
sub_8160638: @ 8160638 sub_8160638: @ 8160638
push {lr} push {lr}
@ -35,7 +38,9 @@ sub_8160638: @ 8160638
bx r0 bx r0
.pool .pool
thumb_func_end sub_8160638 thumb_func_end sub_8160638
*/
/*
thumb_func_start sub_8160664 thumb_func_start sub_8160664
sub_8160664: @ 8160664 sub_8160664: @ 8160664
push {r4,lr} push {r4,lr}
@ -60,7 +65,9 @@ _08160688:
bx r0 bx r0
.pool .pool
thumb_func_end sub_8160664 thumb_func_end sub_8160664
*/
/*
thumb_func_start sub_81606A0 thumb_func_start sub_81606A0
sub_81606A0: @ 81606A0 sub_81606A0: @ 81606A0
push {r4-r6,lr} push {r4-r6,lr}
@ -100,8 +107,8 @@ sub_81606A0: @ 81606A0
bl ListMenuInit bl ListMenuInit
ldr r1, [r6] ldr r1, [r6]
movs r2, 0x89 movs r2, 0x89
lsls r2, 1 lsls r2, 1 //0x112
adds r1, r2 adds r1, r2 //partymon + 0x112
strb r0, [r1] strb r0, [r1]
movs r0, 0 movs r0, 0
movs r1, 0 movs r1, 0
@ -114,7 +121,9 @@ sub_81606A0: @ 81606A0
bx r0 bx r0
.pool .pool
thumb_func_end sub_81606A0 thumb_func_end sub_81606A0
*/
/*
thumb_func_start sub_8160740 thumb_func_start sub_8160740
sub_8160740: @ 8160740 sub_8160740: @ 8160740
push {r4,r5,lr} push {r4,r5,lr}
@ -171,7 +180,9 @@ sub_8160740: @ 8160740
bx r0 bx r0
.pool .pool
thumb_func_end sub_8160740 thumb_func_end sub_8160740
*/
/*
thumb_func_start sub_81607EC thumb_func_start sub_81607EC
sub_81607EC: @ 81607EC sub_81607EC: @ 81607EC
push {lr} push {lr}
@ -198,7 +209,9 @@ sub_81607EC: @ 81607EC
bx r0 bx r0
.pool .pool
thumb_func_end sub_81607EC thumb_func_end sub_81607EC
*/
/*
thumb_func_start sub_816082C thumb_func_start sub_816082C
sub_816082C: @ 816082C sub_816082C: @ 816082C
push {lr} push {lr}
@ -211,6 +224,7 @@ sub_816082C: @ 816082C
pop {r0} pop {r0}
bx r0 bx r0
thumb_func_end sub_816082C thumb_func_end sub_816082C
*/
thumb_func_start sub_816084C thumb_func_start sub_816084C
sub_816084C: @ 816084C sub_816084C: @ 816084C

BIN
graphics/pokedex/arrows.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

7
include/learn_move.h Normal file
View File

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

View File

@ -204,6 +204,7 @@ SECTIONS {
src/battle_controller_safari.o(.text); src/battle_controller_safari.o(.text);
src/fldeff_sweetscent.o(.text); src/fldeff_sweetscent.o(.text);
asm/battle_anim_815A0D4.o(.text); asm/battle_anim_815A0D4.o(.text);
src/learn_move.o(.text);
asm/learn_move.o(.text); asm/learn_move.o(.text);
src/fldeff_softboiled.o(.text); src/fldeff_softboiled.o(.text);
src/decoration_inventory.o(.text); src/decoration_inventory.o(.text);
@ -486,6 +487,7 @@ SECTIONS {
src/battle_controller_safari.o(.rodata); src/battle_controller_safari.o(.rodata);
data/battle_anim_815A0D4.o(.rodata); data/battle_anim_815A0D4.o(.rodata);
data/learn_move.o(.rodata); data/learn_move.o(.rodata);
src/learn_move.o(.rodata);
src/roamer.o(.rodata); src/roamer.o(.rodata);
data/battle_tower.o(.rodata); data/battle_tower.o(.rodata);
src/use_pokeblock.o(.rodata); src/use_pokeblock.o(.rodata);

139
src/learn_move.c Normal file
View File

@ -0,0 +1,139 @@
#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 "gpu_regs.h"
#include "learn_move.h"
EWRAM_DATA u8 *gUnknown_0203BC34 = 0;
EWRAM_DATA u8 gUnknown_0203BC38[8] = {0};
extern void (*gFieldCallback)(void);
extern const struct SpritePalette gUnknown_085CEBB8;
extern const struct SpriteSheet gUnknown_085CEBB0;
extern const struct BgTemplate gUnknown_085CEC28;
extern void sub_81D2824(u16);
void sub_8160868(void);
void sub_8161280(void);
void sub_81610B8(void);
void sub_816082C(void);
static void sub_8160664(u8 taskId);
void sub_81606A0(void); //CB2_InitLearnMove
void sub_8160740(void);
void sub_81607EC(void);
void sub_816082C(void);
void sub_8160624(void) //VBlankCB_LearnMove
{
LoadOam();
ProcessSpriteCopyRequests();
TransferPlttBuffer();
}
void sub_8160638(void) //TeachMoveTutorMove
{
ScriptContext2_Enable();
CreateTask(sub_8160664, 0xA);
BeginNormalPaletteFade(-1, 0, 0, 0x10, 0);
}
void sub_8160664(u8 taskId)
{
if (!gPaletteFade.active)
{
SetMainCallback2(sub_81606A0);
gFieldCallback = sub_80AF168;
DestroyTask(taskId);
}
}
// Doesn't match
void sub_81606A0(void) //CB2_InitLearnMove
{
ResetSpriteData();
FreeAllSpritePalettes();
ResetTasks();
clear_scheduled_bg_copies_to_vram();
gUnknown_0203BC34 = AllocZeroed(0x118); //gUnknown_0203BC34 ?
gUnknown_0203BC34[68] = gSpecialVar_0x8004;
SetVBlankCallback(sub_8160624);
sub_81607EC();
sub_81D2824(0);
//gUnknown_0203BC38 ?
gUnknown_0203BC38[0] = 0;
gUnknown_0203BC38[2] = 0;
gUnknown_0203BC38[4] = 0;
sub_8161280();
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);
}
// Doesn't match
void sub_8160740(void)
{
ResetSpriteData();
FreeAllSpritePalettes();
ResetTasks();
clear_scheduled_bg_copies_to_vram();
gUnknown_0203BC34 = AllocZeroed(0x118); //gUnknown_0203BC34 ?
gUnknown_0203BC34[68] = gSpecialVar_0x8004;
gUnknown_0203BC34[69] = gSpecialVar_0x8005;
SetVBlankCallback(sub_8160624);
sub_81607EC();
//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);
}
void sub_81607EC(void)
{
ResetVramOamAndBgCntRegs();
ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, &gUnknown_085CEC28, 2);
ResetAllBgsCoordinates();
SetGpuReg(0, 0x1040);
ShowBg(0);
ShowBg(1);
SetGpuReg(0x50, 0);
}
void sub_816082C(void)
{
sub_8160868();
RunTasks();
AnimateSprites();
BuildOamBuffer();
do_scheduled_bg_tilemap_copies_to_vram();
UpdatePaletteFade();
}

View File

@ -660,12 +660,7 @@ gUnknown_0203ABB8: @ 203ABB8
.include "src/mystery_event_script.o" .include "src/mystery_event_script.o"
gUnknown_0203BC34: @ 203BC34 .include "src/learn_move.o"
.space 0x4
gUnknown_0203BC38: @ 203BC38
.space 0x8
.include "src/decoration_inventory.o" .include "src/decoration_inventory.o"
.include "src/roamer.o" .include "src/roamer.o"