summaryrefslogtreecommitdiff
path: root/src/code_80118A4_1.c
blob: c2fa64125f62af7fc1b17fded5d5d6468968ce49 (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
#include "global.h"

extern u8 gUnknown_203B150;

void nullsub_199(void)
{
}

void nullsub_27(void)
{
}

void sub_8011B08(void)
{
    gUnknown_203B150 = 1;
}

void sub_8011B14(void)
{
    gUnknown_203B150 = 0;
}

#ifndef NONMATCHING
NAKED
#endif
u8 sub_8011B20(void)
{
#ifdef NONMATCHING
    // TODO figure out why I mix up my mv/ldr for these kinds of comparisons
    u8 temp;
    if(gUnknown_203B150 == 0)
    {
        temp = 1;
    }
    else
    {
        temp = 0;
    }
    gUnknown_203B150 = temp;
    return gUnknown_203B150;
#else
	asm_unified("\tpush {lr}\n"
	"\tldr r1, _08011B38\n"
	"\tmovs r2, 0\n"
	"\tldrb r0, [r1]\n"
	"\tcmp r0, 0\n"
	"\tbne _08011B2E\n"
	"\tmovs r2, 0x1\n"
"_08011B2E:\n"
	"\tstrb r2, [r1]\n"
	"\tldrb r0, [r1]\n"
	"\tpop {r1}\n"
	"\tbx r1\n"
	"\t.align 2, 0\n"
"_08011B38: .4byte gUnknown_203B150");
#endif
}

// unused
u8 sub_8011B3C(void)
{
    return gUnknown_203B150;
}

// unused
void nullsub_137(void)
{

}