From 3ae0de9b53492dbcac7201a4ec7a3ada072fdfc0 Mon Sep 17 00:00:00 2001 From: bunnei Date: Mon, 18 Mar 2019 22:17:12 -0400 Subject: memory: Check that core is powered on before attempting to use GPU. - GPU will be released on shutdown, before pages are unmapped. - On subsequent runs, current_page_table will be not nullptr, but GPU might not be valid yet. --- src/core/memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 365ac82b4..332c1037c 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -48,7 +48,7 @@ static void MapPages(Common::PageTable& page_table, VAddr base, u64 size, u8* me (base + size) * PAGE_SIZE); // During boot, current_page_table might not be set yet, in which case we need not flush - if (current_page_table) { + if (Core::System::GetInstance().IsPoweredOn()) { Core::System::GetInstance().GPU().FlushAndInvalidateRegion(base << PAGE_BITS, size * PAGE_SIZE); } -- cgit v1.2.3