Skip to content

Commit

Permalink
gsdx-tc: add an explanation of the magic number 0x140
Browse files Browse the repository at this point in the history
  • Loading branch information
gregory38 committed May 29, 2015
1 parent 97b2377 commit 0cb6c37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion plugins/GSdx/GSRendererHW.cpp
Expand Up @@ -64,7 +64,6 @@ void GSRendererHW::SetScaling(){
{
m_width = (m_buffer_size * 64) * m_upscale_multiplier;
m_height = m_width; //Keep it square

}
}
else
Expand Down
6 changes: 6 additions & 0 deletions plugins/GSdx/GSTextureCache.cpp
Expand Up @@ -136,6 +136,9 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const GIFRegTEX0& TEX0, con

} else if ((t->m_TEX0.TBW == 20) && (t->m_TEX0.PSM == 2) && GSUtil::HasSharedBits(bp, psm, t->m_TEX0.TBP0 + 0x140, t->m_TEX0.PSM)) {
// try to detect render target bigger than 1024 Texels
// 0x140: In 16 bits format, pages are 64 pixels and 8KB
// Half of 1280 is 640 so 10 pages
// TBP0 unit is block of 256B => (10 pages * 8 KB) / (1 block * 256B) = 320 = 0x140

half_right = true;
dst = t;
Expand Down Expand Up @@ -363,6 +366,9 @@ void GSTextureCache::InvalidateVideoMem(GSOffset* off, const GSVector4i& rect, b

if ((bw == 20) && (psm == 2)) {
// try to detect render target bigger than 1024 Texels
// 0x140: In 16 bits format, pages are 64 pixels and 8KB
// Half of 1280 is 640 so 10 pages
// TBP0 unit is block of 256B => (10 pages * 8 KB) / (1 block * 256B) = 320 = 0x140
uint32 bbp = bp + 0x140;

const list<Source*>& m = m_src.m_map[bbp >> 5];
Expand Down

0 comments on commit 0cb6c37

Please sign in to comment.