diff --git a/360/main.c b/360/main.c index 47d65fb54b..37eab22f0d 100644 --- a/360/main.c +++ b/360/main.c @@ -324,72 +324,6 @@ static void get_environment_settings (void) 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[]) { get_environment_settings(); @@ -415,9 +349,6 @@ begin_loop: do{ repeat = ssnes_main_iterate(); }while(repeat && !g_console.frame_advance_enable); - - if(g_console.ingame_menu_enable) - ingame_menu(); } else if(g_console.mode_switch == MODE_MENU) { diff --git a/360/menu.cpp b/360/menu.cpp index 646b542ef3..6bcb8d7b5d 100644 --- a/360/menu.cpp +++ b/360/menu.cpp @@ -275,10 +275,16 @@ void menu_loop(void) HRESULT hr; xdk360_video_t *vid = (xdk360_video_t*)g_d3d; + if(g_console.ingame_menu_enable) + xdk360_block_swap(); + do { 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, 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; if(g_console.mode_switch == MODE_EMULATION) - SET_TIMER_EXPIRATION(60); + { + SET_TIMER_EXPIRATION(30); + } app.RunFrame(); /* Update XUI */ hr = app.Render(); /* Render XUI */ @@ -300,4 +308,8 @@ void menu_loop(void) /* Present the frame */ vid->xdk360_render_device->Present(NULL, NULL, NULL, NULL); }while(g_console.menu_enable); + + if(g_console.ingame_menu_enable) + xdk360_unblock_swap(); + g_console.ingame_menu_enable = false; } diff --git a/360/xdk360_input.cpp b/360/xdk360_input.cpp index 7cb5009cdb..5bac7dabe6 100644 --- a/360/xdk360_input.cpp +++ b/360/xdk360_input.cpp @@ -105,7 +105,7 @@ static bool xdk360_key_pressed(void *data, int key) case SSNES_FRAMEADVANCE: if(g_console.frame_advance_enable) { - g_console.menu_enable = false; + g_console.menu_enable = true; g_console.ingame_menu_enable = true; g_console.mode_switch = MODE_EMULATION; } @@ -113,6 +113,7 @@ static bool xdk360_key_pressed(void *data, int key) case SSNES_REWIND: return ((state[0].Gamepad.sThumbRY > DEADZONE) && !(state[0].Gamepad.bRightTrigger > 128)); case SSNES_QUIT_KEY: + if(IS_TIMER_EXPIRED()) { 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); @@ -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.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; - SET_TIMER_EXPIRATION(60); + SET_TIMER_EXPIRATION(30); retval = g_console.menu_enable; } - else - { - g_console.mode_switch = MODE_EMULATION; - retval = g_console.ingame_menu_enable; - } + + retval = g_console.ingame_menu_enable ? g_console.ingame_menu_enable : g_console.menu_enable; } }