Hackish-fixed the crash when you run a game through run->execute in release builds. Some code is corrupting ebp and not preserving it, so I made execute() do that instead. Put a nice fixme in there in case anyone is worried. :p

Yes you read the nickname correctly.
Yes I did take the time to fix a problem in pcsx2.
No you are not dreaming, I was bored.

git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@460 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
gigaherz 2008-12-20 03:38:48 +00:00 committed by Gregory Hainaut
parent 0123e80888
commit a946fad125
1 changed files with 7 additions and 2 deletions

View File

@ -1545,7 +1545,6 @@ int recInit( void )
x86SetPtr(recMem+REC_CACHEMEM);
dyna_block_discard_recmem=(u8*)x86Ptr;
JMP32( (uptr)&dyna_block_discard - ( (u32)x86Ptr + 5 ));
// SSE3 detection, manually create the code
@ -1726,7 +1725,9 @@ static void execute( void )
#ifdef _MSC_VER
pfn = ((R5900FNPTR)pblock->pFnptr);
// use call instead of pfn()
__asm push ebp; // FIXME: need to preserve ebp or else the bios crashes, should find where ebp is getting corrupted instead.
__asm call pfn;
__asm pop ebp; // restore ebp for the reason above
#else
((R5900FNPTR)pblock->pFnptr)();
#endif
@ -2811,8 +2812,10 @@ void badespfn() {
void __fastcall dyna_block_discard(u32 start,u32 sz)
{
__asm push ebp;
SysPrintf("dyna_block_discard %08X , count %d\n",start,sz);
Cpu->Clear(start,sz);
__asm pop ebp;
return;
}
void recRecompile( u32 startpc )
@ -3268,7 +3271,9 @@ StartRecomp:
while(stg>0)
{
CMP32ItoM((uptr)PSM(lpc),*(u32*)PSM(lpc));
JNE32(((u32)dyna_block_discard_recmem)- ( (u32)x86Ptr + 6 ));
JNE32(((u32)&dyna_block_discard)- ( (u32)x86Ptr + 6 ));
//JMP32( (uptr)&dyna_block_discard - ( (u32)x86Ptr + 5 ));
stg-=4;
lpc+=4;
}