mirror of
https://github.com/libretro/RetroArch
synced 2025-01-27 12:35:23 +00:00
(360) Added new ingame menu (Right thumb stick) - will still have
to add a 'Quick Menu'
This commit is contained in:
parent
9969474326
commit
beeb660103
69
360/main.c
69
360/main.c
@ -324,72 +324,6 @@ static void get_environment_settings (void)
|
|||||||
strlcpy(SYS_CONFIG_FILE, "game:\\ssnes.cfg", sizeof(SYS_CONFIG_FILE));
|
strlcpy(SYS_CONFIG_FILE, "game:\\ssnes.cfg", sizeof(SYS_CONFIG_FILE));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ingame_menu (void)
|
|
||||||
{
|
|
||||||
uint32_t menuitem_colors[MENU_ITEM_LAST];
|
|
||||||
char comment[256];
|
|
||||||
xdk360_video_t *vid = (xdk360_video_t*)g_d3d;
|
|
||||||
|
|
||||||
xdk360_block_swap();
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
XINPUT_STATE state;
|
|
||||||
XInputGetState(0, &state);
|
|
||||||
static uint64_t blocking = 0;
|
|
||||||
|
|
||||||
ssnes_render_cached_frame();
|
|
||||||
|
|
||||||
if(IS_TIMER_EXPIRED() && blocking == false)
|
|
||||||
{
|
|
||||||
if(state.Gamepad.wButtons & XINPUT_GAMEPAD_B)
|
|
||||||
{
|
|
||||||
g_console.frame_advance_enable = false;
|
|
||||||
g_console.ingame_menu_item = 0;
|
|
||||||
g_console.ingame_menu_enable = false;
|
|
||||||
g_console.mode_switch = MODE_EMULATION;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch(g_console.ingame_menu_item)
|
|
||||||
{
|
|
||||||
case MENU_ITEM_LOAD_STATE:
|
|
||||||
break;
|
|
||||||
case MENU_ITEM_SAVE_STATE:
|
|
||||||
break;
|
|
||||||
case MENU_ITEM_KEEP_ASPECT_RATIO:
|
|
||||||
break;
|
|
||||||
case MENU_ITEM_OVERSCAN_AMOUNT:
|
|
||||||
break;
|
|
||||||
case MENU_ITEM_ORIENTATION:
|
|
||||||
break;
|
|
||||||
case MENU_ITEM_FRAME_ADVANCE:
|
|
||||||
break;
|
|
||||||
case MENU_ITEM_RESIZE_MODE:
|
|
||||||
break;
|
|
||||||
case MENU_ITEM_SCREENSHOT_MODE:
|
|
||||||
break;
|
|
||||||
case MENU_ITEM_RETURN_TO_GAME:
|
|
||||||
break;
|
|
||||||
case MENU_ITEM_RESET:
|
|
||||||
break;
|
|
||||||
case MENU_ITEM_RETURN_TO_MENU:
|
|
||||||
break;
|
|
||||||
case MENU_ITEM_RETURN_TO_DASHBOARD:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
float x_position = 0.3f;
|
|
||||||
float font_size = 1.1f;
|
|
||||||
float ypos = 0.19f;
|
|
||||||
float ypos_increment = 0.04f;
|
|
||||||
|
|
||||||
vid->xdk360_render_device->Present(NULL, NULL, NULL, NULL);
|
|
||||||
}
|
|
||||||
}while(g_console.ingame_menu_enable);
|
|
||||||
|
|
||||||
xdk360_unblock_swap();
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
get_environment_settings();
|
get_environment_settings();
|
||||||
@ -415,9 +349,6 @@ begin_loop:
|
|||||||
do{
|
do{
|
||||||
repeat = ssnes_main_iterate();
|
repeat = ssnes_main_iterate();
|
||||||
}while(repeat && !g_console.frame_advance_enable);
|
}while(repeat && !g_console.frame_advance_enable);
|
||||||
|
|
||||||
if(g_console.ingame_menu_enable)
|
|
||||||
ingame_menu();
|
|
||||||
}
|
}
|
||||||
else if(g_console.mode_switch == MODE_MENU)
|
else if(g_console.mode_switch == MODE_MENU)
|
||||||
{
|
{
|
||||||
|
16
360/menu.cpp
16
360/menu.cpp
@ -275,10 +275,16 @@ void menu_loop(void)
|
|||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
xdk360_video_t *vid = (xdk360_video_t*)g_d3d;
|
xdk360_video_t *vid = (xdk360_video_t*)g_d3d;
|
||||||
|
|
||||||
|
if(g_console.ingame_menu_enable)
|
||||||
|
xdk360_block_swap();
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
g_frame_count++;
|
g_frame_count++;
|
||||||
vid->xdk360_render_device->Clear(0, NULL,
|
if(g_console.ingame_menu_enable)
|
||||||
|
ssnes_render_cached_frame();
|
||||||
|
else
|
||||||
|
vid->xdk360_render_device->Clear(0, NULL,
|
||||||
D3DCLEAR_TARGET | D3DCLEAR_STENCIL | D3DCLEAR_ZBUFFER,
|
D3DCLEAR_TARGET | D3DCLEAR_STENCIL | D3DCLEAR_ZBUFFER,
|
||||||
D3DCOLOR_ARGB(255, 32, 32, 64), 1.0, 0);
|
D3DCOLOR_ARGB(255, 32, 32, 64), 1.0, 0);
|
||||||
|
|
||||||
@ -291,7 +297,9 @@ void menu_loop(void)
|
|||||||
g_console.mode_switch = g_console.menu_enable ? MODE_MENU : MODE_EMULATION;
|
g_console.mode_switch = g_console.menu_enable ? MODE_MENU : MODE_EMULATION;
|
||||||
|
|
||||||
if(g_console.mode_switch == MODE_EMULATION)
|
if(g_console.mode_switch == MODE_EMULATION)
|
||||||
SET_TIMER_EXPIRATION(60);
|
{
|
||||||
|
SET_TIMER_EXPIRATION(30);
|
||||||
|
}
|
||||||
|
|
||||||
app.RunFrame(); /* Update XUI */
|
app.RunFrame(); /* Update XUI */
|
||||||
hr = app.Render(); /* Render XUI */
|
hr = app.Render(); /* Render XUI */
|
||||||
@ -300,4 +308,8 @@ void menu_loop(void)
|
|||||||
/* Present the frame */
|
/* Present the frame */
|
||||||
vid->xdk360_render_device->Present(NULL, NULL, NULL, NULL);
|
vid->xdk360_render_device->Present(NULL, NULL, NULL, NULL);
|
||||||
}while(g_console.menu_enable);
|
}while(g_console.menu_enable);
|
||||||
|
|
||||||
|
if(g_console.ingame_menu_enable)
|
||||||
|
xdk360_unblock_swap();
|
||||||
|
g_console.ingame_menu_enable = false;
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ static bool xdk360_key_pressed(void *data, int key)
|
|||||||
case SSNES_FRAMEADVANCE:
|
case SSNES_FRAMEADVANCE:
|
||||||
if(g_console.frame_advance_enable)
|
if(g_console.frame_advance_enable)
|
||||||
{
|
{
|
||||||
g_console.menu_enable = false;
|
g_console.menu_enable = true;
|
||||||
g_console.ingame_menu_enable = true;
|
g_console.ingame_menu_enable = true;
|
||||||
g_console.mode_switch = MODE_EMULATION;
|
g_console.mode_switch = MODE_EMULATION;
|
||||||
}
|
}
|
||||||
@ -113,6 +113,7 @@ static bool xdk360_key_pressed(void *data, int key)
|
|||||||
case SSNES_REWIND:
|
case SSNES_REWIND:
|
||||||
return ((state[0].Gamepad.sThumbRY > DEADZONE) && !(state[0].Gamepad.bRightTrigger > 128));
|
return ((state[0].Gamepad.sThumbRY > DEADZONE) && !(state[0].Gamepad.bRightTrigger > 128));
|
||||||
case SSNES_QUIT_KEY:
|
case SSNES_QUIT_KEY:
|
||||||
|
if(IS_TIMER_EXPIRED())
|
||||||
{
|
{
|
||||||
uint32_t left_thumb_pressed = (state[0].Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB);
|
uint32_t left_thumb_pressed = (state[0].Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB);
|
||||||
uint32_t right_thumb_pressed = (state[0].Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB);
|
uint32_t right_thumb_pressed = (state[0].Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB);
|
||||||
@ -120,17 +121,15 @@ static bool xdk360_key_pressed(void *data, int key)
|
|||||||
g_console.menu_enable = right_thumb_pressed && left_thumb_pressed && IS_TIMER_EXPIRED();
|
g_console.menu_enable = right_thumb_pressed && left_thumb_pressed && IS_TIMER_EXPIRED();
|
||||||
g_console.ingame_menu_enable = right_thumb_pressed && !left_thumb_pressed;
|
g_console.ingame_menu_enable = right_thumb_pressed && !left_thumb_pressed;
|
||||||
|
|
||||||
if(g_console.menu_enable && !g_console.ingame_menu_enable)
|
if(g_console.menu_enable || (g_console.ingame_menu_enable
|
||||||
|
&& !g_console.menu_enable))
|
||||||
{
|
{
|
||||||
g_console.mode_switch = MODE_MENU;
|
g_console.mode_switch = MODE_MENU;
|
||||||
SET_TIMER_EXPIRATION(60);
|
SET_TIMER_EXPIRATION(30);
|
||||||
retval = g_console.menu_enable;
|
retval = g_console.menu_enable;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
retval = g_console.ingame_menu_enable ? g_console.ingame_menu_enable : g_console.menu_enable;
|
||||||
g_console.mode_switch = MODE_EMULATION;
|
|
||||||
retval = g_console.ingame_menu_enable;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user