diff options
| author | Ryan Houdek <Sonicadvance1@gmail.com> | 2013-04-14 20:43:42 -0500 |
|---|---|---|
| committer | Ryan Houdek <Sonicadvance1@gmail.com> | 2013-04-14 20:43:42 -0500 |
| commit | 37b67971e7def8dcd0dae3209afc6c69b52d0609 (patch) | |
| tree | 510eccb41b0653225ec3af6bf02b425c72a195e1 /Source/Plugins/Plugin_VideoSoftware/Src/XFMemLoader.cpp | |
| parent | bde7ea00ef9fd625a4e453ee9598fc20382a35a5 (diff) | |
| parent | b91930a2d4742ec001d0b1df1abe938da7527d03 (diff) | |
Merge remote-tracking branch 'origin/master' into Android-trash
Conflicts:
Source/Plugins/Plugin_VideoSoftware/Src/SWRenderer.cpp
Diffstat (limited to 'Source/Plugins/Plugin_VideoSoftware/Src/XFMemLoader.cpp')
| -rw-r--r-- | Source/Plugins/Plugin_VideoSoftware/Src/XFMemLoader.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/XFMemLoader.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/XFMemLoader.cpp index 081967a484..7bbfa5f0fe 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/XFMemLoader.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/XFMemLoader.cpp @@ -12,7 +12,7 @@ // 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 +// Official Git repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ #include "VideoCommon.h" @@ -26,15 +26,15 @@ XFRegisters swxfregs; void InitXFMemory() { - memset(&swxfregs, 0, sizeof(swxfregs)); + memset(&swxfregs, 0, sizeof(swxfregs)); } void XFWritten(u32 transferSize, u32 baseAddress) { - u32 topAddress = baseAddress + transferSize; + u32 topAddress = baseAddress + transferSize; - if (baseAddress <= 0x1026 && topAddress >= 0x1020) - Clipper::SetViewOffset(); + if (baseAddress <= 0x1026 && topAddress >= 0x1020) + Clipper::SetViewOffset(); // fix lights so invalid values don't trash the lighting computations if (baseAddress <= 0x067f && topAddress >= 0x0604) @@ -63,32 +63,32 @@ void XFWritten(u32 transferSize, u32 baseAddress) void SWLoadXFReg(u32 transferSize, u32 baseAddress, u32 *pData) { - u32 size = transferSize; + u32 size = transferSize; - // do not allow writes past registers - if (baseAddress + transferSize > 0x1058) - { - INFO_LOG(VIDEO, "xf load exceeds address space: %x %d bytes\n", baseAddress, transferSize); - - if (baseAddress >= 0x1058) - size = 0; - else - size = 0x1058 - baseAddress; - } + // do not allow writes past registers + if (baseAddress + transferSize > 0x1058) + { + INFO_LOG(VIDEO, "xf load exceeds address space: %x %d bytes\n", baseAddress, transferSize); - if (size > 0) { - memcpy_gc( &((u32*)&swxfregs)[baseAddress], pData, size * 4); - XFWritten(transferSize, baseAddress); - } + if (baseAddress >= 0x1058) + size = 0; + else + size = 0x1058 - baseAddress; + } + if (size > 0) + { + memcpy_gc( &((u32*)&swxfregs)[baseAddress], pData, size * 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 + 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(arraybases[array] + arraystrides[array]*index); |
