diff options
| author | NeoBrainX <NeoBrainX@gmail.com> | 2013-04-25 14:01:07 +0200 |
|---|---|---|
| committer | NeoBrainX <NeoBrainX@gmail.com> | 2013-04-25 14:05:54 +0200 |
| commit | 5e6b712651dc042b06ce59bcfb4becda5ee15022 (patch) | |
| tree | c82731464d76517cce5ffb6d7e9764c47a433804 /Source/Core/VideoCommon/Src/BPStructs.cpp | |
| parent | eef95fa4c5919bf93335e10dd61cd5a9fd6a5f6d (diff) | |
| parent | d18b71ccf91c9578236b44ae26e8bc35314cc180 (diff) | |
Merge 'master' into shader-uids-awesome.
Conflicts:
Source/Core/VideoCommon/Src/BPMemory.h
Source/Core/VideoCommon/Src/LightingShaderGen.cpp
Source/Core/VideoCommon/Src/PixelShaderGen.cpp
Source/Core/VideoCommon/Src/PixelShaderGen.h
Source/Core/VideoCommon/Src/PixelShaderManager.cpp
Source/Core/VideoCommon/Src/VertexShaderGen.cpp
Source/Core/VideoCommon/Src/VertexShaderGen.h
Diffstat (limited to 'Source/Core/VideoCommon/Src/BPStructs.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Src/BPStructs.cpp | 75 |
1 files changed, 36 insertions, 39 deletions
diff --git a/Source/Core/VideoCommon/Src/BPStructs.cpp b/Source/Core/VideoCommon/Src/BPStructs.cpp index 9580eea447..314041f894 100644 --- a/Source/Core/VideoCommon/Src/BPStructs.cpp +++ b/Source/Core/VideoCommon/Src/BPStructs.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 <cmath> @@ -115,7 +102,9 @@ void BPWritten(const BPCmd& bp) if (!mapTexFound) { if (bp.address != BPMEM_TEV_COLOR_ENV && bp.address != BPMEM_TEV_ALPHA_ENV) + { numWrites = 0; + } else if (++numWrites >= 100) // seem that if 100 consecutive BP writes are called to either of these addresses in ZTP, { // then it is safe to assume the map texture address is currently loaded into the BP memory mapTexAddress = bpmem.tex[0].texImage3[0].hex << 5; @@ -206,15 +195,19 @@ void BPWritten(const BPCmd& bp) PRIM_LOG("blendmode: en=%d, open=%d, colupd=%d, alphaupd=%d, dst=%d, src=%d, sub=%d, mode=%d", bpmem.blendmode.blendenable, bpmem.blendmode.logicopenable, bpmem.blendmode.colorupdate, bpmem.blendmode.alphaupdate, bpmem.blendmode.dstfactor, bpmem.blendmode.srcfactor, bpmem.blendmode.subtract, bpmem.blendmode.logicmode); + // Set LogicOp Blending Mode if (bp.changes & 2) SetLogicOpMode(); + // Set Dithering Mode if (bp.changes & 4) SetDitherMode(); + // Set Blending Mode if (bp.changes & 0xFF1) SetBlendMode(); + // Set Color Mask if (bp.changes & 0x18) SetColorMask(); @@ -426,32 +419,35 @@ void BPWritten(const BPCmd& bp) case BPMEM_CLEARBBOX1: case BPMEM_CLEARBBOX2: { - if(g_ActiveConfig.bUseBBox) - { - // Don't compute bounding box if this frame is being skipped! - // Wrong but valid values are better than bogus values... - if(g_bSkipCurrentFrame) - break; + if(g_ActiveConfig.bUseBBox) + { + // Don't compute bounding box if this frame is being skipped! + // Wrong but valid values are better than bogus values... + if(g_bSkipCurrentFrame) + break; - if (bp.address == BPMEM_CLEARBBOX1) { - int right = bp.newvalue >> 10; - int left = bp.newvalue & 0x3ff; + if (bp.address == BPMEM_CLEARBBOX1) + { + int right = bp.newvalue >> 10; + int left = bp.newvalue & 0x3ff; - // We should only set these if bbox is calculated properly. - PixelEngine::bbox[0] = left; - PixelEngine::bbox[1] = right; - PixelEngine::bbox_active = true; - } else { - int bottom = bp.newvalue >> 10; - int top = bp.newvalue & 0x3ff; - - // We should only set these if bbox is calculated properly. - PixelEngine::bbox[2] = top; - PixelEngine::bbox[3] = bottom; - PixelEngine::bbox_active = true; + // We should only set these if bbox is calculated properly. + PixelEngine::bbox[0] = left; + PixelEngine::bbox[1] = right; + PixelEngine::bbox_active = true; + } + else + { + int bottom = bp.newvalue >> 10; + int top = bp.newvalue & 0x3ff; + + // We should only set these if bbox is calculated properly. + PixelEngine::bbox[2] = top; + PixelEngine::bbox[3] = bottom; + PixelEngine::bbox_active = true; + } } } - } break; case BPMEM_TEXINVALIDATE: // TODO: Needs some restructuring in TextureCacheBase. @@ -459,7 +455,8 @@ void BPWritten(const BPCmd& bp) case BPMEM_ZCOMPARE: // Set the Z-Compare and EFB pixel format OnPixelFormatChange(); - if(bp.changes & 7) { + if(bp.changes & 7) + { SetBlendMode(); // dual source could be activated by changing to PIXELFMT_RGBA6_Z24 g_renderer->SetColorMask(); // alpha writing needs to be disabled if the new pixel format doesn't have an alpha channel } |
