From bb6a9b35495cd3710f48c4c14f35033f5e8fed8f Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Wed, 18 Feb 2015 12:09:39 +0600 Subject: [PATCH] Correct frame buffer end address calculation in FrameBufferList::saveBuffer. Fixed gfx not showing with fb emulation on in Top Gear Hyper Bike #45 --- FrameBuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FrameBuffer.cpp b/FrameBuffer.cpp index 713e8cdb..19cec3a0 100644 --- a/FrameBuffer.cpp +++ b/FrameBuffer.cpp @@ -300,7 +300,7 @@ void FrameBufferList::saveBuffer(u32 _address, u16 _format, u16 _size, u16 _widt gDPFillRDRAM(m_pCurrent->m_startAddress, 0, 0, m_pCurrent->m_width, gDP.colorImage.height, m_pCurrent->m_width, m_pCurrent->m_size, m_pCurrent->m_fillcolor); } - const u32 endAddress = _address + ((_width * _height << _size >> 1) - 1); + const u32 endAddress = _address + ((_width * (_height - 1)) << _size >> 1) - 1; if (m_pCurrent == NULL || m_pCurrent->m_startAddress != _address || m_pCurrent->m_width != _width) m_pCurrent = _findBuffer(_address, endAddress, _width); if (m_pCurrent != NULL) {