sub_020708D8

This commit is contained in:
PikalaxALT 2021-11-17 15:45:08 -05:00
parent e61678c4be
commit a471e082b5
6 changed files with 87 additions and 231 deletions

View File

@ -708,233 +708,6 @@ _021100E8:
.public GetExpByGrowthRateAndLevel
.public sub_02070560
thumb_func_start sub_020708D8
sub_020708D8: ; 0x020708D8
push {r3, r4, r5, r6, lr}
sub sp, #4
add r6, r1, #0
add r1, r3, #0
add r5, r0, #0
add r4, r2, #0
bl sub_02070438
ldr r1, _02070A60 ; =0x000001A5
cmp r5, r1
bgt _0207093E
bge _020709CC
add r2, r1, #0
sub r2, #0x46
cmp r5, r2
bgt _0207090E
sub r1, #0x46
cmp r5, r1
bge _020709E0
cmp r5, #0xac
bgt _02070908
bne _02070906
b _02070A32
_02070906:
b _02070A3E
_02070908:
cmp r5, #0xc9
beq _020709F4
b _02070A3E
_0207090E:
add r2, r1, #0
sub r2, #0x23
cmp r5, r2
bgt _0207091E
sub r1, #0x23
cmp r5, r1
beq _020709EA
b _02070A3E
_0207091E:
add r2, r1, #0
sub r2, #8
cmp r5, r2
bgt _0207093C
add r2, r1, #0
sub r2, #9
cmp r5, r2
blt _0207093C
add r2, r1, #0
sub r2, #9
cmp r5, r2
beq _020709A4
sub r1, #8
cmp r5, r1
beq _020709B0
_0207093C:
b _02070A3E
_0207093E:
add r2, r1, #0
add r2, #0x42
cmp r5, r2
bgt _0207096C
add r2, r1, #0
add r2, #0x42
cmp r5, r2
bge _02070A26
add r2, r1, #2
cmp r5, r2
bgt _02070964
add r2, r1, #1
cmp r5, r2
blt _02070A3E
beq _020709BC
add r1, r1, #2
cmp r5, r1
beq _020709C4
b _02070A3E
_02070964:
add r1, #0x3a
cmp r5, r1
beq _02070A1A
b _02070A3E
_0207096C:
add r2, r1, #0
add r2, #0x47
cmp r5, r2
bgt _0207097C
add r1, #0x47
cmp r5, r1
beq _02070A0E
b _02070A3E
_0207097C:
add r2, r1, #0
add r2, #0x4a
cmp r5, r2
bgt _02070A3E
add r2, r1, #0
add r2, #0x48
cmp r5, r2
blt _02070A3E
add r2, r1, #0
add r2, #0x48
cmp r5, r2
beq _020709D4
add r2, r1, #0
add r2, #0x49
cmp r5, r2
beq _02070A00
add r1, #0x4a
cmp r5, r1
beq _02070A08
b _02070A3E
_020709A4:
lsr r2, r4, #1
add r2, #0x48
lsl r0, r0, #1
mov r1, #0x75
add r2, r2, r0
b _02070A50
_020709B0:
lsr r2, r4, #1
add r2, #0x4e
lsl r0, r0, #1
mov r1, #0x75
add r2, r2, r0
b _02070A50
_020709BC:
add r4, #0x54
mov r1, #0x75
add r2, r4, r0
b _02070A50
_020709C4:
add r4, #0x58
mov r1, #0x75
add r2, r4, r0
b _02070A50
_020709CC:
add r4, #0x5c
mov r1, #0x75
add r2, r4, r0
b _02070A50
_020709D4:
lsr r2, r4, #1
add r2, #0x60
lsl r0, r0, #1
mov r1, #0x75
add r2, r2, r0
b _02070A50
_020709E0:
lsl r2, r4, #1
add r2, #0x40
mov r1, #0x75
add r2, r0, r2
b _02070A50
_020709EA:
lsr r2, r4, #1
lsl r0, r0, #1
mov r1, #0x75
add r2, r2, r0
b _02070A50
_020709F4:
lsr r2, r4, #1
add r2, #8
lsl r0, r0, #1
mov r1, #0x75
add r2, r2, r0
b _02070A50
_02070A00:
add r2, r0, #0
mov r1, #0x75
add r2, #0x84
b _02070A50
_02070A08:
mov r1, #0x75
mov r2, #0x84
b _02070A50
_02070A0E:
lsr r2, r4, #1
add r2, #0x88
lsl r0, r0, #1
mov r1, #0x75
add r2, r2, r0
b _02070A50
_02070A1A:
lsr r2, r4, #1
add r2, #0x8c
lsl r0, r0, #1
mov r1, #0x75
add r2, r2, r0
b _02070A50
_02070A26:
lsr r2, r4, #1
add r2, #0x98
lsl r0, r0, #1
mov r1, #0x75
add r2, r2, r0
b _02070A50
_02070A32:
lsr r2, r4, #1
add r2, #0x9c
lsl r0, r0, #1
mov r1, #0x75
add r2, r2, r0
b _02070A50
_02070A3E:
mov r1, #5
cmp r6, #1
beq _02070A48
mov r2, #1
b _02070A4A
_02070A48:
mov r2, #0
_02070A4A:
lsl r0, r5, #2
add r0, r4, r0
add r2, r0, r2
_02070A50:
add r0, sp, #0
bl ReadWholeNarcMemberByIdPair
add r0, sp, #0
ldrb r0, [r0]
add sp, #4
pop {r3, r4, r5, r6, pc}
nop
_02070A60: .word 0x000001A5
thumb_func_end sub_020708D8
thumb_func_start sub_02070A64
sub_02070A64: ; 0x02070A64
push {r3, r4, r5, r6, lr}

