mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-13 15:13:42 +01:00
Cleanup and one non-matching function
This commit is contained in:
parent
64683e1473
commit
44c1ea16b9
@ -169,41 +169,41 @@
|
||||
// .pool
|
||||
// thumb_func_end sub_81615A8
|
||||
|
||||
thumb_func_start sub_816166C
|
||||
sub_816166C: @ 816166C
|
||||
push {r4,r5,lr}
|
||||
sub sp, 0x4
|
||||
adds r4, r0, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
movs r0, 0x1
|
||||
bl PlaySE
|
||||
ldr r5, =gUnknown_0203CEC8
|
||||
movs r1, 0x9
|
||||
ldrsb r1, [r5, r1]
|
||||
movs r0, 0x64
|
||||
muls r0, r1
|
||||
ldr r1, =gPlayerParty
|
||||
adds r0, r1
|
||||
movs r1, 0x3A
|
||||
bl GetMonData
|
||||
movs r1, 0x5
|
||||
bl __udivsi3
|
||||
adds r3, r0, 0
|
||||
lsls r3, 16
|
||||
asrs r3, 16
|
||||
ldrb r1, [r5, 0xA]
|
||||
ldr r0, =sub_81616C0
|
||||
str r0, [sp]
|
||||
adds r0, r4, 0
|
||||
movs r2, 0x1
|
||||
bl sub_81B1F18
|
||||
add sp, 0x4
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_816166C
|
||||
// thumb_func_start sub_816166C
|
||||
//sub_816166C: @ 816166C
|
||||
// push {r4,r5,lr}
|
||||
// sub sp, 0x4
|
||||
// adds r4, r0, 0
|
||||
// lsls r4, 24
|
||||
// lsrs r4, 24
|
||||
// movs r0, 0x1
|
||||
// bl PlaySE
|
||||
// ldr r5, =gUnknown_0203CEC8
|
||||
// movs r1, 0x9
|
||||
// ldrsb r1, [r5, r1]
|
||||
// movs r0, 0x64
|
||||
// muls r0, r1
|
||||
// ldr r1, =gPlayerParty
|
||||
// adds r0, r1
|
||||
// movs r1, 0x3A
|
||||
// bl GetMonData
|
||||
// movs r1, 0x5
|
||||
// bl __udivsi3
|
||||
// adds r3, r0, 0
|
||||
// lsls r3, 16
|
||||
// asrs r3, 16
|
||||
// ldrb r1, [r5, 0xA]
|
||||
// ldr r0, =sub_81616C0
|
||||
// str r0, [sp]
|
||||
// adds r0, r4, 0
|
||||
// movs r2, 0x1
|
||||
// bl sub_81B1F18
|
||||
// add sp, 0x4
|
||||
// pop {r4,r5}
|
||||
// pop {r0}
|
||||
// bx r0
|
||||
// .pool
|
||||
// thumb_func_end sub_816166C
|
||||
|
||||
thumb_func_start sub_81616C0
|
||||
sub_81616C0: @ 81616C0
|
||||
|
@ -9,52 +9,10 @@
|
||||
#include "sprite.h"
|
||||
#include "strings.h"
|
||||
#include "task.h"
|
||||
//#include "ewram.h"
|
||||
|
||||
/*
|
||||
struct Struct2001000 {
|
||||
u8 unk0;
|
||||
u8 unk1;
|
||||
u8 unk2;
|
||||
u8 filler3[9];
|
||||
void *unkC;
|
||||
};
|
||||
|
||||
struct Struct201C000 {
|
||||
struct Pokemon *unk0;
|
||||
u8 filler4[1];
|
||||
u8 unk5;
|
||||
u16 unk6;
|
||||
u8 filler8[4];
|
||||
s32 unkC;
|
||||
void* unk10;
|
||||
u8 filler14[26];
|
||||
s16 unk2E;
|
||||
};
|
||||
|
||||
#if ENGLISH
|
||||
#define WINDOW_LEFT 3
|
||||
#define WINDOW_RIGHT 26
|
||||
#elif GERMAN
|
||||
#define WINDOW_LEFT 0
|
||||
#define WINDOW_RIGHT 29
|
||||
#endif
|
||||
*/
|
||||
/*
|
||||
// extern
|
||||
extern u8 gUnknown_0202E8F6;
|
||||
extern u8 gLastFieldPokeMenuOpened;
|
||||
extern u8 gUnknown_0202E8F4;
|
||||
|
||||
// Static
|
||||
static void sub_8133D50(u8 taskId);
|
||||
static void sub_8133E74(u8 taskId);
|
||||
static void sub_8133EB8(u8 taskId);
|
||||
static void sub_8133EF8(void);
|
||||
*/
|
||||
|
||||
void sub_816166C(u8 taskId);
|
||||
void sub_81617B8(u8 taskId);
|
||||
void sub_81616C0(u8 taskId);
|
||||
void sub_81B1F18(u8 taskId, u8 pokemonIdx, s8 a, s16 hp, TaskFunc func);
|
||||
|
||||
bool8 SetUpFieldMove_SoftBoiled(void)
|
||||
@ -108,84 +66,52 @@ void sub_81615A8(u8 taskId)
|
||||
sub_81B1F18(taskId, unk9, -1, GetMonData(&gPlayerParty[unk9], MON_DATA_MAX_HP)/5, sub_816166C);
|
||||
}
|
||||
|
||||
/*
|
||||
void sub_8133D28(u8 taskid) {
|
||||
EWRAM_1000.unkC = sub_8133D50;
|
||||
EWRAM_1B000_2.unk272 = 3;
|
||||
DoPokemonMenu_Switch(taskid);
|
||||
}
|
||||
|
||||
static void sub_8133D50(u8 taskId) {
|
||||
u8 unk1, unk2;
|
||||
u16 hp;
|
||||
struct Pokemon *pokemon;
|
||||
//struct Task *task;
|
||||
|
||||
struct Sprite *sprites = gSprites;
|
||||
|
||||
|
||||
unk1 = sprites[EWRAM_1000.unk1].data[0];
|
||||
unk2 = sprites[EWRAM_1000.unk2].data[0];
|
||||
|
||||
if (unk1 > 5 || unk2 > 5)
|
||||
{
|
||||
sub_806CD44(taskId);
|
||||
return;
|
||||
}
|
||||
|
||||
EWRAM_1C000.unk0 = &gPlayerParty[sprites[EWRAM_1000.unk2].data[0]];
|
||||
hp = GetMonData(EWRAM_1C000.unk0, MON_DATA_HP);
|
||||
|
||||
if (hp == 0 || unk1 == unk2 || GetMonData(EWRAM_1C000.unk0, MON_DATA_MAX_HP) == hp)
|
||||
{
|
||||
sub_8133EB8(taskId);
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef NONMATCHING
|
||||
void sub_816166C(u8 taskId)
|
||||
{
|
||||
PlaySE(SE_KAIFUKU);
|
||||
|
||||
EWRAM_1C000.unk5 = gSprites[EWRAM_1000.unk1].data[0];
|
||||
|
||||
pokemon = &gPlayerParty[EWRAM_1C000.unk5];
|
||||
EWRAM_1C000.unk0 = pokemon;
|
||||
EWRAM_1C000.unk6 = 0;
|
||||
EWRAM_1C000.unkC = -0x8000;
|
||||
EWRAM_1C000.unk10 = sub_8133EF8;
|
||||
|
||||
|
||||
gTasks[taskId].data[10] = GetMonData(EWRAM_1C000.unk0, MON_DATA_MAX_HP);
|
||||
gTasks[taskId].data[11] = GetMonData(EWRAM_1C000.unk0, MON_DATA_HP);
|
||||
gTasks[taskId].data[12] = gTasks[taskId].data[10] / 5;
|
||||
|
||||
sub_806D5A4();
|
||||
gTasks[taskId].func = sub_806FA18;
|
||||
EWRAM_1B000_2.unk282 = gTasks[taskId].data[11];
|
||||
sub_81B1F18(taskId, gUnknown_0203CEC8.unkA, 1, GetMonData(&gPlayerParty[gUnknown_0203CEC8.unk9], MON_DATA_MAX_HP)/5, sub_81616C0);
|
||||
}
|
||||
#else
|
||||
__attribute__((naked))
|
||||
void sub_816166C(u8 taskId)
|
||||
{
|
||||
asm(".syntax unified\n\
|
||||
push {r4,r5,lr}\n\
|
||||
sub sp, 0x4\n\
|
||||
adds r4, r0, 0\n\
|
||||
lsls r4, 24\n\
|
||||
lsrs r4, 24\n\
|
||||
movs r0, 0x1\n\
|
||||
bl PlaySE\n\
|
||||
ldr r5, =gUnknown_0203CEC8\n\
|
||||
movs r1, 0x9\n\
|
||||
ldrsb r1, [r5, r1]\n\
|
||||
movs r0, 0x64\n\
|
||||
muls r0, r1\n\
|
||||
ldr r1, =gPlayerParty\n\
|
||||
adds r0, r1\n\
|
||||
movs r1, 0x3A\n\
|
||||
bl GetMonData\n\
|
||||
movs r1, 0x5\n\
|
||||
bl __udivsi3\n\
|
||||
adds r3, r0, 0\n\
|
||||
lsls r3, 16\n\
|
||||
asrs r3, 16\n\
|
||||
ldrb r1, [r5, 0xA]\n\
|
||||
ldr r0, =sub_81616C0\n\
|
||||
str r0, [sp]\n\
|
||||
adds r0, r4, 0\n\
|
||||
movs r2, 0x1\n\
|
||||
bl sub_81B1F18\n\
|
||||
add sp, 0x4\n\
|
||||
pop {r4,r5}\n\
|
||||
pop {r0}\n\
|
||||
bx r0\n\
|
||||
.pool\n\
|
||||
.syntax divided\n");
|
||||
|
||||
static void sub_8133E74(u8 taskId) {
|
||||
if (gUnknown_0202E8F6)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MenuZeroFillWindowRect(WINDOW_LEFT, 14, WINDOW_RIGHT, 19);
|
||||
PrintPartyMenuPromptText(3, 0);
|
||||
gTasks[taskId].func = HandlePartyMenuSwitchPokemonInput;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void sub_8133EB8(u8 taskId) {
|
||||
gUnknown_0202E8F4 = 0;
|
||||
sub_806D5A4();
|
||||
sub_806E834(gOtherText_CantUseOnPoke, 1);
|
||||
gTasks[taskId].func = sub_8133E74;
|
||||
}
|
||||
|
||||
static void sub_8133EF8(void) {
|
||||
sub_806CCE4();
|
||||
EWRAM_1B000_2.unk261 = 2;
|
||||
DestroySprite(&gSprites[EWRAM_1000.unk1]);
|
||||
MenuZeroFillWindowRect(WINDOW_LEFT, 14, WINDOW_RIGHT, 19);
|
||||
PrintPartyMenuPromptText(0, 0);
|
||||
SwitchTaskToFollowupFunc(EWRAM_1000.unk0);
|
||||
}
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user