diff --git a/plugins/zzogl-pg/opengl/CRC.h b/plugins/zzogl-pg/opengl/CRC.h index ff4d27d775..a173473ef1 100644 --- a/plugins/zzogl-pg/opengl/CRC.h +++ b/plugins/zzogl-pg/opengl/CRC.h @@ -53,7 +53,8 @@ enum GAME_HACK_OPTIONS GAME_PARTIALDEPTH = 0x04000000, // tries to save depth targets as much as possible across height changes GAME_REGETHACK = 0x08000000, // some sort of weirdness in ReGet() code GAME_GUSTHACK = 0x10000000, // Needed for Gustgames fast update. - GAME_NOLOGZ = 0x20000000 // Intended for linux -- not logarithmic Z. + GAME_NOLOGZ = 0x20000000, // Intended for linux -- not logarithmic Z. + GAME_AUTOSKIPDRAW = 0x40000000 // Remove blur effect on some games }; #define USEALPHATESTING (!(conf.settings().no_alpha_test)) diff --git a/plugins/zzogl-pg/opengl/GSmain.cpp b/plugins/zzogl-pg/opengl/GSmain.cpp index bb3095e29f..bddb78d267 100644 --- a/plugins/zzogl-pg/opengl/GSmain.cpp +++ b/plugins/zzogl-pg/opengl/GSmain.cpp @@ -159,6 +159,7 @@ void ReportHacks(gameHacks hacks) if (hacks.reget) ZZLog::WriteLn("Reget hack enabled."); if (hacks.gust) ZZLog::WriteLn("Gust hack enabled."); if (hacks.no_logz) ZZLog::WriteLn("'No logz' hack enabled."); + if (hacks.automatic_skip_draw) ZZLog::WriteLn("'Automatic skip draw' hack enabled."); } void ListHacks() diff --git a/plugins/zzogl-pg/opengl/Linux/Linux.cpp b/plugins/zzogl-pg/opengl/Linux/Linux.cpp index a2137309be..d7670e1439 100644 --- a/plugins/zzogl-pg/opengl/Linux/Linux.cpp +++ b/plugins/zzogl-pg/opengl/Linux/Linux.cpp @@ -149,6 +149,7 @@ void CreateGameHackTable(GtkWidget *treeview, gameHacks hacks) add_map_entry(GAME_GUSTHACK, "10000000", "Gust fix, made gustgame more clean and fast - 10000000"); add_map_entry(GAME_NOLOGZ, "20000000", "No logarithmic Z, could decrease number of Z-artefacts - 20000000"); add_map_entry(GAME_INTERLACE2X, "00000004", "Interlace 2X - 00000004\nFixes 2x bigger screen (Gradius 3)."); + add_map_entry(GAME_AUTOSKIPDRAW, "40000000", "Remove blur effect on some games\nSlow games."); for (map::iterator it = mapConfOpts.begin(); it != mapConfOpts.end(); ++it) { diff --git a/plugins/zzogl-pg/opengl/Util.h b/plugins/zzogl-pg/opengl/Util.h index d1c9bb8724..7d540447e7 100644 --- a/plugins/zzogl-pg/opengl/Util.h +++ b/plugins/zzogl-pg/opengl/Util.h @@ -173,7 +173,7 @@ typedef union u32 reget : 1; // some sort of weirdness in ReGet() code u32 gust : 1; // Needed for Gustgames fast update. u32 no_logz : 1; // Intended for linux -- not logarithmic Z. - u32 reserved1 :1; + u32 automatic_skip_draw :1; // allow debug of the automatic skip draw option u32 reserved2 :1; }; u32 _u32; diff --git a/plugins/zzogl-pg/opengl/ZZoglFlushHack.cpp b/plugins/zzogl-pg/opengl/ZZoglFlushHack.cpp index 79cf577354..75f5725868 100644 --- a/plugins/zzogl-pg/opengl/ZZoglFlushHack.cpp +++ b/plugins/zzogl-pg/opengl/ZZoglFlushHack.cpp @@ -25,6 +25,15 @@ #include "ZZoglFlushHack.h" +inline bool GABEST_HAS_SHARED_BITS (int fbp, int fpsm, int tbp, int tpsm) +{ + if ( !PSMT_HAS_SHARED_BITS (fpsm, tpsm) ) + return ((fbp ^ tbp) == 0); + else + return false; +} + + // GSC_... function has been imported from GSdx void GSC_Okami(const GSFrameInfo& fi, int& skip) { @@ -429,12 +438,26 @@ void GSC_RadiataStories(const GSFrameInfo& fi, int& skip) } } -inline bool GABEST_HAS_SHARED_BITS (int fbp, int fpsm, int tbp, int tpsm) +bool GSC_HauntingGround(const GSFrameInfo& fi, int& skip) { - if ( !PSMT_HAS_SHARED_BITS (fpsm, tpsm) ) - return ((fbp ^ tbp) == 0); - else - return false; + if(skip == 0) + { + if(fi.TME && fi.FPSM == fi.TPSM && fi.TPSM == PSM_PSMCT16S && fi.FBMSK == 0x03FFF) + { + skip = 1; + } + else if(fi.TME && fi.FBP == 0x3000 && fi.TBP0 == 0x3380) + { + skip = 1; // bloom + } + else if(fi.TME && fi.FBP == fi.TBP0 && fi.TBP0 == 0x3000 && fi.FBMSK == 0xFFFFFF && + GABEST_HAS_SHARED_BITS(fi.FBP, fi.FPSM, fi.TBP0, fi.TPSM)) + { + skip = 1; + } + } + + return true; } __forceinline bool IsBadFrame(ZeroGS::VB& curvb) @@ -450,7 +473,7 @@ __forceinline bool IsBadFrame(ZeroGS::VB& curvb) fi.TPSM = curvb.tex0.psm; fi.TZTST = curvb.test.ztst; - if (GetSkipCount_Handler) + if (GetSkipCount_Handler && conf.settings().automatic_skip_draw) GetSkipCount_Handler(fi, g_SkipFlushFrame); if(g_SkipFlushFrame == 0 && (conf.SkipDraw > 0))