summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/BPStructs.cpp
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2012-03-23 22:10:48 +1100
committerskidau <skidau@gmail.com>2012-03-23 22:10:48 +1100
commitc4fbb6e3771960b1bb1f28571612e4c60d0c9817 (patch)
tree2f125c2f4f5c85c9dad9ce1dfc74245003eefe96 /Source/Core/VideoCommon/Src/BPStructs.cpp
parentfab037446cb28610ce5084ecd04bac3d125105a9 (diff)
Checked PRELOAD_MODE to determine if TMEMODD or TMEMEVEN should be used.
Fixes issue 5212.
Diffstat (limited to 'Source/Core/VideoCommon/Src/BPStructs.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/BPStructs.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/Src/BPStructs.cpp b/Source/Core/VideoCommon/Src/BPStructs.cpp
index 6cb102555b..01b09e351b 100644
--- a/Source/Core/VideoCommon/Src/BPStructs.cpp
+++ b/Source/Core/VideoCommon/Src/BPStructs.cpp
@@ -476,10 +476,15 @@ void BPWritten(const BPCmd& bp)
// if this is different from 0, manual TMEM management is used.
if (bp.newvalue != 0)
{
- // NOTE(neobrain): Apparently tmemodd doesn't affect hardware behavior at all (libogc uses it just as a buffer and switches its contents with tmemeven whenever this is called)
BPS_TmemConfig& tmem_cfg = bpmem.tmem_config;
u8* ram_ptr = Memory::GetPointer(tmem_cfg.preload_addr << 5);
- u32 tmem_addr = tmem_cfg.preload_tmem_even * TMEM_LINE_SIZE;
+ u32 tmem_addr = 0;
+
+ if (bp.newvalue >> 16)
+ tmem_addr = tmem_cfg.preload_tmem_odd * TMEM_LINE_SIZE;
+ else
+ tmem_addr = tmem_cfg.preload_tmem_even * TMEM_LINE_SIZE;
+
u32 size = tmem_cfg.preload_tile_info.count * 32;
memcpy(texMem + tmem_addr, ram_ptr, size);
}