[Glide64] Remove FPS

This commit is contained in:
zilmar 2016-12-13 17:31:40 +11:00
parent 2394215349
commit beed52498e
12 changed files with 18 additions and 142 deletions

View File

@ -13,3 +13,9 @@ std::string CDateTime::Format(const char * format)
strftime(buffer, sizeof(buffer), format, localtime(&m_time));
return std::string(buffer);
}
CDateTime & CDateTime::SetToNow(void)
{
m_time = time(NULL);
return *this;
}

View File

@ -312,12 +312,8 @@ public:
COMMAND_HANDLER_EX(IDC_CMB_WINDOW_RES, CBN_SELCHANGE, ItemChanged)
COMMAND_HANDLER_EX(IDC_CMB_FS_RESOLUTION, CBN_SELCHANGE, ItemChanged)
COMMAND_HANDLER_EX(IDC_CHK_VERTICAL_SYNC, BN_CLICKED, ItemChanged)
COMMAND_HANDLER_EX(IDC_CHK_FPS_COUNTER, BN_CLICKED, ItemChanged)
COMMAND_HANDLER_EX(IDC_CHK_VIS_COUNTER, BN_CLICKED, ItemChanged)
COMMAND_HANDLER_EX(IDC_CHK_PERCENT_COUNTER, BN_CLICKED, ItemChanged)
COMMAND_HANDLER_EX(IDC_CHK_CLOCK_ENABLED, BN_CLICKED, ItemChanged)
COMMAND_HANDLER_EX(IDC_CHK_CLOCK_24, BN_CLICKED, ItemChanged)
COMMAND_HANDLER_EX(IDC_CHK_TRANSPARENT, BN_CLICKED, ItemChanged)
COMMAND_HANDLER_EX(IDC_CBXANISOTROPIC, BN_CLICKED, ItemChanged)
COMMAND_HANDLER_EX(IDC_CHK_SHOW_TEXTURE_ENHANCEMENT, BN_CLICKED, ItemChanged)
COMMAND_HANDLER_EX(IDC_CHK_AUTODETECT_VRAM, BN_CLICKED, ItemChanged)
@ -373,22 +369,6 @@ public:
m_cbxTextureSettings.Attach(GetDlgItem(IDC_CHK_SHOW_TEXTURE_ENHANCEMENT));
m_cbxTextureSettings.SetCheck(g_settings->texenh_options ? BST_CHECKED : BST_UNCHECKED);
m_cbxFPS.Attach(GetDlgItem(IDC_CHK_FPS_COUNTER));
m_cbxFPS.SetCheck((g_settings->show_fps & 1) > 0 ? BST_CHECKED : BST_UNCHECKED);
TTSetTxt(IDC_CHK_FPS_COUNTER, "FPS counter:\n\nWhen this option is checked, a FPS (frames per second) counter will be shown in the lower left corner of the screen.\n\n[Recommended: your preference]");
m_cbxVIS.Attach(GetDlgItem(IDC_CHK_VIS_COUNTER));
m_cbxVIS.SetCheck((g_settings->show_fps & 2) > 0 ? BST_CHECKED : BST_UNCHECKED);
TTSetTxt(IDC_CHK_VIS_COUNTER, "VI/s counter:\n\nWhen this option is checked, a VI/s (vertical interrupts per second) counter will be shown in the lower left corner of the screen.\nThis is like the FPS counter but will be consistent at 60 VI/s for full speed on NTSC (U) games and 50 VI/s for full speed on PAL (E) ones.\n\n[Recommended: your preference]");
m_cbxPercent.Attach(GetDlgItem(IDC_CHK_PERCENT_COUNTER));
m_cbxPercent.SetCheck((g_settings->show_fps & 4) > 0 ? BST_CHECKED : BST_UNCHECKED);
TTSetTxt(IDC_CHK_PERCENT_COUNTER, "% speed:\n\nThis displays a percentage of the actual N64 speed in the lower left corner of the screen.\n\n[Recommended: your preference]");
m_cbxTextTransparent.Attach(GetDlgItem(IDC_CHK_TRANSPARENT));
m_cbxTextTransparent.SetCheck((g_settings->show_fps & 8) > 0 ? BST_CHECKED : BST_UNCHECKED);
TTSetTxt(IDC_CHK_TRANSPARENT, "Transparent text background:\n\nIf this is checked, all on-screen messages will have a transparent background.\nOtherwise, it will have a solid black background.\n\n[Recommended: your preference]");
m_cbxClockEnabled.Attach(GetDlgItem(IDC_CHK_CLOCK_ENABLED));
m_cbxClockEnabled.SetCheck(g_settings->clock > 0 ? BST_CHECKED : BST_UNCHECKED);
TTSetTxt(IDC_CHK_CLOCK_ENABLED, "Clock enabled:\n\nThis option will put a clock in the lower right corner of the screen, showing the current time.\n\n[Recommended: your preference]");
@ -440,11 +420,6 @@ public:
g_settings->scr_res_y = g_settings->res_y = resolutions[g_settings->res_data][1];
g_settings->vsync = m_cbxVSync.GetCheck() == BST_CHECKED;
g_settings->ssformat = m_cmbScreenShotFormat.GetCurSel();
g_settings->show_fps =
(m_cbxFPS.GetCheck() == BST_CHECKED ? 1 : 0) |
(m_cbxVIS.GetCheck() == BST_CHECKED ? 2 : 0) |
(m_cbxPercent.GetCheck() == BST_CHECKED ? 4 : 0) |
(m_cbxTextTransparent.GetCheck() == BST_CHECKED ? 8 : 0);
g_settings->texenh_options = m_cbxTextureSettings.GetCheck() == BST_CHECKED;
g_settings->clock = m_cbxClockEnabled.GetCheck() == BST_CHECKED;
g_settings->clock_24_hr = m_cbxClock24.GetCheck() == BST_CHECKED;
@ -483,7 +458,6 @@ private:
CComboBox m_cmbScreenShotFormat;
CButton m_cbxVSync;
CButton m_cbxTextureSettings;
CButton m_cbxFPS, m_cbxVIS, m_cbxPercent, m_cbxTextTransparent;
CButton m_cbxClockEnabled, m_cbxClock24;
CButton m_cbxAnisotropic;
CButton m_cbxFBO;

