update gliden64

This commit is contained in:
Logan McNaughton committed 2020-10-29 07:30:32 -07:00
1 parent da3c040922
commit 14b2b88cec
8 files changed
+35 -10

No files matched your search

+1
View File
@@ -19,5 +19,6 @@ src/Revision.h
/projects/cmake/Makefile
/projects/cmake/cmake_install.cmake
/projects/cmake/osal/
/projects/cmake/mupen64plus-video-GLideN64_autogen/
.vs
/translations/wtl
+2 -2
View File
@@ -1077,7 +1077,7 @@ bool FrameBufferList::RdpUpdate::update(RdpUpdateResult & _result)
const s32 delta_y = y2 - y1;
const u32 vitype = _SHIFTR( *REG.VI_STATUS, 0, 2 );
const bool serration_pulses = (*REG.VI_STATUS & 0x40) != 0;
const bool serration_pulses = (*REG.VI_STATUS & VI_STATUS_SERRATE_ENABLED) != 0;
const bool validinterlace = ((vitype & 2) != 0 ) && serration_pulses;
if (validinterlace && prevserrate && emucontrolsvicurrent < 0)
emucontrolsvicurrent = (*REG.VI_V_CURRENT_LINE & 1) != prevvicurrent ? 1 : 0;
@@ -1167,7 +1167,7 @@ bool FrameBufferList::RdpUpdate::update(RdpUpdateResult & _result)
_result.vi_lowerfield = lowerfield;
_result.vi_origin = _SHIFTR(*REG.VI_ORIGIN, 0, 24);
_result.vi_fsaa = (*REG.VI_STATUS & 512) == 0;
_result.vi_divot = (*REG.VI_STATUS & 16) != 0;
_result.vi_divot = (*REG.VI_STATUS & VI_STATUS_DIVOT_ENABLED) != 0;
return true;
#if 0
@@ -36,9 +36,9 @@ void ColorBufferReaderWithEGLImage::_initBuffers()
m_image = eglCreateImageKHR(eglGetDisplay(EGL_DEFAULT_DISPLAY), EGL_NO_CONTEXT,
EGL_NATIVE_BUFFER_ANDROID, m_hardwareBuffer.getClientBuffer(), eglImgAttrs);
m_bindTexture->bind(graphics::Parameter(0), graphics::Parameter(GL_TEXTURE_EXTERNAL_OES), m_pTexture->name);
glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, m_image);
m_bindTexture->bind(graphics::Parameter(0), graphics::Parameter(GL_TEXTURE_EXTERNAL_OES), ObjectHandle());
m_bindTexture->bind(graphics::Parameter(0), textureTarget::TEXTURE_EXTERNAL, m_pTexture->name);
glEGLImageTargetTexture2DOES(GLenum(textureTarget::TEXTURE_EXTERNAL), m_image);
m_bindTexture->bind(graphics::Parameter(0), textureTarget::TEXTURE_EXTERNAL, ObjectHandle());
}
}
@@ -3,6 +3,8 @@
#include "opengl_Utils.h"
#include "opengl_GLInfo.h"
#include <regex>
#include <Graphics/Parameters.h>
#ifdef EGL
#include <EGL/egl.h>
#endif
@@ -170,6 +172,10 @@ void GLInfo::init() {
(renderer != Renderer::PowerVR);
#endif
if (renderer == Renderer::Intel) {
graphics::textureTarget::TEXTURE_EXTERNAL = GL_TEXTURE_2D;
}
eglImageFramebuffer = eglImage && !isGLES2;
if (config.frameBufferEmulation.N64DepthCompare != Config::dcDisable) {
+2 -1
View File
@@ -5,6 +5,7 @@
#include "PostProcessor.h"
#include "FrameBuffer.h"
#include "Config.h"
#include "VI.h"
#include <Graphics/Context.h>
#include <Graphics/Parameters.h>
@@ -156,7 +157,7 @@ FrameBuffer * PostProcessor::_doGammaCorrection(FrameBuffer * _pBuffer)
if (_pBuffer == nullptr)
return nullptr;
if (((*REG.VI_STATUS & 8) | config.gammaCorrection.force) == 0)
if (((*REG.VI_STATUS & VI_STATUS_GAMMA_ENABLED) | config.gammaCorrection.force) == 0)
return _pBuffer;
return _doPostProcessing(_pBuffer, m_gammaCorrectionProgram.get());
+3 -3
View File
@@ -49,7 +49,7 @@ void VI_UpdateSize()
VI.real_height = vEnd > vStart ? (((vEnd - vStart) >> 1) * vScale) >> 10 : 0;
VI.width = *REG.VI_WIDTH;
VI.interlaced = (*REG.VI_STATUS & 0x40) != 0;
VI.interlaced = (*REG.VI_STATUS & VI_STATUS_SERRATE_ENABLED) != 0;
if (VI.interlaced) {
f32 fullWidth = 640.0f;
@@ -164,13 +164,13 @@ void VI_UpdateScreen()
wnd.updateScale();
bVIUpdated = true;
}
const u32 size = *REG.VI_STATUS & 3;
const u32 size = *REG.VI_STATUS & VI_STATUS_TYPE_32;
if (VI.height > 0 && size > G_IM_SIZ_8b && VI.width > 0)
frameBufferList().saveBuffer(*REG.VI_ORIGIN & 0xffffff, G_IM_FMT_RGBA, size, VI.width, true);
}
}
// if ((((*REG.VI_STATUS) & 3) > 0) && (gDP.colorImage.changed || bCFB)) { // Does not work in release build!!!
if (((*REG.VI_STATUS) & 3) > 0) {
if (((*REG.VI_STATUS) & VI_STATUS_TYPE_32) > 0) {
if (!bVIUpdated) {
VI_UpdateSize();
bVIUpdated = true;
+16
View File
@@ -2,6 +2,22 @@
#define VI_H
#include "Types.h"
// VI status register
#define VI_STATUS_TYPE_16 0x000002 /* 16 bit 5/5/5/3 */
#define VI_STATUS_TYPE_32 0x000003 /* 32 bit 8/8/8/8 */
#define VI_STATUS_GAMMA_DITHER_ENABLED 0x000004
#define VI_STATUS_GAMMA_ENABLED 0x000008
#define VI_STATUS_DIVOT_ENABLED 0x000010
#define VI_STATUS_SERRATE_ENABLED 0x000040
#define VI_STATUS_AA_MASK 0x000300 /* see AA modes */
#define VI_STATUS_DITHER_FILTER_ENABLED 0x010000
// AA modes
#define AA_MODE_AA_RESAMPLE_ALWAYS_FETCH 0x000000 /* Always fetch lines */
#define AA_MODE_AA_RESAMPLE 0x000100 /* Fetch extra line if needed */
#define AA_MODE_RESAMPLE_ONLY 0x000200
#define AA_MODE_NEITHER 0x000300 /* Replicate pixels, no interpolation */
struct VIInfo
{
u32 width, widthPrev, height, real_height;
+2 -1
View File
@@ -896,7 +896,8 @@ void gDPFullSync()
frameBufferList().updateCurrentBufferEndAddress();
FrameBuffer * pCurrentBuffer = frameBufferList().getCurrent();
pCurrentBuffer->copyDepthTexture();
if (pCurrentBuffer != nullptr)
pCurrentBuffer->copyDepthTexture();
if ((config.frameBufferEmulation.copyToRDRAM != Config::ctDisable || (config.generalEmulation.hacks & hack_subscreen) != 0) &&
!FBInfo::fbInfo.isSupported() &&
pCurrentBuffer != nullptr &&