summaryrefslogtreecommitdiff
path: root/src/pokemon_1.c
blob: ebb24d77d0a4cb7ff0f14691e2a9a5a6d5f66154 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include "global.h"
#include "pokemon.h"
#include "file_system.h"

extern int sprintf(char *, const char *, ...);

extern struct gPokemon *gMonsterParameters;
extern struct FileArchive gUnknown_8510000;
extern const char gUnknown_8107684[];

struct unkEvolve
{
    /* 0x0 */ struct EvolveStruct1 conditions;
    /* 0x4 */ struct EvolveNeeds needs;
};

s16 sub_808DD48(s16 r0, struct unkEvolve *r1)
{
    struct EvolveStruct1 temp2;
    struct EvolveNeeds temp1;
    temp1 = gMonsterParameters[r0].need;
    temp2 = gMonsterParameters[r0].pre;
    r1->conditions = temp2;
    r1->needs = temp1;
    // The return value is not used anywhere, but necessary for the function to match.
    return r0;
}

u8 sub_808DD68(s16 r0, u32 r1)
{
    // Had to have this cast to match
    u32 temp;
    temp = r0;
    if (r1 != 0)
    {
        return 0xA;
    }
    else 
    {
        return gMonsterParameters[temp].overworld_sprite;
    }
}

struct OpenedFile *sub_808DD90(s16 r0)
{
    // Looks like this loads the dialogue sprite for the pokemon

    char buffer[0xC];
    if(gMonsterParameters[r0].dialogue_sprites == 0)
    {
        return NULL;
    }
    sprintf(buffer, gUnknown_8107684, r0); // "kao%03d"
    return OpenFile(buffer, &gUnknown_8510000);
}

struct OpenedFile *sub_808DDD0(s16 r0)
{
    // Looks like this loads the dialogue sprite for the pokemon

    char buffer[0xC];
    if(gMonsterParameters[r0].dialogue_sprites == 0)
    {
        return NULL;
    }
    sprintf(buffer, gUnknown_8107684, r0); // "kao%03d"
    return OpenFileAndGetFileDataPtr(buffer, &gUnknown_8510000);
}

bool8 sub_808DE10(s16 r0, s32 r1)
{
    // checking to see if dialogue sprite is available??
    return (gMonsterParameters[r0].dialogue_sprites >> r1) & 1;
}