From f637e91f22ac0aa29a9047100c6a39153d6ba3a2 Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Fri, 3 Oct 2014 16:51:12 +0700 Subject: [PATCH] Replace _SHIFTR( *REG.VI_H_START, 0, 10 ) == 0 check by VI.width == 0 one Fixed glError in Knockout Kings 2000. The game sets h_start==h_end at start, thus VI.width is zero but *REG.VI_H_START is not. --- FrameBuffer.cpp | 10 +++++----- VI.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/FrameBuffer.cpp b/FrameBuffer.cpp index 1d7eb4f1..bb3cfd2c 100644 --- a/FrameBuffer.cpp +++ b/FrameBuffer.cpp @@ -172,7 +172,7 @@ FrameBuffer * FrameBufferList::findTmpBuffer(u32 _address) void FrameBufferList::saveBuffer(u32 _address, u16 _format, u16 _size, u16 _width, u16 _height, bool _cfb) { - if (_SHIFTR(*REG.VI_H_START, 0, 10) == 0) // H width is zero. Don't save + if (VI.width == 0) // H width is zero. Don't save return; OGLVideo & ogl = video(); m_drawBuffer = GL_FRAMEBUFFER; @@ -332,7 +332,7 @@ void FrameBufferList::renderBuffer(u32 _address) { static u32 vStartPrev = 0; - if (_SHIFTR( *REG.VI_H_START, 0, 10 ) == 0) // H width is zero. Don't draw + if (VI.width == 0) // H width is zero. Don't draw return; FrameBuffer *pBuffer = findBuffer(_address); @@ -407,7 +407,7 @@ void FrameBufferList::renderBuffer(u32 _address) void FrameBufferList::renderBuffer(u32 _address) { - if (_SHIFTR( *REG.VI_H_START, 0, 10 ) == 0) // H width is zero. Don't draw + if (VI.width == 0) // H width is zero. Don't draw return; FrameBuffer *pBuffer = findBuffer(_address); if (pBuffer == NULL) @@ -556,7 +556,7 @@ void FrameBufferToRDRAM::Destroy() { } void FrameBufferToRDRAM::CopyToRDRAM( u32 address, bool bSync ) { - if (_SHIFTR(*REG.VI_H_START, 0, 10) == 0) // H width is zero. Don't copy + if (VI.width == 0) // H width is zero. Don't copy return; FrameBuffer *pBuffer = frameBufferList().findBuffer(address); if (pBuffer == NULL) @@ -696,7 +696,7 @@ void DepthBufferToRDRAM::Destroy() { } void DepthBufferToRDRAM::CopyToRDRAM( u32 address) { - if (_SHIFTR(*REG.VI_H_START, 0, 10) == 0) // H width is zero. Don't copy + if (VI.width == 0) // H width is zero. Don't copy return; FrameBuffer *pBuffer = frameBufferList().findBuffer(address); if (pBuffer == NULL || pBuffer->m_pDepthBuffer == NULL) diff --git a/VI.cpp b/VI.cpp index 78f77a2f..7c48f134 100644 --- a/VI.cpp +++ b/VI.cpp @@ -93,7 +93,7 @@ void VI_UpdateScreen() VI_UpdateSize(); ogl.updateScale(); const u32 size = *REG.VI_STATUS & 3; - if (VI.height > 0 && size > G_IM_SIZ_8b && _SHIFTR( *REG.VI_H_START, 0, 10 ) > 0) + if (VI.height > 0 && size > G_IM_SIZ_8b && VI.width > 0) frameBufferList().saveBuffer(*REG.VI_ORIGIN, G_IM_FMT_RGBA, size, VI.width, VI.height, true); } }