mirror of
https://github.com/libretro/RetroArch
synced 2025-04-04 04:20:29 +00:00
(RMenu) menu_loop renamed into rmenu_iterate - iterates menu code for one frame
This commit is contained in:
parent
a570493672
commit
dacab094f0
@ -1146,19 +1146,20 @@ static void ingame_menu_resize (void)
|
|||||||
g_extern.console.rmenu.input_loop = INPUT_LOOP_MENU;
|
g_extern.console.rmenu.input_loop = INPUT_LOOP_MENU;
|
||||||
}
|
}
|
||||||
|
|
||||||
void menu_loop(void)
|
bool rmenu_iterate(void)
|
||||||
{
|
{
|
||||||
|
static bool preinit = true;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
xdk_d3d_video_t *device_ptr = (xdk_d3d_video_t*)driver.video_data;
|
xdk_d3d_video_t *device_ptr = (xdk_d3d_video_t*)driver.video_data;
|
||||||
|
|
||||||
g_extern.console.rmenu.state.rmenu.enable = true;
|
if(preinit)
|
||||||
|
|
||||||
device_ptr->block_swap = true;
|
|
||||||
|
|
||||||
g_extern.console.rmenu.input_loop = INPUT_LOOP_MENU;
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
|
device_ptr->block_swap = true;
|
||||||
|
g_extern.console.rmenu.input_loop = INPUT_LOOP_MENU;
|
||||||
|
g_extern.draw_menu = true;
|
||||||
|
preinit = false;
|
||||||
|
}
|
||||||
|
|
||||||
g_extern.frame_count++;
|
g_extern.frame_count++;
|
||||||
|
|
||||||
if(g_extern.console.emulator_initialized)
|
if(g_extern.console.emulator_initialized)
|
||||||
@ -1172,11 +1173,14 @@ void menu_loop(void)
|
|||||||
XINPUT_STATE state;
|
XINPUT_STATE state;
|
||||||
XInputGetState(0, &state);
|
XInputGetState(0, &state);
|
||||||
|
|
||||||
g_extern.console.rmenu.state.rmenu.enable = !((state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB)
|
bool rmenu_enable = !((state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB)
|
||||||
&& (state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) && (g_extern.console.emulator_initialized)
|
&& (state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) && (g_extern.console.emulator_initialized)
|
||||||
&& IS_TIMER_EXPIRED(0));
|
&& IS_TIMER_EXPIRED(0));
|
||||||
|
|
||||||
g_extern.console.rmenu.mode = g_extern.console.rmenu.state.rmenu.enable ? MODE_MENU : MODE_EMULATION;
|
g_extern.console.rmenu.mode = rmenu_enable ? MODE_MENU : MODE_EMULATION;
|
||||||
|
|
||||||
|
if(g_extern.console.rmenu.mode == MODE_EMULATION || g_extern.console.rmenu.mode == MODE_EXIT)
|
||||||
|
goto deinit;
|
||||||
|
|
||||||
switch(g_extern.console.rmenu.input_loop)
|
switch(g_extern.console.rmenu.input_loop)
|
||||||
{
|
{
|
||||||
@ -1204,10 +1208,6 @@ void menu_loop(void)
|
|||||||
hr = app.Render(); /* Render XUI */
|
hr = app.Render(); /* Render XUI */
|
||||||
hr = XuiTimersRun(); /* Update XUI timers */
|
hr = XuiTimersRun(); /* Update XUI timers */
|
||||||
|
|
||||||
if(g_extern.console.rmenu.mode == MODE_EMULATION && !(g_extern.lifecycle_state & (1ULL << RARCH_FRAMEADVANCE)))
|
|
||||||
{
|
|
||||||
SET_TIMER_EXPIRATION(0, 30);
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *message = msg_queue_pull(g_extern.msg_queue);
|
const char *message = msg_queue_pull(g_extern.msg_queue);
|
||||||
|
|
||||||
@ -1217,9 +1217,21 @@ void menu_loop(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
device_ptr->ctx_driver->swap_buffers();
|
device_ptr->ctx_driver->swap_buffers();
|
||||||
}while(g_extern.console.rmenu.state.rmenu.enable);
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
deinit:
|
||||||
|
if(!(g_extern.lifecycle_state & (1ULL << RARCH_FRAMEADVANCE)))
|
||||||
|
{
|
||||||
|
// set a timer delay so that we don't instantly switch back to the menu when
|
||||||
|
// press and holding L3 + R3 in the emulation loop (lasts for 30 frame ticks)
|
||||||
|
SET_TIMER_EXPIRATION(0, 30);
|
||||||
|
}
|
||||||
|
|
||||||
device_ptr->block_swap = false;
|
device_ptr->block_swap = false;
|
||||||
|
|
||||||
g_extern.console.rmenu.state.ingame_menu.enable = false;
|
g_extern.console.rmenu.state.ingame_menu.enable = false;
|
||||||
|
g_extern.draw_menu = false;
|
||||||
|
preinit = true;
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1943,7 +1943,6 @@ static void ingame_menu_screenshot(menu *current_menu, uint64_t input)
|
|||||||
if(input & (1ULL << RMENU_DEVICE_NAV_A))
|
if(input & (1ULL << RMENU_DEVICE_NAV_A))
|
||||||
{
|
{
|
||||||
menu_stack_pop();
|
menu_stack_pop();
|
||||||
device_ptr->ctx_driver->rmenu_enable(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(input & (1ULL << RMENU_DEVICE_NAV_B))
|
if(input & (1ULL << RMENU_DEVICE_NAV_B))
|
||||||
@ -2204,23 +2203,30 @@ void menu_free (void)
|
|||||||
rmenu_filebrowser_free();
|
rmenu_filebrowser_free();
|
||||||
}
|
}
|
||||||
|
|
||||||
void menu_loop(void)
|
bool rmenu_iterate(void)
|
||||||
{
|
{
|
||||||
|
static bool preinit = true;
|
||||||
|
const char *msg;
|
||||||
|
|
||||||
DEVICE_CAST device_ptr = (DEVICE_CAST)driver.video_data;
|
DEVICE_CAST device_ptr = (DEVICE_CAST)driver.video_data;
|
||||||
|
|
||||||
g_extern.console.rmenu.state.rmenu.enable = true;
|
menu current_menu;
|
||||||
|
|
||||||
|
if(preinit)
|
||||||
|
{
|
||||||
device_ptr->block_swap = true;
|
device_ptr->block_swap = true;
|
||||||
|
|
||||||
if(g_extern.console.rmenu.state.ingame_menu.enable)
|
if(g_extern.console.rmenu.state.ingame_menu.enable)
|
||||||
menu_stack_push(INGAME_MENU);
|
menu_stack_push(INGAME_MENU);
|
||||||
|
|
||||||
device_ptr->ctx_driver->rmenu_enable(true);
|
|
||||||
|
|
||||||
menu current_menu;
|
|
||||||
menu_stack_force_refresh();
|
menu_stack_force_refresh();
|
||||||
|
g_extern.draw_menu = true;
|
||||||
|
|
||||||
|
device_ptr->ctx_driver->rmenu_init();
|
||||||
|
|
||||||
|
preinit = false;
|
||||||
|
}
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
g_extern.frame_count++;
|
g_extern.frame_count++;
|
||||||
|
|
||||||
//first button input frame
|
//first button input frame
|
||||||
@ -2277,12 +2283,10 @@ void menu_loop(void)
|
|||||||
|
|
||||||
if(!show_menu_screen || current_menu.enum_id == INGAME_MENU_SCREENSHOT)
|
if(!show_menu_screen || current_menu.enum_id == INGAME_MENU_SCREENSHOT)
|
||||||
{
|
{
|
||||||
device_ptr->ctx_driver->rmenu_enable(false);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
device_ptr->ctx_driver->set_blend(true);
|
device_ptr->ctx_driver->set_blend(true);
|
||||||
device_ptr->ctx_driver->rmenu_enable(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rarch_render_cached_frame();
|
rarch_render_cached_frame();
|
||||||
@ -2365,24 +2369,20 @@ void menu_loop(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_extern.console.rmenu.state.rmenu.enable = !(((old_state & (1ULL << RMENU_DEVICE_NAV_L3)) && (old_state & (1ULL << RMENU_DEVICE_NAV_R3)) && g_extern.console.emulator_initialized));
|
bool rmenu_enable = !(((old_state & (1ULL << RMENU_DEVICE_NAV_L3)) && (old_state & (1ULL << RMENU_DEVICE_NAV_R3)) && g_extern.console.emulator_initialized));
|
||||||
g_extern.console.rmenu.mode = g_extern.console.rmenu.state.rmenu.enable ? MODE_MENU : MODE_EMULATION;
|
g_extern.console.rmenu.mode = rmenu_enable ? MODE_MENU : MODE_EMULATION;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// set a timer delay so that we don't instantly switch back to the menu when
|
if(g_extern.console.rmenu.mode == MODE_EMULATION || g_extern.console.rmenu.mode == MODE_EXIT)
|
||||||
// press and holding L3 + R3 in the emulation loop (lasts for 30 frame ticks)
|
goto deinit;
|
||||||
if(g_extern.console.rmenu.mode == MODE_EMULATION && !(g_extern.lifecycle_state & (1ULL << RARCH_FRAMEADVANCE)))
|
|
||||||
|
msg = msg_queue_pull(g_extern.msg_queue);
|
||||||
|
|
||||||
|
if (msg && g_extern.console.rmenu.state.msg_info.enable)
|
||||||
{
|
{
|
||||||
SET_TIMER_EXPIRATION(0, 30);
|
device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.msg_queue_x_position, default_pos.msg_queue_y_position, default_pos.msg_queue_font_size, WHITE, msg);
|
||||||
}
|
|
||||||
|
|
||||||
const char * message = msg_queue_pull(g_extern.msg_queue);
|
|
||||||
|
|
||||||
if (message && g_extern.console.rmenu.state.msg_info.enable)
|
|
||||||
{
|
|
||||||
device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.msg_queue_x_position, default_pos.msg_queue_y_position, default_pos.msg_queue_font_size, WHITE, message);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
device_ptr->ctx_driver->swap_buffers();
|
device_ptr->ctx_driver->swap_buffers();
|
||||||
@ -2395,14 +2395,27 @@ void menu_loop(void)
|
|||||||
{ }
|
{ }
|
||||||
else
|
else
|
||||||
device_ptr->ctx_driver->set_blend(false);
|
device_ptr->ctx_driver->set_blend(false);
|
||||||
}while(g_extern.console.rmenu.state.rmenu.enable);
|
|
||||||
|
|
||||||
device_ptr->ctx_driver->rmenu_enable(false);
|
return true;
|
||||||
|
|
||||||
|
deinit:
|
||||||
|
if (!(g_extern.lifecycle_state & (1ULL << RARCH_FRAMEADVANCE)))
|
||||||
|
{
|
||||||
|
// set a timer delay so that we don't instantly switch back to the menu when
|
||||||
|
// press and holding L3 + R3 in the emulation loop (lasts for 30 frame ticks)
|
||||||
|
SET_TIMER_EXPIRATION(0, 30);
|
||||||
|
}
|
||||||
|
|
||||||
if(g_extern.console.rmenu.state.ingame_menu.enable)
|
if(g_extern.console.rmenu.state.ingame_menu.enable)
|
||||||
menu_stack_pop();
|
menu_stack_pop();
|
||||||
|
|
||||||
device_ptr->block_swap = false;
|
device_ptr->block_swap = false;
|
||||||
|
g_extern.draw_menu = false;
|
||||||
g_extern.console.rmenu.state.ingame_menu.enable = false;
|
g_extern.console.rmenu.state.ingame_menu.enable = false;
|
||||||
|
|
||||||
|
device_ptr->ctx_driver->rmenu_free();
|
||||||
|
|
||||||
|
preinit = true;
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -206,7 +206,7 @@ enum
|
|||||||
#define MAX_NO_OF_CONTROLS_SETTINGS SETTING_CONTROLS_DEFAULT_ALL+1
|
#define MAX_NO_OF_CONTROLS_SETTINGS SETTING_CONTROLS_DEFAULT_ALL+1
|
||||||
|
|
||||||
void menu_init (void);
|
void menu_init (void);
|
||||||
void menu_loop (void);
|
bool rmenu_iterate(void);
|
||||||
void menu_free (void);
|
void menu_free (void);
|
||||||
|
|
||||||
#endif /* MENU_H_ */
|
#endif /* MENU_H_ */
|
||||||
|
@ -572,6 +572,7 @@ struct global
|
|||||||
#endif
|
#endif
|
||||||
} console;
|
} console;
|
||||||
|
|
||||||
|
bool draw_menu;
|
||||||
uint64_t lifecycle_state;
|
uint64_t lifecycle_state;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
|
@ -349,13 +349,13 @@ static void gfx_ctx_get_available_resolutions (void)
|
|||||||
|
|
||||||
#ifdef HAVE_RMENU
|
#ifdef HAVE_RMENU
|
||||||
#define DRIVE_MAPPING_SIZE 3
|
#define DRIVE_MAPPING_SIZE 3
|
||||||
bool rmenu_inited = false;
|
|
||||||
const char drive_mappings[DRIVE_MAPPING_SIZE][32] = {
|
const char drive_mappings[DRIVE_MAPPING_SIZE][32] = {
|
||||||
"/",
|
"/",
|
||||||
"/mnt/",
|
"/mnt/",
|
||||||
"/mnt/sdcard"
|
"/mnt/sdcard"
|
||||||
};
|
};
|
||||||
unsigned char drive_mapping_idx = 1;
|
unsigned char drive_mapping_idx = 1;
|
||||||
|
bool rmenu_inited = false;
|
||||||
|
|
||||||
static bool gfx_ctx_rmenu_init(void)
|
static bool gfx_ctx_rmenu_init(void)
|
||||||
{
|
{
|
||||||
@ -364,6 +364,9 @@ static bool gfx_ctx_rmenu_init(void)
|
|||||||
if (!gl)
|
if (!gl)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (rmenu_inited)
|
||||||
|
return true;
|
||||||
|
|
||||||
#ifdef HAVE_RMENU
|
#ifdef HAVE_RMENU
|
||||||
glGenTextures(1, &menu_texture_id);
|
glGenTextures(1, &menu_texture_id);
|
||||||
|
|
||||||
@ -452,22 +455,6 @@ static const char * rmenu_ctx_drive_mapping_next(void)
|
|||||||
drive_mapping_idx++;
|
drive_mapping_idx++;
|
||||||
return drive_mappings[drive_mapping_idx];
|
return drive_mappings[drive_mapping_idx];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_menu_enable(bool enable)
|
|
||||||
{
|
|
||||||
gl_t *gl = driver.video_data;
|
|
||||||
|
|
||||||
if (enable)
|
|
||||||
{
|
|
||||||
if(!rmenu_inited)
|
|
||||||
gfx_ctx_rmenu_init();
|
|
||||||
gl->draw_rmenu = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gfx_ctx_rmenu_free();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void rmenu_ctx_screenshot_enable(bool enable)
|
static void rmenu_ctx_screenshot_enable(bool enable)
|
||||||
|
@ -293,7 +293,7 @@ static void gfx_ctx_set_blend(bool enable)
|
|||||||
|
|
||||||
static void gfx_ctx_set_resize(unsigned width, unsigned height) { }
|
static void gfx_ctx_set_resize(unsigned width, unsigned height) { }
|
||||||
|
|
||||||
bool rmenu_inited = false;
|
static bool rmenu_inited = false;
|
||||||
|
|
||||||
static bool gfx_ctx_rmenu_init(void)
|
static bool gfx_ctx_rmenu_init(void)
|
||||||
{
|
{
|
||||||
@ -302,6 +302,9 @@ static bool gfx_ctx_rmenu_init(void)
|
|||||||
if (!gl)
|
if (!gl)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (rmenu_inited)
|
||||||
|
return true;
|
||||||
|
|
||||||
#ifdef HAVE_RMENU
|
#ifdef HAVE_RMENU
|
||||||
glGenTextures(1, &menu_texture_id);
|
glGenTextures(1, &menu_texture_id);
|
||||||
|
|
||||||
@ -335,24 +338,6 @@ static bool gfx_ctx_rmenu_init(void)
|
|||||||
#if defined(HAVE_RMENU)
|
#if defined(HAVE_RMENU)
|
||||||
static void gfx_ctx_rmenu_free(void)
|
static void gfx_ctx_rmenu_free(void)
|
||||||
{
|
{
|
||||||
gl_t *gl = driver.video_data;
|
|
||||||
gl->draw_rmenu = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_menu_enable(bool enable)
|
|
||||||
{
|
|
||||||
gl_t *gl = driver.video_data;
|
|
||||||
|
|
||||||
if (enable)
|
|
||||||
{
|
|
||||||
if(!rmenu_inited)
|
|
||||||
gfx_ctx_rmenu_init();
|
|
||||||
gl->draw_rmenu = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gfx_ctx_rmenu_free();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_rmenu_frame(void *data)
|
static void gfx_ctx_rmenu_frame(void *data)
|
||||||
@ -566,7 +551,6 @@ const gfx_ctx_driver_t gfx_ctx_ps3 = {
|
|||||||
gfx_ctx_rmenu_init,
|
gfx_ctx_rmenu_init,
|
||||||
gfx_ctx_rmenu_frame,
|
gfx_ctx_rmenu_frame,
|
||||||
gfx_ctx_rmenu_free,
|
gfx_ctx_rmenu_free,
|
||||||
gfx_ctx_menu_enable,
|
|
||||||
gfx_ctx_menu_draw_bg,
|
gfx_ctx_menu_draw_bg,
|
||||||
gfx_ctx_menu_draw_panel,
|
gfx_ctx_menu_draw_panel,
|
||||||
gfx_ctx_ps3_set_default_pos,
|
gfx_ctx_ps3_set_default_pos,
|
||||||
|
@ -88,8 +88,6 @@ unsigned m_menuMainRomListPos_x;
|
|||||||
unsigned m_menuMainRomListPos_y;
|
unsigned m_menuMainRomListPos_y;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool rmenu_inited = false;
|
|
||||||
|
|
||||||
static void gfx_ctx_xdk_set_blend(bool enable)
|
static void gfx_ctx_xdk_set_blend(bool enable)
|
||||||
{
|
{
|
||||||
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
|
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
|
||||||
@ -163,7 +161,6 @@ static bool gfx_ctx_xdk_menu_init(void)
|
|||||||
ypos = width == 640 ? 430 : 670;
|
ypos = width == 640 ? 430 : 670;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
rmenu_inited = true;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,20 +177,6 @@ static void gfx_ctx_xdk_menu_free(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_menu_enable(bool enable)
|
|
||||||
{
|
|
||||||
if (enable)
|
|
||||||
{
|
|
||||||
if(!rmenu_inited)
|
|
||||||
gfx_ctx_xdk_menu_init();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gfx_ctx_xdk_menu_free();
|
|
||||||
rmenu_inited = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_xdk_swap_buffers(void)
|
static void gfx_ctx_xdk_swap_buffers(void)
|
||||||
{
|
{
|
||||||
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
|
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
|
||||||
@ -538,7 +521,6 @@ const gfx_ctx_driver_t gfx_ctx_xdk = {
|
|||||||
gfx_ctx_xdk_menu_init,
|
gfx_ctx_xdk_menu_init,
|
||||||
gfx_ctx_xdk_menu_frame,
|
gfx_ctx_xdk_menu_frame,
|
||||||
gfx_ctx_xdk_menu_free,
|
gfx_ctx_xdk_menu_free,
|
||||||
gfx_ctx_menu_enable,
|
|
||||||
gfx_ctx_xdk_menu_draw_bg,
|
gfx_ctx_xdk_menu_draw_bg,
|
||||||
gfx_ctx_xdk_menu_draw_panel,
|
gfx_ctx_xdk_menu_draw_panel,
|
||||||
gfx_ctx_xdk_menu_set_default_pos,
|
gfx_ctx_xdk_menu_set_default_pos,
|
||||||
|
@ -114,7 +114,6 @@ typedef struct gfx_ctx_driver
|
|||||||
bool (*rmenu_init)(void);
|
bool (*rmenu_init)(void);
|
||||||
void (*rmenu_frame)(void *data);
|
void (*rmenu_frame)(void *data);
|
||||||
void (*rmenu_free)(void);
|
void (*rmenu_free)(void);
|
||||||
void (*rmenu_enable)(bool enable);
|
|
||||||
void (*rmenu_draw_bg)(rarch_position_t *position);
|
void (*rmenu_draw_bg)(rarch_position_t *position);
|
||||||
void (*rmenu_draw_panel)(rarch_position_t *position);
|
void (*rmenu_draw_panel)(rarch_position_t *position);
|
||||||
void (*rmenu_set_default_pos)(rmenu_default_positions_t *position);
|
void (*rmenu_set_default_pos)(rmenu_default_positions_t *position);
|
||||||
|
4
gfx/gl.c
4
gfx/gl.c
@ -1194,7 +1194,7 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei
|
|||||||
context_swap_buffers_func();
|
context_swap_buffers_func();
|
||||||
|
|
||||||
#ifdef HAVE_RMENU
|
#ifdef HAVE_RMENU
|
||||||
if (gl->draw_rmenu)
|
if (g_extern.draw_menu)
|
||||||
context_rmenu_frame_func(gl);
|
context_rmenu_frame_func(gl);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1747,7 +1747,6 @@ static void gl_restart(void)
|
|||||||
|
|
||||||
#ifdef HAVE_RMENU
|
#ifdef HAVE_RMENU
|
||||||
bool should_block_swap = gl->block_swap;
|
bool should_block_swap = gl->block_swap;
|
||||||
bool should_draw_rmenu = gl->draw_rmenu;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gl_stop();
|
gl_stop();
|
||||||
@ -1757,7 +1756,6 @@ static void gl_restart(void)
|
|||||||
gl_start();
|
gl_start();
|
||||||
|
|
||||||
#ifdef HAVE_RMENU
|
#ifdef HAVE_RMENU
|
||||||
gl->draw_rmenu = should_draw_rmenu;
|
|
||||||
gl->block_swap = should_block_swap;
|
gl->block_swap = should_block_swap;
|
||||||
SET_TIMER_EXPIRATION(0, 30);
|
SET_TIMER_EXPIRATION(0, 30);
|
||||||
#endif
|
#endif
|
||||||
|
@ -279,7 +279,6 @@ typedef struct gl
|
|||||||
|
|
||||||
#ifdef HAVE_RMENU
|
#ifdef HAVE_RMENU
|
||||||
bool block_swap;
|
bool block_swap;
|
||||||
bool draw_rmenu;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool egl_images;
|
bool egl_images;
|
||||||
|
@ -272,7 +272,7 @@ static bool folder_cb(const char *directory, rgui_file_enum_cb_t file_cb,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void menu_loop(void)
|
static bool rmenu_iterate(void)
|
||||||
{
|
{
|
||||||
gx_video_t *gx = (gx_video_t*)driver.video_data;
|
gx_video_t *gx = (gx_video_t*)driver.video_data;
|
||||||
|
|
||||||
@ -390,6 +390,8 @@ static void menu_loop(void)
|
|||||||
gx->menu_render = false;
|
gx->menu_render = false;
|
||||||
|
|
||||||
g_extern.console.rmenu.state.ingame_menu.enable = false;
|
g_extern.console.rmenu.state.ingame_menu.enable = false;
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void menu_init(void)
|
static void menu_init(void)
|
||||||
@ -586,7 +588,7 @@ begin_loop:
|
|||||||
}
|
}
|
||||||
else if(g_extern.console.rmenu.mode == MODE_MENU)
|
else if(g_extern.console.rmenu.mode == MODE_MENU)
|
||||||
{
|
{
|
||||||
menu_loop();
|
rmenu_iterate();
|
||||||
|
|
||||||
if (g_extern.console.rmenu.mode != MODE_EXIT)
|
if (g_extern.console.rmenu.mode != MODE_EXIT)
|
||||||
rarch_startup(default_paths.config_file);
|
rarch_startup(default_paths.config_file);
|
||||||
|
@ -98,9 +98,11 @@ void menu_init (void)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void menu_loop (void)
|
bool rmenu_iterate(void)
|
||||||
{
|
{
|
||||||
rarch_console_load_game_wrap("/dev_hdd0/game/SSNE10000/USRDIR/mm3.nes", 0, 0);
|
rarch_console_load_game_wrap("/dev_hdd0/game/SSNE10000/USRDIR/mm3.nes", 0, 0);
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void menu_free (void)
|
void menu_free (void)
|
||||||
@ -227,6 +229,8 @@ static void get_environment_settings(int argc, char *argv[])
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
bool repeat = false;
|
||||||
|
|
||||||
#ifdef HAVE_SYSUTILS
|
#ifdef HAVE_SYSUTILS
|
||||||
RARCH_LOG("Registering system utility callback...\n");
|
RARCH_LOG("Registering system utility callback...\n");
|
||||||
cellSysutilRegisterCallback(0, callback_sysutil_exit, NULL);
|
cellSysutilRegisterCallback(0, callback_sysutil_exit, NULL);
|
||||||
@ -344,8 +348,6 @@ int main(int argc, char *argv[])
|
|||||||
begin_loop:
|
begin_loop:
|
||||||
if(g_extern.console.rmenu.mode == MODE_EMULATION)
|
if(g_extern.console.rmenu.mode == MODE_EMULATION)
|
||||||
{
|
{
|
||||||
bool repeat = false;
|
|
||||||
|
|
||||||
input_ps3.poll(NULL);
|
input_ps3.poll(NULL);
|
||||||
|
|
||||||
driver.video->set_aspect_ratio(driver.video_data, g_settings.video.aspect_ratio_idx);
|
driver.video->set_aspect_ratio(driver.video_data, g_settings.video.aspect_ratio_idx);
|
||||||
@ -356,7 +358,9 @@ begin_loop:
|
|||||||
}
|
}
|
||||||
else if(g_extern.console.rmenu.mode == MODE_MENU)
|
else if(g_extern.console.rmenu.mode == MODE_MENU)
|
||||||
{
|
{
|
||||||
menu_loop();
|
do{
|
||||||
|
repeat = rmenu_iterate();
|
||||||
|
}while(repeat);
|
||||||
|
|
||||||
if (g_extern.console.rmenu.mode != MODE_EXIT)
|
if (g_extern.console.rmenu.mode != MODE_EXIT)
|
||||||
rarch_startup(default_paths.config_file);
|
rarch_startup(default_paths.config_file);
|
||||||
|
@ -93,13 +93,15 @@ void menu_init (void)
|
|||||||
g_extern.console.rmenu.mode = MODE_MENU;
|
g_extern.console.rmenu.mode = MODE_MENU;
|
||||||
}
|
}
|
||||||
|
|
||||||
void menu_loop (void)
|
bool rmenu_iterate(void)
|
||||||
{
|
{
|
||||||
char game_rom[256];
|
char game_rom[256];
|
||||||
snprintf(game_rom, sizeof(game_rom), "%s%s", default_paths.port_dir, "dkc.sfc");
|
snprintf(game_rom, sizeof(game_rom), "%s%s", default_paths.port_dir, "dkc.sfc");
|
||||||
RARCH_LOG("game ROM: %s\n", game_rom);
|
RARCH_LOG("game ROM: %s\n", game_rom);
|
||||||
rarch_console_load_game_wrap(game_rom, 0, 0);
|
rarch_console_load_game_wrap(game_rom, 0, 0);
|
||||||
g_extern.console.rmenu.mode = MODE_EMULATION;
|
g_extern.console.rmenu.mode = MODE_EMULATION;
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void menu_free (void)
|
void menu_free (void)
|
||||||
@ -156,9 +158,9 @@ int main(int argc, char *argv[])
|
|||||||
menu_init();
|
menu_init();
|
||||||
|
|
||||||
begin_loop:
|
begin_loop:
|
||||||
|
bool repeat = false;
|
||||||
if(g_extern.console.rmenu.mode == MODE_EMULATION)
|
if(g_extern.console.rmenu.mode == MODE_EMULATION)
|
||||||
{
|
{
|
||||||
bool repeat = false;
|
|
||||||
|
|
||||||
RARCH_LOG("Gets to: #2.0\n");
|
RARCH_LOG("Gets to: #2.0\n");
|
||||||
|
|
||||||
@ -179,7 +181,9 @@ begin_loop:
|
|||||||
}
|
}
|
||||||
else if(g_extern.console.rmenu.mode == MODE_MENU)
|
else if(g_extern.console.rmenu.mode == MODE_MENU)
|
||||||
{
|
{
|
||||||
menu_loop();
|
do{
|
||||||
|
repeat = rmenu_iterate();
|
||||||
|
}while(repeat);
|
||||||
|
|
||||||
if (g_extern.console.rmenu.mode != MODE_EXIT)
|
if (g_extern.console.rmenu.mode != MODE_EXIT)
|
||||||
rarch_startup(default_paths.config_file);
|
rarch_startup(default_paths.config_file);
|
||||||
|
@ -182,9 +182,9 @@ int main(int argc, char *argv[])
|
|||||||
menu_init();
|
menu_init();
|
||||||
|
|
||||||
begin_loop:
|
begin_loop:
|
||||||
|
bool repeat = false;
|
||||||
if(g_extern.console.rmenu.mode == MODE_EMULATION)
|
if(g_extern.console.rmenu.mode == MODE_EMULATION)
|
||||||
{
|
{
|
||||||
bool repeat = false;
|
|
||||||
|
|
||||||
input_xinput.poll(NULL);
|
input_xinput.poll(NULL);
|
||||||
|
|
||||||
@ -196,7 +196,9 @@ begin_loop:
|
|||||||
}
|
}
|
||||||
else if(g_extern.console.rmenu.mode == MODE_MENU)
|
else if(g_extern.console.rmenu.mode == MODE_MENU)
|
||||||
{
|
{
|
||||||
menu_loop();
|
do{
|
||||||
|
repeat = rmenu_iterate();
|
||||||
|
}while(repeat);
|
||||||
|
|
||||||
if (g_extern.console.rmenu.mode != MODE_EXIT)
|
if (g_extern.console.rmenu.mode != MODE_EXIT)
|
||||||
rarch_startup(default_paths.config_file);
|
rarch_startup(default_paths.config_file);
|
||||||
|
@ -19,6 +19,6 @@
|
|||||||
|
|
||||||
void menu_init (void);
|
void menu_init (void);
|
||||||
void menu_free (void);
|
void menu_free (void);
|
||||||
void menu_loop (void);
|
bool rmenu_iterate(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -610,7 +610,7 @@ static bool xdk_d3d_frame(void *data, const void *frame,
|
|||||||
#ifdef HAVE_FBO
|
#ifdef HAVE_FBO
|
||||||
D3DSurface* pRenderTarget0;
|
D3DSurface* pRenderTarget0;
|
||||||
#endif
|
#endif
|
||||||
bool menu_enabled = g_extern.console.rmenu.state.rmenu.enable;
|
bool menu_enabled = g_extern.draw_menu;
|
||||||
bool fps_enable = g_extern.console.rmenu.state.msg_fps.enable;
|
bool fps_enable = g_extern.console.rmenu.state.msg_fps.enable;
|
||||||
#ifdef _XBOX1
|
#ifdef _XBOX1
|
||||||
unsigned flicker_filter = g_extern.console.screen.state.flicker_filter.value;
|
unsigned flicker_filter = g_extern.console.screen.state.flicker_filter.value;
|
||||||
@ -817,7 +817,7 @@ static bool xdk_d3d_frame(void *data, const void *frame,
|
|||||||
&& !menu_enabled
|
&& !menu_enabled
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
d3d->font_ctx->render_msg_place(d3d, msg_width, msg_height, 0.0f, 0, msg); //TODO: dehardcode x/y here for HD (720p) mode
|
d3d->font_ctx->render_msg_place(d3d, msg_width, msg_height, 0.0f, 0, msg);
|
||||||
|
|
||||||
if(!d3d->block_swap)
|
if(!d3d->block_swap)
|
||||||
gfx_ctx_xdk_swap_buffers();
|
gfx_ctx_xdk_swap_buffers();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user