| 1 | #include <heap/seadHeapMgr.h> |
|---|---|
| 2 | #include <nn/init.h> |
| 3 | #include <nn/mem.h> |
| 4 | #include <nn/oe.h> |
| 5 | |
| 6 | #include "System/Application.h" |
| 7 | #include "System/ApplicationFunction.h" |
| 8 | |
| 9 | extern "C"void nninitStartup() { |
| 10 | uintptr_t allocatorHeap; |
| 11 | uintptr_t recordingHeap; |
| 12 | |
| 13 | nn::os::SetMemoryHeapSize(0xc8000000); |
| 14 | nn::os::AllocateMemoryBlock(&allocatorHeap, 0x2400000); |
| 15 | nn::init::InitializeAllocator(addr: reinterpret_cast<void*>(allocatorHeap), size: 0x2400000); |
| 16 | nn::os::AllocateMemoryBlock(&recordingHeap, 0x6000000); |
| 17 | nn::oe::EnableGamePlayRecording(reinterpret_cast<void*>(recordingHeap), 0x6000000); |
| 18 | } |
| 19 | |
| 20 | extern "C"void nnMain() { |
| 21 | s32 argc = nn::os::GetHostArgc(); |
| 22 | char** argv = nn::os::GetHostArgv(); |
| 23 | ApplicationFunction::initialize(argc, argv); |
| 24 | if (sead::HeapMgr::getRootHeapNum() == 0 || !sead::HeapMgr::getRootHeap(index: 0)) |
| 25 | Application::createInstance(heap: nullptr); |
| 26 | else { |
| 27 | sead::ScopedCurrentHeapSetter setter(sead::HeapMgr::getRootHeap(index: 0)); |
| 28 | Application::createInstance(heap: nullptr); |
| 29 | } |
| 30 | Application::instance()->init(argc, argv); |
| 31 | Application::instance()->run(); |
| 32 | } |
| 33 |