summaryrefslogtreecommitdiff
path: root/src/code_809447C.c
blob: 816bf78654e2912a99f32f03b59efe24099c14a6 (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
#include "global.h"
#include "code_8092334.h"
#include "item.h"
#include "moves.h"

struct unkStruct_8113080
{
    u8 unk0;
    u8 *unk4; // some string
};

extern u8 gUnknown_202DE58[];
extern u8 gAvailablePokemonNames[];
extern u8 *gUnknown_811383C[];
extern struct unkStruct_8113080 gUnknown_8113080[];

struct unkStruct_80928C0
{
    u32 unk0;
    s32 unk4;
    u8 unk8;
    u8 unk9;
};

void sub_80928C0(u8 *buffer, struct PokemonMove *move, struct unkStruct_80928C0 *param_3);
extern void xxx_format_string(const char *, u8 *, void *, u32);

void sub_809447C(struct unkStruct_8094924 *r0, u8 *r1)
{
    RestoreIntegerBits(r0, r1, 0x10);
    RestoreIntegerBits(r0, r1 + 2, 0x10);
}

void sub_809449C(struct unkStruct_8094924 *r0, u8 *r1)
{
    SaveIntegerBits(r0, r1, 0x10);
    SaveIntegerBits(r0, r1 + 2, 0x10);
}

void sub_80944BC(s16 moveID, u8 *arg2)
{
    u16 moveID_u16;
    s32 moveID_s32 = moveID;
    struct PokemonMove stack;

    if (moveID_s32 < 0x1F4) {
        // Needed this cast/variable to match
        moveID_u16 = moveID_s32;
        sub_8092AA8(&stack, moveID_u16);
        sub_80928C0(gUnknown_202DE58, &stack, NULL);
        xxx_format_string(*gUnknown_811383C, arg2, arg2 + 200, 0);
    } else {
        strncpy(arg2, gUnknown_8113080[moveID - 0x1F4].unk4, 200);
    }
}

u8 sub_8094528(s16 moveID)
{
    if(moveID < 0x1F4)
    {
        return 1;
    }
    else
    {
        return gUnknown_8113080[moveID  - 0x1F4].unk0;
    }
}