(360) Add FPS - memory free reporting

This commit is contained in:
twinaphex 2012-11-22 05:32:58 +01:00
parent c71993af83
commit 8612711fa8
5 changed files with 61 additions and 16 deletions

View File

@ -379,6 +379,7 @@ HRESULT CRetroArchSettings::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
m_settingslist.SetText(SETTING_EMU_REWIND_ENABLED, g_settings.rewind_enable ? L"Rewind: ON" : L"Rewind: OFF");
m_settingslist.SetText(SETTING_EMU_SHOW_INFO_MSG, g_extern.console.rmenu.state.msg_info.enable ? L"Info messages: ON" : L"Info messages: OFF");
m_settingslist.SetText(SETTING_EMU_SHOW_DEBUG_INFO_MSG, g_extern.console.rmenu.state.msg_fps.enable ? L"Debug Info messages: ON" : L"Debug Info messages: OFF");
m_settingslist.SetText(SETTING_EMU_MENUS, g_extern.console.rmenu.state.rmenu_hd.enable ? L"Menus: HD" : L"Menus: SD");
m_settingslist.SetText(SETTING_GAMMA_CORRECTION_ENABLED, g_extern.console.screen.gamma_correction ? L"Gamma correction: ON" : L"Gamma correction: OFF");
m_settingslist.SetText(SETTING_HW_TEXTURE_FILTER, g_settings.video.smooth ? L"Hardware filtering shader #1: Linear interpolation" : L"Hardware filtering shader #1: Point filtering");
@ -419,6 +420,10 @@ HRESULT CRetroArchSettings::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
g_extern.console.rmenu.state.msg_info.enable = !g_extern.console.rmenu.state.msg_info.enable;
m_settingslist.SetText(SETTING_EMU_SHOW_INFO_MSG, g_extern.console.rmenu.state.msg_info.enable ? L"Info messages: ON" : L"Info messages: OFF");
break;
case SETTING_EMU_SHOW_DEBUG_INFO_MSG:
g_extern.console.rmenu.state.msg_fps.enable = !g_extern.console.rmenu.state.msg_fps.enable;
m_settingslist.SetText(SETTING_EMU_SHOW_DEBUG_INFO_MSG, g_extern.console.rmenu.state.msg_fps.enable ? L"Debug Info messages: ON" : L"Debug Info messages: OFF");
break;
case SETTING_EMU_MENUS:
g_extern.console.rmenu.state.rmenu_hd.enable = !g_extern.console.rmenu.state.rmenu_hd.enable;
m_settingslist.SetText(SETTING_EMU_MENUS, g_extern.console.rmenu.state.rmenu_hd.enable ? L"Menus: HD" : L"Menus: SD");
@ -511,6 +516,10 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro
g_extern.console.rmenu.state.msg_info.enable = !g_extern.console.rmenu.state.msg_info.enable;
m_settingslist.SetText(SETTING_EMU_SHOW_INFO_MSG, g_extern.console.rmenu.state.msg_info.enable ? L"Info messages: ON" : L"Info messages: OFF");
break;
case SETTING_EMU_SHOW_DEBUG_INFO_MSG:
g_extern.console.rmenu.state.msg_fps.enable = !g_extern.console.rmenu.state.msg_fps.enable;
m_settingslist.SetText(SETTING_EMU_SHOW_DEBUG_INFO_MSG, g_extern.console.rmenu.state.msg_fps.enable ? L"Debug Info messages: ON" : L"Debug Info messages: OFF");
break;
case SETTING_EMU_MENUS:
g_extern.console.rmenu.state.rmenu_hd.enable = !g_extern.console.rmenu.state.rmenu_hd.enable;
m_settingslist.SetText(SETTING_EMU_MENUS, g_extern.console.rmenu.state.rmenu_hd.enable ? L"Menus: HD" : L"Menus: SD");
@ -566,6 +575,10 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro
g_extern.console.rmenu.state.msg_info.enable = !g_extern.console.rmenu.state.msg_info.enable;
m_settingslist.SetText(SETTING_EMU_SHOW_INFO_MSG, g_extern.console.rmenu.state.msg_info.enable ? L"Info messages: ON" : L"Info messages: OFF");
break;
case SETTING_EMU_SHOW_DEBUG_INFO_MSG:
g_extern.console.rmenu.state.msg_fps.enable = !g_extern.console.rmenu.state.msg_fps.enable;
m_settingslist.SetText(SETTING_EMU_SHOW_DEBUG_INFO_MSG, g_extern.console.rmenu.state.msg_fps.enable ? L"Debug Info messages: ON" : L"Debug Info messages: OFF");
break;
case SETTING_EMU_MENUS:
g_extern.console.rmenu.state.rmenu_hd.enable = !g_extern.console.rmenu.state.rmenu_hd.enable;
m_settingslist.SetText(SETTING_EMU_MENUS, g_extern.console.rmenu.state.rmenu_hd.enable ? L"Menus: HD" : L"Menus: SD");

