diff --git a/nx/source/gfx/gfx.c b/nx/source/gfx/gfx.c index d2db8c03..f1d7abad 100644 --- a/nx/source/gfx/gfx.c +++ b/nx/source/gfx/gfx.c @@ -249,6 +249,9 @@ u32 gfxGetFramebufferDisplayOffset(u32 x, u32 y) { gfxGetFramebuffer(&width, &height); + if (x >= width) x = width-1; + if (y >= height) y = height-1; + y = height-1-y; tilepos = ((y & 127) / 16) + (x/16*8) + ((y/16/8)*(width/16*8));