From d2db08b2cfebcfeec384dab6ef3545d619a8c92b Mon Sep 17 00:00:00 2001 From: EnderIce2 Date: Mon, 4 Mar 2024 02:07:53 +0200 Subject: [PATCH] Workaround for QEMU TCG crash --- core/memory/memory.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/memory/memory.cpp b/core/memory/memory.cpp index 452dc9d..077d0f9 100644 --- a/core/memory/memory.cpp +++ b/core/memory/memory.cpp @@ -111,6 +111,12 @@ NIF void MapFramebuffer(PageTable *PT) break; size_t fbSize = bInfo.Framebuffer[itrfb].Pitch * bInfo.Framebuffer[itrfb].Height; + fbSize = ALIGN_UP(fbSize, PAGE_SIZE); + +#ifdef DEBUG + if (DebuggerIsAttached) + fbSize += 16 * PAGE_SIZE; +#endif if (PSESupport && Page1GBSupport) {