mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
* Changed the Projection Hack option in game properties to "Custom Projection Hack"
- dislocating all sensible stuff related to "values per game/pattern" outside the sourcecode. - giving more control to end-users across the user-friendly interface. - deleting/cleaning some dead variables. - updating all gameconfig.ini data to reflect new PHack concept (pending upload). * Updated Italian translation - Includes corrections, a better strings translating and suggestions directly by Google Code's people. + Minor old pending changes... git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6973 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -138,10 +138,8 @@ void CPUInfo::Detect()
|
||||
if (max_std_fn >= 1) {
|
||||
__cpuid(cpu_id, 0x00000001);
|
||||
logical_cpu_count = (cpu_id[1] >> 16) & 0xFF;
|
||||
if ((cpu_id[3] >> 28) & 1) {
|
||||
// wtf, we get here on my core 2
|
||||
HTT = true;
|
||||
}
|
||||
// HTT is valid for intel processors only.
|
||||
HTT = ((cpu_id[3] >> 28) & 1) && vendor == VENDOR_INTEL;
|
||||
if ((cpu_id[3] >> 25) & 1) bSSE = true;
|
||||
if ((cpu_id[3] >> 26) & 1) bSSE2 = true;
|
||||
if ((cpu_id[2]) & 1) bSSE3 = true;
|
||||
@ -175,7 +173,7 @@ void CPUInfo::Detect()
|
||||
if (apic_id_core_id_size == 0) {
|
||||
// New mechanism for modern CPUs.
|
||||
num_cores = logical_cpu_count;
|
||||
if (HTT && vendor == VENDOR_INTEL) {
|
||||
if (HTT) {
|
||||
__cpuid(cpu_id, 0x00000004);
|
||||
int cores_x_package = ((cpu_id[0] >> 26) & 0x3F) + 1;
|
||||
cores_x_package = ((logical_cpu_count % cores_x_package) == 0) ? cores_x_package : 1;
|
||||
@ -202,7 +200,7 @@ std::string CPUInfo::Summarize()
|
||||
else
|
||||
{
|
||||
sum = StringFromFormat("%s, %i cores", cpu_string, num_cores);
|
||||
if (HTT && vendor == VENDOR_INTEL) sum += StringFromFormat(" (%i logical IDs per physical core)", logical_cpu_count);
|
||||
if (HTT) sum += StringFromFormat(" (%i logical IDs per physical core)", logical_cpu_count);
|
||||
}
|
||||
if (bSSE) sum += ", SSE";
|
||||
if (bSSE2) sum += ", SSE2";
|
||||
|
@ -38,7 +38,7 @@ struct CPUInfo
|
||||
bool CPU64bit;
|
||||
bool Mode64bit;
|
||||
|
||||
bool hyper_threaded;
|
||||
bool HTT;
|
||||
int num_cores;
|
||||
int logical_cpu_count;
|
||||
|
||||
@ -55,7 +55,6 @@ struct CPUInfo
|
||||
bool bAES;
|
||||
bool bLAHFSAHF64;
|
||||
bool bLongMode;
|
||||
bool HTT;
|
||||
|
||||
// Call Detect()
|
||||
explicit CPUInfo();
|
||||
|
@ -69,6 +69,7 @@ BEGIN_EVENT_TABLE(CISOProperties, wxDialog)
|
||||
EVT_MENU(IDM_EXTRACTAPPLOADER, CISOProperties::OnExtractDataFromHeader)
|
||||
EVT_MENU(IDM_EXTRACTDOL, CISOProperties::OnExtractDataFromHeader)
|
||||
EVT_CHOICE(ID_LANG, CISOProperties::OnChangeBannerLang)
|
||||
EVT_CHECKBOX(ID_PHACKENABLE, CISOProperties::OnCheckBoxClicked)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& position, const wxSize& size, long style)
|
||||
@ -347,14 +348,22 @@ void CISOProperties::CreateGUIControls(bool IsWad)
|
||||
UseZTPSpeedupHack->SetToolTip(_("Enable this to speed up The Legend of Zelda: Twilight Princess. Disable for ANY other game."));
|
||||
DListCache = new wxCheckBox(m_GameConfig, ID_DLISTCACHE, _("DList Cache"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator);
|
||||
// Hack
|
||||
Hacktext = new wxStaticText(m_GameConfig, ID_HACK_TEXT, _("Projection Hack for: "), wxDefaultPosition, wxDefaultSize);
|
||||
arrayStringFor_Hack.Add(_("None"));
|
||||
arrayStringFor_Hack.Add(_("Zelda Twilight Princess Bloom hack"));
|
||||
arrayStringFor_Hack.Add(_("Sonic and the Black Knight"));
|
||||
arrayStringFor_Hack.Add(_("Bleach Versus Crusade"));
|
||||
arrayStringFor_Hack.Add(_("Skies of Arcadia"));
|
||||
arrayStringFor_Hack.Add(_("Metroid Other M"));
|
||||
Hack = new wxChoice(m_GameConfig, ID_HACK, wxDefaultPosition, wxDefaultSize, arrayStringFor_Hack, 0, wxDefaultValidator);
|
||||
sbPHackSettings = new wxStaticBoxSizer(wxVERTICAL, m_GameConfig, _("Custom Projection Hack"));
|
||||
PHackEnable = new wxCheckBox(m_GameConfig, ID_PHACKENABLE, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE, wxDefaultValidator);
|
||||
PHackEnable->SetToolTip(_("Customize some Orthographic Projection parameters."));
|
||||
szrPHackSettings = new wxFlexGridSizer(3,5,5);
|
||||
PHackZNearText = new wxStaticText(m_GameConfig, ID_PHACK_ZNear_TEXT, _("zNear Correction: "), wxDefaultPosition, wxDefaultSize);
|
||||
PHackZNear = new wxTextCtrl(m_GameConfig, ID_PHACK_ZNear, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
PHackZNear->SetToolTip(_("Adds the specified value to zNear Parameter.\nTwo ways to express the floating point values.\nExample: entering '\'200'\' or '\'0.0002'\' directly, it produces equal effects, the acquired value will be '\'0.0002'\'.\nValues: (0->+/-Integer) or (0->+/-FP[6 digits of precision])\n\nNOTE: Check LogWindow/Console for the acquired values."));
|
||||
PHackSZNear = new wxCheckBox(m_GameConfig, ID_PHACK_SZNear, _("(-)+zNear"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE, wxDefaultValidator);
|
||||
PHackSZNear->SetToolTip(_("Changes sign to zNear Parameter (after correction)"));
|
||||
PHackZFarText = new wxStaticText(m_GameConfig, ID_PHACK_ZFar_TEXT, _("zFar Correction: "), wxDefaultPosition, wxDefaultSize);
|
||||
PHackZFar = new wxTextCtrl(m_GameConfig, ID_PHACK_ZFar, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
PHackZFar->SetToolTip(_("Adds the specified value to zFar Parameter.\nTwo ways to express the floating point values.\nExample: entering '\'200'\' or '\'0.0002'\' directly, it produces equal effects, the acquired value will be '\'0.0002'\'.\nValues: (0->+/-Integer) or (0->+/-FP[6 digits of precision])\n\nNOTE: Check LogWindow/Console for the acquired values."));
|
||||
PHackSZFar = new wxCheckBox(m_GameConfig, ID_PHACK_SZFar, _("(-)+zFar"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE, wxDefaultValidator);
|
||||
PHackSZFar->SetToolTip(_("Changes sign to zFar Parameter (after correction)"));
|
||||
PHackExP = new wxCheckBox(m_GameConfig, ID_PHACK_ExP, _("Extra Parameter"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE, wxDefaultValidator);
|
||||
PHackExP->SetToolTip(_("Extra Parameter useful in '\'Metroid: Other M'\' only."));
|
||||
|
||||
// Emulation State
|
||||
sEmuState = new wxBoxSizer(wxHORIZONTAL);
|
||||
@ -391,8 +400,18 @@ void CISOProperties::CreateGUIControls(bool IsWad)
|
||||
sbVideoOverrides->Add(UseXFB, 0, wxEXPAND|wxLEFT, 5);
|
||||
sbVideoOverrides->Add(UseZTPSpeedupHack, 0, wxEXPAND|wxLEFT, 5);
|
||||
sbVideoOverrides->Add(DListCache, 0, wxEXPAND|wxLEFT, 5);
|
||||
sbVideoOverrides->Add(Hacktext, 0, wxEXPAND|wxLEFT, 5);
|
||||
sbVideoOverrides->Add(Hack, 0, wxEXPAND|wxLEFT, 5);
|
||||
sbVideoOverrides->AddSpacer(5);
|
||||
sbVideoOverrides->Add(sbPHackSettings, 0, wxEXPAND);
|
||||
sbPHackSettings->Add(PHackEnable, 0, wxEXPAND|wxLEFT, 5);
|
||||
sbPHackSettings->AddSpacer(15);
|
||||
sbPHackSettings->Add(szrPHackSettings, 0, wxEXPAND|wxLEFT, 5);
|
||||
szrPHackSettings->Add(PHackZNearText, 0, wxALIGN_CENTER_VERTICAL);
|
||||
szrPHackSettings->Add(PHackZNear, 1, wxEXPAND);
|
||||
szrPHackSettings->Add(PHackSZNear, 0, wxEXPAND|wxLEFT, 5);
|
||||
szrPHackSettings->Add(PHackZFarText, 0, wxALIGN_CENTER_VERTICAL);
|
||||
szrPHackSettings->Add(PHackZFar, 1, wxEXPAND);
|
||||
szrPHackSettings->Add(PHackSZFar, 0, wxEXPAND|wxLEFT, 5);
|
||||
szrPHackSettings->Add(PHackExP, 0, wxEXPAND);
|
||||
|
||||
sbGameConfig->Add(sbCoreOverrides, 0, wxEXPAND);
|
||||
sbGameConfig->Add(sbWiiOverrides, 0, wxEXPAND);
|
||||
@ -400,7 +419,7 @@ void CISOProperties::CreateGUIControls(bool IsWad)
|
||||
sConfigPage->Add(sbGameConfig, 0, wxEXPAND|wxALL, 5);
|
||||
sEmuState->Add(EmuStateText, 0, wxALIGN_CENTER_VERTICAL);
|
||||
sEmuState->Add(EmuState, 0, wxEXPAND);
|
||||
sEmuState->Add(EmuIssues,1,wxEXPAND);
|
||||
sEmuState->Add(EmuIssues, 1, wxEXPAND);
|
||||
sConfigPage->Add(sEmuState, 0, wxEXPAND|wxALL, 5);
|
||||
m_GameConfig->SetSizer(sConfigPage);
|
||||
|
||||
@ -552,6 +571,22 @@ void CISOProperties::CreateGUIControls(bool IsWad)
|
||||
Layout();
|
||||
}
|
||||
|
||||
void CISOProperties::OnCheckBoxClicked(wxCommandEvent& event)
|
||||
{
|
||||
bool choice = (bool)event.GetInt();
|
||||
|
||||
if (event.GetId() == ID_PHACKENABLE)
|
||||
{
|
||||
PHackSZNear->Enable(choice);
|
||||
PHackSZFar->Enable(choice);
|
||||
PHackZNearText->Enable(choice);
|
||||
PHackZNear->Enable(choice);
|
||||
PHackZFarText->Enable(choice);
|
||||
PHackZFar->Enable(choice);
|
||||
PHackExP->Enable(choice);
|
||||
}
|
||||
}
|
||||
|
||||
void CISOProperties::OnClose(wxCloseEvent& WXUNUSED (event))
|
||||
{
|
||||
if (!SaveGameConfig())
|
||||
@ -920,8 +955,37 @@ void CISOProperties::LoadGameConfig()
|
||||
else
|
||||
DListCache->Set3StateValue(wxCHK_UNDETERMINED);
|
||||
|
||||
GameIni.Get("Video", "ProjectionHack", &iTemp, 0/*None*/);
|
||||
Hack->SetSelection(iTemp);
|
||||
GameIni.Get("Video", "ProjectionHack", &bTemp);
|
||||
PHackEnable->Set3StateValue((wxCheckBoxState)bTemp);
|
||||
PHackSZNear->Enable(bTemp);
|
||||
PHackSZFar->Enable(bTemp);
|
||||
PHackZNearText->Enable(bTemp);
|
||||
PHackZNear->Enable(bTemp);
|
||||
PHackZFarText->Enable(bTemp);
|
||||
PHackZFar->Enable(bTemp);
|
||||
PHackExP->Enable(bTemp);
|
||||
|
||||
GameIni.Get("Video", "PH_SZNear", &bTemp);
|
||||
PHackSZNear->Set3StateValue((wxCheckBoxState)bTemp);
|
||||
GameIni.Get("Video", "PH_SZFar", &bTemp);
|
||||
PHackSZFar->Set3StateValue((wxCheckBoxState)bTemp);
|
||||
GameIni.Get("Video", "PH_ExtraParam", &bTemp);
|
||||
PHackExP->Set3StateValue((wxCheckBoxState)bTemp);
|
||||
|
||||
GameIni.Get("Video", "PH_ZNear", &sTemp);
|
||||
if (!sTemp.empty())
|
||||
{
|
||||
PHackZNear->SetValue(wxString(sTemp.c_str(), *wxConvCurrent));
|
||||
bRefreshList = true;
|
||||
}
|
||||
|
||||
GameIni.Get("Video", "PH_ZFar", &sTemp);
|
||||
if (!sTemp.empty())
|
||||
{
|
||||
PHackZFar->SetValue(wxString(sTemp.c_str(), *wxConvCurrent));
|
||||
bRefreshList = true;
|
||||
}
|
||||
|
||||
|
||||
GameIni.Get("EmuState", "EmulationStateId", &iTemp, 0/*Not Set*/);
|
||||
EmuState->SetSelection(iTemp);
|
||||
@ -1041,7 +1105,14 @@ bool CISOProperties::SaveGameConfig()
|
||||
else
|
||||
GameIni.Set("Video", "DlistCachingEnable", DListCache->Get3StateValue());
|
||||
|
||||
GameIni.Set("Video", "ProjectionHack", Hack->GetSelection());
|
||||
GameIni.Set("Video", "ProjectionHack", PHackEnable->Get3StateValue());
|
||||
GameIni.Set("Video", "PH_SZNear", PHackSZNear->Get3StateValue());
|
||||
GameIni.Set("Video", "PH_SZFar", PHackSZFar->Get3StateValue());
|
||||
GameIni.Set("Video", "PH_ExtraParam", PHackExP->Get3StateValue());
|
||||
|
||||
GameIni.Set("Video", "PH_ZNear", (const char*)PHackZNear->GetValue().mb_str(*wxConvCurrent));
|
||||
GameIni.Set("Video", "PH_ZFar", (const char*)PHackZFar->GetValue().mb_str(*wxConvCurrent));
|
||||
|
||||
GameIni.Set("EmuState", "EmulationStateId", EmuState->GetSelection());
|
||||
GameIni.Set("EmuState", "EmulationIssues", (const char*)EmuIssues->GetValue().mb_str(*wxConvCurrent));
|
||||
|
||||
|
@ -63,6 +63,7 @@ class CISOProperties : public wxDialog
|
||||
wxStaticBoxSizer *sbCoreOverrides;
|
||||
wxStaticBoxSizer *sbWiiOverrides;
|
||||
wxStaticBoxSizer *sbVideoOverrides;
|
||||
wxStaticBoxSizer *sbPHackSettings;
|
||||
wxBoxSizer *sEmuState;
|
||||
wxBoxSizer *sPatches;
|
||||
wxBoxSizer *sPatchButtons;
|
||||
@ -92,10 +93,8 @@ class CISOProperties : public wxDialog
|
||||
wxCheckBox *ForceFiltering,
|
||||
*EFBCopyEnable, *EFBAccessEnable, *EFBToTextureEnable,
|
||||
*SafeTextureCache, *DstAlphaPass, *UseXFB, *UseZTPSpeedupHack,
|
||||
*DListCache;
|
||||
*DListCache, *PHackEnable, *PHackSZNear, *PHackSZFar, *PHackExP;
|
||||
wxStaticText *Hacktext;
|
||||
wxArrayString arrayStringFor_Hack;
|
||||
wxChoice *Hack;
|
||||
|
||||
wxButton *EditConfig;
|
||||
wxStaticText *EmuStateText;
|
||||
@ -129,12 +128,16 @@ class CISOProperties : public wxDialog
|
||||
wxStaticText *m_MakerText;
|
||||
wxStaticText *m_CommentText;
|
||||
wxStaticText *m_BannerText;
|
||||
wxStaticText *PHackZNearText;
|
||||
wxStaticText *PHackZFarText;
|
||||
wxTextCtrl *m_Name;
|
||||
wxTextCtrl *m_GameID;
|
||||
wxTextCtrl *m_Country;
|
||||
wxTextCtrl *m_MakerID;
|
||||
wxTextCtrl *m_Date;
|
||||
wxTextCtrl *m_FST;
|
||||
wxTextCtrl *PHackZNear;
|
||||
wxTextCtrl *PHackZFar;
|
||||
wxArrayString arrayStringFor_Lang;
|
||||
wxChoice *m_Lang;
|
||||
wxTextCtrl *m_ShortName;
|
||||
@ -146,6 +149,8 @@ class CISOProperties : public wxDialog
|
||||
wxTreeItemId RootId;
|
||||
wxImageList *m_iconList;
|
||||
|
||||
wxFlexGridSizer *szrPHackSettings;
|
||||
|
||||
Gecko::CodeConfigPanel *m_geckocode_panel;
|
||||
|
||||
enum
|
||||
@ -180,8 +185,14 @@ class CISOProperties : public wxDialog
|
||||
ID_USEXFB,
|
||||
ID_ZTP_SPEEDUP,
|
||||
ID_DLISTCACHE,
|
||||
ID_HACK_TEXT,
|
||||
ID_HACK,
|
||||
ID_PHACKENABLE,
|
||||
ID_PHACK_SZNear,
|
||||
ID_PHACK_SZFar,
|
||||
ID_PHACK_ZNear_TEXT,
|
||||
ID_PHACK_ZNear,
|
||||
ID_PHACK_ZFar_TEXT,
|
||||
ID_PHACK_ZFar,
|
||||
ID_PHACK_ExP,
|
||||
ID_ENABLEPROGRESSIVESCAN,
|
||||
ID_ENABLEWIDESCREEN,
|
||||
ID_EDITCONFIG,
|
||||
@ -248,6 +259,7 @@ class CISOProperties : public wxDialog
|
||||
void OnExtractDataFromHeader(wxCommandEvent& event);
|
||||
void SetRefresh(wxCommandEvent& event);
|
||||
void OnChangeBannerLang(wxCommandEvent& event);
|
||||
void OnCheckBoxClicked(wxCommandEvent& event);
|
||||
|
||||
GameListItem *OpenGameListItem;
|
||||
|
||||
|
@ -434,7 +434,7 @@ void TextureCache::CopyRenderTargetToTexture(u32 address, bool bFromZBuffer,
|
||||
|
||||
case 3: // Z16
|
||||
colmat[1] = colmat[5] = colmat[9] = colmat[12] = 1.0f;
|
||||
cbufid = 13;
|
||||
cbufid = 24;
|
||||
break;
|
||||
|
||||
case 11: // Z16 (reverse order)
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "MathUtil.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <sstream>
|
||||
|
||||
#include "Statistics.h"
|
||||
|
||||
@ -52,24 +53,77 @@ void UpdateViewport();
|
||||
namespace
|
||||
{
|
||||
// Control Variables
|
||||
static bool g_ProjHack0;
|
||||
static ProjectionHack g_ProjHack1;
|
||||
static ProjectionHack g_ProjHack2;
|
||||
static ProjectionHack g_ProjHack3;
|
||||
static bool g_ProjHack3;
|
||||
} // Namespace
|
||||
|
||||
void UpdateProjectionHack(int iPhackvalue)
|
||||
float PHackValue(std::string sValue)
|
||||
{
|
||||
bool bProjHack1 = 0, bPhackvalue1 = 0, bPhackvalue2 = 0, bPhackvalue3 = 0;
|
||||
float fhackvalue1 = 0, fhackvalue2 = 0;
|
||||
switch(iPhackvalue)
|
||||
float f = 0;
|
||||
bool fp = false;
|
||||
const char *cStr = sValue.c_str();
|
||||
char *c = new char[strlen(cStr)+1];
|
||||
std::istringstream sTof("");
|
||||
|
||||
for (unsigned int i=0; i<=strlen(cStr); ++i)
|
||||
{
|
||||
case PROJECTION_HACK_NONE:
|
||||
bProjHack1 = 0;
|
||||
bPhackvalue1 = 0;
|
||||
bPhackvalue2 = 0;
|
||||
bPhackvalue3 = 0;
|
||||
break;
|
||||
if (i == 20)
|
||||
{
|
||||
c[i] = '\0';
|
||||
break;
|
||||
}
|
||||
c[i] = (cStr[i] == ',') ? '.' : *(cStr+i);
|
||||
if (c[i] == '.')
|
||||
fp = true;
|
||||
}
|
||||
cStr = c;
|
||||
sTof.str(cStr);
|
||||
sTof >> f;
|
||||
|
||||
if (!fp) f /= 0xF4240;
|
||||
|
||||
delete [] c;
|
||||
return f;
|
||||
}
|
||||
|
||||
void UpdateProjectionHack(int iPhackvalue[], std::string sPhackvalue[])
|
||||
{
|
||||
float fhackvalue1 = 0, fhackvalue2 = 0;
|
||||
float fhacksign1 = 1.0, fhacksign2 = 1.0;
|
||||
bool bProjHack3 = false;
|
||||
char *sTemp[2];
|
||||
|
||||
if (iPhackvalue[0] == 0)
|
||||
goto hackDisabled;
|
||||
|
||||
NOTICE_LOG(VIDEO, "\t\t--- Ortographic Projection Hack ON ---");
|
||||
|
||||
fhacksign1 *= (iPhackvalue[1] == 1) ? -1.0f : fhacksign1;
|
||||
sTemp[0] = (iPhackvalue[1] == 1) ? " * (-1)" : "";
|
||||
fhacksign2 *= (iPhackvalue[2] == 1) ? -1.0f : fhacksign2;
|
||||
sTemp[1] = (iPhackvalue[2] == 1) ? " * (-1)" : "";
|
||||
|
||||
fhackvalue1 = PHackValue(sPhackvalue[0]);
|
||||
NOTICE_LOG(VIDEO, "- zNear Correction = (%f + zNear)%s", fhackvalue1, sTemp[0]);
|
||||
|
||||
fhackvalue2 = PHackValue(sPhackvalue[1]);
|
||||
NOTICE_LOG(VIDEO, "- zFar Correction = (%f + zFar)%s", fhackvalue2, sTemp[1]);
|
||||
|
||||
sTemp[0] = "DISABLED";
|
||||
bProjHack3 = (iPhackvalue[3] == 1) ? true : bProjHack3;
|
||||
if (bProjHack3)
|
||||
sTemp[0] = "ENABLED";
|
||||
NOTICE_LOG(VIDEO, "- Extra Parameter: %s", sTemp[0]);
|
||||
|
||||
hackDisabled:
|
||||
|
||||
// Set the projections hacks
|
||||
g_ProjHack1 = ProjectionHack(fhackvalue1,fhacksign1);
|
||||
g_ProjHack2 = ProjectionHack(fhackvalue2,fhacksign2);
|
||||
g_ProjHack3 = bProjHack3;
|
||||
|
||||
/*
|
||||
case PROJECTION_HACK_ZELDA_TP_BLOOM_HACK:
|
||||
bPhackvalue1 = 1;
|
||||
bProjHack1 = 1;
|
||||
@ -95,7 +149,7 @@ void UpdateProjectionHack(int iPhackvalue)
|
||||
case PROJECTION_HACK_METROID_OTHER_M: //temp fix for black screens during cut scenes
|
||||
bPhackvalue3 = 1;
|
||||
break;
|
||||
/* // Unused - kept for reference
|
||||
// Unused - kept for reference
|
||||
case PROJECTION_HACK_FINAL_FANTASY_CC_ECHO_OF_TIME:
|
||||
bPhackvalue1 = 1;
|
||||
fhackvalue1 = 0.8f;
|
||||
@ -124,13 +178,6 @@ void UpdateProjectionHack(int iPhackvalue)
|
||||
bProjHack1 = 1;
|
||||
break;
|
||||
*/
|
||||
}
|
||||
|
||||
// Set the projections hacks
|
||||
g_ProjHack0 = bProjHack1;
|
||||
g_ProjHack1 = ProjectionHack(bPhackvalue1 == 0 ? false : true, fhackvalue1);
|
||||
g_ProjHack2 = ProjectionHack(bPhackvalue2 == 0 ? false : true, fhackvalue2);
|
||||
g_ProjHack3 = ProjectionHack(bPhackvalue3,0);
|
||||
}
|
||||
|
||||
void VertexShaderManager::Init()
|
||||
@ -344,8 +391,8 @@ void VertexShaderManager::SetConstants()
|
||||
|
||||
g_fProjectionMatrix[8] = 0.0f;
|
||||
g_fProjectionMatrix[9] = 0.0f;
|
||||
g_fProjectionMatrix[10] = (g_ProjHack1.enabled ? -(g_ProjHack1.value + xfregs.rawProjection[4]) : xfregs.rawProjection[4]);
|
||||
g_fProjectionMatrix[11] = (g_ProjHack2.enabled ? -(g_ProjHack2.value + xfregs.rawProjection[5]) : xfregs.rawProjection[5]) + (g_ProjHack0 ? 0.1f : 0.0f);
|
||||
g_fProjectionMatrix[10] = (g_ProjHack1.value + xfregs.rawProjection[4]) * g_ProjHack1.sign;
|
||||
g_fProjectionMatrix[11] = (g_ProjHack2.value + xfregs.rawProjection[5]) * g_ProjHack2.sign;
|
||||
|
||||
g_fProjectionMatrix[12] = 0.0f;
|
||||
g_fProjectionMatrix[13] = 0.0f;
|
||||
@ -358,7 +405,7 @@ void VertexShaderManager::SetConstants()
|
||||
*/
|
||||
|
||||
g_fProjectionMatrix[14] = 0.0f;
|
||||
g_fProjectionMatrix[15] = (g_ProjHack3.enabled && xfregs.rawProjection[0] == 2.0f ? 0.0f : 1.0f); //causes either the efb copy or bloom layer not to show if proj hack enabled
|
||||
g_fProjectionMatrix[15] = (g_ProjHack3 && xfregs.rawProjection[0] == 2.0f ? 0.0f : 1.0f); //causes either the efb copy or bloom layer not to show if proj hack enabled
|
||||
|
||||
SETSTAT_FT(stats.g2proj_0, g_fProjectionMatrix[0]);
|
||||
SETSTAT_FT(stats.g2proj_1, g_fProjectionMatrix[1]);
|
||||
|
@ -20,26 +20,16 @@
|
||||
|
||||
#include "VertexShaderGen.h"
|
||||
|
||||
enum
|
||||
{
|
||||
PROJECTION_HACK_NONE = 0,
|
||||
PROJECTION_HACK_ZELDA_TP_BLOOM_HACK = 1,
|
||||
PROJECTION_HACK_SONIC_AND_THE_BLACK_KNIGHT = 2,
|
||||
PROJECTION_HACK_BLEACH_VERSUS_CRUSADE = 3,
|
||||
PROJECTION_HACK_SKIES_OF_ARCADIA = 4,
|
||||
PROJECTION_HACK_METROID_OTHER_M = 5,
|
||||
};
|
||||
|
||||
struct ProjectionHack
|
||||
{
|
||||
bool enabled;
|
||||
float sign;
|
||||
float value;
|
||||
ProjectionHack() { }
|
||||
ProjectionHack(bool new_enabled, float new_value)
|
||||
: enabled(new_enabled), value(new_value) {}
|
||||
ProjectionHack(float new_sign, float new_value)
|
||||
: sign(new_sign), value(new_value) {}
|
||||
};
|
||||
|
||||
void UpdateProjectionHack(int hackIdx);
|
||||
void UpdateProjectionHack(int iParams[], std::string sParams[]);
|
||||
|
||||
// The non-API dependent parts.
|
||||
class VertexShaderManager
|
||||
|
@ -110,7 +110,6 @@ void VideoConfig::Load(const char *ini_file)
|
||||
iniFile.Get("Hacks", "EFBScaledCopy", &bCopyEFBScaled, true);
|
||||
iniFile.Get("Hacks", "EFBCopyCacheEnable", &bEFBCopyCacheEnable, false);
|
||||
iniFile.Get("Hacks", "EFBEmulateFormatChanges", &bEFBEmulateFormatChanges, true);
|
||||
iniFile.Get("Hacks", "ProjectionHack", &iPhackvalue, 0);
|
||||
|
||||
iniFile.Get("Hardware", "Adapter", &iAdapter, 0);
|
||||
if (iAdapter == -1)
|
||||
@ -159,7 +158,17 @@ void VideoConfig::GameIniLoad(const char *ini_file)
|
||||
if (iniFile.Exists("Video", "UseRealXFB"))
|
||||
iniFile.Get("Video", "UseRealXFB", &bUseRealXFB);
|
||||
if (iniFile.Exists("Video", "ProjectionHack"))
|
||||
iniFile.Get("Video", "ProjectionHack", &iPhackvalue);
|
||||
iniFile.Get("Video", "ProjectionHack", &iPhackvalue[0], 0);
|
||||
if (iniFile.Exists("Video", "PH_SZNear"))
|
||||
iniFile.Get("Video", "PH_SZNear", &iPhackvalue[1], 0);
|
||||
if (iniFile.Exists("Video", "PH_SZFar"))
|
||||
iniFile.Get("Video", "PH_SZFar", &iPhackvalue[2], 0);
|
||||
if (iniFile.Exists("Video", "PH_ExtraParam"))
|
||||
iniFile.Get("Video", "PH_ExtraParam", &iPhackvalue[3], 0);
|
||||
if (iniFile.Exists("Video", "PH_ZNear"))
|
||||
iniFile.Get("Video", "PH_ZNear", &sPhackvalue[0], "");
|
||||
if (iniFile.Exists("Video", "PH_ZFar"))
|
||||
iniFile.Get("Video", "PH_ZFar", &sPhackvalue[1], "");
|
||||
if (iniFile.Exists("Video", "UseNativeMips"))
|
||||
iniFile.Get("Video", "UseNativeMips", &bUseNativeMips);
|
||||
if (iniFile.Exists("Video", "ZTPSpeedupHack"))
|
||||
@ -228,7 +237,6 @@ void VideoConfig::Save(const char *ini_file)
|
||||
iniFile.Set("Hacks", "EFBScaledCopy", bCopyEFBScaled);
|
||||
iniFile.Set("Hacks", "EFBCopyCacheEnable", bEFBCopyCacheEnable);
|
||||
iniFile.Set("Hacks", "EFBEmulateFormatChanges", bEFBEmulateFormatChanges);
|
||||
iniFile.Set("Hacks", "ProjectionHack", iPhackvalue);
|
||||
|
||||
iniFile.Set("Hardware", "Adapter", iAdapter);
|
||||
|
||||
|
@ -121,15 +121,12 @@ struct VideoConfig
|
||||
bool bEFBCopyCacheEnable;
|
||||
bool bEFBEmulateFormatChanges;
|
||||
bool bOSDHotKey;
|
||||
bool bHack;
|
||||
bool bCopyEFBToTexture;
|
||||
bool bCopyEFBScaled;
|
||||
bool bSafeTextureCache;
|
||||
int iSafeTextureCache_ColorSamples;
|
||||
int iPhackvalue;
|
||||
bool bPhackvalue1, bPhackvalue2;
|
||||
float fhackvalue1, fhackvalue2;
|
||||
bool bProjHack1;
|
||||
int iPhackvalue[4];
|
||||
std::string sPhackvalue[2];
|
||||
float fAspectRatioHackW, fAspectRatioHackH;
|
||||
bool bZTPSpeedHack; // The Legend of Zelda: Twilight Princess
|
||||
bool bEnablePixelLigting;
|
||||
|
Reference in New Issue
Block a user