src/platform/3ds/ctru-heap.c (view raw)
1/* Copyright (c) 2013-2020 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6#include <3ds/archive.h>
7
8#include <mgba-util/common.h>
9
10u32 __ctru_heap_size = 0x02400000;
11u32 __ctru_linear_heap_size = 0x01400000;
12
13uint32_t* romBuffer = NULL;
14size_t romBufferSize;
15
16FS_Archive sdmcArchive;
17
18void userAppInit(void) {
19 FSUSER_OpenArchive(&sdmcArchive, ARCHIVE_SDMC, fsMakePath(PATH_EMPTY, ""));
20
21 romBuffer = malloc(0x02000000);
22 if (romBuffer) {
23 romBufferSize = 0x02000000;
24 return;
25 }
26 romBuffer = malloc(0x01000000);
27 if (romBuffer) {
28 romBufferSize = 0x01000000;
29 return;
30 }
31}