mirror of
https://github.com/libretro/RetroArch.git
synced 2025-01-23 18:06:36 +00:00
(Xbox 1/RARCH_CONSOLE) Create member in console_settings for showing
FPS onscreen
This commit is contained in:
parent
58595a7c97
commit
d1231fb55b
@ -200,14 +200,13 @@ typedef struct
|
||||
|
||||
struct console_settings
|
||||
{
|
||||
#ifdef __CELLOS_LV2__
|
||||
bool custom_bgm_enable;
|
||||
#endif
|
||||
bool check_available_resolutions;
|
||||
bool block_config_read;
|
||||
bool default_sram_dir_enable;
|
||||
bool default_savestate_dir_enable;
|
||||
bool fbo_enabled;
|
||||
bool fps_info_enable;
|
||||
bool frame_advance_enable;
|
||||
#ifdef _XBOX
|
||||
bool menus_hd_enable;
|
||||
@ -242,9 +241,7 @@ struct console_settings
|
||||
uint32_t supported_resolutions_count;
|
||||
uint32_t control_timer_expiration_frame_count;
|
||||
uint32_t timer_expiration_frame_count;
|
||||
#ifdef RARCH_CONSOLE
|
||||
uint32_t input_loop;
|
||||
#endif
|
||||
#ifdef _XBOX
|
||||
uint32_t color_format;
|
||||
DWORD volume_device_type;
|
||||
@ -257,7 +254,7 @@ struct console_settings
|
||||
char default_sram_dir[PATH_MAX];
|
||||
char launch_app_on_exit[PATH_MAX];
|
||||
float menu_font_size;
|
||||
#if defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)
|
||||
#if defined(__CELLOS_LV2__)
|
||||
oskutil_params oskutil_handle;
|
||||
#endif
|
||||
};
|
||||
|
@ -185,7 +185,7 @@ static void *xdk_d3d_init(const video_info_t *video, const input_driver_t **inpu
|
||||
if (!d3d->d3d_device)
|
||||
{
|
||||
free(d3d);
|
||||
OutputDebugString("RetroArch: Failed to create a D3D8 object!");
|
||||
RARCH_ERR("Failed to create a D3D8 object.\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -344,7 +344,6 @@ static void *xdk_d3d_init(const video_info_t *video, const input_driver_t **inpu
|
||||
d3d->vsync = video->vsync;
|
||||
|
||||
// load debug font (toggle option in later revisions ?)
|
||||
#ifdef SHOW_DEBUG_INFO
|
||||
XFONT_OpenDefaultFont(&d3d->debug_font);
|
||||
d3d->debug_font->SetBkMode(XFONT_TRANSPARENT);
|
||||
d3d->debug_font->SetBkColor(D3DCOLOR_ARGB(100,0,0,0));
|
||||
@ -353,6 +352,10 @@ static void *xdk_d3d_init(const video_info_t *video, const input_driver_t **inpu
|
||||
|
||||
font_x = 0;
|
||||
font_y = 0;
|
||||
|
||||
// TODO: place this somewhere else outside of xdk_d3d8.cpp
|
||||
#ifdef SHOW_DEBUG_INFO
|
||||
g_console.fps_info_enable = true;
|
||||
#endif
|
||||
|
||||
return d3d;
|
||||
@ -361,13 +364,12 @@ static void *xdk_d3d_init(const video_info_t *video, const input_driver_t **inpu
|
||||
static bool xdk_d3d_frame(void *data, const void *frame,
|
||||
unsigned width, unsigned height, unsigned pitch, const char *msg)
|
||||
{
|
||||
#if 0
|
||||
if (!frame)
|
||||
return true;
|
||||
#endif
|
||||
|
||||
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)data;
|
||||
bool menu_enabled = g_console.menu_enable;
|
||||
bool fps_enable = g_console.fps_info_enable;
|
||||
|
||||
if (d3d->last_width != width || d3d->last_height != height) //240*160
|
||||
{
|
||||
@ -442,40 +444,38 @@ static bool xdk_d3d_frame(void *data, const void *frame,
|
||||
d3d->d3d_render_device->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
|
||||
d3d->d3d_render_device->EndScene();
|
||||
|
||||
|
||||
#ifdef SHOW_DEBUG_INFO
|
||||
static MEMORYSTATUS stat;
|
||||
GlobalMemoryStatus(&stat);
|
||||
d3d->d3d_render_device->GetBackBuffer(-1, D3DBACKBUFFER_TYPE_MONO, &d3d->pFrontBuffer);
|
||||
d3d->d3d_render_device->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &d3d->pBackBuffer);
|
||||
|
||||
//Output memory usage
|
||||
|
||||
char buf[128], buf2[128], buf_fps_last[128];
|
||||
bool ret = false;
|
||||
sprintf(buf, "%.2f MB free / %.2f MB total", stat.dwAvailPhys/(1024.0f*1024.0f), stat.dwTotalPhys/(1024.0f*1024.0f));
|
||||
rarch_convert_char_to_wchar(strw_buffer, buf, sizeof(strw_buffer));
|
||||
d3d->debug_font->TextOut(d3d->pFrontBuffer, strw_buffer, (unsigned)-1, font_x + 30, font_y + 50 );
|
||||
d3d->debug_font->TextOut(d3d->pBackBuffer, strw_buffer, (unsigned)-1, font_x + 30, font_y + 50 );
|
||||
|
||||
if(ret = gfx_window_title(buf2, sizeof(buf2)) || sizeof(buf_fps_last))
|
||||
if(fps_enable)
|
||||
{
|
||||
if(ret)
|
||||
{
|
||||
sprintf(buf_fps_last, buf2);
|
||||
rarch_convert_char_to_wchar(strw_buffer, buf2, sizeof(strw_buffer));
|
||||
}
|
||||
else if(buf_fps_last)
|
||||
{
|
||||
rarch_convert_char_to_wchar(strw_buffer, buf_fps_last, sizeof(strw_buffer));
|
||||
}
|
||||
static MEMORYSTATUS stat;
|
||||
GlobalMemoryStatus(&stat);
|
||||
d3d->d3d_render_device->GetBackBuffer(-1, D3DBACKBUFFER_TYPE_MONO, &d3d->pFrontBuffer);
|
||||
d3d->d3d_render_device->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &d3d->pBackBuffer);
|
||||
|
||||
d3d->debug_font->TextOut(d3d->pFrontBuffer, strw_buffer, (unsigned)-1, font_x + 30, font_y + 70 );
|
||||
d3d->debug_font->TextOut(d3d->pBackBuffer, strw_buffer, (unsigned)-1, font_x + 30, font_y + 70 );
|
||||
d3d->pFrontBuffer->Release();
|
||||
d3d->pBackBuffer->Release();
|
||||
//Output memory usage
|
||||
|
||||
char buf[128], buf_fps_last[128];
|
||||
bool ret = false;
|
||||
sprintf(buf, "%.2f MB free / %.2f MB total", stat.dwAvailPhys/(1024.0f*1024.0f), stat.dwTotalPhys/(1024.0f*1024.0f));
|
||||
rarch_convert_char_to_wchar(strw_buffer, buf, sizeof(strw_buffer));
|
||||
d3d->debug_font->TextOut(d3d->pFrontBuffer, strw_buffer, (unsigned)-1, font_x + 30, font_y + 50 );
|
||||
d3d->debug_font->TextOut(d3d->pBackBuffer, strw_buffer, (unsigned)-1, font_x + 30, font_y + 50 );
|
||||
|
||||
if(ret = gfx_window_title(buf, sizeof(buf)) || sizeof(buf_fps_last))
|
||||
{
|
||||
if(ret)
|
||||
{
|
||||
sprintf(buf_fps_last, buf);
|
||||
rarch_convert_char_to_wchar(strw_buffer, buf, sizeof(strw_buffer));
|
||||
}
|
||||
else if(buf_fps_last)
|
||||
rarch_convert_char_to_wchar(strw_buffer, buf_fps_last, sizeof(strw_buffer));
|
||||
|
||||
d3d->debug_font->TextOut(d3d->pFrontBuffer, strw_buffer, (unsigned)-1, font_x + 30, font_y + 70 );
|
||||
d3d->debug_font->TextOut(d3d->pBackBuffer, strw_buffer, (unsigned)-1, font_x + 30, font_y + 70 );
|
||||
d3d->pFrontBuffer->Release();
|
||||
d3d->pBackBuffer->Release();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if(!d3d->block_swap)
|
||||
gfx_ctx_swap_buffers();
|
||||
|
@ -96,59 +96,59 @@ static int16_t xinput_input_state(void *data, const struct retro_keybind **binds
|
||||
DWORD button = binds[player][id].joykey;
|
||||
int16_t retval = 0;
|
||||
|
||||
//Hardcoded binds (WIP)
|
||||
//FIXME: Hardcoded binds
|
||||
switch(id)
|
||||
{
|
||||
case RETRO_DEVICE_ID_JOYPAD_A:
|
||||
retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_B]) ? 1 : 0;
|
||||
break;
|
||||
case RETRO_DEVICE_ID_JOYPAD_B:
|
||||
retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_A]) ? 1 : 0;
|
||||
break;
|
||||
retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_A]) ? 1 : 0;
|
||||
break;
|
||||
case RETRO_DEVICE_ID_JOYPAD_X:
|
||||
retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_Y]) ? 1 : 0;
|
||||
break;
|
||||
retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_Y]) ? 1 : 0;
|
||||
break;
|
||||
case RETRO_DEVICE_ID_JOYPAD_Y:
|
||||
retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_X]) ? 1 : 0;
|
||||
break;
|
||||
retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_X]) ? 1 : 0;
|
||||
break;
|
||||
case RETRO_DEVICE_ID_JOYPAD_LEFT:
|
||||
retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_LEFT) || (state[player].Gamepad.sThumbLX < -DEADZONE) ? 1 : 0;
|
||||
break;
|
||||
retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_LEFT) || (state[player].Gamepad.sThumbLX < -DEADZONE) ? 1 : 0;
|
||||
break;
|
||||
case RETRO_DEVICE_ID_JOYPAD_RIGHT:
|
||||
retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_RIGHT) || (state[player].Gamepad.sThumbLX > DEADZONE) ? 1 : 0;
|
||||
break;
|
||||
retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_RIGHT) || (state[player].Gamepad.sThumbLX > DEADZONE) ? 1 : 0;
|
||||
break;
|
||||
case RETRO_DEVICE_ID_JOYPAD_UP:
|
||||
retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_UP) || (state[player].Gamepad.sThumbLY > DEADZONE) ? 1 : 0;
|
||||
break;
|
||||
retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_UP) || (state[player].Gamepad.sThumbLY > DEADZONE) ? 1 : 0;
|
||||
break;
|
||||
case RETRO_DEVICE_ID_JOYPAD_DOWN:
|
||||
retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_DOWN)|| (state[player].Gamepad.sThumbLY < -DEADZONE) ? 1 : 0;
|
||||
break;
|
||||
retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_DOWN)|| (state[player].Gamepad.sThumbLY < -DEADZONE) ? 1 : 0;
|
||||
break;
|
||||
case RETRO_DEVICE_ID_JOYPAD_START:
|
||||
retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_START) ? 1 : 0;
|
||||
break;
|
||||
retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_START) ? 1 : 0;
|
||||
break;
|
||||
case RETRO_DEVICE_ID_JOYPAD_SELECT:
|
||||
retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_BACK) ? 1 : 0;
|
||||
break;
|
||||
retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_BACK) ? 1 : 0;
|
||||
break;
|
||||
case RETRO_DEVICE_ID_JOYPAD_L:
|
||||
retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_LEFT_TRIGGER]) ? 1 : 0;
|
||||
break;
|
||||
retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_LEFT_TRIGGER]) ? 1 : 0;
|
||||
break;
|
||||
case RETRO_DEVICE_ID_JOYPAD_R:
|
||||
retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_RIGHT_TRIGGER]) ? 1 : 0;
|
||||
break;
|
||||
retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_RIGHT_TRIGGER]) ? 1 : 0;
|
||||
break;
|
||||
case RETRO_DEVICE_ID_JOYPAD_L2:
|
||||
retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_WHITE]) ? 1 : 0;
|
||||
break;
|
||||
retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_WHITE]) ? 1 : 0;
|
||||
break;
|
||||
case RETRO_DEVICE_ID_JOYPAD_R2:
|
||||
retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_BLACK]) ? 1 : 0;
|
||||
break;
|
||||
retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_BLACK]) ? 1 : 0;
|
||||
break;
|
||||
case RETRO_DEVICE_ID_JOYPAD_L3:
|
||||
retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB) ? 1 : 0;
|
||||
break;
|
||||
retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB) ? 1 : 0;
|
||||
break;
|
||||
case RETRO_DEVICE_ID_JOYPAD_R3:
|
||||
retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) ? 1 : 0;
|
||||
break;
|
||||
retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) ? 1 : 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
return retval;
|
||||
|
Loading…
x
Reference in New Issue
Block a user