Permalink
Browse files

Merge pull request #475 from fzurita/GLideN64_update_oct_12

video-gliden64: Update to commit 19668e2.
  • Loading branch information...
xperia64 committed Oct 3, 2015
2 parents 44766cf + e3719af commit 86a8241736fe48a322d1bd962d306c004362e41b
Showing with 188 additions and 117 deletions.
  1. +8 −24 jni/mupen64plus-video-gliden64/ini/GLideN64.custom.ini
  2. +1 −1 jni/mupen64plus-video-gliden64/src/Config.cpp
  3. +2 −0 jni/mupen64plus-video-gliden64/src/Config.h
  4. +20 −4 jni/mupen64plus-video-gliden64/src/FrameBuffer.cpp
  5. +5 −1 jni/mupen64plus-video-gliden64/src/FrameBuffer.h
  6. +11 −9 jni/mupen64plus-video-gliden64/src/GLES2/GLSLCombiner_gles2.cpp
  7. +11 −7 jni/mupen64plus-video-gliden64/src/GLES2/Shaders_gles2.h
  8. +2 −2 jni/mupen64plus-video-gliden64/src/GLES2/UniformSet.cpp
  9. +1 −1 jni/mupen64plus-video-gliden64/src/GLSLCombiner.h
  10. +1 −1 jni/mupen64plus-video-gliden64/src/GLideNHQ/TxFilter.cpp
  11. +1 −1 jni/mupen64plus-video-gliden64/src/GLideNUI/configDialog.ui
  12. +17 −15 jni/mupen64plus-video-gliden64/src/OGL3X/GLSLCombiner_ogl3x.cpp
  13. +15 −9 jni/mupen64plus-video-gliden64/src/OGL3X/Shaders_ogl3x.h
  14. +20 −8 jni/mupen64plus-video-gliden64/src/OGL3X/UniformBlock.cpp
  15. +1 −0 jni/mupen64plus-video-gliden64/src/OGL3X/UniformBlock.h
  16. +30 −8 jni/mupen64plus-video-gliden64/src/OpenGL.cpp
  17. +1 −0 jni/mupen64plus-video-gliden64/src/OpenGL.h
  18. +6 −0 jni/mupen64plus-video-gliden64/src/RSP.cpp
  19. +1 −1 jni/mupen64plus-video-gliden64/src/Revision.h
  20. +1 −1 jni/mupen64plus-video-gliden64/src/VI.cpp
  21. +13 −11 jni/mupen64plus-video-gliden64/src/gDP.cpp
  22. +14 −7 jni/mupen64plus-video-gliden64/src/gSP.cpp
  23. +1 −1 jni/mupen64plus-video-gliden64/translations/gliden64_de.ts
  24. +1 −1 jni/mupen64plus-video-gliden64/translations/gliden64_es.ts
  25. +1 −1 jni/mupen64plus-video-gliden64/translations/gliden64_fr.ts
  26. +1 −1 jni/mupen64plus-video-gliden64/translations/gliden64_it.ts
  27. +1 −1 jni/mupen64plus-video-gliden64/translations/gliden64_pl.ts
  28. +1 −1 jni/mupen64plus-video-gliden64/translations/gliden64_pt_BR.ts