5
files/.gitignore vendored
View File

@ -1,3 +1,5 @@
a/0/0/3
a/0/0/4
a/0/1/2
a/0/1/6
a/0/1/7
@ -6,6 +8,7 @@ a/0/2/7
a/0/3/7
a/0/7/4
a/0/7/5
a/1/1/4
a/1/3/3
a/1/3/6
a/1/3/8
@ -19,5 +22,3 @@ data/gs_areawindow.narc
itemtool/itemdata/item_icon.narc
itemtool/itemdata/item_data.narc
poketool/personal/growtbl.narc
poketool/pokegra/pokegra.narc
poketool/pokegra/otherpoke.narc

View File

@ -10,7 +10,7 @@ typedef enum NarcId
NARC_a_0_0_2,
NARC_poketool_personal_growtbl,
NARC_poketool_pokegra_pokegra,
NARC_a_0_0_5,
NARC_poketool_pokegra_height,
NARC_a_0_0_6,
NARC_a_0_0_7,
NARC_a_0_0_8,
@ -122,7 +122,7 @@ typedef enum NarcId
NARC_poketool_pokegra_otherpoke,
NARC_a_1_1_5,
NARC_a_1_1_6,
NARC_a_1_1_7,
NARC_poketool_pokegra_height_0,
NARC_a_1_1_8,
NARC_a_1_1_9,
NARC_a_1_2_0,

View File

@ -2412,3 +2412,85 @@ u8 sub_02070854(BOXMON *boxmon, u8 whichFacing, BOOL a2) {
return sub_020708D8(species, gender, whichFacing, forme, pid);
}
}
u8 sub_020708D8(u16 species, u8 gender, u8 whichFacing, u8 forme, u32 pid) {
// species -> r5
// gender -> r6
// whichFacing -> r4
// forme -> <overwrittten>
// pid -> sp18
#pragma unused(pid)
NarcId narcId;
s32 fileId;
u8 ret;
forme = sub_02070438(species, forme);
switch (species) {
case SPECIES_BURMY:
narcId = NARC_poketool_pokegra_height_0;
fileId = 0x48 + whichFacing / 2 + forme * 2;
break;
case SPECIES_WORMADAM:
narcId = NARC_poketool_pokegra_height_0;
fileId = 0x4E + whichFacing / 2 + forme * 2;
break;
case SPECIES_SHELLOS:
narcId = NARC_poketool_pokegra_height_0;
fileId = 0x54 + whichFacing + forme;
break;
case SPECIES_GASTRODON:
narcId = NARC_poketool_pokegra_height_0;
fileId = 0x58 + whichFacing + forme;
break;
case SPECIES_CHERRIM:
narcId = NARC_poketool_pokegra_height_0;
fileId = 0x5C + whichFacing + forme;
break;
case SPECIES_ARCEUS:
narcId = NARC_poketool_pokegra_height_0;
fileId = 0x60 + whichFacing / 2 + forme * 2;
break;
case SPECIES_CASTFORM:
narcId = NARC_poketool_pokegra_height_0;
fileId = 0x40 + 2 * whichFacing + forme;
break;
case SPECIES_DEOXYS:
narcId = NARC_poketool_pokegra_height_0;
fileId = 0x00 + whichFacing / 2 + forme * 2;
break;
case SPECIES_UNOWN:
narcId = NARC_poketool_pokegra_height_0;
fileId = 0x08 + whichFacing / 2 + forme * 2;
break;
case SPECIES_EGG: // egg, manaphy egg
narcId = NARC_poketool_pokegra_height_0;
fileId = 0x84 + forme;
break;
case SPECIES_MANAPHY_EGG: // bad egg
narcId = NARC_poketool_pokegra_height_0;
fileId = 0x84;
break;
case SPECIES_SHAYMIN: // land, sky
narcId = NARC_poketool_pokegra_height_0;
fileId = 0x88 + whichFacing / 2 + forme * 2;
break;
case SPECIES_ROTOM: // normal, fan, mow, wash, heat, frost
narcId = NARC_poketool_pokegra_height_0;
fileId = 0x8C + whichFacing / 2 + forme * 2;
break;
case SPECIES_GIRATINA: // altered, origin
narcId = NARC_poketool_pokegra_height_0;
fileId = 0x98 + whichFacing / 2 + forme * 2;
break;
case SPECIES_PICHU: // spiky-ear
narcId = NARC_poketool_pokegra_height_0;
fileId = 0x9C + whichFacing / 2 + forme * 2;
break;
default:
narcId = NARC_poketool_pokegra_height;
fileId = species * 4 + whichFacing + (gender != MON_FEMALE ? 1 : 0);
break;
}
ReadWholeNarcMemberByIdPair(&ret, narcId, fileId);
return ret;
}