From 9399c2223cdaf3c5dd22ddddac865b9a4e479789 Mon Sep 17 00:00:00 2001 From: hrydgard Date: Wed, 29 Oct 2008 21:05:07 +0000 Subject: [PATCH] fix bad palettes in wii games git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1006 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Plugins/Plugin_VideoOGL/Src/BPStructs.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.cpp b/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.cpp index f7252c3f78..0a8ada081a 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.cpp @@ -89,7 +89,7 @@ void BPWritten(int addr, int changes, int newval) bpmem.genMode.numindstages, bpmem.genMode.zfreeze); // none, ccw, cw, ccw - if (bpmem.genMode.cullmode>0 && !g_Config.bDisableCulling) { + if (bpmem.genMode.cullmode > 0) { glEnable(GL_CULL_FACE); glFrontFace(bpmem.genMode.cullmode == 2 ? GL_CCW : GL_CW); } @@ -539,8 +539,10 @@ void BPWritten(int addr, int changes, int newval) u32 tlutTMemAddr = (newval&0x3FF)<<9; u32 tlutXferCount = (newval&0x1FFC00)>>5; - //do the transfer!! - memcpy_gc(texMem + tlutTMemAddr, g_VideoInitialize.pGetMemoryPointer((bpmem.tlutXferSrc&0xFFFFF)<<5), tlutXferCount); + //do the transfer!! + u8 *ptr = g_VideoInitialize.pGetMemoryPointer((bpmem.tlutXferSrc)<<5); + if (ptr) + memcpy_gc(texMem + tlutTMemAddr, ptr, tlutXferCount); // TODO(ector) : kill all textures that use this palette // Not sure if it's a good idea, though. For now, we hash texture palettes }