From 76d24f2c0d8bdad2ad49cdd839f44d0a5b020711 Mon Sep 17 00:00:00 2001 From: hrydgard Date: Sat, 21 Mar 2009 18:00:54 +0000 Subject: [PATCH] improve PE logging + misc git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2716 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/HW/PixelEngine.cpp | 39 ++++++++++++++----- Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp | 4 ++ .../Core/Src/PowerPC/JitCommon/JitCache.cpp | 2 +- Source/Core/InputCommon/InputCommon.vcproj | 8 ++-- .../Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp | 2 +- 5 files changed, 41 insertions(+), 14 deletions(-) diff --git a/Source/Core/Core/Src/HW/PixelEngine.cpp b/Source/Core/Core/Src/HW/PixelEngine.cpp index f44de2e504..e8f72eab14 100644 --- a/Source/Core/Core/Src/HW/PixelEngine.cpp +++ b/Source/Core/Core/Src/HW/PixelEngine.cpp @@ -15,6 +15,11 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ + +// http://developer.nvidia.com/object/General_FAQ.html#t6 !!!!! + + + #include "Common.h" #include "ChunkFile.h" @@ -34,8 +39,13 @@ namespace PixelEngine // internal hardware addresses enum { - CTRL_REGISTER = 0x00a, - TOKEN_REG = 0x00e, + PE_CTRL_REGISTER = 0x00a, + PE_TOKEN_REG = 0x00e, + PE_ZCONF = 0x000, + PE_ALPHACONF = 0x002, + PE_DSTALPHACONF = 0x004, + PE_ALPHAMODE = 0x006, + PE_ALPHAREAD = 0x008, }; // fifo Control Register @@ -90,16 +100,21 @@ void Read16(u16& _uReturnValue, const u32 _iAddress) switch (_iAddress & 0xFFF) { - case CTRL_REGISTER: + case PE_CTRL_REGISTER: _uReturnValue = g_ctrlReg.Hex; INFO_LOG(PIXELENGINE,"\t CTRL_REGISTER : %04x", _uReturnValue); return; - case TOKEN_REG: + case PE_TOKEN_REG: _uReturnValue = CommandProcessor::fifo.PEToken; INFO_LOG(PIXELENGINE,"\t TOKEN_REG : %04x", _uReturnValue); return; + case PE_ALPHACONF: + // Most games read this early. no idea why. + INFO_LOG(PIXELENGINE, "(r16): PE_ALPHACONF"); + break; + default: WARN_LOG(PIXELENGINE, "(r16): unknown @ %08x", _iAddress); break; @@ -115,11 +130,9 @@ void Write32(const u32 _iValue, const u32 _iAddress) void Write16(const u16 _iValue, const u32 _iAddress) { - DEBUG_LOG(PIXELENGINE, "(w16): 0x%04x @ 0x%08x",_iValue,_iAddress); - switch (_iAddress & 0xFFF) { - case CTRL_REGISTER: + case PE_CTRL_REGISTER: { UPECtrlReg tmpCtrl(_iValue); @@ -131,17 +144,25 @@ void Write16(const u16 _iValue, const u32 _iAddress) g_ctrlReg.PEToken = 0; // this flag is write only g_ctrlReg.PEFinish = 0; // this flag is write only + DEBUG_LOG(PIXELENGINE, "(w16): PE_CTRL_REGISTER: 0x%04x", _iValue); UpdateInterrupts(); } break; - case TOKEN_REG: + case PE_TOKEN_REG: //LOG(PIXELENGINE,"WEIRD: program wrote token: %i",_iValue); - PanicAlert("PIXELENGINE : (w16) WTF? PowerPC 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; break; + // These are probably the settings for direct CPU EFB access. Ugh. + case PE_ZCONF: INFO_LOG("(w16) ZCONF: %02x", _iValue); break; + case PE_ALPHACONF: INFO_LOG("(w16) ALPHACONF: %02x", _iValue); break; + case PE_DSTALPHACONF: INFO_LOG("(w16) DSTALPHACONF: %02x", _iValue); break; + case PE_ALPHAMODE: INFO_LOG("(w16) ALPHAMODE: %02x", _iValue); break; + case PE_ALPHAREAD: INFO_LOG("(w16) ALPHAREAD: %02x", _iValue); break; + default: WARN_LOG(PIXELENGINE, "Write16: unknown %04x @ %08x", _iValue, _iAddress); break; diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp index c661fb5c06..81f0ef13ba 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp @@ -463,6 +463,10 @@ namespace CPUCompare // get start tic PROFILER_QUERY_PERFORMACE_COUNTER(&b->ticStart); } +#if defined(_DEBUG) || defined(DEBUGFAST) + // should help logged stacktraces become more accurate + MOV(32, M(&PC), Imm32(js.blockStart)); +#endif //Start up the register allocators //They use the information in gpa/fpa to preload commonly used registers. diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp b/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp index 6c3b931c69..52dbc02155 100644 --- a/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp +++ b/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp @@ -315,7 +315,7 @@ void JitBlockCache::GetBlockNumbersFromAddress(u32 em_address, std::vector //overwritten. We should have thrown it out before, on instruction cache invalidate or something. //Not ne cessarily bad though , if a game has simply thrown away a lot of code and is now using the space //for something else, then it's fine. - WARN_LOG(MASTER_LOG, "WARNING - ClearCache detected code overwrite @ %08x", blocks[blocknum].originalAddress); + DEBUG_LOG(MASTER_LOG, "WARNING - ClearCache detected code overwrite @ %08x", blocks[blocknum].originalAddress); } // We don't unlink blocks, we just send anyone who tries to run them back to the dispatcher. diff --git a/Source/Core/InputCommon/InputCommon.vcproj b/Source/Core/InputCommon/InputCommon.vcproj index 1aa686e530..9dcf128832 100644 --- a/Source/Core/InputCommon/InputCommon.vcproj +++ b/Source/Core/InputCommon/InputCommon.vcproj @@ -25,6 +25,7 @@ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" ConfigurationType="4" CharacterSet="0" + WholeProgramOptimization="0" >