@@ -133,13 +133,8 @@ frameBufferEmulation\N64DepthCompare=1
Good_Name=Extreme-G (U)
frameBufferEmulation\N64DepthCompare=1
[EXTREME%20G%202]
Good_Name=Extreme-G XG2 (E)(U)
frameBufferEmulation\copyDepthToRDRAM=0
[208E05CD]
Good_Name=Extreme-G XG2 (J)
frameBufferEmulation\copyDepthToRDRAM=0
[F1%20POLE%20POSITION%2064]
Good_Name=F-1 Pole Position 64 (E)(U)
@@ -239,7 +234,6 @@ Good_Name=Mario No Photopi (J)
[MARIO%20STORY]
Good_Name=Mario Story (J)
frameBufferEmulation\copyToRDRAM=1
frameBufferEmulation\copyDepthToRDRAM=0
[MARIOTENNIS]
Good_Name=Mario Tennis (E)(U)
@@ -273,12 +267,10 @@ Good_Name=Nushi Duri 64 - Shiokaze Ni Notte (J)
[PAPER%20MARIO]
Good_Name=Paper Mario (E)(U)
frameBufferEmulation\copyToRDRAM=1
frameBufferEmulation\copyDepthToRDRAM=0
[PENNY%20RACERS]
Good_Name=Penny Racers (E)(U)
frameBufferEmulation\copyToRDRAM=0
frameBufferEmulation\copyDepthToRDRAM=0
[PERFECT%20DARK]
Good_Name=Perfect Dark (E)(J)(U)
@@ -292,12 +284,10 @@ frameBufferEmulation\detectCFB=1
[POKEMON%20STADIUM%202]
Good_Name=Pokemon Stadium 2 (E)(F)(G)(I)(J)(S)(U)
frameBufferEmulation\copyToRDRAM=0
frameBufferEmulation\copyDepthToRDRAM=0
[POKEMON%20STADIUM%20G&S]
Good_Name=Pokemon Stadium Kin Gin (J)
frameBufferEmulation\copyToRDRAM=0
frameBufferEmulation\copyDepthToRDRAM=0
[RAYMAN%202]
Good_Name=Rayman 2 - The Great Escape (E)(U)
@@ -308,29 +298,19 @@ frameBufferEmulation\detectCFB=1
Good_Name=Resident Evil 2 (E)(U)
frameBufferEmulation\detectCFB=1
[ROADSTERS%20TROPHY]
Good_Name=Roadsters Trophy (E)(U)
frameBufferEmulation\copyDepthToRDRAM=0
[437009B9]
Good_Name=Saikyou Habu Shougi (J)
[RUSH%202049]
Good_Name=San Francisco Rush 2049 (E)(U)
frameBufferEmulation\copyToRDRAM=0
frameBufferEmulation\copyDepthToRDRAM=0
[SHADOWGATE64]
Good_Name=Shadowgate 64 - Trials Of The Four Towers (E)(J)(U)
frameBufferEmulation\copyDepthToRDRAM=0
[1C500641]
Good_Name=Snobow Kids (J)
[SPACE%20INVADERS]
Good_Name=Space Invaders (U)
frameBufferEmulation\copyToRDRAM=0
frameBufferEmulation\copyDepthToRDRAM=0
[STARCRAFT%2064]
Good_Name=Star Craft 64 (E)(G)(U)
@@ -346,13 +326,13 @@ Good_Name=Star Twins (J)
frameBufferEmulation\copyFromRDRAM=1
frameBufferEmulation\copyToRDRAM=0
[STAR%20WARS%20EP1%20RACER]
Good_Name=Star Wars Episode I - Racer (E)(U)(J)
frameBufferEmulation\copyDepthToRDRAM=1
[67ED0B45]
Good_Name=Super Robot Taisen 64 (J)
[SMASH%20BROTHERS]
Good_Name=Super Smash Bros. (A)(E)(U) / Nintendo All-Star! Dairantou Smash Brothers (J)
frameBufferEmulation\copyDepthToRDRAM=0
[622D0C12]
Good_Name=Susume! Taisen Puzzle Dama - Toukon! Marutama Chou (J)
@@ -387,6 +367,10 @@ frameBufferEmulation\detectCFB=1
[48460A35]
Good_Name=Ucchan Nanchan No Hono No Challenger - Denryuu Ira Ira Bou (J)
[VIGILANTE%208]
Good_Name=Vigilante 8 (E)(F)(G)(U)
frameBufferEmulation\copyDepthToRDRAM=1
[4C2E093B]
Good_Name=Virtual Pro Wrestling 2 - Oudou Keishou (J)
@@ -42,7 +42,7 @@ void Config::resetToDefaults()
#endif
frameBufferEmulation.enable = 1;
frameBufferEmulation.copyDepthToRDRAM = 1;
frameBufferEmulation.copyDepthToRDRAM = 0;
frameBufferEmulation.copyFromRDRAM = 0;
frameBufferEmulation.copyToRDRAM = 1;
frameBufferEmulation.detectCFB = 0;
@@ -120,6 +120,8 @@ struct Config
#define hack_blastCorps (1<<8) //Blast Corps black polygons
#define hack_ignoreVIHeightChange (1<<9) //Do not reset FBO when VI height is changed. Space Invaders need it.
#define hack_VIUpdateOnCIChange (1<<10) //Update frame if color buffer changed. Needed for Quake II underwater.
#define hack_skipVIChangeCheck (1<<11) //Don't reset FBO when VI parameters changed. Zelda MM
#define hack_ZeldaCamera (1<<12) //Special hack to detect and process Zelda MM camera.
extern Config config;
@@ -229,7 +229,7 @@ void FrameBuffer::init(u32 _address, u32 _endAddress, u16 _format, u16 _size, u1
void FrameBuffer::reinit(u16 _height)
{
const u16 format = m_pTexture->format;
const u32 endAddress = m_startAddress + ((m_width * (_height - 1)) << m_size >> 1) - 1;
const u32 endAddress = m_startAddress + ((m_width * _height) << m_size >> 1) - 1;
if (m_pTexture != NULL)
textureCache().removeFrameBufferTexture(m_pTexture);
if (m_resolveFBO != 0)
@@ -357,11 +357,15 @@ FrameBufferList & FrameBufferList::get()
void FrameBufferList::init()
{
m_pCurrent = NULL;
m_pCopy = NULL;
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
}
void FrameBufferList::destroy() {
m_list.clear();
m_pCurrent = NULL;
m_pCopy = NULL;
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
}
void FrameBufferList::setBufferChanged()
@@ -525,8 +529,10 @@ void FrameBufferList::removeBuffer(u32 _address )
{
for (FrameBuffers::iterator iter = m_list.begin(); iter != m_list.end(); ++iter)
if (iter->m_startAddress == _address) {
if (&(*iter) == m_pCurrent)
if (&(*iter) == m_pCurrent) {
m_pCurrent = NULL;
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
}
m_list.erase(iter);
return;
}
@@ -537,8 +543,10 @@ void FrameBufferList::removeBuffers(u32 _width)
m_pCurrent = NULL;
for (FrameBuffers::iterator iter = m_list.begin(); iter != m_list.end(); ++iter) {
while (iter->m_width == _width) {
if (&(*iter) == m_pCurrent)
if (&(*iter) == m_pCurrent) {
m_pCurrent = NULL;
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
}
iter = m_list.erase(iter);
if (iter == m_list.end())
return;
@@ -1184,7 +1192,15 @@ bool DepthBufferToRDRAM::CopyToRDRAM( u32 _address) {
bool FrameBuffer_CopyDepthBuffer( u32 address ) {
#ifndef GLES2
return g_dbToRDRAM.CopyToRDRAM(address);
FrameBuffer * pCopyBuffer = frameBufferList().getCopyBuffer();
if (pCopyBuffer != NULL) {
// This code is mainly to emulate Zelda MM camera.
g_fbToRDRAM.CopyToRDRAM(pCopyBuffer->m_startAddress);
pCopyBuffer->m_RdramCopy.resize(0); // To disable validity check by RDRAM content. CPU may change content of the buffer for some unknown reason.
frameBufferList().setCopyBuffer(NULL);
return true;
} else
return g_dbToRDRAM.CopyToRDRAM(address);
#else
return false;
#endif
@@ -71,17 +71,21 @@ class FrameBufferList
void correctHeight();
void clearBuffersChanged();
FrameBuffer * getCopyBuffer() const { return m_pCopy; }
void setCopyBuffer(FrameBuffer * _pBuffer) { m_pCopy = _pBuffer; }
static FrameBufferList & get();
private:
FrameBufferList() : m_pCurrent(NULL) {}
FrameBufferList() : m_pCurrent(NULL), m_pCopy(NULL) {}
FrameBufferList(const FrameBufferList &);
FrameBuffer * _findBuffer(u32 _startAddress, u32 _endAddress, u32 _width);
typedef std::list<FrameBuffer> FrameBuffers;
FrameBuffers m_list;
FrameBuffer * m_pCurrent;
FrameBuffer * m_pCopy;
};
struct PBOBinder {
@@ -164,11 +164,11 @@ ShaderCombiner::ShaderCombiner(Combiner & _color, Combiner & _alpha, const gDPCo
} else {
if (usesTile(0)) {
strFragmentShader.append(" nCurrentTile = 0; \n");
strFragmentShader.append(" lowp vec4 readtex0 = readTex(uTex0, vTexCoord0, uFb8Bit[0] != 0, uFbFixedAlpha[0] != 0); \n");
strFragmentShader.append(" lowp vec4 readtex0 = readTex(uTex0, vTexCoord0, uFbMonochrome[0], uFbFixedAlpha[0] != 0); \n");
}
if (usesTile(1)) {
strFragmentShader.append(" nCurrentTile = 1; \n");
strFragmentShader.append(" lowp vec4 readtex1 = readTex(uTex1, vTexCoord1, uFb8Bit[1] != 0, uFbFixedAlpha[1] != 0); \n");
strFragmentShader.append(" lowp vec4 readtex1 = readTex(uTex1, vTexCoord1, uFbMonochrome[1], uFbFixedAlpha[1] != 0); \n");
}
}
const bool bUseHWLight = config.generalEmulation.enableHWLighting != 0 && GBI.isHWLSupported() && usesShadeColor();
@@ -269,7 +269,7 @@ void ShaderCombiner::_locateUniforms() {
LocateUniform(uEnableDepthUpdate);
LocateUniform(uDepthMode);
LocateUniform(uDepthSource);
LocateUniform(uFb8Bit);
LocateUniform(uFbMonochrome);
LocateUniform(uFbFixedAlpha);
LocateUniform(uMaxTile)
LocateUniform(uTexturePersp);
@@ -441,25 +441,27 @@ void ShaderCombiner::updateFBInfo(bool _bForce) {
if (!usesTexture())
return;
int nFb8bitMode0 = 0, nFb8bitMode1 = 0;
int nFbMonochromeMode0 = 0, nFbMonochromeMode1 = 0;
int nFbFixedAlpha0 = 0, nFbFixedAlpha1 = 0;
int nMSTex0Enabled = 0, nMSTex1Enabled = 0;
TextureCache & cache = textureCache();
if (cache.current[0] != NULL && cache.current[0]->frameBufferTexture != CachedTexture::fbNone) {
if (cache.current[0]->size == G_IM_SIZ_8b) {
nFb8bitMode0 = 1;
nFbMonochromeMode0 = 1;
if (gDP.otherMode.imageRead == 0)
nFbFixedAlpha0 = 1;
}
} else if (gSP.textureTile[0]->size == G_IM_SIZ_16b && gSP.textureTile[0]->format == G_IM_FMT_IA)
nFbMonochromeMode0 = 2;
}
if (cache.current[1] != NULL && cache.current[1]->frameBufferTexture != CachedTexture::fbNone) {
if (cache.current[1]->size == G_IM_SIZ_8b) {
nFb8bitMode1 = 1;
nFbMonochromeMode1 = 1;
if (gDP.otherMode.imageRead == 0)
nFbFixedAlpha1 = 1;
}
} else if (gSP.textureTile[1]->size == G_IM_SIZ_16b && gSP.textureTile[1]->format == G_IM_FMT_IA)
nFbMonochromeMode1 = 2;
}
m_uniforms.uFb8Bit.set(nFb8bitMode0, nFb8bitMode1, _bForce);
m_uniforms.uFbMonochrome.set(nFbMonochromeMode0, nFbMonochromeMode1, _bForce);
m_uniforms.uFbFixedAlpha.set(nFbFixedAlpha0, nFbFixedAlpha1, _bForce);
gDP.changed &= ~CHANGED_FB_TEXTURE;
@@ -169,7 +169,7 @@ SHADER_VERSION
"uniform lowp int uAlphaCompareMode; \n"
"uniform lowp int uGammaCorrectionEnabled; \n"
"uniform lowp int uFogUsage; \n"
"uniform lowp ivec2 uFb8Bit; \n"
"uniform lowp ivec2 uFbMonochrome; \n"
"uniform lowp ivec2 uFbFixedAlpha;\n"
"uniform lowp int uSpecialBlendMode;\n"
"uniform lowp int uEnableAlphaTest; \n"
@@ -224,7 +224,7 @@ static const char* fragment_shader_header_common_functions =
"lowp float snoise(); \n"
"void calc_light(in lowp float fLights, in lowp vec3 input_color, out lowp vec3 output_color);\n"
"mediump float mipmap(out lowp vec4 readtex0, out lowp vec4 readtex1); \n"
"lowp vec4 readTex(in sampler2D tex, in mediump vec2 texCoord, in bool fb8bit, in bool fbFixedAlpha); \n"
"lowp vec4 readTex(in sampler2D tex, in mediump vec2 texCoord, in lowp int fbMonochrome, in bool fbFixedAlpha); \n"
#ifdef USE_TOONIFY
"void toonify(in mediump float intensity); \n"
#endif
@@ -295,10 +295,12 @@ static const char* fragment_shader_fake_mipmap =
;
static const char* fragment_shader_readtex =
"lowp vec4 readTex(in sampler2D tex, in mediump vec2 texCoord, in bool fb8bit, in bool fbFixedAlpha) \n"
"lowp vec4 readTex(in sampler2D tex, in mediump vec2 texCoord, in lowp int fbMonochrome, in bool fbFixedAlpha) \n"
"{ \n"
" lowp vec4 texColor = texture2D(tex, texCoord); \n"
" if (fb8bit) texColor = vec4(texColor.r); \n"
" if (fbMonochrome == 1) texColor = vec4(texColor.r); \n"
" else if (fbMonochrome == 2) \n"
" texColor.rgb = vec3(dot(vec3(0.2126, 0.7152, 0.0722), texColor.rgb)); \n"
" if (fbFixedAlpha) texColor.a = 0.825; \n"
" return texColor; \n"
"} \n"
@@ -321,12 +323,14 @@ static const char* fragment_shader_readtex_3point =
" lowp vec4 c2 = TEX_OFFSET(vec2(offset.x, offset.y - sign(offset.y))); \n"
" return c0 + abs(offset.x)*(c1-c0) + abs(offset.y)*(c2-c0); \n"
"} \n"
"lowp vec4 readTex(in sampler2D tex, in mediump vec2 texCoord, in bool fb8bit, in bool fbFixedAlpha) \n"
"lowp vec4 readTex(in sampler2D tex, in mediump vec2 texCoord, in lowp int fbMonochrome, in bool fbFixedAlpha) \n"
"{ \n"
" lowp vec4 texStandard = texture2D(tex, texCoord); \n"
" lowp vec4 texStandard = texture2D(tex, texCoord); \n"
" lowp vec4 tex3Point = filter3point(tex, texCoord); \n"
" lowp vec4 texColor = uTextureFilterMode == 0 ? texStandard : tex3Point; \n"
" if (fb8bit) texColor = vec4(texColor.r); \n"
" if (fbMonochrome == 1) texColor = vec4(texColor.r); \n"
" else if (fbMonochrome == 2) \n"
" texColor.rgb = vec3(dot(vec3(0.2126, 0.7152, 0.0722), texColor.rgb)); \n"
" if (fbFixedAlpha) texColor.a = 0.825; \n"
" return texColor; \n"
"} \n"
@@ -88,8 +88,8 @@ void UniformSet::_updateTextureUniforms(UniformSetLocation & _location, bool _bU
else {
_location.uTexOffset[t].set(gSP.textureTile[t]->fuls, gSP.textureTile[t]->fult, _bForce);
_location.uTexMask[t].set(
gSP.textureTile[t]->masks > 0 ? (float)(1 << gSP.textureTile[t]->masks) : 0.0f,
gSP.textureTile[t]->maskt > 0 ? (float)(1 << gSP.textureTile[t]->maskt) : 0.0f,
gSP.textureTile[t]->clamps == 0 && gSP.textureTile[t]->masks > 0 ? (float)(1 << gSP.textureTile[t]->masks) : 0.0f,
gSP.textureTile[t]->clampt == 0 && gSP.textureTile[t]->maskt > 0 ? (float)(1 << gSP.textureTile[t]->maskt) : 0.0f,
_bForce);
}
}
@@ -96,7 +96,7 @@ class ShaderCombiner {
fv2Uniform uScreenScale, uDepthScale, uFogScale;
iv2Uniform uMSTexEnabled, uFb8Bit, uFbFixedAlpha;
iv2Uniform uMSTexEnabled, uFbMonochrome, uFbFixedAlpha;
};
#ifdef OS_MAC_OS_X
@@ -594,7 +594,7 @@ TxFilter::dmptx(uint8 *src, int width, int height, int rowStridePixel, uint16 gf
tmpbuf.append(wst("/"));
tmpbuf.append(_ident);
tmpbuf.append(wst("/GLideNHQ"));
if (!osal_path_existsW(tmpbuf.c_str()) && !osal_mkdirp(tmpbuf.c_str()))
if (!osal_path_existsW(tmpbuf.c_str()) && osal_mkdirp(tmpbuf.c_str()) != 0)
return 0;
if ((n64fmt >> 8) == 0x2) {
@@ -673,7 +673,7 @@
<item>
<widget class="QCheckBox" name="n64DepthCompareCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Use shadres to emulate N64 depth compare modes. &lt;span style=&quot; font-weight:600;&quot;&gt;Experimantal!&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Use shaders to emulate N64 depth compare modes. &lt;span style=&quot; font-weight:600;&quot;&gt;Experimantal!&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Emulate N64 depth compare</string>
Oops, something went wrong.

0 comments on commit 86a8241

Please sign in to comment.