struct GUIFont* GUIFontCreate(void) { struct GUIFont* guiFont = malloc(sizeof(struct GUIFont)); if (!guiFont) { return 0; } struct ctrTexture* tex = &guiFont->texture; ctrTexture_Init(tex); tex->data = vramAlloc(256 * 128 * 2); tex->format = GPU_RGBA5551; tex->width = 256; tex->height = 128; GSPGPU_FlushDataCache(font, font_size); GX_RequestDma((u32*) font, tex->data, font_size); gspWaitForDMA(); tex = &guiFont->icons; ctrTexture_Init(tex); tex->data = vramAlloc(256 * 64 * 2); tex->format = GPU_RGBA5551; tex->width = 256; tex->height = 64; GSPGPU_FlushDataCache(icons, icons_size); GX_RequestDma((u32*) icons, tex->data, icons_size); gspWaitForDMA(); return guiFont; }
void gpuInit(void) { colorBuf = vramAlloc(400*240*4); depthBuf = vramAlloc(400*240*4); cmdBuf = linearAlloc(0x40000*4); GPU_Init(NULL); GPU_Reset(NULL, cmdBuf, 0x40000); }
void TestAll() { const std::string tag = "MemoryFills"; u8* buffer = (u8*)vramAlloc(0x400); Test(tag, "Fill24Bits", Fill24Bits(buffer), true); Test(tag, "Fill32Bits", Fill32Bits(buffer), true); vramFree(buffer); }