diff options
| author | degasus <wickmarkus@web.de> | 2015-10-09 20:50:36 +0200 |
|---|---|---|
| committer | degasus <wickmarkus@web.de> | 2016-01-06 22:10:29 +0100 |
| commit | efbe5bc4b651d1f7f726bb064255e0e2562f7490 (patch) | |
| tree | 6166a471269a9b1eb2bf703a31c915489e428b44 /Source/Core/VideoBackends/Software/XFMemLoader.cpp | |
| parent | 7fcb5a803b2e6179fe57654496fcea7f6b2ff183 (diff) | |
VideoSW: Use more VideoCommon
Now we require lots of empty functions, but this removes by far more duplicated code.
Diffstat (limited to 'Source/Core/VideoBackends/Software/XFMemLoader.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Software/XFMemLoader.cpp | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/Source/Core/VideoBackends/Software/XFMemLoader.cpp b/Source/Core/VideoBackends/Software/XFMemLoader.cpp deleted file mode 100644 index 3aa86aea8e..0000000000 --- a/Source/Core/VideoBackends/Software/XFMemLoader.cpp +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2009 Dolphin Emulator Project -// Licensed under GPLv2+ -// Refer to the license.txt file included. - -#include "Common/Common.h" -#include "Common/CommonFuncs.h" -#include "Core/HW/Memmap.h" -#include "VideoBackends/Software/Clipper.h" -#include "VideoBackends/Software/CPMemLoader.h" -#include "VideoBackends/Software/XFMemLoader.h" -#include "VideoCommon/VideoCommon.h" - -void InitXFMemory() -{ - memset(&xfmem, 0, sizeof(xfmem)); -} - -void XFWritten(u32 transferSize, u32 baseAddress) -{ - u32 topAddress = baseAddress + transferSize; - - if (baseAddress <= 0x1026 && topAddress >= 0x1020) - Clipper::SetViewOffset(); - - // fix lights so invalid values don't trash the lighting computations - if (baseAddress <= 0x067f && topAddress >= 0x0604) - { - u32* x = (u32*)xfmem.lights; - - // go through all lights - for (int light = 0; light < 8; light++) - { - // skip to floating point values - x += 4; - - for (int i = 0; i < 12; i++) - { - u32 xVal = *x; - - // if the exponent is 255 then the number is inf or nan - if ((xVal & 0x7f800000) == 0x7f800000) - *x = 0; - - x++; - } - } - } -} - -void SWLoadXFReg(u32 transferSize, u32 baseAddress, u32 *pData) -{ - // do not allow writes past registers - if (baseAddress + transferSize > 0x1058) - { - INFO_LOG(VIDEO, "XF load exceeds address space: %x %d bytes", baseAddress, transferSize); - - if (baseAddress >= 0x1058) - transferSize = 0; - else - transferSize = 0x1058 - baseAddress; - } - - // write to XF regs - if (transferSize > 0) - { - memcpy((u32*)(&xfmem) + baseAddress, pData, transferSize * 4); - XFWritten(transferSize, baseAddress); - } -} - -void SWLoadIndexedXF(u32 val, int array) -{ - int index = val >> 16; - int address = val & 0xFFF; //check mask - int size = ((val >> 12) & 0xF) + 1; - //load stuff from array to address in xf mem - - u32 *pData = (u32*)Memory::GetPointer(g_main_cp_state.array_bases[array] + g_main_cp_state.array_strides[array]*index); - - // byteswap data - u32 buffer[16]; - for (int i = 0; i < size; ++i) - buffer[i] = Common::swap32(*(pData + i)); - - SWLoadXFReg(size, address, buffer); -} |
