From 0da3b628c63c7845647ac7f4291fed9dfe3258e4 Mon Sep 17 00:00:00 2001 From: freakdave Date: Mon, 6 Aug 2012 15:08:10 +0200 Subject: [PATCH 1/2] (Xbox 1) Fixed lockups that occurred due to negative viewport coordinates (X,Y in Resize Mode) --- console/rmenu/rmenu.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/console/rmenu/rmenu.c b/console/rmenu/rmenu.c index b8af014e50..360278d9cf 100644 --- a/console/rmenu/rmenu.c +++ b/console/rmenu/rmenu.c @@ -1874,9 +1874,11 @@ static void ingame_menu_resize(item *items, menu *current_menu, uint64_t input) gfx_ctx_set_aspect_ratio(NULL, g_console.aspect_ratio_index); if(input & (1 << RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_LEFT)) - g_console.viewports.custom_vp.x -= 4; + if(g_console.viewports.custom_vp.x >= 4) + g_console.viewports.custom_vp.x -= 4; else if(input & (1 << RETRO_DEVICE_ID_JOYPAD_LEFT)) - g_console.viewports.custom_vp.x -= 1; + if(g_console.viewports.custom_vp.x > 0) + g_console.viewports.custom_vp.x -= 1; if(input & (1 << RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_RIGHT)) g_console.viewports.custom_vp.x += 4; @@ -1889,9 +1891,11 @@ static void ingame_menu_resize(item *items, menu *current_menu, uint64_t input) g_console.viewports.custom_vp.y += 1; if(input & (1 << RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_DOWN)) - g_console.viewports.custom_vp.y -= 4; + if(g_console.viewports.custom_vp.y >= 4) + g_console.viewports.custom_vp.y -= 4; else if(input & (1 << RETRO_DEVICE_ID_JOYPAD_DOWN)) - g_console.viewports.custom_vp.y -= 1; + if(g_console.viewports.custom_vp.y > 0) + g_console.viewports.custom_vp.y -= 1; if(input & (1 << RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_LEFT)) g_console.viewports.custom_vp.width -= 4; From 64ef86ce06546bb6018a0db5929604b7422c6329 Mon Sep 17 00:00:00 2001 From: freakdave Date: Mon, 6 Aug 2012 15:15:58 +0200 Subject: [PATCH 2/2] (Xbox 1) Added ifdef's to the viewport fix, i don't know if other platforms allow negative values. --- console/rmenu/rmenu.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/console/rmenu/rmenu.c b/console/rmenu/rmenu.c index 360278d9cf..e5c4ac60d9 100644 --- a/console/rmenu/rmenu.c +++ b/console/rmenu/rmenu.c @@ -1874,10 +1874,14 @@ static void ingame_menu_resize(item *items, menu *current_menu, uint64_t input) gfx_ctx_set_aspect_ratio(NULL, g_console.aspect_ratio_index); if(input & (1 << RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_LEFT)) +#ifdef _XBOX1 if(g_console.viewports.custom_vp.x >= 4) +#endif g_console.viewports.custom_vp.x -= 4; else if(input & (1 << RETRO_DEVICE_ID_JOYPAD_LEFT)) +#ifdef _XBOX1 if(g_console.viewports.custom_vp.x > 0) +#endif g_console.viewports.custom_vp.x -= 1; if(input & (1 << RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_RIGHT)) @@ -1891,10 +1895,14 @@ static void ingame_menu_resize(item *items, menu *current_menu, uint64_t input) g_console.viewports.custom_vp.y += 1; if(input & (1 << RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_DOWN)) +#ifdef _XBOX1 if(g_console.viewports.custom_vp.y >= 4) +#endif g_console.viewports.custom_vp.y -= 4; else if(input & (1 << RETRO_DEVICE_ID_JOYPAD_DOWN)) +#ifdef _XBOX1 if(g_console.viewports.custom_vp.y > 0) +#endif g_console.viewports.custom_vp.y -= 1; if(input & (1 << RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_LEFT))