From fc4bdfd0256a36e09d90f352297991063ce6090b Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Mon, 24 Jun 2024 12:51:36 +0100 Subject: [PATCH] GS: Avoid pointlessly trying to map more pages in memory than the GS has --- pcsx2/GS/GSLocalMemory.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pcsx2/GS/GSLocalMemory.cpp b/pcsx2/GS/GSLocalMemory.cpp index 557d894fbc..7191a46727 100644 --- a/pcsx2/GS/GSLocalMemory.cpp +++ b/pcsx2/GS/GSLocalMemory.cpp @@ -371,6 +371,13 @@ std::vector* GSLocalMemory::GetPage2TileMap(const GIFRegTEX0& TEX0) int tw = std::max(1 << TEX0.TW, bs.x); int th = std::max(1 << TEX0.TH, bs.y); + // Limit the size to the maximum size of the GS memory, there's no point in mapping more than this. + if ((tw * th) > VM_SIZE) + { + tw = 2048; + th = 2048; + } + GSOffset off = GetOffset(TEX0.TBP0, TEX0.TBW, TEX0.PSM); GSOffset::BNHelper bn = off.bnMulti(0, 0);