From 4f48594aa8bcf8e9dc1e355cf14efc2d0f676f2e Mon Sep 17 00:00:00 2001 From: hrydgard Date: Tue, 17 Feb 2009 23:07:10 +0000 Subject: [PATCH] Remove/cleanup some auto-"breaks" in the code. they are annoying when debugging. (jit64 hits the DSP.cpp case in animal crossing) :/ git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2300 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/Core.cpp | 4 ++-- Source/Core/Core/Src/HW/CPU.h | 6 +++--- Source/Core/Core/Src/HW/DSP.cpp | 5 ++--- Source/Core/Core/Src/HW/MemmapFunctions.cpp | 2 -- Source/Core/Core/Src/HW/WII_IPC.cpp | 1 - Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp | 3 --- Source/Core/Core/Src/PowerPC/Interpreter/Interpreter.cpp | 8 +++----- Source/Core/DebuggerWX/Src/CodeWindow.cpp | 4 ++-- 8 files changed, 12 insertions(+), 21 deletions(-) diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index 418ea45f09..fa1d5dbc23 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -133,7 +133,7 @@ void DisplayMessage(const char *message, int time_in_ms) void Callback_DebuggerBreak() { - CCPU::EnableStepping(true); + CCPU::Break(); } void* GetWindowHandle() @@ -514,7 +514,7 @@ bool SetState(EState _State) break; case CORE_PAUSE: - CCPU::EnableStepping(true); + CCPU::EnableStepping(true); // Break break; case CORE_RUN: diff --git a/Source/Core/Core/Src/HW/CPU.h b/Source/Core/Core/Src/HW/CPU.h index 5f868c8e6a..5b928c9165 100644 --- a/Source/Core/Core/Src/HW/CPU.h +++ b/Source/Core/Core/Src/HW/CPU.h @@ -49,11 +49,11 @@ public: // Enable or Disable Stepping static void EnableStepping(const bool _bStepping); + // break, same as EnableStepping(true). + static void Break(); + // is stepping ? static bool IsStepping(); - - // break - static void Break(); }; #endif diff --git a/Source/Core/Core/Src/HW/DSP.cpp b/Source/Core/Core/Src/HW/DSP.cpp index d96ca515b8..220038aee7 100644 --- a/Source/Core/Core/Src/HW/DSP.cpp +++ b/Source/Core/Core/Src/HW/DSP.cpp @@ -347,7 +347,7 @@ void Write16(const u16 _Value, const u32 _Address) case DSP_CONTROL: { UDSPControl tmpControl; - tmpControl.Hex = (_Value& ~DSP_CONTROL_MASK) | + tmpControl.Hex = (_Value & ~DSP_CONTROL_MASK) | (dsp->DSP_WriteControlRegister(_Value) & DSP_CONTROL_MASK); // Update DSP related flags @@ -374,8 +374,7 @@ void Write16(const u16 _Value, const u32 _Address) g_dspState.DSPControl.pad = tmpControl.pad; if (g_dspState.DSPControl.pad != 0) { - LOG(DSPINTERFACE, "DSPInterface(w) g_dspState.DSPControl gets an unknown value"); - CCPU::Break(); + PanicAlert("DSPInterface(w) g_dspState.DSPControl gets a value with junk in the padding %08x", _Value); } UpdateInterrupts(); diff --git a/Source/Core/Core/Src/HW/MemmapFunctions.cpp b/Source/Core/Core/Src/HW/MemmapFunctions.cpp index d50a4676f9..afb9001ce5 100644 --- a/Source/Core/Core/Src/HW/MemmapFunctions.cpp +++ b/Source/Core/Core/Src/HW/MemmapFunctions.cpp @@ -142,7 +142,6 @@ void ReadFromHardware(T &_var, u32 em_address, u32 effective_address, Memory::XC _var = bswap((*(const T*)&m_pFakeVMEM[em_address & FAKEVMEM_MASK])); } else {/* LOG(MEMMAP,"READ (unknown): %08x (PC: %08x)",em_address,PC);*/ - /*CCPU::EnableStepping(TRUE);*/ /*PanicAlert("READ: Unknown Address", "1", MB_OK);*/ u32 TmpAddress = CheckDTLB(effective_address, flag); TmpAddress = (TmpAddress & 0xFFFFFFF0) | (em_address & 0xF); @@ -219,7 +218,6 @@ void WriteToHardware(u32 em_address, const T data, u32 effective_address, Memory } /* LOG(MEMMAP,"WRITE: %08x (PC: %08x)",em_address,PC);*/ /*MessageBox(NULL, "WRITE: unknown Address", "1", MB_OK);*/ - /*CCPU::EnableStepping(TRUE);*/ u32 tmpAddress = CheckDTLB(effective_address, flag); tmpAddress = (tmpAddress & 0xFFFFFFF0) | (em_address & 0xF); *(T*)&m_pRAM[tmpAddress & RAM_MASK] = bswap(data); diff --git a/Source/Core/Core/Src/HW/WII_IPC.cpp b/Source/Core/Core/Src/HW/WII_IPC.cpp index 70216dbbde..7c34664e8f 100644 --- a/Source/Core/Core/Src/HW/WII_IPC.cpp +++ b/Source/Core/Core/Src/HW/WII_IPC.cpp @@ -130,7 +130,6 @@ void HWCALL Read32(u32& _rReturnValue, const u32 _Address) _rReturnValue = g_IPC_Control.Hex; LOGV(WII_IPC, 2, "IOP: Read32 from IPC_CONTROL_REGISTER(0x04) = 0x%08x", _rReturnValue); - // CCPU::Break(); // if ((REASON_REG & 0x14) == 0x14) CALL IPCReplayHanlder // if ((REASON_REG & 0x22) != 0x22) Jumps to the end 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 bb6cf3bd58..5185f24dcf 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp @@ -405,9 +405,6 @@ void ExecuteCommand(u32 _Address) default: _dbg_assert_msg_(WII_IPC_HLE, 0, "Unknown IPC Command %i (0x%08x)", Command, _Address); // Break on the same terms as the _dbg_assert_msg_, if LOGGING was defined - #ifdef LOGGING - CCPU::Break(); - #endif break; } diff --git a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter.cpp b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter.cpp index 491c0e4cc1..fce68b451f 100644 --- a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter.cpp +++ b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter.cpp @@ -74,7 +74,6 @@ void patches() if (command == 0x0b13) { PanicAlert("command: %x", command); - CCPU::Break(); } }*/ } @@ -105,9 +104,9 @@ void SingleStepInner(void) last_pc = PC; PC = NPC; - if (PowerPC::ppcState.gpr[1] == 0) { + if (PowerPC::ppcState.gpr[1] == 0) + { printf("%i Corrupt stack", PowerPC::ppcState.DebugCount); -// CCPU::Break(); } #if defined(_DEBUG) || defined(DEBUGFAST) PowerPC::ppcState.DebugCount++; @@ -150,7 +149,7 @@ void Run() if (BreakPoints::IsAddressBreakPoint(PC)) { LOG(GEKKO, "Hit Breakpoint - %08x", PC); - CCPU::EnableStepping(true); + CCPU::Break(); if (BreakPoints::IsTempBreakPoint(PC)) BreakPoints::Remove(PC); @@ -190,7 +189,6 @@ void Run() void unknown_instruction(UGeckoInstruction _inst) { - CCPU::Break(); char disasm[256]; DisassembleGekko(Memory::ReadUnchecked_U32(last_pc), last_pc, disasm, 256); printf("Last PC = %08x : %s\n", last_pc, disasm); diff --git a/Source/Core/DebuggerWX/Src/CodeWindow.cpp b/Source/Core/DebuggerWX/Src/CodeWindow.cpp index 9c6ee31c9f..4b3b1de03c 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindow.cpp +++ b/Source/Core/DebuggerWX/Src/CodeWindow.cpp @@ -695,7 +695,7 @@ void CCodeWindow::OnCodeStep(wxCommandEvent& event) } else { - CCPU::EnableStepping(true); + CCPU::EnableStepping(true); // Break Host_UpdateLogDisplay(); } @@ -708,7 +708,7 @@ void CCodeWindow::OnCodeStep(wxCommandEvent& event) break; case IDM_STEPOVER: - CCPU::EnableStepping(true); + CCPU::EnableStepping(true); // TODO: Huh? break; case IDM_SKIP: