NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_main.cpp
1#include <types.h>
2#include <game/bases/d_main.hpp>
3#include <game/bases/d_system.hpp>
4
5extern "C" {
6void DVDDiskCheck(); ///< @unofficial
7}
8
9OSThread dMain::mainThread;
11
14 dSys_c::setBlack(false);
15}
16
18 while (true) {
20 }
21}
22
23void *dMain::main01(void *arg) {
24 Create();
25 Execute();
26 return nullptr;
27}
28
29#define STACK_SIZE 0xf000
30
31void main(int argc, char *argv[]) {
32 u8 stack[STACK_SIZE] ALIGN(32);
33 DVDDiskCheck();
34 dMain::g_InitialTime = OSGetTime();
35 dSystem::fixArena();
36 OSThread *thread = OSGetCurrentThread();
37 int priority = OSGetThreadPriority();
38 OSCreateThread(&dMain::mainThread, dMain::main01, nullptr, stack + STACK_SIZE, STACK_SIZE, priority, 0);
39 OSResumeThread(&dMain::mainThread);
40 OSSetThreadPriority(thread, 0x1f);
41 OSSuspendThread(thread);
42}
static void * main01(void *)
The main function to be run on the main thread.
Definition d_main.cpp:23
static void Create()
The function that initializes the main game loop.
Definition d_main.cpp:12
static OSThread mainThread
The main thread for the game.
Definition d_main.hpp:13
static s64 g_InitialTime
The startup time of the game.
Definition d_main.hpp:14
static void Execute()
The function that runs the main game loop.
Definition d_main.cpp:17
static void create()
Initializes the game.
Definition d_system.cpp:120
static void execute()
Executes one frame of the game loop.
Definition d_system.cpp:222