[VIdeo] Add trace settings

This commit is contained in:
zilmar 2017-04-18 22:03:49 +10:00
parent 0c1c5e39af
commit e400d42ff6
11 changed files with 314 additions and 45 deletions

View File

@ -50,22 +50,29 @@
#include "trace.h"
#include "ScreenResolution.h"
#include <Common/StdString.h>
#include <Settings/Settings.h>
#include "SettingsID.h"
#ifdef _WIN32
#include <Common/CriticalSection.h>
#include "resource.h"
#pragma warning(push)
#pragma warning(disable : 4091) // warning C4091: 'typedef ': ignored on left of 'tagGPFIDL_FLAGS' when no variable is declared
#pragma warning(disable : 4302) // warning C4302: 'type cast': truncation from 'LPCTSTR' to 'WORD'
#pragma warning(disable : 4458) // warning C4458: declaration of 'dwCommonButtons' hides class member
#pragma warning(disable : 4838) // warning C4838: conversion from 'int' to 'UINT' requires a narrowing conversion
#pragma warning(disable : 4996) // warning C4996: 'GetVersionExA': was declared deprecated
#pragma warning(disable : 4302) // warning C4302: 'type cast': truncation from 'LPCTSTR' to 'WORD'
#define _ATL_DISABLE_NOTHROW_NEW
#include <atlbase.h>
#pragma warning(push)
#pragma warning(disable : 4996) // warning C4996: 'GetVersionExA': was declared deprecated
#include <wtl/atlapp.h>
#pragma warning(pop)
#include <atlwin.h>
#include <wtl/atldlgs.h>
#include <wtl/atlctrls.h>
#include <wtl/atlcrack.h>
#pragma warning(pop)
extern HINSTANCE hinstDLL;
extern bool g_ghq_use;
@ -88,9 +95,9 @@ public:
CGlide64WtlModule * WtlModule = NULL;
void ConfigInit(HINSTANCE hinst)
void ConfigInit(void * hinst)
{
WtlModule = new CGlide64WtlModule(hinst);
WtlModule = new CGlide64WtlModule((HINSTANCE)hinst);
}
void ConfigCleanup(void)
@ -104,7 +111,6 @@ void ConfigCleanup(void)
#endif
void CloseConfig();
#ifdef _WIN32
@ -114,7 +120,7 @@ class CToolTipDialog
{
// Data declarations and members
public:
TT& GetTT(){ return m_TT; }
TT& GetTT() { return m_TT; }
protected:
TT m_TT;
UINT m_uTTStyle;
@ -229,6 +235,7 @@ void SetComboBoxIndex(CComboBox & cmb, uint32_t data)
class CConfigBasicPage;
class CConfigEmuSettings;
class CDebugSettings;
class CConfigTextureEnhancement;
class COptionsSheet : public CPropertySheetImpl < COptionsSheet >
@ -249,6 +256,7 @@ private:
// Property pages
CConfigBasicPage * m_pgBasicPage;
CConfigEmuSettings * m_pgEmuSettings;
CDebugSettings * m_pgDebugSettings;
CConfigTextureEnhancement * m_pgTextureEnhancement;
HPROPSHEETPAGE m_hTextureEnhancement;
};
@ -281,7 +289,7 @@ public:
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
TTInit();
TTSize(400);
TTSize(400);
m_WindowRes.Attach(GetDlgItem(IDC_CMB_WINDOW_RES));
for (uint32_t i = 0, n = GetScreenResolutionCount(); i < n; i++)
{
@ -316,7 +324,7 @@ public:
m_cbxFBO.Attach(GetDlgItem(IDC_CHK_USE_FRAME_BUFFER_OBJECT));
TTSetTxt(IDC_CHK_USE_FRAME_BUFFER_OBJECT, "Use frame buffer objects:\n\nChanges the way FB effects are rendered - with or without usage of the OpenGL Frame Buffer Objects (FBO) extension.\nThe choice depends on game and your video card. FBO off is good for NVIDIA cards, while for ATI cards, it's usually best that FBOs are turned on.\nAlso, some FB effects works only with one of the methods, no matter, which card you have.\nOn the whole, with FBO off, compatibility/ accuracy is a bit better (which is the case for Resident Evil 2).\nHowever, with FBO on with some systems, it can actually be a bit faster in cases.\n\n[Recommended: video card and game dependant]");
m_cbxFBO.SetCheck(g_settings->wrpFBO() > 0 ? BST_CHECKED : BST_UNCHECKED);
m_cbxFBO.SetCheck(g_settings->wrpFBO() ? BST_CHECKED : BST_UNCHECKED);
m_cbxVRAM.Attach(GetDlgItem(IDC_CHK_AUTODETECT_VRAM));
TTSetTxt(IDC_CHK_AUTODETECT_VRAM, "Autodetect VRAM Size:\n\nSince OpenGL cannot do this reliably at the moment, the option to set this manually is available.\nIf checked, plugin will try to autodetect VRAM size.\nBut if this appears wrong, please uncheck and set it to correct value.\n\n[Recommended: on]");
@ -361,7 +369,7 @@ private:
void AutoDetectChanged(void)
{
m_spinVRAM.SetWindowText(m_cbxVRAM.GetCheck() == BST_CHECKED ? " auto" : stdstr_f("%d",g_settings->wrpVRAM() != 0 ? g_settings->wrpVRAM() : 32).c_str());
m_spinVRAM.SetWindowText(m_cbxVRAM.GetCheck() == BST_CHECKED ? " auto" : stdstr_f("%d", g_settings->wrpVRAM() != 0 ? g_settings->wrpVRAM() : 32).c_str());
m_spinVRAM.EnableWindow(m_cbxVRAM.GetCheck() != BST_CHECKED);
m_VramSize.EnableWindow(m_cbxVRAM.GetCheck() != BST_CHECKED);
m_lblMb.EnableWindow(m_cbxVRAM.GetCheck() != BST_CHECKED);
@ -408,7 +416,7 @@ public:
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
TTInit();
TTSize(400);
TTSize(400);
if (g_romopen)
{
@ -461,7 +469,7 @@ public:
tooltip = "Fog enabled:\n\nSets fog emulation on//off.\n\n[Recommended: on]";
TTSetTxt(IDC_CHK_FOG, tooltip.c_str());
m_cbxFog.Attach(GetDlgItem(IDC_CHK_FOG));
m_cbxFog.SetCheck(g_settings->fog() > 0 ? BST_CHECKED : BST_UNCHECKED);
m_cbxFog.SetCheck(g_settings->fog() ? BST_CHECKED : BST_UNCHECKED);
tooltip = "Buffer clear on every frame:\n\nForces the frame buffer to be cleared every frame drawn.\nUsually frame buffer clear is controlled by the game.\nHowever, in some cases it is not well emulated, and some garbage may be left on the screen.\nIn such cases, this option must be set on.\n\n[Recommended: on]";
TTSetTxt(IDC_CHK_BUFFER_CLEAR, tooltip.c_str());
@ -473,7 +481,7 @@ public:
m_cbxFBEnable.SetCheck(g_settings->fb_emulation_enabled() ? BST_CHECKED : BST_UNCHECKED);
m_cbxFBHWFBE.Attach(GetDlgItem(IDC_CHK_HARDWARE_FRAMEBUFFER));
TTSetTxt(IDC_CHK_HARDWARE_FRAMEBUFFER, "Enable hardware frame buffer emulation:\n\nIf this option is on, plugin will create auxiliary frame buffers in video memory instead of copying frame buffer content into main memory.\nThis allows plugin to run frame buffer effects without slowdown and without scaling image down to N64's native resolution.\nThis feature is fully supported by Voodoo 4/5 cards and partially by Voodoo3 and Banshee. Modern cards also fully support it.\n\n[Recommended: on, if supported by your hardware]");
TTSetTxt(IDC_CHK_HARDWARE_FRAMEBUFFER, "Enable hardware frame buffer emulation:\n\nIf this option is on, plugin will create auxiliary frame buffers in video memory instead of copying frame buffer content into main memory.\nThis allows plugin to run frame buffer effects without slowdown and without scaling image down to N64's native resolution.\nModern cards also fully support it.\n\n[Recommended: on, if supported by your hardware]");
m_cbxFBHWFBE.SetCheck(g_settings->fb_hwfbe_set() ? BST_CHECKED : BST_UNCHECKED);
m_cbxFBGetFBI.Attach(GetDlgItem(IDC_CHK_GET_FRAMEBUFFER));
@ -564,6 +572,121 @@ private:
CButton m_cbxFBDepthBuffer;
};
class CDebugSettings :
public CPropertyPageImpl<CDebugSettings>,
public CToolTipDialog<CDebugSettings>
{
public:
enum { IDD = IDD_DEBUG_SETTINGS };
BEGIN_MSG_MAP(CDebugSettings)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
COMMAND_HANDLER_EX(IDC_CMB_TRACE_SETTINGS, CBN_SELCHANGE, ItemChanged)
COMMAND_HANDLER_EX(IDC_CMB_TRACE_UNKNOWN, CBN_SELCHANGE, ItemChanged)
COMMAND_HANDLER_EX(IDC_CMB_TRACE_GLIDE64, CBN_SELCHANGE, ItemChanged)
COMMAND_HANDLER_EX(IDC_CMB_TRACE_INTERFACE, CBN_SELCHANGE, ItemChanged)
COMMAND_HANDLER_EX(IDC_CMB_TRACE_RESOLUTION, CBN_SELCHANGE, ItemChanged)
COMMAND_HANDLER_EX(IDC_CMB_TRACE_GLITCH, CBN_SELCHANGE, ItemChanged)
COMMAND_HANDLER_EX(IDC_CMB_TRACE_RDP, CBN_SELCHANGE, ItemChanged)
COMMAND_HANDLER_EX(IDC_CMB_TRACE_TLUT, CBN_SELCHANGE, ItemChanged)
COMMAND_HANDLER_EX(IDC_CMB_TRACE_PNG, CBN_SELCHANGE, ItemChanged)
COMMAND_HANDLER_EX(IDC_CMB_TRACE_OGLWRAPPER, CBN_SELCHANGE, ItemChanged)
CHAIN_MSG_MAP(CToolTipDialog<CDebugSettings>)
CHAIN_MSG_MAP(CPropertyPageImpl<CDebugSettings>)
END_MSG_MAP()
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
TTInit();
TTSize(400);
m_cmbTraceSettings.Attach(GetDlgItem(IDC_CMB_TRACE_SETTINGS));
m_cmbTraceUnknown.Attach(GetDlgItem(IDC_CMB_TRACE_UNKNOWN));
m_cmbTraceGlide64.Attach(GetDlgItem(IDC_CMB_TRACE_GLIDE64));
m_cmbTraceInterface.Attach(GetDlgItem(IDC_CMB_TRACE_INTERFACE));
m_cmbTraceresolution.Attach(GetDlgItem(IDC_CMB_TRACE_RESOLUTION));
m_cmbTraceGlitch.Attach(GetDlgItem(IDC_CMB_TRACE_GLITCH));
m_cmbTraceRDP.Attach(GetDlgItem(IDC_CMB_TRACE_RDP));
m_cmbTraceTLUT.Attach(GetDlgItem(IDC_CMB_TRACE_TLUT));
m_cmbTracePNG.Attach(GetDlgItem(IDC_CMB_TRACE_PNG));
m_cmbTraceOGLWrapper.Attach(GetDlgItem(IDC_CMB_TRACE_OGLWRAPPER));
m_cmbTraceRDPCommands.Attach(GetDlgItem(IDC_CMB_TRACE_RDP_COMMANDS));
struct {
CComboBox & cmb;
uint16_t SettingId;
} TraceCMB[] =
{
{ m_cmbTraceSettings, Set_Logging_Settings },
{ m_cmbTraceUnknown, Set_Logging_Unknown },
{ m_cmbTraceGlide64, Set_Logging_Glide64 },
{ m_cmbTraceInterface, Set_Logging_Interface },
{ m_cmbTraceresolution, Set_Logging_Resolution },
{ m_cmbTraceGlitch, Set_Logging_Glitch },
{ m_cmbTraceRDP, Set_Logging_VideoRDP },
{ m_cmbTraceTLUT, Set_Logging_TLUT },
{ m_cmbTracePNG, Set_Logging_PNG },
{ m_cmbTraceOGLWrapper, Set_Logging_OGLWrapper },
{ m_cmbTraceRDPCommands, Set_Logging_RDPCommands },
};
for (size_t i = 0, n = sizeof(TraceCMB) / sizeof(TraceCMB[0]); i < n; i++)
{
TraceCMB[i].cmb.SetItemData(TraceCMB[i].cmb.AddString("Error"), TraceError);
TraceCMB[i].cmb.SetItemData(TraceCMB[i].cmb.AddString("Warning"), TraceWarning);
TraceCMB[i].cmb.SetItemData(TraceCMB[i].cmb.AddString("Notice"), TraceNotice);
TraceCMB[i].cmb.SetItemData(TraceCMB[i].cmb.AddString("Info"), TraceInfo);
TraceCMB[i].cmb.SetItemData(TraceCMB[i].cmb.AddString("Debug"), TraceDebug);
TraceCMB[i].cmb.SetItemData(TraceCMB[i].cmb.AddString("Verbose"), TraceVerbose);
SetComboBoxIndex(TraceCMB[i].cmb, (uint32_t)GetSetting(TraceCMB[i].SettingId));
}
return TRUE;
}
bool OnApply()
{
struct {
CComboBox & cmb;
uint16_t SettingId;
} TraceCMB[] =
{
{ m_cmbTraceSettings, Set_Logging_Settings },
{ m_cmbTraceUnknown, Set_Logging_Unknown },
{ m_cmbTraceGlide64, Set_Logging_Glide64 },
{ m_cmbTraceInterface, Set_Logging_Interface },
{ m_cmbTraceresolution, Set_Logging_Resolution },
{ m_cmbTraceGlitch, Set_Logging_Glitch },
{ m_cmbTraceRDP, Set_Logging_VideoRDP },
{ m_cmbTraceTLUT, Set_Logging_TLUT },
{ m_cmbTracePNG, Set_Logging_PNG },
{ m_cmbTraceOGLWrapper, Set_Logging_OGLWrapper },
{ m_cmbTraceRDPCommands, Set_Logging_RDPCommands },
};
for (size_t i = 0, n = sizeof(TraceCMB) / sizeof(TraceCMB[0]); i < n; i++)
{
SetSetting(TraceCMB[i].SettingId, TraceCMB[i].cmb.GetItemData(TraceCMB[i].cmb.GetCurSel()));
}
return true;
}
private:
void ItemChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
{
SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0);
}
CComboBox m_cmbTraceSettings;
CComboBox m_cmbTraceUnknown;
CComboBox m_cmbTraceGlide64;
CComboBox m_cmbTraceInterface;
CComboBox m_cmbTraceresolution;
CComboBox m_cmbTraceGlitch;
CComboBox m_cmbTraceRDP;
CComboBox m_cmbTraceTLUT;
CComboBox m_cmbTracePNG;
CComboBox m_cmbTraceOGLWrapper;
CComboBox m_cmbTraceRDPCommands;
};
class CConfigTextureEnhancement :
public CPropertyPageImpl<CConfigTextureEnhancement>,
public CToolTipDialog < CConfigTextureEnhancement >
@ -580,7 +703,7 @@ public:
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
TTInit();
TTSize(400);
TTSize(400);
std::string tooltip = "Filters:\n\nApply a filter to either smooth or sharpen textures.\nThere are 4 different smoothing filters and 2 different sharpening filters.\nThe higher the number, the stronger the effect,\ni.e. \"Smoothing filter 4\" will have a much more noticeable effect than \"Smoothing filter 1\".\nBe aware that performance may have an impact depending on the game and/or the PC.\n\n[Recommended: your preference]";
TTSetTxt(IDC_TXT_ENH_FILTER, tooltip.c_str());
@ -633,20 +756,20 @@ public:
TTSetTxt(IDC_CHK_IGNORE_BACKGROUND, "Ignore Backgrounds:\n\nIt is used to skip enhancement for long narrow textures, usually used for backgrounds.\nThis may save texture memory greatly and increase performance.\n\n[Recommended: on (off for 'Store' mode)]");
m_cbxEnhIgnoreBG.Attach(GetDlgItem(IDC_CHK_IGNORE_BACKGROUND));
m_cbxEnhIgnoreBG.SetCheck(g_settings->ghq_enht_nobg() > 0 ? BST_CHECKED : BST_UNCHECKED);
m_cbxEnhIgnoreBG.SetCheck(g_settings->ghq_enht_nobg() ? BST_CHECKED : BST_UNCHECKED);
tooltip = "Texture compression:\n\nTextures will be compressed using selected texture compression method.\nThe overall compression ratio is about 1/6 for FXT1 and 1/4 for S3TC.\nIn addition to saving space on the texture cache, the space occupied on the GFX hardware's texture RAM, by the enhanced textures, will be greatly reduced.\nThis minimizes texture RAM usage, decreasing the number of texture swaps to the GFX hardware leading to performance gains.\nHowever, due to the nature of lossy compression of FXT1 and S3TC, using this option can sometimes lead to quality degradation of small size textures and color banding of gradient colored textures.\n\n[Recommended: off]";
TTSetTxt(IDC_CHK_TEX_COMPRESSION, tooltip.c_str());
TTSetTxt(IDC_CHK_HIRES_TEX_COMPRESSION, tooltip.c_str());
m_cbxEnhTexCompression.Attach(GetDlgItem(IDC_CHK_TEX_COMPRESSION));
m_cbxEnhTexCompression.SetCheck(g_settings->ghq_enht_cmpr() > 0 ? BST_CHECKED : BST_UNCHECKED);
m_cbxEnhTexCompression.SetCheck(g_settings->ghq_enht_cmpr() ? BST_CHECKED : BST_UNCHECKED);
m_cbxHrsTexCompression.Attach(GetDlgItem(IDC_CHK_HIRES_TEX_COMPRESSION));
m_cbxHrsTexCompression.SetCheck(g_settings->ghq_hirs_cmpr() ? BST_CHECKED : BST_UNCHECKED);
TTSetTxt(IDC_CHK_COMPRESS_CACHE, "Compress texture cache:\n\nMemory will be compressed so that more textures can be held in the texture cache.\nThe compression ratio varies with each texture, but 1/5 of the original size would be a modest approximation.\nThey will be decompressed on-the-fly, before being downloaded to the gfx hardware.\nThis option will still help save memory space even when using texture compression.\n\n[Recommended: on]");
m_cbxEnhCompressCache.Attach(GetDlgItem(IDC_CHK_COMPRESS_CACHE));
m_cbxEnhCompressCache.SetCheck(g_settings->ghq_enht_gz() > 0 ? BST_CHECKED : BST_UNCHECKED);
m_cbxEnhCompressCache.SetCheck(g_settings->ghq_enht_gz() ? BST_CHECKED : BST_UNCHECKED);
m_cbxHrsTile.Attach(GetDlgItem(IDC_CHK_TILE_TEX));
TTSetTxt(IDC_CHK_TILE_TEX, "Tile textures:\n\nWhen on, wide texture will be split on several tiles to fit in one 256-width texture.\nThis tiled texture takes much less video memory space and thus overall performance will increase.\nHowever, corresponding polygons must be split too, and this is not polished yet - various issues are possible, including black lines and polygons distortions.\n\n[Recommended: off]");
@ -654,15 +777,15 @@ public:
m_cbxHrsForce16.Attach(GetDlgItem(IDC_CHK_FORCE_16BPP_TEXT));
TTSetTxt(IDC_CHK_FORCE_16BPP_TEXT, "Force 16bpp textures:\n\nThe color of the textures will be reduced to 16bpp.\nThis is another space saver and performance enhancer.\nThis halves the space used on the texture cache and the GFX hardware's texture RAM.\nColor reduction is done so that the original quality is preserved as much as possible.\nDepending on the texture, this usually is hardly noticeable.\nSometimes though, it can be: skies are a good example.\n\n[Recommended: off]");
m_cbxHrsForce16.SetCheck(g_settings->ghq_hirs_f16bpp() > 0 ? BST_CHECKED : BST_UNCHECKED);
m_cbxHrsForce16.SetCheck(g_settings->ghq_hirs_f16bpp() ? BST_CHECKED : BST_UNCHECKED);
m_cbxHrsTexEdit.Attach(GetDlgItem(IDC_CHK_TEX_DUMP_EDIT));
TTSetTxt(IDC_CHK_TEX_DUMP_EDIT, "Texture dumping mode:\n\nIn this mode, you have that ability to dump textures on screen to the appropriate folder.\nYou can also reload textures while the game is running to see how they look instantly - big time saver!\n\nHotkeys:\n\"R\" reloads hires textures from the texture pack\n\"D\" toggles texture dumps on/off.");
m_cbxHrsTexEdit.SetCheck(g_settings->ghq_hirs_dump() > 0 ? BST_CHECKED : BST_UNCHECKED);
m_cbxHrsTexEdit.SetCheck(g_settings->ghq_hirs_dump() ? BST_CHECKED : BST_UNCHECKED);
m_cbxHrsAltCRC.Attach(GetDlgItem(IDC_CHK_ALT_CRC));
TTSetTxt(IDC_CHK_ALT_CRC, "Alternative CRC calculation:\n\nThis option enables emulation of a palette CRC calculation bug in RiceVideo.\nIf some textures are not loaded, try to set this option on/off.\n\n[Recommended: texture pack dependant, mostly on]");
m_cbxHrsAltCRC.SetCheck(g_settings->ghq_hirs_altcrc() > 0 ? BST_CHECKED : BST_UNCHECKED);
m_cbxHrsAltCRC.SetCheck(g_settings->ghq_hirs_altcrc() ? BST_CHECKED : BST_UNCHECKED);
if (g_settings->ghq_hirs_dump())
{
m_cbxHrsAltCRC.EnableWindow(false);
@ -670,15 +793,15 @@ public:
m_cbxHrsCompressCache.Attach(GetDlgItem(IDC_CHK_HRS_COMPRESS_CACHE));
TTSetTxt(IDC_CHK_HRS_COMPRESS_CACHE, "Compress texture cache:\n\nWhen game started, plugin loads all its hi-resolution textures into PC memory.\nSince hi-resolution textures are usually large, the whole pack can take hundreds megabytes of memory.\nCache compression allows save memory space greatly.\nTextures will be decompressed on-the-fly, before being downloaded to the gfx hardware.\nThis option will still help save memory space even when using texture compression.\n\n[Recommended: on]");
m_cbxHrsCompressCache.SetCheck(g_settings->ghq_hirs_gz() > 0 ? BST_CHECKED : BST_UNCHECKED);
m_cbxHrsCompressCache.SetCheck(g_settings->ghq_hirs_gz() ? BST_CHECKED : BST_UNCHECKED);
m_cbxHrsLetFly.Attach(GetDlgItem(IDC_CHK_USE_ALPHA_FULLY));
TTSetTxt(IDC_CHK_USE_ALPHA_FULLY, "Use Alpha channel fully:\n\nWhen this option is off, 16bit rgba textures will be loaded using RiceVideo style, with 1bit for alpha channel.\nWhen it is on, GlideHQ will check, how alpha channel is used by the hires texture, and select most appropriate format for it.\nThis gives texture designers freedom to play with alpha, as they need, regardless of format of original N64 texture.\nFor older and badly designed texture packs it can cause unwanted black borders.\n\n[Recommended: texture pack dependant]");
m_cbxHrsLetFly.SetCheck(g_settings->ghq_hirs_let_texartists_fly() > 0 ? BST_CHECKED : BST_UNCHECKED);
m_cbxHrsLetFly.SetCheck(g_settings->ghq_hirs_let_texartists_fly() ? BST_CHECKED : BST_UNCHECKED);
m_cbxSaveTexCache.Attach(GetDlgItem(IDC_CHK_TEX_CACHE_HD));
TTSetTxt(IDC_CHK_TEX_CACHE_HD, "Save texture cache to HD:\n\nFor enhanced textures cache:\nThis will save all previously loaded and enhanced textures to HD.\nSo upon next game launch, all the textures will be instantly loaded, resulting in smoother performance.\n\nFor high-resolution textures cache:\nAfter creation, loading hi-res texture will take only a few seconds upon game launch, as opposed to the 5 to 60 seconds a pack can take to load without this cache file.\nThe only downside here is upon any changes to the pack, the cache file will need to be manually deleted.\n\nSaved cache files go into a folder called \"Cache\" within the Textures folder.\n\n[Highly Recommended: on]");
m_cbxSaveTexCache.SetCheck(g_settings->ghq_cache_save() > 0 ? BST_CHECKED : BST_UNCHECKED);
m_cbxSaveTexCache.SetCheck(g_settings->ghq_cache_save() ? BST_CHECKED : BST_UNCHECKED);
return TRUE;
}
@ -738,6 +861,7 @@ private:
COptionsSheet::COptionsSheet(_U_STRINGorID /*title*/, UINT /*uStartPage*/, HWND /*hWndParent*/) :
m_pgBasicPage(new CConfigBasicPage(this)),
m_pgEmuSettings(new CConfigEmuSettings),
m_pgDebugSettings(new CDebugSettings),
m_pgTextureEnhancement(NULL),
m_hTextureEnhancement(0)
{
@ -746,6 +870,10 @@ COptionsSheet::COptionsSheet(_U_STRINGorID /*title*/, UINT /*uStartPage*/, HWND
{
AddPage(&m_pgEmuSettings->m_psp);
}
if (g_settings->debugger_enabled())
{
AddPage(&m_pgDebugSettings->m_psp);
}
UpdateTextureSettings();
}
@ -753,6 +881,7 @@ COptionsSheet::~COptionsSheet()
{
delete m_pgBasicPage;
delete m_pgEmuSettings;
delete m_pgDebugSettings;
delete m_pgTextureEnhancement;
}
@ -784,7 +913,7 @@ to allow the user to configure the dll
input: a handle to the window that calls this function
output: none
*******************************************************************/
void CALL DllConfig(HWND hParent)
void CALL DllConfig(void * hParent)
{
WriteTrace(TraceGlide64, TraceDebug, "-");
#ifdef _WIN32
@ -810,7 +939,7 @@ void CALL DllConfig(HWND hParent)
ZLUT_init();
}
COptionsSheet("Glide64 settings").DoModal(hParent);
COptionsSheet("Glide64 settings").DoModal((HWND)hParent);
CloseConfig();
#endif
}
@ -865,7 +994,7 @@ to give further information about the DLL.
input: a handle to the window that calls this function
output: none
*******************************************************************/
void CALL DllAbout(HWND /*hParent*/)
void CALL DllAbout(void * /*hParent*/)
{
#ifdef _WIN32
CAboutDlg dlg;

View File

@ -44,6 +44,6 @@
#pragma once
#ifdef _WIN32
void ConfigInit(HINSTANCE hinst);
void ConfigInit(void * hinst);
void ConfigCleanup(void);
#endif

View File

@ -178,10 +178,10 @@ extern "C" {
typedef struct
{
HWND hWnd; /* Render window */
HWND hStatusBar; /* if render window does not have a status bar then this is NULL */
void * hWnd; /* Render window */
void * hStatusBar; /* if render window does not have a status bar then this is NULL */
int MemoryBswaped; // If this is set to TRUE, then the memory has been pre
int32_t MemoryBswaped; // If this is set to TRUE, then the memory has been pre
// bswap on a dword (32 bits) boundry
// eg. the first 8 bytes are stored like this:
// 4 3 2 1 8 7 6 5
@ -300,7 +300,7 @@ extern "C" {
input: a handle to the window that calls this function
output: none
*******************************************************************/
EXPORT void CALL DllAbout(HWND hParent);
EXPORT void CALL DllAbout(void * hParent);
/******************************************************************
Function: DllConfig
@ -309,7 +309,7 @@ extern "C" {
input: a handle to the window that calls this function
output: none
*******************************************************************/
EXPORT void CALL DllConfig(HWND hParent);
EXPORT void CALL DllConfig(void * hParent);
/******************************************************************
Function: DllTest
@ -318,7 +318,7 @@ extern "C" {
input: a handle to the window that calls this function
output: none
*******************************************************************/
EXPORT void CALL DllTest(HWND hParent);
EXPORT void CALL DllTest(void * hParent);
EXPORT void CALL ReadScreen(void **dest, int *width, int *height);

View File

@ -182,6 +182,37 @@ BEGIN
PUSHBUTTON "Best texture quality",IDC_BUTTON2,162,170,129,14
END
IDD_DEBUG_SETTINGS DIALOGEX 0, 0, 311, 177
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Debug Settings"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
GROUPBOX "Tracing",-1,7,3,140,167
LTEXT "Settings:",IDC_TXT_TRACE_SETTINGS,13,17,55,10,SS_NOTIFY
COMBOBOX IDC_CMB_TRACE_SETTINGS,72,13,72,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "Unknown:",IDC_TXT_TRACE_UNKNOWN,13,31,55,10,SS_NOTIFY
COMBOBOX IDC_CMB_TRACE_UNKNOWN,72,27,72,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "Glide64:",IDC_TXT_TRACE_GLIDE64,13,44,55,10,SS_NOTIFY
COMBOBOX IDC_CMB_TRACE_GLIDE64,72,41,72,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "Interface:",IDC_TXT_TRACE_INTERFACE,13,58,55,10,SS_NOTIFY
COMBOBOX IDC_CMB_TRACE_INTERFACE,72,55,72,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "Resolution:",IDC_TXT_TRACE_RESOLUTION,13,72,55,10,SS_NOTIFY
COMBOBOX IDC_CMB_TRACE_RESOLUTION,72,69,72,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "Glitch:",IDC_TXT_TRACE_GLITCH,13,86,55,10,SS_NOTIFY
COMBOBOX IDC_CMB_TRACE_GLITCH,72,83,72,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "RDP:",IDC_TXT_TRACE_RDP,13,100,55,10,SS_NOTIFY
COMBOBOX IDC_CMB_TRACE_RDP,72,97,72,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "TLUT:",IDC_TXT_TRACE_TLUT,13,114,55,10,SS_NOTIFY
COMBOBOX IDC_CMB_TRACE_TLUT,72,111,72,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "PNG:",IDC_TXT_TRACE_PNG,13,128,55,10,SS_NOTIFY
COMBOBOX IDC_CMB_TRACE_PNG,72,125,72,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "OGLWrapper:",IDC_TXT_TRACE_OGLWRAPPER,13,141,55,10,SS_NOTIFY
COMBOBOX IDC_CMB_TRACE_OGLWRAPPER,72,139,72,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "RDP Commands:",IDC_TXT_TRACE_OGLWRAPPER2,14,155,55,10,SS_NOTIFY
COMBOBOX IDC_CMB_TRACE_RDP_COMMANDS,72,153,72,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
@ -220,6 +251,14 @@ BEGIN
TOPMARGIN, 7
BOTTOMMARGIN, 187
END
IDD_DEBUG_SETTINGS, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 304
TOPMARGIN, 7
BOTTOMMARGIN, 170
END
END
#endif // APSTUDIO_INVOKED

View File

@ -515,7 +515,7 @@ int InitGfx()
g_settings->UpdateScreenSize(ev_fullscreen);
#ifndef ANDROID
SetWindowDisplaySize(gfx.hWnd);
SetWindowDisplaySize((HWND)gfx.hWnd);
#endif
gfx_context = grSstWinOpen(GR_COLORFORMAT_RGBA, GR_ORIGIN_UPPER_LEFT, 2, 1);
if (!gfx_context)
@ -706,7 +706,7 @@ int InitGfx()
voodoo.sup_mirroring = 1;
}
return TRUE;
}
}
void ReleaseGfx()
{
@ -1038,11 +1038,12 @@ void CALL MoveScreen(int xpos, int ypos)
void CALL PluginLoaded(void)
{
SetupTrace();
if (g_settings == NULL)
{
g_settings = new CSettings;
}
SetupTrace();
StartTrace();
WriteTrace(TraceInterface, TraceDebug, "Start");
WriteTrace(TraceInterface, TraceDebug, "Done");
@ -1070,7 +1071,7 @@ void CALL RomClosed(void)
if (evoodoo)
{
ReleaseGfx();
}
}
}
static void CheckDRAMSize()

View File

@ -1,5 +1,6 @@
#include <Common/StdString.h>
#include <Settings/Settings.h>
#include <Glide64/trace.h>
#include "Gfx_1.3.h"
#include "ScreenResolution.h"
#include "SettingsID.h"
@ -8,6 +9,7 @@ extern int g_width, g_height;
CSettings::CSettings() :
m_Set_basic_mode(0),
m_Set_debugger(0),
m_Set_texture_dir(0),
m_Set_log_dir(0),
m_Set_log_flush(0),
@ -18,6 +20,7 @@ CSettings::CSettings() :
m_scr_res_y(GetScreenResHeight(GetDefaultScreenRes())),
m_ScreenRes(GetDefaultScreenRes()),
m_advanced_options(false),
m_debugger_enabled(false),
m_texenh_options(false),
m_vsync(false),
m_rotate(Rotate_None),
@ -78,7 +81,7 @@ CSettings::CSettings() :
m_hacks((hacks_t)0),
//wrapper settings
//wrapper settings
#ifndef ANDROID
m_FullScreenRes(0),
#endif
@ -96,6 +99,7 @@ void CSettings::RegisterSettings(void)
{
SetModuleName("default");
m_Set_basic_mode = FindSystemSettingId("Basic Mode");
m_Set_debugger = FindSystemSettingId("Debugger");
m_Set_texture_dir = FindSystemSettingId("Dir:Texture");
m_Set_log_flush = FindSystemSettingId("Log Auto Flush");
m_Set_log_dir = FindSystemSettingId("Dir:Log");
@ -150,6 +154,21 @@ void CSettings::RegisterSettings(void)
general_setting(Set_fb_get_info_default, "fb_get_info", false);
general_setting(Set_fb_render_default, "fb_render", false);
RegisterSetting(Set_Logging_MD5, Data_DWORD_General, "MD5", "Logging", g_ModuleLogLevel[TraceMD5], NULL);
RegisterSetting(Set_Logging_Thread, Data_DWORD_General, "Thread", "Logging", g_ModuleLogLevel[TraceThread], NULL);
RegisterSetting(Set_Logging_Path, Data_DWORD_General, "Path", "Logging", g_ModuleLogLevel[TracePath], NULL);
RegisterSetting(Set_Logging_Settings, Data_DWORD_General, "Settings", "Logging", g_ModuleLogLevel[TraceSettings], NULL);
RegisterSetting(Set_Logging_Unknown, Data_DWORD_General, "Unknown", "Logging", g_ModuleLogLevel[TraceUnknown], NULL);
RegisterSetting(Set_Logging_Glide64, Data_DWORD_General, "Glide64", "Logging", g_ModuleLogLevel[TraceGlide64], NULL);
RegisterSetting(Set_Logging_Interface, Data_DWORD_General, "Interface", "Logging", g_ModuleLogLevel[TraceInterface], NULL);
RegisterSetting(Set_Logging_Resolution, Data_DWORD_General, "Resolution", "Logging", g_ModuleLogLevel[TraceResolution], NULL);
RegisterSetting(Set_Logging_Glitch, Data_DWORD_General, "Glitch", "Logging", g_ModuleLogLevel[TraceGlitch], NULL);
RegisterSetting(Set_Logging_VideoRDP, Data_DWORD_General, "VideoRDP", "Logging", g_ModuleLogLevel[TraceRDP], NULL);
RegisterSetting(Set_Logging_TLUT, Data_DWORD_General, "TLUT", "Logging", g_ModuleLogLevel[TraceTLUT], NULL);
RegisterSetting(Set_Logging_PNG, Data_DWORD_General, "PNG", "Logging", g_ModuleLogLevel[TracePNG], NULL);
RegisterSetting(Set_Logging_OGLWrapper, Data_DWORD_General, "OGLWrapper", "Logging", g_ModuleLogLevel[TraceOGLWrapper], NULL);
RegisterSetting(Set_Logging_RDPCommands, Data_DWORD_General, "RDPCommands", "Logging", g_ModuleLogLevel[TraceRDPCommands], NULL);
#ifndef ANDROID
general_setting(Set_FullScreenRes, "FullScreenRes", GetCurrentResIndex());
#endif
@ -197,6 +216,20 @@ void CSettings::RegisterSettings(void)
SettingsRegisterChange(false, Set_Resolution, this, stSettingsChanged);
LogLevelChanged();
SettingsRegisterChange(false, Set_Logging_MD5, this, stLogLevelChanged);
SettingsRegisterChange(false, Set_Logging_Thread, this, stLogLevelChanged);
SettingsRegisterChange(false, Set_Logging_Path, this, stLogLevelChanged);
SettingsRegisterChange(false, Set_Logging_Settings, this, stLogLevelChanged);
SettingsRegisterChange(false, Set_Logging_Unknown, this, stLogLevelChanged);
SettingsRegisterChange(false, Set_Logging_Glide64, this, stLogLevelChanged);
SettingsRegisterChange(false, Set_Logging_Interface, this, stLogLevelChanged);
SettingsRegisterChange(false, Set_Logging_Resolution, this, stLogLevelChanged);
SettingsRegisterChange(false, Set_Logging_Glitch, this, stLogLevelChanged);
SettingsRegisterChange(false, Set_Logging_VideoRDP, this, stLogLevelChanged);
SettingsRegisterChange(false, Set_Logging_TLUT, this, stLogLevelChanged);
SettingsRegisterChange(false, Set_Logging_OGLWrapper, this, stLogLevelChanged);
SettingsRegisterChange(false, Set_Logging_RDPCommands, this, stLogLevelChanged);
}
void CSettings::SetTexenhOptions(bool value)
@ -554,7 +587,6 @@ void CSettings::UpdateAspectRatio(void)
m_res_x += (uint32_t)(m_scr_res_x - m_res_x) / 2.0f;
m_res_y += (uint32_t)(m_scr_res_y - m_res_y) / 2.0f;
}
void CSettings::ReadSettings()
@ -566,6 +598,7 @@ void CSettings::ReadSettings()
m_vsync = GetSetting(Set_vsync) != 0;
m_rotate = (ScreenRotate_t)GetSetting(Set_Rotate);
m_advanced_options = m_Set_basic_mode ? GetSystemSetting(m_Set_basic_mode) == 0 : false;
m_debugger_enabled = m_advanced_options && m_Set_debugger ? GetSystemSetting(m_Set_debugger) == 1 : false;
m_texenh_options = GetSetting(Set_texenh_options) != 0;
m_wrpVRAM = GetSetting(Set_wrpVRAM);
@ -586,7 +619,7 @@ void CSettings::ReadSettings()
m_ghq_enht = (TextureEnhancement_t)GetSetting(Set_ghq_enht);
m_ghq_hirs = (HiResPackFormat_t)GetSetting(Set_ghq_hirs);
m_ghq_enht_cmpr = GetSetting(Set_ghq_enht_cmpr) != 0;
m_ghq_enht_f16bpp = GetSetting(Set_ghq_enht_f16bpp) !=0;
m_ghq_enht_f16bpp = GetSetting(Set_ghq_enht_f16bpp) != 0;
m_ghq_enht_gz = GetSetting(Set_ghq_enht_gz) != 0;
m_ghq_enht_nobg = GetSetting(Set_ghq_enht_nobg) != 0;
m_ghq_hirs_cmpr = GetSetting(Set_ghq_hirs_cmpr) != 0;
@ -913,9 +946,30 @@ void CSettings::SettingsChanged(void)
m_ScreenRes = GetSetting(Set_Resolution);
}
void CSettings::LogLevelChanged(void)
{
g_ModuleLogLevel[TraceMD5] = GetSetting(Set_Logging_MD5);
g_ModuleLogLevel[TraceThread] = GetSetting(Set_Logging_Thread);
g_ModuleLogLevel[TracePath] = GetSetting(Set_Logging_Path);
g_ModuleLogLevel[TraceSettings] = GetSetting(Set_Logging_Settings);
g_ModuleLogLevel[TraceUnknown] = GetSetting(Set_Logging_Unknown);
g_ModuleLogLevel[TraceGlide64] = GetSetting(Set_Logging_Glide64);
g_ModuleLogLevel[TraceInterface] = GetSetting(Set_Logging_Interface);
g_ModuleLogLevel[TraceResolution] = GetSetting(Set_Logging_Resolution);
g_ModuleLogLevel[TraceGlitch] = GetSetting(Set_Logging_Glitch);
g_ModuleLogLevel[TraceRDP] = GetSetting(Set_Logging_VideoRDP);
g_ModuleLogLevel[TraceTLUT] = GetSetting(Set_Logging_TLUT);
g_ModuleLogLevel[TracePNG] = GetSetting(Set_Logging_PNG);
g_ModuleLogLevel[TraceOGLWrapper] = GetSetting(Set_Logging_OGLWrapper);
g_ModuleLogLevel[TraceRDPCommands] = GetSetting(Set_Logging_RDPCommands);
}
#ifdef _WIN32
#include <Windows.h>
#endif
void UseUnregisteredSetting(int /*SettingID*/)
{
#ifdef _WIN32
DebugBreak();
#endif
}
}

