From 73c29d44c3c5896302e420dd8b02aa584fd812ee Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Tue, 28 Jun 2022 08:11:05 +0100 Subject: [PATCH] GS: Don't vmalloc inside fifo_alloc to avoid logic confusion. Also remove a pointless check from my previous COP2 fix. --- pcsx2/GS/GS.cpp | 6 +++--- pcsx2/x86/iR5900Analysis.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pcsx2/GS/GS.cpp b/pcsx2/GS/GS.cpp index a4791cf772..4c79689365 100644 --- a/pcsx2/GS/GS.cpp +++ b/pcsx2/GS/GS.cpp @@ -969,7 +969,7 @@ void* fifo_alloc(size_t size, size_t repeat) if (repeat >= std::size(s_Next)) { fprintf(stderr, "Memory mapping overflow (%zu >= %u)\n", repeat, static_cast(std::size(s_Next))); - return vmalloc(size * repeat, false); // Fallback to default vmalloc + return nullptr; // Fallback to default vmalloc } s_fh = CreateFileMapping(INVALID_HANDLE_VALUE, nullptr, PAGE_READWRITE, 0, size, nullptr); @@ -977,7 +977,7 @@ void* fifo_alloc(size_t size, size_t repeat) if (s_fh == NULL) { fprintf(stderr, "Failed to reserve memory. WIN API ERROR:%u\n", errorID); - return vmalloc(size * repeat, false); // Fallback to default vmalloc + return nullptr; // Fallback to default vmalloc } int mmap_segment_failed = 0; @@ -994,7 +994,7 @@ void* fifo_alloc(size_t size, size_t repeat) { fprintf(stderr, "Memory mapping failed after %d attempts, aborting. WIN API ERROR:%u\n", mmap_segment_failed, errorID); fifo_free(fifo, size, repeat); - return vmalloc(size * repeat, false); // Fallback to default vmalloc + return nullptr; // Fallback to default vmalloc } do { diff --git a/pcsx2/x86/iR5900Analysis.cpp b/pcsx2/x86/iR5900Analysis.cpp index d672542e54..ecbd824693 100644 --- a/pcsx2/x86/iR5900Analysis.cpp +++ b/pcsx2/x86/iR5900Analysis.cpp @@ -259,7 +259,7 @@ void COP2MicroFinishPass::Run(u32 start, u32 end, EEINST* inst_cache) inst->info |= EEINST_COP2_FINISH_VU0_MICRO; // QMTC2 and CTC2 interlock on M-Bit not just VU end, so VU0 might continue to run, so we need to continue to check. - if ((_Rs_ == 005 || _Rs_ == 006) && (cpuRegs.code & 1)) + if (_Rs_ == 005 || _Rs_ == 006) return true; needs_vu0_finish = false;