View File

@ -51,7 +51,7 @@ void ConfigCleanup(void);
enum
{
// General Settings
Set_CardId, Set_vsync, Set_ssformat, Set_ShowFps, Set_clock,
Set_CardId, Set_vsync, Set_ssformat, Set_clock,
Set_clock_24_hr, Set_Rotate, Set_texenh_options, Set_hotkeys, Set_wrpVRAM,
Set_wrpFBO, Set_wrpAnisotropic, Set_autodetect_ucode, Set_ucode, Set_wireframe,
Set_wfmode, Set_logging, Set_log_clear, Set_elogging, Set_run_in_window,

View File

@ -70,7 +70,6 @@ the plugin
#include <stddef.h> // offsetof
#include <glide.h>
#include <Common/MemTest.h>
#include <Common/HighResTimeStamp.h>
#include <Settings/Settings.h>
#include "GlideExtensions.h"
#include "rdp.h"
@ -107,8 +106,6 @@ extern "C" {
// ********************************
#define FPS // fps counter able? (not enabled necessarily)
#define LOGNOTKEY // Log if not pressing:
#define LOGKEY 0x11 // this key (CONTROL)
@ -124,8 +121,6 @@ extern "C" {
#endif
#define FPS_FRAMES 10 // Number of frames in which to make an FPS count
//#define SHOW_FULL_TEXVIEWER // shows the entire contents of the texture in the cache viewer,
// usually used to debug clamping issues.
@ -149,13 +144,6 @@ extern "C" {
#define COLORED_DEBUGGER // ;) pretty colors
#ifdef FPS
extern HighResTimeStamp fps_last;
extern HighResTimeStamp fps_next;
extern float fps;
extern uint32_t fps_count;
#endif
// rdram mask at 0x400000 bytes (bah, not right for majora's mask)
//#define BMASK 0x7FFFFF
extern unsigned int BMASK;

View File

@ -100,14 +100,9 @@ BEGIN
CONTROL "Use frame buffer objects",IDC_CHK_USE_FRAME_BUFFER_OBJECT,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,113,133,10
GROUPBOX "On screen display",IDC_STATIC,174,2,135,128
CONTROL "FPS counter",IDC_CHK_FPS_COUNTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,186,25,54,10
CONTROL "VI/s counter",IDC_CHK_VIS_COUNTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,186,36,55,10
CONTROL "% speed",IDC_CHK_PERCENT_COUNTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,186,48,44,10
GROUPBOX "Speed",IDC_STATIC,179,13,124,49
GROUPBOX "Time",IDC_STATIC,180,64,124,36
CONTROL "Clock enabled",IDC_CHK_CLOCK_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,186,75,59,10
CONTROL "Clock is 24-hour",IDC_CHK_CLOCK_24,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,186,88,52,8
CONTROL "Transparent text background",IDC_CHK_TRANSPARENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,184,103,117,14
GROUPBOX "Time",IDC_STATIC,179,13,124,36
CONTROL "Clock enabled",IDC_CHK_CLOCK_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,186,24,59,10
CONTROL "Clock is 24-hour",IDC_CHK_CLOCK_24,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,186,37,52,8
GROUPBOX "Other",IDC_STATIC,7,132,303,36
CONTROL "Show texture enhancement options",IDC_CHK_SHOW_TEXTURE_ENHANCEMENT,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,140,123,11

View File

@ -92,22 +92,8 @@ int64 perf_cur;
int64 perf_next;
#endif
#ifdef FPS
HighResTimeStamp fps_last;
HighResTimeStamp fps_next;
float fps = 0.0f;
uint32_t fps_count = 0;
uint32_t vi_count = 0;
float vi = 0.0f;
uint32_t region = 0;
float ntsc_percent = 0.0f;
float pal_percent = 0.0f;
#endif
// Resolutions, MUST be in the correct order (SST1VID.H)
uint32_t resolutions[0x18][2] = {
{ 320, 200 },
@ -310,7 +296,6 @@ void ReadSettings()
#endif
g_settings->vsync = GetSetting(Set_vsync);
g_settings->ssformat = (uint8_t)GetSetting(Set_ssformat);
g_settings->show_fps = (uint8_t)GetSetting(Set_ShowFps);
g_settings->clock = GetSetting(Set_clock);
g_settings->clock_24_hr = GetSetting(Set_clock_24_hr);
#ifdef ANDROID
@ -542,7 +527,6 @@ void WriteSettings(void)
#endif
SetSetting(Set_ssformat, g_settings->ssformat);
SetSetting(Set_vsync, g_settings->vsync);
SetSetting(Set_ShowFps, g_settings->show_fps);
SetSetting(Set_clock, g_settings->clock);
SetSetting(Set_clock_24_hr, g_settings->clock_24_hr);
#ifdef ANDROID
@ -1398,10 +1382,6 @@ int CALL InitiateGFX(GFX_INFO Gfx_Info)
g_settings->res_data_org = g_settings->res_data;
#endif
#ifdef FPS
fps_last.SetToNow();
#endif
debug_init(); // Initialize debugger
gfx = Gfx_Info;
@ -1480,7 +1460,6 @@ void CALL PluginLoaded(void)
#endif
general_setting(Set_vsync, "vsync", 1);
general_setting(Set_ssformat, "ssformat", 1);
general_setting(Set_ShowFps, "show_fps", 0);
general_setting(Set_clock, "clock", 0);
general_setting(Set_clock_24_hr, "clock_24_hr", 0);
general_setting(Set_texenh_options, "texenh_options", 0);
@ -1793,25 +1772,6 @@ void CALL UpdateScreen(void)
{
update_screen_count++;
}
#ifdef FPS
// vertical interrupt has occurred, increment counter
vi_count++;
// Check frames per second
fps_next.SetToNow();
double diff_secs = (double)(fps_next.GetMicroSeconds() - fps_last.GetMicroSeconds()) / 1000000;
if (diff_secs > 0.5f)
{
fps = (float)(fps_count / diff_secs);
vi = (float)(vi_count / diff_secs);
ntsc_percent = vi / 0.6f;
pal_percent = vi / 0.5f;
fps_last = fps_next;
fps_count = 0;
vi_count = 0;
}
#endif
//*
uint32_t limit = (g_settings->hacks&hack_Lego) ? 15 : 30;
if ((g_settings->frame_buffer&fb_cpu_write_hack) && (update_screen_count > limit) && (rdp.last_bg == 0))
{
@ -1822,8 +1782,6 @@ void CALL UpdateScreen(void)
UpdateScreen();
return;
}
//*/
//*
if (no_dlist)
{
if (*gfx.VI_ORIGIN_REG > width)
@ -1837,7 +1795,6 @@ void CALL UpdateScreen(void)
}
return;
}
//*/
if (g_settings->swapmode == 0)
newSwapBuffers();
}
@ -1993,50 +1950,19 @@ void newSwapBuffers()
grDepthMask(FXFALSE);
grCullMode(GR_CULL_DISABLE);
if ((g_settings->show_fps & 0xF) || g_settings->clock)
set_message_combiner();
#ifdef FPS
float y = 0;//(float)g_settings->res_y;
if (g_settings->show_fps & 0x0F)
{
if (g_settings->show_fps & 4)
{
if (region) // PAL
output(0, y, 1, "%d%% ", (int)pal_percent);
else
output(0, y, 1, "%d%% ", (int)ntsc_percent);
y += 16;
}
if (g_settings->show_fps & 2)
{
output(0, y, 1, "VI/s: %.02f ", vi);
y += 16;
}
if (g_settings->show_fps & 1)
output(0, y, 1, "FPS: %.02f ", fps);
}
#endif
if (g_settings->clock)
{
set_message_combiner();
if (g_settings->clock_24_hr)
{
output(956.0f, 0, 1, CDateTime().Format("%H:%M:%S").c_str(), 0);
output(956.0f, 0, 1, CDateTime().SetToNow().Format("%H:%M:%S").c_str(), 0);
}
else
{
output(930.0f, 0, 1, CDateTime().Format("%I:%M:%S %p").c_str(), 0);
output(930.0f, 0, 1, CDateTime().SetToNow().Format("%I:%M:%S %p").c_str(), 0);
}
}
//hotkeys
//if (CheckKeyPressed(G64_VK_BACK, 0x0001))
//{
//hotkey_info.hk_filtering = 100;
//if (g_settings->filtering < 2)
//g_settings->filtering++;
//else
//g_settings->filtering = 0;
//}
if ((abs((int)(frame_count - curframe)) > 3) && CheckKeyPressed(G64_VK_ALT, 0x8000)) //alt +
{
if (CheckKeyPressed(G64_VK_B, 0x8000)) //b
@ -2241,7 +2167,6 @@ void newSwapBuffers()
grAuxBufferExt(GR_BUFFER_AUXBUFFER);
WriteTrace(TraceGlide64, TraceDebug, "BUFFER SWAPPED");
grBufferSwap(g_settings->vsync);
fps_count++;
if (*gfx.VI_STATUS_REG & 0x08) //gamma correction is used
{
if (!voodoo.gamma_correction)

View File

@ -15,7 +15,6 @@ texenh_options(0),
ssformat(0),
vsync(0),
show_fps(0),
clock(0),
clock_24_hr(0),
#ifdef ANDROID

View File

@ -18,7 +18,6 @@ public:
int ssformat;
int vsync;
int show_fps;
int clock;
int clock_24_hr;
#ifdef ANDROID

View File

@ -2087,12 +2087,6 @@ void set_message_combiner()
GR_COMBINE_LOCAL_NONE,
GR_COMBINE_OTHER_TEXTURE,
FXFALSE);
if (g_settings->show_fps & 0x08)
grAlphaBlendFunction(GR_BLEND_SRC_ALPHA,
GR_BLEND_ONE_MINUS_SRC_ALPHA,
GR_BLEND_ZERO,
GR_BLEND_ZERO);
else
grAlphaBlendFunction(GR_BLEND_ONE,
GR_BLEND_ZERO,
GR_BLEND_ZERO,

View File

@ -2633,7 +2633,7 @@ static void rdp_setcolorimage()
{
if (rdp.ci_count == 0)
{
if (rdp.ci_status == ci_aux) //for PPL
if ((rdp.ci_status == ci_aux)) //for PPL
{
float sx = rdp.scale_x;
float sy = rdp.scale_y;

View File

@ -17,12 +17,8 @@
#define IDC_SPIN_TEXTURE_CACHE 1006
#define IDC_EDIT1 1007
#define IDC_CHK_USE_FRAME_BUFFER_OBJECT 1008
#define IDC_CHK_FPS_COUNTER 1009
#define IDC_CHK_VIS_COUNTER 1010
#define IDC_CHK_PERCENT_COUNTER 1011
#define IDC_CHK_CLOCK_ENABLED 1012
#define IDC_CHK_CLOCK_24 1013
#define IDC_CHK_TRANSPARENT 1014
#define IDC_CMB_SCREEN_SHOT_FORMAT 1015
#define IDC_CHK_SHOW_TEXTURE_ENHANCEMENT 1016
#define IDC_INFO 1017

View File

@ -62,7 +62,7 @@ static void fb_bg_copy()
if (rdp.main_ci == 0)
return;
CI_STATUS status = rdp.frame_buffers[rdp.ci_count - 1].status;
if (status == ci_copy)
if ((status == ci_copy))
return;
uint32_t addr = segoffset(rdp.cmd1) >> 1;