2023-07-16 12:21:52 +02:00
|
|
|
/**
|
|
|
|
* @file menu_state.h
|
|
|
|
* @brief Menu State
|
|
|
|
* @ingroup menu
|
|
|
|
*/
|
|
|
|
|
2023-07-09 00:01:41 +02:00
|
|
|
#ifndef MENU_STRUCT_H__
|
|
|
|
#define MENU_STRUCT_H__
|
|
|
|
|
|
|
|
|
2023-07-11 18:00:18 +02:00
|
|
|
#include "boot/boot.h"
|
2023-07-11 02:22:58 +02:00
|
|
|
#include "flashcart/flashcart.h"
|
2023-07-09 00:01:41 +02:00
|
|
|
#include "path.h"
|
2023-07-11 18:00:18 +02:00
|
|
|
#include "settings.h"
|
2023-07-09 00:01:41 +02:00
|
|
|
|
|
|
|
|
2023-07-25 19:20:29 +02:00
|
|
|
#define BROWSER_LIST_SIZE 2048
|
2023-07-09 00:01:41 +02:00
|
|
|
|
|
|
|
|
2023-07-16 12:21:52 +02:00
|
|
|
/** @brief Menu mode enumeration */
|
2023-07-09 00:01:41 +02:00
|
|
|
typedef enum {
|
|
|
|
MENU_MODE_NONE,
|
|
|
|
MENU_MODE_STARTUP,
|
|
|
|
MENU_MODE_BROWSER,
|
|
|
|
MENU_MODE_FILE_INFO,
|
2023-07-09 00:52:39 +02:00
|
|
|
MENU_MODE_SYSTEM_INFO,
|
2023-07-25 22:56:00 +02:00
|
|
|
MENU_MODE_IMAGE_VIEWER,
|
2023-07-22 12:30:39 +02:00
|
|
|
MENU_MODE_MUSIC_PLAYER,
|
2023-07-09 00:01:41 +02:00
|
|
|
MENU_MODE_CREDITS,
|
|
|
|
MENU_MODE_LOAD,
|
2023-08-05 15:56:10 +02:00
|
|
|
MENU_MODE_EMULATOR_LOAD,
|
2023-07-09 00:01:41 +02:00
|
|
|
MENU_MODE_ERROR,
|
2023-07-11 02:22:58 +02:00
|
|
|
MENU_MODE_FAULT,
|
2023-07-09 00:01:41 +02:00
|
|
|
MENU_MODE_BOOT,
|
|
|
|
} menu_mode_t;
|
|
|
|
|
2023-07-16 12:21:52 +02:00
|
|
|
/** @brief File entry type enumeration */
|
2023-07-09 00:01:41 +02:00
|
|
|
typedef enum {
|
|
|
|
ENTRY_TYPE_DIR,
|
|
|
|
ENTRY_TYPE_ROM,
|
2023-08-05 15:56:10 +02:00
|
|
|
ENTRY_TYPE_EMULATOR,
|
2023-07-09 00:01:41 +02:00
|
|
|
ENTRY_TYPE_SAVE,
|
2023-07-25 22:56:00 +02:00
|
|
|
ENTRY_TYPE_IMAGE,
|
2023-07-09 00:01:41 +02:00
|
|
|
ENTRY_TYPE_MUSIC,
|
|
|
|
ENTRY_TYPE_OTHER,
|
|
|
|
} entry_type_t;
|
|
|
|
|
2023-07-16 12:21:52 +02:00
|
|
|
/** @brief File Entry Structure */
|
2023-07-09 00:01:41 +02:00
|
|
|
typedef struct {
|
|
|
|
char *name;
|
|
|
|
entry_type_t type;
|
|
|
|
int size;
|
|
|
|
} entry_t;
|
|
|
|
|
2023-07-16 12:21:52 +02:00
|
|
|
/** @brief Menu Structure */
|
2023-07-09 00:01:41 +02:00
|
|
|
typedef struct {
|
|
|
|
menu_mode_t mode;
|
|
|
|
menu_mode_t next_mode;
|
|
|
|
|
2023-07-11 18:00:18 +02:00
|
|
|
settings_t settings;
|
|
|
|
boot_params_t *boot_params;
|
2023-07-11 02:22:58 +02:00
|
|
|
flashcart_error_t flashcart_error;
|
2023-07-09 00:01:41 +02:00
|
|
|
|
2023-08-03 17:18:55 +02:00
|
|
|
char *error_message;
|
|
|
|
|
2023-07-09 00:01:41 +02:00
|
|
|
struct {
|
|
|
|
bool go_up;
|
|
|
|
bool go_down;
|
|
|
|
bool go_left;
|
|
|
|
bool go_right;
|
|
|
|
bool fast;
|
|
|
|
int vertical_held_counter;
|
|
|
|
int horizontal_held_counter;
|
|
|
|
|
|
|
|
bool enter;
|
|
|
|
bool back;
|
2023-07-09 00:52:39 +02:00
|
|
|
bool file_info;
|
|
|
|
bool system_info;
|
2023-07-09 00:01:41 +02:00
|
|
|
bool settings;
|
|
|
|
} actions;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
bool valid;
|
|
|
|
path_t *directory;
|
|
|
|
entry_t list[BROWSER_LIST_SIZE];
|
|
|
|
int entries;
|
|
|
|
int selected;
|
|
|
|
} browser;
|
|
|
|
} menu_t;
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|