2013-04-17 21:31:49 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
|
|
|
* Copyright (C) 2010-2013 - Hans-Kristian Arntzen
|
|
|
|
* Copyright (C) 2011-2013 - Daniel De Matteis
|
|
|
|
*
|
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* of the GNU General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MENU_COMMON_H__
|
|
|
|
#define MENU_COMMON_H__
|
|
|
|
|
2013-04-28 13:25:22 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "../../config.h"
|
|
|
|
#endif
|
|
|
|
|
2013-04-28 13:00:37 +00:00
|
|
|
#ifdef HAVE_RGUI
|
|
|
|
#define MENU_TEXTURE_FULLSCREEN false
|
|
|
|
#else
|
|
|
|
#define MENU_TEXTURE_FULLSCREEN true
|
|
|
|
#endif
|
|
|
|
|
2013-04-17 21:31:49 +00:00
|
|
|
#ifndef __cplusplus
|
|
|
|
#include <stdbool.h>
|
|
|
|
#else
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_FILEBROWSER
|
|
|
|
#include "utils/file_browser.h"
|
|
|
|
#else
|
|
|
|
#include "utils/file_list.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
|
|
|
|
#define HAVE_SHADER_MANAGER
|
|
|
|
#include "../../gfx/shader_parse.h"
|
|
|
|
#endif
|
|
|
|
|
2013-04-27 22:35:20 +00:00
|
|
|
#include "history.h"
|
|
|
|
|
2013-04-17 21:31:49 +00:00
|
|
|
#define RGUI_MAX_SHADERS 8
|
|
|
|
|
2013-04-18 17:08:17 +00:00
|
|
|
#if defined(HAVE_RMENU) || defined(HAVE_RMENU_XUI)
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
DEVICE_NAV_UP = 0,
|
|
|
|
DEVICE_NAV_DOWN,
|
|
|
|
DEVICE_NAV_LEFT,
|
|
|
|
DEVICE_NAV_RIGHT,
|
|
|
|
DEVICE_NAV_UP_ANALOG_L,
|
|
|
|
DEVICE_NAV_DOWN_ANALOG_L,
|
|
|
|
DEVICE_NAV_LEFT_ANALOG_L,
|
|
|
|
DEVICE_NAV_RIGHT_ANALOG_L,
|
|
|
|
DEVICE_NAV_UP_ANALOG_R,
|
|
|
|
DEVICE_NAV_DOWN_ANALOG_R,
|
|
|
|
DEVICE_NAV_LEFT_ANALOG_R,
|
|
|
|
DEVICE_NAV_RIGHT_ANALOG_R,
|
|
|
|
DEVICE_NAV_B,
|
|
|
|
DEVICE_NAV_A,
|
|
|
|
DEVICE_NAV_X,
|
|
|
|
DEVICE_NAV_Y,
|
|
|
|
DEVICE_NAV_START,
|
|
|
|
DEVICE_NAV_SELECT,
|
|
|
|
DEVICE_NAV_L1,
|
|
|
|
DEVICE_NAV_R1,
|
|
|
|
DEVICE_NAV_L2,
|
|
|
|
DEVICE_NAV_R2,
|
2013-04-27 12:52:12 +00:00
|
|
|
DEVICE_NAV_MENU,
|
2013-04-18 17:08:17 +00:00
|
|
|
DEVICE_NAV_LAST
|
|
|
|
};
|
2013-04-18 21:00:27 +00:00
|
|
|
#elif defined(HAVE_RGUI)
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
DEVICE_NAV_UP = 0,
|
|
|
|
DEVICE_NAV_DOWN,
|
|
|
|
DEVICE_NAV_LEFT,
|
|
|
|
DEVICE_NAV_RIGHT,
|
|
|
|
DEVICE_NAV_A,
|
|
|
|
DEVICE_NAV_B,
|
|
|
|
DEVICE_NAV_START,
|
|
|
|
DEVICE_NAV_SELECT,
|
|
|
|
DEVICE_NAV_MENU,
|
|
|
|
DEVICE_NAV_LAST
|
|
|
|
};
|
2013-04-18 17:08:17 +00:00
|
|
|
#endif
|
|
|
|
|
2013-04-17 21:31:49 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
RGUI_FILE_PLAIN,
|
|
|
|
RGUI_FILE_DIRECTORY,
|
|
|
|
RGUI_FILE_DEVICE,
|
|
|
|
RGUI_SETTINGS,
|
|
|
|
|
|
|
|
// Shader stuff
|
2013-04-27 22:32:25 +00:00
|
|
|
RGUI_SETTINGS_VIDEO_OPTIONS,
|
2013-04-27 23:41:38 +00:00
|
|
|
#ifdef GEKKO
|
|
|
|
RGUI_SETTINGS_VIDEO_RESOLUTION,
|
|
|
|
#endif
|
|
|
|
RGUI_SETTINGS_VIDEO_FILTER,
|
|
|
|
RGUI_SETTINGS_VIDEO_SOFT_FILTER,
|
|
|
|
RGUI_SETTINGS_VIDEO_GAMMA,
|
|
|
|
RGUI_SETTINGS_VIDEO_INTEGER_SCALE,
|
|
|
|
RGUI_SETTINGS_VIDEO_ASPECT_RATIO,
|
|
|
|
RGUI_SETTINGS_CUSTOM_VIEWPORT,
|
|
|
|
RGUI_SETTINGS_CUSTOM_VIEWPORT_2,
|
|
|
|
RGUI_SETTINGS_TOGGLE_FULLSCREEN,
|
2013-04-27 23:04:34 +00:00
|
|
|
RGUI_SETTINGS_VIDEO_ROTATION,
|
|
|
|
#ifdef HAVE_SHADER_MANAGER
|
2013-04-17 21:31:49 +00:00
|
|
|
RGUI_SETTINGS_SHADER_FILTER,
|
|
|
|
RGUI_SETTINGS_SHADER_PRESET,
|
|
|
|
RGUI_SETTINGS_SHADER_APPLY,
|
|
|
|
RGUI_SETTINGS_SHADER_PASSES,
|
|
|
|
RGUI_SETTINGS_SHADER_0,
|
|
|
|
RGUI_SETTINGS_SHADER_0_FILTER,
|
|
|
|
RGUI_SETTINGS_SHADER_0_SCALE,
|
2013-04-27 23:04:34 +00:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_SHADER_MANAGER
|
2013-04-17 21:31:49 +00:00
|
|
|
RGUI_SETTINGS_SHADER_LAST = RGUI_SETTINGS_SHADER_0_SCALE + (3 * (RGUI_MAX_SHADERS - 1)),
|
2013-04-27 23:04:34 +00:00
|
|
|
#else
|
|
|
|
RGUI_SETTINGS_SHADER_LAST = RGUI_SETTINGS_VIDEO_ROTATION,
|
|
|
|
#endif
|
2013-04-17 21:31:49 +00:00
|
|
|
|
|
|
|
// settings options are done here too
|
|
|
|
RGUI_SETTINGS_OPEN_FILEBROWSER,
|
2013-04-27 22:35:20 +00:00
|
|
|
RGUI_SETTINGS_OPEN_HISTORY,
|
2013-04-17 21:31:49 +00:00
|
|
|
RGUI_SETTINGS_CORE,
|
|
|
|
RGUI_SETTINGS_CORE_OPTIONS,
|
2013-05-04 17:00:57 +00:00
|
|
|
RGUI_SETTINGS_AUDIO_OPTIONS,
|
|
|
|
RGUI_SETTINGS_INPUT_OPTIONS,
|
2013-05-04 19:17:47 +00:00
|
|
|
RGUI_SETTINGS_PATH_OPTIONS,
|
2013-04-17 21:31:49 +00:00
|
|
|
RGUI_SETTINGS_REWIND_ENABLE,
|
|
|
|
RGUI_SETTINGS_REWIND_GRANULARITY,
|
2013-04-29 13:56:49 +00:00
|
|
|
RGUI_SETTINGS_SRAM_AUTOSAVE,
|
2013-04-17 21:31:49 +00:00
|
|
|
RGUI_SETTINGS_SAVESTATE_SAVE,
|
|
|
|
RGUI_SETTINGS_SAVESTATE_LOAD,
|
2013-05-04 17:26:34 +00:00
|
|
|
RGUI_SETTINGS_DISK_OPTIONS,
|
2013-04-27 11:29:01 +00:00
|
|
|
RGUI_SETTINGS_DISK_INDEX,
|
2013-04-27 13:14:59 +00:00
|
|
|
RGUI_SETTINGS_DISK_APPEND,
|
2013-04-17 21:31:49 +00:00
|
|
|
#ifdef HAVE_SCREENSHOTS
|
|
|
|
RGUI_SETTINGS_SCREENSHOT,
|
|
|
|
#endif
|
2013-05-04 19:17:47 +00:00
|
|
|
RGUI_BROWSER_DIR_PATH,
|
|
|
|
RGUI_SAVESTATE_DIR_PATH,
|
|
|
|
RGUI_SAVEFILE_DIR_PATH,
|
|
|
|
RGUI_SYSTEM_DIR_PATH,
|
2013-04-17 21:31:49 +00:00
|
|
|
RGUI_SETTINGS_RESTART_GAME,
|
|
|
|
RGUI_SETTINGS_AUDIO_MUTE,
|
|
|
|
RGUI_SETTINGS_AUDIO_CONTROL_RATE,
|
|
|
|
RGUI_SETTINGS_ZIP_EXTRACT,
|
|
|
|
RGUI_SETTINGS_SRAM_DIR,
|
|
|
|
RGUI_SETTINGS_STATE_DIR,
|
|
|
|
RGUI_SETTINGS_DEBUG_TEXT,
|
|
|
|
RGUI_SETTINGS_RESTART_EMULATOR,
|
|
|
|
RGUI_SETTINGS_RESUME_GAME,
|
|
|
|
RGUI_SETTINGS_QUIT_RARCH,
|
|
|
|
|
2013-05-04 15:01:10 +00:00
|
|
|
RGUI_SETTINGS_BIND_PLAYER,
|
2013-04-17 21:31:49 +00:00
|
|
|
RGUI_SETTINGS_BIND_DEVICE,
|
2013-04-27 10:32:03 +00:00
|
|
|
RGUI_SETTINGS_BIND_DEVICE_TYPE,
|
2013-04-17 21:31:49 +00:00
|
|
|
RGUI_SETTINGS_BIND_DPAD_EMULATION,
|
|
|
|
RGUI_SETTINGS_BIND_UP,
|
|
|
|
RGUI_SETTINGS_BIND_DOWN,
|
|
|
|
RGUI_SETTINGS_BIND_LEFT,
|
|
|
|
RGUI_SETTINGS_BIND_RIGHT,
|
|
|
|
RGUI_SETTINGS_BIND_A,
|
|
|
|
RGUI_SETTINGS_BIND_B,
|
|
|
|
RGUI_SETTINGS_BIND_X,
|
|
|
|
RGUI_SETTINGS_BIND_Y,
|
|
|
|
RGUI_SETTINGS_BIND_START,
|
|
|
|
RGUI_SETTINGS_BIND_SELECT,
|
|
|
|
RGUI_SETTINGS_BIND_L,
|
|
|
|
RGUI_SETTINGS_BIND_R,
|
|
|
|
RGUI_SETTINGS_BIND_L2,
|
|
|
|
RGUI_SETTINGS_BIND_R2,
|
|
|
|
RGUI_SETTINGS_BIND_L3,
|
|
|
|
RGUI_SETTINGS_BIND_R3,
|
|
|
|
|
|
|
|
RGUI_SETTINGS_CORE_OPTION_NONE = 0xffff,
|
|
|
|
RGUI_SETTINGS_CORE_OPTION_START = 0x10000
|
|
|
|
} rgui_file_type_t;
|
|
|
|
|
2013-04-27 23:04:34 +00:00
|
|
|
#define RGUI_SETTINGS_VIDEO_OPTIONS_FIRST (RGUI_SETTINGS_VIDEO_OPTIONS + 1)
|
|
|
|
|
2013-04-17 21:31:49 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
RGUI_ACTION_UP,
|
|
|
|
RGUI_ACTION_DOWN,
|
|
|
|
RGUI_ACTION_LEFT,
|
|
|
|
RGUI_ACTION_RIGHT,
|
|
|
|
RGUI_ACTION_OK,
|
|
|
|
RGUI_ACTION_CANCEL,
|
|
|
|
RGUI_ACTION_REFRESH,
|
|
|
|
RGUI_ACTION_SETTINGS,
|
|
|
|
RGUI_ACTION_START,
|
|
|
|
RGUI_ACTION_MESSAGE,
|
|
|
|
RGUI_ACTION_NOOP
|
|
|
|
} rgui_action_t;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2013-04-19 15:53:01 +00:00
|
|
|
uint64_t old_input_state;
|
|
|
|
uint64_t trigger_state;
|
|
|
|
bool do_held;
|
|
|
|
|
2013-04-26 21:52:29 +00:00
|
|
|
unsigned delay_timer;
|
|
|
|
unsigned delay_count;
|
|
|
|
|
2013-04-17 21:31:49 +00:00
|
|
|
uint16_t *frame_buf;
|
|
|
|
size_t frame_buf_pitch;
|
2013-04-19 15:53:01 +00:00
|
|
|
bool frame_buf_show;
|
2013-04-17 21:31:49 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_FILEBROWSER
|
|
|
|
filebrowser_t *browser;
|
|
|
|
unsigned menu_type;
|
|
|
|
#else
|
|
|
|
rgui_list_t *menu_stack;
|
|
|
|
rgui_list_t *selection_buf;
|
|
|
|
#endif
|
|
|
|
size_t selection_ptr;
|
|
|
|
bool need_refresh;
|
|
|
|
bool msg_force;
|
|
|
|
|
|
|
|
char base_path[PATH_MAX];
|
|
|
|
|
|
|
|
const uint8_t *font;
|
|
|
|
bool alloc_font;
|
|
|
|
|
|
|
|
#ifdef HAVE_DYNAMIC
|
|
|
|
char libretro_dir[PATH_MAX];
|
|
|
|
#endif
|
|
|
|
struct retro_system_info info;
|
2013-05-02 12:42:58 +00:00
|
|
|
bool load_no_rom;
|
2013-04-17 21:31:49 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_OSKUTIL
|
|
|
|
unsigned osk_param;
|
|
|
|
bool (*osk_init)(void *data);
|
|
|
|
bool (*osk_callback)(void *data);
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_SHADER_MANAGER
|
|
|
|
struct gfx_shader shader;
|
|
|
|
#endif
|
2013-05-04 14:13:58 +00:00
|
|
|
unsigned current_pad;
|
2013-04-27 22:35:20 +00:00
|
|
|
|
|
|
|
rom_history_t *history;
|
2013-04-17 21:31:49 +00:00
|
|
|
} rgui_handle_t;
|
|
|
|
|
|
|
|
extern rgui_handle_t *rgui;
|
|
|
|
|
|
|
|
void menu_init(void);
|
|
|
|
bool menu_iterate(void);
|
|
|
|
void menu_free(void);
|
|
|
|
|
2013-04-18 21:00:27 +00:00
|
|
|
int rgui_iterate(rgui_handle_t *rgui);
|
2013-04-18 16:33:03 +00:00
|
|
|
|
2013-04-18 12:57:28 +00:00
|
|
|
rgui_handle_t *rgui_init(void);
|
|
|
|
void rgui_free(rgui_handle_t *rgui);
|
|
|
|
|
2013-04-19 15:53:01 +00:00
|
|
|
#ifndef HAVE_RMENU_XUI
|
|
|
|
#if defined(HAVE_RGUI) || defined(HAVE_RMENU)
|
|
|
|
uint64_t rgui_input(void);
|
|
|
|
int rgui_input_postprocess(void *data, uint64_t old_state);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2013-04-17 21:31:49 +00:00
|
|
|
#ifdef HAVE_SHADER_MANAGER
|
|
|
|
void shader_manager_init(rgui_handle_t *rgui);
|
|
|
|
void shader_manager_get_str(struct gfx_shader *shader,
|
|
|
|
char *type_str, size_t type_str_size, unsigned type);
|
|
|
|
#endif
|
|
|
|
|
2013-04-28 14:38:13 +00:00
|
|
|
void load_menu_game_prepare(void);
|
|
|
|
bool load_menu_game(void);
|
2013-04-29 01:10:26 +00:00
|
|
|
void load_menu_game_history(unsigned game_index);
|
2013-04-28 14:38:13 +00:00
|
|
|
|
2013-04-17 21:31:49 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|