Start gfx rewrite & reorganize TE

This commit is contained in:
Such Meme, Many Skill
2020-03-18 00:41:09 +01:00
parent 761ceb7dbe
commit 6aed4ad7b3
16 changed files with 570 additions and 62 deletions

View File

@@ -0,0 +1,58 @@
#pragma once
#include "types.h"
extern const char *gfx_file_size_names[];
extern const char *menu_sd_states[];
extern const char *emmc_fs_entries[];
enum mainmenu_main_return {
MAIN_SDCARD = 0,
MAIN_EMMC_SAF,
MAIN_EMMC_SYS,
MAIN_EMMC_USR,
MAIN_EMUMMC_SAF,
MAIN_EMUMMC_SYS,
MAIN_EMUMMC_USR,
MAIN_MOUNT_SD,
MAIN_TOOLS,
MAIN_SD_FORMAT,
MAIN_CREDITS,
MAIN_EXIT
};
extern menu_entry mainmenu_main[];
enum mainmenu_shutdown_return {
SHUTDOWN_REBOOT_RCM = 1,
SHUTDOWN_REBOOT_NORMAL,
SHUTDOWN_POWER_OFF,
SHUTDOWN_HEKATE,
SHUTDOWN_AMS
};
extern menu_entry mainmenu_shutdown[];
enum mainmenu_tools_return {
TOOLS_DISPLAY_INFO = 1,
TOOLS_DISPLAY_GPIO,
TOOLS_DUMPFIRMWARE,
TOOLS_DUMPUSERSAVE,
TOOLS_DUMP_BOOT,
TOOLS_RESTORE_BOOT
};
extern menu_entry mainmenu_tools[];
enum mainmenu_format_return {
FORMAT_EMUMMC = 1,
FORMAT_ALL_FAT32
};
extern menu_entry mainmenu_format[];
enum mmc_types {
SYSMMC = 1,
EMUMMC
};
extern menu_entry utils_mmcChoice[];

View File

@@ -0,0 +1,19 @@
#include "common.h"
const char *gfx_file_size_names[] = {
"B ",
"KB",
"MB",
"GB"
};
const char *menu_sd_states[] = {
"\nUnmount SD",
"\nMount SD"
};
const char *emmc_fs_entries[] = {
"SYSTEM",
"USER",
"SAFE"
};

View File

@@ -0,0 +1,48 @@
#include "common.h"
#include "types.h"
menu_entry mainmenu_main[] = {
{"[SD:/] SD CARD\n", COLOR_GREEN, ISMENU},
{"[SYSTEM:/] EMMC", COLOR_ORANGE, ISMENU},
{"[USER:/] EMMC", COLOR_ORANGE, ISMENU},
{"[SAFE:/] EMMC", COLOR_ORANGE, ISMENU},
{"\n[SYSTEM:/] EMUMMC", COLOR_BLUE, ISMENU},
{"[USER:/] EMUMMC", COLOR_BLUE, ISMENU},
{"[SAFE:/] EMUMMC", COLOR_BLUE, ISMENU},
{"\nMount/Unmount SD", COLOR_WHITE, ISMENU},
{"Tools", COLOR_VIOLET, ISMENU},
{"SD format", COLOR_VIOLET, ISMENU},
{"\nCredits", COLOR_WHITE, ISMENU},
{"Exit", COLOR_WHITE, ISMENU}
};
menu_entry mainmenu_shutdown[] = {
{"Back", COLOR_WHITE, ISMENU},
{"\nReboot to RCM", COLOR_VIOLET, ISMENU},
{"Reboot normally", COLOR_ORANGE, ISMENU},
{"Power off\n", COLOR_BLUE, ISMENU},
{"Reboot to Hekate", COLOR_GREEN, ISMENU},
{"Reboot to Atmosphere", COLOR_GREEN, ISMENU}
};
menu_entry mainmenu_tools[] = {
{"Back", COLOR_WHITE, ISMENU},
{"\nDisplay Console Info", COLOR_GREEN, ISMENU},
{"Display GPIO pins", COLOR_VIOLET, ISMENU},
{"Dump Firmware", COLOR_BLUE, ISMENU},
{"Dump User Saves", COLOR_YELLOW, ISMENU},
{"[DEBUG] Dump bis", COLOR_RED, ISMENU},
{"[DEBUG] Restore bis", COLOR_RED, ISMENU}
};
menu_entry mainmenu_format[] = {
{"Back\n", COLOR_WHITE, ISMENU},
{"Format entire SD to FAT32", COLOR_RED, ISMENU},
{"Format for EmuMMC setup (FAT32/RAW)", COLOR_RED, ISMENU}
};
menu_entry utils_mmcChoice[] = {
{"Back\n", COLOR_WHITE, ISMENU},
{"SysMMC", COLOR_ORANGE, ISMENU},
{"EmuMMC", COLOR_BLUE, ISMENU}
};

View File

@@ -0,0 +1,31 @@
#pragma once
#include "../../utils/types.h"
#define ISDIR (1 << 0)
#define ISARC (1 << 1)
#define ISHIDE (1 << 8)
#define ISMENU (1 << 9)
#define ISSKIP (1 << 10)
#define ISGB (1 << 7)
#define ISMB (1 << 6)
#define ISKB (1 << 5)
#define ISB (1 << 4)
#define SETBIT(object, shift, value) ((value) ? (object |= shift) : (object &= ~shift))
/* Bit table for property as a file:
0000 0001: Directory bit
0000 0010: Archive bit (or hideme)
0001 0000: Size component is a Byte
0010 0000: Size component is a KiloByte
0100 0000: Size component is a MegaByte
1000 0000: Size component is a GigaByte : note that this won't surpass gigabytes, but i don't expect people to have a single file that's a terrabyte big
*/
typedef struct {
char *name;
u32 storage;
u16 property;
} menu_entry;