diff options
| author | Scott Mansell <phiren@gmail.com> | 2014-10-29 02:20:49 +1300 |
|---|---|---|
| committer | Scott Mansell <phiren@gmail.com> | 2014-10-29 08:53:53 +1300 |
| commit | ba58cc47a3d5658f1c953df9e3072fbc11022f3a (patch) | |
| tree | f9c8ee7637206efe291546b546230397caa7a7e9 /Source/Core/VideoCommon/BPStructs.cpp | |
| parent | d77f361c01e0ad36218d5f4265e1219b6c1fb983 (diff) | |
Remove old (and now incorrect) error checking code.
We will now rely on Memory::CopyFromEmu to do bounds checking.
Some games actually load palettes from 0x00000000, despite the
fact no valid palette data should ever be there.
Fixes Issue 7792.
Diffstat (limited to 'Source/Core/VideoCommon/BPStructs.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/BPStructs.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/Source/Core/VideoCommon/BPStructs.cpp b/Source/Core/VideoCommon/BPStructs.cpp index cd3302beb3..79c24778bd 100644 --- a/Source/Core/VideoCommon/BPStructs.cpp +++ b/Source/Core/VideoCommon/BPStructs.cpp @@ -269,19 +269,13 @@ static void BPWritten(const BPCmd& bp) { u32 tlutTMemAddr = (bp.newvalue & 0x3FF) << 9; u32 tlutXferCount = (bp.newvalue & 0x1FFC00) >> 5; + u32 addr = bpmem.tmem_config.tlut_src << 5; - u32 addr = 0; + // The GameCube ignores the upper bits of this address. Some games (WW, MKDD) set them. + if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bWii) + addr = addr & 0x01FFFFFF; - // TODO - figure out a cleaner way. - if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii) - addr = bpmem.tmem_config.tlut_src << 5; - else - addr = (bpmem.tmem_config.tlut_src & 0xFFFFF) << 5; - - if (addr) - Memory::CopyFromEmu(texMem + tlutTMemAddr, addr, tlutXferCount); - else - PanicAlert("Invalid palette pointer %08x %08x %08x", bpmem.tmem_config.tlut_src, bpmem.tmem_config.tlut_src << 5, (bpmem.tmem_config.tlut_src & 0xFFFFF)<< 5); + Memory::CopyFromEmu(texMem + tlutTMemAddr, addr, tlutXferCount); return; } |
