diff --git a/nx/source/gfx/gfx.c b/nx/source/gfx/gfx.c index 35a5ffed..51fe735f 100644 --- a/nx/source/gfx/gfx.c +++ b/nx/source/gfx/gfx.c @@ -13,11 +13,11 @@ static s32 g_gfxCurrentBuffer = 0; static s32 g_gfxCurrentProducerBuffer = 0; static u8 *g_gfxFramebuf; static size_t g_gfxFramebufSize; -static size_t g_gfxFramebufSingleSize = 0x3c0000; extern u32 __nx_applet_type; extern u32 g_nvgfx_totalframebufs; +extern size_t g_nvgfx_singleframebuf_size; static u32 g_gfxQueueBufferData[0x5c>>2] = { 0x54, 0x0, @@ -235,10 +235,10 @@ u8* gfxGetFramebuffer(u16* width, u16* height) { if(width) *width = 1280; if(height) *height = 720; - return &g_gfxFramebuf[g_gfxCurrentBuffer*g_gfxFramebufSingleSize]; + return &g_gfxFramebuf[g_gfxCurrentBuffer*g_nvgfx_singleframebuf_size]; } void gfxFlushBuffers(void) { - armDCacheFlush(&g_gfxFramebuf[g_gfxCurrentBuffer*g_gfxFramebufSingleSize], g_gfxFramebufSingleSize); + armDCacheFlush(&g_gfxFramebuf[g_gfxCurrentBuffer*g_nvgfx_singleframebuf_size], g_nvgfx_singleframebuf_size); } diff --git a/nx/source/gfx/nvgfx.c b/nx/source/gfx/nvgfx.c index 05b28446..808ed296 100644 --- a/nx/source/gfx/nvgfx.c +++ b/nx/source/gfx/nvgfx.c @@ -34,6 +34,7 @@ static size_t g_nvgfx_nvhost_userdata_size; static u32 g_nvgfx_nvhostctrl_eventres; u32 g_nvgfx_totalframebufs = 0; +size_t g_nvgfx_singleframebuf_size = /*0x3c0000*/ 1280*768*4; static nvmapobj nvmap_objs[18]; @@ -51,7 +52,7 @@ static u32 g_gfxprod_BufferInitData[0x178>>2] = { 0x0, 0xdaffcaff, 0x2a, 0x0, 0xb00, 0x1, 0x1, 1280, 0x3c0000, 0x1, 0x0, 1280, -720, 0x532120/* & ~0x20*/, 0x1, 0x3, //0x52* field is flags +720, 0x532120, 0x1, 0x3, //0x52* field is flags 0x1400, 0x0, //nvmap handle 0x0, @@ -164,7 +165,7 @@ Result nvgfxInitialize(void) { if (R_SUCCEEDED(rc)) rc = nvmapobjInitialize(&nvmap_objs[3], 0x10000); if (R_SUCCEEDED(rc)) rc = nvmapobjInitialize(&nvmap_objs[4], 0x59000); if (R_SUCCEEDED(rc)) rc = nvmapobjInitialize(&nvmap_objs[5], 0x1000000); - if (R_SUCCEEDED(rc)) rc = nvmapobjInitialize(&nvmap_objs[6], g_nvgfx_totalframebufs*0x3c0000); + if (R_SUCCEEDED(rc)) rc = nvmapobjInitialize(&nvmap_objs[6], g_nvgfx_totalframebufs*g_nvgfx_singleframebuf_size); if (R_SUCCEEDED(rc)) rc = nvmapobjInitialize(&nvmap_objs[7], 0x1000000); if (R_SUCCEEDED(rc)) rc = nvmapobjInitialize(&nvmap_objs[8], 0x800000); if (R_SUCCEEDED(rc)) rc = nvmapobjInitialize(&nvmap_objs[9], 0x100000); @@ -280,7 +281,7 @@ Result nvgfxInitialize(void) { if (R_SUCCEEDED(rc)) { for(pos=0; pos>3] = svcGetSystemTick(); rc = gfxproducerTegraBufferInit(i, (u8*)g_gfxprod_BufferInitData); if (R_FAILED(rc)) break;