mirror of
https://github.com/libretro/RetroArch
synced 2025-02-26 06:40:39 +00:00
(RMenu) L and R buttons now toggle between drive mappings
This commit is contained in:
parent
fcbcf03f65
commit
32df722960
@ -47,6 +47,17 @@
|
|||||||
|
|
||||||
#define NUM_ENTRY_PER_PAGE 15
|
#define NUM_ENTRY_PER_PAGE 15
|
||||||
|
|
||||||
|
#define DRIVE_MAPPING_SIZE 4
|
||||||
|
|
||||||
|
const char drive_mappings[DRIVE_MAPPING_SIZE][32] = {
|
||||||
|
"/app_home/",
|
||||||
|
"/dev_hdd0/",
|
||||||
|
"/dev_hdd1/",
|
||||||
|
"/host_root/"
|
||||||
|
};
|
||||||
|
|
||||||
|
unsigned char drive_mapping_idx = 1;
|
||||||
|
|
||||||
static void rmenu_ctx_ps3_clear(void)
|
static void rmenu_ctx_ps3_clear(void)
|
||||||
{
|
{
|
||||||
gfx_ctx_clear();
|
gfx_ctx_clear();
|
||||||
@ -144,6 +155,20 @@ static void rmenu_ctx_ps3_screenshot_dump(void *data)
|
|||||||
(void)data;
|
(void)data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const char * rmenu_ctx_ps3_drive_mapping_previous(void)
|
||||||
|
{
|
||||||
|
if(drive_mapping_idx > 0)
|
||||||
|
drive_mapping_idx--;
|
||||||
|
return drive_mappings[drive_mapping_idx];
|
||||||
|
}
|
||||||
|
|
||||||
|
static const char * rmenu_ctx_ps3_drive_mapping_next(void)
|
||||||
|
{
|
||||||
|
if((drive_mapping_idx + 1) < DRIVE_MAPPING_SIZE)
|
||||||
|
drive_mapping_idx++;
|
||||||
|
return drive_mappings[drive_mapping_idx];
|
||||||
|
}
|
||||||
|
|
||||||
const rmenu_context_t rmenu_ctx_ps3 = {
|
const rmenu_context_t rmenu_ctx_ps3 = {
|
||||||
.clear = rmenu_ctx_ps3_clear,
|
.clear = rmenu_ctx_ps3_clear,
|
||||||
.blend = rmenu_ctx_ps3_blend,
|
.blend = rmenu_ctx_ps3_blend,
|
||||||
@ -157,4 +182,6 @@ const rmenu_context_t rmenu_ctx_ps3 = {
|
|||||||
.screenshot_dump = rmenu_ctx_ps3_screenshot_dump,
|
.screenshot_dump = rmenu_ctx_ps3_screenshot_dump,
|
||||||
.swap_buffers = rmenu_ctx_ps3_swap_buffers,
|
.swap_buffers = rmenu_ctx_ps3_swap_buffers,
|
||||||
.set_default_pos = rmenu_ctx_ps3_set_default_pos,
|
.set_default_pos = rmenu_ctx_ps3_set_default_pos,
|
||||||
|
.drive_mapping_prev = rmenu_ctx_ps3_drive_mapping_previous,
|
||||||
|
.drive_mapping_next = rmenu_ctx_ps3_drive_mapping_next,
|
||||||
};
|
};
|
||||||
|
@ -44,6 +44,18 @@
|
|||||||
|
|
||||||
#define NUM_ENTRY_PER_PAGE 12
|
#define NUM_ENTRY_PER_PAGE 12
|
||||||
|
|
||||||
|
#define DRIVE_MAPPING_SIZE 5
|
||||||
|
|
||||||
|
const char drive_mappings[DRIVE_MAPPING_SIZE][32] = {
|
||||||
|
"C:",
|
||||||
|
"D:",
|
||||||
|
"E:",
|
||||||
|
"F:",
|
||||||
|
"G:"
|
||||||
|
};
|
||||||
|
|
||||||
|
unsigned char drive_mapping_idx = 1;
|
||||||
|
|
||||||
int xpos, ypos;
|
int xpos, ypos;
|
||||||
texture_image m_menuMainRomSelectPanel;
|
texture_image m_menuMainRomSelectPanel;
|
||||||
texture_image m_menuMainBG;
|
texture_image m_menuMainBG;
|
||||||
@ -157,6 +169,20 @@ static void rmenu_ctx_xdk_screenshot_dump(void *data)
|
|||||||
gfx_ctx_xdk_screenshot_dump(NULL);
|
gfx_ctx_xdk_screenshot_dump(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const char * rmenu_ctx_xdk_drive_mapping_previous(void)
|
||||||
|
{
|
||||||
|
if(drive_mapping_idx > 0)
|
||||||
|
drive_mapping_idx--;
|
||||||
|
return drive_mappings[drive_mapping_idx];
|
||||||
|
}
|
||||||
|
|
||||||
|
static const char * rmenu_ctx_xdk_drive_mapping_next(void)
|
||||||
|
{
|
||||||
|
if((drive_mapping_idx + 1) < DRIVE_MAPPING_SIZE)
|
||||||
|
drive_mapping_idx++;
|
||||||
|
return drive_mappings[drive_mapping_idx];
|
||||||
|
}
|
||||||
|
|
||||||
const rmenu_context_t rmenu_ctx_xdk = {
|
const rmenu_context_t rmenu_ctx_xdk = {
|
||||||
rmenu_ctx_xdk_clear,
|
rmenu_ctx_xdk_clear,
|
||||||
rmenu_ctx_xdk_blend,
|
rmenu_ctx_xdk_blend,
|
||||||
@ -170,4 +196,6 @@ const rmenu_context_t rmenu_ctx_xdk = {
|
|||||||
rmenu_ctx_xdk_screenshot_dump,
|
rmenu_ctx_xdk_screenshot_dump,
|
||||||
rmenu_ctx_xdk_swap_buffers,
|
rmenu_ctx_xdk_swap_buffers,
|
||||||
rmenu_ctx_xdk_set_default_pos,
|
rmenu_ctx_xdk_set_default_pos,
|
||||||
|
rmenu_ctx_xdk_drive_mapping_previous,
|
||||||
|
rmenu_ctx_xdk_drive_mapping_next,
|
||||||
};
|
};
|
||||||
|
@ -84,6 +84,8 @@ typedef enum {
|
|||||||
MENU_ROMSELECT_ACTION_OK,
|
MENU_ROMSELECT_ACTION_OK,
|
||||||
MENU_ROMSELECT_ACTION_GOTO_SETTINGS,
|
MENU_ROMSELECT_ACTION_GOTO_SETTINGS,
|
||||||
MENU_ROMSELECT_ACTION_NOOP,
|
MENU_ROMSELECT_ACTION_NOOP,
|
||||||
|
MENU_DRIVE_MAPPING_PREV,
|
||||||
|
MENU_DRIVE_MAPPING_NEXT
|
||||||
} menu_romselect_action_t;
|
} menu_romselect_action_t;
|
||||||
|
|
||||||
static const struct retro_keybind _rmenu_nav_binds[] = {
|
static const struct retro_keybind _rmenu_nav_binds[] = {
|
||||||
@ -1652,6 +1654,26 @@ static void menu_romselect_iterate(filebrowser_t *filebrowser, menu_romselect_ac
|
|||||||
|
|
||||||
switch(action)
|
switch(action)
|
||||||
{
|
{
|
||||||
|
case MENU_DRIVE_MAPPING_PREV:
|
||||||
|
{
|
||||||
|
const char * drive_map = context->drive_mapping_prev();
|
||||||
|
if(drive_map != NULL)
|
||||||
|
{
|
||||||
|
filebrowser_set_root_and_ext(filebrowser, rarch_console_get_rom_ext(), drive_map);
|
||||||
|
browser_update(filebrowser, 1 << RMENU_DEVICE_NAV_B, rarch_console_get_rom_ext());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case MENU_DRIVE_MAPPING_NEXT:
|
||||||
|
{
|
||||||
|
const char * drive_map = context->drive_mapping_next();
|
||||||
|
if(drive_map != NULL)
|
||||||
|
{
|
||||||
|
filebrowser_set_root_and_ext(filebrowser, rarch_console_get_rom_ext(), drive_map);
|
||||||
|
browser_update(filebrowser, 1 << RMENU_DEVICE_NAV_B, rarch_console_get_rom_ext());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case MENU_ROMSELECT_ACTION_OK:
|
case MENU_ROMSELECT_ACTION_OK:
|
||||||
if(filebrowser_get_current_path_isdir(filebrowser))
|
if(filebrowser_get_current_path_isdir(filebrowser))
|
||||||
ret = filebrowser_iterate(filebrowser, FILEBROWSER_ACTION_OK);
|
ret = filebrowser_iterate(filebrowser, FILEBROWSER_ACTION_OK);
|
||||||
@ -1685,6 +1707,10 @@ static void select_rom(menu *current_menu, uint64_t input)
|
|||||||
action = MENU_ROMSELECT_ACTION_GOTO_SETTINGS;
|
action = MENU_ROMSELECT_ACTION_GOTO_SETTINGS;
|
||||||
else if (input & (1 << RMENU_DEVICE_NAV_B))
|
else if (input & (1 << RMENU_DEVICE_NAV_B))
|
||||||
action = MENU_ROMSELECT_ACTION_OK;
|
action = MENU_ROMSELECT_ACTION_OK;
|
||||||
|
else if (input & (1 << RMENU_DEVICE_NAV_L1))
|
||||||
|
action = MENU_DRIVE_MAPPING_PREV;
|
||||||
|
else if (input & (1 << RMENU_DEVICE_NAV_R1))
|
||||||
|
action = MENU_DRIVE_MAPPING_NEXT;
|
||||||
|
|
||||||
if (action != MENU_ROMSELECT_ACTION_NOOP)
|
if (action != MENU_ROMSELECT_ACTION_NOOP)
|
||||||
menu_romselect_iterate(&browser, action);
|
menu_romselect_iterate(&browser, action);
|
||||||
|
@ -80,6 +80,8 @@ typedef struct rmenu_context
|
|||||||
void (*screenshot_dump)(void *data);
|
void (*screenshot_dump)(void *data);
|
||||||
void (*swap_buffers)(void);
|
void (*swap_buffers)(void);
|
||||||
void (*set_default_pos)(rmenu_default_positions_t *position);
|
void (*set_default_pos)(rmenu_default_positions_t *position);
|
||||||
|
const char * (*drive_mapping_prev)(void);
|
||||||
|
const char * (*drive_mapping_next)(void);
|
||||||
} rmenu_context_t;
|
} rmenu_context_t;
|
||||||
|
|
||||||
enum
|
enum
|
||||||
|
Loading…
x
Reference in New Issue
Block a user