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 copyBuffer() { //copy topleft FB u8 copiedBuffer=currentBuffer^1; u8* bufAdr=&gspHeap[0x46500*copiedBuffer]; GSPGPU_FlushDataCache(NULL, bufAdr, 0x46500); GX_RequestDma(gxCmdBuf, (u32*)bufAdr, (u32*)topLeftFramebuffers[copiedBuffer], 0x46500); }