From 9e398fd418027e4932a1539f7d382b70e8acc408 Mon Sep 17 00:00:00 2001 From: skidau Date: Fri, 2 Mar 2012 18:53:41 +1100 Subject: [PATCH 01/32] Added an external exception check when the CPU writes to the FIFO. This allows the CPU time to service FIFO overflows. Fixes random hangs caused by FIFO overflows and desyncs like in "The Last Story" and "Battalion Wars 2". Thanks to marcosvitali for the research. Fixes issue 5209. Fixes issue 5150. Fixes issue 5055. Fixes issue 4889. Fixes issue 4061. Fixes issue 4010. Fixes issue 3902. --- Source/Core/Core/Src/HW/GPFifo.cpp | 14 ++++++++++-- .../Interpreter/Interpreter_LoadStore.cpp | 4 ++-- Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp | 19 ++++++++++++++++ Source/Core/Core/Src/PowerPC/Jit64IL/IR.cpp | 6 ++--- Source/Core/Core/Src/PowerPC/Jit64IL/IR.h | 7 ++++-- .../Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp | 17 ++++++++++++++ .../Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp | 5 +++++ .../Core/Core/Src/PowerPC/JitCommon/JitBase.h | 4 ++++ .../Core/Src/PowerPC/JitCommon/JitCache.cpp | 11 +++++----- .../Core/Src/PowerPC/JitCommon/JitCache.h | 2 +- Source/Core/Core/Src/PowerPC/PPCCache.cpp | 2 +- .../Core/VideoCommon/Src/CommandProcessor.cpp | 22 ------------------- .../Core/VideoCommon/Src/CommandProcessor.h | 1 - Source/Core/VideoCommon/Src/Fifo.cpp | 3 +-- 14 files changed, 75 insertions(+), 42 deletions(-) diff --git a/Source/Core/Core/Src/HW/GPFifo.cpp b/Source/Core/Core/Src/HW/GPFifo.cpp index 4d72317e0d..35d678a411 100644 --- a/Source/Core/Core/Src/HW/GPFifo.cpp +++ b/Source/Core/Core/Src/HW/GPFifo.cpp @@ -19,9 +19,9 @@ #include "ChunkFile.h" #include "ProcessorInterface.h" #include "Memmap.h" -#include "../PowerPC/PowerPC.h" - #include "VideoBackendBase.h" +#include "../PowerPC/JitCommon/JitBase.h" +#include "../PowerPC/PowerPC.h" #include "GPFifo.h" @@ -96,6 +96,16 @@ void STACKALIGN CheckGatherPipe() // move back the spill bytes memmove(m_gatherPipe, m_gatherPipe + cnt, m_gatherPipeCount); + + // Profile where the FIFO writes are occurring. + const u32 addr = PC - 4; + if (jit && (jit->js.fifoWriteAddresses.find(addr)) == (jit->js.fifoWriteAddresses.end())) + { + jit->js.fifoWriteAddresses.insert(addr); + + // Invalidate the JIT block so that it gets recompiled with the external exception check included. + jit->GetBlockCache()->InvalidateICache(addr, 8); + } } } diff --git a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_LoadStore.cpp b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_LoadStore.cpp index a7955c0982..cad4761e55 100644 --- a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_LoadStore.cpp +++ b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_LoadStore.cpp @@ -367,7 +367,7 @@ void Interpreter::dcbf(UGeckoInstruction _inst) if (jit) { u32 address = Helper_Get_EA_X(_inst); - jit->GetBlockCache()->InvalidateICache(address & ~0x1f); + jit->GetBlockCache()->InvalidateICache(address & ~0x1f, 32); } } @@ -378,7 +378,7 @@ void Interpreter::dcbi(UGeckoInstruction _inst) if (jit) { u32 address = Helper_Get_EA_X(_inst); - jit->GetBlockCache()->InvalidateICache(address & ~0x1f); + jit->GetBlockCache()->InvalidateICache(address & ~0x1f, 32); } } diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp index 0d31893b53..a98df95fc3 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp @@ -41,6 +41,7 @@ #include "JitAsm.h" #include "JitRegCache.h" #include "Jit64_Tables.h" +#include "HW/ProcessorInterface.h" using namespace Gen; using namespace PowerPC; @@ -569,6 +570,24 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc SetJumpTarget(b1); } + // Add an external exception check if the instruction writes to the FIFO. + if (jit->js.fifoWriteAddresses.find(js.compilerPC) != jit->js.fifoWriteAddresses.end()) + { + gpr.Flush(FLUSH_ALL); + fpr.Flush(FLUSH_ALL); + + TEST(32, M((void *)&PowerPC::ppcState.Exceptions), Imm32(EXCEPTION_EXTERNAL_INT)); + FixupBranch noExtException = J_CC(CC_Z); + TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_CP)); + FixupBranch noCPInt = J_CC(CC_Z); + + MOV(32, M(&PC), Imm32(js.compilerPC)); + WriteExceptionExit(); + + SetJumpTarget(noCPInt); + SetJumpTarget(noExtException); + } + Jit64Tables::CompileInstruction(ops[i]); if (js.memcheck && (opinfo->flags & FL_LOADSTORE)) diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/IR.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/IR.cpp index 3a60a0ae11..afab21b30e 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/IR.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/IR.cpp @@ -1260,8 +1260,8 @@ static const std::string opcodeNames[] = { "FResult_End", "StorePaired", "StoreSingle", "StoreDouble", "StoreFReg", "FDCmpCR", "CInt16", "CInt32", "SystemCall", "RFIExit", "InterpreterBranch", "IdleBranch", "ShortIdleLoop", - "FPExceptionCheckStart", "FPExceptionCheckEnd", "ISIException", "Tramp", - "BlockStart", "BlockEnd", "Int3", + "FPExceptionCheckStart", "FPExceptionCheckEnd", "ISIException", "ExtExceptionCheck", + "Tramp", "BlockStart", "BlockEnd", "Int3", }; static const unsigned alwaysUsedList[] = { InterpreterFallback, StoreGReg, StoreCR, StoreLink, StoreCTR, StoreMSR, @@ -1269,7 +1269,7 @@ static const unsigned alwaysUsedList[] = { Store16, Store32, StoreSingle, StoreDouble, StorePaired, StoreFReg, FDCmpCR, BlockStart, BlockEnd, IdleBranch, BranchCond, BranchUncond, ShortIdleLoop, SystemCall, InterpreterBranch, RFIExit, FPExceptionCheckStart, - FPExceptionCheckEnd, ISIException, Int3, Tramp, Nop + FPExceptionCheckEnd, ISIException, ExtExceptionCheck, Int3, Tramp, Nop }; static const unsigned extra8RegList[] = { LoadGReg, LoadCR, LoadGQR, LoadFReg, LoadFRegDENToZero, diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/IR.h b/Source/Core/Core/Src/PowerPC/Jit64IL/IR.h index aca3dd0e37..284cbe6538 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/IR.h +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/IR.h @@ -165,10 +165,10 @@ enum Opcode { ShortIdleLoop, // Idle loop seen in homebrew like wii mahjong, // just a branch - // used for MMU, at least until someone + // used for exception checking, at least until someone // has a better idea of integrating it FPExceptionCheckStart, FPExceptionCheckEnd, - ISIException, + ISIException,ExtExceptionCheck, // "Opcode" representing a register too far away to // reference directly; this is a size optimization Tramp, @@ -411,6 +411,9 @@ public: InstLoc EmitISIException(InstLoc dest) { return EmitUOp(ISIException, dest); } + InstLoc EmitExtExceptionCheck(InstLoc pc) { + return EmitUOp(ExtExceptionCheck, pc); + } InstLoc EmitRFIExit() { return FoldZeroOp(RFIExit, 0); } diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp index e1807cfbb4..6648189809 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp @@ -50,6 +50,7 @@ The register allocation is linear scan allocation. #include "../../../../Common/Src/CPUDetect.h" #include "MathUtil.h" #include "../../Core.h" +#include "HW/ProcessorInterface.h" static ThunkManager thunks; @@ -761,6 +762,7 @@ static void DoWriteCode(IRBuilder* ibuild, JitIL* Jit, bool UseProfile, bool Mak case FPExceptionCheckStart: case FPExceptionCheckEnd: case ISIException: + case ExtExceptionCheck: case Int3: case Tramp: // No liveness effects @@ -1920,6 +1922,21 @@ static void DoWriteCode(IRBuilder* ibuild, JitIL* Jit, bool UseProfile, bool Mak Jit->WriteExceptionExit(); break; } + case ExtExceptionCheck: { + unsigned InstLoc = ibuild->GetImmValue(getOp1(I)); + + Jit->TEST(32, M((void *)&PowerPC::ppcState.Exceptions), Imm32(EXCEPTION_EXTERNAL_INT)); + FixupBranch noExtException = Jit->J_CC(CC_Z); + Jit->TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_CP)); + FixupBranch noCPInt = Jit->J_CC(CC_Z); + + Jit->MOV(32, M(&PC), Imm32(InstLoc)); + Jit->WriteExceptionExit(); + + Jit->SetJumpTarget(noCPInt); + Jit->SetJumpTarget(noExtException); + break; + } case Int3: { Jit->INT3(); break; diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp index 75755de5cb..96afff1613 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp @@ -648,6 +648,11 @@ const u8* JitIL::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc { ibuild.EmitFPExceptionCheckStart(ibuild.EmitIntConst(ops[i].address)); } + + if (jit->js.fifoWriteAddresses.find(js.compilerPC) != jit->js.fifoWriteAddresses.end()) + { + ibuild.EmitExtExceptionCheck(ibuild.EmitIntConst(ops[i].address)); + } JitILTables::CompileInstruction(ops[i]); diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/JitBase.h b/Source/Core/Core/Src/PowerPC/JitCommon/JitBase.h index b832e96e1f..be80754bdc 100644 --- a/Source/Core/Core/Src/PowerPC/JitCommon/JitBase.h +++ b/Source/Core/Core/Src/PowerPC/JitCommon/JitBase.h @@ -31,6 +31,8 @@ #include "PowerPCDisasm.h" #include "disasm.h" +#include + #define JIT_OPCODE 0 class JitBase : public CPUCoreBase, public EmuCodeBlock @@ -75,6 +77,8 @@ protected: u8* rewriteStart; JitBlock *curBlock; + + std::set fifoWriteAddresses; }; public: diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp b/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp index 422369d307..8f5ff5d820 100644 --- a/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp +++ b/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp @@ -390,13 +390,12 @@ bool JitBlock::ContainsAddress(u32 em_address) } - void JitBlockCache::InvalidateICache(u32 address) + void JitBlockCache::InvalidateICache(u32 address, const u32 length) { - address &= ~0x1f; // destroy JIT blocks // !! this works correctly under assumption that any two overlapping blocks end at the same address std::map, u32>::iterator it1 = block_map.lower_bound(std::make_pair(address, 0)), it2 = it1, it; - while (it2 != block_map.end() && it2->first.second < address + 0x20) + while (it2 != block_map.end() && it2->first.second < address + length) { DestroyBlock(it2->second, true); it2++; @@ -418,17 +417,17 @@ bool JitBlock::ContainsAddress(u32 em_address) if (address & JIT_ICACHE_VMEM_BIT) { u32 cacheaddr = address & JIT_ICACHE_MASK; - memset(iCacheVMEM + cacheaddr, JIT_ICACHE_INVALID_BYTE, 32); + memset(iCacheVMEM + cacheaddr, JIT_ICACHE_INVALID_BYTE, length); } else if (address & JIT_ICACHE_EXRAM_BIT) { u32 cacheaddr = address & JIT_ICACHEEX_MASK; - memset(iCacheEx + cacheaddr, JIT_ICACHE_INVALID_BYTE, 32); + memset(iCacheEx + cacheaddr, JIT_ICACHE_INVALID_BYTE, length); } else { u32 cacheaddr = address & JIT_ICACHE_MASK; - memset(iCache + cacheaddr, JIT_ICACHE_INVALID_BYTE, 32); + memset(iCache + cacheaddr, JIT_ICACHE_INVALID_BYTE, length); } #endif } diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.h b/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.h index 91d47a3d0e..7c19310e02 100644 --- a/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.h +++ b/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.h @@ -129,7 +129,7 @@ public: CompiledCode GetCompiledCodeFromBlock(int block_num); // DOES NOT WORK CORRECTLY WITH INLINING - void InvalidateICache(u32 em_address); + void InvalidateICache(u32 address, const u32 length); void DestroyBlock(int block_num, bool invalidate); // Not currently used diff --git a/Source/Core/Core/Src/PowerPC/PPCCache.cpp b/Source/Core/Core/Src/PowerPC/PPCCache.cpp index 704caa4a2c..6956e9db1c 100644 --- a/Source/Core/Core/Src/PowerPC/PPCCache.cpp +++ b/Source/Core/Core/Src/PowerPC/PPCCache.cpp @@ -110,7 +110,7 @@ namespace PowerPC #endif valid[set] = 0; if (jit) - jit->GetBlockCache()->InvalidateICache(addr); + jit->GetBlockCache()->InvalidateICache(addr & ~0x1f, 32); } u32 InstructionCache::ReadInstruction(u32 addr) diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.cpp b/Source/Core/VideoCommon/Src/CommandProcessor.cpp index fc85b8e39d..dbe09aaa0e 100644 --- a/Source/Core/VideoCommon/Src/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/Src/CommandProcessor.cpp @@ -60,7 +60,6 @@ volatile bool interruptSet= false; volatile bool interruptWaiting= false; volatile bool interruptTokenWaiting = false; volatile bool interruptFinishWaiting = false; -volatile bool OnOverflow = false; bool IsOnThread() { @@ -92,7 +91,6 @@ void DoState(PointerWrap &p) p.Do(interruptWaiting); p.Do(interruptTokenWaiting); p.Do(interruptFinishWaiting); - p.Do(OnOverflow); } inline void WriteLow (volatile u32& _reg, u16 lowbits) {Common::AtomicStore(_reg,(_reg & 0xFFFF0000) | lowbits);} @@ -135,7 +133,6 @@ void Init() bProcessFifoToLoWatermark = false; bProcessFifoAllDistance = false; isPossibleWaitingSetDrawDone = false; - OnOverflow = false; et_UpdateInterrupts = CoreTiming::RegisterEvent("UpdateInterrupts", UpdateInterrupts_Wrapper); } @@ -449,26 +446,7 @@ void STACKALIGN GatherPipeBursted() Common::AtomicAdd(fifo.CPReadWriteDistance, GATHER_PIPE_SIZE); if (!IsOnThread()) - { RunGpu(); - } - else - { - if(fifo.CPReadWriteDistance == fifo.CPEnd - fifo.CPBase - 32) - { - if(!OnOverflow) - NOTICE_LOG(COMMANDPROCESSOR,"FIFO is almost in overflown, BreakPoint: %i", fifo.bFF_Breakpoint); - OnOverflow = true; - while (!CommandProcessor::interruptWaiting && fifo.bFF_GPReadEnable && - fifo.CPReadWriteDistance > fifo.CPEnd - fifo.CPBase - 64) - Common::YieldCPU(); - } - else - { - OnOverflow = false; - } - } - _assert_msg_(COMMANDPROCESSOR, fifo.CPReadWriteDistance <= fifo.CPEnd - fifo.CPBase, "FIFO is overflown by GatherPipe !\nCPU thread is too fast!"); diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.h b/Source/Core/VideoCommon/Src/CommandProcessor.h index db6772d66d..bb969fcb95 100644 --- a/Source/Core/VideoCommon/Src/CommandProcessor.h +++ b/Source/Core/VideoCommon/Src/CommandProcessor.h @@ -35,7 +35,6 @@ extern volatile bool interruptSet; extern volatile bool interruptWaiting; extern volatile bool interruptTokenWaiting; extern volatile bool interruptFinishWaiting; -extern volatile bool OnOverflow; // internal hardware addresses enum diff --git a/Source/Core/VideoCommon/Src/Fifo.cpp b/Source/Core/VideoCommon/Src/Fifo.cpp index 842ff49e78..5cb3252816 100644 --- a/Source/Core/VideoCommon/Src/Fifo.cpp +++ b/Source/Core/VideoCommon/Src/Fifo.cpp @@ -137,8 +137,7 @@ void RunGpuLoop() CommandProcessor::SetCpStatus(); // check if we are able to run this buffer - while (!CommandProcessor::interruptWaiting && fifo.bFF_GPReadEnable && - fifo.CPReadWriteDistance && (!AtBreakpoint() || CommandProcessor::OnOverflow)) + while (!CommandProcessor::interruptWaiting && fifo.bFF_GPReadEnable && fifo.CPReadWriteDistance && !AtBreakpoint()) { if (!GpuRunningState) break; From 9e649ce79850f6c39fa16ea5a207659bb2e5b052 Mon Sep 17 00:00:00 2001 From: skidau Date: Sat, 3 Mar 2012 14:26:39 +1100 Subject: [PATCH 02/32] Added additional checks to ensure that only a FIFO breakpoint exception is handled. This fixes the hangs in games like de Blob, Xenoblade and Super Mario Galaxy introduced by r9e398fd41802. --- Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp index a98df95fc3..07eb36d263 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp @@ -571,7 +571,7 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc } // Add an external exception check if the instruction writes to the FIFO. - if (jit->js.fifoWriteAddresses.find(js.compilerPC) != jit->js.fifoWriteAddresses.end()) + if (jit->js.fifoWriteAddresses.find(ops[i].address) != jit->js.fifoWriteAddresses.end()) { gpr.Flush(FLUSH_ALL); fpr.Flush(FLUSH_ALL); @@ -580,10 +580,16 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc FixupBranch noExtException = J_CC(CC_Z); TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_CP)); FixupBranch noCPInt = J_CC(CC_Z); + TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), + Imm32(ProcessorInterface::INT_CAUSE_PE_TOKEN | + ProcessorInterface::INT_CAUSE_PE_FINISH | + ProcessorInterface::INT_CAUSE_DSP)); + FixupBranch ClearInt = J_CC(CC_NZ); - MOV(32, M(&PC), Imm32(js.compilerPC)); + MOV(32, M(&PC), Imm32(ops[i].address)); WriteExceptionExit(); + SetJumpTarget(ClearInt); SetJumpTarget(noCPInt); SetJumpTarget(noExtException); } From 874e17e504c6c6b19f5a1eb9ef16c82bde179032 Mon Sep 17 00:00:00 2001 From: skidau Date: Sat, 3 Mar 2012 15:41:55 +1100 Subject: [PATCH 03/32] Added the corresponding change from r9e649ce79850 to JITIL. --- Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp | 9 +++------ Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp | 3 +++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp index 07eb36d263..44ce9325b6 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp @@ -580,16 +580,13 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc FixupBranch noExtException = J_CC(CC_Z); TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_CP)); FixupBranch noCPInt = J_CC(CC_Z); - TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), - Imm32(ProcessorInterface::INT_CAUSE_PE_TOKEN | - ProcessorInterface::INT_CAUSE_PE_FINISH | - ProcessorInterface::INT_CAUSE_DSP)); - FixupBranch ClearInt = J_CC(CC_NZ); + TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_DSP)); + FixupBranch clearInt = J_CC(CC_NZ); MOV(32, M(&PC), Imm32(ops[i].address)); WriteExceptionExit(); - SetJumpTarget(ClearInt); + SetJumpTarget(clearInt); SetJumpTarget(noCPInt); SetJumpTarget(noExtException); } diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp index 6648189809..0152d0d96e 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp @@ -1929,10 +1929,13 @@ static void DoWriteCode(IRBuilder* ibuild, JitIL* Jit, bool UseProfile, bool Mak FixupBranch noExtException = Jit->J_CC(CC_Z); Jit->TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_CP)); FixupBranch noCPInt = Jit->J_CC(CC_Z); + Jit->TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_DSP)); + FixupBranch clearInt = Jit->J_CC(CC_NZ); Jit->MOV(32, M(&PC), Imm32(InstLoc)); Jit->WriteExceptionExit(); + Jit->SetJumpTarget(clearInt); Jit->SetJumpTarget(noCPInt); Jit->SetJumpTarget(noExtException); break; From 5de8366db2ec084e95420b0853abb4d11a431ac0 Mon Sep 17 00:00:00 2001 From: skidau Date: Sun, 4 Mar 2012 08:10:46 +1100 Subject: [PATCH 04/32] Made the invalidation of the FIFO write JIT blocks more selective (efficient). Fixes the slowdown in the House of the Dead: Overkill cutscenes. --- Source/Core/Core/Src/HW/GPFifo.cpp | 7 +++---- Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp | 2 +- Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Source/Core/Core/Src/HW/GPFifo.cpp b/Source/Core/Core/Src/HW/GPFifo.cpp index 35d678a411..725db3011c 100644 --- a/Source/Core/Core/Src/HW/GPFifo.cpp +++ b/Source/Core/Core/Src/HW/GPFifo.cpp @@ -98,13 +98,12 @@ void STACKALIGN CheckGatherPipe() memmove(m_gatherPipe, m_gatherPipe + cnt, m_gatherPipeCount); // Profile where the FIFO writes are occurring. - const u32 addr = PC - 4; - if (jit && (jit->js.fifoWriteAddresses.find(addr)) == (jit->js.fifoWriteAddresses.end())) + if (jit && (jit->js.fifoWriteAddresses.find(PC)) == (jit->js.fifoWriteAddresses.end())) { - jit->js.fifoWriteAddresses.insert(addr); + jit->js.fifoWriteAddresses.insert(PC); // Invalidate the JIT block so that it gets recompiled with the external exception check included. - jit->GetBlockCache()->InvalidateICache(addr, 8); + jit->GetBlockCache()->InvalidateICache(PC, 4); } } } diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp index 44ce9325b6..71718c6085 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp @@ -580,7 +580,7 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc FixupBranch noExtException = J_CC(CC_Z); TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_CP)); FixupBranch noCPInt = J_CC(CC_Z); - TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_DSP)); + TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_VI | ProcessorInterface::INT_CAUSE_PE_TOKEN | ProcessorInterface::INT_CAUSE_PE_FINISH)); FixupBranch clearInt = J_CC(CC_NZ); MOV(32, M(&PC), Imm32(ops[i].address)); diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp index 0152d0d96e..cffc3b5feb 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp @@ -1929,7 +1929,7 @@ static void DoWriteCode(IRBuilder* ibuild, JitIL* Jit, bool UseProfile, bool Mak FixupBranch noExtException = Jit->J_CC(CC_Z); Jit->TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_CP)); FixupBranch noCPInt = Jit->J_CC(CC_Z); - Jit->TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_DSP)); + Jit->TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_VI | ProcessorInterface::INT_CAUSE_PE_TOKEN | ProcessorInterface::INT_CAUSE_PE_FINISH)); FixupBranch clearInt = Jit->J_CC(CC_NZ); Jit->MOV(32, M(&PC), Imm32(InstLoc)); From a53916ff5d7d2840ef8612bc16511554d259e848 Mon Sep 17 00:00:00 2001 From: skidau Date: Sun, 4 Mar 2012 23:42:33 +1100 Subject: [PATCH 05/32] Changed the detection of FIFO write addresses to writes at the gather pipe boundary. This speeds up games which frequently write to the gather pipe like the pre-rendered movies in The Last Story. Added some code to unlink invalidated blocks so that the recompiled block can be linked (speed-up). --- Source/Core/Core/Src/HW/GPFifo.cpp | 2 +- .../Core/Src/PowerPC/JitCommon/JitCache.cpp | 22 ++++++++++++++++++- .../Core/Src/PowerPC/JitCommon/JitCache.h | 1 + 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/Src/HW/GPFifo.cpp b/Source/Core/Core/Src/HW/GPFifo.cpp index 725db3011c..fd81f099e9 100644 --- a/Source/Core/Core/Src/HW/GPFifo.cpp +++ b/Source/Core/Core/Src/HW/GPFifo.cpp @@ -98,7 +98,7 @@ void STACKALIGN CheckGatherPipe() memmove(m_gatherPipe, m_gatherPipe + cnt, m_gatherPipeCount); // Profile where the FIFO writes are occurring. - if (jit && (jit->js.fifoWriteAddresses.find(PC)) == (jit->js.fifoWriteAddresses.end())) + if (m_gatherPipeCount == 0 && jit && (jit->js.fifoWriteAddresses.find(PC)) == (jit->js.fifoWriteAddresses.end())) { jit->js.fifoWriteAddresses.insert(PC); diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp b/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp index 8f5ff5d820..bccb218fd9 100644 --- a/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp +++ b/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp @@ -353,6 +353,24 @@ bool JitBlock::ContainsAddress(u32 em_address) } } + void JitBlockCache::UnlinkBlock(int i) + { + JitBlock &b = blocks[i]; + std::map::iterator iter; + pair::iterator, multimap::iterator> ppp; + ppp = links_to.equal_range(b.originalAddress); + if (ppp.first == ppp.second) + return; + for (multimap::iterator iter2 = ppp.first; iter2 != ppp.second; ++iter2) { + JitBlock &sourceBlock = blocks[iter2->second]; + for (int e = 0; e < 2; e++) + { + if (sourceBlock.exitAddress[e] == b.originalAddress) + sourceBlock.linkStatus[e] = false; + } + } + } + void JitBlockCache::DestroyBlock(int block_num, bool invalidate) { if (block_num < 0 || block_num >= num_blocks) @@ -375,7 +393,9 @@ bool JitBlock::ContainsAddress(u32 em_address) Memory::WriteUnchecked_U32(b.originalFirstOpcode, b.originalAddress); #endif - // We don't unlink blocks, we just send anyone who tries to run them back to the dispatcher. + UnlinkBlock(block_num); + + // Send anyone who tries to run this block back to the dispatcher. // Not entirely ideal, but .. pretty good. // Spurious entrances from previously linked blocks can only come through checkedEntry XEmitter emit((u8 *)b.checkedEntry); diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.h b/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.h index 7c19310e02..16f16d6d14 100644 --- a/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.h +++ b/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.h @@ -87,6 +87,7 @@ class JitBlockCache bool RangeIntersect(int s1, int e1, int s2, int e2) const; void LinkBlockExits(int i); void LinkBlock(int i); + void UnlinkBlock(int i); public: JitBlockCache() : From b0f75f17ae19484735675fea348f7e95740f597f Mon Sep 17 00:00:00 2001 From: marcosvitali Date: Mon, 5 Mar 2012 02:40:10 -0300 Subject: [PATCH 06/32] This release still fixed the hangs produced by fifo overflow without sacrifice performance. For example you can test Tutorial moves at the beginning of The last history now is fluid 30/60. Shuffle2: I've delete the hacky line, I think is not necessary anymore. Additional some clean in CommandProcessor. Please test The Last Story and others games affected in the previous commits and give me a feedback. --- Source/Core/Common/Src/VideoBackendBase.h | 2 + Source/Core/Core/Src/HW/GPFifo.cpp | 5 ++- Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp | 3 -- .../Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp | 4 +- .../Core/VideoCommon/Src/CommandProcessor.cpp | 39 +++++++++++-------- .../Core/VideoCommon/Src/CommandProcessor.h | 1 + Source/Core/VideoCommon/Src/MainBase.cpp | 5 +++ Source/Core/VideoCommon/Src/PixelEngine.cpp | 2 - .../Plugin_VideoSoftware/Src/SWmain.cpp | 6 +++ .../Plugin_VideoSoftware/Src/VideoBackend.h | 2 +- 10 files changed, 41 insertions(+), 28 deletions(-) diff --git a/Source/Core/Common/Src/VideoBackendBase.h b/Source/Core/Common/Src/VideoBackendBase.h index 28c8f23246..96f639832b 100644 --- a/Source/Core/Common/Src/VideoBackendBase.h +++ b/Source/Core/Common/Src/VideoBackendBase.h @@ -119,6 +119,7 @@ public: virtual void Video_GatherPipeBursted() = 0; virtual bool Video_IsPossibleWaitingSetDrawDone() = 0; + virtual bool Video_IsHiWatermarkActive() = 0; virtual void Video_AbortFrame() = 0; virtual readFn16 Video_CPRead16() = 0; @@ -159,6 +160,7 @@ class VideoBackendHardware : public VideoBackend void Video_GatherPipeBursted(); bool Video_IsPossibleWaitingSetDrawDone(); + bool Video_IsHiWatermarkActive(); void Video_AbortFrame(); readFn16 Video_CPRead16(); diff --git a/Source/Core/Core/Src/HW/GPFifo.cpp b/Source/Core/Core/Src/HW/GPFifo.cpp index fd81f099e9..9bae7bb621 100644 --- a/Source/Core/Core/Src/HW/GPFifo.cpp +++ b/Source/Core/Core/Src/HW/GPFifo.cpp @@ -96,9 +96,10 @@ void STACKALIGN CheckGatherPipe() // move back the spill bytes memmove(m_gatherPipe, m_gatherPipe + cnt, m_gatherPipeCount); - + // Profile where the FIFO writes are occurring. - if (m_gatherPipeCount == 0 && jit && (jit->js.fifoWriteAddresses.find(PC)) == (jit->js.fifoWriteAddresses.end())) + + if (g_video_backend->Video_IsHiWatermarkActive() && jit && (jit->js.fifoWriteAddresses.find(PC)) == (jit->js.fifoWriteAddresses.end())) { jit->js.fifoWriteAddresses.insert(PC); diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp index 71718c6085..417d1159da 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp @@ -580,13 +580,10 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc FixupBranch noExtException = J_CC(CC_Z); TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_CP)); FixupBranch noCPInt = J_CC(CC_Z); - TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_VI | ProcessorInterface::INT_CAUSE_PE_TOKEN | ProcessorInterface::INT_CAUSE_PE_FINISH)); - FixupBranch clearInt = J_CC(CC_NZ); MOV(32, M(&PC), Imm32(ops[i].address)); WriteExceptionExit(); - SetJumpTarget(clearInt); SetJumpTarget(noCPInt); SetJumpTarget(noExtException); } diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp index cffc3b5feb..811440d098 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp @@ -1929,13 +1929,11 @@ static void DoWriteCode(IRBuilder* ibuild, JitIL* Jit, bool UseProfile, bool Mak FixupBranch noExtException = Jit->J_CC(CC_Z); Jit->TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_CP)); FixupBranch noCPInt = Jit->J_CC(CC_Z); - Jit->TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_VI | ProcessorInterface::INT_CAUSE_PE_TOKEN | ProcessorInterface::INT_CAUSE_PE_FINISH)); - FixupBranch clearInt = Jit->J_CC(CC_NZ); Jit->MOV(32, M(&PC), Imm32(InstLoc)); Jit->WriteExceptionExit(); - Jit->SetJumpTarget(clearInt); + Jit->SetJumpTarget(noCPInt); Jit->SetJumpTarget(noExtException); break; diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.cpp b/Source/Core/VideoCommon/Src/CommandProcessor.cpp index dbe09aaa0e..38b342b76c 100644 --- a/Source/Core/VideoCommon/Src/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/Src/CommandProcessor.cpp @@ -56,6 +56,7 @@ static bool bProcessFifoToLoWatermark = false; static bool bProcessFifoAllDistance = false; volatile bool isPossibleWaitingSetDrawDone = false; +volatile bool isHiWatermarkActive = false; volatile bool interruptSet= false; volatile bool interruptWaiting= false; volatile bool interruptTokenWaiting = false; @@ -85,7 +86,7 @@ void DoState(PointerWrap &p) p.Do(bProcessFifoToLoWatermark); p.Do(bProcessFifoAllDistance); - + p.Do(isHiWatermarkActive); p.Do(isPossibleWaitingSetDrawDone); p.Do(interruptSet); p.Do(interruptWaiting); @@ -133,6 +134,7 @@ void Init() bProcessFifoToLoWatermark = false; bProcessFifoAllDistance = false; isPossibleWaitingSetDrawDone = false; + isHiWatermarkActive = false; et_UpdateInterrupts = CoreTiming::RegisterEvent("UpdateInterrupts", UpdateInterrupts_Wrapper); } @@ -141,7 +143,6 @@ void Read16(u16& _rReturnValue, const u32 _Address) { INFO_LOG(COMMANDPROCESSOR, "(r): 0x%08x", _Address); - ProcessFifoEvents(); switch (_Address & 0xFFF) { case STATUS_REGISTER: @@ -409,7 +410,6 @@ void Write16(const u16 _Value, const u32 _Address) if (!IsOnThread()) RunGpu(); - ProcessFifoEvents(); } void Read32(u32& _rReturnValue, const u32 _Address) @@ -425,7 +425,6 @@ void Write32(const u32 _Data, const u32 _Address) void STACKALIGN GatherPipeBursted() { - ProcessFifoEvents(); // if we aren't linked, we don't care about gather pipe data if (!m_CPCtrlReg.GPLinkEnable) { @@ -487,17 +486,18 @@ void AbortFrame() void SetOverflowStatusFromGatherPipe() { - if (!fifo.bFF_HiWatermarkInt) return; + fifo.bFF_HiWatermark = (fifo.CPReadWriteDistance > fifo.CPHiWatermark); - fifo.bFF_LoWatermark = (fifo.CPReadWriteDistance < fifo.CPLoWatermark); + isHiWatermarkActive = fifo.bFF_HiWatermark && fifo.bFF_HiWatermarkInt && m_CPCtrlReg.GPReadEnable; - bool interrupt = fifo.bFF_HiWatermark && fifo.bFF_HiWatermarkInt && - m_CPCtrlReg.GPLinkEnable && m_CPCtrlReg.GPReadEnable; - - if (interrupt != interruptSet && interrupt) - CommandProcessor::UpdateInterrupts(true); - + if (isHiWatermarkActive) + { + interruptSet = true; + INFO_LOG(COMMANDPROCESSOR,"Interrupt set"); + ProcessorInterface::SetInterrupt(INT_CAUSE_CP, true); + } + } void SetCpStatus() @@ -505,7 +505,7 @@ void SetCpStatus() // overflow & underflow check fifo.bFF_HiWatermark = (fifo.CPReadWriteDistance > fifo.CPHiWatermark); fifo.bFF_LoWatermark = (fifo.CPReadWriteDistance < fifo.CPLoWatermark); - + // breakpoint if (fifo.bFF_BPEnable) @@ -540,13 +540,18 @@ void SetCpStatus() bool interrupt = (bpInt || ovfInt || undfInt) && m_CPCtrlReg.GPReadEnable; + isHiWatermarkActive = ovfInt && m_CPCtrlReg.GPReadEnable; + if (interrupt != interruptSet && !interruptWaiting) { u64 userdata = interrupt?1:0; if (IsOnThread()) { - interruptWaiting = true; - CommandProcessor::UpdateInterruptsFromVideoBackend(userdata); + if(!interrupt || bpInt || undfInt) + { + interruptWaiting = true; + CommandProcessor::UpdateInterruptsFromVideoBackend(userdata); + } } else CommandProcessor::UpdateInterrupts(userdata); @@ -631,8 +636,8 @@ void SetCpControlRegister() ProcessorInterface::Fifo_CPUEnd = fifo.CPEnd; } // If overflown happens process the fifo to LoWatemark - if (bProcessFifoToLoWatermark) - ProcessFifoToLoWatermark(); + //if (bProcessFifoToLoWatermark) + // ProcessFifoToLoWatermark(); if(fifo.bFF_GPReadEnable && !m_CPCtrlReg.GPReadEnable) { diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.h b/Source/Core/VideoCommon/Src/CommandProcessor.h index bb969fcb95..2bf965a3ba 100644 --- a/Source/Core/VideoCommon/Src/CommandProcessor.h +++ b/Source/Core/VideoCommon/Src/CommandProcessor.h @@ -31,6 +31,7 @@ namespace CommandProcessor extern SCPFifoStruct fifo; //This one is shared between gfx thread and emulator thread. extern volatile bool isPossibleWaitingSetDrawDone; //This one is used for sync gfx thread and emulator thread. +extern volatile bool isHiWatermarkActive; extern volatile bool interruptSet; extern volatile bool interruptWaiting; extern volatile bool interruptTokenWaiting; diff --git a/Source/Core/VideoCommon/Src/MainBase.cpp b/Source/Core/VideoCommon/Src/MainBase.cpp index af21ebbb94..0b1258a662 100644 --- a/Source/Core/VideoCommon/Src/MainBase.cpp +++ b/Source/Core/VideoCommon/Src/MainBase.cpp @@ -250,6 +250,11 @@ bool VideoBackendHardware::Video_IsPossibleWaitingSetDrawDone() return CommandProcessor::isPossibleWaitingSetDrawDone; } +bool VideoBackendHardware::Video_IsHiWatermarkActive() +{ + return CommandProcessor::isHiWatermarkActive; +} + void VideoBackendHardware::Video_AbortFrame() { CommandProcessor::AbortFrame(); diff --git a/Source/Core/VideoCommon/Src/PixelEngine.cpp b/Source/Core/VideoCommon/Src/PixelEngine.cpp index 456e0fb535..ec0683742f 100644 --- a/Source/Core/VideoCommon/Src/PixelEngine.cpp +++ b/Source/Core/VideoCommon/Src/PixelEngine.cpp @@ -180,7 +180,6 @@ void Init() void Read16(u16& _uReturnValue, const u32 _iAddress) { DEBUG_LOG(PIXELENGINE, "(r16) 0x%08x", _iAddress); - CommandProcessor::ProcessFifoEvents(); switch (_iAddress & 0xFFF) { // CPU Direct Access EFB Raster State Config @@ -334,7 +333,6 @@ void Write16(const u16 _iValue, const u32 _iAddress) break; } - CommandProcessor::ProcessFifoEvents(); } void Write32(const u32 _iValue, const u32 _iAddress) diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp index abfd9155f5..c591bd0957 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp @@ -215,6 +215,12 @@ bool VideoSoftware::Video_IsPossibleWaitingSetDrawDone(void) return false; } +bool VideoSoftware::Video_IsHiWatermarkActive(void) +{ + return false; +} + + void VideoSoftware::Video_AbortFrame(void) { } diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/VideoBackend.h b/Source/Plugins/Plugin_VideoSoftware/Src/VideoBackend.h index 08b4c155ad..7c52e34291 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/VideoBackend.h +++ b/Source/Plugins/Plugin_VideoSoftware/Src/VideoBackend.h @@ -36,7 +36,7 @@ class VideoSoftware : public VideoBackend void Video_SetRendering(bool bEnabled); void Video_GatherPipeBursted(); - + bool Video_IsHiWatermarkActive(); bool Video_IsPossibleWaitingSetDrawDone(); void Video_AbortFrame(); From c2e6fdf09f33f7765526fac680d13af9ba744125 Mon Sep 17 00:00:00 2001 From: marcosvitali Date: Thu, 8 Mar 2012 02:47:55 -0300 Subject: [PATCH 07/32] - I've fixed possibles random hangs in DC mode. - I've fixed hangs in DC mode in (Simpsons, Monkey Island, Pokemon XD, etc) - I've implemented accurate manage of Pixel Engine Interrupts, now the GPU loop is stopped when a PE Interrupt needs to be managed and resume when Pixel Engine finish, I think now, the Fifo in DC mode is more accurate than SC mode. :) Time to close the big fifo Issue 3694 (snif), please if you have a possible fifo issue report this like a game issue. I was working with Skid_AU together, especially thanks for him. Test a lot all games, and compare the performance with the master maybe this accuracy has a cost (not a lot). I think now the fifo is very stable, overflow fixed, random hang fixed, if you have a game with a hang with this rev and not in master please report this. --- Source/Core/VideoCommon/Src/CommandProcessor.cpp | 5 +++-- Source/Core/VideoCommon/Src/Fifo.cpp | 3 ++- Source/Core/VideoCommon/Src/PixelEngine.cpp | 5 +++++ Source/Core/VideoCommon/Src/PixelEngine.h | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.cpp b/Source/Core/VideoCommon/Src/CommandProcessor.cpp index 38b342b76c..4fd7e88f5e 100644 --- a/Source/Core/VideoCommon/Src/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/Src/CommandProcessor.cpp @@ -596,8 +596,8 @@ void SetCpStatusRegister() // Here always there is one fifo attached to the GPU m_CPStatusReg.Breakpoint = fifo.bFF_Breakpoint; - m_CPStatusReg.ReadIdle = (fifo.CPReadPointer == fifo.CPWritePointer) || (fifo.CPReadPointer == fifo.CPBreakpoint); - m_CPStatusReg.CommandIdle = !fifo.CPReadWriteDistance; + m_CPStatusReg.ReadIdle = (fifo.CPReadPointer == fifo.CPWritePointer) || (fifo.CPReadPointer == fifo.CPBreakpoint) ; + m_CPStatusReg.CommandIdle = !fifo.CPReadWriteDistance || (IsOnThread() && PixelEngine::WaitingForPEInterrupt()); m_CPStatusReg.UnderflowLoWatermark = fifo.bFF_LoWatermark; m_CPStatusReg.OverflowHiWatermark = fifo.bFF_HiWatermark; @@ -620,6 +620,7 @@ void SetCpControlRegister() if (!fifo.bFF_GPReadEnable && m_CPCtrlReg.GPReadEnable && !m_CPCtrlReg.BPEnable) { + ProcessFifoEvents(); PixelEngine::ResetSetFinish(); } diff --git a/Source/Core/VideoCommon/Src/Fifo.cpp b/Source/Core/VideoCommon/Src/Fifo.cpp index 5cb3252816..2e60055c97 100644 --- a/Source/Core/VideoCommon/Src/Fifo.cpp +++ b/Source/Core/VideoCommon/Src/Fifo.cpp @@ -22,6 +22,7 @@ #include "Atomic.h" #include "OpcodeDecoding.h" #include "CommandProcessor.h" +#include "PixelEngine.h" #include "ChunkFile.h" #include "Fifo.h" #include "HW/Memmap.h" @@ -137,7 +138,7 @@ void RunGpuLoop() CommandProcessor::SetCpStatus(); // check if we are able to run this buffer - while (!CommandProcessor::interruptWaiting && fifo.bFF_GPReadEnable && fifo.CPReadWriteDistance && !AtBreakpoint()) + while (GpuRunningState && !CommandProcessor::interruptWaiting && fifo.bFF_GPReadEnable && fifo.CPReadWriteDistance && !AtBreakpoint() && !PixelEngine::WaitingForPEInterrupt()) { if (!GpuRunningState) break; diff --git a/Source/Core/VideoCommon/Src/PixelEngine.cpp b/Source/Core/VideoCommon/Src/PixelEngine.cpp index ec0683742f..09cb9b8a5c 100644 --- a/Source/Core/VideoCommon/Src/PixelEngine.cpp +++ b/Source/Core/VideoCommon/Src/PixelEngine.cpp @@ -468,4 +468,9 @@ void ResetSetToken() } CommandProcessor::interruptTokenWaiting = false; } + +bool WaitingForPEInterrupt() +{ + return CommandProcessor::interruptFinishWaiting || CommandProcessor::interruptTokenWaiting || interruptSetFinish || interruptSetToken; +} } // end of namespace PixelEngine diff --git a/Source/Core/VideoCommon/Src/PixelEngine.h b/Source/Core/VideoCommon/Src/PixelEngine.h index dd0304fbe1..5e64300ef3 100644 --- a/Source/Core/VideoCommon/Src/PixelEngine.h +++ b/Source/Core/VideoCommon/Src/PixelEngine.h @@ -80,7 +80,7 @@ void SetToken(const u16 _token, const int _bSetTokenAcknowledge); void SetFinish(void); void ResetSetFinish(void); void ResetSetToken(void); -bool AllowIdleSkipping(); +bool WaitingForPEInterrupt(); // Bounding box functionality. Paper Mario (both) are a couple of the few games that use it. extern u16 bbox[4]; From 41652d6b1f391fdcd0f599463f689c0299cdc007 Mon Sep 17 00:00:00 2001 From: marcosvitali Date: Fri, 9 Mar 2012 01:33:29 -0300 Subject: [PATCH 08/32] I've fixed Metroid Prime 3 and 2 desync. And other games with desync because of FIFO Reset. That happens because FIFO_RW_DISTANCE_HI must be written first, for checking fifo.CPReadWriteDistance == 0, so some fifo resets was not managed in the right way. I didn't test Metroid 2 desync reported in Issue 4336 but I think is the same. About the flickering in MP2, I don't know for my is not related or yes, but you can test anyway. Fixed Issue 3902 Well now the FIFO is 99.99% finished :) --- Source/Core/VideoCommon/Src/CommandProcessor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.cpp b/Source/Core/VideoCommon/Src/CommandProcessor.cpp index 4fd7e88f5e..a6e68f6298 100644 --- a/Source/Core/VideoCommon/Src/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/Src/CommandProcessor.cpp @@ -388,10 +388,6 @@ void Write16(const u16 _Value, const u32 _Address) case FIFO_RW_DISTANCE_HI: WriteHigh((u32 &)fifo.CPReadWriteDistance, _Value); - DEBUG_LOG(COMMANDPROCESSOR,"try to write to FIFO_RW_DISTANCE_HI : %04x", _Value); - break; - case FIFO_RW_DISTANCE_LO: - WriteLow((u32 &)fifo.CPReadWriteDistance, _Value & 0xFFE0); if (fifo.CPReadWriteDistance == 0) { GPFifo::ResetGatherPipe(); @@ -401,6 +397,10 @@ void Write16(const u16 _Value, const u32 _Address) ResetVideoBuffer(); } IncrementCheckContextId(); + DEBUG_LOG(COMMANDPROCESSOR,"try to write to FIFO_RW_DISTANCE_HI : %04x", _Value); + break; + case FIFO_RW_DISTANCE_LO: + WriteLow((u32 &)fifo.CPReadWriteDistance, _Value & 0xFFE0); DEBUG_LOG(COMMANDPROCESSOR,"try to write to FIFO_RW_DISTANCE_LO : %04x", _Value); break; From 104603467be6cc15e63dfb5cadec8044edd1da46 Mon Sep 17 00:00:00 2001 From: marcosvitali Date: Fri, 9 Mar 2012 18:58:23 -0300 Subject: [PATCH 09/32] This commit fix games hanging because of my prior Revision c2e6fdf09f33 The external exceptions in dolphin are checking frequently but is different to real HW, so sometime the game is in a loop checking GPU STATUS, the exceptions doesn't checked, and the game hang.\ For solve this I need a trick: still waiting for the exception handler be linked but if CommandProcecsor is reading the GPStatus, resume this. This fixed "TimeSplitters: Future Perfect" broken in the Revision c2e6fdf09f33 and surely others games. --- Source/Core/VideoCommon/Src/CommandProcessor.cpp | 10 +++++++--- Source/Core/VideoCommon/Src/PixelEngine.cpp | 14 ++++++++------ Source/Core/VideoCommon/Src/PixelEngine.h | 1 + 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.cpp b/Source/Core/VideoCommon/Src/CommandProcessor.cpp index a6e68f6298..77c02d1692 100644 --- a/Source/Core/VideoCommon/Src/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/Src/CommandProcessor.cpp @@ -574,7 +574,7 @@ void ProcessFifoAllDistance() if (IsOnThread()) { while (!CommandProcessor::interruptWaiting && fifo.bFF_GPReadEnable && - fifo.CPReadWriteDistance && !AtBreakpoint()) + fifo.CPReadWriteDistance && !AtBreakpoint() && !PixelEngine::WaitingForPEInterrupt()) Common::YieldCPU(); } bProcessFifoAllDistance = false; @@ -597,10 +597,12 @@ void SetCpStatusRegister() m_CPStatusReg.Breakpoint = fifo.bFF_Breakpoint; m_CPStatusReg.ReadIdle = (fifo.CPReadPointer == fifo.CPWritePointer) || (fifo.CPReadPointer == fifo.CPBreakpoint) ; - m_CPStatusReg.CommandIdle = !fifo.CPReadWriteDistance || (IsOnThread() && PixelEngine::WaitingForPEInterrupt()); + m_CPStatusReg.CommandIdle = !fifo.CPReadWriteDistance; m_CPStatusReg.UnderflowLoWatermark = fifo.bFF_LoWatermark; m_CPStatusReg.OverflowHiWatermark = fifo.bFF_HiWatermark; - + + PixelEngine::ResumeWaitingForPEInterrupt(); + INFO_LOG(COMMANDPROCESSOR,"\t Read from STATUS_REGISTER : %04x", m_CPStatusReg.Hex); DEBUG_LOG(COMMANDPROCESSOR, "(r) status: iBP %s | fReadIdle %s | fCmdIdle %s | iOvF %s | iUndF %s" , m_CPStatusReg.Breakpoint ? "ON" : "OFF" @@ -609,6 +611,8 @@ void SetCpStatusRegister() , m_CPStatusReg.OverflowHiWatermark ? "ON" : "OFF" , m_CPStatusReg.UnderflowLoWatermark ? "ON" : "OFF" ); + + } void SetCpControlRegister() diff --git a/Source/Core/VideoCommon/Src/PixelEngine.cpp b/Source/Core/VideoCommon/Src/PixelEngine.cpp index 09cb9b8a5c..750e8fbb40 100644 --- a/Source/Core/VideoCommon/Src/PixelEngine.cpp +++ b/Source/Core/VideoCommon/Src/PixelEngine.cpp @@ -356,22 +356,16 @@ void UpdateInterrupts() void UpdateTokenInterrupt(bool active) { - if(interruptSetToken != active) - { ProcessorInterface::SetInterrupt(INT_CAUSE_PE_TOKEN, active); interruptSetToken = active; - } } void UpdateFinishInterrupt(bool active) { - if(interruptSetFinish != active) - { ProcessorInterface::SetInterrupt(INT_CAUSE_PE_FINISH, active); interruptSetFinish = active; if (active) State::ProcessRequestedStates(0); - } } // TODO(mb2): Refactor SetTokenINT_OnMainThread(u64 userdata, int cyclesLate). @@ -473,4 +467,12 @@ bool WaitingForPEInterrupt() { return CommandProcessor::interruptFinishWaiting || CommandProcessor::interruptTokenWaiting || interruptSetFinish || interruptSetToken; } + +void ResumeWaitingForPEInterrupt() +{ + interruptSetFinish = false; + interruptSetToken = false; + CommandProcessor::interruptFinishWaiting = false; + CommandProcessor::interruptTokenWaiting = false; +} } // end of namespace PixelEngine diff --git a/Source/Core/VideoCommon/Src/PixelEngine.h b/Source/Core/VideoCommon/Src/PixelEngine.h index 5e64300ef3..64f959009f 100644 --- a/Source/Core/VideoCommon/Src/PixelEngine.h +++ b/Source/Core/VideoCommon/Src/PixelEngine.h @@ -81,6 +81,7 @@ void SetFinish(void); void ResetSetFinish(void); void ResetSetToken(void); bool WaitingForPEInterrupt(); +void ResumeWaitingForPEInterrupt(); // Bounding box functionality. Paper Mario (both) are a couple of the few games that use it. extern u16 bbox[4]; From fedf6055ce2d1ac9862eac8c2c112160b8d7fbe8 Mon Sep 17 00:00:00 2001 From: marcosvitali Date: Sun, 11 Mar 2012 12:40:39 -0300 Subject: [PATCH 10/32] I've fixed Super Monkey Ball in some cases when the game write the WriteReadDistance need to be safe like the SafeCPRead. This fix is not related with the previous commits, but the previous commits help me to see that because in the new scenery SMB was hanging. May be in the past also doesn't boot some times because of that. Please Test FZero boot also. Thanks. --- .../Core/VideoCommon/Src/CommandProcessor.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.cpp b/Source/Core/VideoCommon/Src/CommandProcessor.cpp index 77c02d1692..dbf4907160 100644 --- a/Source/Core/VideoCommon/Src/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/Src/CommandProcessor.cpp @@ -171,11 +171,23 @@ void Read16(u16& _rReturnValue, const u32 _Address) case FIFO_LO_WATERMARK_HI: _rReturnValue = ReadHigh(fifo.CPLoWatermark); return; case FIFO_RW_DISTANCE_LO: + if (IsOnThread()) + if(fifo.CPWritePointer >= fifo.SafeCPReadPointer) + _rReturnValue = ReadLow (fifo.CPWritePointer - fifo.SafeCPReadPointer); + else + _rReturnValue = ReadLow (fifo.CPEnd - fifo.CPWritePointer + fifo.SafeCPReadPointer); + else _rReturnValue = ReadLow (fifo.CPReadWriteDistance); DEBUG_LOG(COMMANDPROCESSOR, "read FIFO_RW_DISTANCE_LO : %04x", _rReturnValue); return; case FIFO_RW_DISTANCE_HI: - _rReturnValue = ReadHigh(fifo.CPReadWriteDistance); + if (IsOnThread()) + if(fifo.CPWritePointer >= fifo.SafeCPReadPointer) + _rReturnValue = ReadHigh (fifo.CPWritePointer - fifo.SafeCPReadPointer); + else + _rReturnValue = ReadHigh (fifo.CPEnd - fifo.CPWritePointer + fifo.SafeCPReadPointer); + else + _rReturnValue = ReadHigh(fifo.CPReadWriteDistance); DEBUG_LOG(COMMANDPROCESSOR, "read FIFO_RW_DISTANCE_HI : %04x", _rReturnValue); return; case FIFO_WRITE_POINTER_LO: @@ -356,6 +368,7 @@ void Write16(const u16 _Value, const u32 _Address) break; case FIFO_READ_POINTER_HI: WriteHigh((u32 &)fifo.CPReadPointer, _Value); + fifo.SafeCPReadPointer = fifo.CPReadPointer; DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_READ_POINTER_HI : %04x", _Value); break; @@ -596,7 +609,7 @@ void SetCpStatusRegister() // Here always there is one fifo attached to the GPU m_CPStatusReg.Breakpoint = fifo.bFF_Breakpoint; - m_CPStatusReg.ReadIdle = (fifo.CPReadPointer == fifo.CPWritePointer) || (fifo.CPReadPointer == fifo.CPBreakpoint) ; + m_CPStatusReg.ReadIdle = !fifo.CPReadWriteDistance || (fifo.CPReadPointer == fifo.CPWritePointer) || (fifo.CPReadPointer == fifo.CPBreakpoint) ; m_CPStatusReg.CommandIdle = !fifo.CPReadWriteDistance; m_CPStatusReg.UnderflowLoWatermark = fifo.bFF_LoWatermark; m_CPStatusReg.OverflowHiWatermark = fifo.bFF_HiWatermark; From 352ab2ba4394180739d7315c0c505aab83ffe211 Mon Sep 17 00:00:00 2001 From: marcosvitali Date: Tue, 13 Mar 2012 01:44:10 -0300 Subject: [PATCH 11/32] Improved the CheckException for the GatherPipe writes in JIT, now only the External Exceptions are processed. We Didn't Check 0x0008000 in PowerPC::ppcState.msr this was killing the performance, this also fix a hang when this check is performed. SMG for example. Deleted the HiWatermark condition from GPFifo. Please test games affected in this Revision 9e649ce79850, and games affected in this Revision b0f75f17ae19. I do not want to excite the game players of 'The Las Story', but Could test again the random hangs with this rev? Thanks --- Source/Core/Core/Src/HW/GPFifo.cpp | 2 +- Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/Src/HW/GPFifo.cpp b/Source/Core/Core/Src/HW/GPFifo.cpp index 9bae7bb621..77fdbf5933 100644 --- a/Source/Core/Core/Src/HW/GPFifo.cpp +++ b/Source/Core/Core/Src/HW/GPFifo.cpp @@ -99,7 +99,7 @@ void STACKALIGN CheckGatherPipe() // Profile where the FIFO writes are occurring. - if (g_video_backend->Video_IsHiWatermarkActive() && jit && (jit->js.fifoWriteAddresses.find(PC)) == (jit->js.fifoWriteAddresses.end())) + if (jit && (jit->js.fifoWriteAddresses.find(PC)) == (jit->js.fifoWriteAddresses.end())) { jit->js.fifoWriteAddresses.insert(PC); diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp index 417d1159da..b23964b071 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp @@ -576,14 +576,21 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc gpr.Flush(FLUSH_ALL); fpr.Flush(FLUSH_ALL); + + TEST(32, M((void *)&PowerPC::ppcState.Exceptions), Imm32(EXCEPTION_ISI | EXCEPTION_PROGRAM | EXCEPTION_SYSCALL | EXCEPTION_FPU_UNAVAILABLE | EXCEPTION_DSI | EXCEPTION_ALIGNMENT | EXCEPTION_DECREMENTER)); + FixupBranch clearInt = J_CC(CC_NZ); TEST(32, M((void *)&PowerPC::ppcState.Exceptions), Imm32(EXCEPTION_EXTERNAL_INT)); FixupBranch noExtException = J_CC(CC_Z); - TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_CP)); + TEST(32, M((void *)&PowerPC::ppcState.msr), Imm32(0x0008000)); FixupBranch noCPInt = J_CC(CC_Z); - + TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_CP)); + FixupBranch noCPInt2 = J_CC(CC_Z); + MOV(32, M(&PC), Imm32(ops[i].address)); WriteExceptionExit(); + SetJumpTarget(clearInt); + SetJumpTarget(noCPInt2); SetJumpTarget(noCPInt); SetJumpTarget(noExtException); } From dc79d68e72f04f60366484f60bff1e39d7e6babe Mon Sep 17 00:00:00 2001 From: skidau Date: Tue, 13 Mar 2012 22:35:11 +1100 Subject: [PATCH 12/32] Added the corresponding change from r352ab2ba4394 into JITIL. Tidied some code. --- Source/Core/Core/Src/HW/GPFifo.cpp | 1 - Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp | 16 +++++---- .../Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp | 7 +++- .../Core/Src/PowerPC/JitCommon/JitBase.cpp | 2 ++ .../Core/Core/Src/PowerPC/JitCommon/JitBase.h | 3 -- .../Core/VideoCommon/Src/CommandProcessor.cpp | 34 ++++++------------- .../Core/VideoCommon/Src/CommandProcessor.h | 1 - Source/Core/VideoCommon/Src/PixelEngine.cpp | 3 -- 8 files changed, 28 insertions(+), 39 deletions(-) diff --git a/Source/Core/Core/Src/HW/GPFifo.cpp b/Source/Core/Core/Src/HW/GPFifo.cpp index 77fdbf5933..3af387792f 100644 --- a/Source/Core/Core/Src/HW/GPFifo.cpp +++ b/Source/Core/Core/Src/HW/GPFifo.cpp @@ -98,7 +98,6 @@ void STACKALIGN CheckGatherPipe() memmove(m_gatherPipe, m_gatherPipe + cnt, m_gatherPipeCount); // Profile where the FIFO writes are occurring. - if (jit && (jit->js.fifoWriteAddresses.find(PC)) == (jit->js.fifoWriteAddresses.end())) { jit->js.fifoWriteAddresses.insert(PC); diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp index b23964b071..1506170b2b 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp @@ -42,6 +42,9 @@ #include "JitRegCache.h" #include "Jit64_Tables.h" #include "HW/ProcessorInterface.h" +#if defined(_DEBUG) || defined(DEBUGFAST) +#include "PowerPCDisasm.h" +#endif using namespace Gen; using namespace PowerPC; @@ -576,23 +579,22 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc gpr.Flush(FLUSH_ALL); fpr.Flush(FLUSH_ALL); - TEST(32, M((void *)&PowerPC::ppcState.Exceptions), Imm32(EXCEPTION_ISI | EXCEPTION_PROGRAM | EXCEPTION_SYSCALL | EXCEPTION_FPU_UNAVAILABLE | EXCEPTION_DSI | EXCEPTION_ALIGNMENT | EXCEPTION_DECREMENTER)); FixupBranch clearInt = J_CC(CC_NZ); TEST(32, M((void *)&PowerPC::ppcState.Exceptions), Imm32(EXCEPTION_EXTERNAL_INT)); FixupBranch noExtException = J_CC(CC_Z); TEST(32, M((void *)&PowerPC::ppcState.msr), Imm32(0x0008000)); - FixupBranch noCPInt = J_CC(CC_Z); + FixupBranch noExtIntEnable = J_CC(CC_Z); TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_CP)); - FixupBranch noCPInt2 = J_CC(CC_Z); - + FixupBranch noCPInt = J_CC(CC_Z); + MOV(32, M(&PC), Imm32(ops[i].address)); WriteExceptionExit(); - SetJumpTarget(clearInt); - SetJumpTarget(noCPInt2); SetJumpTarget(noCPInt); + SetJumpTarget(noExtIntEnable); SetJumpTarget(noExtException); + SetJumpTarget(clearInt); } Jit64Tables::CompileInstruction(ops[i]); @@ -619,7 +621,7 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc { char ppcInst[256]; DisassembleGekko(ops[i].inst.hex, em_address, ppcInst, 256); - NOTICE_LOG(DYNA_REC, "Unflushed reg: %s", ppcInst); + DEBUG_LOG(DYNA_REC, "Unflushed reg: %s", ppcInst); } #endif diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp index 811440d098..f82e34b5b1 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp @@ -1925,17 +1925,22 @@ static void DoWriteCode(IRBuilder* ibuild, JitIL* Jit, bool UseProfile, bool Mak case ExtExceptionCheck: { unsigned InstLoc = ibuild->GetImmValue(getOp1(I)); + Jit->TEST(32, M((void *)&PowerPC::ppcState.Exceptions), Imm32(EXCEPTION_ISI | EXCEPTION_PROGRAM | EXCEPTION_SYSCALL | EXCEPTION_FPU_UNAVAILABLE | EXCEPTION_DSI | EXCEPTION_ALIGNMENT | EXCEPTION_DECREMENTER)); + FixupBranch clearInt = Jit->J_CC(CC_NZ); Jit->TEST(32, M((void *)&PowerPC::ppcState.Exceptions), Imm32(EXCEPTION_EXTERNAL_INT)); FixupBranch noExtException = Jit->J_CC(CC_Z); + Jit->TEST(32, M((void *)&PowerPC::ppcState.msr), Imm32(0x0008000)); + FixupBranch noExtIntEnable = Jit->J_CC(CC_Z); Jit->TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_CP)); FixupBranch noCPInt = Jit->J_CC(CC_Z); Jit->MOV(32, M(&PC), Imm32(InstLoc)); Jit->WriteExceptionExit(); - Jit->SetJumpTarget(noCPInt); + Jit->SetJumpTarget(noExtIntEnable); Jit->SetJumpTarget(noExtException); + Jit->SetJumpTarget(clearInt); break; } case Int3: { diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/JitBase.cpp b/Source/Core/Core/Src/PowerPC/JitCommon/JitBase.cpp index 7f6cac8dd3..6203a81e15 100644 --- a/Source/Core/Core/Src/PowerPC/JitCommon/JitBase.cpp +++ b/Source/Core/Core/Src/PowerPC/JitCommon/JitBase.cpp @@ -13,6 +13,8 @@ // If not, see http://www.gnu.org/licenses/ #include "JitBase.h" +#include "PowerPCDisasm.h" +#include "disasm.h" JitBase *jit; diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/JitBase.h b/Source/Core/Core/Src/PowerPC/JitCommon/JitBase.h index be80754bdc..c2febde722 100644 --- a/Source/Core/Core/Src/PowerPC/JitCommon/JitBase.h +++ b/Source/Core/Core/Src/PowerPC/JitCommon/JitBase.h @@ -28,9 +28,6 @@ #include "JitBackpatch.h" // for EmuCodeBlock #include "JitAsmCommon.h" -#include "PowerPCDisasm.h" -#include "disasm.h" - #include #define JIT_OPCODE 0 diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.cpp b/Source/Core/VideoCommon/Src/CommandProcessor.cpp index dbf4907160..3744acd200 100644 --- a/Source/Core/VideoCommon/Src/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/Src/CommandProcessor.cpp @@ -141,7 +141,6 @@ void Init() void Read16(u16& _rReturnValue, const u32 _Address) { - INFO_LOG(COMMANDPROCESSOR, "(r): 0x%08x", _Address); switch (_Address & 0xFFF) { @@ -177,7 +176,7 @@ void Read16(u16& _rReturnValue, const u32 _Address) else _rReturnValue = ReadLow (fifo.CPEnd - fifo.CPWritePointer + fifo.SafeCPReadPointer); else - _rReturnValue = ReadLow (fifo.CPReadWriteDistance); + _rReturnValue = ReadLow (fifo.CPReadWriteDistance); DEBUG_LOG(COMMANDPROCESSOR, "read FIFO_RW_DISTANCE_LO : %04x", _rReturnValue); return; case FIFO_RW_DISTANCE_HI: @@ -187,7 +186,7 @@ void Read16(u16& _rReturnValue, const u32 _Address) else _rReturnValue = ReadHigh (fifo.CPEnd - fifo.CPWritePointer + fifo.SafeCPReadPointer); else - _rReturnValue = ReadHigh(fifo.CPReadWriteDistance); + _rReturnValue = ReadHigh(fifo.CPReadWriteDistance); DEBUG_LOG(COMMANDPROCESSOR, "read FIFO_RW_DISTANCE_HI : %04x", _rReturnValue); return; case FIFO_WRITE_POINTER_LO: @@ -499,18 +498,15 @@ void AbortFrame() void SetOverflowStatusFromGatherPipe() { - - fifo.bFF_HiWatermark = (fifo.CPReadWriteDistance > fifo.CPHiWatermark); isHiWatermarkActive = fifo.bFF_HiWatermark && fifo.bFF_HiWatermarkInt && m_CPCtrlReg.GPReadEnable; - + if (isHiWatermarkActive) { interruptSet = true; INFO_LOG(COMMANDPROCESSOR,"Interrupt set"); - ProcessorInterface::SetInterrupt(INT_CAUSE_CP, true); + ProcessorInterface::SetInterrupt(INT_CAUSE_CP, true); } - } void SetCpStatus() @@ -520,12 +516,10 @@ void SetCpStatus() fifo.bFF_LoWatermark = (fifo.CPReadWriteDistance < fifo.CPLoWatermark); // breakpoint - if (fifo.bFF_BPEnable) { if (fifo.CPBreakpoint == fifo.CPReadPointer) - { - + { if (!fifo.bFF_Breakpoint) { INFO_LOG(COMMANDPROCESSOR, "Hit breakpoint at %i", fifo.CPReadPointer); @@ -607,15 +601,16 @@ void Shutdown() void SetCpStatusRegister() { // Here always there is one fifo attached to the GPU - m_CPStatusReg.Breakpoint = fifo.bFF_Breakpoint; m_CPStatusReg.ReadIdle = !fifo.CPReadWriteDistance || (fifo.CPReadPointer == fifo.CPWritePointer) || (fifo.CPReadPointer == fifo.CPBreakpoint) ; m_CPStatusReg.CommandIdle = !fifo.CPReadWriteDistance; m_CPStatusReg.UnderflowLoWatermark = fifo.bFF_LoWatermark; m_CPStatusReg.OverflowHiWatermark = fifo.bFF_HiWatermark; - - PixelEngine::ResumeWaitingForPEInterrupt(); - + + // HACK to compensate for slow response to PE interrupts in Time Splitters: Future Perfect + if (IsOnThread()) + PixelEngine::ResumeWaitingForPEInterrupt(); + INFO_LOG(COMMANDPROCESSOR,"\t Read from STATUS_REGISTER : %04x", m_CPStatusReg.Hex); DEBUG_LOG(COMMANDPROCESSOR, "(r) status: iBP %s | fReadIdle %s | fCmdIdle %s | iOvF %s | iUndF %s" , m_CPStatusReg.Breakpoint ? "ON" : "OFF" @@ -624,13 +619,10 @@ void SetCpStatusRegister() , m_CPStatusReg.OverflowHiWatermark ? "ON" : "OFF" , m_CPStatusReg.UnderflowLoWatermark ? "ON" : "OFF" ); - - } void SetCpControlRegister() { - // If the new fifo is being attached We make sure there wont be SetFinish event pending. // This protection fix eternal darkness booting, because the second SetFinish event when it is booting // seems invalid or has a bug and hang the game. @@ -638,7 +630,7 @@ void SetCpControlRegister() if (!fifo.bFF_GPReadEnable && m_CPCtrlReg.GPReadEnable && !m_CPCtrlReg.BPEnable) { ProcessFifoEvents(); - PixelEngine::ResetSetFinish(); + PixelEngine::ResetSetFinish(); } fifo.bFF_BPInt = m_CPCtrlReg.BPInt; @@ -653,9 +645,6 @@ void SetCpControlRegister() ProcessorInterface::Fifo_CPUBase = fifo.CPBase; ProcessorInterface::Fifo_CPUEnd = fifo.CPEnd; } - // If overflown happens process the fifo to LoWatemark - //if (bProcessFifoToLoWatermark) - // ProcessFifoToLoWatermark(); if(fifo.bFF_GPReadEnable && !m_CPCtrlReg.GPReadEnable) { @@ -667,7 +656,6 @@ void SetCpControlRegister() fifo.bFF_GPReadEnable = m_CPCtrlReg.GPReadEnable; } - DEBUG_LOG(COMMANDPROCESSOR, "\t GPREAD %s | BP %s | Int %s | OvF %s | UndF %s | LINK %s" , fifo.bFF_GPReadEnable ? "ON" : "OFF" , fifo.bFF_BPEnable ? "ON" : "OFF" diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.h b/Source/Core/VideoCommon/Src/CommandProcessor.h index 2bf965a3ba..440c900dc3 100644 --- a/Source/Core/VideoCommon/Src/CommandProcessor.h +++ b/Source/Core/VideoCommon/Src/CommandProcessor.h @@ -25,7 +25,6 @@ class PointerWrap; extern bool MT; - namespace CommandProcessor { diff --git a/Source/Core/VideoCommon/Src/PixelEngine.cpp b/Source/Core/VideoCommon/Src/PixelEngine.cpp index 750e8fbb40..38c85cc10c 100644 --- a/Source/Core/VideoCommon/Src/PixelEngine.cpp +++ b/Source/Core/VideoCommon/Src/PixelEngine.cpp @@ -322,7 +322,6 @@ void Write16(const u16 _iValue, const u32 _iAddress) break; case PE_TOKEN_REG: - //LOG(PIXELENGINE,"WEIRD: program wrote token: %i",_iValue); PanicAlert("(w16) WTF? PowerPC program wrote token: %i", _iValue); //only the gx pipeline is supposed to be able to write here //g_token = _iValue; @@ -384,8 +383,6 @@ void SetToken_OnMainThread(u64 userdata, int cyclesLate) CommandProcessor::interruptTokenWaiting = false; IncrementCheckContextId(); //} - //else - // LOGV(PIXELENGINE, 1, "VIDEO Backend wrote token: %i", CommandProcessor::fifo.PEToken); } void SetFinish_OnMainThread(u64 userdata, int cyclesLate) From 8ed6ea3b076a3d1aec2a170d0c71dc1a12122371 Mon Sep 17 00:00:00 2001 From: skidau Date: Thu, 15 Mar 2012 21:48:19 +1100 Subject: [PATCH 13/32] Sped up the Dolphin debugger in JIT mode by splitting a block only while stepping or when it contains a breakpoint. The block is invalidated when a breakpoint is set or cleared. Fixed a bug in the JitCache where the JIT icache was not being invalidated when a block containing the instruction was destroyed. --- Source/Core/Common/Src/BreakPoints.cpp | 23 +++++++++++++++++-- Source/Core/Common/Src/BreakPoints.h | 2 +- Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp | 19 ++++++++++++--- Source/Core/Core/Src/PowerPC/Jit64IL/IR.cpp | 3 ++- Source/Core/Core/Src/PowerPC/Jit64IL/IR.h | 5 +++- .../Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp | 12 ++++++++++ .../Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp | 9 ++++++-- .../Core/Src/PowerPC/JitCommon/JitCache.cpp | 18 +++++++++++++++ 8 files changed, 81 insertions(+), 10 deletions(-) diff --git a/Source/Core/Common/Src/BreakPoints.cpp b/Source/Core/Common/Src/BreakPoints.cpp index 45a0b52daf..9164312f82 100644 --- a/Source/Core/Common/Src/BreakPoints.cpp +++ b/Source/Core/Common/Src/BreakPoints.cpp @@ -19,6 +19,7 @@ #include "DebugInterface.h" #include "BreakPoints.h" #include +#include "..\..\Core\Src\PowerPC\JitCommon\JitBase.h" bool BreakPoints::IsAddressBreakPoint(u32 _iAddress) { @@ -70,7 +71,11 @@ void BreakPoints::AddFromStrings(const TBreakPointsStr& bps) void BreakPoints::Add(const TBreakPoint& bp) { if (!IsAddressBreakPoint(bp.iAddress)) + { m_BreakPoints.push_back(bp); + if (jit) + jit->GetBlockCache()->InvalidateICache(bp.iAddress, 4); + } } void BreakPoints::Add(u32 em_address, bool temp) @@ -83,21 +88,35 @@ void BreakPoints::Add(u32 em_address, bool temp) pt.iAddress = em_address; m_BreakPoints.push_back(pt); + + if (jit) + jit->GetBlockCache()->InvalidateICache(em_address, 4); } } -void BreakPoints::Remove(u32 _iAddress) +void BreakPoints::Remove(u32 em_address) { for (TBreakPoints::iterator i = m_BreakPoints.begin(); i != m_BreakPoints.end(); ++i) { - if (i->iAddress == _iAddress) + if (i->iAddress == em_address) { m_BreakPoints.erase(i); + if (jit) + jit->GetBlockCache()->InvalidateICache(em_address, 4); return; } } } +void BreakPoints::Clear() +{ + for (TBreakPoints::iterator i = m_BreakPoints.begin(); i != m_BreakPoints.end(); ++i) + { + if (jit) + jit->GetBlockCache()->InvalidateICache(i->iAddress, 4); + m_BreakPoints.erase(i); + } +} MemChecks::TMemChecksStr MemChecks::GetStrings() const { diff --git a/Source/Core/Common/Src/BreakPoints.h b/Source/Core/Common/Src/BreakPoints.h index a97452cde6..c742f812a7 100644 --- a/Source/Core/Common/Src/BreakPoints.h +++ b/Source/Core/Common/Src/BreakPoints.h @@ -78,7 +78,7 @@ public: // Remove Breakpoint void Remove(u32 _iAddress); - void Clear() { m_BreakPoints.clear(); }; + void Clear(); void DeleteByAddress(u32 _Address); diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp index 1506170b2b..cb9f66b7d4 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp @@ -415,9 +415,8 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc if (Core::g_CoreStartupParameter.bEnableDebugging) { - // Comment out the following to disable breakpoints (speed-up) - blockSize = 1; - broken_block = true; + if (GetState() == CPU_STEPPING) + blockSize = 1; Trace(); } @@ -597,6 +596,20 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc SetJumpTarget(clearInt); } + if (Core::g_CoreStartupParameter.bEnableDebugging && breakpoints.IsAddressBreakPoint(ops[i].address) && GetState() != CPU_STEPPING) + { + MOV(32, M(&PC), Imm32(ops[i].address)); + ABI_CallFunction(reinterpret_cast(&PowerPC::CheckBreakPoints)); + TEST(32, M((void*)PowerPC::GetStatePtr()), Imm32(0xFFFFFFFF)); + + FixupBranch noBreakpoint = J_CC(CC_Z); + gpr.Flush(FLUSH_ALL); + fpr.Flush(FLUSH_ALL); + + WriteExit(ops[i].address, 0); + SetJumpTarget(noBreakpoint); + } + Jit64Tables::CompileInstruction(ops[i]); if (js.memcheck && (opinfo->flags & FL_LOADSTORE)) diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/IR.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/IR.cpp index afab21b30e..7c3e7f0810 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/IR.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/IR.cpp @@ -1269,7 +1269,8 @@ static const unsigned alwaysUsedList[] = { Store16, Store32, StoreSingle, StoreDouble, StorePaired, StoreFReg, FDCmpCR, BlockStart, BlockEnd, IdleBranch, BranchCond, BranchUncond, ShortIdleLoop, SystemCall, InterpreterBranch, RFIExit, FPExceptionCheckStart, - FPExceptionCheckEnd, ISIException, ExtExceptionCheck, Int3, Tramp, Nop + FPExceptionCheckEnd, ISIException, ExtExceptionCheck, BreakPointCheck, + Int3, Tramp, Nop }; static const unsigned extra8RegList[] = { LoadGReg, LoadCR, LoadGQR, LoadFReg, LoadFRegDENToZero, diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/IR.h b/Source/Core/Core/Src/PowerPC/Jit64IL/IR.h index 284cbe6538..f41742b01c 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/IR.h +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/IR.h @@ -168,7 +168,7 @@ enum Opcode { // used for exception checking, at least until someone // has a better idea of integrating it FPExceptionCheckStart, FPExceptionCheckEnd, - ISIException,ExtExceptionCheck, + ISIException, ExtExceptionCheck, BreakPointCheck, // "Opcode" representing a register too far away to // reference directly; this is a size optimization Tramp, @@ -414,6 +414,9 @@ public: InstLoc EmitExtExceptionCheck(InstLoc pc) { return EmitUOp(ExtExceptionCheck, pc); } + InstLoc EmitBreakPointCheck(InstLoc pc) { + return EmitUOp(BreakPointCheck, pc); + } InstLoc EmitRFIExit() { return FoldZeroOp(RFIExit, 0); } diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp index f82e34b5b1..743eaf2030 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp @@ -763,6 +763,7 @@ static void DoWriteCode(IRBuilder* ibuild, JitIL* Jit, bool UseProfile, bool Mak case FPExceptionCheckEnd: case ISIException: case ExtExceptionCheck: + case BreakPointCheck: case Int3: case Tramp: // No liveness effects @@ -1943,6 +1944,17 @@ static void DoWriteCode(IRBuilder* ibuild, JitIL* Jit, bool UseProfile, bool Mak Jit->SetJumpTarget(clearInt); break; } + case BreakPointCheck: { + unsigned InstLoc = ibuild->GetImmValue(getOp1(I)); + + Jit->MOV(32, M(&PC), Imm32(InstLoc)); + Jit->ABI_CallFunction(reinterpret_cast(&PowerPC::CheckBreakPoints)); + Jit->TEST(32, M((void*)PowerPC::GetStatePtr()), Imm32(0xFFFFFFFF)); + FixupBranch noBreakpoint = Jit->J_CC(CC_Z); + Jit->WriteExit(InstLoc, 0); + Jit->SetJumpTarget(noBreakpoint); + break; + } case Int3: { Jit->INT3(); break; diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp index 96afff1613..7694722bb5 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp @@ -523,8 +523,8 @@ const u8* JitIL::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc if (Core::g_CoreStartupParameter.bEnableDebugging) { - // Comment out the following to disable breakpoints (speed-up) - blockSize = 1; + if (GetState() == CPU_STEPPING) + blockSize = 1; Trace(); } @@ -653,6 +653,11 @@ const u8* JitIL::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc { ibuild.EmitExtExceptionCheck(ibuild.EmitIntConst(ops[i].address)); } + + if (Core::g_CoreStartupParameter.bEnableDebugging && breakpoints.IsAddressBreakPoint(ops[i].address) && GetState() != CPU_STEPPING) + { + ibuild.EmitBreakPointCheck(ibuild.EmitIntConst(ops[i].address)); + } JitILTables::CompileInstruction(ops[i]); diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp b/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp index bccb218fd9..46096450e7 100644 --- a/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp +++ b/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp @@ -417,6 +417,24 @@ bool JitBlock::ContainsAddress(u32 em_address) std::map, u32>::iterator it1 = block_map.lower_bound(std::make_pair(address, 0)), it2 = it1, it; while (it2 != block_map.end() && it2->first.second < address + length) { +#ifdef JIT_UNLIMITED_ICACHE + JitBlock &b = blocks[it2->second]; + if (b.originalAddress & JIT_ICACHE_VMEM_BIT) + { + u32 cacheaddr = b.originalAddress & JIT_ICACHE_MASK; + memset(iCacheVMEM + cacheaddr, JIT_ICACHE_INVALID_BYTE, length); + } + else if (b.originalAddress & JIT_ICACHE_EXRAM_BIT) + { + u32 cacheaddr = b.originalAddress & JIT_ICACHEEX_MASK; + memset(iCacheEx + cacheaddr, JIT_ICACHE_INVALID_BYTE, length); + } + else + { + u32 cacheaddr = b.originalAddress & JIT_ICACHE_MASK; + memset(iCache + cacheaddr, JIT_ICACHE_INVALID_BYTE, length); + } +#endif DestroyBlock(it2->second, true); it2++; } From 05692b1e7e88d19d6045cc42464cc8ef11760c62 Mon Sep 17 00:00:00 2001 From: skidau Date: Fri, 16 Mar 2012 20:08:05 +1100 Subject: [PATCH 14/32] Sped up to the Dolphin debugger by not checking for breakpoints when stepping. Fixed the JIT cache, invalidating one instruction length at a time. Fixed a bug where the JIT cache did not get invalidated when stepping. Disabled fused instructions in the debugger. --- Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp | 2 +- Source/Core/Core/Src/PowerPC/Jit64/JitAsm.cpp | 3 +++ Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp | 2 +- Source/Core/Core/Src/PowerPC/Jit64IL/JitILAsm.cpp | 3 +++ Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp | 6 +++--- Source/Core/DolphinWX/Src/Debugger/CodeWindow.cpp | 2 ++ 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp index cb9f66b7d4..8140a075a2 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp @@ -601,8 +601,8 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc MOV(32, M(&PC), Imm32(ops[i].address)); ABI_CallFunction(reinterpret_cast(&PowerPC::CheckBreakPoints)); TEST(32, M((void*)PowerPC::GetStatePtr()), Imm32(0xFFFFFFFF)); - FixupBranch noBreakpoint = J_CC(CC_Z); + gpr.Flush(FLUSH_ALL); fpr.Flush(FLUSH_ALL); diff --git a/Source/Core/Core/Src/PowerPC/Jit64/JitAsm.cpp b/Source/Core/Core/Src/PowerPC/Jit64/JitAsm.cpp index b9aaa2df6a..04462872e6 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/JitAsm.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/JitAsm.cpp @@ -81,12 +81,15 @@ void Jit64AsmRoutineManager::Generate() if (Core::g_CoreStartupParameter.bEnableDebugging) { + TEST(32, M((void*)PowerPC::GetStatePtr()), Imm32(PowerPC::CPU_STEPPING)); + FixupBranch notStepping = J_CC(CC_Z); ABI_CallFunction(reinterpret_cast(&PowerPC::CheckBreakPoints)); TEST(32, M((void*)PowerPC::GetStatePtr()), Imm32(0xFFFFFFFF)); FixupBranch noBreakpoint = J_CC(CC_Z); ABI_PopAllCalleeSavedRegsAndAdjustStack(); RET(); SetJumpTarget(noBreakpoint); + SetJumpTarget(notStepping); } SetJumpTarget(skipToRealDispatch); diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp index 4980b4d7a4..5aaf4b99f1 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp @@ -266,7 +266,7 @@ void Jit64::reg_imm(UGeckoInstruction inst) case 15: if (a == 0) { // lis // Merge with next instruction if loading a 32-bits immediate value (lis + addi, lis + ori) - if (!js.isLastInstruction) { + if (!js.isLastInstruction && !Core::g_CoreStartupParameter.bEnableDebugging) { if ((js.next_inst.OPCD == 14) && (js.next_inst.RD == d) && (js.next_inst.RA == d)) { // addi gpr.SetImmediate32(d, ((u32)inst.SIMM_16 << 16) + (u32)(s32)js.next_inst.SIMM_16); js.downcountAmount++; diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/JitILAsm.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/JitILAsm.cpp index da94c881e3..ac533dd473 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/JitILAsm.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/JitILAsm.cpp @@ -83,12 +83,15 @@ void JitILAsmRoutineManager::Generate() if (Core::g_CoreStartupParameter.bEnableDebugging) { + TEST(32, M((void*)PowerPC::GetStatePtr()), Imm32(PowerPC::CPU_STEPPING)); + FixupBranch notStepping = J_CC(CC_Z); ABI_CallFunction(reinterpret_cast(&PowerPC::CheckBreakPoints)); TEST(32, M((void*)PowerPC::GetStatePtr()), Imm32(0xFFFFFFFF)); FixupBranch noBreakpoint = J_CC(CC_Z); ABI_PopAllCalleeSavedRegsAndAdjustStack(); RET(); SetJumpTarget(noBreakpoint); + SetJumpTarget(notStepping); } SetJumpTarget(skipToRealDispatch); diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp b/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp index 46096450e7..8cc85e3284 100644 --- a/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp +++ b/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp @@ -422,17 +422,17 @@ bool JitBlock::ContainsAddress(u32 em_address) if (b.originalAddress & JIT_ICACHE_VMEM_BIT) { u32 cacheaddr = b.originalAddress & JIT_ICACHE_MASK; - memset(iCacheVMEM + cacheaddr, JIT_ICACHE_INVALID_BYTE, length); + memset(iCacheVMEM + cacheaddr, JIT_ICACHE_INVALID_BYTE, 4); } else if (b.originalAddress & JIT_ICACHE_EXRAM_BIT) { u32 cacheaddr = b.originalAddress & JIT_ICACHEEX_MASK; - memset(iCacheEx + cacheaddr, JIT_ICACHE_INVALID_BYTE, length); + memset(iCacheEx + cacheaddr, JIT_ICACHE_INVALID_BYTE, 4); } else { u32 cacheaddr = b.originalAddress & JIT_ICACHE_MASK; - memset(iCache + cacheaddr, JIT_ICACHE_INVALID_BYTE, length); + memset(iCache + cacheaddr, JIT_ICACHE_INVALID_BYTE, 4); } #endif DestroyBlock(it2->second, true); diff --git a/Source/Core/DolphinWX/Src/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Src/Debugger/CodeWindow.cpp index 37ff81772a..0b6b366c88 100644 --- a/Source/Core/DolphinWX/Src/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Src/Debugger/CodeWindow.cpp @@ -263,6 +263,8 @@ void CCodeWindow::SingleStep() { if (CCPU::IsStepping()) { + if (jit) + jit->GetBlockCache()->InvalidateICache(PC, 4); CCPU::StepOpcode(&sync_event); wxThread::Sleep(20); // need a short wait here From 6fe495e1aa77730b7d26ee64a89c6ecb2ec20449 Mon Sep 17 00:00:00 2001 From: Matthew Parlane Date: Sun, 18 Mar 2012 21:00:23 +1300 Subject: [PATCH 15/32] Fixed Pokepark 2! Maybe... :D Don't trust save states, although I think they are correct. File fd's were too large. Let me know if file related loading stops working in some games. fds are many to 1, not 1 to 1. ES has two instances available at a time. Sadly a clean up requires changing IWII_IPC_HLE_Device Constructor, as a deviceID doesn't make much sense per device. I won't do this until we have less branches :| --- Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp | 370 +++++++++++------- Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.h | 15 +- .../Core/Src/IPC_HLE/WII_IPC_HLE_Device.h | 3 +- .../Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp | 50 ++- .../Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.h | 2 +- 5 files changed, 268 insertions(+), 172 deletions(-) diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp index 38baf7f43e..756e59305d 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp @@ -68,8 +68,13 @@ TDeviceMap g_DeviceMap; // STATE_TO_SAVE typedef std::map TFileNameMap; -TFileNameMap g_FileNameMap; -u32 g_LastDeviceID; + +#define IPC_MAX_FDS 0x18 +#define ES_MAX_COUNT 2 +IWII_IPC_HLE_Device* g_FdMap[IPC_MAX_FDS]; +bool es_inuse[ES_MAX_COUNT]; +IWII_IPC_HLE_Device* es_handles[ES_MAX_COUNT]; + typedef std::deque ipc_msg_queue; static ipc_msg_queue request_queue; // ppc -> arm @@ -78,14 +83,27 @@ static ipc_msg_queue reply_queue; // arm -> ppc void Init() { _dbg_assert_msg_(WII_IPC_HLE, g_DeviceMap.empty(), "DeviceMap isnt empty on init"); + + u32 i; + for(i=0; iIsHardware()) + { + // close all files and delete their resources + g_FdMap[i]->Close(0, true); + delete g_FdMap[i]; + } + g_FdMap[i] = NULL; + } + TDeviceMap::iterator itr = g_DeviceMap.begin(); while (itr != g_DeviceMap.end()) { @@ -111,21 +139,17 @@ void Reset(bool _bHard) // Force close itr->second->Close(0, true); // Hardware should not be deleted unless it is a hard reset - if (_bHard || !itr->second->IsHardware()) + if (_bHard) delete itr->second; } ++itr; } - // Skip hardware devices if not a hard reset - itr = (_bHard) ? g_DeviceMap.begin() : g_DeviceMap.lower_bound(IPC_FIRST_FILEIO_ID); - // Erase devices - g_DeviceMap.erase(itr, g_DeviceMap.end()); - g_FileNameMap.clear(); - + if (_bHard) + { + g_DeviceMap.erase(g_DeviceMap.begin(), g_DeviceMap.end()); + } request_queue.clear(); reply_queue.clear(); - - g_LastDeviceID = IPC_FIRST_FILEIO_ID; } void Shutdown() @@ -135,41 +159,52 @@ void Shutdown() void SetDefaultContentFile(const std::string& _rFilename) { - CWII_IPC_HLE_Device_es* pDevice = - (CWII_IPC_HLE_Device_es*)AccessDeviceByID(GetDeviceIDByName(std::string("/dev/es"))); - if (pDevice) - pDevice->LoadWAD(_rFilename); + TDeviceMap::const_iterator itr = g_DeviceMap.begin(); + while(itr != g_DeviceMap.end()) + { + if (itr->second && itr->second->GetDeviceName().find(std::string("/dev/es")) == 0) + { + ((CWII_IPC_HLE_Device_es*)itr->second)->LoadWAD(_rFilename); + } + ++itr; + } } void ES_DIVerify(u8 *_pTMD, u32 _sz) { - CWII_IPC_HLE_Device_es* pDevice = - (CWII_IPC_HLE_Device_es*)AccessDeviceByID(GetDeviceIDByName(std::string("/dev/es"))); - if (pDevice) - pDevice->ES_DIVerify(_pTMD, _sz); - else - ERROR_LOG(WII_IPC_ES, "DIVerify called but /dev/es is not available"); + CWII_IPC_HLE_Device_es::ES_DIVerify(_pTMD, _sz); } void SDIO_EventNotify() { CWII_IPC_HLE_Device_sdio_slot0 *pDevice = - (CWII_IPC_HLE_Device_sdio_slot0*)AccessDeviceByID(GetDeviceIDByName(std::string("/dev/sdio/slot0"))); + (CWII_IPC_HLE_Device_sdio_slot0*)GetDeviceByName(std::string("/dev/sdio/slot0")); if (pDevice) pDevice->EventNotify(); } +int getFreeDeviceId() +{ + u32 i; + for(i=0; isecond->GetDeviceName() == _rDeviceName) - return itr->first; + if (itr->second && itr->second->GetDeviceName() == _rDeviceName) + return itr->second; ++itr; } - return -1; + return NULL; } IWII_IPC_HLE_Device* AccessDeviceByID(u32 _ID) @@ -177,17 +212,7 @@ IWII_IPC_HLE_Device* AccessDeviceByID(u32 _ID) if (g_DeviceMap.find(_ID) != g_DeviceMap.end()) return g_DeviceMap[_ID]; - return NULL; -} - -void DeleteDeviceByID(u32 ID) -{ - IWII_IPC_HLE_Device* pDevice = AccessDeviceByID(ID); - if (pDevice) - delete pDevice; - - g_DeviceMap.erase(ID); - g_FileNameMap.erase(ID); + return NULL; } // This is called from ExecuteCommand() COMMAND_OPEN_DEVICE @@ -205,60 +230,82 @@ IWII_IPC_HLE_Device* CreateFileIO(u32 _DeviceID, const std::string& _rDeviceName void DoState(PointerWrap &p) { - p.Do(g_LastDeviceID); + p.Do(request_queue); + p.Do(reply_queue); - if (p.GetMode() == PointerWrap::MODE_READ) - { - TFileNameMap::const_iterator itr; - // Delete file Handles - itr = g_FileNameMap.begin(); - while (itr != g_FileNameMap.end()) - { - TDeviceMap::const_iterator devitr = g_DeviceMap.find(itr->first); - if (devitr != g_DeviceMap.end()) + TDeviceMap::const_iterator itr; + + itr = g_DeviceMap.begin(); + while (itr != g_DeviceMap.end()) + { + if (itr->second->IsHardware()) { - if (devitr->second) - delete devitr->second; - g_DeviceMap.erase(itr->first); + itr->second->DoState(p); } ++itr; + } + + if (p.GetMode() == PointerWrap::MODE_READ) + { + u32 i; + for (i=0; iDoState(p); + } + } + else + { + g_FdMap[i] = NULL; + } } - // Load file names - p.Do(g_FileNameMap); - // Rebuild file handles - itr = g_FileNameMap.begin(); - while (itr != g_FileNameMap.end()) + for (i=0; ifirst] = new CWII_IPC_HLE_Device_FileIO(itr->first, itr->second); - ++itr; + p.Do(es_inuse[i]); + u32 handleID = es_handles[i]->GetDeviceID(); + p.Do(handleID); + + es_handles[i] = AccessDeviceByID(handleID); } } else { - p.Do(g_FileNameMap); - } - - p.Do(request_queue); - p.Do(reply_queue); - - - TDeviceMap::const_iterator itr; - //first, all the real devices - //(because we need fs to be deserialized first) - itr = g_DeviceMap.begin(); - while (itr != g_DeviceMap.end()) - { - if (itr->second->IsHardware()) - itr->second->DoState(p); - ++itr; - } - //then all the files - itr = g_DeviceMap.begin(); - while (itr != g_DeviceMap.end()) - { - if (!itr->second->IsHardware()) - itr->second->DoState(p); - ++itr; + u32 i; + for (i=0; iIsHardware() ? 1 : 0; + p.Do(isHw); + if (isHw) + { + u32 hwId = g_FdMap[i]->GetDeviceID(); + p.Do(hwId); + } + else + { + g_FdMap[i]->DoState(p); + } + } + } + for (i=0; iGetDeviceID(); + p.Do(handleID); + } } } @@ -267,67 +314,106 @@ void ExecuteCommand(u32 _Address) bool CmdSuccess = false; ECommandType Command = static_cast(Memory::Read_U32(_Address)); - int DeviceID = Memory::Read_U32(_Address + 8); - IWII_IPC_HLE_Device* pDevice = AccessDeviceByID(DeviceID); + volatile int DeviceID = Memory::Read_U32(_Address + 8); - INFO_LOG(WII_IPC_HLE, "-->> Execute Command Address: 0x%08x (code: %x, device: %x) ", _Address, Command, DeviceID); + IWII_IPC_HLE_Device* pDevice = (DeviceID >= 0 && DeviceID < IPC_MAX_FDS) ? g_FdMap[DeviceID] : NULL; + + INFO_LOG(WII_IPC_HLE, "-->> Execute Command Address: 0x%08x (code: %x, device: %x) %p", _Address, Command, DeviceID, pDevice); switch (Command) { case COMMAND_OPEN_DEVICE: - { - // Create a new HLE device. The Mode and DeviceName is given to us but we - // generate a DeviceID to be used for access to this device until it is Closed. - std::string DeviceName; - Memory::GetString(DeviceName, Memory::Read_U32(_Address + 0xC)); + { + u32 Mode = Memory::Read_U32(_Address + 0x10); + DeviceID = getFreeDeviceId(); + + std::string DeviceName; + Memory::GetString(DeviceName, Memory::Read_U32(_Address + 0xC)); - u32 Mode = Memory::Read_U32(_Address + 0x10); - DeviceID = GetDeviceIDByName(DeviceName); - - // check if a device with this name has been created already - if (DeviceName.find("/dev/") == std::string::npos || DeviceID == -1) - { - if (DeviceName.find("/dev/") == 0) + + WARN_LOG(WII_IPC_HLE, "Tried to open %s as %d", DeviceName.c_str(), DeviceID); + if (DeviceID >= 0) + { + if (DeviceName.find("/dev/es") == 0) + { + u32 j; + for (j=0; jOpen(_Address, Mode); + Memory::Write_U32(DeviceID, _Address+4); + break; + } + } + if(j == ES_MAX_COUNT) + { + Memory::Write_U32(FS_EESEXHAUSTED, _Address + 4); + CmdSuccess = true; + } - pDevice = AccessDeviceByID(GetDeviceIDByName(std::string("_Unimplemented_Device_"))); + } + else if (DeviceName.find("/dev/") == 0) + { + pDevice = GetDeviceByName(DeviceName); + if (pDevice) + { + g_FdMap[DeviceID] = pDevice; CmdSuccess = pDevice->Open(_Address, Mode); + INFO_LOG(WII_IPC_FILEIO, "IOP: ReOpen (Device=%s, DeviceID=%08x, Mode=%i)", + pDevice->GetDeviceName().c_str(), DeviceID, Mode); + Memory::Write_U32(DeviceID, _Address+4); } else { - // create new file handle - u32 CurrentDeviceID = g_LastDeviceID; - pDevice = CreateFileIO(CurrentDeviceID, DeviceName); - g_DeviceMap[CurrentDeviceID] = pDevice; - g_FileNameMap[CurrentDeviceID] = DeviceName; - g_LastDeviceID++; - + WARN_LOG(WII_IPC_HLE, "Unimplemented device: %s", DeviceName.c_str()); + pDevice = GetDeviceByName(std::string("_Unimplemented_Device_")); CmdSuccess = pDevice->Open(_Address, Mode); - - INFO_LOG(WII_IPC_FILEIO, "IOP: Open File (Device=%s, ID=%08x, Mode=%i)", - pDevice->GetDeviceName().c_str(), CurrentDeviceID, Mode); + g_FdMap[DeviceID] = pDevice; + Memory::Write_U32(DeviceID, _Address+4); } - } - else - { - // F|RES: prolly the re-open is just a mode change - pDevice = AccessDeviceByID(DeviceID); + } + else + { + IWII_IPC_HLE_Device* pDevice = CreateFileIO(DeviceID, DeviceName); CmdSuccess = pDevice->Open(_Address, Mode); - INFO_LOG(WII_IPC_FILEIO, "IOP: ReOpen (Device=%s, DeviceID=%08x, Mode=%i)", - pDevice->GetDeviceName().c_str(), DeviceID, Mode); - } - } - break; + INFO_LOG(WII_IPC_FILEIO, "IOP: Open File (Device=%s, ID=%08x, Mode=%i)", + pDevice->GetDeviceName().c_str(), DeviceID, Mode); + if(Memory::Read_U32(_Address + 4) == DeviceID) + g_FdMap[DeviceID] = pDevice; + } + } + else + { + Memory::Write_U32(FS_EFDEXHAUSTED, _Address + 4); + CmdSuccess = true; + } + break; + } case COMMAND_CLOSE_DEVICE: - if (pDevice) + { + if (pDevice) { CmdSuccess = pDevice->Close(_Address); + + u32 j; + for (j=0; jIsHardware()) - DeleteDeviceByID(DeviceID); + delete pDevice; } else { @@ -335,50 +421,67 @@ void ExecuteCommand(u32 _Address) CmdSuccess = true; } break; - + } case COMMAND_READ: + { if (pDevice) + { CmdSuccess = pDevice->Read(_Address); + } else { Memory::Write_U32(FS_EINVAL, _Address + 4); CmdSuccess = true; } break; - + } case COMMAND_WRITE: + { if (pDevice) + { CmdSuccess = pDevice->Write(_Address); + } else { Memory::Write_U32(FS_EINVAL, _Address + 4); CmdSuccess = true; } break; - + } case COMMAND_SEEK: + { if (pDevice) + { CmdSuccess = pDevice->Seek(_Address); + } else { Memory::Write_U32(FS_EINVAL, _Address + 4); CmdSuccess = true; } break; - + } case COMMAND_IOCTL: + { if (pDevice) + { CmdSuccess = pDevice->IOCtl(_Address); + } break; - + } case COMMAND_IOCTLV: + { if (pDevice) + { CmdSuccess = pDevice->IOCtlV(_Address); + } break; - + } default: + { _dbg_assert_msg_(WII_IPC_HLE, 0, "Unknown IPC Command %i (0x%08x)", Command, _Address); break; + } } // It seems that the original hardware overwrites the command after it has been @@ -450,8 +553,7 @@ void Update() void UpdateDevices() { // Check if a hardware device must be updated - TDeviceMap::const_iterator itrEnd = g_DeviceMap.lower_bound(IPC_FIRST_FILEIO_ID); - for (TDeviceMap::const_iterator itr = g_DeviceMap.begin(); itr != itrEnd; ++itr) { + for (TDeviceMap::const_iterator itr = g_DeviceMap.begin(); itr != g_DeviceMap.end(); ++itr) { if (itr->second->IsOpened() && itr->second->Update()) { break; } diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.h b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.h index 11420d1cdd..2e056b5bec 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.h +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.h @@ -25,9 +25,9 @@ class IWII_IPC_HLE_Device; namespace WII_IPC_HLE_Interface { -#define IPC_FIRST_HARDWARE_ID 0 // first IPC device ID -#define IPC_FIRST_FILEIO_ID 33 // first IPC file ID - +#define IPC_FIRST_ID 0x00 // first IPC device ID +#define IPC_MAX_FILES 0x10 // first IPC file ID + // Init void Init(); @@ -46,14 +46,13 @@ void ES_DIVerify(u8 *_pTMD, u32 _sz); void SDIO_EventNotify(); -int GetDeviceIDByName(const std::string& _rDeviceName); - -IWII_IPC_HLE_Device* AccessDeviceByID(u32 _ID); - -void DeleteDeviceByID(u32 _ID); IWII_IPC_HLE_Device* CreateFileIO(u32 _DeviceID, const std::string& _rDeviceName); +IWII_IPC_HLE_Device* GetDeviceByName(const std::string& _rDeviceName); +IWII_IPC_HLE_Device* AccessDeviceByID(u32 _ID); +int getFreeDeviceId(); + // Update void Update(); diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device.h b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device.h index 36709a084f..113b14cffb 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device.h +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device.h @@ -39,7 +39,7 @@ class PointerWrap; #define FS_ENOENT2 (u32)-106 // File not found #define FS_ENFILE (u32)-107 // Too many fds open #define FS_EFBIG (u32)-108 // max block count reached? -#define FS_ENFILE2 (u32)-109 // Too many fds open +#define FS_EFDEXHAUSTED (u32)-109 // Too many fds open #define FS_ENAMELEN (u32)-110 // pathname is too long #define FS_EFDOPEN (u32)-111 // FD is already open #define FS_EIO2 (u32)-114 // returned on ECC error @@ -47,6 +47,7 @@ class PointerWrap; #define FS_EDIRDEPTH (u32)-116 // max directory depth exceeded #define FS_EBUSY2 (u32)-118 // Resource busy //#define FS_EFATAL (u32)-119 // fatal error not used by IOS as fatal ERROR +#define FS_EESEXHAUSTED (u32)-1016 // Max of 2 ES handles at a time class IWII_IPC_HLE_Device { diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp index 98a85d25ca..f5a893012a 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp @@ -28,7 +28,7 @@ static Common::replace_v replacements; -// This is used by several of the FileIO and /dev/fs/ functions +// This is used by several of the FileIO and /dev/fs functions std::string HLE_IPC_BuildFilename(const char* _pFilename, int _size) { std::string path_full = File::GetUserPath(D_WIIROOT_IDX); @@ -128,7 +128,7 @@ bool CWII_IPC_HLE_Device_FileIO::Open(u32 _CommandAddress, u32 _Mode) // The file must exist before we can open it // It should be created by ISFS_CreateFile, not here - if(File::Exists(m_Filename)) + if (File::Exists(m_Filename)) { INFO_LOG(WII_IPC_FILEIO, "FileIO: Open %s (%s == %08X)", m_Name.c_str(), Modes[_Mode], _Mode); ReturnValue = m_DeviceID; @@ -149,21 +149,22 @@ bool CWII_IPC_HLE_Device_FileIO::Open(u32 _CommandAddress, u32 _Mode) bool CWII_IPC_HLE_Device_FileIO::OpenFile() { - switch(m_Mode) + switch (m_Mode) { case ISFS_OPEN_READ: + { m_pFileHandle.Open(m_Filename, "rb"); break; - - // "r+b" is technically wrong, but OPEN_WRITE should not truncate the file as "wb" does. + } case ISFS_OPEN_WRITE: m_pFileHandle.Open(m_Filename, "r+b"); break; case ISFS_OPEN_RW: + { m_pFileHandle.Open(m_Filename, "r+b"); break; - + } default: PanicAlertT("FileIO: Unknown open mode : 0x%02x", m_Mode); break; @@ -178,21 +179,21 @@ void CWII_IPC_HLE_Device_FileIO::CloseFile() bool CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress) { - u32 ReturnValue = FS_RESULT_FATAL; - const s32 SeekPosition = Memory::Read_U32(_CommandAddress + 0xC); - const s32 Mode = Memory::Read_U32(_CommandAddress + 0x10); + u32 ReturnValue = FS_RESULT_FATAL; + const s32 SeekPosition = Memory::Read_U32(_CommandAddress + 0xC); + const s32 Mode = Memory::Read_U32(_CommandAddress + 0x10); - if(OpenFile()) + if (OpenFile()) { ReturnValue = FS_RESULT_FATAL; - const u64 fileSize = m_pFileHandle.GetSize(); + const u64 fileSize = m_pFileHandle.GetSize(); INFO_LOG(WII_IPC_FILEIO, "FileIO: Seek Pos: 0x%08x, Mode: %i (%s, Length=0x%08llx)", SeekPosition, Mode, m_Name.c_str(), fileSize); - switch(Mode){ + switch (Mode){ case 0: { - if(SeekPosition >=0 && SeekPosition <= fileSize) + if (SeekPosition >=0 && SeekPosition <= fileSize) { m_SeekPos = SeekPosition; ReturnValue = m_SeekPos; @@ -202,7 +203,7 @@ bool CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress) case 1: { s32 wantedPos = SeekPosition+m_SeekPos; - if(wantedPos >=0 && wantedPos <= fileSize) + if (wantedPos >=0 && wantedPos <= fileSize) { m_SeekPos = wantedPos; ReturnValue = m_SeekPos; @@ -212,7 +213,7 @@ bool CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress) case 2: { s32 wantedPos = fileSize+m_SeekPos; - if(wantedPos >=0 && wantedPos <= fileSize) + if (wantedPos >=0 && wantedPos <= fileSize) { m_SeekPos = wantedPos; ReturnValue = m_SeekPos; @@ -244,7 +245,7 @@ bool CWII_IPC_HLE_Device_FileIO::Read(u32 _CommandAddress) const u32 Size = Memory::Read_U32(_CommandAddress + 0x10); - if(OpenFile()) + if (OpenFile()) { if (m_Mode == ISFS_OPEN_WRITE) { @@ -284,7 +285,7 @@ bool CWII_IPC_HLE_Device_FileIO::Write(u32 _CommandAddress) const u32 Size = Memory::Read_U32(_CommandAddress + 0x10); - if(OpenFile()) + if (OpenFile()) { if (m_Mode == ISFS_OPEN_READ) { @@ -318,21 +319,14 @@ bool CWII_IPC_HLE_Device_FileIO::IOCtl(u32 _CommandAddress) #if defined(_DEBUG) || defined(DEBUGFAST) DumpCommands(_CommandAddress); #endif - const u32 Parameter = Memory::Read_U32(_CommandAddress + 0xC); + const u32 Parameter = Memory::Read_U32(_CommandAddress + 0xC); + u32 ReturnValue = 0; - //u32 BufferIn = Memory::Read_U32(_CommandAddress + 0x10); - //u32 BufferInSize = Memory::Read_U32(_CommandAddress + 0x14); - //u32 BufferOut = Memory::Read_U32(_CommandAddress + 0x18); - //u32 BufferOutSize = Memory::Read_U32(_CommandAddress + 0x1C); - - // Return Value - u32 ReturnValue = 0; // no error - - switch(Parameter) + switch (Parameter) { case ISFS_IOCTL_GETFILESTATS: { - if(OpenFile()) + if (OpenFile()) { u32 m_FileLength = (u32)m_pFileHandle.GetSize(); diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.h b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.h index 6c31e7be31..681baeebe6 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.h +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.h @@ -37,7 +37,7 @@ public: virtual bool Close(u32 _CommandAddress, bool _bForce); virtual bool IOCtlV(u32 _CommandAddress); - u32 ES_DIVerify(u8 *_pTMD, u32 _sz); + static u32 ES_DIVerify(u8 *_pTMD, u32 _sz); private: enum From 8479d5bdf7eac446271288611f749776a1510e84 Mon Sep 17 00:00:00 2001 From: Matthew Parlane Date: Sun, 18 Mar 2012 21:50:07 +1300 Subject: [PATCH 16/32] Some code clean up. I am terrible at coding styles... --- Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp | 33 +++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp index 756e59305d..6c1ab5baef 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp @@ -85,7 +85,8 @@ void Init() _dbg_assert_msg_(WII_IPC_HLE, g_DeviceMap.empty(), "DeviceMap isnt empty on init"); u32 i; - for(i=0; iIsHardware()) { // close all files and delete their resources @@ -160,7 +162,7 @@ void Shutdown() void SetDefaultContentFile(const std::string& _rFilename) { TDeviceMap::const_iterator itr = g_DeviceMap.begin(); - while(itr != g_DeviceMap.end()) + while (itr != g_DeviceMap.end()) { if (itr->second && itr->second->GetDeviceName().find(std::string("/dev/es")) == 0) { @@ -185,7 +187,8 @@ void SDIO_EventNotify() int getFreeDeviceId() { u32 i; - for(i=0; iIsHardware() ? 1 : 0; p.Do(isHw); if (isHw) @@ -348,7 +355,7 @@ void ExecuteCommand(u32 _Address) break; } } - if(j == ES_MAX_COUNT) + if (j == ES_MAX_COUNT) { Memory::Write_U32(FS_EESEXHAUSTED, _Address + 4); CmdSuccess = true; @@ -382,7 +389,7 @@ void ExecuteCommand(u32 _Address) INFO_LOG(WII_IPC_FILEIO, "IOP: Open File (Device=%s, ID=%08x, Mode=%i)", pDevice->GetDeviceName().c_str(), DeviceID, Mode); - if(Memory::Read_U32(_Address + 4) == DeviceID) + if (Memory::Read_U32(_Address + 4) == DeviceID) g_FdMap[DeviceID] = pDevice; } @@ -553,8 +560,10 @@ void Update() void UpdateDevices() { // Check if a hardware device must be updated - for (TDeviceMap::const_iterator itr = g_DeviceMap.begin(); itr != g_DeviceMap.end(); ++itr) { - if (itr->second->IsOpened() && itr->second->Update()) { + for (TDeviceMap::const_iterator itr = g_DeviceMap.begin(); itr != g_DeviceMap.end(); ++itr) + { + if (itr->second->IsOpened() && itr->second->Update()) + { break; } } From cfbcaa2cc6d2c990b907747298ad012aa1c6c2fd Mon Sep 17 00:00:00 2001 From: skidau Date: Sun, 18 Mar 2012 23:37:38 +1100 Subject: [PATCH 17/32] Linux build fix --- Source/Core/Common/Src/BreakPoints.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Common/Src/BreakPoints.cpp b/Source/Core/Common/Src/BreakPoints.cpp index 9164312f82..1700276d85 100644 --- a/Source/Core/Common/Src/BreakPoints.cpp +++ b/Source/Core/Common/Src/BreakPoints.cpp @@ -18,8 +18,8 @@ #include "Common.h" #include "DebugInterface.h" #include "BreakPoints.h" +#include "../../Core/Src/PowerPC/JitCommon/JitBase.h" #include -#include "..\..\Core\Src\PowerPC\JitCommon\JitBase.h" bool BreakPoints::IsAddressBreakPoint(u32 _iAddress) { From ed3f9ce288ba3a74b263d2267e5bba96da3f0829 Mon Sep 17 00:00:00 2001 From: Andrew de los Reyes Date: Tue, 13 Mar 2012 17:14:00 -0700 Subject: [PATCH 18/32] Switch Mac compiler to Clang. Specifically: - Look for clang and clang++ in the new (Xcode 4.3) location first, then the old (Xcode 4.2) location. - Look for sysroot in the new (Xcode 4.3) location first, then the old (Xcode 4.2) location. --- CMakeLists.txt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b64c5b6f61..c6fbad069d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,17 @@ # General setup # cmake_minimum_required(VERSION 2.6) + +# Update compiler before calling project() +if (APPLE) + # Use clang compiler + set(CMAKE_C_COMPILER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang") + set(CMAKE_CXX_COMPILER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++") + if (NOT EXISTS "${CMAKE_CXX_COMPILER}") + set(CMAKE_C_COMPILER "clang") + set(CMAKE_CXX_COMPILER "clang++") + endif() +endif() project(dolphin-emu) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMakeTests) set(DOLPHIN_IS_STABLE FALSE) @@ -135,7 +146,11 @@ if (APPLE) # features can be used, not the minimum required version to run. set(OSX_MIN_VERSION "10.5.4") set(TARGET_FLAGS "${TARGET_FLAGS} -mmacosx-version-min=${OSX_MIN_VERSION}") - set(TARGET_FLAGS "${TARGET_FLAGS} -isysroot /Developer/SDKs/MacOSX10.6.sdk") + set(TARGET_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk") + if (NOT EXISTS "${TARGET_SYSROOT}/") + set(TARGET_SYSROOT "/Developer/SDKs/MacOSX10.6.sdk") + endif() + set(TARGET_FLAGS "${TARGET_FLAGS} -isysroot ${TARGET_SYSROOT}") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk") # Do not warn about frameworks that are not available on all architectures. # This avoids a warning when linking with QuickTime. From d6d52920ec2f8c5d2ae74a219d16d211ecf45af9 Mon Sep 17 00:00:00 2001 From: Andrew de los Reyes Date: Fri, 16 Mar 2012 21:08:27 -0700 Subject: [PATCH 19/32] Fix segfault in LogWindow on Mac Commit 9ddb67d4a96a53698a71a7f3c8936c2437dd81de seems to have introduced a segfault on Mac. The issue is that it this change casts wxConvCurrent (which is a wxMBConvLibc) to a wxCSConv. This is an unsafe cast because wxCSConv has member variables, but wxMBConvLibc does not. In LogWindow.cpp, the constructor for m_SJISConv is dereferencing one of those member variables, which is a dereference of uninitialized memory! This CL reverts to the older (non-crashing) constructor, but keeps the behavior the same. --- Source/Core/DolphinWX/Src/LogWindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinWX/Src/LogWindow.cpp b/Source/Core/DolphinWX/Src/LogWindow.cpp index 0d11ef0142..4c9c495713 100644 --- a/Source/Core/DolphinWX/Src/LogWindow.cpp +++ b/Source/Core/DolphinWX/Src/LogWindow.cpp @@ -41,7 +41,7 @@ CLogWindow::CLogWindow(CFrame *parent, wxWindowID id, const wxPoint& pos, , x(0), y(0), winpos(0) , Parent(parent), m_ignoreLogTimer(false), m_LogAccess(true) , m_Log(NULL), m_cmdline(NULL), m_FontChoice(NULL) - , m_SJISConv(*(wxCSConv*)wxConvCurrent) + , m_SJISConv(wxT("")) { #ifdef _WIN32 static bool validCP932 = ::IsValidCodePage(932) != 0; @@ -52,6 +52,7 @@ CLogWindow::CLogWindow(CFrame *parent, wxWindowID id, const wxPoint& pos, else { WARN_LOG(COMMON, "Cannot Convert from Charset Windows Japanese cp 932"); + m_SJISConv = *(wxCSConv*)wxConvCurrent; } #else // on linux the wrong string is returned from wxFontMapper::GetEncodingName(wxFONTENCODING_SHIFT_JIS) From 20eca1bf7e2e02dd18229dc2b6b83935ce0d4047 Mon Sep 17 00:00:00 2001 From: marcosvitali Date: Sun, 18 Mar 2012 22:54:58 -0300 Subject: [PATCH 20/32] Ive fixed definitely Pokemon XD in dual core mode. This game is doing something not allowed. It attach to CPU the same fifo attached to the GPU in multibuffer mode. I added a check to prevent overwrite the GPU FIFO with the CPU FIFO. If the game do that on breakpoint the solution can fail. Fixed ReadWriteDistance calc when CPRead > CPWrite. Added Token and Finish cause to GP Jit checking. --- Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp | 2 +- .../Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp | 2 +- .../Core/VideoCommon/Src/CommandProcessor.cpp | 19 +++++++++++++++++-- .../Core/VideoCommon/Src/CommandProcessor.h | 3 ++- Source/Core/VideoCommon/Src/PixelEngine.cpp | 2 +- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp index 8140a075a2..fe090d1b50 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp @@ -584,7 +584,7 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc FixupBranch noExtException = J_CC(CC_Z); TEST(32, M((void *)&PowerPC::ppcState.msr), Imm32(0x0008000)); FixupBranch noExtIntEnable = J_CC(CC_Z); - TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_CP)); + TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_CP | ProcessorInterface::INT_CAUSE_PE_TOKEN | ProcessorInterface::INT_CAUSE_PE_FINISH)); FixupBranch noCPInt = J_CC(CC_Z); MOV(32, M(&PC), Imm32(ops[i].address)); diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp index 743eaf2030..7579c69a03 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp @@ -1932,7 +1932,7 @@ static void DoWriteCode(IRBuilder* ibuild, JitIL* Jit, bool UseProfile, bool Mak FixupBranch noExtException = Jit->J_CC(CC_Z); Jit->TEST(32, M((void *)&PowerPC::ppcState.msr), Imm32(0x0008000)); FixupBranch noExtIntEnable = Jit->J_CC(CC_Z); - Jit->TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_CP)); + Jit->TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_CP || ProcessorInterface::INT_CAUSE_PE_TOKEN || ProcessorInterface::INT_CAUSE_PE_FINISH)); FixupBranch noCPInt = Jit->J_CC(CC_Z); Jit->MOV(32, M(&PC), Imm32(InstLoc)); diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.cpp b/Source/Core/VideoCommon/Src/CommandProcessor.cpp index 3744acd200..a4dddf537f 100644 --- a/Source/Core/VideoCommon/Src/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/Src/CommandProcessor.cpp @@ -61,6 +61,7 @@ volatile bool interruptSet= false; volatile bool interruptWaiting= false; volatile bool interruptTokenWaiting = false; volatile bool interruptFinishWaiting = false; +volatile bool waitingForPEInterruptDisable = false; bool IsOnThread() { @@ -174,7 +175,7 @@ void Read16(u16& _rReturnValue, const u32 _Address) if(fifo.CPWritePointer >= fifo.SafeCPReadPointer) _rReturnValue = ReadLow (fifo.CPWritePointer - fifo.SafeCPReadPointer); else - _rReturnValue = ReadLow (fifo.CPEnd - fifo.CPWritePointer + fifo.SafeCPReadPointer); + _rReturnValue = ReadLow (fifo.CPEnd - fifo.SafeCPReadPointer + fifo.CPWritePointer - fifo.CPBase + 32); else _rReturnValue = ReadLow (fifo.CPReadWriteDistance); DEBUG_LOG(COMMANDPROCESSOR, "read FIFO_RW_DISTANCE_LO : %04x", _rReturnValue); @@ -184,7 +185,7 @@ void Read16(u16& _rReturnValue, const u32 _Address) if(fifo.CPWritePointer >= fifo.SafeCPReadPointer) _rReturnValue = ReadHigh (fifo.CPWritePointer - fifo.SafeCPReadPointer); else - _rReturnValue = ReadHigh (fifo.CPEnd - fifo.CPWritePointer + fifo.SafeCPReadPointer); + _rReturnValue = ReadHigh (fifo.CPEnd - fifo.SafeCPReadPointer + fifo.CPWritePointer - fifo.CPBase + 32); else _rReturnValue = ReadHigh(fifo.CPReadWriteDistance); DEBUG_LOG(COMMANDPROCESSOR, "read FIFO_RW_DISTANCE_HI : %04x", _rReturnValue); @@ -437,11 +438,25 @@ void Write32(const u32 _Data, const u32 _Address) void STACKALIGN GatherPipeBursted() { + ProcessFifoEvents(); // if we aren't linked, we don't care about gather pipe data if (!m_CPCtrlReg.GPLinkEnable) { if (!IsOnThread()) RunGpu(); + else + { + // In multibuffer mode is not allowed write in the same fifo attached to the GPU. + // Fix Pokemon XD in DC mode. + if((ProcessorInterface::Fifo_CPUEnd == fifo.CPEnd) && (ProcessorInterface::Fifo_CPUBase == fifo.CPBase) + && fifo.CPReadWriteDistance > 0) + { + waitingForPEInterruptDisable = true; + ProcessFifoAllDistance(); + waitingForPEInterruptDisable = false; + } + + } return; } diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.h b/Source/Core/VideoCommon/Src/CommandProcessor.h index 440c900dc3..5d31453537 100644 --- a/Source/Core/VideoCommon/Src/CommandProcessor.h +++ b/Source/Core/VideoCommon/Src/CommandProcessor.h @@ -35,7 +35,8 @@ extern volatile bool interruptSet; extern volatile bool interruptWaiting; extern volatile bool interruptTokenWaiting; extern volatile bool interruptFinishWaiting; - +extern volatile bool waitingForPEInterruptDisable; + // internal hardware addresses enum { diff --git a/Source/Core/VideoCommon/Src/PixelEngine.cpp b/Source/Core/VideoCommon/Src/PixelEngine.cpp index 38c85cc10c..e6dbdb8c26 100644 --- a/Source/Core/VideoCommon/Src/PixelEngine.cpp +++ b/Source/Core/VideoCommon/Src/PixelEngine.cpp @@ -462,7 +462,7 @@ void ResetSetToken() bool WaitingForPEInterrupt() { - return CommandProcessor::interruptFinishWaiting || CommandProcessor::interruptTokenWaiting || interruptSetFinish || interruptSetToken; + return !CommandProcessor::waitingForPEInterruptDisable && (CommandProcessor::interruptFinishWaiting || CommandProcessor::interruptTokenWaiting || interruptSetFinish || interruptSetToken); } void ResumeWaitingForPEInterrupt() From 418f46ea72828d828febf2a1eadfcb262e9a974d Mon Sep 17 00:00:00 2001 From: Matthew Parlane Date: Mon, 19 Mar 2012 17:55:46 +1300 Subject: [PATCH 21/32] Fixed memory leak. And added braces to match the rest of the switch statement in FileIO. --- Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp | 6 ++++++ Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp index 6c1ab5baef..b552185f87 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp @@ -390,7 +390,13 @@ void ExecuteCommand(u32 _Address) INFO_LOG(WII_IPC_FILEIO, "IOP: Open File (Device=%s, ID=%08x, Mode=%i)", pDevice->GetDeviceName().c_str(), DeviceID, Mode); if (Memory::Read_U32(_Address + 4) == DeviceID) + { g_FdMap[DeviceID] = pDevice; + } + else + { + delete pDevice; + } } } diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp index f5a893012a..1f0b0d72cd 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp @@ -157,18 +157,21 @@ bool CWII_IPC_HLE_Device_FileIO::OpenFile() break; } case ISFS_OPEN_WRITE: + { m_pFileHandle.Open(m_Filename, "r+b"); break; - + } case ISFS_OPEN_RW: { m_pFileHandle.Open(m_Filename, "r+b"); break; } default: + { PanicAlertT("FileIO: Unknown open mode : 0x%02x", m_Mode); break; } + } return m_pFileHandle.IsOpen(); } From 281d7531a3d92036380b27e2dabda162e7289f87 Mon Sep 17 00:00:00 2001 From: skidau Date: Mon, 19 Mar 2012 21:51:26 +1100 Subject: [PATCH 22/32] Fixed a crash on exit by calling DefWindowProc after the WM_DESTORY message has been received. Patch by eddie.willett. Fixes issue 4588. Fixes issue 5285. --- Externals/wxWidgets/include/wx/msw/window.h | 2 +- Externals/wxWidgets/src/msw/window.cpp | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Externals/wxWidgets/include/wx/msw/window.h b/Externals/wxWidgets/include/wx/msw/window.h index c75ac55d33..b037268bd6 100644 --- a/Externals/wxWidgets/include/wx/msw/window.h +++ b/Externals/wxWidgets/include/wx/msw/window.h @@ -365,7 +365,7 @@ public: virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); // Calls an appropriate default window procedure - virtual WXLRESULT MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); + virtual WXLRESULT MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam, bool callDefWindowProc = false); // message processing helpers diff --git a/Externals/wxWidgets/src/msw/window.cpp b/Externals/wxWidgets/src/msw/window.cpp index 4810bd68d7..00e68b2d2d 100644 --- a/Externals/wxWidgets/src/msw/window.cpp +++ b/Externals/wxWidgets/src/msw/window.cpp @@ -2234,9 +2234,9 @@ bool wxWindowMSW::DoPopupMenu(wxMenu *menu, int x, int y) // pre/post message processing // =========================================================================== -WXLRESULT wxWindowMSW::MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) +WXLRESULT wxWindowMSW::MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam, bool callDefWindowProc /* = false */) { - if ( m_oldWndProc ) + if (!callDefWindowProc && m_oldWndProc) return ::CallWindowProc(CASTWNDPROC m_oldWndProc, GetHwnd(), (UINT) nMsg, (WPARAM) wParam, (LPARAM) lParam); else return ::DefWindowProc(GetHwnd(), nMsg, wParam, lParam); @@ -2653,11 +2653,12 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l break; case WM_DESTROY: - // never set processed to true and *always* pass WM_DESTROY to - // DefWindowProc() as Windows may do some internal cleanup when - // processing it and failing to pass the message along may cause - // memory and resource leaks! + // *always* pass WM_DESTROY to DefWindowProc() as Windows may do + // some internal cleanup when processing it and failing to pass + // the message along may cause memory and resource leaks! (void)HandleDestroy(); + rc.result = MSWDefWindowProc(message, wParam, lParam, true); + processed = true; break; case WM_SIZE: From 14ea442382681567277e0cd0538d4537f434effe Mon Sep 17 00:00:00 2001 From: Matthew Parlane Date: Tue, 20 Mar 2012 19:51:42 +1300 Subject: [PATCH 23/32] srawx fixed thanks to boo toe. --- Source/Core/Core/Src/PowerPC/Jit64IL/JitIL_Integer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL_Integer.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL_Integer.cpp index 572cb63861..379aaca48a 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL_Integer.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL_Integer.cpp @@ -493,6 +493,9 @@ void JitIL::srawx(UGeckoInstruction inst) test = ibuild.EmitOr(val, mask2); test = ibuild.EmitICmpUgt(test, mask); ibuild.EmitStoreCarry(test); + + if (inst.Rc) + ComputeRC(ibuild, val); } void JitIL::srawix(UGeckoInstruction inst) From 5e2fd4520302bd6a7232772ea878894e2b7fed61 Mon Sep 17 00:00:00 2001 From: skidau Date: Tue, 20 Mar 2012 21:01:15 +1100 Subject: [PATCH 24/32] Merge fix --- Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp | 42 +++++++++++++++++++ .../Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp | 10 +++++ 2 files changed, 52 insertions(+) diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp index 15bd5ca18a..b43ed516dd 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp @@ -41,6 +41,10 @@ #include "JitAsm.h" #include "JitRegCache.h" #include "Jit64_Tables.h" +#include "HW/ProcessorInterface.h" +#if defined(_DEBUG) || defined(DEBUGFAST) +#include "PowerPCDisasm.h" +#endif using namespace Gen; using namespace PowerPC; @@ -572,6 +576,44 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc SetJumpTarget(b1); } + // Add an external exception check if the instruction writes to the FIFO. + if (jit->js.fifoWriteAddresses.find(ops[i].address) != jit->js.fifoWriteAddresses.end()) + { + gpr.Flush(FLUSH_ALL); + fpr.Flush(FLUSH_ALL); + + TEST(32, M((void *)&PowerPC::ppcState.Exceptions), Imm32(EXCEPTION_ISI | EXCEPTION_PROGRAM | EXCEPTION_SYSCALL | EXCEPTION_FPU_UNAVAILABLE | EXCEPTION_DSI | EXCEPTION_ALIGNMENT | EXCEPTION_DECREMENTER)); + FixupBranch clearInt = J_CC(CC_NZ); + TEST(32, M((void *)&PowerPC::ppcState.Exceptions), Imm32(EXCEPTION_EXTERNAL_INT)); + FixupBranch noExtException = J_CC(CC_Z); + TEST(32, M((void *)&PowerPC::ppcState.msr), Imm32(0x0008000)); + FixupBranch noExtIntEnable = J_CC(CC_Z); + TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_CP | ProcessorInterface::INT_CAUSE_PE_TOKEN | ProcessorInterface::INT_CAUSE_PE_FINISH)); + FixupBranch noCPInt = J_CC(CC_Z); + + MOV(32, M(&PC), Imm32(ops[i].address)); + WriteExceptionExit(); + + SetJumpTarget(noCPInt); + SetJumpTarget(noExtIntEnable); + SetJumpTarget(noExtException); + SetJumpTarget(clearInt); + } + + if (Core::g_CoreStartupParameter.bEnableDebugging && breakpoints.IsAddressBreakPoint(ops[i].address) && GetState() != CPU_STEPPING) + { + MOV(32, M(&PC), Imm32(ops[i].address)); + ABI_CallFunction(reinterpret_cast(&PowerPC::CheckBreakPoints)); + TEST(32, M((void*)PowerPC::GetStatePtr()), Imm32(0xFFFFFFFF)); + FixupBranch noBreakpoint = J_CC(CC_Z); + + gpr.Flush(FLUSH_ALL); + fpr.Flush(FLUSH_ALL); + + WriteExit(ops[i].address, 0); + SetJumpTarget(noBreakpoint); + } + Jit64Tables::CompileInstruction(ops[i]); if (js.memcheck && (opinfo->flags & FL_LOADSTORE)) diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp index 0c6fc41366..e079fb7896 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp @@ -652,6 +652,16 @@ const u8* JitIL::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc { ibuild.EmitFPExceptionCheckStart(ibuild.EmitIntConst(ops[i].address)); } + + if (jit->js.fifoWriteAddresses.find(js.compilerPC) != jit->js.fifoWriteAddresses.end()) + { + ibuild.EmitExtExceptionCheck(ibuild.EmitIntConst(ops[i].address)); + } + + if (Core::g_CoreStartupParameter.bEnableDebugging && breakpoints.IsAddressBreakPoint(ops[i].address) && GetState() != CPU_STEPPING) + { + ibuild.EmitBreakPointCheck(ibuild.EmitIntConst(ops[i].address)); + } JitILTables::CompileInstruction(ops[i]); From 0861f524d4480bb33a7de94029e5f35ad841c282 Mon Sep 17 00:00:00 2001 From: "kostamarino@hotmail.com" Date: Tue, 20 Mar 2012 20:41:55 +0200 Subject: [PATCH 25/32] Gameini database update. About 142 files updated or added to the database. --- Data/User/GameConfig/G4FD69.ini | 9 +++++++-- Data/User/GameConfig/G4FE69.ini | 12 ++++++++---- Data/User/GameConfig/G4FF69.ini | 9 +++++++-- Data/User/GameConfig/G4FP69.ini | 9 +++++++-- Data/User/GameConfig/G6TP5G.ini | 1 + Data/User/GameConfig/GCZE69.ini | 9 ++++++--- Data/User/GameConfig/GCZP69.ini | 9 +++++++-- Data/User/GameConfig/GDGE7H.ini | 6 +++--- Data/User/GameConfig/GDGP78.ini | 6 +++--- Data/User/GameConfig/GEND69.ini | 4 ++-- Data/User/GameConfig/GENE69.ini | 4 ++-- Data/User/GameConfig/GENP69.ini | 4 ++-- Data/User/GameConfig/GENS69.ini | 4 ++-- Data/User/GameConfig/GF5E69.ini | 11 +++++++---- Data/User/GameConfig/GF6E69.ini | 12 ++++++++---- Data/User/GameConfig/GF6F69.ini | 9 +++++++-- Data/User/GameConfig/GFAD69.ini | 6 +++--- Data/User/GameConfig/GFAE69.ini | 6 +++--- Data/User/GameConfig/GFAP69.ini | 6 +++--- Data/User/GameConfig/GFAS69.ini | 6 +++--- Data/User/GameConfig/GFYE69.ini | 11 +++++++---- Data/User/GameConfig/GFYP69.ini | 5 ++--- Data/User/GameConfig/GG5E52.ini | 2 +- Data/User/GameConfig/GGYE41.ini | 2 -- Data/User/GameConfig/GGYP41.ini | 2 -- Data/User/GameConfig/GH7E5D.ini | 2 +- Data/User/GameConfig/GHCE4Q.ini | 8 ++++++-- Data/User/GameConfig/GHCF4Q.ini | 7 ++++++- Data/User/GameConfig/GIKE70.ini | 8 ++++++++ Data/User/GameConfig/GIKP70.ini | 1 + Data/User/GameConfig/GIZE52.ini | 4 ++-- Data/User/GameConfig/GJWE78.ini | 8 ++++++-- Data/User/GameConfig/GJZE52.ini | 2 +- Data/User/GameConfig/GK4E01.ini | 10 +++++++--- Data/User/GameConfig/GKBEAF.ini | 2 +- Data/User/GameConfig/GKBPAF.ini | 2 +- Data/User/GameConfig/GKLE69.ini | 12 +++++++++--- Data/User/GameConfig/GKLF69.ini | 12 +++++++++--- Data/User/GameConfig/GKLP69.ini | 7 +++---- Data/User/GameConfig/GKLS69.ini | 12 +++++++++--- Data/User/GameConfig/GLCE52.ini | 1 + Data/User/GameConfig/GLCF52.ini | 1 + Data/User/GameConfig/GM5E7D.ini | 5 ++--- Data/User/GameConfig/GM5F7D.ini | 5 ++--- Data/User/GameConfig/GM5P7D.ini | 6 ++---- Data/User/GameConfig/GNNE69.ini | 2 ++ Data/User/GameConfig/GOAE52.ini | 2 +- Data/User/GameConfig/GPOP8P.ini | 1 + Data/User/GameConfig/GPSP8P.ini | 1 + Data/User/GameConfig/GQTE4Q.ini | 7 +++++-- Data/User/GameConfig/GRYE41.ini | 18 ++++++++++++++++++ Data/User/GameConfig/GT3D52.ini | 4 ++-- Data/User/GameConfig/GT3E52.ini | 4 ++-- Data/User/GameConfig/GT3F52.ini | 4 ++-- Data/User/GameConfig/GT3P52.ini | 4 ++-- Data/User/GameConfig/GT7E41.ini | 3 +-- Data/User/GameConfig/GT7P41.ini | 3 ++- Data/User/GameConfig/GT7X41.ini | 3 ++- Data/User/GameConfig/GTYE69.ini | 4 ++-- Data/User/GameConfig/GTYP69.ini | 4 ++-- Data/User/GameConfig/GVKE52.ini | 8 ++++++-- Data/User/GameConfig/GWYE41.ini | 1 + Data/User/GameConfig/GXFE69.ini | 4 ++-- Data/User/GameConfig/GXFF69.ini | 4 ++-- Data/User/GameConfig/GXFP69.ini | 4 ++-- Data/User/GameConfig/GXXE01.ini | 1 - Data/User/GameConfig/GXXP01.ini | 2 -- Data/User/GameConfig/GYWD41.ini | 4 ++-- Data/User/GameConfig/GYWEE9.ini | 4 ++-- Data/User/GameConfig/GYWP41.ini | 4 ++-- Data/User/GameConfig/HACA01.ini | 1 + Data/User/GameConfig/R22E01.ini | 2 +- Data/User/GameConfig/R22J01.ini | 2 +- Data/User/GameConfig/R22P01.ini | 2 +- Data/User/GameConfig/R3OJ01.ini | 1 + Data/User/GameConfig/R3OP01.ini | 1 + Data/User/GameConfig/R5DE5G.ini | 4 +--- Data/User/GameConfig/R5IE4Q.ini | 1 + Data/User/GameConfig/R5IP4Q.ini | 1 + Data/User/GameConfig/R5IX4Q.ini | 1 + Data/User/GameConfig/R6YEXS.ini | 1 + Data/User/GameConfig/R6YPH3.ini | 1 + Data/User/GameConfig/R7XE69.ini | 21 +++++++++++++++++++++ Data/User/GameConfig/R7XJ13.ini | 21 +++++++++++++++++++++ Data/User/GameConfig/R7XP69.ini | 21 +++++++++++++++++++++ Data/User/GameConfig/RBWE01.ini | 4 ++-- Data/User/GameConfig/RBWJ01.ini | 12 +++++++++--- Data/User/GameConfig/RBWP01.ini | 12 +++++++++--- Data/User/GameConfig/RDSJAF.ini | 1 + Data/User/GameConfig/RDSPAF.ini | 1 + Data/User/GameConfig/RFCJGD.ini | 1 + Data/User/GameConfig/RFCPGD.ini | 1 + Data/User/GameConfig/RFFJGD.ini | 2 +- Data/User/GameConfig/RFFPGD.ini | 1 + Data/User/GameConfig/RFQP69.ini | 1 + Data/User/GameConfig/RIPJAF.ini | 1 + Data/User/GameConfig/RIPPAF.ini | 1 + Data/User/GameConfig/RIUJAF.ini | 1 + Data/User/GameConfig/RK2JEB.ini | 1 + Data/User/GameConfig/RK2P01.ini | 1 + Data/User/GameConfig/RKDJEB.ini | 1 + Data/User/GameConfig/RKDP01.ini | 1 + Data/User/GameConfig/RKDPEB.ini | 1 + Data/User/GameConfig/ROUJAF.ini | 1 + Data/User/GameConfig/RQ6EJJ.ini | 3 +-- Data/User/GameConfig/RQ6PKM.ini | 3 +-- Data/User/GameConfig/RQ6XKM.ini | 3 +-- Data/User/GameConfig/S2LE01.ini | 19 +++++++++++++++++++ Data/User/GameConfig/S2LJ01.ini | 19 +++++++++++++++++++ Data/User/GameConfig/S2LP01.ini | 19 +++++++++++++++++++ Data/User/GameConfig/S59E01.ini | 1 + Data/User/GameConfig/S59JC8.ini | 1 + Data/User/GameConfig/SAKPNS.ini | 1 + Data/User/GameConfig/SBDJ08.ini | 1 + Data/User/GameConfig/SBDK08.ini | 1 + Data/User/GameConfig/SBDP08.ini | 1 + Data/User/GameConfig/SC8E01.ini | 15 +++++++++++++++ Data/User/GameConfig/SC8J01.ini | 15 +++++++++++++++ Data/User/GameConfig/SC8P01.ini | 15 +++++++++++++++ Data/User/GameConfig/SE2P69.ini | 1 + Data/User/GameConfig/SEAE69.ini | 1 + Data/User/GameConfig/SEAJ13.ini | 1 + Data/User/GameConfig/SEAP69.ini | 1 + Data/User/GameConfig/SFWP69.ini | 1 + Data/User/GameConfig/SLSJ01.ini | 19 +++++++++++++++++++ Data/User/GameConfig/SLSP01.ini | 19 +++++++++++++++++++ Data/User/GameConfig/SMNE01.ini | 1 + Data/User/GameConfig/SMNJ01.ini | 1 + Data/User/GameConfig/SMNK01.ini | 1 + Data/User/GameConfig/SMNW01.ini | 1 + Data/User/GameConfig/SNDE20.ini | 17 +++++++++++++++++ Data/User/GameConfig/SNJP69.ini | 1 + Data/User/GameConfig/SOUE01.ini | 3 +++ Data/User/GameConfig/SOUJ01.ini | 3 +++ Data/User/GameConfig/SOUK01.ini | 3 +++ Data/User/GameConfig/SOUP01.ini | 3 +++ Data/User/GameConfig/SPTJEB.ini | 1 + Data/User/GameConfig/SUKE01.ini | 3 +-- Data/User/GameConfig/SUKJ01.ini | 2 +- Data/User/GameConfig/SUKP01.ini | 2 +- Data/User/GameConfig/SXCP52.ini | 1 + Data/User/GameConfig/WF4EGD.ini | 1 + 142 files changed, 548 insertions(+), 161 deletions(-) create mode 100644 Data/User/GameConfig/GRYE41.ini create mode 100644 Data/User/GameConfig/R7XE69.ini create mode 100644 Data/User/GameConfig/R7XJ13.ini create mode 100644 Data/User/GameConfig/R7XP69.ini create mode 100644 Data/User/GameConfig/S2LE01.ini create mode 100644 Data/User/GameConfig/S2LJ01.ini create mode 100644 Data/User/GameConfig/S2LP01.ini create mode 100644 Data/User/GameConfig/SC8E01.ini create mode 100644 Data/User/GameConfig/SC8J01.ini create mode 100644 Data/User/GameConfig/SC8P01.ini create mode 100644 Data/User/GameConfig/SLSJ01.ini create mode 100644 Data/User/GameConfig/SLSP01.ini create mode 100644 Data/User/GameConfig/SNDE20.ini diff --git a/Data/User/GameConfig/G4FD69.ini b/Data/User/GameConfig/G4FD69.ini index abc304e162..4de9d5c61d 100644 --- a/Data/User/GameConfig/G4FD69.ini +++ b/Data/User/GameConfig/G4FD69.ini @@ -1,11 +1,16 @@ # G4FD69 - FIFA 07 [Core] Values set here will override the main dolphin settings. -MMU = 1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 4 -EmulationIssues = Sound issues need LLE plugin and videos are messed up. Slow due to MMU(r6932) +EmulationIssues = Sound issues need LLE audio to be fixed and the videos are messed up. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = [Gecko] diff --git a/Data/User/GameConfig/G4FE69.ini b/Data/User/GameConfig/G4FE69.ini index 2f08c09f90..f4b303cd32 100644 --- a/Data/User/GameConfig/G4FE69.ini +++ b/Data/User/GameConfig/G4FE69.ini @@ -1,12 +1,16 @@ # G4FE69 - FIFA 07 [Core] Values set here will override the main dolphin settings. -MMU = 1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 3 -EmulationIssues = Sound issues need LLE plugin and videos are messed up. Slow due to MMU(r6932) +EmulationStateId = 4 +EmulationIssues = Sound issues need LLE audio to be fixed and the videos are messed up. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = [Gecko] - diff --git a/Data/User/GameConfig/G4FF69.ini b/Data/User/GameConfig/G4FF69.ini index 6f94d10dc7..688bde8ea9 100644 --- a/Data/User/GameConfig/G4FF69.ini +++ b/Data/User/GameConfig/G4FF69.ini @@ -1,11 +1,16 @@ # G4FF69 - FIFA 07 [Core] Values set here will override the main dolphin settings. -MMU = 1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 4 -EmulationIssues = Sound issues need LLE plugin and videos are messed up. Slow due to MMU(r6932) +EmulationIssues = Sound issues need LLE audio to be fixed and the videos are messed up. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = [Gecko] diff --git a/Data/User/GameConfig/G4FP69.ini b/Data/User/GameConfig/G4FP69.ini index 80743faa36..f4b303cd32 100644 --- a/Data/User/GameConfig/G4FP69.ini +++ b/Data/User/GameConfig/G4FP69.ini @@ -1,11 +1,16 @@ # G4FE69 - FIFA 07 [Core] Values set here will override the main dolphin settings. -MMU = 1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 4 -EmulationIssues = Sound issues need LLE plugin and videos are messed up. Slow due to MMU(r6932) +EmulationIssues = Sound issues need LLE audio to be fixed and the videos are messed up. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = [Gecko] diff --git a/Data/User/GameConfig/G6TP5G.ini b/Data/User/GameConfig/G6TP5G.ini index 6f32916865..3850135202 100644 --- a/Data/User/GameConfig/G6TP5G.ini +++ b/Data/User/GameConfig/G6TP5G.ini @@ -16,3 +16,4 @@ PH_ZFar = [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/GCZE69.ini b/Data/User/GameConfig/GCZE69.ini index dd3f749849..d5b582c365 100644 --- a/Data/User/GameConfig/GCZE69.ini +++ b/Data/User/GameConfig/GCZE69.ini @@ -1,17 +1,20 @@ # GCZE69 - CATWOMAN [Core] Values set here will override the main dolphin settings. TLBHack = 1 -MMU = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationIssues = Needs MMU and is slow (r6898) +EmulationIssues = EmulationStateId = 4 [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = [Gecko] [Video_Settings] SafeTextureCache = True SafeTextureCacheColorSamples = 512 [Video_Enhancements] - diff --git a/Data/User/GameConfig/GCZP69.ini b/Data/User/GameConfig/GCZP69.ini index 320db678f9..b04a026c61 100644 --- a/Data/User/GameConfig/GCZP69.ini +++ b/Data/User/GameConfig/GCZP69.ini @@ -1,15 +1,20 @@ # GCZP69 - CATWOMAN [Core] Values set here will override the main dolphin settings. TLBHack = 1 -MMU = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationIssues = Needs MMU and is slow (r6898) +EmulationIssues = EmulationStateId = 4 [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = [Gecko] [Video_Settings] SafeTextureCache = True SafeTextureCacheColorSamples = 512 +[Video_Enhancements] diff --git a/Data/User/GameConfig/GDGE7H.ini b/Data/User/GameConfig/GDGE7H.ini index 60f3aefa3f..9228786a72 100644 --- a/Data/User/GameConfig/GDGE7H.ini +++ b/Data/User/GameConfig/GDGE7H.ini @@ -1,9 +1,9 @@ # GDGE7H - Dragon's Lair 3D [Core] Values set here will override the main dolphin settings. -MMU = 1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 3 -EmulationIssues = Needs MMU (very slow due to that). +EmulationStateId = 4 +EmulationIssues = Needs Real Xfb for videos to show up. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GDGP78.ini b/Data/User/GameConfig/GDGP78.ini index f425112d03..7ff92c8b6c 100644 --- a/Data/User/GameConfig/GDGP78.ini +++ b/Data/User/GameConfig/GDGP78.ini @@ -1,9 +1,9 @@ # GDGP78 - Dragon's Lair 3D [Core] Values set here will override the main dolphin settings. -MMU = 1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 3 -EmulationIssues = Needs MMU (very slow due to that). +EmulationStateId = 4 +EmulationIssues = Needs Real Xfb for videos to show up. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GEND69.ini b/Data/User/GameConfig/GEND69.ini index 43cb8e86e1..bae13d7b54 100644 --- a/Data/User/GameConfig/GEND69.ini +++ b/Data/User/GameConfig/GEND69.ini @@ -2,8 +2,8 @@ [Core] Values set here will override the main dolphin settings. TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationIssues = Needs LLE audio for proper sound. -EmulationStateId = 4 +EmulationIssues = Needs LLE audio for proper sound. Graphic glitches (depth issues). Fixed in zcomploc support Dolphin branch. +EmulationStateId = 3 [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GENE69.ini b/Data/User/GameConfig/GENE69.ini index 6307e0268f..23f8b03271 100644 --- a/Data/User/GameConfig/GENE69.ini +++ b/Data/User/GameConfig/GENE69.ini @@ -2,8 +2,8 @@ [Core] Values set here will override the main dolphin settings. TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationIssues = Needs LLE audio for proper sound. -EmulationStateId = 4 +EmulationIssues = Needs LLE audio for proper sound. Graphic glitches (depth issues). Fixed in zcomploc support Dolphin branch. +EmulationStateId = 3 [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GENP69.ini b/Data/User/GameConfig/GENP69.ini index be23957d70..5bf6674c6a 100644 --- a/Data/User/GameConfig/GENP69.ini +++ b/Data/User/GameConfig/GENP69.ini @@ -2,8 +2,8 @@ [Core] Values set here will override the main dolphin settings. TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationIssues = Needs LLE audio for proper sound. -EmulationStateId = 4 +EmulationIssues = Needs LLE audio for proper sound. Graphic glitches (depth issues). Fixed in zcomploc support Dolphin branch. +EmulationStateId = 3 [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GENS69.ini b/Data/User/GameConfig/GENS69.ini index c0645ed29a..227aaddd6d 100644 --- a/Data/User/GameConfig/GENS69.ini +++ b/Data/User/GameConfig/GENS69.ini @@ -2,8 +2,8 @@ [Core] Values set here will override the main dolphin settings. TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationIssues = Needs LLE audio for proper sound. -EmulationStateId = 4 +EmulationIssues = Needs LLE audio for proper sound. Graphic glitches (depth issues). Fixed in zcomploc support Dolphin branch. +EmulationStateId = 3 [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GF5E69.ini b/Data/User/GameConfig/GF5E69.ini index 40e4375018..79b7cf1fd5 100644 --- a/Data/User/GameConfig/GF5E69.ini +++ b/Data/User/GameConfig/GF5E69.ini @@ -1,13 +1,16 @@ # GF5E69 - FIFA Soccer 2005 [Core] Values set here will override the main dolphin settings. TLBHack = 1 -MMU = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationIssues = Sound issues need LLE plugin and videos are messed up. Slow due to MMU(r6932) -EmulationStateId = 3 +EmulationIssues = Sound issues need LLE audio to be fixed and the videos are messed up. +EmulationStateId = 4 [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = [Gecko] - diff --git a/Data/User/GameConfig/GF6E69.ini b/Data/User/GameConfig/GF6E69.ini index 037aeb7404..d812a5d154 100644 --- a/Data/User/GameConfig/GF6E69.ini +++ b/Data/User/GameConfig/GF6E69.ini @@ -1,12 +1,16 @@ # GF6E69 - FIFA 06 [Core] Values set here will override the main dolphin settings. -MMU = 1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 3 -EmulationIssues = Sound issues need LLE plugin and videos are messed up. Slow due to MMU(r6932) +EmulationStateId = 4 +EmulationIssues = Sound issues need LLE audio to be fixed and the videos are messed up. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = [Gecko] - diff --git a/Data/User/GameConfig/GF6F69.ini b/Data/User/GameConfig/GF6F69.ini index 19bc8b9072..2696bcb453 100644 --- a/Data/User/GameConfig/GF6F69.ini +++ b/Data/User/GameConfig/GF6F69.ini @@ -1,11 +1,16 @@ # GF6F69 - FIFA 06 [Core] Values set here will override the main dolphin settings. -MMU = 1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 4 -EmulationIssues = Sound issues need LLE plugin and videos are messed up. Slow due to MMU(r6932) +EmulationIssues = Sound issues need LLE audio to be fixed and the videos are messed up. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = [Gecko] diff --git a/Data/User/GameConfig/GFAD69.ini b/Data/User/GameConfig/GFAD69.ini index 115f719d10..5abba727c5 100644 --- a/Data/User/GameConfig/GFAD69.ini +++ b/Data/User/GameConfig/GFAD69.ini @@ -1,9 +1,9 @@ # GFAD69 - FIFA 2003 [Core] Values set here will override the main dolphin settings. -MMU = 1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 3 -EmulationIssues = Sound issues need LLE plugin and videos are messed up. Slow due to MMU. +EmulationStateId = 4 +EmulationIssues = Sound issues need LLE plugin and videos are messed up. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GFAE69.ini b/Data/User/GameConfig/GFAE69.ini index bfeae04974..f41893cbb3 100644 --- a/Data/User/GameConfig/GFAE69.ini +++ b/Data/User/GameConfig/GFAE69.ini @@ -1,9 +1,9 @@ # GFAE69 - FIFA 2003 [Core] Values set here will override the main dolphin settings. -MMU = 1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 3 -EmulationIssues = Sound issues need LLE plugin and videos are messed up. Slow due to MMU. +EmulationStateId = 4 +EmulationIssues = Sound issues need LLE plugin and videos are messed up. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GFAP69.ini b/Data/User/GameConfig/GFAP69.ini index 3de799a41e..97426b2f38 100644 --- a/Data/User/GameConfig/GFAP69.ini +++ b/Data/User/GameConfig/GFAP69.ini @@ -1,9 +1,9 @@ # GFAP69 - FIFA 2003 [Core] Values set here will override the main dolphin settings. -MMU = 1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 3 -EmulationIssues = Sound issues need LLE plugin and videos are messed up. Slow due to MMU. +EmulationStateId = 4 +EmulationIssues = Sound issues need LLE plugin and videos are messed up. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GFAS69.ini b/Data/User/GameConfig/GFAS69.ini index 003023a82c..1fd280f110 100644 --- a/Data/User/GameConfig/GFAS69.ini +++ b/Data/User/GameConfig/GFAS69.ini @@ -1,9 +1,9 @@ # GFAS69 - FIFA 2003 [Core] Values set here will override the main dolphin settings. -MMU = 1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 3 -EmulationIssues = Sound issues need LLE plugin and videos are messed up. Slow due to MMU. +EmulationStateId = 4 +EmulationIssues = Sound issues need LLE plugin and videos are messed up. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GFYE69.ini b/Data/User/GameConfig/GFYE69.ini index 8289b3d2ac..91766a9a73 100644 --- a/Data/User/GameConfig/GFYE69.ini +++ b/Data/User/GameConfig/GFYE69.ini @@ -1,10 +1,9 @@ # GFYE69 - FIFA Street 2 [Core] Values set here will override the main dolphin settings. TLBHack = 1 -MMU = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 3 -EmulationIssues = Sound issues need LLE plugin and videos are messed up. Slow due to MMU(r6932) +EmulationStateId = 4 +EmulationIssues = Sound issues need LLE plugin and videos are messed up. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. $Master Code @@ -35,8 +34,12 @@ $Away Team Low Trick Points 044349E8 00000000 [Video] ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = [Gecko] [Video_Settings] SafeTextureCache = True SafeTextureCacheColorSamples = 512 - diff --git a/Data/User/GameConfig/GFYP69.ini b/Data/User/GameConfig/GFYP69.ini index e65004851e..629148769d 100644 --- a/Data/User/GameConfig/GFYP69.ini +++ b/Data/User/GameConfig/GFYP69.ini @@ -1,10 +1,9 @@ # GFYP69 - FIFA Street 2 [Core] Values set here will override the main dolphin settings. TLBHack = 1 -MMU = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 3 -EmulationIssues = Sound issues need LLE plugin and videos are messed up. Slow due to MMU(r6932) +EmulationStateId = 4 +EmulationIssues = Sound issues need LLE plugin and videos are messed up. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GG5E52.ini b/Data/User/GameConfig/GG5E52.ini index 32174bc73d..1b292d43b3 100644 --- a/Data/User/GameConfig/GG5E52.ini +++ b/Data/User/GameConfig/GG5E52.ini @@ -2,7 +2,7 @@ [Core] Values set here will override the main dolphin settings. TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationIssues = Needs Jitil to run. LLE audio fixes sound issues. +EmulationIssues = LLE audio fixes sound issues. EmulationStateId = 4 [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. diff --git a/Data/User/GameConfig/GGYE41.ini b/Data/User/GameConfig/GGYE41.ini index 50fe9ee3e0..812eafb8e5 100644 --- a/Data/User/GameConfig/GGYE41.ini +++ b/Data/User/GameConfig/GGYE41.ini @@ -1,7 +1,6 @@ # GGYE41 - GR2GC [Core] Values set here will override the main dolphin settings. TLBHack = 1 -MMU = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 3 EmulationIssues = Needs Real XFB for videos to show up, lle for sound issues.(r6932) @@ -20,4 +19,3 @@ UseXFB = True UseRealXFB = True SafeTextureCache = True SafeTextureCacheColorSamples = 512 - diff --git a/Data/User/GameConfig/GGYP41.ini b/Data/User/GameConfig/GGYP41.ini index bf78a71214..0f49271a1c 100644 --- a/Data/User/GameConfig/GGYP41.ini +++ b/Data/User/GameConfig/GGYP41.ini @@ -1,7 +1,6 @@ # GGYP41 - GR2GC [Core] Values set here will override the main dolphin settings. TLBHack = 1 -MMU = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 3 EmulationIssues = Needs Real XFB for videos to show up, lle for sound issues.(r6932) @@ -20,4 +19,3 @@ UseXFB = True UseRealXFB = True SafeTextureCache = True SafeTextureCacheColorSamples = 512 - diff --git a/Data/User/GameConfig/GH7E5D.ini b/Data/User/GameConfig/GH7E5D.ini index 4ce4e822d5..c42570b689 100644 --- a/Data/User/GameConfig/GH7E5D.ini +++ b/Data/User/GameConfig/GH7E5D.ini @@ -1,6 +1,6 @@ # GH7E5D - Happy Feet [Core] Values set here will override the main dolphin settings. -MMU = 1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationIssues = EmulationStateId = 4 diff --git a/Data/User/GameConfig/GHCE4Q.ini b/Data/User/GameConfig/GHCE4Q.ini index 0762662a0d..28d4a87e1d 100644 --- a/Data/User/GameConfig/GHCE4Q.ini +++ b/Data/User/GameConfig/GHCE4Q.ini @@ -1,6 +1,6 @@ # GHCE4Q - Chicken Little [Core] Values set here will override the main dolphin settings. -MMU = 1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 4 EmulationIssues = @@ -8,5 +8,9 @@ EmulationIssues = [ActionReplay] Add action replay cheats here. [Video] ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = [Gecko] - diff --git a/Data/User/GameConfig/GHCF4Q.ini b/Data/User/GameConfig/GHCF4Q.ini index 8fa6ac1159..82d4668bd4 100644 --- a/Data/User/GameConfig/GHCF4Q.ini +++ b/Data/User/GameConfig/GHCF4Q.ini @@ -1,6 +1,6 @@ # GHCF4Q - Chicken Little [Core] Values set here will override the main dolphin settings. -MMU = 1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 4 EmulationIssues = @@ -8,4 +8,9 @@ EmulationIssues = [ActionReplay] Add action replay cheats here. [Video] ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = [Gecko] diff --git a/Data/User/GameConfig/GIKE70.ini b/Data/User/GameConfig/GIKE70.ini index e3254eb0af..57e0ef7c0d 100644 --- a/Data/User/GameConfig/GIKE70.ini +++ b/Data/User/GameConfig/GIKE70.ini @@ -1,9 +1,17 @@ # GIKE70 - IKARUGA [EmuState] EmulationStateId = 5 +EmulationIssues = [Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = [OnFrame] [ActionReplay] [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 128 diff --git a/Data/User/GameConfig/GIKP70.ini b/Data/User/GameConfig/GIKP70.ini index 264ea3055d..d1ed2aa92f 100644 --- a/Data/User/GameConfig/GIKP70.ini +++ b/Data/User/GameConfig/GIKP70.ini @@ -7,3 +7,4 @@ EmulationStateId = 5 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 128 diff --git a/Data/User/GameConfig/GIZE52.ini b/Data/User/GameConfig/GIZE52.ini index c38ae6fb01..8eca4a073e 100644 --- a/Data/User/GameConfig/GIZE52.ini +++ b/Data/User/GameConfig/GIZE52.ini @@ -1,8 +1,8 @@ # GIZE52 - Ty3 [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 3 -EmulationIssues = Text is broken ingame. Fixed in tex-preload Dolphin branch. +EmulationStateId = 4 +EmulationIssues = [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GJWE78.ini b/Data/User/GameConfig/GJWE78.ini index d9f3ef79dd..1ae68295c5 100644 --- a/Data/User/GameConfig/GJWE78.ini +++ b/Data/User/GameConfig/GJWE78.ini @@ -1,6 +1,6 @@ # GJWE78 - Tak: The Great Juju Challenge [Core] Values set here will override the main dolphin settings. -MMU = 1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationIssues = EmulationStateId = 4 @@ -26,5 +26,9 @@ $Infinite Green Fruit 0444C434 4479C000 [Video] ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = [Gecko] - diff --git a/Data/User/GameConfig/GJZE52.ini b/Data/User/GameConfig/GJZE52.ini index b37df81b13..3a9b1eb46e 100644 --- a/Data/User/GameConfig/GJZE52.ini +++ b/Data/User/GameConfig/GJZE52.ini @@ -3,7 +3,7 @@ TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 4 -EmulationIssues = Needs Jitil to run. LLE audio fixes some sound issues. +EmulationIssues = LLE audio fixes some sound issues. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GK4E01.ini b/Data/User/GameConfig/GK4E01.ini index 4860de6eb9..db963e5f1d 100644 --- a/Data/User/GameConfig/GK4E01.ini +++ b/Data/User/GameConfig/GK4E01.ini @@ -3,8 +3,8 @@ #Values set here will override the main dolphin settings. [EmuState] #The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 5 -EmulationIssues = +EmulationStateId = 4 +EmulationIssues = Graphic glitches (depth issues). Fixed in zcomploc support Dolphin branch. [OnFrame] [ActionReplay] $(M) @@ -51,5 +51,9 @@ $MILLIARDE Quick Level Up 042D55E0 000F423F [Video] ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = [Gecko] - diff --git a/Data/User/GameConfig/GKBEAF.ini b/Data/User/GameConfig/GKBEAF.ini index 9934a2ba80..6a41bc607d 100644 --- a/Data/User/GameConfig/GKBEAF.ini +++ b/Data/User/GameConfig/GKBEAF.ini @@ -2,7 +2,7 @@ [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 4 -EmulationIssues = +EmulationIssues = Graphic glitches (depth issues). Fixed in zcomploc support Dolphin branch. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GKBPAF.ini b/Data/User/GameConfig/GKBPAF.ini index 3e5a2cb6d0..61f2a5e442 100644 --- a/Data/User/GameConfig/GKBPAF.ini +++ b/Data/User/GameConfig/GKBPAF.ini @@ -2,7 +2,7 @@ [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 4 -EmulationIssues = +EmulationIssues = Graphic glitches (depth issues). Fixed in zcomploc support Dolphin branch. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GKLE69.ini b/Data/User/GameConfig/GKLE69.ini index 760bc023a3..1caa8234f5 100644 --- a/Data/User/GameConfig/GKLE69.ini +++ b/Data/User/GameConfig/GKLE69.ini @@ -1,13 +1,19 @@ # GKLE69 - The Lord of the Rings; The Return of the King [Core] Values set here will override the main dolphin settings. -MMU = 1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 3 -EmulationIssues = Needs MMU, and is very slow because of it (r6572) +EmulationStateId = 4 +EmulationIssues = [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/GKLF69.ini b/Data/User/GameConfig/GKLF69.ini index f7e2ef20f2..c7fb5d7e19 100644 --- a/Data/User/GameConfig/GKLF69.ini +++ b/Data/User/GameConfig/GKLF69.ini @@ -1,13 +1,19 @@ # GKLF69 - The Lord of the Rings; The Return of the King [Core] Values set here will override the main dolphin settings. -MMU = 1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 3 -EmulationIssues = Needs MMU, and is very slow because of it (r6572) +EmulationStateId = 4 +EmulationIssues = [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/GKLP69.ini b/Data/User/GameConfig/GKLP69.ini index 4c7302bfa3..69bc9a0e81 100644 --- a/Data/User/GameConfig/GKLP69.ini +++ b/Data/User/GameConfig/GKLP69.ini @@ -1,9 +1,9 @@ # GKLP69 - The Lord of the Rings; The Return of the King [Core] Values set here will override the main dolphin settings. -MMU = 1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 3 -EmulationIssues = Needs MMU, and is very slow because of it (r6572) +EmulationStateId = 4 +EmulationIssues = [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] @@ -17,4 +17,3 @@ PH_ZFar = [Video_Settings] SafeTextureCache = True SafeTextureCacheColorSamples = 512 - diff --git a/Data/User/GameConfig/GKLS69.ini b/Data/User/GameConfig/GKLS69.ini index f34abbae8a..a71ab2f394 100644 --- a/Data/User/GameConfig/GKLS69.ini +++ b/Data/User/GameConfig/GKLS69.ini @@ -1,13 +1,19 @@ # GKLS69 - The Lord of the Rings; The Return of the King [Core] Values set here will override the main dolphin settings. -MMU = 1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 3 -EmulationIssues = Needs MMU, and is very slow because of it (r6572) +EmulationStateId = 4 +EmulationIssues = [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/GLCE52.ini b/Data/User/GameConfig/GLCE52.ini index 2d296b4cc3..aaab149619 100644 --- a/Data/User/GameConfig/GLCE52.ini +++ b/Data/User/GameConfig/GLCE52.ini @@ -18,6 +18,7 @@ PH_ZFar = [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 DstAlphaPass = True [Video_Hacks] EFBCopyEnable = True diff --git a/Data/User/GameConfig/GLCF52.ini b/Data/User/GameConfig/GLCF52.ini index 8ba4333554..3858773a87 100644 --- a/Data/User/GameConfig/GLCF52.ini +++ b/Data/User/GameConfig/GLCF52.ini @@ -18,6 +18,7 @@ PH_ZFar = [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 DstAlphaPass = True [Video_Hacks] EFBCopyEnable = True diff --git a/Data/User/GameConfig/GM5E7D.ini b/Data/User/GameConfig/GM5E7D.ini index f7aa5f8eee..3e62c95886 100644 --- a/Data/User/GameConfig/GM5E7D.ini +++ b/Data/User/GameConfig/GM5E7D.ini @@ -3,7 +3,6 @@ SafeTextureCache = True SafeTextureCacheColorSamples = 512 [Core] -CPUThread = 0 [Video] ProjectionHack = 0 PH_SZNear = 0 @@ -12,8 +11,8 @@ PH_ExtraParam = 0 PH_ZNear = PH_ZFar = [EmuState] -EmulationStateId = 3 -EmulationIssues = Needs single core or LLE audio to prevent random crashes(r7436). +EmulationStateId = 4 +EmulationIssues = [OnFrame] [ActionReplay] [Gecko] diff --git a/Data/User/GameConfig/GM5F7D.ini b/Data/User/GameConfig/GM5F7D.ini index 4c8b28f81e..cb53610824 100644 --- a/Data/User/GameConfig/GM5F7D.ini +++ b/Data/User/GameConfig/GM5F7D.ini @@ -3,7 +3,6 @@ SafeTextureCache = True SafeTextureCacheColorSamples = 512 [Core] -CPUThread = 0 [Video] ProjectionHack = 0 PH_SZNear = 0 @@ -12,8 +11,8 @@ PH_ExtraParam = 0 PH_ZNear = PH_ZFar = [EmuState] -EmulationStateId = 3 -EmulationIssues = Needs single core or LLE audio to prevent random crashes(r7436). +EmulationStateId = 4 +EmulationIssues = [OnFrame] [ActionReplay] [Gecko] diff --git a/Data/User/GameConfig/GM5P7D.ini b/Data/User/GameConfig/GM5P7D.ini index 3d61a5be29..875550b1ba 100644 --- a/Data/User/GameConfig/GM5P7D.ini +++ b/Data/User/GameConfig/GM5P7D.ini @@ -3,7 +3,6 @@ SafeTextureCache = True SafeTextureCacheColorSamples = 512 [Core] -CPUThread = 0 [Video] ProjectionHack = 0 PH_SZNear = 0 @@ -12,9 +11,8 @@ PH_ExtraParam = 0 PH_ZNear = PH_ZFar = [EmuState] -EmulationStateId = 3 -EmulationIssues = Needs single core or LLE audio to prevent random crashes(r7436). +EmulationStateId = 4 +EmulationIssues = [OnFrame] [ActionReplay] [Gecko] - diff --git a/Data/User/GameConfig/GNNE69.ini b/Data/User/GameConfig/GNNE69.ini index e089c40997..94365947db 100644 --- a/Data/User/GameConfig/GNNE69.ini +++ b/Data/User/GameConfig/GNNE69.ini @@ -10,3 +10,5 @@ ProjectionHack = 0 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 + diff --git a/Data/User/GameConfig/GOAE52.ini b/Data/User/GameConfig/GOAE52.ini index 8a3da2eb71..2d0371aa41 100644 --- a/Data/User/GameConfig/GOAE52.ini +++ b/Data/User/GameConfig/GOAE52.ini @@ -3,7 +3,7 @@ TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 4 -EmulationIssues = Needs Jitil to run. LLE audio fixes sound issues. +EmulationIssues = LLE audio fixes sound issues. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GPOP8P.ini b/Data/User/GameConfig/GPOP8P.ini index c6fe1f33e1..513c2487c3 100644 --- a/Data/User/GameConfig/GPOP8P.ini +++ b/Data/User/GameConfig/GPOP8P.ini @@ -63,4 +63,5 @@ PH_ZNear = PH_ZFar = [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 [Gecko] diff --git a/Data/User/GameConfig/GPSP8P.ini b/Data/User/GameConfig/GPSP8P.ini index 787743cc82..e20c7ce4f1 100644 --- a/Data/User/GameConfig/GPSP8P.ini +++ b/Data/User/GameConfig/GPSP8P.ini @@ -62,4 +62,5 @@ PH_ZNear = PH_ZFar = [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 [Gecko] diff --git a/Data/User/GameConfig/GQTE4Q.ini b/Data/User/GameConfig/GQTE4Q.ini index 2f34294dc2..79ec455449 100644 --- a/Data/User/GameConfig/GQTE4Q.ini +++ b/Data/User/GameConfig/GQTE4Q.ini @@ -1,6 +1,5 @@ # GQTE4Q - Meet the Robinsons [Core] Values set here will override the main dolphin settings. -MMU = 1 TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationIssues = @@ -9,5 +8,9 @@ EmulationStateId = 4 [ActionReplay] Add action replay cheats here. [Video] ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = [Gecko] - diff --git a/Data/User/GameConfig/GRYE41.ini b/Data/User/GameConfig/GRYE41.ini new file mode 100644 index 0000000000..02d48539b1 --- /dev/null +++ b/Data/User/GameConfig/GRYE41.ini @@ -0,0 +1,18 @@ +# GRYE41 - RAYMAN ARENA +[Core] Values set here will override the main dolphin settings. +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Needs Real Xfb for videos to display. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] +[Video_Settings] +UseXFB = True +UseRealXFB = True diff --git a/Data/User/GameConfig/GT3D52.ini b/Data/User/GameConfig/GT3D52.ini index f50771d9b3..3719bb4ecd 100644 --- a/Data/User/GameConfig/GT3D52.ini +++ b/Data/User/GameConfig/GT3D52.ini @@ -1,8 +1,8 @@ # GT3D52 - Tony Hawk's Pro Skater 3 [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 4 -EmulationIssues = Neads real xfb for videos to display. +EmulationStateId = 3 +EmulationIssues = Needs real xfb for videos to display. Graphic glitches (depth issues). Fixed in zcomploc support Dolphin branch. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GT3E52.ini b/Data/User/GameConfig/GT3E52.ini index dbfe35663e..ff89fe601f 100644 --- a/Data/User/GameConfig/GT3E52.ini +++ b/Data/User/GameConfig/GT3E52.ini @@ -1,8 +1,8 @@ # GT3E52 - Tony Hawk's Pro Skater 3 [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 4 -EmulationIssues = Neads real xfb for videos to display. +EmulationStateId = 3 +EmulationIssues = Needs real xfb for videos to display. Graphic glitches (depth issues). Fixed in zcomploc support Dolphin branch. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GT3F52.ini b/Data/User/GameConfig/GT3F52.ini index 24d932371a..52b9fa5a23 100644 --- a/Data/User/GameConfig/GT3F52.ini +++ b/Data/User/GameConfig/GT3F52.ini @@ -1,8 +1,8 @@ # GT3F52 - Tony Hawk's Pro Skater 3 [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 4 -EmulationIssues = Neads real xfb for videos to display. +EmulationStateId = 3 +EmulationIssues = Needs real xfb for videos to display. Graphic glitches (depth issues). Fixed in zcomploc support Dolphin branch. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GT3P52.ini b/Data/User/GameConfig/GT3P52.ini index aa644f6659..85447e25f7 100644 --- a/Data/User/GameConfig/GT3P52.ini +++ b/Data/User/GameConfig/GT3P52.ini @@ -1,8 +1,8 @@ # GT3P52 - Tony Hawk's Pro Skater 3 [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 4 -EmulationIssues = Neads real xfb for videos to display. +EmulationStateId = 3 +EmulationIssues = Needs real xfb for videos to display. Graphic glitches (depth issues). Fixed in zcomploc support Dolphin branch. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GT7E41.ini b/Data/User/GameConfig/GT7E41.ini index 99426db64a..f52913c097 100644 --- a/Data/User/GameConfig/GT7E41.ini +++ b/Data/User/GameConfig/GT7E41.ini @@ -3,7 +3,7 @@ TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 3 -EmulationIssues = Goes ingame using Jitil, videos need real XFB to show up and loading screens show garbage(r6898) +EmulationIssues = Videos need real XFB to show up and loading screens show garbage. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] @@ -19,4 +19,3 @@ UseXFB = True UseRealXFB = True SafeTextureCache = True SafeTextureCacheColorSamples = 512 - diff --git a/Data/User/GameConfig/GT7P41.ini b/Data/User/GameConfig/GT7P41.ini index 13cb3250bc..1b85f7846d 100644 --- a/Data/User/GameConfig/GT7P41.ini +++ b/Data/User/GameConfig/GT7P41.ini @@ -3,7 +3,7 @@ TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 3 -EmulationIssues = Goes ingame using Jitil, videos need real XFB to show up and loading screens show garbage(r6898) +EmulationIssues = Videos need real XFB to show up and loading screens show garbage. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] @@ -18,3 +18,4 @@ PH_ZFar = UseXFB = True UseRealXFB = True SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/GT7X41.ini b/Data/User/GameConfig/GT7X41.ini index e8144424d3..7efc4af689 100644 --- a/Data/User/GameConfig/GT7X41.ini +++ b/Data/User/GameConfig/GT7X41.ini @@ -3,7 +3,7 @@ TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 3 -EmulationIssues = Goes ingame using Jitil, videos need real XFB to show up and loading screens show garbage(r6898) +EmulationIssues = Videos need real XFB to show up and loading screens show garbage. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] @@ -18,3 +18,4 @@ PH_ZFar = UseXFB = True UseRealXFB = True SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/GTYE69.ini b/Data/User/GameConfig/GTYE69.ini index 268b84cb93..4966a81ed7 100644 --- a/Data/User/GameConfig/GTYE69.ini +++ b/Data/User/GameConfig/GTYE69.ini @@ -1,8 +1,8 @@ # GTYE69 - TY the Tasmanian Tiger [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 4 -EmulationIssues = +EmulationStateId = 3 +EmulationIssues = Graphic glitches (depth issues). Fixed in zcomploc support Dolphin branch. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GTYP69.ini b/Data/User/GameConfig/GTYP69.ini index 91ee039579..34839fa08c 100644 --- a/Data/User/GameConfig/GTYP69.ini +++ b/Data/User/GameConfig/GTYP69.ini @@ -1,8 +1,8 @@ # GTYP69 - TY the Tasmanian Tiger [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 4 -EmulationIssues = +EmulationStateId = 3 +EmulationIssues = Graphic glitches (depth issues). Fixed in zcomploc support Dolphin branch. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GVKE52.ini b/Data/User/GameConfig/GVKE52.ini index c7269fd372..379960a872 100644 --- a/Data/User/GameConfig/GVKE52.ini +++ b/Data/User/GameConfig/GVKE52.ini @@ -3,10 +3,14 @@ TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 4 -EmulationIssues = Needs Jitil to run(r6871) +EmulationIssues = [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = [Gecko] - diff --git a/Data/User/GameConfig/GWYE41.ini b/Data/User/GameConfig/GWYE41.ini index 9aa12b7bd6..770adfd1d1 100644 --- a/Data/User/GameConfig/GWYE41.ini +++ b/Data/User/GameConfig/GWYE41.ini @@ -18,3 +18,4 @@ PH_ZFar = UseXFB = True UseRealXFB = True SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/GXFE69.ini b/Data/User/GameConfig/GXFE69.ini index 8a70142f4a..d74632b761 100644 --- a/Data/User/GameConfig/GXFE69.ini +++ b/Data/User/GameConfig/GXFE69.ini @@ -1,9 +1,9 @@ # GXFE69 - FIFA Soccer 2004 [Core] Values set here will override the main dolphin settings. -MMU = 1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 3 -EmulationIssues = Sound issues need LLE plugin and videos are messed up. Slow due to MMU.Use Opengl backend for less graphic glitches. +EmulationIssues = Sound issues need LLE plugin and videos are messed up. Unstable (crashes ingame). [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GXFF69.ini b/Data/User/GameConfig/GXFF69.ini index 22a7852666..10a4862537 100644 --- a/Data/User/GameConfig/GXFF69.ini +++ b/Data/User/GameConfig/GXFF69.ini @@ -1,9 +1,9 @@ # GXFF69 - FIFA Soccer 2004 [Core] Values set here will override the main dolphin settings. -MMU = 1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 3 -EmulationIssues = Sound issues need LLE plugin and videos are messed up. Slow due to MMU.Use Opengl backend for less graphic glitches. +EmulationIssues = Sound issues need LLE plugin and videos are messed up. Unstable (crashes ingame). [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GXFP69.ini b/Data/User/GameConfig/GXFP69.ini index b6c9d1a977..ea3f4ead57 100644 --- a/Data/User/GameConfig/GXFP69.ini +++ b/Data/User/GameConfig/GXFP69.ini @@ -1,9 +1,9 @@ # GXFP69 - FIFA Soccer 2004 [Core] Values set here will override the main dolphin settings. -MMU = 1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 3 -EmulationIssues = Sound issues need LLE plugin and videos are messed up. Slow due to MMU.Use Opengl backend for less graphic glitches. +EmulationIssues = Sound issues need LLE plugin and videos are messed up. Unstable (crashes ingame). [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GXXE01.ini b/Data/User/GameConfig/GXXE01.ini index a66e71accf..2f9cba55d5 100644 --- a/Data/User/GameConfig/GXXE01.ini +++ b/Data/User/GameConfig/GXXE01.ini @@ -1,6 +1,5 @@ # GXXE01 - POKeMON XD [Core] Values set here will override the main dolphin settings. -CPUThread = 0 BlockMerging = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 4 diff --git a/Data/User/GameConfig/GXXP01.ini b/Data/User/GameConfig/GXXP01.ini index 9d2a0435d5..925765d0d6 100644 --- a/Data/User/GameConfig/GXXP01.ini +++ b/Data/User/GameConfig/GXXP01.ini @@ -1,6 +1,5 @@ # GXXP01 - POKeMON XD [Core] Values set here will override the main dolphin settings. -CPUThread = 0 BlockMerging = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 4 @@ -19,4 +18,3 @@ PH_ZFar = EFBScale = 1 SafeTextureCache = True SafeTextureCacheColorSamples = 0 - diff --git a/Data/User/GameConfig/GYWD41.ini b/Data/User/GameConfig/GYWD41.ini index 2056d831a7..97437f947d 100644 --- a/Data/User/GameConfig/GYWD41.ini +++ b/Data/User/GameConfig/GYWD41.ini @@ -1,8 +1,8 @@ # GYWD41 - Harvest Moon: A Wonderful Life [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 3 -EmulationIssues = Text is broken ingame. Fixed in tex-preload dolphin branch. +EmulationStateId = 4 +EmulationIssues = [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GYWEE9.ini b/Data/User/GameConfig/GYWEE9.ini index 906558b987..c42f850e64 100644 --- a/Data/User/GameConfig/GYWEE9.ini +++ b/Data/User/GameConfig/GYWEE9.ini @@ -1,8 +1,8 @@ # GYWEE9 - Harvest Moon: A Wonderful Life [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 3 -EmulationIssues = Text is broken ingame. Fixed in tex-preload dolphin branch. +EmulationStateId = 4 +EmulationIssues = [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GYWP41.ini b/Data/User/GameConfig/GYWP41.ini index 35634452c2..49a4ba2f05 100644 --- a/Data/User/GameConfig/GYWP41.ini +++ b/Data/User/GameConfig/GYWP41.ini @@ -1,8 +1,8 @@ # GYWP41 - Harvest Moon: A Wonderful Life [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 3 -EmulationIssues = Text is broken ingame. Fixed in tex-preload dolphin branch. +EmulationStateId = 4 +EmulationIssues = [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/HACA01.ini b/Data/User/GameConfig/HACA01.ini index d3a9f197b8..e1408bffbf 100644 --- a/Data/User/GameConfig/HACA01.ini +++ b/Data/User/GameConfig/HACA01.ini @@ -9,3 +9,4 @@ EmulationIssues = ProjectionHack = 0 [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/R22E01.ini b/Data/User/GameConfig/R22E01.ini index 8d992eb454..7b02c3ce0c 100644 --- a/Data/User/GameConfig/R22E01.ini +++ b/Data/User/GameConfig/R22E01.ini @@ -2,7 +2,7 @@ [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 4 -EmulationIssues = +EmulationIssues = Needs real wiimote and motion plus. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/R22J01.ini b/Data/User/GameConfig/R22J01.ini index cdf18e0b81..5f09707267 100644 --- a/Data/User/GameConfig/R22J01.ini +++ b/Data/User/GameConfig/R22J01.ini @@ -2,7 +2,7 @@ [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 4 -EmulationIssues = +EmulationIssues = Needs real wiimote and motion plus. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/R22P01.ini b/Data/User/GameConfig/R22P01.ini index 1a04cc43e1..fe8ae43998 100644 --- a/Data/User/GameConfig/R22P01.ini +++ b/Data/User/GameConfig/R22P01.ini @@ -2,7 +2,7 @@ [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 4 -EmulationIssues = +EmulationIssues = Needs real wiimote and motion plus. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/R3OJ01.ini b/Data/User/GameConfig/R3OJ01.ini index 2616b66fda..e4e7593424 100644 --- a/Data/User/GameConfig/R3OJ01.ini +++ b/Data/User/GameConfig/R3OJ01.ini @@ -15,3 +15,4 @@ PH_ZFar = [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/R3OP01.ini b/Data/User/GameConfig/R3OP01.ini index 11284c5749..e3cae1e700 100644 --- a/Data/User/GameConfig/R3OP01.ini +++ b/Data/User/GameConfig/R3OP01.ini @@ -15,3 +15,4 @@ PH_ZFar = [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/R5DE5G.ini b/Data/User/GameConfig/R5DE5G.ini index 0eaa856ab0..4d99e04a3c 100644 --- a/Data/User/GameConfig/R5DE5G.ini +++ b/Data/User/GameConfig/R5DE5G.ini @@ -3,7 +3,7 @@ SkipIdle = 0 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 4 -EmulationIssues = +EmulationIssues = Idle skipping causes speed issues. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] @@ -15,7 +15,5 @@ PH_ZNear = PH_ZFar = [Gecko] [Video_Settings] -UseXFB = True -UseRealXFB = True [Video_Hacks] DlistCachingEnable = False diff --git a/Data/User/GameConfig/R5IE4Q.ini b/Data/User/GameConfig/R5IE4Q.ini index 3d7a37d075..afef7d58e5 100644 --- a/Data/User/GameConfig/R5IE4Q.ini +++ b/Data/User/GameConfig/R5IE4Q.ini @@ -15,5 +15,6 @@ PH_ZFar = [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 [Video_Enhancements] ForceFiltering = False diff --git a/Data/User/GameConfig/R5IP4Q.ini b/Data/User/GameConfig/R5IP4Q.ini index a891668910..34e1aaa9a5 100644 --- a/Data/User/GameConfig/R5IP4Q.ini +++ b/Data/User/GameConfig/R5IP4Q.ini @@ -15,5 +15,6 @@ PH_ZFar = [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 [Video_Enhancements] ForceFiltering = False diff --git a/Data/User/GameConfig/R5IX4Q.ini b/Data/User/GameConfig/R5IX4Q.ini index a4ea4ef22d..be7dc69ede 100644 --- a/Data/User/GameConfig/R5IX4Q.ini +++ b/Data/User/GameConfig/R5IX4Q.ini @@ -15,5 +15,6 @@ PH_ZFar = [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 [Video_Enhancements] ForceFiltering = False diff --git a/Data/User/GameConfig/R6YEXS.ini b/Data/User/GameConfig/R6YEXS.ini index 8624fff2d8..00c0ab4926 100644 --- a/Data/User/GameConfig/R6YEXS.ini +++ b/Data/User/GameConfig/R6YEXS.ini @@ -10,3 +10,4 @@ ProjectionHack = 0 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/R6YPH3.ini b/Data/User/GameConfig/R6YPH3.ini index cc17213f48..8802d053eb 100644 --- a/Data/User/GameConfig/R6YPH3.ini +++ b/Data/User/GameConfig/R6YPH3.ini @@ -10,3 +10,4 @@ ProjectionHack = 0 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/R7XE69.ini b/Data/User/GameConfig/R7XE69.ini new file mode 100644 index 0000000000..833b57ac39 --- /dev/null +++ b/Data/User/GameConfig/R7XE69.ini @@ -0,0 +1,21 @@ +# R7XE69 - Need for Speed: Nitro +[Core] Values set here will override the main dolphin settings. +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Videos are messed up, needs LLE audio for proper sound. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] +[Video_Settings] +SafeTextureCache = True +SafeTextureCacheColorSamples = 512 +[Video_Hacks] +EFBToTextureEnable = False +EFBCopyEnable = True diff --git a/Data/User/GameConfig/R7XJ13.ini b/Data/User/GameConfig/R7XJ13.ini new file mode 100644 index 0000000000..c017b2d31e --- /dev/null +++ b/Data/User/GameConfig/R7XJ13.ini @@ -0,0 +1,21 @@ +# R7XJ13 - Need for Speed: Nitro +[Core] Values set here will override the main dolphin settings. +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Videos are messed up, needs LLE audio for proper sound. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] +[Video_Settings] +SafeTextureCache = True +SafeTextureCacheColorSamples = 512 +[Video_Hacks] +EFBToTextureEnable = False +EFBCopyEnable = True diff --git a/Data/User/GameConfig/R7XP69.ini b/Data/User/GameConfig/R7XP69.ini new file mode 100644 index 0000000000..162ed64cc5 --- /dev/null +++ b/Data/User/GameConfig/R7XP69.ini @@ -0,0 +1,21 @@ +# R7XP69 - Need for Speed: Nitro +[Core] Values set here will override the main dolphin settings. +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Videos are messed up, needs LLE audio for proper sound. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] +[Video_Settings] +SafeTextureCache = True +SafeTextureCacheColorSamples = 512 +[Video_Hacks] +EFBToTextureEnable = False +EFBCopyEnable = True diff --git a/Data/User/GameConfig/RBWE01.ini b/Data/User/GameConfig/RBWE01.ini index 3a8f5fc212..60b08e73c4 100644 --- a/Data/User/GameConfig/RBWE01.ini +++ b/Data/User/GameConfig/RBWE01.ini @@ -1,8 +1,8 @@ # RBWE01 - Battalion Wars 2 [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 3 -EmulationIssues = Recent revs crash ingame, use an older rev like r6461 with watermark tightness set to 600. +EmulationStateId = 4 +EmulationIssues = Needs LLE audio for proper sound. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/RBWJ01.ini b/Data/User/GameConfig/RBWJ01.ini index 0cfcdb0c24..8efad9729f 100644 --- a/Data/User/GameConfig/RBWJ01.ini +++ b/Data/User/GameConfig/RBWJ01.ini @@ -1,10 +1,16 @@ # RBWJ01 - Totsugeki Famicom Wars vs. [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 3 -EmulationIssues = Recent revs crash ingame, use an older rev like r6461 with watermark tightness set to 600. +EmulationStateId = 4 +EmulationIssues = Needs LLE audio for proper sound. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] ProjectionHack = 0 -[Gecko] \ No newline at end of file +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] +[Video_Enhancements] diff --git a/Data/User/GameConfig/RBWP01.ini b/Data/User/GameConfig/RBWP01.ini index df90e22bfc..36b0b3bc98 100644 --- a/Data/User/GameConfig/RBWP01.ini +++ b/Data/User/GameConfig/RBWP01.ini @@ -1,10 +1,16 @@ # RBWP01 - Battalion Wars 2 [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 3 -EmulationIssues = Recent revs crash ingame, use an older rev like r6461 with watermark tightness set to 600. +EmulationStateId = 4 +EmulationIssues = Needs LLE audio for proper sound. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] ProjectionHack = 0 -[Gecko] \ No newline at end of file +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] +[Video_Enhancements] diff --git a/Data/User/GameConfig/RDSJAF.ini b/Data/User/GameConfig/RDSJAF.ini index 8b208019f3..aa06d850a3 100644 --- a/Data/User/GameConfig/RDSJAF.ini +++ b/Data/User/GameConfig/RDSJAF.ini @@ -10,3 +10,4 @@ ProjectionHack = 0 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/RDSPAF.ini b/Data/User/GameConfig/RDSPAF.ini index 58cbbb496a..c120c82306 100644 --- a/Data/User/GameConfig/RDSPAF.ini +++ b/Data/User/GameConfig/RDSPAF.ini @@ -10,3 +10,4 @@ ProjectionHack = 0 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/RFCJGD.ini b/Data/User/GameConfig/RFCJGD.ini index 8d65cff383..2677e1c3ce 100644 --- a/Data/User/GameConfig/RFCJGD.ini +++ b/Data/User/GameConfig/RFCJGD.ini @@ -10,3 +10,4 @@ ProjectionHack = 0 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/RFCPGD.ini b/Data/User/GameConfig/RFCPGD.ini index 0a8daa4dbe..a4f4259842 100644 --- a/Data/User/GameConfig/RFCPGD.ini +++ b/Data/User/GameConfig/RFCPGD.ini @@ -9,3 +9,4 @@ EmulationIssues = Turn off "use panic handlers". Water glitches (r6521) [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/RFFJGD.ini b/Data/User/GameConfig/RFFJGD.ini index 749f5e068f..dd5d213fb6 100644 --- a/Data/User/GameConfig/RFFJGD.ini +++ b/Data/User/GameConfig/RFFJGD.ini @@ -16,4 +16,4 @@ PH_ZFar = [Video_Settings] SafeTextureCache = True EFBScale = 2 - +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/RFFPGD.ini b/Data/User/GameConfig/RFFPGD.ini index 9c24e2df88..c885e966e5 100644 --- a/Data/User/GameConfig/RFFPGD.ini +++ b/Data/User/GameConfig/RFFPGD.ini @@ -16,3 +16,4 @@ PH_ZFar = [Video_Settings] SafeTextureCache = True EFBScale = 2 +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/RFQP69.ini b/Data/User/GameConfig/RFQP69.ini index ced45265c7..194f30e616 100644 --- a/Data/User/GameConfig/RFQP69.ini +++ b/Data/User/GameConfig/RFQP69.ini @@ -9,3 +9,4 @@ EmulationIssues = Hack = 3 [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/RIPJAF.ini b/Data/User/GameConfig/RIPJAF.ini index 8daa461e7c..1e56628f9a 100644 --- a/Data/User/GameConfig/RIPJAF.ini +++ b/Data/User/GameConfig/RIPJAF.ini @@ -10,3 +10,4 @@ ProjectionHack = 0 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/RIPPAF.ini b/Data/User/GameConfig/RIPPAF.ini index f0756110ea..d39623fbe7 100644 --- a/Data/User/GameConfig/RIPPAF.ini +++ b/Data/User/GameConfig/RIPPAF.ini @@ -10,3 +10,4 @@ ProjectionHack = 0 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/RIUJAF.ini b/Data/User/GameConfig/RIUJAF.ini index c5dea403f9..95efb08eb3 100644 --- a/Data/User/GameConfig/RIUJAF.ini +++ b/Data/User/GameConfig/RIUJAF.ini @@ -10,3 +10,4 @@ ProjectionHack = 0 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/RK2JEB.ini b/Data/User/GameConfig/RK2JEB.ini index 8016eac272..9623df720c 100644 --- a/Data/User/GameConfig/RK2JEB.ini +++ b/Data/User/GameConfig/RK2JEB.ini @@ -10,3 +10,4 @@ ProjectionHack = 0 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/RK2P01.ini b/Data/User/GameConfig/RK2P01.ini index 9d8895d1d2..b0487fea0c 100644 --- a/Data/User/GameConfig/RK2P01.ini +++ b/Data/User/GameConfig/RK2P01.ini @@ -10,3 +10,4 @@ ProjectionHack = 0 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/RKDJEB.ini b/Data/User/GameConfig/RKDJEB.ini index 1e475b1bc4..8f9ab80392 100644 --- a/Data/User/GameConfig/RKDJEB.ini +++ b/Data/User/GameConfig/RKDJEB.ini @@ -10,3 +10,4 @@ ProjectionHack = 0 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/RKDP01.ini b/Data/User/GameConfig/RKDP01.ini index 5e430c75b9..5339b97e0f 100644 --- a/Data/User/GameConfig/RKDP01.ini +++ b/Data/User/GameConfig/RKDP01.ini @@ -8,4 +8,5 @@ EmulationIssues = [Video] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/RKDPEB.ini b/Data/User/GameConfig/RKDPEB.ini index f6c8b3f8a2..e88be90b60 100644 --- a/Data/User/GameConfig/RKDPEB.ini +++ b/Data/User/GameConfig/RKDPEB.ini @@ -10,3 +10,4 @@ ProjectionHack = 0 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/ROUJAF.ini b/Data/User/GameConfig/ROUJAF.ini index 6300f9c9c0..885cb49d68 100644 --- a/Data/User/GameConfig/ROUJAF.ini +++ b/Data/User/GameConfig/ROUJAF.ini @@ -10,3 +10,4 @@ ProjectionHack = 0 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/RQ6EJJ.ini b/Data/User/GameConfig/RQ6EJJ.ini index d9bcac7936..8edd965307 100644 --- a/Data/User/GameConfig/RQ6EJJ.ini +++ b/Data/User/GameConfig/RQ6EJJ.ini @@ -6,7 +6,6 @@ MaxAnisotropy = 0 SafeTextureCache = True SafeTextureCacheColorSamples = 128 [Core] -MMU = 1 BlockMerging = 1 [Video] ProjectionHack = 0 @@ -17,7 +16,7 @@ PH_ZNear = PH_ZFar = [EmuState] EmulationStateId = 4 -EmulationIssues = Use direct 3d 11 for less glitches. Slow, it needs mmu to not crash ingame(r7436). +EmulationIssues = Use direct 3d 11 for less glitches. [OnFrame] [ActionReplay] [Gecko] diff --git a/Data/User/GameConfig/RQ6PKM.ini b/Data/User/GameConfig/RQ6PKM.ini index cfc87e365d..fffd94e621 100644 --- a/Data/User/GameConfig/RQ6PKM.ini +++ b/Data/User/GameConfig/RQ6PKM.ini @@ -6,7 +6,6 @@ MaxAnisotropy = 0 SafeTextureCache = True SafeTextureCacheColorSamples = 128 [Core] -MMU = 1 BlockMerging = 1 [Video] ProjectionHack = 0 @@ -17,7 +16,7 @@ PH_ZNear = PH_ZFar = [EmuState] EmulationStateId = 4 -EmulationIssues = Use direct 3d 11 for less glitches. Slow, it needs mmu to not crash ingame(r7436). +EmulationIssues = Use direct 3d 11 for less glitches. [OnFrame] [ActionReplay] [Gecko] diff --git a/Data/User/GameConfig/RQ6XKM.ini b/Data/User/GameConfig/RQ6XKM.ini index b8e03b8b37..4799406dd8 100644 --- a/Data/User/GameConfig/RQ6XKM.ini +++ b/Data/User/GameConfig/RQ6XKM.ini @@ -6,7 +6,6 @@ MaxAnisotropy = 0 SafeTextureCache = True SafeTextureCacheColorSamples = 128 [Core] -MMU = 1 BlockMerging = 1 [Video] ProjectionHack = 0 @@ -17,7 +16,7 @@ PH_ZNear = PH_ZFar = [EmuState] EmulationStateId = 4 -EmulationIssues = Use direct 3d 11 for less glitches. Slow, it needs mmu to not crash ingame(r7436). +EmulationIssues = Use direct 3d 11 for less glitches. [OnFrame] [ActionReplay] [Gecko] diff --git a/Data/User/GameConfig/S2LE01.ini b/Data/User/GameConfig/S2LE01.ini new file mode 100644 index 0000000000..980e8e4a8e --- /dev/null +++ b/Data/User/GameConfig/S2LE01.ini @@ -0,0 +1,19 @@ +# S2LE01 - PokePark Wii2 +[Core] Values set here will override the main dolphin settings. +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Needs EFB to Ram to display photographs. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] +[Video_Hacks] +EFBToTextureEnable = False +EFBCopyEnable = True +EFBCopyCacheEnable = True diff --git a/Data/User/GameConfig/S2LJ01.ini b/Data/User/GameConfig/S2LJ01.ini new file mode 100644 index 0000000000..9fd8978873 --- /dev/null +++ b/Data/User/GameConfig/S2LJ01.ini @@ -0,0 +1,19 @@ +# S2LJ01 - PokePark Wii2 +[Core] Values set here will override the main dolphin settings. +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Needs EFB to Ram to display photographs. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] +[Video_Hacks] +EFBToTextureEnable = False +EFBCopyEnable = True +EFBCopyCacheEnable = True diff --git a/Data/User/GameConfig/S2LP01.ini b/Data/User/GameConfig/S2LP01.ini new file mode 100644 index 0000000000..da782c2d72 --- /dev/null +++ b/Data/User/GameConfig/S2LP01.ini @@ -0,0 +1,19 @@ +# S2LP01 - PokePark Wii2 +[Core] Values set here will override the main dolphin settings. +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Needs EFB to Ram to display photographs. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] +[Video_Hacks] +EFBToTextureEnable = False +EFBCopyEnable = True +EFBCopyCacheEnable = True diff --git a/Data/User/GameConfig/S59E01.ini b/Data/User/GameConfig/S59E01.ini index adac044e0c..4c34183639 100644 --- a/Data/User/GameConfig/S59E01.ini +++ b/Data/User/GameConfig/S59E01.ini @@ -10,3 +10,4 @@ ProjectionHack = 0 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/S59JC8.ini b/Data/User/GameConfig/S59JC8.ini index a35db392e7..4fffae6156 100644 --- a/Data/User/GameConfig/S59JC8.ini +++ b/Data/User/GameConfig/S59JC8.ini @@ -10,3 +10,4 @@ ProjectionHack = 0 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/SAKPNS.ini b/Data/User/GameConfig/SAKPNS.ini index e702bc182f..a0fae1312f 100644 --- a/Data/User/GameConfig/SAKPNS.ini +++ b/Data/User/GameConfig/SAKPNS.ini @@ -10,3 +10,4 @@ ProjectionHack = 0 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/SBDJ08.ini b/Data/User/GameConfig/SBDJ08.ini index a281b91c1a..56b7d2dae7 100644 --- a/Data/User/GameConfig/SBDJ08.ini +++ b/Data/User/GameConfig/SBDJ08.ini @@ -15,3 +15,4 @@ PH_ZFar = 0.5 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/SBDK08.ini b/Data/User/GameConfig/SBDK08.ini index d3166632f1..e76f702b2b 100644 --- a/Data/User/GameConfig/SBDK08.ini +++ b/Data/User/GameConfig/SBDK08.ini @@ -15,3 +15,4 @@ PH_ZFar = 0.5 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/SBDP08.ini b/Data/User/GameConfig/SBDP08.ini index 529c32a43a..24620fc1fd 100644 --- a/Data/User/GameConfig/SBDP08.ini +++ b/Data/User/GameConfig/SBDP08.ini @@ -15,3 +15,4 @@ PH_ZFar = 0.5 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/SC8E01.ini b/Data/User/GameConfig/SC8E01.ini new file mode 100644 index 0000000000..639f962a6c --- /dev/null +++ b/Data/User/GameConfig/SC8E01.ini @@ -0,0 +1,15 @@ +# SC8E01 - Wii Play: Motion +[Core] Values set here will override the main dolphin settings. +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Needs real wiimote and motion plus. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/SC8J01.ini b/Data/User/GameConfig/SC8J01.ini new file mode 100644 index 0000000000..cc78b5632f --- /dev/null +++ b/Data/User/GameConfig/SC8J01.ini @@ -0,0 +1,15 @@ +# SC8J01 - Wii Play: Motion +[Core] Values set here will override the main dolphin settings. +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Needs real wiimote and motion plus. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/SC8P01.ini b/Data/User/GameConfig/SC8P01.ini new file mode 100644 index 0000000000..bbc6c1f1b4 --- /dev/null +++ b/Data/User/GameConfig/SC8P01.ini @@ -0,0 +1,15 @@ +# SC8P01 - Wii Play: Motion +[Core] Values set here will override the main dolphin settings. +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Needs real wiimote and motion plus. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/SE2P69.ini b/Data/User/GameConfig/SE2P69.ini index 54a3f18e16..84e558d6e8 100644 --- a/Data/User/GameConfig/SE2P69.ini +++ b/Data/User/GameConfig/SE2P69.ini @@ -10,5 +10,6 @@ ProjectionHack = 0 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 [Video_Enhancements] ForceFiltering = False diff --git a/Data/User/GameConfig/SEAE69.ini b/Data/User/GameConfig/SEAE69.ini index 67836c884d..36bcb3b758 100644 --- a/Data/User/GameConfig/SEAE69.ini +++ b/Data/User/GameConfig/SEAE69.ini @@ -10,5 +10,6 @@ ProjectionHack = 0 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 [Video_Enhancements] ForceFiltering = False diff --git a/Data/User/GameConfig/SEAJ13.ini b/Data/User/GameConfig/SEAJ13.ini index caa68320ca..db777d59a6 100644 --- a/Data/User/GameConfig/SEAJ13.ini +++ b/Data/User/GameConfig/SEAJ13.ini @@ -10,5 +10,6 @@ ProjectionHack = 0 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 [Video_Enhancements] ForceFiltering = False diff --git a/Data/User/GameConfig/SEAP69.ini b/Data/User/GameConfig/SEAP69.ini index 1310ccc94f..ac68fe2dfa 100644 --- a/Data/User/GameConfig/SEAP69.ini +++ b/Data/User/GameConfig/SEAP69.ini @@ -10,5 +10,6 @@ ProjectionHack = 0 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 [Video_Enhancements] ForceFiltering = False diff --git a/Data/User/GameConfig/SFWP69.ini b/Data/User/GameConfig/SFWP69.ini index 40eaf1269d..10a8358ca0 100644 --- a/Data/User/GameConfig/SFWP69.ini +++ b/Data/User/GameConfig/SFWP69.ini @@ -9,3 +9,4 @@ EmulationIssues = Lacks HLE Sound [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/SLSJ01.ini b/Data/User/GameConfig/SLSJ01.ini new file mode 100644 index 0000000000..cbf3e2e349 --- /dev/null +++ b/Data/User/GameConfig/SLSJ01.ini @@ -0,0 +1,19 @@ +# SLSJ01 - THE LAST STORY +[Core] Values set here will override the main dolphin settings. +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Direct 3d 9 backend has some depth glitches, use other backends instead. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] +[Video_Hacks] +EFBToTextureEnable = False +EFBCopyEnable = True +EFBCopyCacheEnable = True diff --git a/Data/User/GameConfig/SLSP01.ini b/Data/User/GameConfig/SLSP01.ini new file mode 100644 index 0000000000..daa2b0f9af --- /dev/null +++ b/Data/User/GameConfig/SLSP01.ini @@ -0,0 +1,19 @@ +# SLSP01 - THE LAST STORY +[Core] Values set here will override the main dolphin settings. +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Direct 3d 9 backend has some depth glitches, use other backends instead. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] +[Video_Hacks] +EFBToTextureEnable = False +EFBCopyEnable = True +EFBCopyCacheEnable = True diff --git a/Data/User/GameConfig/SMNE01.ini b/Data/User/GameConfig/SMNE01.ini index 9cda92dadd..6d3407b0b6 100644 --- a/Data/User/GameConfig/SMNE01.ini +++ b/Data/User/GameConfig/SMNE01.ini @@ -39,5 +39,6 @@ PH_ZFar = [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 [Video_Hacks] DlistCachingEnable = False diff --git a/Data/User/GameConfig/SMNJ01.ini b/Data/User/GameConfig/SMNJ01.ini index 7f1cfb06bf..f4da9a9516 100644 --- a/Data/User/GameConfig/SMNJ01.ini +++ b/Data/User/GameConfig/SMNJ01.ini @@ -15,5 +15,6 @@ PH_ZFar = [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 [Video_Hacks] DlistCachingEnable = False diff --git a/Data/User/GameConfig/SMNK01.ini b/Data/User/GameConfig/SMNK01.ini index 30238bcbd4..e1f74effaf 100644 --- a/Data/User/GameConfig/SMNK01.ini +++ b/Data/User/GameConfig/SMNK01.ini @@ -15,5 +15,6 @@ PH_ZFar = [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 [Video_Hacks] DlistCachingEnable = False diff --git a/Data/User/GameConfig/SMNW01.ini b/Data/User/GameConfig/SMNW01.ini index 0c6dfc2f57..7862bd2d40 100644 --- a/Data/User/GameConfig/SMNW01.ini +++ b/Data/User/GameConfig/SMNW01.ini @@ -15,5 +15,6 @@ PH_ZFar = [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 [Video_Hacks] DlistCachingEnable = False diff --git a/Data/User/GameConfig/SNDE20.ini b/Data/User/GameConfig/SNDE20.ini new file mode 100644 index 0000000000..012a3b2ceb --- /dev/null +++ b/Data/User/GameConfig/SNDE20.ini @@ -0,0 +1,17 @@ +# SNDE20 - Deal or No Deal +[Core] Values set here will override the main dolphin settings. +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] +[Video_Settings] +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/SNJP69.ini b/Data/User/GameConfig/SNJP69.ini index 5b87dc2614..92710604b0 100644 --- a/Data/User/GameConfig/SNJP69.ini +++ b/Data/User/GameConfig/SNJP69.ini @@ -10,4 +10,5 @@ ProjectionHack = 0 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/SOUE01.ini b/Data/User/GameConfig/SOUE01.ini index 3a17851101..3e80a50dd6 100644 --- a/Data/User/GameConfig/SOUE01.ini +++ b/Data/User/GameConfig/SOUE01.ini @@ -18,3 +18,6 @@ EFBAccessEnable = True DlistCachingEnable = False [Wii] DisableWiimoteSpeaker = 1 +[Video_Settings] +SafeTextureCache = True +SafeTextureCacheColorSamples = 128 diff --git a/Data/User/GameConfig/SOUJ01.ini b/Data/User/GameConfig/SOUJ01.ini index 67e67a1525..dafa18ad0d 100644 --- a/Data/User/GameConfig/SOUJ01.ini +++ b/Data/User/GameConfig/SOUJ01.ini @@ -18,3 +18,6 @@ EFBAccessEnable = True DlistCachingEnable = False [Wii] DisableWiimoteSpeaker = 1 +[Video_Settings] +SafeTextureCache = True +SafeTextureCacheColorSamples = 128 diff --git a/Data/User/GameConfig/SOUK01.ini b/Data/User/GameConfig/SOUK01.ini index f169b324bf..fa78c40356 100644 --- a/Data/User/GameConfig/SOUK01.ini +++ b/Data/User/GameConfig/SOUK01.ini @@ -18,3 +18,6 @@ EFBAccessEnable = True DlistCachingEnable = False [Wii] DisableWiimoteSpeaker = 1 +[Video_Settings] +SafeTextureCache = True +SafeTextureCacheColorSamples = 128 diff --git a/Data/User/GameConfig/SOUP01.ini b/Data/User/GameConfig/SOUP01.ini index 0e80a81656..849ef6c111 100644 --- a/Data/User/GameConfig/SOUP01.ini +++ b/Data/User/GameConfig/SOUP01.ini @@ -18,3 +18,6 @@ EFBAccessEnable = True DlistCachingEnable = False [Wii] DisableWiimoteSpeaker = 1 +[Video_Settings] +SafeTextureCache = True +SafeTextureCacheColorSamples = 128 diff --git a/Data/User/GameConfig/SPTJEB.ini b/Data/User/GameConfig/SPTJEB.ini index 3d223c0d5a..b660638831 100644 --- a/Data/User/GameConfig/SPTJEB.ini +++ b/Data/User/GameConfig/SPTJEB.ini @@ -10,3 +10,4 @@ ProjectionHack = 0 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/SUKE01.ini b/Data/User/GameConfig/SUKE01.ini index a4c7b22fd4..e8a9cdc79d 100644 --- a/Data/User/GameConfig/SUKE01.ini +++ b/Data/User/GameConfig/SUKE01.ini @@ -2,7 +2,7 @@ [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 4 -EmulationIssues = Theater mode crashes, needs XFB for certain minigames. +EmulationIssues = Some minigames need XFB to work. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] @@ -18,4 +18,3 @@ UseXFB = True UseRealXFB = False SafeTextureCache = True SafeTextureCacheColorSamples = 128 - diff --git a/Data/User/GameConfig/SUKJ01.ini b/Data/User/GameConfig/SUKJ01.ini index a6cd7a1961..210f0a92f3 100644 --- a/Data/User/GameConfig/SUKJ01.ini +++ b/Data/User/GameConfig/SUKJ01.ini @@ -2,7 +2,7 @@ [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 4 -EmulationIssues = Theater mode crashes, needs XFB for certain minigames. +EmulationIssues = Some minigames need XFB to work. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/SUKP01.ini b/Data/User/GameConfig/SUKP01.ini index 8ea6027097..61e2551da7 100644 --- a/Data/User/GameConfig/SUKP01.ini +++ b/Data/User/GameConfig/SUKP01.ini @@ -2,7 +2,7 @@ [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 4 -EmulationIssues = Theater mode crashes, needs XFB for certain minigames. +EmulationIssues = Some minigames need XFB to work. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/SXCP52.ini b/Data/User/GameConfig/SXCP52.ini index 29bf6aab48..b3b8f10788 100644 --- a/Data/User/GameConfig/SXCP52.ini +++ b/Data/User/GameConfig/SXCP52.ini @@ -10,3 +10,4 @@ ProjectionHack = 0 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 diff --git a/Data/User/GameConfig/WF4EGD.ini b/Data/User/GameConfig/WF4EGD.ini index 38e0f8875b..8fae5fc30d 100644 --- a/Data/User/GameConfig/WF4EGD.ini +++ b/Data/User/GameConfig/WF4EGD.ini @@ -10,3 +10,4 @@ ProjectionHack = 0 [Gecko] [Video_Settings] SafeTextureCache = True +SafeTextureCacheColorSamples = 512 From 6202714efdf66987e57846d3297a5972c8b75c38 Mon Sep 17 00:00:00 2001 From: NeoBrainX Date: Tue, 20 Mar 2012 22:36:21 +0100 Subject: [PATCH 26/32] Fix some regressions from r3b38295cbd08. --- .../Core/VideoCommon/Src/TextureCacheBase.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp index cc14499330..00ff9610be 100644 --- a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp @@ -172,8 +172,10 @@ void TextureCache::ClearRenderTargets() TexCache::iterator iter = textures.begin(), tcend = textures.end(); + for (; iter!=tcend; ++iter) - iter->second->type = TCET_NORMAL; + if (iter->second->type != TCET_EC_DYNAMIC) + iter->second->type = TCET_NORMAL; } TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int stage, @@ -238,6 +240,9 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int stage, // 2. a) For EFB copies, only the hash and the texture address need to match if (entry->IsEfbCopy() && tex_hash == entry->hash && address == entry->addr) { + if (entry->type != TCET_EC_VRAM) + entry->type = TCET_NORMAL; + // TODO: Print a warning if the format changes! In this case, we could reinterpret the internal texture object data to the new pixel format (similiar to what is already being done in Renderer::ReinterpretPixelFormat()) goto return_entry; } @@ -318,8 +323,8 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int stage, entry->SetGeneralParameters(address, texture_size, full_format, entry->num_mipmaps); entry->SetDimensions(nativeW, nativeH, width, height); entry->hash = tex_hash; - if (g_ActiveConfig.bCopyEFBToTexture) entry->type = TCET_NORMAL; - else if (entry->IsEfbCopy()) entry->type = TCET_EC_DYNAMIC; + if (entry->IsEfbCopy() && !g_ActiveConfig.bCopyEFBToTexture) entry->type = TCET_EC_DYNAMIC; + else entry->type = TCET_NORMAL; // load texture entry->Load(width, height, expandedWidth, 0, (texLevels == 0)); @@ -647,8 +652,11 @@ void TextureCache::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFormat if ((entry->type == TCET_EC_VRAM && entry->virtual_width == scaled_tex_w && entry->virtual_height == scaled_tex_h) || (entry->type == TCET_EC_DYNAMIC && entry->native_width == tex_w && entry->native_height == tex_h)) { - scaled_tex_w = tex_w; - scaled_tex_h = tex_h; + if (entry->type == TCET_EC_DYNAMIC) + { + scaled_tex_w = tex_w; + scaled_tex_h = tex_h; + } } else { From 70b6c4280f72a1adaa7cefc7ab7cc7173e3c8e7f Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Wed, 21 Mar 2012 22:43:44 +0100 Subject: [PATCH 27/32] Compile with /fp:precise instead of /fp:fast in release mode on Windows /fp:fast was introducing FP precision problems, and mixing it with some /fp:precise code caused strange game behaviors, DSI exceptions and freezes. This commit should fix most of the issues introduced by 3.0-73 (r95517a97). Thanks to hatarumoroboshi@hotmail.com for tracking a lot of these Win32 bugs. Fixes issue 4906. Fixes issue 5138. Probably fixes (not tested) issue 5067. --- .../PowerPC/Interpreter/Interpreter_FloatingPoint.cpp | 10 +--------- Source/VSProps/CodeGen_Release.props | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp index 3b0ae602cd..1d6ea2e70d 100644 --- a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp +++ b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp @@ -42,10 +42,6 @@ using namespace MathUtil; void UpdateSSEState(); -#ifdef _MSC_VER -#pragma float_control(precise, on, push) -#endif - // Extremely rare - actually, never seen. // Star Wars : Rogue Leader spams that at some point :| void Interpreter::Helper_UpdateCR1(double _fValue) @@ -518,8 +514,4 @@ void Interpreter::fsqrtx(UGeckoInstruction _inst) rPS0(_inst.FD) = sqrt(b); UpdateFPRF(rPS0(_inst.FD)); if (_inst.Rc) Helper_UpdateCR1(rPS0(_inst.FD)); -} - -#ifdef _MSC_VER -#pragma float_control(pop) -#endif +} \ No newline at end of file diff --git a/Source/VSProps/CodeGen_Release.props b/Source/VSProps/CodeGen_Release.props index 74770b6910..2dd392b7a9 100644 --- a/Source/VSProps/CodeGen_Release.props +++ b/Source/VSProps/CodeGen_Release.props @@ -19,7 +19,7 @@ false _SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) StreamingSIMDExtensions2 - Fast + Precise true From 15db05d7abd781d2a4ddcbeca57ff30a87b663f9 Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Wed, 21 Mar 2012 14:53:50 -0700 Subject: [PATCH 28/32] I am very picky about my VS files... :D --- Source/VSProps/CodeGen_Release.props | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/VSProps/CodeGen_Release.props b/Source/VSProps/CodeGen_Release.props index 2dd392b7a9..2b69dc0f63 100644 --- a/Source/VSProps/CodeGen_Release.props +++ b/Source/VSProps/CodeGen_Release.props @@ -19,7 +19,6 @@ false _SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) StreamingSIMDExtensions2 - Precise true From dc1cde4581edae5dd95a8a31d8251e2e0bd88a7f Mon Sep 17 00:00:00 2001 From: Matthew Parlane Date: Thu, 22 Mar 2012 17:25:43 +1300 Subject: [PATCH 29/32] Re-enabled stfs, was caused by fast fp, thanks delroth! --- Source/Core/Core/Src/PowerPC/Jit64/Jit64_Tables.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit64_Tables.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit64_Tables.cpp index 5b7baa28c0..93963513ee 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit64_Tables.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit64_Tables.cpp @@ -100,8 +100,8 @@ static GekkoOPTemplate primarytable[] = {50, &Jit64::lfd}, //"lfd", OPTYPE_LOADFP, FL_IN_A}}, {51, &Jit64::Default}, //"lfdu", OPTYPE_LOADFP, FL_OUT_A | FL_IN_A}}, - {52, &Jit64::Default}, //"stfs", OPTYPE_STOREFP, FL_IN_A}}, - {53, &Jit64::Default}, //"stfsu", OPTYPE_STOREFP, FL_OUT_A | FL_IN_A}}, + {52, &Jit64::stfs}, //"stfs", OPTYPE_STOREFP, FL_IN_A}}, + {53, &Jit64::stfs}, //"stfsu", OPTYPE_STOREFP, FL_OUT_A | FL_IN_A}}, {54, &Jit64::stfd}, //"stfd", OPTYPE_STOREFP, FL_IN_A}}, {55, &Jit64::Default}, //"stfdu", OPTYPE_STOREFP, FL_OUT_A | FL_IN_A}}, From 2d75d7a8be4f5487db9735ff1de010d57312fcd2 Mon Sep 17 00:00:00 2001 From: Matthew Parlane Date: Thu, 22 Mar 2012 21:15:05 +1300 Subject: [PATCH 30/32] Fixes issue 5278. Thanks to megazig for finding the bug :) --- Source/Core/DiscIO/Src/VolumeDirectory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/DiscIO/Src/VolumeDirectory.cpp b/Source/Core/DiscIO/Src/VolumeDirectory.cpp index 08188bac71..52e9f4389a 100644 --- a/Source/Core/DiscIO/Src/VolumeDirectory.cpp +++ b/Source/Core/DiscIO/Src/VolumeDirectory.cpp @@ -389,8 +389,8 @@ void CVolumeDirectory::BuildFST() // write FST size and location _dbg_assert_(DVDINTERFACE, m_diskHeader); Write32((u32)(FST_ADDRESS >> m_addressShift), 0x0424, m_diskHeader); - Write32((u32)m_fstSize, 0x0428, m_diskHeader); - Write32((u32)m_fstSize, 0x042c, m_diskHeader); + Write32((u32)(m_fstSize >> m_addressShift), 0x0428, m_diskHeader); + Write32((u32)(m_fstSize >> m_addressShift), 0x042c, m_diskHeader); } void CVolumeDirectory::WriteToBuffer(u64 _SrcStartAddress, u64 _SrcLength, u8* _Src, From d95e31af3f779bfa3141047e8b6275e1fd2e4bbb Mon Sep 17 00:00:00 2001 From: Matthew Parlane Date: Thu, 22 Mar 2012 22:52:12 +1300 Subject: [PATCH 31/32] Fixes issue 4932 AGAIN :D --- Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp index b552185f87..cd4f679db9 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp @@ -376,10 +376,8 @@ void ExecuteCommand(u32 _Address) else { WARN_LOG(WII_IPC_HLE, "Unimplemented device: %s", DeviceName.c_str()); - pDevice = GetDeviceByName(std::string("_Unimplemented_Device_")); - CmdSuccess = pDevice->Open(_Address, Mode); - g_FdMap[DeviceID] = pDevice; - Memory::Write_U32(DeviceID, _Address+4); + Memory::Write_U32(FS_ENOENT, _Address+4); + CmdSuccess = true; } } else From 9c9e593479222b64c414f18facc605ec048a19e4 Mon Sep 17 00:00:00 2001 From: LPFaint99 Date: Thu, 22 Mar 2012 14:52:20 -0700 Subject: [PATCH 32/32] fix crash on windows while changing exi/si devices when interface language is Japanese or Chinese --- Source/Core/DolphinWX/Src/ConfigMain.cpp | 30 ++++++++++++------------ Source/Core/DolphinWX/Src/ConfigMain.h | 4 ++-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Source/Core/DolphinWX/Src/ConfigMain.cpp b/Source/Core/DolphinWX/Src/ConfigMain.cpp index fdca309aee..5ad6859778 100644 --- a/Source/Core/DolphinWX/Src/ConfigMain.cpp +++ b/Source/Core/DolphinWX/Src/ConfigMain.cpp @@ -90,7 +90,7 @@ static const wxLanguage langIds[] = #define EXIDEV_GECKO_STR "USBGecko" #define CSTR_TRANS(a) wxString(wxGetTranslation(wxT(a))).mb_str() - +#define WXSTR_TRANS(a) wxString(wxGetTranslation(wxT(a))) #ifdef WIN32 //only used with xgettext to be picked up as translatable string. //win32 does not have wx on its path, the provided wxALL_FILES @@ -979,7 +979,7 @@ void CConfigMain::GCSettingsChanged(wxCommandEvent& event) case ID_GC_EXIDEVICE_SLOTB: exidevice++; case ID_GC_EXIDEVICE_SLOTA: - ChooseEXIDevice(std::string(event.GetString().mb_str()), exidevice); + ChooseEXIDevice(event.GetString(), exidevice); break; case ID_GC_EXIDEVICE_SLOTA_PATH: ChooseMemcardPath(SConfig::GetInstance().m_strMemoryCardA, true); @@ -994,7 +994,7 @@ void CConfigMain::GCSettingsChanged(wxCommandEvent& event) case ID_GC_SIDEVICE1: sidevice++; case ID_GC_SIDEVICE0: - ChooseSIDevice(std::string(event.GetString().mb_str()), sidevice); + ChooseSIDevice(event.GetString(), sidevice); break; } } @@ -1044,16 +1044,16 @@ void CConfigMain::ChooseMemcardPath(std::string& strMemcard, bool isSlotA) } } -void CConfigMain::ChooseSIDevice(std::string deviceName, int deviceNum) +void CConfigMain::ChooseSIDevice(wxString deviceName, int deviceNum) { SIDevices tempType; - if (!deviceName.compare(CSTR_TRANS(SIDEV_STDCONT_STR))) + if (!deviceName.compare(WXSTR_TRANS(SIDEV_STDCONT_STR))) tempType = SIDEVICE_GC_CONTROLLER; - else if (!deviceName.compare(CSTR_TRANS(SIDEV_BONGO_STR))) + else if (!deviceName.compare(WXSTR_TRANS(SIDEV_BONGO_STR))) tempType = SIDEVICE_GC_TARUKONGA; - else if (!deviceName.compare(SIDEV_GBA_STR)) + else if (!deviceName.compare(wxT(SIDEV_GBA_STR))) tempType = SIDEVICE_GC_GBA; - else if (!deviceName.compare(CSTR_TRANS(SIDEV_AM_BB_STR))) + else if (!deviceName.compare(WXSTR_TRANS(SIDEV_AM_BB_STR))) tempType = SIDEVICE_AM_BASEBOARD; else tempType = SIDEVICE_NONE; @@ -1067,21 +1067,21 @@ void CConfigMain::ChooseSIDevice(std::string deviceName, int deviceNum) } } -void CConfigMain::ChooseEXIDevice(std::string deviceName, int deviceNum) +void CConfigMain::ChooseEXIDevice(wxString deviceName, int deviceNum) { TEXIDevices tempType; - if (!deviceName.compare(CSTR_TRANS(EXIDEV_MEMCARD_STR))) + if (!deviceName.compare(WXSTR_TRANS(EXIDEV_MEMCARD_STR))) tempType = EXIDEVICE_MEMORYCARD; - else if (!deviceName.compare(CSTR_TRANS(EXIDEV_MIC_STR))) + else if (!deviceName.compare(WXSTR_TRANS(EXIDEV_MIC_STR))) tempType = EXIDEVICE_MIC; - else if (!deviceName.compare(EXIDEV_BBA_STR)) + else if (!deviceName.compare(wxT(EXIDEV_BBA_STR))) tempType = EXIDEVICE_ETH; - else if (!deviceName.compare(CSTR_TRANS(EXIDEV_AM_BB_STR))) + else if (!deviceName.compare(WXSTR_TRANS(EXIDEV_AM_BB_STR))) tempType = EXIDEVICE_AM_BASEBOARD; - else if (!deviceName.compare(EXIDEV_GECKO_STR)) + else if (!deviceName.compare(wxT(EXIDEV_GECKO_STR))) tempType = EXIDEVICE_GECKO; - else if (!deviceName.compare(CSTR_TRANS(DEV_NONE_STR))) + else if (!deviceName.compare(WXSTR_TRANS(DEV_NONE_STR))) tempType = EXIDEVICE_NONE; else tempType = EXIDEVICE_DUMMY; diff --git a/Source/Core/DolphinWX/Src/ConfigMain.h b/Source/Core/DolphinWX/Src/ConfigMain.h index 3ec798fb8e..7cb6c81dc7 100644 --- a/Source/Core/DolphinWX/Src/ConfigMain.h +++ b/Source/Core/DolphinWX/Src/ConfigMain.h @@ -253,8 +253,8 @@ private: void GCSettingsChanged(wxCommandEvent& event); void ChooseMemcardPath(std::string& strMemcard, bool isSlotA); - void ChooseSIDevice(std::string deviceName, int deviceNum); - void ChooseEXIDevice(std::string deviceName, int deviceNum); + void ChooseSIDevice(wxString deviceName, int deviceNum); + void ChooseEXIDevice(wxString deviceName, int deviceNum); void WiiSettingsChanged(wxCommandEvent& event); // Change from IPL.LNG value to country code