From 07fd93cb2a340f2a0b40d61ec9f87d3f3ad20925 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Fri, 10 Nov 2023 16:39:09 +0000 Subject: [PATCH] Documentation updates (#65) ## Description ## Motivation and Context ## How Has This Been Tested? ## Screenshots ## Types of changes - [ ] Improvement (non-breaking change that adds a new feature) - [ ] Bug fix (fixes an issue) - [ ] Breaking change (breaking change) - [ ] Config and build (change in the configuration and build system, has no impact on code or features) ## Checklist: - [ ] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [ ] I have added tests to cover my changes. - [ ] All new and existing tests passed. Signed-off-by: GITHUB_USER --- README.md | 4 ++- src/boot/boot_io.h | 46 ++++++++++++++++++++++++----- src/flashcart/64drive/64drive_ll.h | 6 +++- src/flashcart/flashcart.h | 11 +++++++ src/flashcart/sc64/README.md | 5 ++++ src/flashcart/sc64/sc64_ll.c | 2 ++ src/flashcart/sc64/sc64_ll.h | 5 +++- src/menu/cart_load.h | 20 ++++++++++++- src/menu/components.h | 1 + src/menu/components/constants.h | 47 ++++++++++++++++++++++++++++-- src/menu/disk_info.h | 5 +++- src/menu/fonts.h | 3 +- src/menu/mp3_player.c | 1 + src/menu/mp3_player.h | 2 +- src/menu/png_decoder.c | 2 +- src/menu/png_decoder.h | 2 +- src/menu/rom_info.c | 3 +- src/menu/rom_info.h | 24 ++++++++++++++- src/menu/settings.h | 3 +- src/menu/usb_comm.c | 4 ++- 20 files changed, 174 insertions(+), 22 deletions(-) create mode 100644 src/flashcart/sc64/README.md diff --git a/README.md b/README.md index 9d7258b5..31096ae8 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,9 @@ To update to the latest version, use `git submodule update --remote ` from the t # Generate documentation Run `doxygen` from the dev container terminal. 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 - [libdragon](https://github.com/DragonMinded/libdragon) (UNLICENSE License) diff --git a/src/boot/boot_io.h b/src/boot/boot_io.h index 547a6630..a251cd9b 100644 --- a/src/boot/boot_io.h +++ b/src/boot/boot_io.h @@ -18,7 +18,7 @@ typedef volatile uint32_t io32_t; #define UNCACHED(address) ((typeof(address)) (((io32_t) (address)) | (0xA0000000UL))) - +/** @brief Memory Structure. */ typedef struct { io32_t DMEM[1024]; io32_t IMEM[1024]; @@ -27,7 +27,7 @@ typedef struct { #define SP_MEM_BASE (0x04000000UL) #define SP_MEM ((sp_mem_t *) SP_MEM_BASE) - +/** @brief SP Registers Structure. */ typedef struct { io32_t PADDR; io32_t MADDR; @@ -86,7 +86,7 @@ typedef struct { #define SP_SR_SET_SIG7 (1 << 24) -/** @brief DPC Registers Structure */ +/** @brief DPC Registers Structure. */ typedef struct { io32_t START; io32_t END; @@ -124,21 +124,35 @@ typedef struct { #define DPC_SR_CLR_CLOCK_CTR (1 << 9) -/** @brief Video Interface Registers Structure */ +/** @brief Video Interface Registers Structure. */ typedef struct { + /** @brief The Control Register. */ io32_t CR; + /** @brief The Memory Address. */ io32_t MADDR; + /** @brief The Horizontal Width. */ io32_t H_WIDTH; + /** @brief The Virtical Interupt. */ io32_t V_INTR; + /** @brief The Current Line. */ io32_t CURR_LINE; + /** @brief The Timings. */ io32_t TIMING; + /** @brief The Virtical Sync. */ io32_t V_SYNC; + /** @brief The Horizontal Sync. */ io32_t H_SYNC; + /** @brief The Horizontal Sync Leap. */ io32_t H_SYNC_LEAP; + /** @brief The Horizontal Limits. */ io32_t H_LIMITS; + /** @brief The Virtical Limits. */ io32_t V_LIMITS; + /** @brief The Colour Burst. */ io32_t COLOR_BURST; + /** @brief The Horizontal Scale. */ io32_t H_SCALE; + /** @brief The Virtical Scale. */ io32_t V_SCALE; } vi_regs_t; @@ -161,13 +175,19 @@ typedef struct { #define VI_CURR_LINE_FIELD (1 << 0) - +/** @brief Audio Interface Registers Structure. */ typedef struct { + /** @brief The Memory Address. */ io32_t MADDR; + /** @brief The Length of bytes. */ io32_t LEN; + /** @brief The Control Register. */ io32_t CR; + /** @brief The Status Register. */ io32_t SR; + /** @brief The DAC rate. */ io32_t DACRATE; + /** @brief The bit rate. */ io32_t BITRATE; } ai_regs_t; @@ -179,17 +199,27 @@ typedef struct { #define AI_CR_DMA_ON (1 << 0) -/** @brief Parallel Interface Register Structure */ +/** @brief Peripheral Interface Register Structure. */ typedef struct { + /** @brief The Memory Address. */ io32_t MADDR; + /** @brief The Cart Address. */ io32_t PADDR; + /** @brief The Read Length. */ io32_t RDMA; + /** @brief The Write Length. */ io32_t WDMA; + /** @brief The Status Register. */ io32_t SR; + /** @brief The Domain 2 Registers. */ struct { + /** @brief The Latch Value. */ io32_t LAT; + /** @brief The Pulse Width Value. */ io32_t PWD; + /** @brief The Page Size Value. */ io32_t PGS; + /** @brief The Release Value. */ io32_t RLS; } DOM[2]; } pi_regs_t; @@ -211,7 +241,7 @@ typedef struct { #define ROM_CART_BASE (0x10000000UL) #define ROM_CART ((io32_t *) ROM_CART_BASE) - +/** @brief OS Information Structure. */ typedef struct { uint32_t tv_type; uint32_t device_type; @@ -228,7 +258,9 @@ typedef struct { #define OS_INFO_BASE (0x80000300UL) #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) +/** @brief The Console was reset using the reset button. */ #define OS_INFO_RESET_TYPE_NMI (1) diff --git a/src/flashcart/64drive/64drive_ll.h b/src/flashcart/64drive/64drive_ll.h index 44d9ee5f..a16d78a1 100644 --- a/src/flashcart/64drive/64drive_ll.h +++ b/src/flashcart/64drive/64drive_ll.h @@ -17,6 +17,7 @@ * @{ */ +/** @brief Registers Structure. */ typedef struct { uint8_t BUFFER[512]; uint32_t STATUS; @@ -54,18 +55,20 @@ typedef struct { uint32_t WRITEBACK[256]; } d64_regs_t; +/** @brief Registers Base Address. */ #define D64_REGS_BASE (0x18000000UL) #define D64_REGS_BASE_EXT (0x1F800000UL) #define D64_REGS ((d64_regs_t *) D64_REGS_BASE) #define D64_REGS_EXT ((d64_regs_t *) D64_REGS_BASE_EXT) - +/** @brief Device Variant Enumeration. */ typedef enum { DEVICE_VARIANT_UNKNOWN = 0x0000, DEVICE_VARIANT_A = 0x4100, DEVICE_VARIANT_B = 0x4200, } d64_device_variant_t; +/** @brief TV Type Enumeration. */ typedef enum { TV_TYPE_PAL = 0, TV_TYPE_NTSC = 1, @@ -73,6 +76,7 @@ typedef enum { TV_TYPE_UNKNOWN = 3, } d64_tv_type_t; +/** @brief Save Type Enumeration. */ typedef enum { SAVE_TYPE_NONE, SAVE_TYPE_EEPROM_4K, diff --git a/src/flashcart/flashcart.h b/src/flashcart/flashcart.h index 3a22c8ac..0e97e807 100644 --- a/src/flashcart/flashcart.h +++ b/src/flashcart/flashcart.h @@ -42,6 +42,7 @@ typedef enum { __FLASHCART_SAVE_TYPE_END } flashcart_save_type_t; +/** @brief Flashcart Disk Parameter Structure. */ typedef struct { bool development_drive; uint8_t disk_type; @@ -53,15 +54,25 @@ typedef void flashcart_progress_callback_t (float progress); /** @brief Flashcart Structure */ typedef struct { + /** @brief The flashcart initialization function */ flashcart_err_t (*init) (void); + /** @brief The flashcart de-initialization function */ flashcart_err_t (*deinit) (void); + /** @brief The flashcart feature function */ 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); + /** @brief The flashcart file load function */ 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); + /** @brief The flashcart disk bios load function */ 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); + /** @brief The flashcart set save type function */ 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_t; diff --git a/src/flashcart/sc64/README.md b/src/flashcart/sc64/README.md new file mode 100644 index 00000000..5071466f --- /dev/null +++ b/src/flashcart/sc64/README.md @@ -0,0 +1,5 @@ +## SummerCart64 developer notes + +### Official documentation + +https://github.com/Polprzewodnikowy/SummerCart64/tree/main/docs diff --git a/src/flashcart/sc64/sc64_ll.c b/src/flashcart/sc64/sc64_ll.c index 4d6f659e..1ab65bd1 100644 --- a/src/flashcart/sc64/sc64_ll.c +++ b/src/flashcart/sc64/sc64_ll.c @@ -4,6 +4,7 @@ #include "sc64_ll.h" +/** @brief SummerCart64 Registers Structure. */ typedef struct { uint32_t SR_CMD; uint32_t DATA[2]; @@ -31,6 +32,7 @@ typedef enum { CMD_ID_FLASH_ERASE_BLOCK = 'P', } sc64_cmd_id_t; +/** @brief SummerCart64 Commands Structure. */ typedef struct { sc64_cmd_id_t id; uint32_t arg[2]; diff --git a/src/flashcart/sc64/sc64_ll.h b/src/flashcart/sc64/sc64_ll.h index 38e159e3..d385693f 100644 --- a/src/flashcart/sc64/sc64_ll.h +++ b/src/flashcart/sc64/sc64_ll.h @@ -17,6 +17,7 @@ * @{ */ +/** @brief The SC64 buffers structure. */ typedef struct { uint8_t BUFFER[8192]; uint8_t EEPROM[2048]; @@ -27,7 +28,7 @@ typedef struct { #define SC64_BUFFERS_BASE (0x1FFE0000UL) #define SC64_BUFFERS ((sc64_buffers_t *) SC64_BUFFERS_BASE) - +/** @brief The SC64 State Enumeration. */ typedef enum { SC64_OK, SC64_ERROR_BAD_ARGUMENT, @@ -63,6 +64,7 @@ typedef enum { DD_MODE_FULL = 3 } sc64_dd_mode_t; +/** @brief The SC64 Boot Mode Enumeration. */ typedef enum { BOOT_MODE_MENU = 0, BOOT_MODE_ROM = 1, @@ -71,6 +73,7 @@ typedef enum { BOOT_MODE_DIRECT_DDIPL = 4, } sc64_boot_mode_t; +/** @brief The SC64 Save Type Enumeration. */ typedef enum { SAVE_TYPE_NONE, SAVE_TYPE_EEPROM_4K, diff --git a/src/menu/cart_load.h b/src/menu/cart_load.h index c3fa7d7a..04c2c679 100644 --- a/src/menu/cart_load.h +++ b/src/menu/cart_load.h @@ -13,28 +13,46 @@ #include "menu_state.h" #include "rom_info.h" - +/** @brief Cart load state enumeration. */ typedef enum { + /** @brief Returned no error. */ CART_LOAD_OK, + /** @brief Failed to load the ROM correctly. */ CART_LOAD_ERR_ROM_LOAD_FAIL, + /** @brief Failed to load the save correctly. */ CART_LOAD_ERR_SAVE_LOAD_FAIL, + /** @brief The 64DD is available for use. */ CART_LOAD_ERR_64DD_PRESENT, + /** @brief Failed to find the 64DD IPL (BIOS) file. */ CART_LOAD_ERR_64DD_IPL_NOT_FOUND, + /** @brief Failed to load the 64DD IPL (BIOS) file. */ CART_LOAD_ERR_64DD_IPL_LOAD_FAIL, + /** @brief Failed to find the 64DD disk. */ CART_LOAD_ERR_64DD_DISK_LOAD_FAIL, + /** @brief Failed to find the emulator required. */ CART_LOAD_ERR_EMU_NOT_FOUND, + /** @brief Failed to load the emulator required. */ CART_LOAD_ERR_EMU_LOAD_FAIL, CART_LOAD_ERR_EMU_ROM_LOAD_FAIL, + /** @brief Failed to create the save sub-directory. */ 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, + /** @brief An unexpected response. */ CART_LOAD_ERR_FUNCTION_NOT_SUPPORTED, } cart_load_err_t; +/** @brief Cart load type enumeration */ typedef enum { + /** @brief The ROM is designed for a Nintendo Entertainment System or Famicom. */ CART_LOAD_EMU_TYPE_NES, + /** @brief The ROM is designed for a Super Nintendo Entertainment System or Super Famicom. */ CART_LOAD_EMU_TYPE_SNES, + /** @brief The ROM is designed for a Nintendo Gameboy. */ CART_LOAD_EMU_TYPE_GAMEBOY, + /** @brief The ROM is designed for a Nintendo 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_t; diff --git a/src/menu/components.h b/src/menu/components.h index 3a03a1d2..2a442f44 100644 --- a/src/menu/components.h +++ b/src/menu/components.h @@ -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); void component_context_menu_draw (component_context_menu_t *cm); +/** @brief Box Art Structure. */ typedef struct { bool loading; surface_t *image; diff --git a/src/menu/components/constants.h b/src/menu/components/constants.h index 2faa11a7..7522d461 100644 --- a/src/menu/components/constants.h +++ b/src/menu/components/constants.h @@ -7,78 +7,121 @@ #ifndef COMPONENTS_CONSTANTS_H__ #define COMPONENTS_CONSTANTS_H__ - +/** @brief The display width. */ #define DISPLAY_WIDTH (640) +/** @brief The display height. */ #define DISPLAY_HEIGHT (480) +/** @brief The centre of the display on the X axis. */ #define DISPLAY_CENTER_X (DISPLAY_WIDTH / 2) +/** @brief The centre of the display on the Y axis. */ #define DISPLAY_CENTER_Y (DISPLAY_HEIGHT / 2) +/** @brief The overscan on the X axis. */ #define OVERSCAN_WIDTH (32) +/** @brief The overscan on the Y axis. */ #define OVERSCAN_HEIGHT (24) +/** @brief The start position of the visible display on the X axis. */ #define VISIBLE_AREA_X0 (OVERSCAN_WIDTH) +/** @brief The start position of the visible display on the Y axis. */ #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) +/** @brief The end position of the visible display on the Y axis. */ #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) +/** @brief The height of the visible display. */ #define VISIBLE_AREA_HEIGHT (VISIBLE_AREA_Y1 - VISIBLE_AREA_Y0) +/** @brief The thickness of borders. */ #define BORDER_THICKNESS (4) #define LAYOUT_ACTIONS_SEPARATOR_Y (400) +/** @brief The seek bar height. */ #define SEEKBAR_HEIGHT (24) +/** @brief The seek bar width. */ #define SEEKBAR_WIDTH (524) +/** @brief The seek bar position on the X axis. */ #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) +/** @brief The loader bar width. */ #define LOADER_WIDTH (320) +/** @brief The loader bar height. */ #define LOADER_HEIGHT (24) +/** @brief The loader bar position on the X axis. */ #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)) +/** @brief The maximum width of a message box. */ #define MESSAGEBOX_MAX_WIDTH (360) +/** @brief The margin of a message box. */ #define MESSAGEBOX_MARGIN (32) #define TEXT_MARGIN_HORIZONTAL (10) #define TEXT_MARGIN_VERTICAL (7) +/** @brief The boxart picture width. */ #define BOXART_WIDTH (158) +/** @brief The boxart picture height. */ #define BOXART_HEIGHT (112) +/** @brief The box art position on the X axis. */ #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) +/** @brief The scroll bar width. */ #define FILE_LIST_SCROLLBAR_WIDTH (12) +/** @brief The scroll bar 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) +/** @brief The scroll bar position on the Y axis. */ #define FILE_LIST_SCROLLBAR_Y (VISIBLE_AREA_Y0) +/** @brief The maximum amount of file list entries. */ #define FILE_LIST_ENTRIES (20) +/** @brief The maximum width available for a file list entry. */ #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_X (VISIBLE_AREA_X0) - +/** @brief The default background colour. */ #define BACKGROUND_EMPTY_COLOR RGBA32(0x00, 0x00, 0x00, 0xFF) +/** @brief The default background overlay colour. */ #define BACKGROUND_OVERLAY_COLOR RGBA32(0x00, 0x00, 0x00, 0xA0) +/** @brief The border colour. */ #define BORDER_COLOR RGBA32(0xFF, 0xFF, 0xFF, 0xFF) +/** @brief The progress bar background colour. */ #define PROGRESSBAR_BG_COLOR RGBA32(0x00, 0x00, 0x00, 0xFF) +/** @brief The progress bar progressed colour. */ #define PROGRESSBAR_DONE_COLOR RGBA32(0x3B, 0x7C, 0xF5, 0xFF) +/** @brief The scroll bar background colour. */ #define SCROLLBAR_BG_COLOR RGBA32(0x3F, 0x3F, 0x3F, 0xFF) +/** @brief The scroll bar inactive colour. */ #define SCROLLBAR_INACTIVE_COLOR RGBA32(0x5F, 0x5F, 0x5F, 0xFF) +/** @brief The scroll bar position colour. */ #define SCROLLBAR_POSITION_COLOR RGBA32(0x7F, 0x7F, 0x7F, 0xFF) +/** @brief The dialogue background colour. */ #define DIALOG_BG_COLOR RGBA32(0x00, 0x00, 0x00, 0xFF) +/** @brief The boxart loading colour. */ #define BOXART_LOADING_COLOR RGBA32(0x3F, 0x3F, 0x3F, 0xFF) +/** @brief The filelist highlight colour. */ #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) diff --git a/src/menu/disk_info.h b/src/menu/disk_info.h index 12b7ab4b..ae35be69 100644 --- a/src/menu/disk_info.h +++ b/src/menu/disk_info.h @@ -11,7 +11,7 @@ #include #include - +/** @brief Disk state enumeration. */ typedef enum { DISK_OK, DISK_ERR_IO, @@ -19,12 +19,14 @@ typedef enum { DISK_ERR_INVALID, } disk_err_t; +/** @brief Disk region enumeration. */ typedef enum { DISK_REGION_DEVELOPMENT, DISK_REGION_JAPANESE, DISK_REGION_USA, } disk_region_t; +/** @brief Disk type enumeration. */ typedef enum { DISK_TYPE_0, DISK_TYPE_1, @@ -35,6 +37,7 @@ typedef enum { DISK_TYPE_6, } disk_type_t; +/** @brief Disk Information Structure. */ typedef struct { disk_region_t region; disk_type_t disk_type; diff --git a/src/menu/fonts.h b/src/menu/fonts.h index 1c69a5a5..2e006efc 100644 --- a/src/menu/fonts.h +++ b/src/menu/fonts.h @@ -7,11 +7,12 @@ #ifndef FONTS_H__ #define FONTS_H__ - +/** @brief Font type enumeration. */ typedef enum { FNT_DEFAULT = 1, } menu_font_type_t; +/** @brief Font style enumeration. */ typedef enum { STL_DEFAULT = 0, STL_DIRECTORY, diff --git a/src/menu/mp3_player.c b/src/menu/mp3_player.c index bf5ded4f..3dfbd7da 100644 --- a/src/menu/mp3_player.c +++ b/src/menu/mp3_player.c @@ -15,6 +15,7 @@ #define SEEK_PREDECODE_FRAMES (5) +/** @brief MP3 File Information Structure. */ typedef struct { bool loaded; bool io_error; diff --git a/src/menu/mp3_player.h b/src/menu/mp3_player.h index 72887be2..baea06bf 100644 --- a/src/menu/mp3_player.h +++ b/src/menu/mp3_player.h @@ -1,5 +1,5 @@ /** - * @file mp3player.h + * @file mp3_player.h * @brief MP3 Player * @ingroup menu */ diff --git a/src/menu/png_decoder.c b/src/menu/png_decoder.c index 43c2ada5..951057b6 100644 --- a/src/menu/png_decoder.c +++ b/src/menu/png_decoder.c @@ -4,7 +4,7 @@ #include "png_decoder.h" #include "utils/fs.h" - +/** @brief PNG File Information Structure. */ typedef struct { FIL fil; diff --git a/src/menu/png_decoder.h b/src/menu/png_decoder.h index a769ddd3..ea7977f7 100644 --- a/src/menu/png_decoder.h +++ b/src/menu/png_decoder.h @@ -1,5 +1,5 @@ /** - * @file png.h + * @file png_decoder.h * @brief PNG decoder * @ingroup menu */ diff --git a/src/menu/rom_info.c b/src/menu/rom_info.c index 5e3e084d..0910cf22 100644 --- a/src/menu/rom_info.c +++ b/src/menu/rom_info.c @@ -15,7 +15,7 @@ #define CLOCK_RATE_DEFAULT (0x0000000F) - +/** @brief ROM File Information Structure. */ typedef struct __attribute__((packed)) { uint32_t pi_dom1_config; uint32_t clock_rate; @@ -41,6 +41,7 @@ typedef struct __attribute__((packed)) { uint8_t ipl3[IPL3_LENGTH]; } rom_header_t; +/** @brief ROM Information Match Type Enumeration. */ typedef enum { // Check only game code MATCH_TYPE_ID, diff --git a/src/menu/rom_info.h b/src/menu/rom_info.h index a2322ff7..c9aed539 100644 --- a/src/menu/rom_info.h +++ b/src/menu/rom_info.h @@ -14,16 +14,20 @@ #include "boot/cic.h" - +/** @brief ROM error enumeration. */ typedef enum { ROM_OK, ROM_ERR_IO, ROM_ERR_NO_FILE, } rom_err_t; +/** @brief ROM endian enumeration. */ typedef enum { + /** @brief Is Big Endian. */ ENDIANNESS_BIG, + /** @brief Is Little Endian. */ ENDIANNESS_LITTLE, + /** @brief Is Byte Swapped Endian. */ ENDIANNESS_BYTE_SWAP, } endianness_t; @@ -85,7 +89,9 @@ typedef enum { MARKET_OTHER_Z = 'Z' // no known ROM's use this. } destination_type_t; +/** @brief ROM save type enumeration. */ typedef enum { + /** @brief There is no expected save type. */ SAVE_TYPE_NONE, SAVE_TYPE_EEPROM_4K, SAVE_TYPE_EEPROM_16K, @@ -96,6 +102,7 @@ typedef enum { SAVE_TYPE_FLASHRAM_PKST2, } save_type_t; +/** @brief ROM memory requirements enumeration. */ typedef enum { /** @brief The ROM is happy with 4MB of memory. */ EXPANSION_PAK_NONE, @@ -113,30 +120,45 @@ typedef enum { EXPANSION_PAK_FAULTY, } expansion_pak_t; +/** @brief ROM Information Structure. */ typedef struct { + /** @brief The file endian. */ endianness_t endianness; + /** @brief The clock rate defined in the ROM's header. */ float clock_rate; + /** @brief The boot address defined in the ROM's header. */ uint32_t boot_address; struct { + /** @brief The SDK version defined in the ROM's header. */ uint8_t version; + /** @brief The SDK revision defined in the ROM's header. */ char revision; } libultra; + /** @brief The check code defined in the ROM's header. */ uint64_t check_code; + /** @brief The title defined in the ROM's header. */ char title[20]; union { + /** @brief The game code defined in the ROM's header. */ char game_code[4]; struct { + /** @brief The game media type. */ category_type_t category_code : 8; + /** @brief The game unique identifier. */ char unique_code[2]; + /** @brief The game region and or market. */ destination_type_t destination_code : 8; }; }; + /** @brief The ROM version defined in the ROM's header. */ uint8_t version; cic_type_t cic_type; + /** @brief The save type required by the ROM. */ save_type_t save_type; + /** @brief The supported ROM accessories. */ struct { bool controller_pak; bool rumble_pak; diff --git a/src/menu/settings.h b/src/menu/settings.h index 6206788c..20096d25 100644 --- a/src/menu/settings.h +++ b/src/menu/settings.h @@ -33,8 +33,9 @@ typedef struct { } settings_t; - +/** @brief The settings to load */ void settings_load (settings_t *settings); +/** @brief The settings to save */ void settings_save (settings_t *settings); diff --git a/src/menu/usb_comm.c b/src/menu/usb_comm.c index 5f81d457..c823a3bd 100644 --- a/src/menu/usb_comm.c +++ b/src/menu/usb_comm.c @@ -12,9 +12,11 @@ #define MAX_FILE_SIZE MiB(4) - +/** @brief The supported USB commands structure. */ typedef struct { + /** @brief The command identifier. */ const char *id; + /** @brief The command operation. */ void (*op) (menu_t *menu); } usb_comm_command_t;