From f432d6038e353f98cbe0fa522bd9d6034027246e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 31 Mar 2013 19:10:21 -0400 Subject: Fix some typos and correct some capitalizations in the log messages. Makes the logging look more orderly and less spammy when spitting out things. --- Source/Core/VideoCommon/Src/CommandProcessor.cpp | 56 ++++++++++++------------ 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'Source/Core/VideoCommon/Src/CommandProcessor.cpp') diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.cpp b/Source/Core/VideoCommon/Src/CommandProcessor.cpp index dacec67823..1958b1c1d9 100644 --- a/Source/Core/VideoCommon/Src/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/Src/CommandProcessor.cpp @@ -185,7 +185,7 @@ void Read16(u16& _rReturnValue, const u32 _Address) _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); + DEBUG_LOG(COMMANDPROCESSOR, "Read FIFO_RW_DISTANCE_LO : %04x", _rReturnValue); return; case FIFO_RW_DISTANCE_HI: if (IsOnThread()) @@ -195,29 +195,29 @@ void Read16(u16& _rReturnValue, const u32 _Address) _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); + DEBUG_LOG(COMMANDPROCESSOR, "Read FIFO_RW_DISTANCE_HI : %04x", _rReturnValue); return; case FIFO_WRITE_POINTER_LO: _rReturnValue = ReadLow (fifo.CPWritePointer); - DEBUG_LOG(COMMANDPROCESSOR, "read FIFO_WRITE_POINTER_LO : %04x", _rReturnValue); + DEBUG_LOG(COMMANDPROCESSOR, "Read FIFO_WRITE_POINTER_LO : %04x", _rReturnValue); return; case FIFO_WRITE_POINTER_HI: _rReturnValue = ReadHigh(fifo.CPWritePointer); - DEBUG_LOG(COMMANDPROCESSOR, "read FIFO_WRITE_POINTER_HI : %04x", _rReturnValue); + DEBUG_LOG(COMMANDPROCESSOR, "Read FIFO_WRITE_POINTER_HI : %04x", _rReturnValue); return; case FIFO_READ_POINTER_LO: if (IsOnThread()) _rReturnValue = ReadLow (fifo.SafeCPReadPointer); else _rReturnValue = ReadLow (fifo.CPReadPointer); - DEBUG_LOG(COMMANDPROCESSOR, "read FIFO_READ_POINTER_LO : %04x", _rReturnValue); + DEBUG_LOG(COMMANDPROCESSOR, "Read FIFO_READ_POINTER_LO : %04x", _rReturnValue); return; case FIFO_READ_POINTER_HI: if (IsOnThread()) _rReturnValue = ReadHigh (fifo.SafeCPReadPointer); else _rReturnValue = ReadHigh (fifo.CPReadPointer); - DEBUG_LOG(COMMANDPROCESSOR, "read FIFO_READ_POINTER_HI : %04x", _rReturnValue); + DEBUG_LOG(COMMANDPROCESSOR, "Read FIFO_READ_POINTER_HI : %04x", _rReturnValue); return; case FIFO_BP_LO: _rReturnValue = ReadLow (fifo.CPBreakpoint); return; @@ -326,83 +326,83 @@ void Write16(const u16 _Value, const u32 _Address) { UCPClearReg tmpCtrl(_Value); m_CPClearReg.Hex = tmpCtrl.Hex; - DEBUG_LOG(COMMANDPROCESSOR,"\t write to CLEAR_REGISTER : %04x", _Value); + DEBUG_LOG(COMMANDPROCESSOR,"\t Write to CLEAR_REGISTER : %04x", _Value); SetCpClearRegister(); } break; case PERF_SELECT: // Seems to select which set of perf registers should be exposed. - DEBUG_LOG(COMMANDPROCESSOR, "write to PERF_SELECT: %04x", _Value); + DEBUG_LOG(COMMANDPROCESSOR, "Write to PERF_SELECT: %04x", _Value); break; // Fifo Registers case FIFO_TOKEN_REGISTER: m_tokenReg = _Value; - DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_TOKEN_REGISTER : %04x", _Value); + DEBUG_LOG(COMMANDPROCESSOR,"\t Write to FIFO_TOKEN_REGISTER : %04x", _Value); break; case FIFO_BASE_LO: WriteLow ((u32 &)fifo.CPBase, _Value & 0xFFE0); - DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_BASE_LO : %04x", _Value); + DEBUG_LOG(COMMANDPROCESSOR,"\t Write to FIFO_BASE_LO : %04x", _Value); break; case FIFO_BASE_HI: WriteHigh((u32 &)fifo.CPBase, _Value); - DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_BASE_HI : %04x", _Value); + DEBUG_LOG(COMMANDPROCESSOR,"\t Write to FIFO_BASE_HI : %04x", _Value); break; case FIFO_END_LO: WriteLow ((u32 &)fifo.CPEnd, _Value & 0xFFE0); - DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_END_LO : %04x", _Value); + DEBUG_LOG(COMMANDPROCESSOR,"\t Write to FIFO_END_LO : %04x", _Value); break; case FIFO_END_HI: WriteHigh((u32 &)fifo.CPEnd, _Value); - DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_END_HI : %04x", _Value); + DEBUG_LOG(COMMANDPROCESSOR,"\t Write to FIFO_END_HI : %04x", _Value); break; case FIFO_WRITE_POINTER_LO: WriteLow ((u32 &)fifo.CPWritePointer, _Value & 0xFFE0); - DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_WRITE_POINTER_LO : %04x", _Value); + DEBUG_LOG(COMMANDPROCESSOR,"\t Write to FIFO_WRITE_POINTER_LO : %04x", _Value); break; case FIFO_WRITE_POINTER_HI: WriteHigh((u32 &)fifo.CPWritePointer, _Value); - DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_WRITE_POINTER_HI : %04x", _Value); + DEBUG_LOG(COMMANDPROCESSOR,"\t Write to FIFO_WRITE_POINTER_HI : %04x", _Value); break; case FIFO_READ_POINTER_LO: WriteLow ((u32 &)fifo.CPReadPointer, _Value & 0xFFE0); - DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_READ_POINTER_LO : %04x", _Value); + DEBUG_LOG(COMMANDPROCESSOR,"\t Write to FIFO_READ_POINTER_LO : %04x", _Value); 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); + DEBUG_LOG(COMMANDPROCESSOR,"\t Write to FIFO_READ_POINTER_HI : %04x", _Value); break; case FIFO_HI_WATERMARK_LO: WriteLow ((u32 &)fifo.CPHiWatermark, _Value); - DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_HI_WATERMARK_LO : %04x", _Value); + DEBUG_LOG(COMMANDPROCESSOR,"\t Write to FIFO_HI_WATERMARK_LO : %04x", _Value); break; case FIFO_HI_WATERMARK_HI: WriteHigh((u32 &)fifo.CPHiWatermark, _Value); - DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_HI_WATERMARK_HI : %04x", _Value); + DEBUG_LOG(COMMANDPROCESSOR,"\t Write to FIFO_HI_WATERMARK_HI : %04x", _Value); break; case FIFO_LO_WATERMARK_LO: WriteLow ((u32 &)fifo.CPLoWatermark, _Value); - DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_LO_WATERMARK_LO : %04x", _Value); + DEBUG_LOG(COMMANDPROCESSOR,"\t Write to FIFO_LO_WATERMARK_LO : %04x", _Value); break; case FIFO_LO_WATERMARK_HI: WriteHigh((u32 &)fifo.CPLoWatermark, _Value); - DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_LO_WATERMARK_HI : %04x", _Value); + DEBUG_LOG(COMMANDPROCESSOR,"\t Write to FIFO_LO_WATERMARK_HI : %04x", _Value); break; case FIFO_BP_LO: WriteLow ((u32 &)fifo.CPBreakpoint, _Value & 0xFFE0); - DEBUG_LOG(COMMANDPROCESSOR,"write to FIFO_BP_LO : %04x", _Value); + DEBUG_LOG(COMMANDPROCESSOR,"Write to FIFO_BP_LO : %04x", _Value); break; case FIFO_BP_HI: WriteHigh((u32 &)fifo.CPBreakpoint, _Value); - DEBUG_LOG(COMMANDPROCESSOR,"write to FIFO_BP_HI : %04x", _Value); + DEBUG_LOG(COMMANDPROCESSOR,"Write to FIFO_BP_HI : %04x", _Value); break; case FIFO_RW_DISTANCE_HI: @@ -417,11 +417,11 @@ void Write16(const u16 _Value, const u32 _Address) ResetVideoBuffer(); } IncrementCheckContextId(); - DEBUG_LOG(COMMANDPROCESSOR,"try to write to FIFO_RW_DISTANCE_HI : %04x", _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); - DEBUG_LOG(COMMANDPROCESSOR,"try to write to FIFO_RW_DISTANCE_LO : %04x", _Value); + DEBUG_LOG(COMMANDPROCESSOR,"Try to write to FIFO_RW_DISTANCE_LO : %04x", _Value); break; default: @@ -453,7 +453,7 @@ void STACKALIGN GatherPipeBursted() RunGpu(); else { - // In multibuffer mode is not allowed write in the same fifo attached to the GPU. + // 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) @@ -469,7 +469,7 @@ void STACKALIGN GatherPipeBursted() if (IsOnThread()) SetCpStatus(true); - // update the fifo-pointer + // update the fifo pointer if (fifo.CPWritePointer >= fifo.CPEnd) fifo.CPWritePointer = fifo.CPBase; else @@ -481,7 +481,7 @@ void STACKALIGN GatherPipeBursted() RunGpu(); _assert_msg_(COMMANDPROCESSOR, fifo.CPReadWriteDistance <= fifo.CPEnd - fifo.CPBase, - "FIFO is overflown by GatherPipe !\nCPU thread is too fast!"); + "FIFO is overflowed by GatherPipe !\nCPU thread is too fast!"); // check if we are in sync _assert_msg_(COMMANDPROCESSOR, fifo.CPWritePointer == ProcessorInterface::Fifo_CPUWritePointer, "FIFOs linked but out of sync"); -- cgit v1.2.3 From 385d8e2b15c8accce3b4e4b4f3dc90f63e3fbee4 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Tue, 9 Apr 2013 18:57:39 -0500 Subject: ChunkFile has allowed me to accidentally "Do" a non-POD for the last time! --- Source/Core/VideoCommon/Src/CommandProcessor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Source/Core/VideoCommon/Src/CommandProcessor.cpp') diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.cpp b/Source/Core/VideoCommon/Src/CommandProcessor.cpp index 1958b1c1d9..733c99df69 100644 --- a/Source/Core/VideoCommon/Src/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/Src/CommandProcessor.cpp @@ -80,9 +80,9 @@ void UpdateInterrupts_Wrapper(u64 userdata, int cyclesLate) void DoState(PointerWrap &p) { - p.Do(m_CPStatusReg); - p.Do(m_CPCtrlReg); - p.Do(m_CPClearReg); + p.DoPOD(m_CPStatusReg); + p.DoPOD(m_CPCtrlReg); + p.DoPOD(m_CPClearReg); p.Do(m_bboxleft); p.Do(m_bboxtop); p.Do(m_bboxright); -- cgit v1.2.3 From bab9963b00953d60bdd6fabe265d5daa45a27661 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 17 Apr 2013 23:09:55 -0400 Subject: New license header introduced for DiscIO, AudioCommon, InputCommon, VideoCommon, and Common projects. --- Source/Core/VideoCommon/Src/CommandProcessor.cpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'Source/Core/VideoCommon/Src/CommandProcessor.cpp') diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.cpp b/Source/Core/VideoCommon/Src/CommandProcessor.cpp index 733c99df69..24ac10c5bb 100644 --- a/Source/Core/VideoCommon/Src/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/Src/CommandProcessor.cpp @@ -1,19 +1,6 @@ -// Copyright (C) 2003 Dolphin Project. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, version 2.0. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official SVN repository and contact information can be found at -// http://code.google.com/p/dolphin-emu/ +// Copyright 2013 Dolphin Emulator Project +// Licensed under GPLv2 +// Refer to the license.txt file included. #include "Common.h" #include "VideoCommon.h" -- cgit v1.2.3 From 8da425b008b46ef90d649e55c6c0d4a0bc2b556b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 24 Apr 2013 09:21:54 -0400 Subject: Formatting cleanup for VideoCommon. Block braces on new lines. Also killed off trailing whitespace and dangling elses. Spaced some things out to make them more readable (only in places where it looked like a bit of a clusterfuck). --- Source/Core/VideoCommon/Src/CommandProcessor.cpp | 30 +++++++++++++++++------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'Source/Core/VideoCommon/Src/CommandProcessor.cpp') diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.cpp b/Source/Core/VideoCommon/Src/CommandProcessor.cpp index 24ac10c5bb..5c3848de4f 100644 --- a/Source/Core/VideoCommon/Src/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/Src/CommandProcessor.cpp @@ -115,13 +115,13 @@ void Init() fifo.CPCmdIdle = 1; fifo.CPReadIdle = 1; fifo.bFF_Breakpoint = 0; - fifo.bFF_HiWatermark = 0; + fifo.bFF_HiWatermark = 0; fifo.bFF_HiWatermarkInt = 0; - fifo.bFF_LoWatermark = 0; + fifo.bFF_LoWatermark = 0; fifo.bFF_LoWatermarkInt = 0; interruptSet = false; - interruptWaiting = false; + interruptWaiting = false; interruptFinishWaiting = false; interruptTokenWaiting = false; @@ -131,7 +131,7 @@ void Init() isHiWatermarkActive = false; isLoWatermarkActive = false; - et_UpdateInterrupts = CoreTiming::RegisterEvent("CPInterrupt", UpdateInterrupts_Wrapper); + et_UpdateInterrupts = CoreTiming::RegisterEvent("CPInterrupt", UpdateInterrupts_Wrapper); } void Read16(u16& _rReturnValue, const u32 _Address) @@ -139,7 +139,7 @@ void Read16(u16& _rReturnValue, const u32 _Address) INFO_LOG(COMMANDPROCESSOR, "(r): 0x%08x", _Address); switch (_Address & 0xFFF) { - case STATUS_REGISTER: + case STATUS_REGISTER: SetCpStatusRegister(); _rReturnValue = m_CPStatusReg.Hex; return; @@ -166,22 +166,30 @@ void Read16(u16& _rReturnValue, const u32 _Address) case FIFO_RW_DISTANCE_LO: if (IsOnThread()) + { if(fifo.CPWritePointer >= fifo.SafeCPReadPointer) _rReturnValue = ReadLow (fifo.CPWritePointer - fifo.SafeCPReadPointer); else _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); return; case FIFO_RW_DISTANCE_HI: if (IsOnThread()) + { if(fifo.CPWritePointer >= fifo.SafeCPReadPointer) _rReturnValue = ReadHigh (fifo.CPWritePointer - fifo.SafeCPReadPointer); else _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); return; case FIFO_WRITE_POINTER_LO: @@ -437,7 +445,9 @@ void STACKALIGN GatherPipeBursted() if (!m_CPCtrlReg.GPLinkEnable) { if (!IsOnThread()) + { RunGpu(); + } else { // In multibuffer mode is not allowed write in the same FIFO attached to the GPU. @@ -467,7 +477,7 @@ void STACKALIGN GatherPipeBursted() if (!IsOnThread()) RunGpu(); - _assert_msg_(COMMANDPROCESSOR, fifo.CPReadWriteDistance <= fifo.CPEnd - fifo.CPBase, + _assert_msg_(COMMANDPROCESSOR, fifo.CPReadWriteDistance <= fifo.CPEnd - fifo.CPBase, "FIFO is overflowed by GatherPipe !\nCPU thread is too fast!"); // check if we are in sync @@ -482,13 +492,13 @@ void UpdateInterrupts(u64 userdata) { interruptSet = true; INFO_LOG(COMMANDPROCESSOR,"Interrupt set"); - ProcessorInterface::SetInterrupt(INT_CAUSE_CP, true); + ProcessorInterface::SetInterrupt(INT_CAUSE_CP, true); } else { interruptSet = false; INFO_LOG(COMMANDPROCESSOR,"Interrupt cleared"); - ProcessorInterface::SetInterrupt(INT_CAUSE_CP, false); + ProcessorInterface::SetInterrupt(INT_CAUSE_CP, false); } interruptWaiting = false; } @@ -510,7 +520,7 @@ void SetCpStatus(bool isCPUThread) fifo.bFF_HiWatermark = (fifo.CPReadWriteDistance > fifo.CPHiWatermark); fifo.bFF_LoWatermark = (fifo.CPReadWriteDistance < fifo.CPLoWatermark); - // breakpoint + // breakpoint if (!isCPUThread) { if (fifo.bFF_BPEnable) @@ -571,7 +581,9 @@ void SetCpStatus(bool isCPUThread) } } else + { CommandProcessor::UpdateInterrupts(userdata); + } } } -- cgit v1.2.3