From ff890e3bc8655cff499bc7e9bfad2adf13f6b84f Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Fri, 20 Mar 2015 19:54:26 +0600 Subject: [PATCH] Add special blend mode hack to remove Pilot Wings brown boxes. --- Config.h | 1 + OpenGL.cpp | 7 ++++--- RSP.cpp | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Config.h b/Config.h index 18f9f185..7eeaa4ca 100644 --- a/Config.h +++ b/Config.h @@ -95,6 +95,7 @@ struct Config #define hack_noDepthFrameBuffers (1<<1) //Do not use depth buffers as texture #define hack_blurPauseScreen (1<<2) //Game copies frame buffer to depth buffer area, CPU blurs it. That image is used as background for pause screen. #define hack_scoreboard (1<<3) //Copy data from RDRAM to auxilary frame buffer. Scoreboard in Mario Tennis. +#define hack_pilotWings (1<<4) //Special blend mode for PilotWings. extern Config config; diff --git a/OpenGL.cpp b/OpenGL.cpp index b90312eb..936d6bcb 100644 --- a/OpenGL.cpp +++ b/OpenGL.cpp @@ -555,9 +555,10 @@ void OGLRender::_setBlendMode() const glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); break; } - } - else - { + } else if ((config.generalEmulation.hacks & hack_pilotWings) != 0 && (gDP.otherMode.l & 0x80) != 0) { //CLR_ON_CVG without FORCE_BL + glEnable(GL_BLEND); + glBlendFunc(GL_ZERO, GL_ONE); + } else { glDisable( GL_BLEND ); } } diff --git a/RSP.cpp b/RSP.cpp index c9d54490..c1924652 100644 --- a/RSP.cpp +++ b/RSP.cpp @@ -335,6 +335,9 @@ void RSP_Init() config.generalEmulation.hacks |= hack_blurPauseScreen; else if (strstr(RSP.romname, (const char *)"MarioTennis") != NULL) config.generalEmulation.hacks |= hack_scoreboard; + else if (strstr(RSP.romname, (const char *)"Pilot Wings64") != NULL) + config.generalEmulation.hacks |= hack_pilotWings; + api().FindPluginPath(RSP.pluginpath);