View File

@ -193,6 +193,7 @@ public:
inline uint32_t scr_res_y(void) const { return m_scr_res_y; }
inline uint32_t ScreenRes(void) const { return m_ScreenRes; }
inline bool advanced_options(void) const { return m_advanced_options; }
inline bool debugger_enabled(void) const { return m_debugger_enabled; }
inline bool texenh_options(void) const { return m_texenh_options; }
inline bool vsync(void) const { return m_vsync; }
inline ScreenRotate_t rotate(void) const { return m_rotate; }
@ -313,13 +314,20 @@ private:
void RegisterSettings(void);
void UpdateAspectRatio(void);
void SettingsChanged(void);
void LogLevelChanged(void);
static void stSettingsChanged(void * _this)
{
((CSettings *)_this)->SettingsChanged();
}
static void stLogLevelChanged(void * _this)
{
((CSettings *)_this)->LogLevelChanged();
}
short m_Set_basic_mode;
short m_Set_debugger;
short m_Set_texture_dir;
short m_Set_log_dir;
short m_Set_log_flush;
@ -346,6 +354,7 @@ private:
SwapMode_t m_swapmode;
PixelLevelOfDetail_t m_lodmode;
bool m_advanced_options;
bool m_debugger_enabled;
bool m_texenh_options;
bool m_vsync;
std::string m_texture_dir;

