mirror of https://github.com/PCSX2/pcsx2.git
GregMiscellaneous: zzogl-pg: Start gathering the hack code in one place.
git-svn-id: http://pcsx2.googlecode.com/svn/branches/GregMiscellaneous@4005 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
031a3cb7a0
commit
5c4512c5a9
|
@ -64,6 +64,7 @@ set(zzoglSources
|
|||
zerogs.cpp
|
||||
zpipe.cpp
|
||||
ZZClut.cpp
|
||||
ZZHacks.cpp
|
||||
ZZKeyboard.cpp
|
||||
ZZKick.cpp
|
||||
ZZLog.cpp
|
||||
|
@ -99,6 +100,7 @@ set(zzoglHeaders
|
|||
zpipe.h
|
||||
ZZClut.h
|
||||
ZZGl.h
|
||||
ZZHacks.h
|
||||
ZZKick.h
|
||||
ZZLog.h
|
||||
ZZoglCRTC.h
|
||||
|
|
|
@ -20,44 +20,7 @@
|
|||
#ifndef CRC_H_INCLUDED
|
||||
#define CRC_H_INCLUDED
|
||||
|
||||
// don't change these values!
|
||||
enum GAME_HACK_OPTIONS
|
||||
{
|
||||
GAME_TEXTURETARGS = 0x00000001,
|
||||
GAME_AUTORESET = 0x00000002,
|
||||
GAME_INTERLACE2X = 0x00000004,
|
||||
GAME_TEXAHACK = 0x00000008, // apply texa to non textured polys
|
||||
GAME_NOTARGETRESOLVE = 0x00000010,
|
||||
GAME_EXACTCOLOR = 0x00000020,
|
||||
GAME_NOCOLORCLAMP = 0x00000040,
|
||||
GAME_FFXHACK = 0x00000080,
|
||||
GAME_NOALPHAFAIL = 0x00000100,
|
||||
GAME_NODEPTHUPDATE = 0x00000200,
|
||||
GAME_QUICKRESOLVE1 = 0x00000400,
|
||||
GAME_NOQUICKRESOLVE = 0x00000800,
|
||||
GAME_NOTARGETCLUT = 0x00001000, // full 16 bit resolution
|
||||
GAME_NOSTENCIL = 0x00002000,
|
||||
GAME_VSSHACKOFF = 0x00004000, // vertical stripe syndrome
|
||||
GAME_NODEPTHRESOLVE = 0x00008000,
|
||||
GAME_FULL16BITRES = 0x00010000,
|
||||
GAME_RESOLVEPROMOTED = 0x00020000,
|
||||
GAME_FASTUPDATE = 0x00040000,
|
||||
GAME_NOALPHATEST = 0x00080000,
|
||||
GAME_DISABLEMRTDEPTH = 0x00100000,
|
||||
GAME_32BITTARGS = 0x00200000,
|
||||
GAME_PATH3HACK = 0x00400000,
|
||||
GAME_DOPARALLELCTX = 0x00800000, // tries to parallelize both contexts so that render calls are reduced (xenosaga)
|
||||
// makes the game faster, but can be buggy
|
||||
GAME_XENOSPECHACK = 0x01000000, // xenosaga specularity hack (ignore any zmask=1 draws)
|
||||
GAME_PARTIALPOINTERS = 0x02000000, // whenver the texture or render target are small, tries to look for bigger ones to read from
|
||||
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_AUTOSKIPDRAW = 0x40000000 // Remove blur effect on some games
|
||||
};
|
||||
|
||||
#define USEALPHATESTING (!(conf.settings().no_alpha_test))
|
||||
#include "ZZHacks.h"
|
||||
|
||||
// CRC Information
|
||||
enum Title_Info
|
||||
|
|
|
@ -104,7 +104,6 @@ HWND GShwnd = NULL;
|
|||
u32 THR_KeyEvent = 0; // Value for key event processing between threads
|
||||
bool THR_bShift = false;
|
||||
|
||||
|
||||
u32 CALLBACK PS2EgetLibType()
|
||||
{
|
||||
return PS2E_LT_GS;
|
||||
|
@ -135,55 +134,6 @@ void CALLBACK GSsetLogDir(const char* dir)
|
|||
ZZLog::SetDir(dir);
|
||||
}
|
||||
|
||||
void ReportHacks(gameHacks hacks)
|
||||
{
|
||||
if (hacks.texture_targs) ZZLog::WriteLn("'Texture targs' hack enabled.");
|
||||
if (hacks.auto_reset) ZZLog::WriteLn("'Auto reset' hack enabled.");
|
||||
if (hacks.interlace_2x) ZZLog::WriteLn("'Interlace 2x' hack enabled.");
|
||||
if (hacks.texa) ZZLog::WriteLn("'Texa' hack enabled.");
|
||||
if (hacks.no_target_resolve) ZZLog::WriteLn("'No target resolve' hack enabled.");
|
||||
if (hacks.exact_color) ZZLog::WriteLn("Exact color hack enabled.");
|
||||
if (hacks.no_color_clamp) ZZLog::WriteLn("'No color clamp' hack enabled.");
|
||||
if (hacks.no_alpha_fail) ZZLog::WriteLn("'No alpha fail' hack enabled.");
|
||||
if (hacks.no_depth_update) ZZLog::WriteLn("'No depth update' hack enabled.");
|
||||
if (hacks.quick_resolve_1) ZZLog::WriteLn("'Quick resolve 1' enabled.");
|
||||
if (hacks.no_quick_resolve) ZZLog::WriteLn("'No Quick resolve' hack enabled.");
|
||||
if (hacks.no_target_clut) ZZLog::WriteLn("'No target clut' hack enabled.");
|
||||
if (hacks.no_stencil) ZZLog::WriteLn("'No stencil' hack enabled.");
|
||||
if (hacks.vss_hack_off) ZZLog::WriteLn("VSS hack enabled.");
|
||||
if (hacks.no_depth_resolve) ZZLog::WriteLn("'No depth resolve' hack enabled.");
|
||||
if (hacks.full_16_bit_res) ZZLog::WriteLn("'Full 16 bit resolution' hack enabled.");
|
||||
if (hacks.resolve_promoted) ZZLog::WriteLn("'Resolve promoted' hack enabled.");
|
||||
if (hacks.fast_update) ZZLog::WriteLn("'Fast update' hack enabled.");
|
||||
if (hacks.no_alpha_test) ZZLog::WriteLn("'No alpha test' hack enabled.");
|
||||
if (hacks.disable_mrt_depth) ZZLog::WriteLn("'Disable mrt depth' hack enabled.");
|
||||
if (hacks.args_32_bit) ZZLog::WriteLn("'Args 32 bit' hack enabled.");
|
||||
//if (hacks.path3) ZZLog::WriteLn("'Path3' hack enabled.");
|
||||
if (hacks.parallel_context) ZZLog::WriteLn("'Parallel context' hack enabled.");
|
||||
if (hacks.xenosaga_spec) ZZLog::WriteLn("'Xenosaga spec' hack enabled.");
|
||||
if (hacks.partial_pointers) ZZLog::WriteLn("'Partial pointers' hack enabled.");
|
||||
if (hacks.partial_depth) ZZLog::WriteLn("'Partial depth' hack enabled.");
|
||||
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()
|
||||
{
|
||||
if ((!conf.disableHacks) && (conf.def_hacks._u32 != 0))
|
||||
{
|
||||
ZZLog::WriteLn("AutoEnabling these hacks:");
|
||||
ReportHacks(conf.def_hacks);
|
||||
}
|
||||
|
||||
if (conf.hacks._u32 != 0)
|
||||
{
|
||||
ZZLog::WriteLn("You've manually enabled these hacks:");
|
||||
ReportHacks(conf.hacks);
|
||||
}
|
||||
}
|
||||
|
||||
void CALLBACK GSsetGameCRC(int crc, int options)
|
||||
{
|
||||
// build a list of function pointer for GetSkipCount (SkipDraw)
|
||||
|
@ -350,7 +300,6 @@ extern LRESULT WINAPI MsgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
extern HINSTANCE hInst;
|
||||
#endif
|
||||
|
||||
|
||||
s32 CALLBACK GSopen(void *pDsp, char *Title, int multithread)
|
||||
{
|
||||
FUNCLOG
|
||||
|
@ -393,6 +342,48 @@ s32 CALLBACK GSopen(void *pDsp, char *Title, int multithread)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef USE_GOPEN2
|
||||
s32 CALLBACK GSopen2( void* pDsp, INT32 flags )
|
||||
{
|
||||
FUNCLOG
|
||||
|
||||
bool err;
|
||||
|
||||
g_GSMultiThreaded = true;
|
||||
|
||||
ZZLog::WriteLn("Calling GSopen2.");
|
||||
|
||||
#if defined(_WIN32) && defined(_DEBUG)
|
||||
g_hCurrentThread = GetCurrentThread();
|
||||
#endif
|
||||
|
||||
LoadConfig();
|
||||
strcpy(GStitle, Title);
|
||||
|
||||
err = GLWin.GetWindow(pDsp); // Needs to be added.
|
||||
if (!err)
|
||||
{
|
||||
ZZLog::Error_Log("Failed to acquire window. Exiting...");
|
||||
return -1;
|
||||
}
|
||||
|
||||
ZZLog::GS_Log("Using %s:%d.%d.%d.", libraryName, zgsrevision, zgsbuild, zgsminor);
|
||||
|
||||
if (!ZZCreate2(conf.width, conf.height)) return -1; // Needs to be added.
|
||||
|
||||
ZZLog::WriteLn("Initialization successful.");
|
||||
|
||||
WriteBilinear();
|
||||
WriteAA();
|
||||
InitProfile();
|
||||
InitPath();
|
||||
ResetRegs();
|
||||
ZZLog::GS_Log("GSopen2 finished.");
|
||||
return 0;
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
void CALLBACK GSshutdown()
|
||||
{
|
||||
FUNCLOG
|
||||
|
|
|
@ -146,6 +146,8 @@
|
|||
<Unit filename="../../ZZClut.cpp" />
|
||||
<Unit filename="../../ZZClut.h" />
|
||||
<Unit filename="../../ZZGl.h" />
|
||||
<Unit filename="../../ZZHacks.cpp" />
|
||||
<Unit filename="../../ZZHacks.h" />
|
||||
<Unit filename="../../ZZKeyboard.cpp" />
|
||||
<Unit filename="../../ZZKick.cpp" />
|
||||
<Unit filename="../../ZZKick.h" />
|
||||
|
|
|
@ -127,47 +127,6 @@ enum GSWindowDim
|
|||
GSDim_1280,
|
||||
};
|
||||
|
||||
typedef union
|
||||
{
|
||||
struct
|
||||
{
|
||||
u32 texture_targs : 1;
|
||||
u32 auto_reset : 1;
|
||||
u32 interlace_2x : 1;
|
||||
u32 texa : 1; // apply texa to non textured polys
|
||||
u32 no_target_resolve : 1;
|
||||
u32 exact_color : 1;
|
||||
u32 no_color_clamp : 1;
|
||||
u32 ffx : 1;
|
||||
u32 no_alpha_fail : 1;
|
||||
u32 no_depth_update : 1;
|
||||
u32 quick_resolve_1 : 1;
|
||||
u32 no_quick_resolve : 1;
|
||||
u32 no_target_clut : 1; // full 16 bit resolution
|
||||
u32 no_stencil : 1;
|
||||
u32 vss_hack_off : 1; // vertical stripe syndrome
|
||||
u32 no_depth_resolve : 1;
|
||||
u32 full_16_bit_res : 1;
|
||||
u32 resolve_promoted : 1;
|
||||
u32 fast_update : 1;
|
||||
u32 no_alpha_test : 1;
|
||||
u32 disable_mrt_depth : 1;
|
||||
u32 args_32_bit : 1;
|
||||
u32 path3 : 1;
|
||||
u32 parallel_context : 1; // tries to parallelize both contexts so that render calls are reduced (xenosaga)
|
||||
// makes the game faster, but can be buggy
|
||||
u32 xenosaga_spec : 1; // xenosaga specularity hack (ignore any zmask=1 draws)
|
||||
u32 partial_pointers : 1; // whenver the texture or render target are small, tries to look for bigger ones to read from
|
||||
u32 partial_depth : 1; // tries to save depth targets as much as possible across height changes
|
||||
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 automatic_skip_draw :1; // allow debug of the automatic skip draw option
|
||||
u32 reserved2 :1;
|
||||
};
|
||||
u32 _u32;
|
||||
} gameHacks;
|
||||
|
||||
typedef union
|
||||
{
|
||||
struct
|
||||
|
|
|
@ -155,6 +155,7 @@
|
|||
<ClCompile Include="..\x86.cpp" />
|
||||
<ClCompile Include="..\zerogs.cpp" />
|
||||
<ClCompile Include="..\zpipe.cpp" />
|
||||
<ClCompile Include="..\ZZHacks.cpp" />
|
||||
<ClCompile Include="..\ZZKeyboard.cpp" />
|
||||
<ClCompile Include="..\ZZLog.cpp" />
|
||||
<ClCompile Include="..\ZZoglCreate.cpp" />
|
||||
|
@ -203,6 +204,7 @@
|
|||
<ClInclude Include="Win32.h" />
|
||||
<ClInclude Include="..\x86.h" />
|
||||
<ClInclude Include="..\ZZGl.h" />
|
||||
<ClInclude Include="..\ZZHacks.h" />
|
||||
<ClInclude Include="..\ZZLog.h" />
|
||||
<ClInclude Include="..\zerogs.h" />
|
||||
<ClInclude Include="..\zerogsmath.h" />
|
||||
|
|
|
@ -360,6 +360,10 @@
|
|||
RelativePath="..\ZZKeyboard.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\ZZHacks.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\ZZKick.cpp"
|
||||
>
|
||||
|
@ -505,6 +509,10 @@
|
|||
RelativePath="..\ZZGl.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\ZZHacks.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\ZZKick.h"
|
||||
>
|
||||
|
|
|
@ -0,0 +1,185 @@
|
|||
/* ZZ Open GL graphics plugin
|
||||
* Copyright (c)2009-2010 zeydlitz@gmail.com, arcum42@gmail.com
|
||||
* Based on Zerofrog's ZeroGS KOSMOS (c)2005-2008
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "ZZHacks.h"
|
||||
#include "ZZLog.h"
|
||||
|
||||
int CurrentHack = 0;
|
||||
|
||||
// A list of what bit controls each of the current hacks.
|
||||
u32 hackList[HACK_NUMBER] =
|
||||
{
|
||||
0, // No hack
|
||||
1, //GAME_TEXTURETARGS,
|
||||
2, //GAME_AUTORESET,
|
||||
3, //GAME_INTERLACE2X,
|
||||
4, //GAME_TEXAHACK,
|
||||
5, //GAME_NOTARGETRESOLVE,
|
||||
6, //GAME_EXACTCOLOR,
|
||||
//7 //GAME_NOCOLORCLAMP,
|
||||
//8 //GAME_FFXHACK,
|
||||
9, //GAME_NOALPHAFAIL,
|
||||
10, //GAME_NODEPTHUPDATE,
|
||||
11, //GAME_QUICKRESOLVE1,
|
||||
12, //GAME_NOQUICKRESOLVE,
|
||||
13, //GAME_NOTARGETCLUT,
|
||||
14, //GAME_NOSTENCIL,
|
||||
15, //GAME_NODEPTHRESOLVE,
|
||||
16, //GAME_FULL16BITRES,
|
||||
17, //GAME_RESOLVEPROMOTED,
|
||||
18, //GAME_FASTUPDATE,
|
||||
19, //GAME_NOALPHATEST,
|
||||
20, //GAME_DISABLEMRTDEPTH,
|
||||
//21 //GAME_32BITTARGS,
|
||||
//22 //GAME_PATH3HACK,
|
||||
//23 //GAME_DOPARALLELCTX,
|
||||
24, //GAME_XENOSPECHACK,
|
||||
//25 //GAME_PARTIALPOINTERS,
|
||||
26, //GAME_PARTIALDEPTH,
|
||||
27, //GAME_REGETHACK,
|
||||
28, //GAME_GUSTHACK,
|
||||
29, //GAME_NOLOGZ,
|
||||
30, //GAME_AUTOSKIPDRAW
|
||||
};
|
||||
|
||||
|
||||
char hackDesc[32][64] =
|
||||
{
|
||||
"No hack",
|
||||
"Texture targs",
|
||||
"Auto reset",
|
||||
"Interlace 2x",
|
||||
"Texa",
|
||||
"No target resolve",
|
||||
"Exact color",
|
||||
"No color clamp",
|
||||
"Final Fantasy X",
|
||||
"No alpha fail",
|
||||
"No depth update",
|
||||
"Quick resolve 1",
|
||||
"No Quick resolve",
|
||||
"No target clut",
|
||||
"No stencil",
|
||||
"VSS",
|
||||
"No depth resolve",
|
||||
"Full 16 bit resolution",
|
||||
"Resolve promoted",
|
||||
"Fast update",
|
||||
"No alpha test",
|
||||
"Disable mrt depth",
|
||||
"Args 32 bit",
|
||||
"",
|
||||
"Parallel context",
|
||||
"Xenosaga spec",
|
||||
"Partial pointers",
|
||||
"Partial depth",
|
||||
"Reget",
|
||||
"Gust",
|
||||
"No logz",
|
||||
"Automatic skip draw"
|
||||
};
|
||||
|
||||
struct hacks
|
||||
{
|
||||
bool enabled;
|
||||
char shortDesc[64];
|
||||
char longDesc[256];
|
||||
};
|
||||
|
||||
hacks hack_list[32] =
|
||||
{
|
||||
{ true, "No hack", "No hack" },
|
||||
{ true, "Texture targs", "Tex Target checking - 00000001\nLego Racers" },
|
||||
{ true, "Auto reset", "Auto reset targs - 00000002\nUse when game is slow and toggling AA fixes it. Samurai Warriors. (Automatically on for Shadow Hearts)" },
|
||||
{ true, "Interlace 2x", "Interlace 2X - 00000004\nFixes 2x bigger screen. Gradius 3." },
|
||||
{ false, "Texa", "" },
|
||||
{ true, "No target resolve", "No target resolves - 00000010\nStops all resolving of targets. Try this first for really slow games. (Automatically on for Dark Cloud 1.)" },
|
||||
{ true, "Exact color", "Exact color testing - 00000020\nFixes overbright or shadow/black artifacts. Crash 'n Burn." },
|
||||
{ false, "No color clamp", "No color clamping - 00000040\nSpeeds up games, but might be too bright or too dim." },
|
||||
{ false, "Final Fantasy X", "" },
|
||||
{ false, "No alpha fail", "Alpha Fail hack - 00000100\nRemove vertical stripes or other coloring artifacts. Breaks Persona 4 and MGS3. (Automatically on for Sonic Unleashed, Shadow the Hedgehog, & Ghost in the Shell.)" },
|
||||
{ true, "No depth update", "Disable depth updates - 00000200" },
|
||||
{ true, "Quick resolve 1", "Resolve Hack #1 - 00000400\n Speeds some games. Kingdom Hearts."},
|
||||
{ true, "No Quick resolve", "Resolve Hack #2 - 00000800\nShadow Hearts, Urbz. Destroys FFX."},
|
||||
{ true, "No target clut", "No target CLUT - 00001000\nResident Evil 4, or foggy scenes." },
|
||||
{ true, "No stencil", "Disable stencil buffer - 00002000\nUsually safe to do for simple scenes. Harvest Moon." },
|
||||
{ false, "VSS", "" },
|
||||
{ true, "No depth resolve", "No depth resolve - 00008000\nMight give z buffer artifacts." },
|
||||
{ true, "Full 16 bit resolution", "Full 16 bit resolution - 00010000\nUse when half the screen is missing." },
|
||||
{ true, "Resolve promoted", "Resolve Hack #3 - 00020000\nNeopets" },
|
||||
{ true, "Fast update", "Fast Update - 00040000\n Speeds some games. Needed for Sonic Unleashed. Okami." },
|
||||
{ true, "No alpha test", "Disable alpha testing - 00080000" },
|
||||
{ true, "Disable mrt depth", "Enable Multiple RTs - 00100000" },
|
||||
{ false, "Args 32 bit", "" },
|
||||
{ false, "Path3", "" },
|
||||
{ false, "Parallel context", "" },
|
||||
{ true, "Xenosaga spec", "Specular Highlights - 01000000\nMakes graphics faster by removing highlights. (Automatically on for Xenosaga, Okami, & Okage.)" },
|
||||
{ false, "Partial pointers", "Partial targets - 02000000" },
|
||||
{ true, "Partial depth", "Partial depth - 04000000" },
|
||||
{ false, "Reget", "" },
|
||||
{ true, "Gust", "Gust fix - 10000000. Makes gust games cleaner and faster. (Automatically on for most Gust games)" },
|
||||
{ true, "No logz", "No logarithmic Z - 20000000. Could decrease number of Z-artifacts." },
|
||||
{ true, "Automatic skip draw", "Remove blur effect on some games\nSlow games." }
|
||||
};
|
||||
|
||||
void ReportHacks(gameHacks hacks)
|
||||
{
|
||||
for(int i = 0; i < 32; i++)
|
||||
{
|
||||
if (hacks._u32 & (1 << i))
|
||||
{
|
||||
ZZLog::WriteLn("'%s' hack enabled.", hackDesc[i+1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ListHacks()
|
||||
{
|
||||
if ((!conf.disableHacks) && (conf.def_hacks._u32 != 0))
|
||||
{
|
||||
ZZLog::WriteLn("Auto-enabling these hacks:");
|
||||
ReportHacks(conf.def_hacks);
|
||||
}
|
||||
|
||||
if (conf.hacks._u32 != 0)
|
||||
{
|
||||
ZZLog::WriteLn("You've manually enabled these hacks:");
|
||||
ReportHacks(conf.hacks);
|
||||
}
|
||||
}
|
||||
|
||||
void DisplayHack(int hack)
|
||||
{
|
||||
ZZLog::WriteToScreen2("***%d %s", hack, hackDesc[hackList[hack]]);
|
||||
}
|
||||
|
||||
void ChangeCurrentHack(int hack)
|
||||
{
|
||||
FUNCLOG
|
||||
|
||||
conf.hacks._u32 &= !(hackList[CurrentHack]);
|
||||
conf.hacks._u32 |= hackList[hack];
|
||||
|
||||
DisplayHack(hack);
|
||||
|
||||
CurrentHack = hack;
|
||||
SaveConfig();
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
#ifndef ZZHACKS_H_INCLUDED
|
||||
#define ZZHACKS_H_INCLUDED
|
||||
|
||||
#include "PS2Edefs.h"
|
||||
|
||||
// This is a list of the various hacks, and what bit controls them.
|
||||
// Changing these is not advised unless you know what you are doing.
|
||||
enum GAME_HACK_OPTIONS
|
||||
{
|
||||
GAME_TEXTURETARGS = 0x00000001,
|
||||
GAME_AUTORESET = 0x00000002,
|
||||
GAME_INTERLACE2X = 0x00000004,
|
||||
GAME_TEXAHACK = 0x00000008, // apply texa to non textured polys
|
||||
GAME_NOTARGETRESOLVE = 0x00000010,
|
||||
GAME_EXACTCOLOR = 0x00000020,
|
||||
GAME_NOCOLORCLAMP = 0x00000040,
|
||||
GAME_FFXHACK = 0x00000080,
|
||||
GAME_NOALPHAFAIL = 0x00000100,
|
||||
GAME_NODEPTHUPDATE = 0x00000200,
|
||||
GAME_QUICKRESOLVE1 = 0x00000400,
|
||||
GAME_NOQUICKRESOLVE = 0x00000800,
|
||||
GAME_NOTARGETCLUT = 0x00001000, // full 16 bit resolution
|
||||
GAME_NOSTENCIL = 0x00002000,
|
||||
GAME_VSSHACKOFF = 0x00004000, // vertical stripe syndrome
|
||||
GAME_NODEPTHRESOLVE = 0x00008000,
|
||||
GAME_FULL16BITRES = 0x00010000,
|
||||
GAME_RESOLVEPROMOTED = 0x00020000,
|
||||
GAME_FASTUPDATE = 0x00040000,
|
||||
GAME_NOALPHATEST = 0x00080000,
|
||||
GAME_DISABLEMRTDEPTH = 0x00100000,
|
||||
GAME_32BITTARGS = 0x00200000,
|
||||
GAME_PATH3HACK = 0x00400000,
|
||||
GAME_DOPARALLELCTX = 0x00800000, // tries to parallelize both contexts so that render calls are reduced (xenosaga)
|
||||
// makes the game faster, but can be buggy
|
||||
GAME_XENOSPECHACK = 0x01000000, // xenosaga specularity hack (ignore any zmask=1 draws)
|
||||
GAME_PARTIALPOINTERS = 0x02000000, // whenver the texture or render target are small, tries to look for bigger ones to read from
|
||||
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_AUTOSKIPDRAW = 0x40000000, // Remove blur effect on some games
|
||||
GAME_RESERVED_HACK = 0x80000000
|
||||
};
|
||||
|
||||
#define USEALPHATESTING (!(conf.settings().no_alpha_test))
|
||||
|
||||
typedef union
|
||||
{
|
||||
struct
|
||||
{
|
||||
u32 texture_targs : 1;
|
||||
u32 auto_reset : 1;
|
||||
u32 interlace_2x : 1;
|
||||
u32 texa : 1; // apply texa to non textured polys
|
||||
u32 no_target_resolve : 1;
|
||||
u32 exact_color : 1;
|
||||
u32 no_color_clamp : 1;
|
||||
u32 ffx : 1;
|
||||
u32 no_alpha_fail : 1;
|
||||
u32 no_depth_update : 1;
|
||||
u32 quick_resolve_1 : 1;
|
||||
u32 no_quick_resolve : 1;
|
||||
u32 no_target_clut : 1; // full 16 bit resolution
|
||||
u32 no_stencil : 1;
|
||||
u32 vss_hack_off : 1; // vertical stripe syndrome
|
||||
u32 no_depth_resolve : 1;
|
||||
u32 full_16_bit_res : 1;
|
||||
u32 resolve_promoted : 1;
|
||||
u32 fast_update : 1;
|
||||
u32 no_alpha_test : 1;
|
||||
u32 disable_mrt_depth : 1;
|
||||
u32 args_32_bit : 1;
|
||||
u32 path3 : 1;
|
||||
u32 parallel_context : 1; // tries to parallelize both contexts so that render calls are reduced (xenosaga)
|
||||
// makes the game faster, but can be buggy
|
||||
u32 xenosaga_spec : 1; // xenosaga specularity hack (ignore any zmask=1 draws)
|
||||
u32 partial_pointers : 1; // whenver the texture or render target are small, tries to look for bigger ones to read from
|
||||
u32 partial_depth : 1; // tries to save depth targets as much as possible across height changes
|
||||
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 automatic_skip_draw :1; // allow debug of the automatic skip draw option
|
||||
u32 reserved2 :1;
|
||||
};
|
||||
u32 _u32;
|
||||
} gameHacks;
|
||||
|
||||
#define HACK_NUMBER 25
|
||||
extern u32 hackList[HACK_NUMBER];
|
||||
extern char hackDesc[32][64];
|
||||
extern int CurrentHack;
|
||||
|
||||
extern void ReportHacks(gameHacks hacks);
|
||||
extern void ListHacks();
|
||||
|
||||
extern void DisplayHack(int hack);
|
||||
extern void ChangeCurrentHack(int hack);
|
||||
|
||||
#endif // ZZHACKS_H_INCLUDED
|
|
@ -111,75 +111,26 @@ void ProcessWireFrame()
|
|||
ZZLog::WriteToScreen(strtitle);
|
||||
}
|
||||
|
||||
typedef struct GameHackStruct
|
||||
{
|
||||
const char HackName[40];
|
||||
u32 HackMask;
|
||||
} GameHack;
|
||||
|
||||
#define HACK_NUMBER 25
|
||||
|
||||
GameHack HackinshTable[HACK_NUMBER] =
|
||||
{
|
||||
{"*** 0 No Hack", 0},
|
||||
{"*** 1 TexTargets Check", GAME_TEXTURETARGS},
|
||||
{"*** 2 Autoreset Targets", GAME_AUTORESET},
|
||||
{"*** 3 Interlace 2x", GAME_INTERLACE2X},
|
||||
{"*** 4 TexA hack", GAME_TEXAHACK},
|
||||
{"*** 5 No Target Resolve", GAME_NOTARGETRESOLVE},
|
||||
{"*** 6 Exact color", GAME_EXACTCOLOR},
|
||||
//{"***xx No color clamp", GAME_NOCOLORCLAMP},
|
||||
//{"***xx FFX hack", GAME_FFXHACK},
|
||||
{"*** 7 No Alpha Fail", GAME_NOALPHAFAIL},
|
||||
{"*** 8 No Depth Update", GAME_NODEPTHUPDATE},
|
||||
{"*** 9 Quick Resolve 1", GAME_QUICKRESOLVE1},
|
||||
{"***10 No quick resolve", GAME_NOQUICKRESOLVE},
|
||||
{"***11 Notaget clut", GAME_NOTARGETCLUT},
|
||||
{"***12 No Stencil", GAME_NOSTENCIL},
|
||||
{"***13 No Depth resolve", GAME_NODEPTHRESOLVE},
|
||||
{"***14 Full 16 bit", GAME_FULL16BITRES},
|
||||
{"***15 Resolve promoted", GAME_RESOLVEPROMOTED},
|
||||
{"***16 Fast Update", GAME_FASTUPDATE},
|
||||
{"***17 No Alpha Test", GAME_NOALPHATEST},
|
||||
{"***18 Disable MRT depth", GAME_DISABLEMRTDEPTH},
|
||||
//{"***xx 32 bit targs", GAME_32BITTARGS},
|
||||
//{"***xx Path 3 hack", GAME_PATH3HACK},
|
||||
//{"***xx Parallel calls", GAME_DOPARALLELCTX},
|
||||
{"***19 Specular highlights", GAME_XENOSPECHACK},
|
||||
//{"***xx Partial pointers", GAME_PARTIALPOINTERS},
|
||||
{"***20 Partial depth", GAME_PARTIALDEPTH},
|
||||
{"***21 Reget hack", GAME_REGETHACK},
|
||||
|
||||
{"***22 Gust hack", GAME_GUSTHACK},
|
||||
{"***23 Log-Z", GAME_NOLOGZ},
|
||||
{"***24 Auto skipdraw", GAME_AUTOSKIPDRAW}
|
||||
};
|
||||
|
||||
int CurrentHackSetting = 0;
|
||||
|
||||
void ProcessHackSetting(bool reverse)
|
||||
{
|
||||
FUNCLOG
|
||||
|
||||
// ZZLog::Debug_Log("A %d", HackinshTable[CurrentHackSetting].HackMask);
|
||||
conf.hacks._u32 &= !(HackinshTable[CurrentHackSetting].HackMask);
|
||||
int hack = CurrentHack;
|
||||
|
||||
if (reverse)
|
||||
{
|
||||
CurrentHackSetting--;
|
||||
hack--;
|
||||
|
||||
if (CurrentHackSetting == -1) CurrentHackSetting = HACK_NUMBER - 1;
|
||||
if (hack < 0) hack = HACK_NUMBER - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
CurrentHackSetting++;
|
||||
hack++;
|
||||
|
||||
if (CurrentHackSetting >= HACK_NUMBER) CurrentHackSetting = 0;
|
||||
if (hack >= HACK_NUMBER) hack = 0;
|
||||
}
|
||||
ChangeCurrentHack(hack);
|
||||
|
||||
conf.hacks._u32 |= HackinshTable[CurrentHackSetting].HackMask;
|
||||
|
||||
ZZLog::WriteToScreen(HackinshTable[CurrentHackSetting].HackName);
|
||||
SaveConfig();
|
||||
}
|
||||
|
||||
|
@ -189,7 +140,7 @@ void ProcessSaveState()
|
|||
char strtitle[256];
|
||||
sprintf(strtitle, "Saving in savestate %d", CurrentSavestate);
|
||||
SaveStateExists = true;
|
||||
ZZLog::WriteToScreen(HackinshTable[CurrentHackSetting].HackName);
|
||||
if (CurrentHack != 0) DisplayHack(CurrentHack);
|
||||
}
|
||||
|
||||
void OnFKey(int key, int shift)
|
||||
|
|
|
@ -106,6 +106,18 @@ void WriteToScreen(const char* pstr, u32 ms)
|
|||
ZZAddMessage(pstr, ms);
|
||||
}
|
||||
|
||||
void WriteToScreen2(const char* fmt, ...)
|
||||
{
|
||||
va_list list;
|
||||
char tmp[512];
|
||||
|
||||
va_start(list, fmt);
|
||||
vsprintf(tmp, fmt, list);
|
||||
va_end(list);
|
||||
|
||||
ZZAddMessage(tmp, 5000);
|
||||
}
|
||||
|
||||
void _Message(const char *str)
|
||||
{
|
||||
SysMessage(str);
|
||||
|
|
|
@ -183,6 +183,7 @@ extern void Close();
|
|||
extern void Message(const char *fmt, ...);
|
||||
extern void Log(const char *fmt, ...);
|
||||
void WriteToScreen(const char* pstr, u32 ms = 5000);
|
||||
void WriteToScreen2(const char* pstr, ...);
|
||||
extern void WriteToConsole(const char *fmt, ...);
|
||||
extern void Print(const char *fmt, ...);
|
||||
extern void WriteLn(const char *fmt, ...);
|
||||
|
|
Loading…
Reference in New Issue