View File

@ -24,6 +24,7 @@ enum
{
SETTING_EMU_REWIND_ENABLED = 0,
SETTING_EMU_SHOW_INFO_MSG,
SETTING_EMU_SHOW_DEBUG_INFO_MSG,
SETTING_EMU_MENUS,
SETTING_GAMMA_CORRECTION_ENABLED,
SETTING_SHADER,

View File

@ -32,6 +32,7 @@
<Position>44.880005,64.959991,0.000000</Position>
<ItemsText>Rewind:
Info messages:
Debug info messages:
Menus:
Gamma Correction:
Shader #1:
@ -247,6 +248,18 @@ Extract ZIP:
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
</Properties>
</XuiListItem>
<XuiListItem>
<Properties>
<Id>control_ListItem</Id>
<Width>226.000000</Width>
<Height>45.000000</Height>
<Position>7.000000,22.000000,0.000000</Position>
<Anchor>5</Anchor>
<Show>false</Show>
<Visual>XuiButton</Visual>
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
</Properties>
</XuiListItem>
</XuiCommonList>
<XuiBackButton>
<Properties>

View File

@ -32,6 +32,7 @@
<Position>44.880005,64.959991,0.000000</Position>
<ItemsText>Rewind:
Info messages:
Debug info messages:
Menus:
Gamma Correction:
Shader #1:
@ -223,6 +224,18 @@ Extract ZIP:
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
</Properties>
</XuiListItem>
<XuiListItem>
<Properties>
<Id>control_ListItem</Id>
<Width>226.000000</Width>
<Height>45.000000</Height>
<Position>7.000000,22.000000,0.000000</Position>
<Anchor>5</Anchor>
<Show>false</Show>
<Visual>XuiButton</Visual>
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
</Properties>
</XuiListItem>
</XuiCommonList>
<XuiBackButton>
<Properties>

View File

@ -797,6 +797,19 @@ static bool xdk_d3d_frame(void *data, const void *frame,
#endif
#if defined(_XBOX1)
#define fonts_render_msg_place_func(device, x, y, scale, msg) xfonts_render_msg_place(device, x, y, scale, msg)
float width = font_x + 30;
float height = font_y + 50;
float msg_width = 60;
float msg_height = 365;
#elif defined(_XBOX360)
#define fonts_render_msg_place_func(device, x, y, scale, msg) xdk_render_msg_place(device, x, y, msg)
float mem_width = g_extern.console.rmenu.state.rmenu_hd.enable ? 160 : 100;
float mem_height = 70;
float msg_width = mem_width;
float msg_height = mem_height + 50;
#endif
if(fps_enable)
{
MEMORYSTATUS stat;
@ -804,28 +817,20 @@ static bool xdk_d3d_frame(void *data, const void *frame,
char fps_txt[128];
char buf[128];
snprintf(buf, sizeof(buf), "%.2f MB free / %.2f MB total", stat.dwAvailPhys/(1024.0f*1024.0f), stat.dwTotalPhys/(1024.0f*1024.0f));
xfonts_render_msg_place(d3d, font_x + 30, font_y + 50, 0 /* scale */, buf);
fonts_render_msg_place_func(d3d, mem_width, mem_height, 0, buf);
gfx_fps_title(fps_txt, sizeof(fps_txt));
xfonts_render_msg_place(d3d, font_x + 30, font_y + 70, 0 /* scale */, fps_txt);
fonts_render_msg_place_func(d3d, mem_width, mem_height + 30, 0, fps_txt);
}
if (msg)
xfonts_render_msg_place(d3d, 60, 365, 0, msg); //TODO: dehardcode x/y here for HD (720p) mode
#elif defined(_XBOX360)
if(fps_enable)
{
char fps_txt[128];
gfx_fps_title(fps_txt, sizeof(fps_txt));
xdk_render_msg_place(d3d, g_extern.console.rmenu.state.rmenu_hd.enable ? 160 : 100, 90, fps_txt);
}
if (msg && !menu_enabled)
{
xdk_render_msg(d3d, msg);
}
if (msg
#ifdef _XBOX360
&& !menu_enabled
#endif
)
fonts_render_msg_place_func(d3d, msg_width, msg_height, 0, msg); //TODO: dehardcode x/y here for HD (720p) mode
if(!d3d->block_swap)
gfx_ctx_xdk_swap_buffers();