View File

@ -42,6 +42,12 @@ enum
//RDB Setting
Set_ucodeLookup,
//Logging Settings
Set_Logging_MD5, Set_Logging_Thread, Set_Logging_Path, Set_Logging_Settings,
Set_Logging_Unknown, Set_Logging_Glide64, Set_Logging_Interface, Set_Logging_Resolution,
Set_Logging_Glitch, Set_Logging_VideoRDP, Set_Logging_TLUT, Set_Logging_PNG,
Set_Logging_OGLWrapper, Set_Logging_RDPCommands,
#ifdef _WIN32
Set_FullScreenRes,
#endif

View File

@ -7,6 +7,7 @@
#define IDD_TEXTURE_ENHANCEMENT 103
#define IDD_ABOUT 104
#define IDD_ABOUTBOX 104
#define IDD_DEBUG_SETTINGS 105
#define IDC_CMB_FS_RESOLUTION 1001
#define IDC_CHK_VERTICAL_SYNC 1002
#define IDC_CMB_WINDOW_RES 1003
@ -21,15 +22,26 @@
#define IDC_INFO 1017
#define IDC_CMB_FILTERING_MODE 1018
#define IDC_CMB_BUFFER_SWAPPING 1019
#define IDC_CMB_TRACE_UNKNOWN 1019
#define IDC_CMB_LOD_CALC 1020
#define IDC_CMB_TRACE_GLIDE64 1020
#define IDC_CMB_ASPECT_RATIO 1021
#define IDC_CMB_TRACE_INTERFACE 1021
#define IDC_CHK_FOG 1022
#define IDC_CMB_TRACE_RESOLUTION 1022
#define IDC_CHK_BUFFER_CLEAR 1023
#define IDC_CMB_TRACE_GLITCH 1023
#define IDC_TXT_FILTERING_MODE 1024
#define IDC_CMB_TRACE_RDP 1024
#define IDC_CHK_FRAME_BUFFER_EMULATION 1025
#define IDC_CMB_TRACE_TLUT 1025
#define IDC_CHK_HARDWARE_FRAMEBUFFER 1026
#define IDC_CMB_TRACE_PNG 1026
#define IDC_CHK_READ_EVERY_FRAME 1027
#define IDC_CMB_TRACE_OGLWRAPPER 1027
#define IDC_CHK_GET_FRAMEBUFFER 1028
#define IDC_CMB_TRACE_OGLWRAPPER2 1028
#define IDC_CMB_TRACE_RDP_COMMANDS 1028
#define IDC_RENDER_FRAME_AS_TEXTURE 1029
#define IDC_CHK_DETECT_CPU_WRITE 1030
#define IDC_SOFTWARE_DEPTH_BUFFER 1031
@ -62,14 +74,27 @@
#define IDC_LBL_MB 1076
#define IDC_TEXT_MB 1077
#define IDC_TXT_TEXTURE_CACHE 1078
#define IDC_TXT_TRACE_SETTINGS 1079
#define IDC_TXT_TRACE_UNKNOWN 1080
#define IDC_TXT_TRACE_GLIDE64 1081
#define IDC_TXT_TRACE_INTERFACE 1082
#define IDC_TXT_TRACE_RESOLUTION 1083
#define IDC_TXT_TRACE_GLITCH 1084
#define IDC_TXT_TRACE_RDP 1085
#define IDC_TXT_TRACE_TLUT 1086
#define IDC_TXT_TRACE_PNG 1087
#define IDC_TXT_TRACE_OGLWRAPPER 1088
#define IDC_TXT_TRACE_OGLWRAPPER2 1089
#define IDC_CMB_TRACE_SETTINGS 1090
#define IDC_SOFTWARE_RENDERING 1091
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 105
#define _APS_NEXT_RESOURCE_VALUE 107
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1079
#define _APS_NEXT_CONTROL_VALUE 1092
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@ -68,7 +68,11 @@ void SetupTrace(void)
TraceSetModuleName(TraceTLUT, "TLUT");
TraceSetModuleName(TracePNG, "PNG");
TraceSetModuleName(TraceOGLWrapper, "OGL Wrapper");
TraceSetModuleName(TraceRDPCommands, "RDP Command");
}
void StartTrace(void)
{
const char * log_dir = g_settings ? g_settings->log_dir() : NULL;
if (log_dir == NULL || log_dir[0] == '\0')
{

View File

@ -14,7 +14,9 @@ enum TraceModuleGlide64
TraceTLUT,
TracePNG,
TraceOGLWrapper,
TraceRDPCommands,
MaxTraceModuleGlide64,
};
void SetupTrace(void);
void SetupTrace(void);
void StartTrace(void);