// Wrapper func to call function pointer set by OSDynLoad_SetAllocator int OSDynLoad_MemAlloc(int size, int alignment, void **outPtr) { be_data<uint32_t> value; auto result = pOSDynLoad_MemAlloc(size, alignment, &value); *outPtr = memory_translate(value); return result; }
void CoreInit::initialiseMemory() { auto lcBase = static_cast<uint8_t*>(memory_translate(0xF8000000)); for (auto i = 0; i < 3; ++i) { gLcHeaps[i] = new TeenyHeap(lcBase + (0x6000 * i), 0x4000); } }
void CoreInit::initialiseShared() { gSharedHeap = new TeenyHeap(memory_translate(mem::SharedDataBase), mem::SharedDataSize); readFont(gFonts[0], "resources/fonts/SourceSansPro-Regular.ttf"); gFonts[1] = gFonts[0]; gFonts[2] = gFonts[0]; gFonts[3] = gFonts[0]; }
// Gets the translated pointer (plus automatic casting to lhs) auto_ptr_cast get() const { return memory_translate(p); }