rendered paste bodyIndex: pcsx2/Memory.cpp===================================================================--- pcsx2/Memory.cpp (revision 1037)+++ pcsx2/Memory.cpp (working copy)@@ -820,6 +820,7 @@ u32 offset=((u8*)ptr-psM); offset>>=12;+ psMPWC[(offset/32)] &= ~(1<<(offset&31)); for (u32 i=0;i<psMPWVA[offset].size();i++) {Index: pcsx2/x86/ix86-32/iR5900-32.cpp===================================================================--- pcsx2/x86/ix86-32/iR5900-32.cpp (revision 1037)+++ pcsx2/x86/ix86-32/iR5900-32.cpp (working copy)@@ -48,6 +48,8 @@ #include "NakedAsm.h" +using namespace x86Emitter;+ using namespace R5900; // used to disable register freezing during cpuBranchTests (registers@@ -1071,9 +1073,14 @@ // caused by sync hacks and such, since games seem to care a lot more about // these small blocks having accurate cycle counts. - if( s_nBlockCycles <= (5<<3) || (CHECK_EE_CYCLERATE == 0) )- return s_nBlockCycles >> 3;+ u32 basecycles = s_nBlockCycles; + if (s_pCurBlockEx->startpc == 0x81fc0)+ basecycles *= 100;++ if( basecycles <= (5<<3) || (CHECK_EE_CYCLERATE == 0) )+ return basecycles >> 3;+ uint scalarLow, scalarMid, scalarHigh; // Note: larger blocks get a smaller scalar, to help keep@@ -1081,7 +1088,7 @@ switch( CHECK_EE_CYCLERATE ) {- case 0: return s_nBlockCycles >> 3;+ case 0: return basecycles >> 3; case 1: // Sync hack x1.5! scalarLow = 5;@@ -1104,9 +1111,9 @@ jNO_DEFAULT } - const u32 temp = s_nBlockCycles * (- (s_nBlockCycles <= (10<<3)) ? scalarLow :- ((s_nBlockCycles > (21<<3)) ? scalarHigh : scalarMid )+ const u32 temp = basecycles * (+ (basecycles <= (10<<3)) ? scalarLow :+ ((basecycles > (21<<3)) ? scalarHigh : scalarMid ) ); return temp >> (3+2);@@ -1355,6 +1362,13 @@ Cpu->Clear(start,sz); } +void __fastcall dyna_block_reset(u32 start,u32 sz)+{+ DevCon::WriteLn("dyna_block_reset %08X , count %d", params start,sz);+ Cpu->Clear(start & ~0xfffUL, 0x400);+ mmap_MarkCountedRamPage(PSM(start), start & ~0xfffUL);+}+ void recRecompile( const u32 startpc ) { u32 i = 0;@@ -1695,9 +1709,10 @@ iDumpBlock(startpc, recPtr); #endif + static u16 manual_page[Ps2MemSize::Base >> 12]; u32 sz=(s_nEndBlock-startpc)>>2; - u32 inpage_ptr=startpc;+ u32 inpage_ptr=HWADDR(startpc); u32 inpage_sz=sz*4; while(inpage_sz)@@ -1708,12 +1723,14 @@ if(PageType!=-1) {- if (PageType==0)+ if (PageType==0) { mmap_MarkCountedRamPage(PSM(inpage_ptr),inpage_ptr&~0xFFF);+ manual_page[inpage_ptr >> 12] = 0;+ } else {- MOV32ItoR(ECX, startpc);- MOV32ItoR(EDX, sz);+ MOV32ItoR(ECX, inpage_ptr);+ MOV32ItoR(EDX, pgsz); u32 lpc=inpage_ptr; u32 stg=pgsz;@@ -1726,6 +1743,11 @@ stg-=4; lpc+=4; }+ if (startpc != 0x81fc0) {+ xADD(ptr16[&manual_page[inpage_ptr >> 12]], 1);+ iJccKnownTarget(Jcc_Carry, dyna_block_reset);+ }+ DbgCon::WriteLn("Manual block @ %08X : %08X %d %d %d %d", params startpc,inpage_ptr,pgsz,0x1000-inpage_offs,inpage_sz,sz*4); }@@ -1740,6 +1762,7 @@ recompileNextInstruction(0); } + #ifdef _DEBUG if( (dumplog & 1) ) iDumpBlock(startpc, recPtr);