summaryrefslogtreecommitdiff
path: root/GameCube/source/main.cpp
blob: f4374ec80af5c576c90ae6c0da13cd6ed4ae5c4e (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
#include "main.h"

#include <cinttypes>
#include <cstdint>
#include <cstdio>
#include <cstring>

#include "chronos/timer.h"
#include "patch.h"
#include "tp/JFWSystem.h"
#include "tp/f_ap_game.h"

namespace mod
{
    using namespace libtp::chronos;
    void main()
    {
        // Initialise rando-system
        return_fapGm_Execute = libtp::patch::hookFunction( libtp::tp::f_ap_game::fapGm_Execute, []() {
            mod::t->tick();

            mod::return_fapGm_Execute();
        } );

        libtp::tp::jfw_system::systemConsole->consoleEnabled = true;

        t = new IntervalTimer( 120, []( Timer* timer ) {
            libtp::tp::jfw_system::systemConsole->consoleLine[timer->m_ExecCount].showLine = true;
            sprintf( libtp::tp::jfw_system::systemConsole->consoleLine[timer->m_ExecCount].line,
                     "Timer Handler: #%" PRId32,
                     timer->m_ExecCount );
        } );

        return;
    }
}     // namespace mod