summaryrefslogtreecommitdiff
path: root/src/debug/unknown_debug_menu.c
blob: 787e456d216d745240091c1004afcb0319d1b016 (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
#include "global.h"
#include "battle_tower.h"
#include "menu.h"

extern u8 gBattleCommunication[];

extern u8 (*gMenuCallback)(void);

static u8 sub_814A4B8(void);
static u8 sub_814A464(void);

const u8 UnknownString_1stRound[] = _("1st round");
const u8 UnknownString_2ndRound[] = _("2nd round");
const u8 UnknownString_3rdRound[] = _("3rd round");
const u8 UnknownString_4thRound[] = _("4th round");
const u8 UnknownString_5thRound[] = _("5th round");
const u8 UnknownString_6thRound[] = _("6th round");
const u8 UnknownString_7thRound[] = _("7th round");
const u8 UnknownString_8thRound[] = _("8th round");


const struct MenuAction gUnknown_0842C29C[] = {
    {UnknownString_1stRound, sub_814A4B8},
    {UnknownString_2ndRound, sub_814A4B8},
    {UnknownString_3rdRound, sub_814A4B8},
    {UnknownString_4thRound, sub_814A4B8},
    {UnknownString_5thRound, sub_814A4B8},
    {UnknownString_6thRound, sub_814A4B8},
    {UnknownString_7thRound, sub_814A4B8},
    {UnknownString_8thRound, sub_814A4B8}
};

int InitSogabeDebugMenu(void)
{
    Menu_EraseScreen();
    Menu_DrawStdWindowFrame(0, 0, 16, 18);
    Menu_PrintItems(2, 1, 8, gUnknown_0842C29C);
    InitMenu(0, 1, 1, 8, 0, 15);
    gMenuCallback = sub_814A464;
    return 0;
}

static u8 sub_814A464(void)
{
    s8 result = Menu_ProcessInput();
    if (result == -2)
    {
        return 0;
    }
    else if (result == -1)
    {
        CloseMenu();
        return 1;
    }
    else
    {
        gBattleCommunication[0] = result;
        gMenuCallback = gUnknown_0842C29C[result].func;
        return 0;
    }
}

static u8 sub_814A4B8(void)
{
    gSaveBlock2.battleTower.var_4AE[0] = 3;
    gSaveBlock2.battleTower.var_4AE[1] = 3;
    gSaveBlock2.battleTower.curStreakChallengesNum[0] = gBattleCommunication[0] + 1;
    gSaveBlock2.battleTower.curStreakChallengesNum[1] = gBattleCommunication[0] + 1;
    gSaveBlock2.battleTower.curChallengeBattleNum[0] = 1;
    gSaveBlock2.battleTower.curChallengeBattleNum[1] = 1;
    CloseMenu();
    return 1;
}