mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 19:47:35 +01:00
sub_8017EA0
This commit is contained in:
parent
bf4a73a67c
commit
8d75dc1982
140
asm/union_room.s
140
asm/union_room.s
@ -5,146 +5,6 @@
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_8017EA0
|
||||
sub_8017EA0: @ 8017EA0
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
adds r7, r0, 0
|
||||
adds r5, r2, 0
|
||||
adds r6, r3, 0
|
||||
movs r2, 0
|
||||
mov r8, r2
|
||||
ldrh r0, [r5]
|
||||
subs r0, 0x40
|
||||
cmp r0, 0x8
|
||||
bls _08017EBA
|
||||
b _08017FC6
|
||||
_08017EBA:
|
||||
lsls r0, 2
|
||||
ldr r1, =_08017EC8
|
||||
adds r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.pool
|
||||
.align 2, 0
|
||||
_08017EC8:
|
||||
.4byte _08017FBC
|
||||
.4byte _08017EEC
|
||||
.4byte _08017FC6
|
||||
.4byte _08017FC6
|
||||
.4byte _08017EFC
|
||||
.4byte _08017EF4
|
||||
.4byte _08017FC6
|
||||
.4byte _08017FC6
|
||||
.4byte _08017FAC
|
||||
_08017EEC:
|
||||
ldr r1, =gUnknown_082EE3DC
|
||||
b _08017FAE
|
||||
.pool
|
||||
_08017EF4:
|
||||
ldr r1, =gUnknown_082EE430
|
||||
b _08017FAE
|
||||
.pool
|
||||
_08017EFC:
|
||||
adds r0, r6, 0
|
||||
adds r0, 0x58
|
||||
ldr r4, =gUnknown_02022C40
|
||||
ldrh r1, [r4, 0xC]
|
||||
movs r2, 0
|
||||
movs r3, 0x3
|
||||
bl ConvertIntToDecimalStringN
|
||||
adds r0, r6, 0
|
||||
adds r0, 0x68
|
||||
ldrh r2, [r4, 0xA]
|
||||
movs r1, 0xB
|
||||
muls r1, r2
|
||||
ldr r2, =gSpeciesNames
|
||||
adds r1, r2
|
||||
bl StringCopy
|
||||
movs r4, 0
|
||||
b _08017F2E
|
||||
.pool
|
||||
_08017F2C:
|
||||
adds r4, 0x1
|
||||
_08017F2E:
|
||||
cmp r4, 0x3
|
||||
bgt _08017F64
|
||||
ldr r0, =gUnknown_03007890
|
||||
ldr r0, [r0]
|
||||
lsls r1, r4, 5
|
||||
adds r0, r1
|
||||
ldrh r0, [r0, 0x18]
|
||||
cmp r0, 0x2
|
||||
bne _08017F2C
|
||||
ldrh r1, [r5, 0x4]
|
||||
adds r0, r6, 0
|
||||
adds r0, 0x78
|
||||
movs r2, 0
|
||||
movs r3, 0x3
|
||||
bl ConvertIntToDecimalStringN
|
||||
ldrh r1, [r5, 0x2]
|
||||
movs r0, 0xB
|
||||
muls r1, r0
|
||||
ldr r0, =gSpeciesNames
|
||||
adds r1, r0
|
||||
adds r0, r6, 0
|
||||
adds r0, 0x88
|
||||
bl StringCopy
|
||||
ldrh r5, [r5, 0x2]
|
||||
mov r8, r5
|
||||
_08017F64:
|
||||
movs r0, 0xCE
|
||||
lsls r0, 1
|
||||
cmp r8, r0
|
||||
bne _08017F84
|
||||
ldr r1, =gUnknown_082EE4F0
|
||||
adds r0, r7, 0
|
||||
bl StringCopy
|
||||
b _08017FB4
|
||||
.pool
|
||||
_08017F84:
|
||||
movs r4, 0
|
||||
adds r5, r6, 0
|
||||
adds r5, 0x58
|
||||
_08017F8A:
|
||||
lsls r0, r4, 24
|
||||
lsrs r0, 24
|
||||
adds r1, r5, 0
|
||||
bl DynamicPlaceholderTextUtil_SetPlaceholderPtr
|
||||
adds r5, 0x10
|
||||
adds r4, 0x1
|
||||
cmp r4, 0x3
|
||||
ble _08017F8A
|
||||
ldr r1, =gUnknown_082EE47C
|
||||
adds r0, r7, 0
|
||||
bl DynamicPlaceholderTextUtil_ExpandPlaceholders
|
||||
b _08017FB4
|
||||
.pool
|
||||
_08017FAC:
|
||||
ldr r1, =gUnknown_082EE380
|
||||
_08017FAE:
|
||||
adds r0, r7, 0
|
||||
bl StringExpandPlaceholders
|
||||
_08017FB4:
|
||||
movs r2, 0x1
|
||||
b _08017FC6
|
||||
.pool
|
||||
_08017FBC:
|
||||
ldr r1, =gUnknown_082EE544
|
||||
adds r0, r7, 0
|
||||
bl StringExpandPlaceholders
|
||||
movs r2, 0x2
|
||||
_08017FC6:
|
||||
adds r0, r2, 0
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_8017EA0
|
||||
|
||||
thumb_func_start sub_8017FD8
|
||||
sub_8017FD8: @ 8017FD8
|
||||
push {lr}
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include "field_player_avatar.h"
|
||||
#include "strings.h"
|
||||
#include "mevent.h"
|
||||
#include "dynamic_placeholder_text_util.h"
|
||||
#include "rom_8011DC0.h"
|
||||
|
||||
EWRAM_DATA u8 gUnknown_02022C20[12] = {};
|
||||
@ -5093,3 +5094,59 @@ void sub_8017E00(u8 *dst, u8 arg1)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
s32 sub_8017EA0(u8 *dst, u32 gender, u16 *arg2, struct UnkStruct_URoom *arg3)
|
||||
{
|
||||
s32 result = 0;
|
||||
u16 species = SPECIES_NONE;
|
||||
s32 i;
|
||||
|
||||
switch (arg2[0])
|
||||
{
|
||||
case 0x41:
|
||||
StringExpandPlaceholders(dst, gUnknown_082EE3DC);
|
||||
result = 1;
|
||||
break;
|
||||
case 0x45:
|
||||
StringExpandPlaceholders(dst, gUnknown_082EE430);
|
||||
result = 1;
|
||||
break;
|
||||
case 0x44:
|
||||
ConvertIntToDecimalStringN(arg3->field_58 + 0x00, gUnknown_02022C40.field_C, STR_CONV_MODE_LEFT_ALIGN, 3);
|
||||
StringCopy(arg3->field_58 + 0x10, gSpeciesNames[gUnknown_02022C40.field_A]);
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (gUnknown_03007890->unk_14[i].unk_04 == 2)
|
||||
{
|
||||
ConvertIntToDecimalStringN(arg3->field_58 + 0x20, arg2[2], STR_CONV_MODE_LEFT_ALIGN, 3);
|
||||
StringCopy(arg3->field_58 + 0x30, gSpeciesNames[arg2[1]]);
|
||||
species = arg2[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (species == SPECIES_EGG)
|
||||
{
|
||||
StringCopy(dst, gUnknown_082EE4F0);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
DynamicPlaceholderTextUtil_SetPlaceholderPtr(i, arg3->field_58 + 0x10 * i);
|
||||
}
|
||||
DynamicPlaceholderTextUtil_ExpandPlaceholders(dst, gUnknown_082EE47C);
|
||||
}
|
||||
result = 1;
|
||||
break;
|
||||
case 0x48:
|
||||
StringExpandPlaceholders(dst, gUnknown_082EE380);
|
||||
result = 1;
|
||||
break;
|
||||
case 0x40:
|
||||
StringExpandPlaceholders(dst, gUnknown_082EE544);
|
||||
result = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user