Merge branch 'main' into ed64-basic

This commit is contained in:
Robin Jones 2023-11-10 16:46:01 +00:00 committed by GitHub
commit ddd644ff7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 177 additions and 23 deletions

View File

@ -7,6 +7,8 @@ ASSETS_DIR = assets
BUILD_DIR = build BUILD_DIR = build
OUTPUT_DIR = output OUTPUT_DIR = output
FLAGS += -DMENU_VERSION=\"0.0.1.$(shell date +%Y-%m-%dT%H:%M:%SZ).ALPHA\"
include $(N64_INST)/include/n64.mk include $(N64_INST)/include/n64.mk
N64_CFLAGS += -iquote $(SOURCE_DIR) -iquote $(ASSETS_DIR) -I $(SOURCE_DIR)/libs -flto=auto $(FLAGS) N64_CFLAGS += -iquote $(SOURCE_DIR) -iquote $(ASSETS_DIR) -I $(SOURCE_DIR)/libs -flto=auto $(FLAGS)

View File

@ -128,7 +128,9 @@ To update to the latest version, use `git submodule update --remote ` from the t
# Generate documentation # Generate documentation
Run `doxygen` from the dev container terminal. Run `doxygen` from the dev container terminal.
Make sure you fix the warnings before creating a PR! Make sure you fix the warnings before creating a PR!
Generated documentation is located in `output/docs` folder. Generated documentation is located in `output/docs` folder and auto published to the `gh-pages` branch when merged with `main`.
Once merged, they can be viewed [here](https://polprzewodnikowy.github.io/N64FlashcartMenu/)
# Open source software and licenses used # Open source software and licenses used
- [libdragon](https://github.com/DragonMinded/libdragon) (UNLICENSE License) - [libdragon](https://github.com/DragonMinded/libdragon) (UNLICENSE License)

View File

@ -18,7 +18,7 @@ typedef volatile uint32_t io32_t;
#define UNCACHED(address) ((typeof(address)) (((io32_t) (address)) | (0xA0000000UL))) #define UNCACHED(address) ((typeof(address)) (((io32_t) (address)) | (0xA0000000UL)))
/** @brief Memory Structure. */
typedef struct { typedef struct {
io32_t DMEM[1024]; io32_t DMEM[1024];
io32_t IMEM[1024]; io32_t IMEM[1024];
@ -27,7 +27,7 @@ typedef struct {
#define SP_MEM_BASE (0x04000000UL) #define SP_MEM_BASE (0x04000000UL)
#define SP_MEM ((sp_mem_t *) SP_MEM_BASE) #define SP_MEM ((sp_mem_t *) SP_MEM_BASE)
/** @brief SP Registers Structure. */
typedef struct { typedef struct {
io32_t PADDR; io32_t PADDR;
io32_t MADDR; io32_t MADDR;
@ -86,7 +86,7 @@ typedef struct {
#define SP_SR_SET_SIG7 (1 << 24) #define SP_SR_SET_SIG7 (1 << 24)
/** @brief DPC Registers Structure */ /** @brief DPC Registers Structure. */
typedef struct { typedef struct {
io32_t START; io32_t START;
io32_t END; io32_t END;
@ -124,21 +124,35 @@ typedef struct {
#define DPC_SR_CLR_CLOCK_CTR (1 << 9) #define DPC_SR_CLR_CLOCK_CTR (1 << 9)
/** @brief Video Interface Registers Structure */ /** @brief Video Interface Registers Structure. */
typedef struct { typedef struct {
/** @brief The Control Register. */
io32_t CR; io32_t CR;
/** @brief The Memory Address. */
io32_t MADDR; io32_t MADDR;
/** @brief The Horizontal Width. */
io32_t H_WIDTH; io32_t H_WIDTH;
/** @brief The Virtical Interupt. */
io32_t V_INTR; io32_t V_INTR;
/** @brief The Current Line. */
io32_t CURR_LINE; io32_t CURR_LINE;
/** @brief The Timings. */
io32_t TIMING; io32_t TIMING;
/** @brief The Virtical Sync. */
io32_t V_SYNC; io32_t V_SYNC;
/** @brief The Horizontal Sync. */
io32_t H_SYNC; io32_t H_SYNC;
/** @brief The Horizontal Sync Leap. */
io32_t H_SYNC_LEAP; io32_t H_SYNC_LEAP;
/** @brief The Horizontal Limits. */
io32_t H_LIMITS; io32_t H_LIMITS;
/** @brief The Virtical Limits. */
io32_t V_LIMITS; io32_t V_LIMITS;
/** @brief The Colour Burst. */
io32_t COLOR_BURST; io32_t COLOR_BURST;
/** @brief The Horizontal Scale. */
io32_t H_SCALE; io32_t H_SCALE;
/** @brief The Virtical Scale. */
io32_t V_SCALE; io32_t V_SCALE;
} vi_regs_t; } vi_regs_t;
@ -161,13 +175,19 @@ typedef struct {
#define VI_CURR_LINE_FIELD (1 << 0) #define VI_CURR_LINE_FIELD (1 << 0)
/** @brief Audio Interface Registers Structure. */
typedef struct { typedef struct {
/** @brief The Memory Address. */
io32_t MADDR; io32_t MADDR;
/** @brief The Length of bytes. */
io32_t LEN; io32_t LEN;
/** @brief The Control Register. */
io32_t CR; io32_t CR;
/** @brief The Status Register. */
io32_t SR; io32_t SR;
/** @brief The DAC rate. */
io32_t DACRATE; io32_t DACRATE;
/** @brief The bit rate. */
io32_t BITRATE; io32_t BITRATE;
} ai_regs_t; } ai_regs_t;
@ -179,17 +199,27 @@ typedef struct {
#define AI_CR_DMA_ON (1 << 0) #define AI_CR_DMA_ON (1 << 0)
/** @brief Parallel Interface Register Structure */ /** @brief Peripheral Interface Register Structure. */
typedef struct { typedef struct {
/** @brief The Memory Address. */
io32_t MADDR; io32_t MADDR;
/** @brief The Cart Address. */
io32_t PADDR; io32_t PADDR;
/** @brief The Read Length. */
io32_t RDMA; io32_t RDMA;
/** @brief The Write Length. */
io32_t WDMA; io32_t WDMA;
/** @brief The Status Register. */
io32_t SR; io32_t SR;
/** @brief The Domain 2 Registers. */
struct { struct {
/** @brief The Latch Value. */
io32_t LAT; io32_t LAT;
/** @brief The Pulse Width Value. */
io32_t PWD; io32_t PWD;
/** @brief The Page Size Value. */
io32_t PGS; io32_t PGS;
/** @brief The Release Value. */
io32_t RLS; io32_t RLS;
} DOM[2]; } DOM[2];
} pi_regs_t; } pi_regs_t;
@ -211,7 +241,7 @@ typedef struct {
#define ROM_CART_BASE (0x10000000UL) #define ROM_CART_BASE (0x10000000UL)
#define ROM_CART ((io32_t *) ROM_CART_BASE) #define ROM_CART ((io32_t *) ROM_CART_BASE)
/** @brief OS Information Structure. */
typedef struct { typedef struct {
uint32_t tv_type; uint32_t tv_type;
uint32_t device_type; uint32_t device_type;
@ -228,7 +258,9 @@ typedef struct {
#define OS_INFO_BASE (0x80000300UL) #define OS_INFO_BASE (0x80000300UL)
#define OS_INFO ((os_info_t *) OS_INFO_BASE) #define OS_INFO ((os_info_t *) OS_INFO_BASE)
/** @brief The Console was powered on using the power switch. */
#define OS_INFO_RESET_TYPE_COLD (0) #define OS_INFO_RESET_TYPE_COLD (0)
/** @brief The Console was reset using the reset button. */
#define OS_INFO_RESET_TYPE_NMI (1) #define OS_INFO_RESET_TYPE_NMI (1)

View File

@ -17,6 +17,7 @@
* @{ * @{
*/ */
/** @brief Registers Structure. */
typedef struct { typedef struct {
uint8_t BUFFER[512]; uint8_t BUFFER[512];
uint32_t STATUS; uint32_t STATUS;
@ -54,18 +55,20 @@ typedef struct {
uint32_t WRITEBACK[256]; uint32_t WRITEBACK[256];
} d64_regs_t; } d64_regs_t;
/** @brief Registers Base Address. */
#define D64_REGS_BASE (0x18000000UL) #define D64_REGS_BASE (0x18000000UL)
#define D64_REGS_BASE_EXT (0x1F800000UL) #define D64_REGS_BASE_EXT (0x1F800000UL)
#define D64_REGS ((d64_regs_t *) D64_REGS_BASE) #define D64_REGS ((d64_regs_t *) D64_REGS_BASE)
#define D64_REGS_EXT ((d64_regs_t *) D64_REGS_BASE_EXT) #define D64_REGS_EXT ((d64_regs_t *) D64_REGS_BASE_EXT)
/** @brief Device Variant Enumeration. */
typedef enum { typedef enum {
DEVICE_VARIANT_UNKNOWN = 0x0000, DEVICE_VARIANT_UNKNOWN = 0x0000,
DEVICE_VARIANT_A = 0x4100, DEVICE_VARIANT_A = 0x4100,
DEVICE_VARIANT_B = 0x4200, DEVICE_VARIANT_B = 0x4200,
} d64_device_variant_t; } d64_device_variant_t;
/** @brief TV Type Enumeration. */
typedef enum { typedef enum {
TV_TYPE_PAL = 0, TV_TYPE_PAL = 0,
TV_TYPE_NTSC = 1, TV_TYPE_NTSC = 1,
@ -73,6 +76,7 @@ typedef enum {
TV_TYPE_UNKNOWN = 3, TV_TYPE_UNKNOWN = 3,
} d64_tv_type_t; } d64_tv_type_t;
/** @brief Save Type Enumeration. */
typedef enum { typedef enum {
SAVE_TYPE_NONE, SAVE_TYPE_NONE,
SAVE_TYPE_EEPROM_4K, SAVE_TYPE_EEPROM_4K,

View File

@ -42,6 +42,7 @@ typedef enum {
__FLASHCART_SAVE_TYPE_END __FLASHCART_SAVE_TYPE_END
} flashcart_save_type_t; } flashcart_save_type_t;
/** @brief Flashcart Disk Parameter Structure. */
typedef struct { typedef struct {
bool development_drive; bool development_drive;
uint8_t disk_type; uint8_t disk_type;
@ -53,15 +54,25 @@ typedef void flashcart_progress_callback_t (float progress);
/** @brief Flashcart Structure */ /** @brief Flashcart Structure */
typedef struct { typedef struct {
/** @brief The flashcart initialization function */
flashcart_err_t (*init) (void); flashcart_err_t (*init) (void);
/** @brief The flashcart de-initialization function */
flashcart_err_t (*deinit) (void); flashcart_err_t (*deinit) (void);
/** @brief The flashcart feature function */
bool (*has_feature) (flashcart_features_t feature); bool (*has_feature) (flashcart_features_t feature);
/** @brief The flashcart ROM load function */
flashcart_err_t (*load_rom) (char *rom_path, flashcart_progress_callback_t *progress); flashcart_err_t (*load_rom) (char *rom_path, flashcart_progress_callback_t *progress);
/** @brief The flashcart file load function */
flashcart_err_t (*load_file) (char *file_path, uint32_t rom_offset, uint32_t file_offset); flashcart_err_t (*load_file) (char *file_path, uint32_t rom_offset, uint32_t file_offset);
/** @brief The flashcart save file load function */
flashcart_err_t (*load_save) (char *save_path); flashcart_err_t (*load_save) (char *save_path);
/** @brief The flashcart disk bios load function */
flashcart_err_t (*load_64dd_ipl) (char *ipl_path, flashcart_progress_callback_t *progress); flashcart_err_t (*load_64dd_ipl) (char *ipl_path, flashcart_progress_callback_t *progress);
/** @brief The flashcart disk load function */
flashcart_err_t (*load_64dd_disk) (char *disk_path, flashcart_disk_parameters_t *disk_parameters); flashcart_err_t (*load_64dd_disk) (char *disk_path, flashcart_disk_parameters_t *disk_parameters);
/** @brief The flashcart set save type function */
flashcart_err_t (*set_save_type) (flashcart_save_type_t save_type); flashcart_err_t (*set_save_type) (flashcart_save_type_t save_type);
/** @brief The flashcart set save writeback function */
flashcart_err_t (*set_save_writeback) (uint32_t *sectors); flashcart_err_t (*set_save_writeback) (uint32_t *sectors);
} flashcart_t; } flashcart_t;

View File

@ -0,0 +1,5 @@
## SummerCart64 developer notes
### Official documentation
https://github.com/Polprzewodnikowy/SummerCart64/tree/main/docs

View File

@ -4,6 +4,7 @@
#include "sc64_ll.h" #include "sc64_ll.h"
/** @brief SummerCart64 Registers Structure. */
typedef struct { typedef struct {
uint32_t SR_CMD; uint32_t SR_CMD;
uint32_t DATA[2]; uint32_t DATA[2];
@ -31,6 +32,7 @@ typedef enum {
CMD_ID_FLASH_ERASE_BLOCK = 'P', CMD_ID_FLASH_ERASE_BLOCK = 'P',
} sc64_cmd_id_t; } sc64_cmd_id_t;
/** @brief SummerCart64 Commands Structure. */
typedef struct { typedef struct {
sc64_cmd_id_t id; sc64_cmd_id_t id;
uint32_t arg[2]; uint32_t arg[2];

View File

@ -17,6 +17,7 @@
* @{ * @{
*/ */
/** @brief The SC64 buffers structure. */
typedef struct { typedef struct {
uint8_t BUFFER[8192]; uint8_t BUFFER[8192];
uint8_t EEPROM[2048]; uint8_t EEPROM[2048];
@ -27,7 +28,7 @@ typedef struct {
#define SC64_BUFFERS_BASE (0x1FFE0000UL) #define SC64_BUFFERS_BASE (0x1FFE0000UL)
#define SC64_BUFFERS ((sc64_buffers_t *) SC64_BUFFERS_BASE) #define SC64_BUFFERS ((sc64_buffers_t *) SC64_BUFFERS_BASE)
/** @brief The SC64 State Enumeration. */
typedef enum { typedef enum {
SC64_OK, SC64_OK,
SC64_ERROR_BAD_ARGUMENT, SC64_ERROR_BAD_ARGUMENT,
@ -63,6 +64,7 @@ typedef enum {
DD_MODE_FULL = 3 DD_MODE_FULL = 3
} sc64_dd_mode_t; } sc64_dd_mode_t;
/** @brief The SC64 Boot Mode Enumeration. */
typedef enum { typedef enum {
BOOT_MODE_MENU = 0, BOOT_MODE_MENU = 0,
BOOT_MODE_ROM = 1, BOOT_MODE_ROM = 1,
@ -71,6 +73,7 @@ typedef enum {
BOOT_MODE_DIRECT_DDIPL = 4, BOOT_MODE_DIRECT_DDIPL = 4,
} sc64_boot_mode_t; } sc64_boot_mode_t;
/** @brief The SC64 Save Type Enumeration. */
typedef enum { typedef enum {
SAVE_TYPE_NONE, SAVE_TYPE_NONE,
SAVE_TYPE_EEPROM_4K, SAVE_TYPE_EEPROM_4K,

View File

@ -13,28 +13,46 @@
#include "menu_state.h" #include "menu_state.h"
#include "rom_info.h" #include "rom_info.h"
/** @brief Cart load state enumeration. */
typedef enum { typedef enum {
/** @brief Returned no error. */
CART_LOAD_OK, CART_LOAD_OK,
/** @brief Failed to load the ROM correctly. */
CART_LOAD_ERR_ROM_LOAD_FAIL, CART_LOAD_ERR_ROM_LOAD_FAIL,
/** @brief Failed to load the save correctly. */
CART_LOAD_ERR_SAVE_LOAD_FAIL, CART_LOAD_ERR_SAVE_LOAD_FAIL,
/** @brief The 64DD is available for use. */
CART_LOAD_ERR_64DD_PRESENT, CART_LOAD_ERR_64DD_PRESENT,
/** @brief Failed to find the 64DD IPL (BIOS) file. */
CART_LOAD_ERR_64DD_IPL_NOT_FOUND, CART_LOAD_ERR_64DD_IPL_NOT_FOUND,
/** @brief Failed to load the 64DD IPL (BIOS) file. */
CART_LOAD_ERR_64DD_IPL_LOAD_FAIL, CART_LOAD_ERR_64DD_IPL_LOAD_FAIL,
/** @brief Failed to find the 64DD disk. */
CART_LOAD_ERR_64DD_DISK_LOAD_FAIL, CART_LOAD_ERR_64DD_DISK_LOAD_FAIL,
/** @brief Failed to find the emulator required. */
CART_LOAD_ERR_EMU_NOT_FOUND, CART_LOAD_ERR_EMU_NOT_FOUND,
/** @brief Failed to load the emulator required. */
CART_LOAD_ERR_EMU_LOAD_FAIL, CART_LOAD_ERR_EMU_LOAD_FAIL,
CART_LOAD_ERR_EMU_ROM_LOAD_FAIL, CART_LOAD_ERR_EMU_ROM_LOAD_FAIL,
/** @brief Failed to create the save sub-directory. */
CART_LOAD_ERR_CREATE_SAVES_SUBDIR_FAIL, CART_LOAD_ERR_CREATE_SAVES_SUBDIR_FAIL,
/** @brief There was not enough system memory available (expected an Expansion PAK). */
CART_LOAD_ERR_EXP_PAK_NOT_FOUND, CART_LOAD_ERR_EXP_PAK_NOT_FOUND,
/** @brief An unexpected response. */
CART_LOAD_ERR_FUNCTION_NOT_SUPPORTED, CART_LOAD_ERR_FUNCTION_NOT_SUPPORTED,
} cart_load_err_t; } cart_load_err_t;
/** @brief Cart load type enumeration */
typedef enum { typedef enum {
/** @brief The ROM is designed for a Nintendo Entertainment System or Famicom. */
CART_LOAD_EMU_TYPE_NES, CART_LOAD_EMU_TYPE_NES,
/** @brief The ROM is designed for a Super Nintendo Entertainment System or Super Famicom. */
CART_LOAD_EMU_TYPE_SNES, CART_LOAD_EMU_TYPE_SNES,
/** @brief The ROM is designed for a Nintendo Gameboy. */
CART_LOAD_EMU_TYPE_GAMEBOY, CART_LOAD_EMU_TYPE_GAMEBOY,
/** @brief The ROM is designed for a Nintendo Gameboy Color. */
CART_LOAD_EMU_TYPE_GAMEBOY_COLOR, CART_LOAD_EMU_TYPE_GAMEBOY_COLOR,
/** @brief The ROM is designed for a Sega 8Bit system (Game Gear or Master System). */
CART_LOAD_EMU_TYPE_SEGA_GENERIC_8BIT, CART_LOAD_EMU_TYPE_SEGA_GENERIC_8BIT,
} cart_load_emu_type_t; } cart_load_emu_type_t;

View File

@ -54,6 +54,7 @@ void component_context_menu_show (component_context_menu_t *cm);
bool component_context_menu_process (menu_t *menu, component_context_menu_t *cm); bool component_context_menu_process (menu_t *menu, component_context_menu_t *cm);
void component_context_menu_draw (component_context_menu_t *cm); void component_context_menu_draw (component_context_menu_t *cm);
/** @brief Box Art Structure. */
typedef struct { typedef struct {
bool loading; bool loading;
surface_t *image; surface_t *image;

View File

@ -7,78 +7,121 @@
#ifndef COMPONENTS_CONSTANTS_H__ #ifndef COMPONENTS_CONSTANTS_H__
#define COMPONENTS_CONSTANTS_H__ #define COMPONENTS_CONSTANTS_H__
/** @brief The display width. */
#define DISPLAY_WIDTH (640) #define DISPLAY_WIDTH (640)
/** @brief The display height. */
#define DISPLAY_HEIGHT (480) #define DISPLAY_HEIGHT (480)
/** @brief The centre of the display on the X axis. */
#define DISPLAY_CENTER_X (DISPLAY_WIDTH / 2) #define DISPLAY_CENTER_X (DISPLAY_WIDTH / 2)
/** @brief The centre of the display on the Y axis. */
#define DISPLAY_CENTER_Y (DISPLAY_HEIGHT / 2) #define DISPLAY_CENTER_Y (DISPLAY_HEIGHT / 2)
/** @brief The overscan on the X axis. */
#define OVERSCAN_WIDTH (32) #define OVERSCAN_WIDTH (32)
/** @brief The overscan on the Y axis. */
#define OVERSCAN_HEIGHT (24) #define OVERSCAN_HEIGHT (24)
/** @brief The start position of the visible display on the X axis. */
#define VISIBLE_AREA_X0 (OVERSCAN_WIDTH) #define VISIBLE_AREA_X0 (OVERSCAN_WIDTH)
/** @brief The start position of the visible display on the Y axis. */
#define VISIBLE_AREA_Y0 (OVERSCAN_HEIGHT) #define VISIBLE_AREA_Y0 (OVERSCAN_HEIGHT)
/** @brief The end position of the visible display on the X axis. */
#define VISIBLE_AREA_X1 (DISPLAY_WIDTH - OVERSCAN_WIDTH) #define VISIBLE_AREA_X1 (DISPLAY_WIDTH - OVERSCAN_WIDTH)
/** @brief The end position of the visible display on the Y axis. */
#define VISIBLE_AREA_Y1 (DISPLAY_HEIGHT - OVERSCAN_HEIGHT) #define VISIBLE_AREA_Y1 (DISPLAY_HEIGHT - OVERSCAN_HEIGHT)
/** @brief The width of the visible display. */
#define VISIBLE_AREA_WIDTH (VISIBLE_AREA_X1 - VISIBLE_AREA_X0) #define VISIBLE_AREA_WIDTH (VISIBLE_AREA_X1 - VISIBLE_AREA_X0)
/** @brief The height of the visible display. */
#define VISIBLE_AREA_HEIGHT (VISIBLE_AREA_Y1 - VISIBLE_AREA_Y0) #define VISIBLE_AREA_HEIGHT (VISIBLE_AREA_Y1 - VISIBLE_AREA_Y0)
/** @brief The thickness of borders. */
#define BORDER_THICKNESS (4) #define BORDER_THICKNESS (4)
#define LAYOUT_ACTIONS_SEPARATOR_Y (400) #define LAYOUT_ACTIONS_SEPARATOR_Y (400)
/** @brief The seek bar height. */
#define SEEKBAR_HEIGHT (24) #define SEEKBAR_HEIGHT (24)
/** @brief The seek bar width. */
#define SEEKBAR_WIDTH (524) #define SEEKBAR_WIDTH (524)
/** @brief The seek bar position on the X axis. */
#define SEEKBAR_X (DISPLAY_CENTER_X - (SEEKBAR_WIDTH / 2)) #define SEEKBAR_X (DISPLAY_CENTER_X - (SEEKBAR_WIDTH / 2))
/** @brief The seek bar position on the Y axis. */
#define SEEKBAR_Y (VISIBLE_AREA_Y1 - SEEKBAR_HEIGHT - 80) #define SEEKBAR_Y (VISIBLE_AREA_Y1 - SEEKBAR_HEIGHT - 80)
/** @brief The loader bar width. */
#define LOADER_WIDTH (320) #define LOADER_WIDTH (320)
/** @brief The loader bar height. */
#define LOADER_HEIGHT (24) #define LOADER_HEIGHT (24)
/** @brief The loader bar position on the X axis. */
#define LOADER_X (DISPLAY_CENTER_X - (LOADER_WIDTH / 2)) #define LOADER_X (DISPLAY_CENTER_X - (LOADER_WIDTH / 2))
/** @brief The loader bar position on the Y axis. */
#define LOADER_Y (DISPLAY_CENTER_Y - (LOADER_HEIGHT / 2)) #define LOADER_Y (DISPLAY_CENTER_Y - (LOADER_HEIGHT / 2))
/** @brief The maximum width of a message box. */
#define MESSAGEBOX_MAX_WIDTH (360) #define MESSAGEBOX_MAX_WIDTH (360)
/** @brief The margin of a message box. */
#define MESSAGEBOX_MARGIN (32) #define MESSAGEBOX_MARGIN (32)
#define TEXT_MARGIN_HORIZONTAL (10) #define TEXT_MARGIN_HORIZONTAL (10)
#define TEXT_MARGIN_VERTICAL (7) #define TEXT_MARGIN_VERTICAL (7)
/** @brief The boxart picture width. */
#define BOXART_WIDTH (158) #define BOXART_WIDTH (158)
/** @brief The boxart picture height. */
#define BOXART_HEIGHT (112) #define BOXART_HEIGHT (112)
/** @brief The box art position on the X axis. */
#define BOXART_X (VISIBLE_AREA_X1 - BOXART_WIDTH - 24) #define BOXART_X (VISIBLE_AREA_X1 - BOXART_WIDTH - 24)
/** @brief The box art position on the Y axis. */
#define BOXART_Y (LAYOUT_ACTIONS_SEPARATOR_Y - BOXART_HEIGHT - 24) #define BOXART_Y (LAYOUT_ACTIONS_SEPARATOR_Y - BOXART_HEIGHT - 24)
/** @brief The scroll bar width. */
#define FILE_LIST_SCROLLBAR_WIDTH (12) #define FILE_LIST_SCROLLBAR_WIDTH (12)
/** @brief The scroll bar height. */
#define FILE_LIST_SCROLLBAR_HEIGHT (LAYOUT_ACTIONS_SEPARATOR_Y - OVERSCAN_HEIGHT) #define FILE_LIST_SCROLLBAR_HEIGHT (LAYOUT_ACTIONS_SEPARATOR_Y - OVERSCAN_HEIGHT)
/** @brief The scroll bar position on the X axis. */
#define FILE_LIST_SCROLLBAR_X (VISIBLE_AREA_X1 - FILE_LIST_SCROLLBAR_WIDTH) #define FILE_LIST_SCROLLBAR_X (VISIBLE_AREA_X1 - FILE_LIST_SCROLLBAR_WIDTH)
/** @brief The scroll bar position on the Y axis. */
#define FILE_LIST_SCROLLBAR_Y (VISIBLE_AREA_Y0) #define FILE_LIST_SCROLLBAR_Y (VISIBLE_AREA_Y0)
/** @brief The maximum amount of file list entries. */
#define FILE_LIST_ENTRIES (20) #define FILE_LIST_ENTRIES (20)
/** @brief The maximum width available for a file list entry. */
#define FILE_LIST_MAX_WIDTH (480) #define FILE_LIST_MAX_WIDTH (480)
#define FILE_LIST_HIGHLIGHT_WIDTH (VISIBLE_AREA_X1 - VISIBLE_AREA_X0 - FILE_LIST_SCROLLBAR_WIDTH) #define FILE_LIST_HIGHLIGHT_WIDTH (VISIBLE_AREA_X1 - VISIBLE_AREA_X0 - FILE_LIST_SCROLLBAR_WIDTH)
#define FILE_LIST_HIGHLIGHT_X (VISIBLE_AREA_X0) #define FILE_LIST_HIGHLIGHT_X (VISIBLE_AREA_X0)
/** @brief The default background colour. */
#define BACKGROUND_EMPTY_COLOR RGBA32(0x00, 0x00, 0x00, 0xFF) #define BACKGROUND_EMPTY_COLOR RGBA32(0x00, 0x00, 0x00, 0xFF)
/** @brief The default background overlay colour. */
#define BACKGROUND_OVERLAY_COLOR RGBA32(0x00, 0x00, 0x00, 0xA0) #define BACKGROUND_OVERLAY_COLOR RGBA32(0x00, 0x00, 0x00, 0xA0)
/** @brief The border colour. */
#define BORDER_COLOR RGBA32(0xFF, 0xFF, 0xFF, 0xFF) #define BORDER_COLOR RGBA32(0xFF, 0xFF, 0xFF, 0xFF)
/** @brief The progress bar background colour. */
#define PROGRESSBAR_BG_COLOR RGBA32(0x00, 0x00, 0x00, 0xFF) #define PROGRESSBAR_BG_COLOR RGBA32(0x00, 0x00, 0x00, 0xFF)
/** @brief The progress bar progressed colour. */
#define PROGRESSBAR_DONE_COLOR RGBA32(0x3B, 0x7C, 0xF5, 0xFF) #define PROGRESSBAR_DONE_COLOR RGBA32(0x3B, 0x7C, 0xF5, 0xFF)
/** @brief The scroll bar background colour. */
#define SCROLLBAR_BG_COLOR RGBA32(0x3F, 0x3F, 0x3F, 0xFF) #define SCROLLBAR_BG_COLOR RGBA32(0x3F, 0x3F, 0x3F, 0xFF)
/** @brief The scroll bar inactive colour. */
#define SCROLLBAR_INACTIVE_COLOR RGBA32(0x5F, 0x5F, 0x5F, 0xFF) #define SCROLLBAR_INACTIVE_COLOR RGBA32(0x5F, 0x5F, 0x5F, 0xFF)
/** @brief The scroll bar position colour. */
#define SCROLLBAR_POSITION_COLOR RGBA32(0x7F, 0x7F, 0x7F, 0xFF) #define SCROLLBAR_POSITION_COLOR RGBA32(0x7F, 0x7F, 0x7F, 0xFF)
/** @brief The dialogue background colour. */
#define DIALOG_BG_COLOR RGBA32(0x00, 0x00, 0x00, 0xFF) #define DIALOG_BG_COLOR RGBA32(0x00, 0x00, 0x00, 0xFF)
/** @brief The boxart loading colour. */
#define BOXART_LOADING_COLOR RGBA32(0x3F, 0x3F, 0x3F, 0xFF) #define BOXART_LOADING_COLOR RGBA32(0x3F, 0x3F, 0x3F, 0xFF)
/** @brief The filelist highlight colour. */
#define FILE_LIST_HIGHLIGHT_COLOR RGBA32(0x3F, 0x3F, 0x3F, 0xFF) #define FILE_LIST_HIGHLIGHT_COLOR RGBA32(0x3F, 0x3F, 0x3F, 0xFF)
/** @brief The menu highlight colour. */
#define CONTEXT_MENU_HIGHLIGHT_COLOR RGBA32(0x3F, 0x3F, 0x3F, 0xFF) #define CONTEXT_MENU_HIGHLIGHT_COLOR RGBA32(0x3F, 0x3F, 0x3F, 0xFF)

View File

@ -11,7 +11,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
/** @brief Disk state enumeration. */
typedef enum { typedef enum {
DISK_OK, DISK_OK,
DISK_ERR_IO, DISK_ERR_IO,
@ -19,12 +19,14 @@ typedef enum {
DISK_ERR_INVALID, DISK_ERR_INVALID,
} disk_err_t; } disk_err_t;
/** @brief Disk region enumeration. */
typedef enum { typedef enum {
DISK_REGION_DEVELOPMENT, DISK_REGION_DEVELOPMENT,
DISK_REGION_JAPANESE, DISK_REGION_JAPANESE,
DISK_REGION_USA, DISK_REGION_USA,
} disk_region_t; } disk_region_t;
/** @brief Disk type enumeration. */
typedef enum { typedef enum {
DISK_TYPE_0, DISK_TYPE_0,
DISK_TYPE_1, DISK_TYPE_1,
@ -35,6 +37,7 @@ typedef enum {
DISK_TYPE_6, DISK_TYPE_6,
} disk_type_t; } disk_type_t;
/** @brief Disk Information Structure. */
typedef struct { typedef struct {
disk_region_t region; disk_region_t region;
disk_type_t disk_type; disk_type_t disk_type;

View File

@ -7,11 +7,12 @@
#ifndef FONTS_H__ #ifndef FONTS_H__
#define FONTS_H__ #define FONTS_H__
/** @brief Font type enumeration. */
typedef enum { typedef enum {
FNT_DEFAULT = 1, FNT_DEFAULT = 1,
} menu_font_type_t; } menu_font_type_t;
/** @brief Font style enumeration. */
typedef enum { typedef enum {
STL_DEFAULT = 0, STL_DEFAULT = 0,
STL_DIRECTORY, STL_DIRECTORY,

View File

@ -15,6 +15,7 @@
#define SEEK_PREDECODE_FRAMES (5) #define SEEK_PREDECODE_FRAMES (5)
/** @brief MP3 File Information Structure. */
typedef struct { typedef struct {
bool loaded; bool loaded;
bool io_error; bool io_error;

View File

@ -1,5 +1,5 @@
/** /**
* @file mp3player.h * @file mp3_player.h
* @brief MP3 Player * @brief MP3 Player
* @ingroup menu * @ingroup menu
*/ */

View File

@ -4,7 +4,7 @@
#include "png_decoder.h" #include "png_decoder.h"
#include "utils/fs.h" #include "utils/fs.h"
/** @brief PNG File Information Structure. */
typedef struct { typedef struct {
FIL fil; FIL fil;

View File

@ -1,5 +1,5 @@
/** /**
* @file png.h * @file png_decoder.h
* @brief PNG decoder * @brief PNG decoder
* @ingroup menu * @ingroup menu
*/ */

View File

@ -15,7 +15,7 @@
#define CLOCK_RATE_DEFAULT (0x0000000F) #define CLOCK_RATE_DEFAULT (0x0000000F)
/** @brief ROM File Information Structure. */
typedef struct __attribute__((packed)) { typedef struct __attribute__((packed)) {
uint32_t pi_dom1_config; uint32_t pi_dom1_config;
uint32_t clock_rate; uint32_t clock_rate;
@ -41,6 +41,7 @@ typedef struct __attribute__((packed)) {
uint8_t ipl3[IPL3_LENGTH]; uint8_t ipl3[IPL3_LENGTH];
} rom_header_t; } rom_header_t;
/** @brief ROM Information Match Type Enumeration. */
typedef enum { typedef enum {
// Check only game code // Check only game code
MATCH_TYPE_ID, MATCH_TYPE_ID,

View File

@ -14,16 +14,20 @@
#include "boot/cic.h" #include "boot/cic.h"
/** @brief ROM error enumeration. */
typedef enum { typedef enum {
ROM_OK, ROM_OK,
ROM_ERR_IO, ROM_ERR_IO,
ROM_ERR_NO_FILE, ROM_ERR_NO_FILE,
} rom_err_t; } rom_err_t;
/** @brief ROM endian enumeration. */
typedef enum { typedef enum {
/** @brief Is Big Endian. */
ENDIANNESS_BIG, ENDIANNESS_BIG,
/** @brief Is Little Endian. */
ENDIANNESS_LITTLE, ENDIANNESS_LITTLE,
/** @brief Is Byte Swapped Endian. */
ENDIANNESS_BYTE_SWAP, ENDIANNESS_BYTE_SWAP,
} endianness_t; } endianness_t;
@ -85,7 +89,9 @@ typedef enum {
MARKET_OTHER_Z = 'Z' // no known ROM's use this. MARKET_OTHER_Z = 'Z' // no known ROM's use this.
} destination_type_t; } destination_type_t;
/** @brief ROM save type enumeration. */
typedef enum { typedef enum {
/** @brief There is no expected save type. */
SAVE_TYPE_NONE, SAVE_TYPE_NONE,
SAVE_TYPE_EEPROM_4K, SAVE_TYPE_EEPROM_4K,
SAVE_TYPE_EEPROM_16K, SAVE_TYPE_EEPROM_16K,
@ -96,6 +102,7 @@ typedef enum {
SAVE_TYPE_FLASHRAM_PKST2, SAVE_TYPE_FLASHRAM_PKST2,
} save_type_t; } save_type_t;
/** @brief ROM memory requirements enumeration. */
typedef enum { typedef enum {
/** @brief The ROM is happy with 4MB of memory. */ /** @brief The ROM is happy with 4MB of memory. */
EXPANSION_PAK_NONE, EXPANSION_PAK_NONE,
@ -113,30 +120,45 @@ typedef enum {
EXPANSION_PAK_FAULTY, EXPANSION_PAK_FAULTY,
} expansion_pak_t; } expansion_pak_t;
/** @brief ROM Information Structure. */
typedef struct { typedef struct {
/** @brief The file endian. */
endianness_t endianness; endianness_t endianness;
/** @brief The clock rate defined in the ROM's header. */
float clock_rate; float clock_rate;
/** @brief The boot address defined in the ROM's header. */
uint32_t boot_address; uint32_t boot_address;
struct { struct {
/** @brief The SDK version defined in the ROM's header. */
uint8_t version; uint8_t version;
/** @brief The SDK revision defined in the ROM's header. */
char revision; char revision;
} libultra; } libultra;
/** @brief The check code defined in the ROM's header. */
uint64_t check_code; uint64_t check_code;
/** @brief The title defined in the ROM's header. */
char title[20]; char title[20];
union { union {
/** @brief The game code defined in the ROM's header. */
char game_code[4]; char game_code[4];
struct { struct {
/** @brief The game media type. */
category_type_t category_code : 8; category_type_t category_code : 8;
/** @brief The game unique identifier. */
char unique_code[2]; char unique_code[2];
/** @brief The game region and or market. */
destination_type_t destination_code : 8; destination_type_t destination_code : 8;
}; };
}; };
/** @brief The ROM version defined in the ROM's header. */
uint8_t version; uint8_t version;
cic_type_t cic_type; cic_type_t cic_type;
/** @brief The save type required by the ROM. */
save_type_t save_type; save_type_t save_type;
/** @brief The supported ROM accessories. */
struct { struct {
bool controller_pak; bool controller_pak;
bool rumble_pak; bool rumble_pak;

View File

@ -39,8 +39,9 @@ typedef struct {
} settings_t; } settings_t;
/** @brief The settings to load */
void settings_load (settings_t *settings); void settings_load (settings_t *settings);
/** @brief The settings to save */
void settings_save (settings_t *settings); void settings_save (settings_t *settings);

View File

@ -12,9 +12,11 @@
#define MAX_FILE_SIZE MiB(4) #define MAX_FILE_SIZE MiB(4)
/** @brief The supported USB commands structure. */
typedef struct { typedef struct {
/** @brief The command identifier. */
const char *id; const char *id;
/** @brief The command operation. */
void (*op) (menu_t *menu); void (*op) (menu_t *menu);
} usb_comm_command_t; } usb_comm_command_t;

View File

@ -2,7 +2,7 @@
#ifndef MENU_VERSION #ifndef MENU_VERSION
#define MENU_VERSION "0.0.0.5.ALPHA" #define MENU_VERSION "0.0.0.6.ALPHA"
#endif #endif