GFX: updated Dates, code formatting cleanup, code cleanup / organization, some unknown BPs uncovered, fixed OGL's config dialog bug, added another shader

DSPHLE: Some warning fixes and added some logging for unknown voice cases
Please report if anything has broken.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3884 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
omegadox
2009-07-26 09:52:35 +00:00
parent e79b11af5b
commit e4a9faeba4
57 changed files with 1139 additions and 955 deletions

View File

@ -47,7 +47,7 @@ void FlushPipeline()
{
VertexManager::Flush();
}
void SetGenerationMode(const Bypass &bp)
void SetGenerationMode(const BPCmd &bp)
{
// none, ccw, cw, ccw
if (bpmem.genMode.cullmode > 0)
@ -60,13 +60,13 @@ void SetGenerationMode(const Bypass &bp)
}
void SetScissor(const Bypass &bp)
void SetScissor(const BPCmd &bp)
{
if (!Renderer::SetScissorRect())
if (bp.address == BPMEM_SCISSORBR)
ERROR_LOG(VIDEO, "bad scissor!");
}
void SetLineWidth(const Bypass &bp)
void SetLineWidth(const BPCmd &bp)
{
float fratio = xfregs.rawViewport[0] != 0 ? ((float)Renderer::GetTargetWidth() / EFB_WIDTH) : 1.0f;
if (bpmem.lineptwidth.linesize > 0)
@ -74,7 +74,7 @@ void SetLineWidth(const Bypass &bp)
if (bpmem.lineptwidth.pointsize > 0)
glPointSize((float)bpmem.lineptwidth.pointsize * fratio / 6.0f);
}
void SetDepthMode(const Bypass &bp)
void SetDepthMode(const BPCmd &bp)
{
if (bpmem.zmode.testenable)
{
@ -89,18 +89,18 @@ void SetDepthMode(const Bypass &bp)
glDepthMask(GL_FALSE);
}
}
void SetBlendMode(const Bypass &bp)
void SetBlendMode(const BPCmd &bp)
{
Renderer::SetBlendMode(false);
}
void SetDitherMode(const Bypass &bp)
void SetDitherMode(const BPCmd &bp)
{
if (bpmem.blendmode.dither)
glEnable(GL_DITHER);
else
glDisable(GL_DITHER);
}
void SetLogicOpMode(const Bypass &bp)
void SetLogicOpMode(const BPCmd &bp)
{
if (bpmem.blendmode.logicopenable)
{
@ -111,12 +111,12 @@ void SetLogicOpMode(const Bypass &bp)
glDisable(GL_COLOR_LOGIC_OP);
}
void SetColorMask(const Bypass &bp)
void SetColorMask(const BPCmd &bp)
{
Renderer::SetColorMask();
}
void CopyEFB(const Bypass &bp, const EFBRectangle &rc, const u32 &address, const bool &fromZBuffer, const bool &isIntensityFmt, const u32 &copyfmt, const bool &scaleByHalf)
void CopyEFB(const BPCmd &bp, const EFBRectangle &rc, const u32 &address, const bool &fromZBuffer, const bool &isIntensityFmt, const u32 &copyfmt, const bool &scaleByHalf)
{
// bpmem.zcontrol.pixel_format to PIXELFMT_Z24 is when the game wants to copy from ZBuffer (Zbuffer uses 24-bit Format)
if (!g_Config.bEFBCopyDisable)
@ -126,12 +126,12 @@ void CopyEFB(const Bypass &bp, const EFBRectangle &rc, const u32 &address, const
TextureMngr::CopyRenderTargetToTexture(address, fromZBuffer, isIntensityFmt, copyfmt, scaleByHalf, rc);
}
void RenderToXFB(const Bypass &bp, const EFBRectangle &rc, const float &yScale, const float &xfbLines, u32 xfbAddr, const u32 &dstWidth, const u32 &dstHeight)
void RenderToXFB(const BPCmd &bp, const EFBRectangle &rc, const float &yScale, const float &xfbLines, u32 xfbAddr, const u32 &dstWidth, const u32 &dstHeight)
{
Renderer::RenderToXFB(xfbAddr, dstWidth, dstHeight, rc);
}
void ClearScreen(const Bypass &bp, const EFBRectangle &rc)
void ClearScreen(const BPCmd &bp, const EFBRectangle &rc)
{
bool colorEnable = bpmem.blendmode.colorupdate;
bool alphaEnable = (bpmem.zcontrol.pixel_format == PIXELFMT_RGBA6_Z24 && bpmem.blendmode.alphaupdate);
@ -146,7 +146,7 @@ void ClearScreen(const Bypass &bp, const EFBRectangle &rc)
}
}
void RestoreRenderState(const Bypass &bp)
void RestoreRenderState(const BPCmd &bp)
{
Renderer::RestoreGLState();
}
@ -170,11 +170,11 @@ u8 *GetPointer(const u32 &address)
{
return g_VideoInitialize.pGetMemoryPointer(address);
}
void SetSamplerState(const Bypass &bp)
void SetSamplerState(const BPCmd &bp)
{
// TODO
}
void SetInterlacingMode(const Bypass &bp)
void SetInterlacingMode(const BPCmd &bp)
{
// TODO
}

View File

@ -54,7 +54,6 @@ void Config::Load()
iniFile.Get("Settings", "SafeTextureCache", &bSafeTextureCache, false); // Settings
iniFile.Get("Settings", "ShowFPS", &bShowFPS, false); // Settings
iniFile.Get("Settings", "OverlayStats", &bOverlayStats, false);
iniFile.Get("Settings", "OverlayBlendStats", &bOverlayBlendStats, false);
iniFile.Get("Settings", "OverlayProjStats", &bOverlayProjStats, false);
iniFile.Get("Settings", "ShowEFBCopyRegions", &bShowEFBCopyRegions, false);
iniFile.Get("Settings", "DLOptimize", &iCompileDLsLevel, 0);
@ -148,7 +147,6 @@ void Config::Save()
iniFile.Set("Settings", "SafeTextureCache", bSafeTextureCache);
iniFile.Set("Settings", "ShowFPS", bShowFPS);
iniFile.Set("Settings", "OverlayStats", bOverlayStats);
iniFile.Set("Settings", "OverlayBlendStats", bOverlayBlendStats);
iniFile.Set("Settings", "OverlayProjStats", bOverlayProjStats);
iniFile.Set("Settings", "DLOptimize", iCompileDLsLevel);
iniFile.Set("Settings", "Show", iCompileDLsLevel);

View File

@ -73,7 +73,6 @@ struct Config
// Information
bool bShowFPS;
bool bOverlayStats;
bool bOverlayBlendStats;
bool bOverlayProjStats;
bool bTexFmtOverlayEnable;
bool bTexFmtOverlayCenter;

View File

@ -56,7 +56,6 @@ BEGIN_EVENT_TABLE(GFXConfigDialogOGL,wxDialog)
EVT_CHECKBOX(ID_WIREFRAME, GFXConfigDialogOGL::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_SHOWFPS, GFXConfigDialogOGL::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_STATISTICS, GFXConfigDialogOGL::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_BLENDSTATS, GFXConfigDialogOGL::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_PROJSTATS, GFXConfigDialogOGL::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_SHOWEFBCOPYREGIONS, GFXConfigDialogOGL::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_SHADERERRORS, GFXConfigDialogOGL::AdvancedSettingsChanged)
@ -100,9 +99,7 @@ GFXConfigDialogOGL::~GFXConfigDialogOGL()
}
void GFXConfigDialogOGL::OnClose(wxCloseEvent& event)
{
g_Config.Save();
INFO_LOG(CONSOLE, "OnClose");
//INFO_LOG(CONSOLE, "OnClose");
// notice that we don't run wxEntryCleanup(); here so the dll will still be loaded
/* JP: Yes, it seems like Close() does not do that. It only runs EndModal() or something
@ -113,18 +110,20 @@ void GFXConfigDialogOGL::OnClose(wxCloseEvent& event)
//EndModal(0);
// Allow wxWidgets to close and unload the window
event.Skip();
//event.Skip();
CloseWindow();
}
void GFXConfigDialogOGL::CloseClick(wxCommandEvent& WXUNUSED (event))
{
INFO_LOG(CONSOLE, "CloseClick");
//INFO_LOG(CONSOLE, "CloseClick");
// If we run wxEntryCleanup() the class will be entirely deleted, and the destructor will be run
//g_Config.Save();
//wxEntryCleanup();
Close();
//Close();
CloseWindow();
}
///////////////////////////////
@ -354,8 +353,6 @@ void GFXConfigDialogOGL::CreateGUIControls()
m_ShowFPS->SetValue(g_Config.bShowFPS);
m_Statistics = new wxCheckBox(m_PageAdvanced, ID_STATISTICS, wxT("Overlay some statistics"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_Statistics->SetValue(g_Config.bOverlayStats);
m_BlendStats = new wxCheckBox(m_PageAdvanced, ID_BLENDSTATS, wxT("Overlay Blend Stats"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_BlendStats->SetValue(g_Config.bOverlayBlendStats);
m_ProjStats = new wxCheckBox(m_PageAdvanced, ID_PROJSTATS, wxT("Overlay Projection Stats"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_ProjStats->SetValue(g_Config.bOverlayProjStats);
m_ShowEFBCopyRegions = new wxCheckBox(m_PageAdvanced, ID_SHOWEFBCOPYREGIONS, wxT("Show EFB Copy Regions"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
@ -463,11 +460,10 @@ void GFXConfigDialogOGL::CreateGUIControls()
sInfo->Add(m_ShowFPS, wxGBPosition(0, 0), wxGBSpan(1, 2), wxALL, 5);
sInfo->Add(m_ShaderErrors, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALL, 5);
sInfo->Add(m_Statistics, wxGBPosition(2, 0), wxGBSpan(1, 2), wxALL, 5);
sInfo->Add(m_BlendStats, wxGBPosition(3, 0), wxGBSpan(1, 2), wxALL, 5);
sInfo->Add(m_ProjStats, wxGBPosition(4, 0), wxGBSpan(1, 2), wxALL, 5);
sInfo->Add(m_ShowEFBCopyRegions, wxGBPosition(5, 0), wxGBSpan(1, 2), wxALL, 5);
sInfo->Add(m_TexFmtOverlay, wxGBPosition(6, 0), wxGBSpan(1, 1), wxALL, 5);
sInfo->Add(m_TexFmtCenter, wxGBPosition(6, 1), wxGBSpan(1, 1), wxALL, 5);
sInfo->Add(m_ProjStats, wxGBPosition(3, 0), wxGBSpan(1, 2), wxALL, 5);
sInfo->Add(m_ShowEFBCopyRegions, wxGBPosition(4, 0), wxGBSpan(1, 2), wxALL, 5);
sInfo->Add(m_TexFmtOverlay, wxGBPosition(5, 0), wxGBSpan(1, 1), wxALL, 5);
sInfo->Add(m_TexFmtCenter, wxGBPosition(5, 1), wxGBSpan(1, 1), wxALL, 5);
sbInfo->Add(sInfo);
wxBoxSizer *sRenderBoxRow1 = new wxBoxSizer(wxHORIZONTAL);
@ -711,9 +707,6 @@ void GFXConfigDialogOGL::AdvancedSettingsChanged(wxCommandEvent& event)
TextureMngr::ClearRenderTargets();
g_Config.bCopyEFBToRAM = false;
break;
case ID_BLENDSTATS:
g_Config.bOverlayBlendStats = m_BlendStats->IsChecked();
break;
case ID_PROJSTATS:
g_Config.bOverlayProjStats = m_ProjStats->IsChecked();
break;
@ -725,6 +718,13 @@ void GFXConfigDialogOGL::AdvancedSettingsChanged(wxCommandEvent& event)
UpdateGUI();
}
void GFXConfigDialogOGL::CloseWindow()
{
// Save the config to INI
g_Config.Save();
EndModal(1);
}
void GFXConfigDialogOGL::UpdateGUI()
{

View File

@ -113,7 +113,6 @@ class GFXConfigDialogOGL : public wxDialog
wxCheckBox *m_ShowFPS;
wxCheckBox *m_ShaderErrors;
wxCheckBox *m_Statistics;
wxCheckBox *m_BlendStats;
wxCheckBox *m_ProjStats;
wxCheckBox *m_ShowEFBCopyRegions;
wxCheckBox *m_TexFmtOverlay;
@ -171,7 +170,6 @@ class GFXConfigDialogOGL : public wxDialog
ID_SHOWFPS,
ID_SHADERERRORS,
ID_STATISTICS,
ID_BLENDSTATS,
ID_PROJSTATS,
ID_SHOWEFBCOPYREGIONS,
ID_TEXFMTOVERLAY,
@ -213,7 +211,8 @@ class GFXConfigDialogOGL : public wxDialog
void ReloadShaderClick(wxCommandEvent& event);
void EditShaderClick(wxCommandEvent& event);
void GeneralSettingsChanged(wxCommandEvent& event);
void AdvancedSettingsChanged(wxCommandEvent& event);
void AdvancedSettingsChanged(wxCommandEvent& event);
void CloseWindow();
};
#endif // _OGL_CONFIGDIALOG_H_

View File

@ -67,7 +67,7 @@ Make AA apply instantly during gameplay if possible
GFXConfigDialogOGL *m_ConfigFrame = NULL;
#include "Debugger/Debugger.h"
GFXDebuggerOGL *m_DebuggerFrame = NULL;
#endif
#endif // HAVE_WX
#include "Config.h"
#include "LookUpTables.h"
@ -97,6 +97,8 @@ GFXDebuggerOGL *m_DebuggerFrame = NULL;
SVideoInitialize g_VideoInitialize;
PLUGIN_GLOBALS* globals = NULL;
bool allowConfigShow = true;
// Logging
int GLScissorX, GLScissorY, GLScissorW, GLScissorH;
@ -108,6 +110,10 @@ static Common::Event s_swapResponseEvent;
static volatile u32 s_efbAccessRequested = false;
static Common::Event s_efbResponseEvent;
#if defined(HAVE_WX) && HAVE_WX
#endif // HAVE_WX
void GetDllInfo (PLUGIN_INFO* _PluginInfo)
{
@ -169,13 +175,17 @@ void DllDebugger(HWND _hParent, bool Show) { }
void DllConfig(HWND _hParent)
{
#if defined(HAVE_WX) && HAVE_WX
if (!m_ConfigFrame)
m_ConfigFrame = new GFXConfigDialogOGL(GetParentedWxWindow(_hParent));
else if (!m_ConfigFrame->GetParent()->IsShown())
m_ConfigFrame->Close(true);
//if (!m_ConfigFrame)
if (allowConfigShow) // Prevent user to show more than 1 config window at same time
{
m_ConfigFrame = new GFXConfigDialogOGL(GetParentedWxWindow(_hParent));
//else if (!m_ConfigFrame->GetParent()->IsShown())
// m_ConfigFrame->Close(true);
#if defined(_WIN32)
// Search for avaliable resolutions
DWORD iModeNum = 0;
@ -294,13 +304,16 @@ void DllConfig(HWND _hParent)
}
// Only allow one open at a time
if (!m_ConfigFrame->IsShown())
{
//if (!m_ConfigFrame->IsShown())
//{
allowConfigShow = false;
m_ConfigFrame->CreateGUIControls();
m_ConfigFrame->ShowModal();
}
else
m_ConfigFrame->Hide();
allowConfigShow = m_ConfigFrame->ShowModal() == 1 ? true : false;
}
//}
//else
// m_ConfigFrame->Hide();
#endif
}