From 5f1cc131c8da6817caf194ef3391dbd31b71f938 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Wed, 27 May 2009 01:49:48 +0000 Subject: [PATCH] Bugfix for Issue 241. Also increased the EErec's stack memory from 64k to 128k, since there's no reason to be frugal there anymore. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1269 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/ix86-32/iR5900-32.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pcsx2/x86/ix86-32/iR5900-32.cpp b/pcsx2/x86/ix86-32/iR5900-32.cpp index 50626dfe4e..4a46b80a4c 100644 --- a/pcsx2/x86/ix86-32/iR5900-32.cpp +++ b/pcsx2/x86/ix86-32/iR5900-32.cpp @@ -75,7 +75,7 @@ u32 g_cpuHasConstReg = 0, g_cpuFlushedConstReg = 0; // Static Private Variables - R5900 Dynarec #define X86 -static const int RECSTACK_SIZE = 0x00010000; +static const int RECSTACK_SIZE = 0x00020000; static u8 *recMem = NULL; // the recompiled blocks will be here static u8* recStack = NULL; // stack mem @@ -349,7 +349,9 @@ int _flushUnusedConstReg() // u32* recAllocStackMem(int size, int align) { - recStackPtr += align - ((u32)recStackPtr % align); + jASSUME( align == 4 || align == 8 || align == 16 ); + + recStackPtr = (u8*) ( (((uptr)recStackPtr) + (align-1)) & ~(align-1) ); recStackPtr += size; return (u32*)(recStackPtr-size); }