1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-04 10:03:36 +00:00

Emulate crazy way of shifting image horizontally, which bottom of the 9th uses.

Fixed bottom of the 9th: screen not centered #862
This commit is contained in:
Sergey Lipskiy 2016-08-28 18:22:44 +07:00
parent 1bdce5c579
commit d80bd636e2

View File

@ -791,6 +791,7 @@ void FrameBufferList::renderBuffer(u32 _address)
OGLRender & render = ogl.getRender();
GLint srcY0, srcY1, dstY0, dstY1;
GLint X0, X1, Xwidth;
GLint Xoffset = 0;
GLint srcPartHeight = 0;
GLint dstPartHeight = 0;
@ -817,7 +818,10 @@ void FrameBufferList::renderBuffer(u32 _address)
isLowerField = vStart > vStartPrev;
vStartPrev = vStart;
srcY0 = ((_address - pBuffer->m_startAddress) << 1 >> pBuffer->m_size) / (*REG.VI_WIDTH);
const u32 addrOffset = ((_address - pBuffer->m_startAddress) << 1 >> pBuffer->m_size);
srcY0 = addrOffset / (*REG.VI_WIDTH);
if (addrOffset % (*REG.VI_WIDTH) != 0)
Xoffset = (*REG.VI_WIDTH) - addrOffset % (*REG.VI_WIDTH);
if (isLowerField) {
if (srcY0 > 0)
--srcY0;
@ -846,8 +850,8 @@ void FrameBufferList::renderBuffer(u32 _address)
const s32 h0 = (isPAL ? 128 : 108);
const s32 hx0 = max(0, hStart - h0);
const s32 hx1 = max(0, h0 + 640 - hEnd);
X0 = (GLint)(hx0 * viScaleX * dstScaleX);
Xwidth = (GLint)((min((f32)VI.width, (hEnd - hStart)*viScaleX)) * srcScaleX);
X0 = (GLint)((hx0 * viScaleX + Xoffset) * dstScaleX);
Xwidth = (GLint)((min((f32)VI.width, (hEnd - hStart)*viScaleX - Xoffset)) * srcScaleX);
X1 = ogl.getWidth() - (GLint)(hx1 *viScaleX * dstScaleX);
const f32 srcScaleY = pFilteredBuffer->m_scaleY;